1. 08 7月, 2016 1 次提交
  2. 14 6月, 2016 1 次提交
  3. 07 6月, 2016 1 次提交
  4. 17 5月, 2016 1 次提交
  5. 12 5月, 2016 1 次提交
  6. 05 5月, 2016 2 次提交
  7. 01 4月, 2016 1 次提交
  8. 06 3月, 2016 1 次提交
  9. 20 2月, 2016 1 次提交
    • M
      drm/amdgpu: Don't hang in amdgpu_flip_work_func on disabled crtc. · e1d09dc0
      Mario Kleiner 提交于
      This fixes a regression introduced in Linux 4.4.
      
      This is a port of the same fix for radeon-kms in the
      patch "drm/radeon: Don't hang in radeon_flip_work_func
      on disabled crtc. (v2)"
      
      Limit the amount of time amdgpu_flip_work_func can
      delay programming a page flip, by both limiting the
      maximum amount of time per wait cycle and the maximum
      number of wait cycles. Continue the flip if the limit
      is exceeded, even if that may result in a visual or
      timing glitch.
      
      This is to prevent a hang of page flips, as reported
      in fdo bug #93746: Disconnecting a DisplayPort display
      in parallel to a kms pageflip getting queued can cause
      the following hang of page flips and thereby an unusable
      desktop:
      
      1. kms pageflip ioctl() queues pageflip -> queues execution
         of amdgpu_flip_work_func.
      
      2. Hotunplug of display causes the driver to DPMS OFF
         the unplugged display. Display engine shuts down,
         scanout no longer moves, but stays at its resting
         position at start line of vblank.
      
      3. amdgpu_flip_work_func executes while crtc is off, and
         due to the non-moving scanout position, the new flip
         delay code introduced into Linux 4.4 by
         commit 8e36f9d3 ("drm/amdgpu: Fixup hw vblank counter/ts..")
         enters an infinite wait loop.
      
      4. After reconnecting the display, the pageflip continues
         to hang in 3. and the display doesn't update its view
         of the desktop.
      
      This patch fixes the Linux 4.4 regression from fdo bug #93746
      
      <https://bugs.freedesktop.org/show_bug.cgi?id=93746>
      Reported-by: NBernd Steinhauser <linux@bernd-steinhauser.de>
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      
      Cc: <stable@vger.kernel.org> # 4.4+
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e1d09dc0
  10. 17 2月, 2016 3 次提交
  11. 11 2月, 2016 1 次提交
  12. 05 12月, 2015 2 次提交
    • A
      drm/amdgpu: Fixup hw vblank counter/ts for new drm_update_vblank_count() (v3) · 8e36f9d3
      Alex Deucher 提交于
      commit 4dfd6486 "drm: Use vblank timestamps to guesstimate how many
      vblanks were missed" introduced in Linux 4.4-rc1 makes the drm core
      more fragile to drivers which don't update hw vblank counters and
      vblank timestamps in sync with firing of the vblank irq and
      essentially at leading edge of vblank.
      
      This exposed a problem with radeon-kms/amdgpu-kms which do not
      satisfy above requirements:
      
      The vblank irq fires a few scanlines before start of vblank, but
      programmed pageflips complete at start of vblank and
      vblank timestamps update at start of vblank, whereas the
      hw vblank counter increments only later, at start of vsync.
      
      This leads to problems like off by one errors for vblank counter
      updates, vblank counters apparently going backwards or vblank
      timestamps apparently having time going backwards. The net result
      is stuttering of graphics in games, or little hangs, as well as
      total failure of timing sensitive applications.
      
      See bug #93147 for an example of the regression on Linux 4.4-rc:
      
      https://bugs.freedesktop.org/show_bug.cgi?id=93147
      
      This patch tries to align all above events better from the
      viewpoint of the drm core / of external callers to fix the problem:
      
      1. The apparent start of vblank is shifted a few scanlines earlier,
      so the vblank irq now always happens after start of this extended
      vblank interval and thereby drm_update_vblank_count() always samples
      the updated vblank count and timestamp of the new vblank interval.
      
      To achieve this, the reporting of scanout positions by
      radeon_get_crtc_scanoutpos() now operates as if the vblank starts
      radeon_crtc->lb_vblank_lead_lines before the real start of the hw
      vblank interval. This means that the vblank timestamps which are based
      on these scanout positions will now update at this earlier start of
      vblank.
      
      2. The driver->get_vblank_counter() function will bump the returned
      vblank count as read from the hw by +1 if the query happens after
      the shifted earlier start of the vblank, but before the real hw increment
      at start of vsync, so the counter appears to increment at start of vblank
      in sync with the timestamp update.
      
      3. Calls from vblank irq-context and regular non-irq calls are now
      treated identical, always simulating the shifted vblank start, to
      avoid inconsistent results for queries happening from vblank irq vs.
      happening from drm_vblank_enable() or vblank_disable_fn().
      
      4. The radeon_flip_work_func will delay mmio programming a pageflip until
      the start of the real vblank iff it happens to execute inside the shifted
      earlier start of the vblank, so pageflips now also appear to execute at
      start of the shifted vblank, in sync with vblank counter and timestamp
      updates. This to avoid some races between updates of vblank count and
      timestamps that are used for swap scheduling and pageflip execution which
      could cause pageflips to execute before the scheduled target vblank.
      
      The lb_vblank_lead_lines "fudge" value is calculated as the size of
      the display controllers line buffer in scanlines for the given video
      mode: Vblank irq's are triggered by the line buffer logic when the line
      buffer refill for a video frame ends, ie. when the line buffer source read
      position enters the hw vblank. This means that a vblank irq could fire at
      most as many scanlines before the current reported scanout position of the
      crtc timing generator as the number of scanlines the line buffer can
      maximally hold for a given video mode.
      
      This patch has been successfully tested on a RV730 card with DCE-3 display
      engine and on a evergreen card with DCE-4 display engine, in single-display
      and dual-display configuration, with different video modes.
      
      A similar patch is needed for amdgpu-kms to fix the same problem.
      
      Limitations:
      
      - Maybe replace the udelay() in the flip_work_func() by a suitable
        usleep_range() for a bit better efficiency? Will try that.
      
      - Line buffer sizes in pixels are hard-coded on < DCE-4 to a value
        i just guessed to be high enough to work ok, lacking info on the true
        sizes atm.
      
      Probably fixes: fdo#93147
      
      Port of Mario's radeon fix to amdgpu.
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      (v1) Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
      
      (v2) Refine amdgpu_flip_work_func() for better efficiency.
      
           In amdgpu_flip_work_func, replace the busy waiting udelay(5)
           with event lock held by a more performance and energy efficient
           usleep_range() until at least predicted true start of hw vblank,
           with some slack for scheduler happiness. Release the event lock
           during waits to not delay other outputs in doing their stuff, as
           the waiting can last up to 200 usecs in some cases.
      
           Also small fix to code comment and formatting in that function.
      
      (v2) Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
      
      (v3) Fix crash in crtc disabled case
      8e36f9d3
    • C
      drm/amdgpu: take a BO reference in the display code · e9d951a8
      Christian König 提交于
      No need for the GEM reference here.
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e9d951a8
  13. 24 11月, 2015 1 次提交
  14. 23 10月, 2015 1 次提交
  15. 21 10月, 2015 1 次提交
  16. 15 10月, 2015 1 次提交
  17. 06 10月, 2015 1 次提交
    • T
      drm/irq: Use unsigned int pipe in public API · 88e72717
      Thierry Reding 提交于
      This continues the pattern started in commit cc1ef118 ("drm/irq:
      Make pipe unsigned and name consistent"). This is applied to the public
      APIs and driver callbacks, so pretty much all drivers need to be updated
      to match the new prototypes.
      
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Jianwei Wang <jianwei.wang.chn@gmail.com>
      Cc: Alison Wang <alison.wang@freescale.com>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Mark Yao <mark.yao@rock-chips.com>
      Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
      Cc: Vincent Abriou <vincent.abriou@st.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      88e72717
  18. 25 9月, 2015 1 次提交
  19. 18 8月, 2015 2 次提交
  20. 04 6月, 2015 2 次提交