1. 09 3月, 2016 1 次提交
    • D
      drm/radeon: Switch to drm_vblank_on/off · 777e3cbc
      Daniel Vetter 提交于
      These should be functionally equivalent to the older per/post modeset
      functions, except that they block out drm_vblank_get right away.
      There's only the clock adjusting code (outside of pageflips) in
      readone which uses drm_vblank_get. But that code doesn't synchronize
      against concurrent modesets and instead handles any such races by
      waiting for the right vblank to arrive with a short timetout.
      
      The longer-term plan here is to switch all kms drivers to
      drm_vblank_on/off so that common code like pending event cleanup can
      be done there, while drm_vblank_pre/post_modeset will be purely
      drm internal for the old UMS ioctl.
      
      Note that with this patch Michel uncovered a bug in the dri3
      implementation of the DDX (it does vblank waits when the pipe is off),
      which had to be fixed first.
      
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Acked-and-tested-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      777e3cbc
  2. 27 2月, 2016 1 次提交
  3. 16 2月, 2016 1 次提交
  4. 13 2月, 2016 1 次提交
    • L
      drm/radeon: Fix WARN_ON if DRM_DP_AUX_CHARDEV is enabled · 477d9f0e
      Lukas Wunner 提交于
      Rafael Antognolli's new DRM_DP_AUX_CHARDEV feature causes a WARN_ON
      if drm_dp_aux->dev == drm_connector->kdev and drm_dp_aux_unregister()
      is called after drm_connector_unregister(). radeon is the only driver
      affected by this besides i915. (amdgpu calls drm_dp_aux_unregister()
      before drm_connector_unregister().)
      
      Cc: Rafael Antognolli <rafael.antognolli@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      477d9f0e
  5. 11 2月, 2016 1 次提交
    • M
      drm/radeon: Avoid double gpu reset by adding a timeout on IB ring tests. · 04db4caf
      Matthew Dawson 提交于
      When the radeon driver resets a gpu, it attempts to test whether all the
      rings can successfully handle an IB.  If these rings fail to respond, the
      process will wait forever.  Another gpu reset can't happen at this point,
      as the current reset holds a lock required to do so.  Instead, make all
      the IB tests run with a timeout, so the system can attempt to recover
      in this case.
      
      While this doesn't fix the underlying issue with card resets failing, it
      gives the system a higher chance of recovering.  These timeouts have been
      confirmed to help both a Tathi and Hawaii card recover after a gpu reset.
      
      This also adds a new function, radeon_fence_wait_timeout, that behaves like
      fence_wait_timeout.  It is used instead of fence_wait_timeout as it continues
      to work during a reset.  radeon_fence_wait is changed to be implemented
      using this function.
      
      V2:
       - Changed the timeout to 1s, as the default 10s from radeon_wait_timeout was
      too long.  A timeout of 100ms was tested and found to be too short.
       - Changed radeon_fence_wait_timeout to behave more like fence_wait_timeout.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NMatthew Dawson <matthew@mjdsystems.ca>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      04db4caf
  6. 09 2月, 2016 3 次提交
  7. 02 2月, 2016 1 次提交
  8. 28 1月, 2016 3 次提交
  9. 26 1月, 2016 1 次提交
    • R
      drm/radeon: only init fbdev if we have connectors · f95429ec
      Rob Clark 提交于
      This fixes an issue that was noticed on an optimus/prime laptop with
      a kernel that was old enough to not support the integrated intel gfx
      (which was driving all the outputs), but did have support for the
      discrete radeon gpu.  The end result was not falling back to VESA and
      leaving the user with a black screen.
      
      (Plus it is kind of silly to create an framebuffer device if there
      are no outputs hooked up to the gpu.)
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f95429ec
  10. 25 1月, 2016 1 次提交
  11. 22 1月, 2016 1 次提交
  12. 14 1月, 2016 1 次提交
  13. 09 1月, 2016 2 次提交
  14. 05 1月, 2016 1 次提交
  15. 04 1月, 2016 1 次提交
  16. 22 12月, 2015 3 次提交
  17. 19 12月, 2015 5 次提交
    • N
      drm/radeon: only increment sync_seq when a fence is really emitted · b24c683a
      Nicolai Hähnle 提交于
      In the rare situation where the kmalloc fails we're probably screwed anyway,
      but let's try to be more robust about it.
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NNicolai Hähnle <Nicolai.Haehnle@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      b24c683a
    • N
      drm/radeon: fix typo in cik_ring_ib_execute documentation (v2) · 5fc45397
      Nicolai Hähnle 提交于
      v2: agd: clarify commit message, fix "an" as spotted by Michel.
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NNicolai Hähnle <nicolai.haehnle@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      5fc45397
    • T
      drm/radeon: Update radeon_get_vblank_counter_kms() · 4e926d2d
      Thierry Reding 提交于
      Commit 88e72717 ("drm/irq: Use unsigned int pipe in public API")
      updated the prototype of this function but not the implementation. This
      wasn't noticed even through compile tests because the prototype is part
      of the source file that uses it and hence the compiler won't know the
      prototype when it compiles the implementation.
      
      The right thing would've been to move the prototype to a header that's
      included in radeon_kms.c so that the implementation signature could be
      checked against it, but the closest thing would've been radeon_drv.h
      and including that results in a lot of build errors, so we'll leave it
      as is for now.
      
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      4e926d2d
    • M
      drm/radeon: Fixup hw vblank counter/ts for new drm_update_vblank_count() (v2) · c55d21ea
      Mario Kleiner 提交于
      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:
      
      - 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.
      
      Fixes: fdo#93147
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Harry Wentland <Harry.Wentland@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      
      (v1) Tested-by: Dave Witbrodt <dawitbro@sbcglobal.net>
      
      (v2) Refine radeon_flip_work_func() for better efficiency:
      
           In radeon_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.
      
           Retested on DCE-3 and DCE-4 to verify it still works nicely.
      
      (v2) Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      c55d21ea
    • S
      drm/radeon: Fix "slow" audio over DP on DCE8+ · ac4a9350
      Slava Grigorev 提交于
      DP audio is derived from the dfs clock.
      Signed-off-by: NSlava Grigorev <slava.grigorev@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      ac4a9350
  18. 11 12月, 2015 1 次提交
  19. 09 12月, 2015 3 次提交
  20. 08 12月, 2015 1 次提交
  21. 05 12月, 2015 2 次提交
    • M
      drm/radeon: Fixup hw vblank counter/ts for new drm_update_vblank_count() (v2) · 5b5561b3
      Mario Kleiner 提交于
      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:
      
      - 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.
      
      Fixes: fdo#93147
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Harry Wentland <Harry.Wentland@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      
      (v1) Tested-by: Dave Witbrodt <dawitbro@sbcglobal.net>
      
      (v2) Refine radeon_flip_work_func() for better efficiency:
      
           In radeon_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.
      
           Retested on DCE-3 and DCE-4 to verify it still works nicely.
      
      (v2) Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      5b5561b3
    • L
      drm/radeon: Retry DDC probing on DVI on failure if we got an HPD interrupt · cb5d4166
      Lyude 提交于
      HPD signals on DVI ports can be fired off before the pins required for
      DDC probing actually make contact, due to the pins for HPD making
      contact first. This results in a HPD signal being asserted but DDC
      probing failing, resulting in hotplugging occasionally failing.
      
      This is somewhat rare on most cards (depending on what angle you plug
      the DVI connector in), but on some cards it happens constantly. The
      Radeon R5 on the machine used for testing this patch for instance, runs
      into this issue just about every time I try to hotplug a DVI monitor and
      as a result hotplugging almost never works.
      
      Rescheduling the hotplug work for a second when we run into an HPD
      signal with a failing DDC probe usually gives enough time for the rest
      of the connector's pins to make contact, and fixes this issue.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NLyude <cpaul@redhat.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      cb5d4166
  22. 03 12月, 2015 4 次提交
  23. 01 12月, 2015 1 次提交