]> Git Repo - linux.git/log
linux.git
7 years agoMerge tag 'gvt-next-2017-08-15' of https://github.com/01org/gvt-linux into drm-intel...
Daniel Vetter [Tue, 15 Aug 2017 10:52:38 +0000 (12:52 +0200)]
Merge tag 'gvt-next-2017-08-15' of https://github.com/01org/gvt-linux into drm-intel-next-queued

gvt-next-2017-08-15

gvt update for 4.14
- MMIO save/restore optimization (Changbin)
- Split workload scan vs. dispatch for more parallel exec (Ping)
- vGPU full 48bit ppgtt support (Joonas, Tina)
- vGPU hw id expose for perf (Zhenyu)
- other misc cleanup and fixes

Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Initialize 'data' in intel_dsi_dcs_backlight.c
Balasubramaniam, Hari Chand [Tue, 15 Aug 2017 02:05:46 +0000 (10:05 +0800)]
drm/i915: Initialize 'data' in intel_dsi_dcs_backlight.c

variable 'data' may be used uninitialized in this function. thus,
'function dcs_get_backlight' will return unwanted value/fail.

Thus, adding NULL initialized to 'data' variable will solve the return
failure happening.

v2: Change commit message to reflect upstream with proper message

Fixes: 90198355b83c ("drm/i915/dsi: Add DCS control for Panel PWM")
Cc: Jani Nikula <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Yetunde Adebisi <[email protected]>
Cc: Deepak M <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Balasubramaniam, Hari Chand <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/1502762746-191826-1-git-send-email-hari.chand.balasubramaniam@intel.com
7 years agodrm/i915/dp: Validate the compliance test link parameters
Manasi Navare [Thu, 8 Jun 2017 20:41:03 +0000 (13:41 -0700)]
drm/i915/dp: Validate the compliance test link parameters

Validate the compliance test link parameters when the compliance
test dpcd registers are read. Also validate them in compute_config
before using them since the max values might have been reduced
due to link training fallback.

If either the link rate or lane count is invalid, we still bail
from using the test parameters since the combination would not work
and instead use the fallback values.

v2:
* Added commit message to explain why we still bail when either of
of the params is invalid (Ville Syrjala)
* Add reason for validating in the comment (Jani Nikula)
* Also check if index >= 0 after validating (Jani Nikula)

Signed-off-by: Manasi Navare <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Ville Syrjala <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Tested-by: Nathan Ciobanu <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/dp: Generalize intel_dp_link_params function to accept arguments to be validated
Manasi Navare [Thu, 8 Jun 2017 20:41:02 +0000 (13:41 -0700)]
drm/i915/dp: Generalize intel_dp_link_params function to accept arguments to be validated

This function now takes the link rate and lane ocunt to be validated
as an argument so that this can be used for validating even the
compliance test link parameters.

Signed-off-by: Manasi Navare <[email protected]>
Cc: Ville Syrjala <[email protected]>
Cc: Jani Nikula <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Tested-by: Nathan Ciobanu <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/gvt: Fix guest i915 full ppgtt blocking issue
Tina Zhang [Mon, 14 Aug 2017 07:24:14 +0000 (15:24 +0800)]
drm/i915/gvt: Fix guest i915 full ppgtt blocking issue

Guest i915 full ppgtt functionality was blocking by an issue, which would
lead to gpu hardware hang. Guest i915 driver may update the ppgtt table
just before this workload is going to be submitted to the hardware by
device model. This case wasn't handled well by device model before, due
to the small time window between removing old ppgtt entry and adding the
new one. Errors occur when the workload is executed by hardware during
that small time window. This patch is to remove this time window by adding
the new ppgtt entry first and then remove the old one.

Changes in v2:
- Move VGT_CAPS_FULL_PPGTT introduction to patch 2/4. (Joonas)

Changes since v2:
- Divide the whole patch set into two separate patch series, with one
  patch in i915 side to check guest i915 full ppgtt capability and enable
  it when this capability is supported by the device model, and the other
  one in gvt side which fixs the blocking issue and enables the device
  model to provide the capability to guest. And this patch focuses on gvt
  side. (Joonas)
- Change the title from "reorder the shadow ppgtt update process by adding
  entry first" to "Fix guest i915 full ppgtt blocking issue". (Tina)

Changes since v3:
- Rebase to the latest branch.

Changes since v4:
- Tested by Tina Zhang.

Changes since v5:
- Rebase to the latest branch.

v6:
- Update full 48bit ppgtt definition

Cc: Tina Zhang <[email protected]>
Signed-off-by: Tina Zhang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915: Enable guest i915 full ppgtt functionality
Tina Zhang [Mon, 14 Aug 2017 07:20:46 +0000 (15:20 +0800)]
drm/i915: Enable guest i915 full ppgtt functionality

Enable the guest i915 full ppgtt functionality when host can provide this
capability. vgt_caps is introduced to guest i915 driver to get the vgpu
capabilities from the device model. VGT_CPAS_FULL_PPGTT is one of the
capabilities type to let guest i915 dirver know that the guest i915 full
ppgtt is supported by device model.

Notice that the minor version of pvinfo isn't bumped because of this
vgt_caps introduction, due to older guest would be broken by simply
increasing the pvinfo version. Although the pvinfo minor version doesn't
increase, the compatibility won't be blocked. The compatibility is ensured
by checking the value of caps field in pvinfo. Zero means no full ppgtt
support and BIT(2) means this feature is provided.

Changes since v1:
- Use u32 instead of uint32_t (Joonas)
- Move VGT_CAPS_FULL_PPGTT introduction to this patch and use #define
  instead of enum (Joonas)
- Rewrite the vgpu full ppgtt capability checking logic. (Joonas)
- Some coding style refine. (Joonas)

Changes since v2:
- Divide the whole patch set into two separate patch series, with one
  patch in i915 side to check guest i915 full ppgtt capability and enable
  it when this capability is supported by the device model, and the other
  one in gvt side which fixs the blocking issue and enables the device
  model to provide the capability to guest. And this patch focuses on guest
  i915 side. (Joonas)
- Change the title from "introduce vgt_caps to pvinfo" to
  "Enable guest i915 full ppgtt functionality". (Tina)

Change since v3:
- Add some comments about pvinfo caps and version. (Joonas)

Change since v4:
- Tested by Tina Zhang.

Change since v5:
- Add limitation about supporting 32bit full ppgtt.

Change since v6:
- Change the fallback to 48bit full ppgtt if i915.ppgtt_enable=2. (Zhenyu)

Change in v9:
- Remove the fixme comment due to no plan for 32bit full ppgtt
  support. (Zhenyu)
- Reorder the patch-set to fix compiling issue with git-bisect. (Zhenyu)
- Add print log when forcing guest 48bit full ppgtt. (Zhenyu)

v10:
- Update against Joonas's has_full_ppgtt and has_full_48bit_ppgtt disconnect
  change. (Zhenyu)

Reviewed-by: Joonas Lahtinen <[email protected]> # in v2
Cc: Joonas Lahtinen <[email protected]>
Cc: Tina Zhang <[email protected]>
Signed-off-by: Tina Zhang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915: Disconnect 32 and 48 bit ppGTT support
Joonas Lahtinen [Fri, 11 Aug 2017 09:51:26 +0000 (12:51 +0300)]
drm/i915: Disconnect 32 and 48 bit ppGTT support

Configurations like virtualized environments may support only 48 bit
ppGTT without supporting 32 bit ppGTT. Support this by disconnecting
the relationship of the two feature bits.

Cc: Tina Zhang <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Zhi Wang <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Joonas Lahtinen <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915: More surgically unbreak the modeset vs reset deadlock
Daniel Vetter [Tue, 8 Aug 2017 08:08:28 +0000 (10:08 +0200)]
drm/i915: More surgically unbreak the modeset vs reset deadlock

