1. 23 7月, 2014 5 次提交
    • D
      drm/i915: Use genX_ prefix for gt irq enable/disable functions · 480c8033
      Daniel Vetter 提交于
      Traditionally we use genX_ for GT/render stuff and the codenames for
      display stuff. But the gt and pm interrupt handling functions on
      gen5/6+ stuck out as exceptions, so convert them.
      
      Looking at the diff this nicely realigns our ducks since almost all
      the callers are already platform-specific functions following the
      genX_ pattern.
      
      Spotted while reviewing some internal rps patches.
      
      No function change in this patch.
      Acked-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      480c8033
    • D
      drm/i915: Also give the sprite width for WM computation · ed57cb8a
      Damien Lespiau 提交于
      In the future, we'll need the height of the fb to fetch from memory for
      WM computation.
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ed57cb8a
    • V
      drm/i915: Add aspect ratio property for HDMI · 94a11ddc
      Vandana Kannan 提交于
      Create and attach the drm property to set aspect ratio. If there is no user
      specified value, then PAR_NONE/Automatic option is set by default. User can
      select aspect ratio 4:3 or 16:9. The aspect ratio selected by user would
      come into effect with a mode set.
      
      v2: Modified switch case to include aspect ratio enum changes
      
      v3: Modified the patch according the change in the earlier patch to return
      errno in case property creation fails. With this change, property will be
      attached only if creation is successful
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      94a11ddc
    • D
      drm/i915: Fix up PSR frontbuffer tracking · 9ca15301
      Daniel Vetter 提交于
      I've tried to split this up, but all the changes are so tightly
      related that I didn't find a good way to do this without breaking
      bisecting. Essentially this completely changes how psr is glued into
      the overall driver, and there's not much you can do to soften such a
      paradigm change.
      
      - Use frontbuffer tracking bits stuff to separate disable and
        re-enable.
      
      - Don't re-check everything in the psr work. We have now accurate
        tracking for everything, so no need to check for sprites or tiling
        really. Allows us to ditch tons of locks.
      
      - That in turn allows us to properly cancel the work in the disable
        function - no more deadlocks.
      
      - Add a check for HSW sprites and force a flush. Apparently the
        hardware doesn't forward the flushing when updating the sprite base
        address. We can do the same trick everywhere else we have such
        issues, e.g. on baytrail with ... everything.
      
      - Don't re-enable psr with a delay in psr_exit. It really must be
        turned off forever if we detect a gtt write. At least with the
        current frontbuffer render tracking. Userspace can do a busy ioctl
        call or no-op pageflip to re-enable psr.
      
      - Drop redundant checks for crtc and crtc->active - now that they're
        only called from enable this is guaranteed.
      
      - Fix up the hsw port check. eDP can also happen on port D, but the
        issue is exactly that it doesn't work there. So an || check is
        wrong.
      
      - We still schedule the psr work with a delay. The frontbuffer
        flushing interface mandates that we upload the next full frame, so
        need to wait a bit. Once we have single-shot frame uploads we can do
        better here.
      
      v2: Don't enable psr initially, rely upon the fb flush of the initial
      plane setup for that. Gives us more unified code flow and makes the
      crtc enable sequence less a special case.
      
      v3: s/psr_exit/psr_invalidate/ for consistency
      
      v4: Fixup whitespace.
      
      v5: Correctly bail out of psr_invalidate/flush when
      dev_priv->psr.enabled is NULL. Spotted by Rodrigo.
      
      v6:
      - Only schedule work when there's work to do. Fixes WARNINGs reported
        by Rodrigo.
      - Comments Chris requested to clarify the code.
      
      v7: Fix conflict on rebase (Rodrigo)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v6)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ca15301
    • B
      drm/i915: Power gating display wells during i915_pm_suspend · b04c5bd6
      Borun Fu 提交于
      On VLV, after i915_pm_suspend display power wells are staying
      power ungated. So, after initiating mem sleep "echo mem > /sys/power/state"
      Display is staing D0 State. There might be better way/place to power gate
      these wells. Also, we need to make sure that if wells are power gated due to
      DPMS OFF sequence, they need not be turned off by i915_pm_suspend again.
      
      v2: Extracted helper for intel_crtc_disable and power gating CRTC power wells.
      [Daniel]
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Change-Id: I34c80da66aa24c423a5576c68aa1f3a8d0f43848
      Signed-off-by: NBorun Fu <borun.fu@intel.com>
      Signed-off-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b04c5bd6
  2. 11 7月, 2014 3 次提交
  3. 09 7月, 2014 1 次提交
  4. 08 7月, 2014 1 次提交
    • D
      drm/i915: Support pf CRC source on haswell transcoder edp · fabf6e51
      Daniel Vetter 提交于
      The always-on power well pixel path on haswell is routed such that it
      bypasses the panel fitter when we use is. Which means the pfit CRC
      source won't work in that configuration.
      
      Add a new disallow-bypass flags to the pfit pipe config state and set
      it when we want to use the pf CRC. Results in a bit of flicker, but
      should get the job done. We'll also undo do it afterwards to make sure
      other tests arent' negatively affected.
      
      Totally untested due to lack of hsw laptops around here.
      
      v2: s/disallow_bypass/force_power_well_on/ to avoid a double negative
      (Damien).
      
      v3: force_thru because roadsigns.
      
      v4: Don't forget the power wells! Also note that until the runtime pm
      for DPMS series is fully merged the simple disable/enable trick won't
      work since the ->crtc_mode_set callback is still required to do nasty
      things. This stuff is tricky, but I think by both fixing up
      get_crtc_power_domains and the debugfs wa code we should always
      grab/drop the additional power well correctly.
      
      v5: Wrap in () as suggested by Damien to avoid setting reserved values
      for the edp transcoder path on bdw+
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=72864
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Tested-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fabf6e51
  5. 07 7月, 2014 4 次提交
  6. 23 6月, 2014 1 次提交
  7. 20 6月, 2014 1 次提交
    • D
      drm/i915: Track frontbuffer invalidation/flushing · f99d7069
      Daniel Vetter 提交于
      So these are the guts of the new beast. This tracks when a frontbuffer
      gets invalidated (due to frontbuffer rendering) and hence should be
      constantly scaned out, and when it's flushed again and can be
      compressed/one-shot-upload.
      
      Rules for flushing are simple: The frontbuffer needs one more full
      upload starting from the next vblank. Which means that the flushing
      can _only_ be called once the frontbuffer update has been latched.
      
      But this poses a problem for pageflips: We can't just delay the
      flushing until the pageflip is latched, since that would pose the risk
      that we override frontbuffer rendering that has been scheduled
      in-between the pageflip ioctl and the actual latching.
      
      To handle this track asynchronous invalidations (and also pageflip)
      state per-ring and delay any in-between flushing until the rendering
      has completed. And also cancel any delayed flushing if we get a new
      invalidation request (whether delayed or not).
      
      Also call intel_mark_fb_busy in both cases in all cases to make sure
      that we keep the screen at the highest refresh rate both on flips,
      synchronous plane updates and for frontbuffer rendering.
      
      v2: Lots of improvements
      
      Suggestions from Chris:
      - Move invalidate/flush in flush_*_domain and set_to_*_domain.
      - Drop the flush in busy_ioctl since it's redundant. Was a leftover
        from an earlier concept to track flips/delayed flushes.
      - Don't forget about the initial modeset enable/final disable.
        Suggested by Chris.
      
      Track flips accurately, too. Since flips complete independently of
      rendering we need to track pending flips in a separate mask. Again if
      an invalidate happens we need to cancel the evenutal flush to avoid
      races.
      
      v3:
      Provide correct header declarations for flip functions. Currently not
      needed outside of intel_display.c, but part of the proper interface.
      
      v4: Add proper domain management to fbcon so that the fbcon buffer is
      also tracked correctly.
      
      v5: Fixup locking around the fbcon set_to_gtt_domain call.
      
      v6: More comments from Chris:
      - Split out fbcon changes.
      - Drop superflous checks for potential scanout before calling intel_fb
        functions - we can micro-optimize this later.
      - s/intel_fb_/intel_fb_obj_/ to make it clear that this deals in gem
        object. We already have precedence for fb_obj in the pin_and_fence
        functions.
      
      v7: Clarify the semantics of the flip flush handling by renaming
      things a bit:
      - Don't go through a gem object but take the relevant frontbuffer bits
        directly. These functions center on the plane, the actual object is
        irrelevant - even a flip to the same object as already active should
        cause a flush.
      - Add a new intel_frontbuffer_flip for synchronous plane updates. It
        currently just calls intel_frontbuffer_flush since the implemenation
        differs.
      
      This way we achieve a clear split between one-shot update events on
      one side and frontbuffer rendering with potentially a very long delay
      between the invalidate and flush.
      
      Chris and I also had some discussions about mark_busy and whether it
      is appropriate to call from flush. But mark busy is a state which
      should be derived from the 3 events (invalidate, flush, flip) we now
      have by the users, like psr does by tracking relevant information in
      psr.busy_frontbuffer_bits. DRRS (the only real use of mark_busy for
      frontbuffer) needs to have similar logic. With that the overall
      mark_busy in the core could be removed.
      
      v8: Only when retiring gpu buffers only flush frontbuffer bits we
      actually invalidated in a batch. Just for safety since before any
      additional usage/invalidate we should always retire current rendering.
      Suggested by Chris Wilson.
      
      v9: Actually use intel_frontbuffer_flip in all appropriate places.
      Spotted by Chris.
      
      v10: Address more comments from Chris:
      - Don't call _flip in set_base when the crtc is inactive, avoids redunancy
        in the modeset case with the initial enabling of all planes.
      - Add comments explaining that the initial/final plane enable/disable
        still has work left to do before it's fully generic.
      
      v11: Only invalidate for gtt/cpu access when writing. Spotted by Chris.
      
      v12: s/_flush/_flip/ in intel_overlay.c per Chris' comment.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f99d7069
  8. 19 6月, 2014 2 次提交
    • D
      drm/i915: Drop schedule_back from psr_exit · 3108e99e
      Daniel Vetter 提交于
      It doesn't make sense to never again schedule the work, since by the
      time we might want to re-enable psr the world might have changed and
      we can do it again.
      
      The only exception is when we shut down the pipe, but that's an
      entirely different thing and needs to be handled in psr_disable.
      
      Note that later patch will again split psr_exit into psr_invalidate
      and psr_flush. But the split is different and this simplification
      helps with the transition.
      
      v2: Improve the commit message a bit.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3108e99e
    • D
      drm/i915: Ditch intel_edp_psr_update · e6e559d4
      Daniel Vetter 提交于
      We have _enable/_disable interfaces now for the modeset sequence and
      intel_edp_psr_exit for workarounds.
      
      The callsites in intel_display.c are all redundant with the modeset
      sequence enable/disable calls in intel_ddi.c. The one in
      intel_sprite.c is real and needs to be switched to psr_exit.
      
      If this breaks anything then we need to augment the enable/disable
      functions accordingly.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e6e559d4
  9. 17 6月, 2014 1 次提交
    • S
      drm/i915: Replaced Blitter ring based flips with MMIO flips · 84c33a64
      Sourab Gupta 提交于
      This patch enables the framework for using MMIO based flip calls,
      in contrast with the CS based flip calls which are being used currently.
      
      MMIO based flip calls can be enabled on architectures where
      Render and Blitter engines reside in different power wells. The
      decision to use MMIO flips can be made based on workloads to give
      100% residency for Media power well.
      
      v2: The MMIO flips now use the interrupt driven mechanism for issuing the
      flips when target seqno is reached. (Incorporating Ville's idea)
      
      v3: Rebasing on latest code. Code restructuring after incorporating
      Damien's comments
      
      v4: Addressing Ville's review comments
          -general cleanup
          -updating only base addr instead of calling update_primary_plane
          -extending patch for gen5+ platforms
      
      v5: Addressed Ville's review comments
          -Making mmio flip vs cs flip selection based on module parameter
          -Adding check for DRIVER_MODESET feature in notify_ring before calling
           notify mmio flip.
          -Other changes mostly in function arguments
      
      v6: -Having a seperate function to check condition for using mmio flips (Ville)
          -propogating error code from i915_gem_check_olr (Ville)
      
      v7: -Adding __must_check with i915_gem_check_olr (Chris)
          -Renaming mmio_flip_data to mmio_flip (Chris)
          -Rebasing on latest nightly
      
      v8: -Rebasing on latest code
          -squash 3rd patch in series(mmio setbase vs page flip race) with this patch
          -Added new tiling mode update in intel_do_mmio_flip (Chris)
      
      v9: -check for obj->last_write_seqno being 0 instead of obj->ring being NULL in
      intel_postpone_flip, as this is a more restrictive condition (Chris)
      
      v10: -Applied Chris's suggestions for squashing patches 2,3 into this patch.
      These patches make the selection of CS vs MMIO flip at the page flip time, and
      make the module parameter for using mmio flips as tristate, the states being
      'force CS flips', 'force mmio flips', 'driver discretion'.
      Changed the logic for driver discretion (Chris)
      
      v11: Minor code cleanup(better readability, fixing whitespace errors, using
      lockdep to check mutex locked status in postpone_flip, removal of __must_check
      in function definition) (Chris)
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NSourab Gupta <sourab.gupta@intel.com>
      Signed-off-by: NAkash Goel <akash.goel@intel.com>
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # snb, ivb
      [danvet: Fix up parameter alignement checkpatch spotted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      84c33a64
  10. 14 6月, 2014 1 次提交
    • R
      drm/i915: Force PSR exit by inactivating it. · 7c8f8a70
      Rodrigo Vivi 提交于
      The perfect solution for psr_exit is the hardware tracking the changes and
      doing the psr exit by itself. This scenario works for HSW and BDW with some
      environments like Gnome and Wayland.
      
      However there are many other scenarios that this isn't true. Mainly one right
      now is KDE users on HSW and BDW with PSR on. User would miss many screen
      updates. For instances any key typed could be seen only when mouse cursor is
      moved. So this patch introduces the ability of trigger PSR exit on kernel side
      on some common cases that.
      
      Most of the cases are coverred by psr_exit at set_domain. The remaining cases
      are coverred by triggering it at set_domain, busy_ioctl, sw_finish and
      mark_busy.
      
      The downside here might be reducing the residency time on the cases this
      already work very wall like Gnome environment. But so far let's get focused
      on fixinge issues sio PSR couild be used for everybody and we could even
      get it enabled by default. Later we can add some alternatives to choose the
      level of PSR efficiency over boot flag of even over crtc property.
      
      v2: remove exit from connector_dpms. Daniel pointed this is the wrong way and
      also this isn't needed for BDW and HSW anyway.
      
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NVijay Purushothaman <vijay.a.purushothaman@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7c8f8a70
  11. 13 6月, 2014 1 次提交
    • M
      drm/i915: Switch to unified plane cursor handling (v4) · 3d7d6510
      Matt Roper 提交于
      The DRM core will translate calls to legacy cursor ioctls into universal
      cursor calls automatically, so there's no need to maintain the legacy
      cursor support.  This greatly simplifies the transition since we don't
      have to handle reference counting differently depending on which cursor
      interface was called.
      
      The aim here is to transition to the universal plane interface with
      minimal code change.  There's a lot of cleanup that can be done (e.g.,
      using state stored in crtc->cursor->fb rather than intel_crtc) that is
      left to future patches.
      
      v4:
       - Drop drm_gem_object_unreference() that is no longer needed now that
         we receive the GEM obj directly rather than looking up the ID.
      v3:
       - Pass cursor obj to intel_crtc_cursor_set_obj() if cursor fb changes,
         even if 'visible' is false.  intel_crtc_cursor_set_obj() will notice
         that the cursor isn't visible and disable it properly, but we still
         need to get intel_crtc->cursor_addr set properly so that we behave
         properly if the cursor becomes visible again in the future without
         changing the cursor buffer (noted by Chris Wilson and verified
         via i-g-t kms_cursor_crc).
       - s/drm_plane_init/drm_universal_plane_init/.  Due to type
         compatibility between enum and bool, everything actually works
         correctly with the wrong init call, except for the type of plane that
         gets exposed to userspace (it shows up as type 'primary' rather than
         type 'cursor').
      v2:
       - Remove duplicate dimension checks on cursor
       - Drop explicit cursor disable from crtc destroy (fb & plane
         destruction will take care of that now)
       - Use DRM plane helper to check update parameters
      
      Cc: intel-gfx@lists.freedesktop.org
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: Pallavi G<pallavi.g@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3d7d6510
  12. 12 6月, 2014 1 次提交
  13. 11 6月, 2014 3 次提交
  14. 05 6月, 2014 3 次提交
    • C
      drm/i915: Always apply cursor width changes · 4b0e333e
      Chris Wilson 提交于
      It is possible for userspace to create a big object large enough for a
      256x256, and then switch over to using it as a 64x64 cursor. This
      requires the cursor update routines to check for a change in width on
      every update, rather than just when the cursor is originally enabled.
      
      This also fixes an issue with 845g/865g which cannot change the base
      address of the cursor whilst it is active.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [Antti:rebased, adjusted macro names and moved some lines, no functional
      changes]
      Reviewed-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Tested-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Cc: stable@vger.kernel.org
      Testcase: igt/kms_cursor_crc/cursor-size-change
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4b0e333e
    • J
      drm/i915/vlv: assert and de-assert sideband reset at boot and resume v3 · 57021059
      Jesse Barnes 提交于
      This is a bit like the CMN reset de-assert we do in DPIO_CTL, except
      that it resets the whole common lane section of the PHY.  This is
      required on machines where the BIOS doesn't do this for us on boot or
      resume to properly re-calibrate and get the PHY ready to transmit data.
      
      Without this patch, such machines won't resume correctly much of the time,
      with the symptom being a 'port ready' timeout and/or a link training
      failure.
      
      Note that simply asserting reset at suspend and de-asserting at resume
      is not sufficient, nor is simply de-asserting at boot.  Both of these
      cases have been tested and have still been found to have failures on
      some configurations.
      
      v2: extract simpler set_power_well function for use in reset_dpio (Imre)
          move to reset_dpio (Daniel & Ville)
      v3: don't reset if DPIO reset is already de-asserted (Imre)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      57021059
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  15. 23 5月, 2014 1 次提交
  16. 22 5月, 2014 3 次提交
  17. 21 5月, 2014 2 次提交
    • D
      drm/i915: Accurately initialize fifo underrun state on gmch platforms · c5ab3bc0
      Daniel Vetter 提交于
      We don't have hardware based disable bits on gmch platforms, so need
      to block spurious underrun reports in software. Which means that we
      _must_ start out with fifo underrun reporting disabled everywhere.
      
      This is in big contrast to ilk/hsw/cpt where there's only _one_
      disable bit for all platforms and hence we must allow underrun
      reporting on disabled pipes. Otherwise nothing really works,
      especially the CRC support since that's key'ed off the same irq
      disable bit.
      
      This allows us to ditch the fifo underrun reporting hack from the vlv
      runtime pm code and unexport the internal function from i915_irq.c
      again. Yay!
      
      v2: Keep the display irq disabling, spotted by Imre.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c5ab3bc0
    • V
      drm/i915: Fix mmio vs. CS flip race on ILK+ · 75f7f3ec
      Ville Syrjälä 提交于
      Starting from ILK, mmio flips also cause a flip done interrupt to be
      signalled. This means if we first do a set_base and follow it
      immediately with the CS flip, we might mistake the flip done interrupt
      caused by the set_base as the flip done interrupt caused by the CS
      flip.
      
      The hardware has a flip counter which increments every time a mmio or
      CS flip is issued. It basically counts the number of DSPSURF register
      writes. This means we can sample the counter before we put the CS
      flip into the ring, and then when we get a flip done interrupt we can
      check whether the CS flip has actually performed the surface address
      update, or if the interrupt was caused by a previous but yet
      unfinished mmio flip.
      
      Even with the flip counter we still have a race condition of the CS flip
      base address update happens after the mmio flip done interrupt was
      raised but not yet processed by the driver. When the interrupt is
      eventually processed, the flip counter will already indicate that the
      CS flip has been executed, but it would not actually complete until the
      next start of vblank. We can use the DSPSURFLIVE register to check
      whether the hardware is actually scanning out of the buffer we expect,
      or if we managed hit this race window.
      
      This covers all the cases where the CS flip actually changes the base
      address. If the base address remains unchanged, we might still complete
      the CS flip before it has actually completed. But since the address
      didn't change anyway, the premature flip completion can't result in
      userspace overwriting data that's still being scanned out.
      
      CTG already has the flip counter and DSPSURFLIVE registers, and
      although the flip done interrupt is still limited to CS flips alone,
      the code now also checks the flip counter on CTG as well.
      
      v2: s/dspsurf/gtt_offset/ (Chris)
      
      Testcase: igt/kms_mmio_vs_cs_flip/setcrtc_vs_cs_flip
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73027Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      [danvet: Add g4x_ prefix to flip_count_after_eq.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      75f7f3ec
  18. 16 5月, 2014 4 次提交
  19. 14 5月, 2014 1 次提交
  20. 13 5月, 2014 1 次提交