You need to sign in or sign up before continuing.
  1. 10 10月, 2017 1 次提交
  2. 27 9月, 2017 1 次提交
  3. 19 9月, 2017 1 次提交
  4. 31 8月, 2017 2 次提交
  5. 16 8月, 2017 1 次提交
  6. 15 8月, 2017 2 次提交
    • I
      drm/i915/hsw+: Add support for multiple power well regs · 9c3a16c8
      Imre Deak 提交于
      Future platforms increase the number of power wells which require
      additional control registers. A convenient way to select the correct
      register is to use the high bits of the power well ID as index. This
      patch only prepares for this, while upcoming platform enabling patches
      will add the actual new power well IDs and corresponding power well
      control registers.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Animesh Manna <animesh.manna@intel.com>
      Cc: Rakshmi Bhatia <rakshmi.bhatia@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NAnimesh Manna <animesh.manna@intel.com>
      Reviewed-by: NRakshmi Bhatia <rakshmi.bhatia@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170814151530.24154-2-imre.deak@intel.com
      9c3a16c8
    • D
      drm/i915: Avoid the gpu reset vs. modeset deadlock · 781cc76e
      Daniel Vetter 提交于
      ... using the biggest hammer we have. This is essentially a weaponized
      version of the timeout-based wedging Chris added in
      
      commit 36703e79
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      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: 4680816b ("drm/i915: Wait first for submission, before waiting for request completion")
      Fixes: 221fe799 ("drm/i915: Perform a direct reset of the GPU from the waiter")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170808080828.23650-1-daniel.vetter@ffwll.ch
      (cherry picked from commit 97154ec2)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      781cc76e
  7. 14 8月, 2017 3 次提交
    • D
      drm/i915: More surgically unbreak the modeset vs reset deadlock · 9db529aa
      Daniel Vetter 提交于
      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 <michel.thierry@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Cc: Michel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170808080828.23650-3-daniel.vetter@ffwll.chReviewed-by: NMichel Thierry <michel.thierry@intel.com>
      9db529aa
    • D
      drm/i915: Push i915_sw_fence_wait into the nonblocking atomic commit · 42b062b0
      Daniel Vetter 提交于
      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: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170808080828.23650-2-daniel.vetter@ffwll.ch
      42b062b0
    • D
      drm/i915: Avoid the gpu reset vs. modeset deadlock · 97154ec2
      Daniel Vetter 提交于
      ... using the biggest hammer we have. This is essentially a weaponized
      version of the timeout-based wedging Chris added in
      
      commit 36703e79
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      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: 4680816b ("drm/i915: Wait first for submission, before waiting for request completion")
      Fixes: 221fe799 ("drm/i915: Perform a direct reset of the GPU from the waiter")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v2)
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170808080828.23650-1-daniel.vetter@ffwll.ch
      97154ec2
  8. 11 8月, 2017 3 次提交
    • B
      drm/i915: Add format modifiers for Intel · 714244e2
      Ben Widawsky 提交于
      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ä <ville.syrjala@linux.intel.com>
      Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v8)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      714244e2
    • V
      drm/i915: Add render decompression support · 2e2adb05
      Ville Syrjälä 提交于
      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 <vandana.kannan@intel.com>
      * Daniel Vetter <daniel@ffwll.ch>
      * Ben Widawsky <ben@bwidawsk.net>
      
      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 <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NVille Syrjä <ville.syrjala@linux.intel.com>
      Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170801165817.7063-1-ben@bwidawsk.net
      2e2adb05
    • V
      drm/i915: Implement .get_format_info() hook for CCS · bbfb6ce8
      Ville Syrjälä 提交于
      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 <daniel@ffwll.ch>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Acked-by: NJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (v3)
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      Signed-off-by: NVille Syrjä <ville.syrjala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      bbfb6ce8
  9. 08 8月, 2017 2 次提交
  10. 02 8月, 2017 1 次提交
    • B
      drm: Plumb modifiers through plane init · e6fc3b68
      Ben Widawsky 提交于
      This is the plumbing for supporting fb modifiers on planes. Modifiers
      have already been introduced to some extent, but this series will extend
      this to allow querying modifiers per plane. Based on this, the client to
      enable optimal modifications for framebuffers.
      
      This patch simply allows the DRM drivers to initialize their list of
      supported modifiers upon initializing the plane.
      
      v2: A minor addition from Daniel
      
      v3:
      * Updated commit message
      * s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu)
      * Remove some excess newlines (Liviu)
      * Update comment for > 64 modifiers (Liviu)
      
      v4: Minor comment adjustments (Liviu)
      
      v5: Some new platforms added due to rebase
      
      v6: Add some missed plane inits (or maybe they're new - who knows at
      this point) (Daniel)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: Daniel Stone <daniels@collabora.com> (v2)
      Reviewed-by: NLiviu Dudau <Liviu.Dudau@arm.com>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      e6fc3b68
  11. 28 7月, 2017 2 次提交
    • I
      drm/i915: Fix scaler init during CRTC HW state readout · 283d6860
      Imre Deak 提交于
      The scaler allocation code depends on a non-zero default value for the
      crtc scaler_id, so make sure we initialize the scaler state accordingly
      even if the crtc is off. This fixes at least an initial YUV420 modeset
      (added in a follow-up patchset by Shashank) when booting with the screen
      off: after the initial HW readout and modeset which enables the scaler a
      subsequent modeset will disable the scaler which isn't properly
      allocated. This results in a funky HW state where the pipe scaler HW
      registers can't be modified and the normally black screen is grey and
      shifted to the right or jitters.
      
      The problem was revealed by Shashank's YUV420 patchset and first
      reported by Ville.
      
      v2:
      - In the stable tag also include versions which need backporting (Jani)
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chandra Konduru <chandra.konduru@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: <stable@vger.kernel.org> # 4.2.x
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Fixes: a1b2278e ("drm/i915: skylake panel fitting using shared scalers")
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NMahesh Kumar <mahesh1.kumar@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170720112820.26816-1-imre.deak@intel.comSigned-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit 5fb9dadf)
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      283d6860
    • D
      drm/i915: Unbreak gpu reset vs. modeset locking · 4706ca77
      Daniel Vetter 提交于
      Taking the modeset locks unconditionally isn't the greatest idea,
      because atm that part is still broken and times out (and then atomic
      keels over). And there's really no reason to do so, the old code
      didn't do that either.
      
      To make the patch a bit simpler let's also nuke 2 cases that are only
      around for the old mmioflip paths. Atomic nonblocking workers will not
      die (minus bugs) when a gpu reset happens.
      
      And of course this doesn't fix any of the gpu reset vs. modeset
      deadlock fun, but it at least stop modern CI machines from keeling
      over all over the place for no reason at all.
      
      And we still have the explicit testcases to run the fake gpu reset, so
      coverage isn't that much worse.
      
      v2: Split out additional changes on top, restrict this to purely reducing
      the critical section of modeset locks.
      
      v2: Review from Maarten
      - update comments
      - don't oops when state is NULL in intel_finish_reset, but try to at
        least still drop locks properly. The hw is going to be toast anyway.
      
      Fixes: 73974893 ("drm/i915: Fix modeset handling during gpu reset, v5.")
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170719125502.25696-3-daniel.vetter@ffwll.ch
      (cherry picked from commit ce87ea15)
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4706ca77
  12. 27 7月, 2017 9 次提交
  13. 26 7月, 2017 1 次提交
  14. 21 7月, 2017 4 次提交
  15. 20 7月, 2017 3 次提交
  16. 19 7月, 2017 1 次提交
    • D
      drm/i915: Fix fbdev unload sequence · 4f256d82
      Daniel Vetter 提交于
      First thing we need to do is unregister the fbdev instance, but we
      can't just go ahead and kfree it. That must wait until the hotplug and
      polling work are stopped, since they can race with the with the
      teardown. That means we need to split up the fbdev teardown into the
      unregister part and the cleanup part.
      
      I originally suspected that this was broken in one of the unload
      shuffles, but on closer inspection the oldest sequence I've dug out
      also gets this wrong. Just not quite so badly.
      
      I've run drv_module_reload a few hundred times and it's rock solid
      compared to insta-death beforehand. This bug seems to have been
      uncovered by
      
      commit 88be58be
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jul 6 15:00:19 2017 +0200
      
          drm/i915/fbdev: Always forward hotplug events
      
      But the effect of that seems to only be to increase the race window
      enough to make it blow up easier. I'm not exactly clear on what's
      going on there ...
      
      v2: Fix whitespace and use fetch_and_zero (Chris).
      
      Testcase: igt/drv_module_reload
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101791
      Cc: martin.peres@free.fr
      Cc: chris@chris-wilson.co.uk
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170714224656.6431-2-daniel.vetter@ffwll.ch
      4f256d82
  17. 18 7月, 2017 2 次提交
  18. 07 7月, 2017 1 次提交