There's no reason to entirely wedge the gpu, for the minimal deadlock
bugfix we only need to unbreak/decouple the atomic commit from the gpu
reset. The simplest way to fix that is by replacing the
unconditional fence wait a the top of commit_tail by a wait which
completes either when the fences are done (normal case, or when a
reset doesn't need to touch the display state). Or when the gpu reset
needs to force-unblock all pending modeset states.

The lesser source of deadlocks is when we try to pin a new framebuffer
and run into a stall. There's a bunch of places this can happen, like
eviction, changing the caching mode, acquiring a fence on older
platforms. And we can't just break the depency loop and keep going,
the only way would be to break out and restart. But the problem with
that approach is that we must stall for the reset to complete before
we grab any locks, and with the atomic infrastructure that's a bit
tricky. The only place is the ioctl code, and we don't want to insert
code into e.g. the BUSY ioctl. Hence for that problem just create a
critical section, and if any code is in there, wedge the GPU. For the
steady-state this should never be a problem.

Note that in both cases TDR itself keeps working, so from a userspace
pov this trickery isn't observable. Users themselvs might spot a short
glitch while the rendering is catching up again, but that's still
better than pre-TDR where we've thrown away all the rendering,
including innocent batches. Also, this fixes the regression TDR
introduced of making gpu resets deadlock-prone when we do need to
touch the display.

One thing I noticed is that gpu_error.flags seems to use both our own
wait-queue in gpu_error.wait_queue, and the generic wait_on_bit
facilities. Not entirely sure why this inconsistency exists, I just
picked one style.

A possible future avenue could be to insert the gpu reset in-between
ongoing modeset changes, which would avoid the momentary glitch. But
that's a lot more work to implement in the atomic commit machinery,
and given that we only need this for pre-g4x hw, of questionable
utility just for the sake of polishing gpu reset even more on those
old boxes. It might be useful for other features though.

v2: Rebase onto 4.13 with a s/wait_queue_t/struct wait_queue_entry/.

v3: Really emabarrassing fixup, I checked the wrong bit and broke the
unbreak/wakeup logic.

v4: Also handle deadlocks in pin_to_display.

v5: Review from Michel:
- Fixup the BUILD_BUG_ON
- Don't forget about the overlay

Cc: Michel Thierry <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Tvrtko Ursulin <[email protected]> (v2)
Cc: Michel Thierry <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Michel Thierry <[email protected]>
7 years agodrm/i915: Push i915_sw_fence_wait into the nonblocking atomic commit
Daniel Vetter [Tue, 8 Aug 2017 08:08:27 +0000 (10:08 +0200)]
drm/i915: Push i915_sw_fence_wait into the nonblocking atomic commit

Blocking in a worker is ok, that's what the unbound_wq is for. And it
unifies the paths between the blocking and nonblocking commit, giving
me just one path where I have to implement the deadlock avoidance
trickery in the next patch.

I first tried to implement the following patch without this rework, but
force-completing i915_sw_fence creates some serious challenges around
properly cleaning things up. So wasn't a feasible short-term approach.
Another approach would be to simple keep track of all pending atomic
commit work items and manually queue them from the reset code. With the
caveat that double-queue in case we race with the i915_sw_fence must be
avoided. Given all that, taking the cost of a double schedule in atomic
for the short-term fix is the best approach, but can be changed in the future of course.

v2: Amend commit message (Chris).

v3: Add comment explaining why we do nothing in the sw_fence complete
callback (Michel).

Reviewed-by: Maarten Lankhorst <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Tvrtko Ursulin <[email protected]> (v2)
Cc: Michel Thierry <[email protected]>
Reviewed-by: Michel Thierry <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Avoid the gpu reset vs. modeset deadlock
Daniel Vetter [Tue, 8 Aug 2017 08:08:26 +0000 (10:08 +0200)]
drm/i915: Avoid the gpu reset vs. modeset deadlock

... using the biggest hammer we have. This is essentially a weaponized
version of the timeout-based wedging Chris added in

commit 36703e79a982c8ce5a8e43833291f2719e92d0d1
Author: Chris Wilson <[email protected]>
Date:   Thu Jun 22 11:56:25 2017 +0100

    drm/i915: Break modeset deadlocks on reset

Because defense-in-depth is good it's good to still have both. Also
note that with the locking change we can now restrict this a lot (old
gpus and special testing only), so this doesn't kill the TDR benefits
on at least anything remotely modern.

And futuremore with a few tricks it should be possible to make a much
more educated guess about whether an atomic commit is stuck waiting on
the gpu (atomic_t counting the pending i915_sw_fence used by the
atomic modeset code should do it), so we can improve this.

But for now just start with something that is guaranteed to recover
faster, for much better CI througput.

This defacto reverts TDR on these platforms, but there's not really a
single commit to specify as the sole offender.

v2: Add a debug message to explain what's going on. We can't DRM_ERROR
because that spams CI. And the timeout based fallback still prints a
DRM_ERROR, in case something goes wrong.

v3: Fix comment layout (Michel)

Fixes: 4680816be336 ("drm/i915: Wait first for submission, before waiting for request completion")
Fixes: 221fe7994554 ("drm/i915: Perform a direct reset of the GPU from the waiter")
Cc: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Tvrtko Ursulin <[email protected]> (v2)
Cc: Michel Thierry <[email protected]>
Reviewed-by: Tvrtko Ursulin <[email protected]> (v2)
Reviewed-by: Michel Thierry <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/gen9: Send all components in VF state
Mika Kuoppala [Thu, 10 Aug 2017 11:04:51 +0000 (14:04 +0300)]
drm/i915/gen9: Send all components in VF state

Update gen9 renderstate to account the, long overdue, changes for
igt commit 5c07135b7bd2 ("tools/null_state/gen9: Send all
components in VF state").

Signed-off-by: Mika Kuoppala <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/guc: Rename GuC irq trigger function
Michal Wajdeczko [Wed, 9 Aug 2017 21:26:03 +0000 (21:26 +0000)]
drm/i915/guc: Rename GuC irq trigger function

We should emphasize that irq raising function depends on Gen.

v2: use yet another better name (Chris)

Signed-off-by: Michal Wajdeczko <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
7 years agodrm/i915: Suppress switch_mm emission between the same aliasing_ppgtt
Chris Wilson [Sat, 12 Aug 2017 15:27:24 +0000 (16:27 +0100)]
drm/i915: Suppress switch_mm emission between the same aliasing_ppgtt

When switching between contexts using the aliasing_ppgtt, the VM is
shared. We don't need to reload the PD registers unless they are dirty.

Martin Peres reported an issue that looks like corruption between
Haswell context switches, bisecting to commit f9326be5f1d3 ("drm/i915:
Rearrange switch_context to load the aliasing ppgtt on first use").
Switching between the same mm (the aliasing_ppgtt is used for all
contexts in this case) should be a nop, but appears to trigger some
side-effects in the context switch. However, as we know the switch
is redundant in this case, we can skip it and continue to ignore the
issue until somebody feels strong enough to investigate full-ppgtt on
gen7 again!

Except.. Martin was using full-ppgtt which is not supported as it
doesn't work correctly yet. So whilst the bisect did yield valuable
information about the failures, the fix should not have any user impact
under default settings, with the exception of a slightly lower
throughput on xcs as the VM would always be reloaded.

v2: Also remember to set the legacy_active_context following the switch
on xcs (commit e8a9c58fcd9a ("drm/i915: Unify active context tracking
between legacy/execlists/guc"))

Fixes: f9326be5f1d3 ("drm/i915: Rearrange switch_context to load the aliasing ppgtt on first use")
Fixes: e8a9c58fcd9a ("drm/i915: Unify active context tracking between legacy/execlists/guc")
Reported-by: Martin Peres <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: Martin Peres <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Add SW_SYNC to our recommend testing Kconfig
Chris Wilson [Thu, 10 Aug 2017 09:40:36 +0000 (10:40 +0100)]
drm/i915: Add SW_SYNC to our recommend testing Kconfig

Since we do use the SW_SYNC in igt for validating dma-fence and
sync_file, and wish to expand usage to cover driver independent portions
of syncobj interaction, ensure SW_SYNC is included in our testing
Kconfig.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Jason Ekstrand <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Joonas Lahtinen <[email protected]>
7 years agodrm/i915: Introduce intel_hpd_pin function.
Rodrigo Vivi [Fri, 11 Aug 2017 18:26:50 +0000 (11:26 -0700)]
drm/i915: Introduce intel_hpd_pin function.

The idea is to have an unique place to decide the pin-port
per platform.

So let's create this function now without any functional
change. Just adding together code from hdmi and dp together.

v2: Add missing pin for port A.
v3: Fix typo on subject.
    Avoid behaviour change so add WARN_ON and return
    if port A on HDMI. (by DK).

Cc: Dhinakaran Pandiyan <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Dhinakaran Pandiyan <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Simplify hpd pin to port
Rodrigo Vivi [Fri, 11 Aug 2017 18:26:49 +0000 (11:26 -0700)]
drm/i915: Simplify hpd pin to port

We will soon need to make that pin port association per
platform, so let's try to simplify it beforehand.

Also we are moving the backwards port to pin
here as well so let's use a standardized way.

One extra possibility here would be to add a
MISSING_CASE along with PORT_NONE, but I don't want
to change this behaviour for now.

Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Dhinakaran Pandiyan <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/cnl: Dump the right pll registers when dumping pipe config.
Rodrigo Vivi [Thu, 10 Aug 2017 22:45:25 +0000 (15:45 -0700)]
drm/i915/cnl: Dump the right pll registers when dumping pipe config.

Different from SKL we don't need ctrl1 and cfgcr2, but
we need to dump cfgcr0 and cfgcr1 instead.

v2: rebase and commit message

Cc: Clint Taylor <[email protected]>
Cc: Mika Kahola <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Mika Kahola <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/cnl: Add allowed DP rates for Cannonlake.
Rodrigo Vivi [Thu, 10 Aug 2017 22:40:08 +0000 (15:40 -0700)]
drm/i915/cnl: Add allowed DP rates for Cannonlake.

"Frequencies over 5.4 GHz only supported on certain
DDI ports and SKUs, and requires Vccio >= 0.95V."

More specifically, for current CNL SKUs available
(CNL-U and CNL-Y) we have:

DDI A - 5.4G eDP
DDI B - 8.1G DP
DDI C - 8.1G DP
DDI D - 5.4G DP

v2: Rebase on top of source_rates changes.
v3: Address the max 5.4 x 8.1 per DDI and also consider vccio.

Cc: Mika Kahola <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Manasi Navare <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Return correct EDP voltage swing table for 0.85V
Matthias Kaehlcke [Mon, 17 Jul 2017 19:58:54 +0000 (12:58 -0700)]
drm/i915: Return correct EDP voltage swing table for 0.85V

For 0.85V cnl_get_buf_trans_edp() returns the DP table, instead of EDP.
Use the correct table.

The error was pointed out by this clang warning:

drivers/gpu/drm/i915/intel_ddi.c:392:39: warning: variable
  'cnl_ddi_translations_edp_0_85V' is not needed and will not be emitted
  [-Wunneeded-internal-declaration]
    static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_0_85V[] = {

Fixes: cf54ca8bc567 ("drm/i915/cnl: Implement voltage swing sequence.")
Signed-off-by: Matthias Kaehlcke <[email protected]>
Reviewed-by: Manasi Navare <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: make structure intel_sprite_plane_funcs static
Colin Ian King [Fri, 11 Aug 2017 13:49:38 +0000 (14:49 +0100)]
drm/i915: make structure intel_sprite_plane_funcs static

The structure intel_sprite_plane_funcs is local to the source
and does not need to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'intel_sprite_plane_funcs' was not declared. Should it be static?

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/fbc: only update no_fbc_reason when active
Daniel Vetter [Fri, 11 Aug 2017 07:23:27 +0000 (09:23 +0200)]
drm/i915/fbc: only update no_fbc_reason when active

In our snb farm in CI we have plenty of underruns, but not enough
stolen memory to enable fbc. Which means every time there's an
underrun the no_fbc_reason swichtes to something that makes
kms_frontbuffer_tracking fail instead of skip, adding massive amounts
of additional noise to igt test runs.

Make sure we don't try to disable fbc when it's off already.

v2: Squash in additional WARN_ON suggestion from Chris.

Cc: Paulo Zanoni <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/cnl: Add slice and subslice information to debugfs.
Rodrigo Vivi [Wed, 9 Aug 2017 20:07:02 +0000 (13:07 -0700)]
drm/i915/cnl: Add slice and subslice information to debugfs.

A missing part to EU slice power gating is the
debugfs interface. This patch actually should have been
squashed to the initial EU slice power gating one.

v2: Initial patch was merged without this part.

Fixes: c7ae7e9ab207 ("drm/i915/cnl: Configure EU slice power gating.")
Cc: Joonas Lahtinen <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/gen10: fix WM latency printing
Paulo Zanoni [Wed, 9 Aug 2017 20:52:46 +0000 (13:52 -0700)]
drm/i915/gen10: fix WM latency printing

Gen 10 is just like Gen 9, so let's consider that all the future
platforms are going to be like gen 9 instead of being like gen8-.

Cc: Mahesh Kumar <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/gen10: fix the gen 10 SAGV block time
Paulo Zanoni [Wed, 9 Aug 2017 20:52:45 +0000 (13:52 -0700)]
drm/i915/gen10: fix the gen 10 SAGV block time

A previous commit added CNL to intel_has_sagv(), but forgot to adjust
the SAGV block time to gen 10 platforms.

Cc: Mahesh Kumar <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/cnl: Enable SAGV for Cannonlake.
Rodrigo Vivi [Wed, 9 Aug 2017 20:52:44 +0000 (13:52 -0700)]
drm/i915/cnl: Enable SAGV for Cannonlake.

For now inherit from previous platforms.

v2: Rebase on top of CFL.

Cc: Mahesh Kumar <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Paulo Zanoni <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/gen10+: use the SKL code for reading WM latencies
Paulo Zanoni [Wed, 9 Aug 2017 20:52:43 +0000 (13:52 -0700)]
drm/i915/gen10+: use the SKL code for reading WM latencies

Gen 10 should use the exact same code as Gen 9, so change the check to
take this into consideration, and also assume that future platforms
will run this code.

Also add a MISSING_CASE(), just in case we do something wrong, instead
of silently failing.

Cc: Mahesh Kumar <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Avoid null dereference if mst_port is unset.
Rodrigo Vivi [Thu, 10 Aug 2017 14:50:43 +0000 (07:50 -0700)]
drm/i915: Avoid null dereference if mst_port is unset.

I'm not sure if this is really the case and I don't believe
this is the real fix for the bug mentioned here, but since
I don't see a reliable path when mst_port is set and when
mode_valid is requested I believe it is worth to have this
protection here.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102022
Cc: Elizabeth <[email protected]>
Cc: Stefan Assmann <[email protected]>
Cc: Dhinakaran Pandiyan <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/perf: Drop redundant check for perf.initialised on reset
Chris Wilson [Thu, 10 Aug 2017 17:57:43 +0000 (18:57 +0100)]
drm/i915/perf: Drop redundant check for perf.initialised on reset

As we cannot have an exclusive stream set if the perf has not been
initialized, we only need to check for that exclusive stream.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Cc: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Matthew Auld <[email protected]>
7 years agodrm/i915/perf: Drop lockdep assert for i915_oa_init_reg_state()
Chris Wilson [Thu, 10 Aug 2017 17:57:42 +0000 (18:57 +0100)]
drm/i915/perf: Drop lockdep assert for i915_oa_init_reg_state()

This is called from execlist context init which we need to be unlocked.
Commit f89823c21224 ("drm/i915/perf: Implement
I915_PERF_ADD/REMOVE_CONFIG interface") added a lockdep assert to this
path for unclear reasons, remove it again!

Fixes: f89823c21224 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Cc: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Matthew Auld <[email protected]>
7 years agodrm/i915/perf: Initialise dynamic sysfs group before creation
Chris Wilson [Thu, 10 Aug 2017 17:57:41 +0000 (18:57 +0100)]
drm/i915/perf: Initialise dynamic sysfs group before creation

Another case where we need to call sysfs_attr_init() to setup the
internal lockdep class prior to use:

[    9.325229] BUG: key ffff880168bc7bb0 not in .data!
[    9.325240] DEBUG_LOCKS_WARN_ON(1)
[    9.325250] ------------[ cut here ]------------
[    9.325280] WARNING: CPU: 1 PID: 275 at kernel/locking/lockdep.c:3156 lockdep_init_map+0x1b2/0x1c0
[    9.325301] Modules linked in: intel_powerclamp(+) coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915(+) snd_hda_intel snd_hda_codec snd_hwdep r8169 mii snd_hda_core snd_pcm prime_numbers i2c_hid pinctrl_geminilake pinctrl_intel
[    9.325375] CPU: 1 PID: 275 Comm: modprobe Not tainted 4.13.0-rc4-CI-Trybot_1040+ #1
[    9.325395] Hardware name: Intel Corp. Geminilake/GLK RVP2 LP4SD (07), BIOS GELKRVPA.X64.0045.B51.1704281422 04/28/2017
[    9.325422] task: ffff8801721a4ec0 task.stack: ffffc900001dc000
[    9.325440] RIP: 0010:lockdep_init_map+0x1b2/0x1c0
[    9.325456] RSP: 0018:ffffc900001dfa10 EFLAGS: 00010282
[    9.325473] RAX: 0000000000000016 RBX: ffff880168d54b80 RCX: 0000000000000000
[    9.325488] RDX: 0000000080000001 RSI: 0000000000000001 RDI: ffffffff810f0800
[    9.325505] RBP: ffffc900001dfa30 R08: 0000000000000001 R09: 0000000000000000
[    9.325521] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880168bc7bb0
[    9.325537] R13: 0000000000000000 R14: ffff880168bc7b98 R15: ffffffff81a263a0
[    9.325554] FS:  00007fb60c3fd700(0000) GS:ffff88017fc80000(0000) knlGS:0000000000000000
[    9.325574] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    9.325588] CR2: 0000006582777d80 CR3: 000000016d818000 CR4: 00000000003406e0
[    9.325604] Call Trace:
[    9.325618]  __kernfs_create_file+0x76/0xe0
[    9.325632]  sysfs_add_file_mode_ns+0x8a/0x1a0
[    9.325646]  internal_create_group+0xea/0x2c0
[    9.325660]  sysfs_create_group+0x13/0x20
[    9.325737]  i915_perf_register+0xde/0x220 [i915]
[    9.325800]  i915_driver_load+0xa77/0x16c0 [i915]
[    9.325863]  i915_pci_probe+0x37/0x90 [i915]
[    9.325880]  pci_device_probe+0xa8/0x130
[    9.325894]  driver_probe_device+0x29c/0x450
[    9.325908]  __driver_attach+0xe3/0xf0
[    9.325922]  ? driver_probe_device+0x450/0x450
[    9.325935]  bus_for_each_dev+0x62/0xa0
[    9.325948]  driver_attach+0x1e/0x20
[    9.325960]  bus_add_driver+0x173/0x270
[    9.325974]  driver_register+0x60/0xe0
[    9.325986]  __pci_register_driver+0x60/0x70
[    9.326044]  i915_init+0x6f/0x78 [i915]
[    9.326066]  ? 0xffffffffa024e000
[    9.326079]  do_one_initcall+0x43/0x170
[    9.326094]  ? rcu_read_lock_sched_held+0x7a/0x90
[    9.326109]  ? kmem_cache_alloc_trace+0x261/0x2d0
[    9.326124]  do_init_module+0x5f/0x206
[    9.326137]  load_module+0x2561/0x2da0
[    9.326150]  ? show_coresize+0x30/0x30
[    9.326165]  ? kernel_read_file+0x105/0x190
[    9.326180]  SyS_finit_module+0xc1/0x100
[    9.326192]  ? SyS_finit_module+0xc1/0x100
[    9.326210]  entry_SYSCALL_64_fastpath+0x1c/0xb1
[    9.326223] RIP: 0033:0x7fb60bf359f9
[    9.326234] RSP: 002b:00007fff92b47c48 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[    9.326255] RAX: ffffffffffffffda RBX: ffffffff814898a3 RCX: 00007fb60bf359f9
[    9.326271] RDX: 0000000000000000 RSI: 00000028a9ceef8b RDI: 0000000000000000
[    9.326287] RBP: ffffc900001dff88 R08: 0000000000000000 R09: 0000000000000000
[    9.326303] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000040000
[    9.326319] R13: 00000028aaef2a70 R14: 0000000000000000 R15: 00000028aaeee5d0
[    9.326339]  ? __this_cpu_preempt_check+0x13/0x20
[    9.326353] Code: f1 39 00 85 c0 0f 84 38 ff ff ff 83 3d 9f 44 ce 01 00 0f 85 2b ff ff ff 48 c7 c6 b2 a2 c7 81 48 c7 c7 53 40 c5 81 e8 3f 82 01 00 <0f> ff e9 11 ff ff ff 0f 1f 80 00 00 00 00 55 31 c9 31 d2 31 f6

Fixes: 701f8231a2fe ("drm/i915/perf: prune OA configs")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Cc: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Lionel Landwerlin <[email protected]>
7 years agodrm/i915: add register macro definition style guide
Jani Nikula [Thu, 10 Aug 2017 12:29:44 +0000 (15:29 +0300)]
drm/i915: add register macro definition style guide

This is not to try to force a new style; this is my interpretation of
what the most common existing style is.

With hopes I don't need to answer so many questions about style going
forward.

Start a new style section in the i915 document to bolt the register
style guide into.

v2: vertical alignment, incorporate to kernel-doc, and more

Cc: Daniel Vetter <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Reviewed-by: Dhinakaran Pandiyan <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/9de4a5b1bea4e76461c70a1dd66751581de0124f.1502368010.git.jani.nikula@intel.com
7 years agodrm/i915: enum i915_power_well_id is not proper kernel-doc
Jani Nikula [Thu, 10 Aug 2017 12:29:43 +0000 (15:29 +0300)]
drm/i915: enum i915_power_well_id is not proper kernel-doc

Revert to a normal comment, as the enum isn't properly documented
anyway.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/f2c44a0aa00ea7d9b71e7a3183a7507f98811146.1502368010.git.jani.nikula@intel.com
7 years agoDocumentation/i915: remove sphinx conversion artefact
Jani Nikula [Thu, 10 Aug 2017 12:29:42 +0000 (15:29 +0300)]
Documentation/i915: remove sphinx conversion artefact

Remove old warning about docproc directive that's not supported in the
Sphinx toolchain.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/7fc8a110b78a9dc9a585dce643b68b4200b7e793.1502368010.git.jani.nikula@intel.com
7 years agodrm/i915: Add format modifiers for Intel
Ben Widawsky [Tue, 1 Aug 2017 16:58:16 +0000 (09:58 -0700)]
drm/i915: Add format modifiers for Intel

This was based on a patch originally by Kristian. It has been modified
pretty heavily to use the new callbacks from the previous patch.

v2:
  - Add LINEAR and Yf modifiers to list (Ville)
  - Combine i8xx and i965 into one list of formats (Ville)
  - Allow 1010102 formats for Y/Yf tiled (Ville)

v3:
  - Handle cursor formats (Ville)
  - Put handling for LINEAR in the mod_support functions (Ville)

v4:
  - List each modifier explicitly in supported modifiers (Ville)
  - Handle the CURSOR plane (Ville)

v5:
  - Split out cursor and sprite handling (Ville)

v6:
  - Actually use the sprite funcs (Emil)
  - Use unreachable (Emil)

v7:
  - Only allow Intel modifiers and LINEAR (Ben)

v8
  - Fix spite assert introduced in v6 (Daniel)

v9
  - Change vendor check logic to avoid magic 56 (Emil)
  - Reorder skl_mod_support (Ville)
  - make intel_plane_funcs static, could be done as of v5 (Ville)
  - rename local variable intel_format_modifiers to modifiers (Ville)
    - actually use sprite modifiers
  - split out modifier/formats by platform (Ville)

v10:
  - Undo vendor check from v9

v11:
  - Squash CCS advertisement into this patch (daniels)
  - Don't advertise CCS on higher sprite planes (daniels)

v12:
  - Don't advertise Y-tiled or CCS on any sprite planes, since we don't
    allocate enough DDB space for it to work. (daniels)

Cc: Ville Syrjälä <[email protected]>
Reviewed-by: Emil Velikov <[email protected]> (v8)
Signed-off-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Stone <[email protected]>
7 years agodrm/i915: Add render decompression support
Ville Syrjälä [Tue, 1 Aug 2017 16:58:13 +0000 (09:58 -0700)]
drm/i915: Add render decompression support

SKL+ display engine can scan out certain kinds of compressed surfaces
produced by the render engine. This involved telling the display engine
the location of the color control surfae (CCS) which describes
which parts of the main surface are compressed and which are not. The
location of CCS is provided by userspace as just another plane with its
own offset.

Add the required stuff to validate the user provided AUX plane metadata
and convert the user provided linear offset into something the hardware
can consume.

Due to hardware limitations we require that the main surface and
the AUX surface (CCS) be part of the same bo. The hardware also
makes life hard by not allowing you to provide separate x/y offsets
for the main and AUX surfaces (excpet with NV12), so finding suitable
offsets for both requires a bit of work. Assuming we still want keep
playing tricks with the offsets. I've just gone with a dumb "search
backward for suitable offsets" approach, which is far from optimal,
but it works.

Also not all planes will be capable of scanning out compressed surfaces,
and eg. 90/270 degree rotation is not supported in combination with
decompression either.

This patch may contain work from at least the following people:
* Vandana Kannan <[email protected]>
* Daniel Vetter <[email protected]>
* Ben Widawsky <[email protected]>

v2: Deal with display workarounds 0390, 0531, 1125 (Paulo)
v3: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason)
    Put the AUX register defines to the correct place
    Fix up the slightly bogus rotation check
v4: Use I915_WRITE_FW() due to plane update locking changes
    s/return -EINVAL/goto err/ in intel_framebuffer_init()
    Eliminate a bunch hardcoded numbers in CCS code

v5: (By Ben)
conflict resolution +
-               res_blocks += fixed_16_16_to_u32_round_up(y_tile_minimum);
+               res_blocks += fixed16_to_u32_round_up(y_tile_minimum);

v6: (daniels) Fix botched commit message.

Cc: Paulo Zanoni <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Ben Widawsky <[email protected]>
Cc: Jason Ekstrand <[email protected]>
Signed-off-by: Ville Syrjä <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]> (v1)
Reviewed-by: Daniel Stone <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Stone <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Implement .get_format_info() hook for CCS
Ville Syrjälä [Tue, 1 Aug 2017 16:58:12 +0000 (09:58 -0700)]
drm/i915: Implement .get_format_info() hook for CCS

SKL+ display engine can scan out certain kinds of compressed surfaces
produced by the render engine. This involved telling the display engine
the location of the color control surfae (CCS) which describes which
parts of the main surface are compressed and which are not. The location
of CCS is provided by userspace as just another plane with its own offset.

By providing our own format information for the CCS formats, we should
be able to make framebuffer_check() do the right thing for the CCS
surface as well.

Note that we'll return the same format info for both Y and Yf tiled
format as that's what happens with the non-CCS Y vs. Yf as well. If
desired, we could potentially return a unique pointer for each
pixel_format+tiling+ccs combination, in which case we immediately be
able to tell if any of that stuff changed by just comparing the
pointers. But that does sound a bit wasteful space wise.

v2: Drop the 'dev' argument from the hook
v3: Include the description of the CCS surface layout
v4: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason)
v5: Re-drop 'dev', fix commit message, add missing drm_fourcc.h
    description of CCS layout. (daniels)

Cc: Daniel Vetter <[email protected]>
Cc: Ben Widawsky <[email protected]>
Cc: Jason Ekstrand <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]> (v3)
Reviewed-by: Daniel Stone <[email protected]>
Signed-off-by: Ville Syrjä <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Stone <[email protected]>
7 years agoMerge airlied/drm-next into drm-intel-next-queued
Daniel Vetter [Thu, 10 Aug 2017 16:12:01 +0000 (18:12 +0200)]
Merge airlied/drm-next into drm-intel-next-queued

Ben Widawsky/Daniel Stone need the extended modifier support from
drm-misc to be able to merge CCS support for i915.ko

Signed-off-by: Daniel Vetter <[email protected]>
7 years agodrm/i915: Supply the engine-id for our mock_engine()
Chris Wilson [Wed, 9 Aug 2017 16:39:30 +0000 (17:39 +0100)]
drm/i915: Supply the engine-id for our mock_engine()

In the original selftest, we didn't care what the engine->id was, just
that it could uniquely identify it. Later though, we started tracking
the mock engines in the fixed size arrays around the drm_i915_private and
so we now require their indices to be correct. This becomes an issue when
using the standalone harness which runs all available tests at module load,
and so we quickly assign an out-of-bounds index to an engine as we
reallocate the mock GEM device between tests. It doesn't show up in
igt/drv_selftest as that runs each subtest individually.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102045
Signed-off-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
7 years agodrm/i915/gvt: Add shadow context descriptor updating
Kechen Lu [Wed, 9 Aug 2017 23:41:36 +0000 (07:41 +0800)]
drm/i915/gvt: Add shadow context descriptor updating

The current context logic only updates the descriptor of context when
it's being pinned to graphics memory space. But this cannot satisfy the
requirement of shadow context. The addressing mode of the pinned shadow
context descriptor may be changed according to the guest addressing mode.
And this won't be updated, as the already pinned shadow context has no
chance to update its descriptor. And this will lead to GPU hang issue,
as shadow context is used with wrong descriptor. This patch fixes this
issue by letting the pinned shadow context descriptor update its
addressing mode on demand.

This patch fixes GPU HANG issue which happends after changing the
grub parameter i915.enable_ppgtt form 0x01 to 0x03 or vice versa and
then rebooting the guest.

Signed-off-by: Tina Zhang <[email protected]>
Signed-off-by: Kechen Lu <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: expose vGPU context hw id
Zhenyu Wang [Tue, 1 Aug 2017 05:09:47 +0000 (13:09 +0800)]
drm/i915/gvt: expose vGPU context hw id

This exposes vGPU context hw id in mdev sysfs which is used to
do vGPU based profiling. Retrieved vGPU context hw id can be set
through i915 perf ioctl to set profiling for target vGPU.

Cc: Jiao Pengyuan <[email protected]>
Cc: Niu Bing <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Refine the intel_vgpu_reset_gtt reset function
Chuanxiao Dong [Fri, 4 Aug 2017 05:08:59 +0000 (13:08 +0800)]
drm/i915/gvt: Refine the intel_vgpu_reset_gtt reset function

When doing the VGPU reset, we don't need to do the gtt/ppgtt reset.
This will make the GVT to do the ppgtt shadow every time for
a workload and caused really bad performance after a VGPU reset.
This patch will make sure ppgtt clean only happen at device module
level reset to fix this.

Signed-off-by: Chuanxiao Dong <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Add carefully checking in GTT walker paths
Changbin Du [Wed, 2 Aug 2017 07:06:37 +0000 (15:06 +0800)]
drm/i915/gvt: Add carefully checking in GTT walker paths

When debugging the gtt code, found the intel_vgpu_gma_to_gpa() can
translate any given GMA though the GMA is not valid. This because
the GTT ops suppress the possible errors, which may result in an
invalid PT entry is retrieved by upper caller.

This patch changed the prototype of pte ops to propagate status to
callers. Then we make sure the GTT walker stop as early as when
a error is detected to prevent undefined behavior.

Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Remove duplicated MMIO entries
Jian Jun Chen [Wed, 19 Jul 2017 04:18:39 +0000 (12:18 +0800)]
drm/i915/gvt: Remove duplicated MMIO entries

Remove duplicated MMIO entries in the tracked MMIO list. -EEXIST
is returned if duplicated MMIO entries are found when new MMIO
entry is added.

v2:
- Use WARN(1, ...) for more verbose message. (Zhenyu)

Signed-off-by: Jian Jun Chen <[email protected]>
Cc: Zhi Wang <[email protected]>
Cc: Changbin Du <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Reviewed-by: Yulei Zhang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: take runtime pm when do early scan and shadow
Zhenyu Wang [Mon, 10 Jul 2017 06:13:12 +0000 (14:13 +0800)]
drm/i915/gvt: take runtime pm when do early scan and shadow

Need to take runtime pm when do early scan/shadow of workload
for request operations.

Fixes: 7fa56bd159bc ("drm/i915/gvt: Audit and shadow workload during ELSP writing")
Cc: Ping Gao <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Replace duplicated code with exist function
Ping Gao [Tue, 4 Jul 2017 08:11:16 +0000 (16:11 +0800)]
drm/i915/gvt: Replace duplicated code with exist function

Use the exist function intel_gvt_ggtt_validate_range to replace
these duplicated code that do the same thing.

Signed-off-by: Ping Gao <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: To check whether workload scan and shadow has mutex hold
Ping Gao [Tue, 4 Jul 2017 06:53:03 +0000 (14:53 +0800)]
drm/i915/gvt: To check whether workload scan and shadow has mutex hold

The function workload scan and shadow have to hold the drm.struct_mutex
before called. To avoid misusing of this function, add a lockdep assert
in it.

Signed-off-by: Ping Gao <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Audit and shadow workload during ELSP writing
Ping Gao [Thu, 29 Jun 2017 04:22:43 +0000 (12:22 +0800)]
drm/i915/gvt: Audit and shadow workload during ELSP writing

Let the workload audit and shadow ahead of vGPU scheduling, that
will eliminate GPU idle time and improve performance for multi-VM.

The performance of Heaven running simultaneously in 3VMs has
improved 20% after this patch.

v2:Remove condition current->vgpu==vgpu when shadow during ELSP
writing.

Signed-off-by: Ping Gao <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Factor out scan and shadow from workload dispatch
Ping Gao [Thu, 29 Jun 2017 04:22:42 +0000 (12:22 +0800)]
drm/i915/gvt: Factor out scan and shadow from workload dispatch

To perform the workload scan and shadow in ELSP writing stage for
performance consideration, the workload scan and shadow stuffs
should be factored out from dispatch_workload().

v2:Put context pin before i915_add_request;
   Refine the comments;
   Rename some APIs;

v3:workload->status should set only when error happens.
v4:i915_add_request is must to have after i915_gem_request_alloc.

Signed-off-by: Ping Gao <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Optimize ring siwtch 2x faster again by light weight mmio access wrapper
Changbin Du [Fri, 23 Jun 2017 07:45:32 +0000 (15:45 +0800)]
drm/i915/gvt: Optimize ring siwtch 2x faster again by light weight mmio access wrapper

The I915_READ/WRITE is not only a mmio read/write, it also contains
debug checking and Forcewake domain lookup. This is too heavy for
GVT ring switch case which access batch of mmio registers on ring
switch. We can handle Forcewake manually and use the raw
i915_read/write instead. The benefit from this is 2x faster mmio
switch performance.
         Before       After
cycles  ~550000      ~250000

v2: Use existing I915_READ_FW/I915_WRITE_FW macro. (zhenyu)

Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Optimize ring siwtch 2x faster by removing unnecessary POSTING_READ
Changbin Du [Fri, 23 Jun 2017 07:45:31 +0000 (15:45 +0800)]
drm/i915/gvt: Optimize ring siwtch 2x faster by removing unnecessary POSTING_READ

There are lots of POSTING_READ alongside each mmio write Op. While
actually this is not necessary. It just bring too much latency since
PCIe read Op is very slow which is of non-posted transaction.

For PCIe device, the mem transaction for strong ordering rules are:
  o PCIe mmio write sequence is FIFO. Posted request cannot
    pass previous posted request.
  o PCIe mmio read will not go ahead of previous write.

Intel graphics doesn't support RO, so we can apply above rules. In
our case, we only need one POSTING_READ at last. This can remove
half of mmio read Op and then the average ring switch performance
is nearly doubled.
         Before       After
cycles  ~970000      ~550000

Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agodrm/i915/gvt: Use gvt_err to print the resource not enough error
Chuanxiao Dong [Tue, 13 Jun 2017 06:31:58 +0000 (14:31 +0800)]
drm/i915/gvt: Use gvt_err to print the resource not enough error

It is better to use gvt_err when the gvt resource is not enough so
the user can be notified from the kernel dmesg. And this kind of
error message is gvt related.

Suggested-by: Bing Niu <[email protected]>
Signed-off-by: Chuanxiao Dong <[email protected]>
Cc: Bing Niu <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
7 years agoMerge tag 'drm-misc-next-2017-08-08' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Thu, 10 Aug 2017 00:47:33 +0000 (10:47 +1000)]
Merge tag 'drm-misc-next-2017-08-08' of git://anongit.freedesktop.org/git/drm-misc into drm-next

UAPI Changes:
- vc4: Add ioctl to allow attaching a label to a bo (Eric)
- Add new format/modifier blob plane property (Ben)
- armada: Use __u32/__u64 instead of uint32_t/uint64_t (Mikko)
- [kinda uapi] fb_helper: Expose display_info size via fb_info (David)

Core Changes:
- Default gem_dumb_[map_offset|destroy] as mmap/destroy implementations (Noralf)
- Simplify atomic properties by removing the helpers and handling in core (Daniel)

Driver Changes:
- stm: Add STM32 DSI controller driver (Phillipe)
- vc4: Add HDMI CEC support (Hans)
- rockchip: Refactor register init & soc version handling (Mark)
- misc: Remove .load_lut, .gamma_set, .gamma_get dead code (Peter)
- dw-hdmi: Add HDMI CEC support (Russell)

Cc: Philippe CORNU <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Noralf Trønnes <[email protected]>
Cc: Ben Widawsky <[email protected]>
Cc: Mark yao <[email protected]>
Cc: Peter Rosin <[email protected]>
Cc: Russell King <[email protected]>
Cc: Mikko Rapeli <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Daniel Vetter <[email protected]>
* tag 'drm-misc-next-2017-08-08' of git://anongit.freedesktop.org/git/drm-misc: (107 commits)
  drm: Nuke drm_atomic_legacy_backoff
  drm: Nuke drm_atomic_helper_connector_dpms
  drm: Nuke drm_atomic_helper_connector_set_property
  drm: Nuke drm_atomic_helper_plane_set_property
  drm: Nuke drm_atomic_helper_crtc_set_property
  drm: Handle properties in the core for atomic drivers
  drm: Don't update property values for atomic drivers
  drm/omap: Rework the rotation-on-crtc hack
  drm/radeon: Use the drm_driver.dumb_destroy default
  drm/i915: Use the drm_driver.dumb_destroy default
  drm/sti: Use .dumb_map_offset and .dumb_destroy defaults
  drm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2.0 PHY
  drm/fb-helper: pass physical dimensions to fbdev
  uapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t
  drm/bridge: dw-hdmi: remove CEC engine register definitions
  drm/bridge: dw-hdmi: add cec driver
  drm/bridge: dw-hdmi: add missing cec_notifier_put
  drm: remove unused and redundant callbacks
  staging: vboxvideo: remove dead gamma lut code
  drm: dw-hdmi-i2s: add missing company name on Copyright
  ...

7 years agodrm/i915/psr: Preserve SRD_CTL bit 29 on PSR init
Jim Bride [Tue, 8 Aug 2017 21:51:34 +0000 (14:51 -0700)]
drm/i915/psr: Preserve SRD_CTL bit 29 on PSR init

Bit 29 of SRD_CTL needs to have its value preserved according to the
B-Spec, so right before we write out the register we go ahead and read
the register and preserve the value of that bit before we write out
the configured register value.

v2: Spaces => tabs, minor name change, and commit message wording (Rodrigo)

Cc: Rodrigo Vivi <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Jim Bride <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/cnl: Removing missing DDI_E bits from CNL.
Rodrigo Vivi [Tue, 8 Aug 2017 19:32:37 +0000 (12:32 -0700)]
drm/i915/cnl: Removing missing DDI_E bits from CNL.

DDI_E is not supported on CNL-U and CNL-Y

When adding the initial support we noticed DDI_E wasn't supported
and removed it on v4 and v5 of that patch.
However for some reason I missed or put back these 2 chunks.

Time to clean it up to avoid later confusion.

Fixes: 8bcd3dd41766 ("drm/i915/cnl: Add power wells for CNL")
Cc: Clint Taylor <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Imre Deak <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Perform an invalidate prior to executing golden renderstate
Chris Wilson [Tue, 8 Aug 2017 13:19:04 +0000 (14:19 +0100)]
drm/i915: Perform an invalidate prior to executing golden renderstate

As we may have just bound the renderstate into the GGTT for execution, we
need to ensure that the GTT TLB are also flushed.

On snb-gt2, this would cause a random GPU hang at the start of a new
context (e.g. boot) and on snb-gt1, it was causing the renderstate batch
to take ~10s. It was the GPU hang that revealed the truth, as the CS
gleefully executed beyond the end of the golden renderstate batch, a good
indicator for a GTT TLB miss.

Fixes: 20fe17aa52dc ("drm/i915: Remove redundant TLB invalidate on switching contexts")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
Cc: <[email protected]> # v4.12-rc1+
7 years agodrm: Nuke drm_atomic_legacy_backoff
Daniel Vetter [Tue, 25 Jul 2017 08:01:22 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_legacy_backoff

Finally all users are gone!

Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Nuke drm_atomic_helper_connector_dpms
Daniel Vetter [Tue, 25 Jul 2017 08:01:21 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_connector_dpms

It's dead code, the core handles all this directly now.

The only special case is nouveau and tda988x which used one function
for both legacy modeset code and -nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

v2: Rebase over the panel/brideg refactorings in stm/ltdc.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Joonyoung Shim <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Alison Wang <[email protected]>
Cc: Russell King <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: CK Hu <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Mark Yao <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: Jeffy Chen <[email protected]>
Cc: Tomeu Vizoso <[email protected]>
Cc: Yakir Yang <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: Romain Perier <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Xinliang Liu <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Rongrong Zou <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Hai Li <[email protected]>
Cc: "Noralf Trønnes" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: zain wang <[email protected]>
Cc: Baoyou Xie <[email protected]>
Cc: Boris Brezillon <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Neil Armstrong <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Acked-by: Archit Taneja <[email protected]>
Tested-by: Philippe Cornu <[email protected]> (on stm)
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Noralf Trønnes <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_connector_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:20 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_connector_set_property

It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_helper_connector_set_property.

The only special case is nouveau which used one function for both
pre-nv50 legacy modeset code and post-nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

What is rather strange here is how few drivers set this up, I suspect
the earlier patch to handle properties in the core did end up fixing a
pile of possible issues.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Vincent Abriou <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_plane_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:19 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_plane_set_property

It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_plane_set_property.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Brian Starkey <[email protected]>
Cc: Mali DP Maintainers <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Joonyoung Shim <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: "Ville Syrjälä" <[email protected]>
Cc: Rongrong Zou <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Eric Engestrom <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Thomas Hellstrom <[email protected]>
Cc: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Archit Taneja <[email protected]>
Acked-by: Philippe Cornu <[email protected]>
Tested-by: Philippe Cornu <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_crtc_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:18 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_crtc_set_property

It's dead code because this is now handled in the core.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Eric Engestrom <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: "Ville Syrjälä" <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Sushmita Susheelendra <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Philipp Zabel <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Hellstrom <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Archit Taneja <[email protected]>
Acked-by: Philippe Cornu <[email protected]>
Tested-by: Philippe Cornu <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Acked-by: Thomas Hellstrom <[email protected]>
7 years agodrm: Handle properties in the core for atomic drivers
Daniel Vetter [Tue, 25 Jul 2017 12:02:04 +0000 (14:02 +0200)]
drm: Handle properties in the core for atomic drivers

The reason behind the original indirection through the helper
functions was to allow existing drivers to overwrite how they handle
properties. For example when a vendor-specific userspace had
expectations that didn't match atomic. That seemed likely, since
atomic is standardizing a _lot_ more of the behaviour of a kms driver.

But 20 drivers later there's no such need at all. Worse, this forces
all drivers to hook up the default behaviour, breaking userspace if
they forget to do that. And it forces us to export a bunch of core
function just for those helpers.

And finally, these helpers are the last places using
drm_atomic_legacy_backoff() and the implicit acquire_ctx.

This patch here just implements the new behaviour and updates the
docs. Follow-up patches will garbage-collect all the dead code.

v2: Fixup docs even better!

v3: Make it actually work ...

v4: Drop the uses_atomic_modeset() checks from the previous patch
again, since they're now moved up in the callchain.

Cc: Maarten Lankhorst <[email protected]>
Reviewed-by: Archit Taneja <[email protected]> (v3)
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Don't update property values for atomic drivers
Daniel Vetter [Tue, 25 Jul 2017 12:01:37 +0000 (14:01 +0200)]
drm: Don't update property values for atomic drivers

Atomic drivers only use the property value store for immutable (i.e.
can't be set by userspace, but the kernel can still adjust it)
properties. The only tricky part is the removal of the update in
drm_atomic_helper_update_legacy_modeset_state().

This was added in

commit 8c10342cb48f3140d9abeadcfd2fa6625d447282 (tag: topic/drm-misc-2015-07-28)
Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jul 27 13:24:29 2015 +0200

    drm/atomic: Update legacy DPMS state during modesets, v3.

by copying it from the i915 code, where it was originally added in

commit 68d3472047a572936551f8ff0b6f4016c5a1fdef
Author: Daniel Vetter <[email protected]>
Date:   Thu Sep 6 22:08:35 2012 +0200

    drm/i915: update dpms property in set_mode

for the legacy modeset code. The reason we needed this hack was that
i915 didn't yet set DRIVER_ATOMIC, and we checked for that instead of
the newer-ish drm_drv_uses_atomic_modeset(), which avoids such
troubles. With the correct feature checks this isn't needed anymore at
all.

Also make sure that drivers don't accidentally get this wrong by
making the exported version of drm_object_property_get_value() only
work for legacy drivers. Only gma500 uses it anyway.

v2: Fixup the uses_atomic_modeset() checks (Maarten)

Cc: Maarten Lankhorst <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/omap: Rework the rotation-on-crtc hack
Maarten Lankhorst [Mon, 7 Aug 2017 10:20:06 +0000 (12:20 +0200)]
drm/omap: Rework the rotation-on-crtc hack

I want/need to rework the core property handling, and this hack is
getting in the way. But since it's a non-standard propety only used by
legacy userspace we know that this will only every be called from
ioctl code. And never on some other free-standing state struct, where
this old hack wouldn't work either.

v2: don't forget zorder and get_property!

v3: Shadow the legacy state to avoid locking issues in get_property
(Maarten).

v4: Review from Laurent
- Move struct omap_crtc_state into omap_crtc.c
- Clean up comments.
- Don't forget to copy the shadowed state over on duplicate.

v5: Don't forget to update the reset handler (Maarten).
v6: Update omap_crtc_state shadow values in omap_crtc_atomic_check (Maarten).
v7:
- Fix get_property to return 0 and set value in *val (Maarten).
- Update comment in set_property for changes in v6 (Maarten).

Reviewed-by: Laurent Pinchart <[email protected]> (v4)
Cc: Maarten Lankhorst <[email protected]>
Cc: Tomi Valkeinen <[email protected]
Cc: Laurent Pinchart <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]> (v4)
Signed-off-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/radeon: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:04 +0000 (17:41 +0200)]
drm/radeon: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:00 +0000 (17:41 +0200)]
drm/i915: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/sti: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:53 +0000 (17:40 +0200)]
drm/sti: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2...
Jose Abreu [Fri, 23 Jun 2017 09:36:44 +0000 (10:36 +0100)]
drm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2.0 PHY

Currently HDMI 2.0 PHYs do not have a default configuration function.

As *some* of the HDMI 2.0 PHYs have the same register layout as the 3D
PHYs we can provide the same default configuration function for both
and still let user overwrite this with custom configuration function
if needed.

If, for some reason, the PHY is custom or has a register different
register layout then custom configuration function *must* be provided
in order for the system to work correctly. As we prefer the pdata
provided configuration function over the internal one this change
will not make any impact in custom platforms.

Signed-off-by: Jose Abreu <[email protected]>
Tested-by: Mark Yao <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Mark Yao <[email protected]>
Cc: Carlos Palminha <[email protected]>
Cc: Heiko Stübner <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/185ccf7d4473fa557044732402ca20b3d4007952.1498209896.git.joabreu@synopsys.com
7 years agodrm/i915: remove unused function declaration
Lionel Landwerlin [Fri, 4 Aug 2017 14:03:48 +0000 (15:03 +0100)]
drm/i915: remove unused function declaration

This function is not part of the driver anymore.

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: 90f4fcd56bda ("drm/i915: Remove forced stop ring on suspend/unload")
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/fb-helper: pass physical dimensions to fbdev
David Lechner [Fri, 4 Aug 2017 16:25:24 +0000 (11:25 -0500)]
drm/fb-helper: pass physical dimensions to fbdev

The fbdev subsystem has a place for physical dimensions (width and height
in mm) that is readable by userspace. Since DRM also knows these
dimensions, pass this information to the fbdev device.

This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
because fb_helper->fbdev may be NULL in drm_setup_crtcs().

Signed-off-by: David Lechner <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agouapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t
Mikko Rapeli [Sun, 6 Aug 2017 16:44:23 +0000 (18:44 +0200)]
uapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t

These are defined in linux/types.h or drm/drm.h. Fixes
user space compilation errors like:

drm/armada_drm.h:26:2: error: unknown type name ‘uint32_t’
  uint32_t handle;
  ^~~~~~~~

Signed-off-by: Mikko Rapeli <[email protected]>
Cc: Emil Velikov <[email protected]>
Cc: Gabriel Laskar <[email protected]>
Cc: Russell King <[email protected]>
Cc: Rob Clark <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: remove CEC engine register definitions
Russell King [Wed, 2 Aug 2017 18:41:08 +0000 (20:41 +0200)]
drm/bridge: dw-hdmi: remove CEC engine register definitions

We don't need the CEC engine register definitions, so let's remove them.

Signed-off-by: Russell King <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Tested-by: Hans Verkuil <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add cec driver
Russell King [Wed, 2 Aug 2017 18:41:07 +0000 (20:41 +0200)]
drm/bridge: dw-hdmi: add cec driver

Add a CEC driver for the dw-hdmi hardware.

Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Russell King <[email protected]>
[hans.verkuil: unsigned -> unsigned int]
[hans.verkuil: cec_transmit_done -> cec_transmit_attempt_done]
[hans.verkuil: add missing CEC_CAP_PASSTHROUGH]
Acked-by: Hans Verkuil <[email protected]>
Tested-by: Hans Verkuil <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add missing cec_notifier_put
Hans Verkuil [Mon, 7 Aug 2017 07:20:35 +0000 (09:20 +0200)]
drm/bridge: dw-hdmi: add missing cec_notifier_put

The __dw_hdmi_remove() function was missing a call to cec_notifier_put
to balance the cec_notifier_get in the probe function.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: remove unused and redundant callbacks
Peter Rosin [Thu, 13 Jul 2017 16:25:38 +0000 (18:25 +0200)]
drm: remove unused and redundant callbacks

Drivers no longer have any need for these callbacks, and there are no
users. Zap. Zap-zap-zzzap-p-pp-p.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agostaging: vboxvideo: remove dead gamma lut code
Peter Rosin [Fri, 4 Aug 2017 10:45:06 +0000 (12:45 +0200)]
staging: vboxvideo: remove dead gamma lut code

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code that was not doing anything
sensible anyway.

Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: dw-hdmi-i2s: add missing company name on Copyright
Kuninori Morimoto [Mon, 7 Aug 2017 04:09:41 +0000 (04:09 +0000)]
drm: dw-hdmi-i2s: add missing company name on Copyright

This driver's Copyright is under Renesas Solutions Corp.
This patch updates the year, because this driver was moved
into synopsys folder in 2017.

Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/87tw1khvnq.wl%[email protected]
7 years agodrm/i915/selftests: Retarget igt_render_engine_reset_fallback()
Chris Wilson [Fri, 28 Jul 2017 11:21:10 +0000 (12:21 +0100)]
drm/i915/selftests: Retarget igt_render_engine_reset_fallback()

The purpose of the test was to check per-engine resets would fallback to
the global reset when required, but first we actually need a test for a
basic i915_handle_error()!

Cc: Mika Kuoppala <[email protected]>
Cc: Michel Thierry <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Michel Thierry <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add better clock disable control
Russell King [Mon, 31 Jul 2017 14:29:46 +0000 (15:29 +0100)]
drm/bridge: dw-hdmi: add better clock disable control

The video setup path aways sets the clock disable register to a specific
value, which has the effect of disabling the CEC engine.  When we add the
CEC driver, this becomes a problem.

Fix this by only setting/clearing the bits that the video path needs to.

Reviewed-by: Jose Abreu <[email protected]>
Signed-off-by: Russell King <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add cec notifier support
Russell King [Mon, 31 Jul 2017 14:29:41 +0000 (15:29 +0100)]
drm/bridge: dw-hdmi: add cec notifier support

Add CEC notifier support to the HDMI bridge driver, so that the CEC
part of the IP can receive its physical address.

Signed-off-by: Russell King <[email protected]>
Tested-by: Neil Armstrong <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()
David Lechner [Thu, 3 Aug 2017 22:33:45 +0000 (17:33 -0500)]
drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()

This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that
drivers can have a driver-specific implementation if needed.

Suggested-by: Noralf Trønnes <[email protected]>
Signed-off-by: David Lechner <[email protected]>
Reviewed-by: Noralf Trønnes <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:23 +0000 (21:16 +0200)]
drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Stefan Agner <[email protected]>
Cc: Alison Wang <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Stefan Agner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: fix backlight invert for non-zero minimum brightness
Jani Nikula [Wed, 31 May 2017 08:33:55 +0000 (11:33 +0300)]
drm/i915: fix backlight invert for non-zero minimum brightness

When we started following the backlight minimum brightness in
6dda730e55f4 ("drm/i915: respect the VBT minimum backlight brightness")
we overlooked the brightness invert quirk. Even if we invert the
brightness, we need to take the min limit into account. We probably
missed this because the invert has only been required on gen4 for proper
operation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101127
Fixes: 6dda730e55f4 ("drm/i915: respect the VBT minimum backlight brightness")
Cc: Daniel Vetter <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915/shrinker: Wrap need_resched() inside preempt-disable
Chris Wilson [Fri, 4 Aug 2017 10:41:35 +0000 (11:41 +0100)]
drm/i915/shrinker: Wrap need_resched() inside preempt-disable

In order for us to successfully detect the end of a timeslice,
preemption must be disabled. Otherwise, inside the loop we may be
preempted many times without our noticing, and each time our timeslice
will be reset, invalidating need_resched()

Reported-by: Joonas Lahtinen <[email protected]>
Reported-by: Tomi Sarvela <[email protected]>
Fixes: 290271de34f6 ("drm/i915: Spin for struct_mutex inside shrinker")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: <[email protected]> # v4.13-rc1+
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Tested-by: Joonas Lahtinen <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
7 years agodrm/i915/perf: Initialise the dynamic sysfs attr
Chris Wilson [Thu, 3 Aug 2017 22:37:00 +0000 (23:37 +0100)]
drm/i915/perf: Initialise the dynamic sysfs attr

Use sysfs_attr_init() to dynamically initialise the
oa_config->sysfs_metric_id.attr as it has the important side-effect of
setting the lockdep key.

[    4.971513] [drm] Initialized i915 1.6.0 20170731 for 0000:00:02.0 on minor 0
[    4.973489] BUG: key ffff88026f6e7bb0 not in .data!
[    4.973506] DEBUG_LOCKS_WARN_ON(1)
[    4.973518] ------------[ cut here ]------------
[    4.973547] WARNING: CPU: 1 PID: 258 at kernel/locking/lockdep.c:3156 lockdep_init_map+0x1b2/0x1c0
[    4.973567] Modules linked in: i915(+) x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mei_me mii mei lpc_ich prime_numbers i2c_hid pinctrl_broxton pinctrl_intel
[    4.973645] CPU: 1 PID: 258 Comm: systemd-udevd Not tainted 4.13.0-rc3-CI-CI_DRM_2915+ #1
[    4.973664] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.10 09/29/2016
[    4.973686] task: ffff8802704c2740 task.stack: ffffc90000224000
[    4.973700] RIP: 0010:lockdep_init_map+0x1b2/0x1c0
[    4.973712] RSP: 0018:ffffc90000227a10 EFLAGS: 00010282
[    4.973726] RAX: 0000000000000016 RBX: ffff880262aac010 RCX: 0000000000000000
[    4.973741] RDX: 0000000080000001 RSI: 0000000000000001 RDI: ffffffff810ed1ab
[    4.973757] RBP: ffffc90000227a30 R08: 0000000000000001 R09: 0000000000000000
[    4.973774] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88026f6e7bb0
[    4.973789] R13: 0000000000000000 R14: ffff88026f6e7b98 R15: ffffffff81a24da0
[    4.973805] FS:  00007f588d7f58c0(0000) GS:ffff88027fc80000(0000) knlGS:0000000000000000
[    4.973823] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.973837] CR2: 00000082482e32a0 CR3: 0000000270531000 CR4: 00000000003406e0
[    4.973852] Call Trace:
[    4.973864]  __kernfs_create_file+0x71/0xe0
[    4.973876]  sysfs_add_file_mode_ns+0x85/0x1a0
[    4.973890]  internal_create_group+0xe5/0x2b0
[    4.973903]  sysfs_create_group+0xe/0x10
[    4.973985]  i915_perf_register+0xd9/0x220 [i915]
[    4.974044]  i915_driver_load+0xa72/0x16b0 [i915]
[    4.974124]  i915_pci_probe+0x32/0x90 [i915]

Annoyingly detected by CI, but not reported due to it occurring during boot
and disabling lockdep for later runs.

Fixes: f89823c21224 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Matthew Auld <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Cc: Andrzej Datczuk <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Matthew Auld <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
7 years agodrm: stm: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:37 +0000 (18:25 +0200)]
drm: stm: remove dead code and pointless local lut storage

The redundant fb helper .load_lut is no longer used, and can not
work right without also providing the fb helpers .gamma_set and
.gamma_get thus rendering the code in this driver suspect.

Just remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: radeon: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:36 +0000 (18:25 +0200)]
drm: radeon: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: nouveau: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:35 +0000 (18:25 +0200)]
drm: nouveau: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: mgag200: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:34 +0000 (18:25 +0200)]
drm: mgag200: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: i915: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:33 +0000 (18:25 +0200)]
drm: i915: remove dead code and pointless local lut storage

The driver stores lut values from the fbdev interface, and is able
to give them back, but does not appear to do anything with these
lut values. The generic fb helpers have replaced this function,
and may even have made the driver work for the C8 mode from the
fbdev interface. But that is untested.

Since the fb helpers .gamma_set and .gamma_get are obsolete,
remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: gma500: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:32 +0000 (18:25 +0200)]
drm: gma500: remove dead code and pointless local lut storage

The redundant fb helpers .gamma_set and .gamma_get are no longer
used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: cirrus: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:31 +0000 (18:25 +0200)]
drm: cirrus: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: ast: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:30 +0000 (18:25 +0200)]
drm: ast: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: armada: remove dead empty functions
Peter Rosin [Thu, 13 Jul 2017 16:25:29 +0000 (18:25 +0200)]
drm: armada: remove dead empty functions

The redundant fb helpers .gamma_set and .gamma_get are no longer used.
Remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: amd: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:28 +0000 (18:25 +0200)]
drm: amd: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: fix race with kms hotplug and fbdev
Mark yao [Tue, 1 Aug 2017 08:11:43 +0000 (16:11 +0800)]
drm/rockchip: fix race with kms hotplug and fbdev

According to the kerneldoc[0], should do fbdev setup before calling
drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race
into fbdev helper initial, and fb_helper->dev may be NULL pointer,
that would cause the bug:
[    0.735411] [00000200] *pgd=00000000f6ffe003, *pud=00000000f6ffe003, *pmd=0000000000000000
[    0.736156] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    0.736648] Modules linked in:
[    0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20
[    0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT)
[    0.738020] Workqueue: events cdn_dp_pd_event_work
[    0.738447] task: ffffffc0f21f3100 ti: ffffffc0f2218000 task.ti: ffffffc0f2218000
[    0.739109] PC is at mutex_lock+0x14/0x44
[    0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114
[    0.756253] [<ffffff8008a344f4>] mutex_lock+0x14/0x44
[    0.756260] [<ffffff8008445708>] drm_fb_helper_hotplug_event+0x30/0x114
[    0.756271] [<ffffff8008473c84>] rockchip_drm_output_poll_changed+0x18/0x20
[    0.756280] [<ffffff8008439fcc>] drm_kms_helper_hotplug_event+0x28/0x34
[    0.756286] [<ffffff800846c444>] cdn_dp_pd_event_work+0x394/0x3c4
[    0.756295] [<ffffff80080b2b38>] process_one_work+0x218/0x3e0
[    0.756302] [<ffffff80080b3538>] worker_thread+0x2e8/0x404
[    0.756308] [<ffffff80080b7e70>] kthread+0xe8/0xf0
[    0.756316] [<ffffff8008082690>] ret_from_fork+0x10/0x40

[0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: report error when check resource error
Mark yao [Mon, 31 Jul 2017 09:49:55 +0000 (17:49 +0800)]
drm/rockchip: vop: report error when check resource error

The user would be confused while facing a error commit without
any error report.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: round_up pitches to word align
Mark yao [Mon, 31 Jul 2017 09:49:50 +0000 (17:49 +0800)]
drm/rockchip: vop: round_up pitches to word align

VOP pitch register is word align, need align to word.

VOP_WIN0_VIR:
  bit[31:16] win0_vir_stride_uv
    Number of words of Win0 uv Virtual width
  bit[15:0] win0_vir_width
    Number of words of Win0 yrgb Virtual width
    ARGB888 : win0_vir_width
    RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3)
    RGB565 : ceil(win0_vir_width/2)
    YUV : ceil(win0_vir_width/4)

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: fix NV12 video display error
Mark yao [Mon, 31 Jul 2017 09:49:46 +0000 (17:49 +0800)]
drm/rockchip: vop: fix NV12 video display error

fixup the scale calculation formula on the case
src_height == (dst_height/2).

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: fix iommu page fault when resume
Mark yao [Mon, 31 Jul 2017 09:49:42 +0000 (17:49 +0800)]
drm/rockchip: vop: fix iommu page fault when resume

Iommu would get page fault with following path:
   vop_disable:
      1, disable all windows and set vop config done
      2, vop enter to standy, all windows not works, but their registers
         are not clean, when you read window's enable bit, may found the
         window is enable.

   vop_enable:
      1, memcpy(vop->regsbak, vop->regs, len)
         save current vop registers to vop->regsbak, then you can found
         window is enable on regsbak.
      2, VOP_WIN_SET(vop, win, gate, 1);
         force enable window gate, but gate and enable are on same
         hardware register, then window enable bit rewrite to vop hardware.
      3, vop power on, and vop might try to scan destroyed buffer,
         then iommu get page fault.

Move windows disable after vop regsbak restore, then vop regsbak mechanism
would keep tracing the modify, everything would be safe.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: no need wait vblank on crtc enable
Mark yao [Mon, 31 Jul 2017 09:49:37 +0000 (17:49 +0800)]
drm/rockchip: vop: no need wait vblank on crtc enable

Since atomic framework, crtc enable and disable are in pairs,
no need to wait vblank.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This page took 0.129029 seconds and 4 git commands to generate.