1. 09 7月, 2015 1 次提交
    • M
      drm/radeon: Handle irqs only based on irq ring, not irq status regs. · 07f18f0b
      Mario Kleiner 提交于
      Trying to resolve issues with missed vblanks and impossible
      values inside delivered kms pageflip completion events showed
      that radeon's irq handling sometimes doesn't handle valid irqs,
      but silently skips them. This was observed for vblank interrupts.
      
      Although those irqs have corresponding events queued in the gpu's
      irq ring at time of interrupt, and therefore the corresponding
      handling code gets triggered by these events, the handling code
      sometimes silently skipped processing the irq. The reason for those
      skips is that the handling code double-checks for each irq event if
      the corresponding irq status bits in the irq status registers
      are set. Sometimes those bits are not set at time of check
      for valid irqs, maybe due to some hardware race on some setups?
      
      The problem only seems to happen on some machine + card combos
      sometimes, e.g., never happened during my testing of different PC
      cards of the DCE-2/3/4 generation a year ago, but happens consistently
      now on two different Apple Mac cards (RV730, DCE-3, Apple iMac and
      Evergreen JUNIPER, DCE-4 in a Apple MacPro). It also doesn't happen
      at each interrupt but only occassionally every couple of
      hundred or thousand vblank interrupts.
      
      This results in XOrg warning messages like
      
      "[  7084.472] (WW) RADEON(0): radeon_dri2_flip_event_handler:
      Pageflip completion event has impossible msc 420120 < target_msc 420121"
      
      as well as skipped frames and problems for applications that
      use kms pageflip events or vblank events, e.g., users of DRI2 and
      DRI3/Present, Waylands Weston compositor, etc. See also
      
      https://bugs.freedesktop.org/show_bug.cgi?id=85203
      
      After some talking to Alex and Michel, we decided to fix this
      by turning the double-check for asserted irq status bits into a
      warning. Whenever a irq event is queued in the IH ring, always
      execute the corresponding interrupt handler. Still check the irq
      status bits, but only to log a DRM_DEBUG message on a mismatch.
      
      This fixed the problems reliably on both previously failing
      cards, RV-730 dual-head tested on both crtcs (pipes D1 and D2)
      and a triple-output Juniper HD-5770 card tested on all three
      available crtcs (D1/D2/D3). The r600 and evergreen irq handling
      is therefore tested, but the cik an si handling is only compile
      tested due to lack of hw.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      CC: Michel Dänzer <michel.daenzer@amd.com>
      CC: Alex Deucher <alexander.deucher@amd.com>
      CC: <stable@vger.kernel.org> # v3.16+
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      07f18f0b
  2. 29 6月, 2015 1 次提交
    • J
      drm/radeon: compute ring fix hibernation (CI GPU family) v2. · 161569de
      Jérôme Glisse 提交于
      In order for hibernation to reliably work we need to cleanup more
      thoroughly the compute ring. Hibernation is different from suspend
      resume as when we resume from hibernation the hardware is first
      fully initialize by regular kernel then freeze callback happens
      (which correspond to a suspend inside the radeon kernel driver)
      and turn off each of the block. It turns out we were not cleanly
      shutting down the compute ring. This patch fix that.
      
      Hibernation and suspend to ram were tested (several times) on :
      Bonaire
      Hawaii
      Mullins
      Kaveri
      Kabini
      
      Changed since v1:
        - Factor the ring stop logic into a function taking ring as arg.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJérôme Glisse <jglisse@redhat.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      161569de
  3. 29 5月, 2015 1 次提交
    • D
      radeon: Deinline indirect register accessor functions · 9e5acbc2
      Denys Vlasenko 提交于
      This patch deinlines indirect register accessor functions.
      
      These functions perform two mmio accesses, framed by spin lock/unlock.
      Spin lock/unlock by itself takes more than 50 cycles in ideal case
      (if lock is exclusively cached on current CPU).
      
      With this .config: http://busybox.net/~vda/kernel_config,
      after uninlining these functions have sizes and callsite counts
      as follows:
      
      r600_uvd_ctx_rreg: 111 bytes, 4 callsites
      r600_uvd_ctx_wreg: 113 bytes, 5 callsites
      eg_pif_phy0_rreg: 106 bytes, 13 callsites
      eg_pif_phy0_wreg: 108 bytes, 13 callsites
      eg_pif_phy1_rreg: 107 bytes, 13 callsites
      eg_pif_phy1_wreg: 108 bytes, 13 callsites
      rv370_pcie_rreg: 111 bytes, 21 callsites
      rv370_pcie_wreg: 113 bytes, 24 callsites
      r600_rcu_rreg: 111 bytes, 16 callsites
      r600_rcu_wreg: 113 bytes, 25 callsites
      cik_didt_rreg: 106 bytes, 10 callsites
      cik_didt_wreg: 107 bytes, 10 callsites
      tn_smc_rreg: 106 bytes, 126 callsites
      tn_smc_wreg: 107 bytes, 116 callsites
      eg_cg_rreg: 107 bytes, 20 callsites
      eg_cg_wreg: 108 bytes, 52 callsites
      
      Functions r100_mm_rreg() and r100_mm_rreg() have a fast path and
      a locked (slow) path. This patch deinlines only slow path.
      
      r100_mm_rreg_slow: 78 bytes, 2083 callsites
      r100_mm_wreg_slow: 81 bytes, 3570 callsites
      
      Reduction in code size is more than 65,000 bytes:
      
          text     data      bss       dec     hex filename
      85740176 22294680 20627456 128662312 7ab3b28 vmlinux.before
      85674192 22294776 20627456 128598664 7aa4288 vmlinux
      Signed-off-by: NDenys Vlasenko <dvlasenk@redhat.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      9e5acbc2
  4. 28 5月, 2015 1 次提交
  5. 12 5月, 2015 1 次提交
  6. 20 3月, 2015 2 次提交
  7. 04 3月, 2015 1 次提交
  8. 26 2月, 2015 1 次提交
  9. 12 2月, 2015 2 次提交
  10. 22 1月, 2015 2 次提交
  11. 08 1月, 2015 1 次提交
  12. 21 11月, 2014 4 次提交
  13. 13 11月, 2014 1 次提交
  14. 07 11月, 2014 2 次提交
  15. 03 10月, 2014 2 次提交
  16. 01 10月, 2014 1 次提交
  17. 23 9月, 2014 4 次提交
  18. 11 9月, 2014 1 次提交
  19. 28 8月, 2014 2 次提交
  20. 27 8月, 2014 1 次提交
  21. 22 8月, 2014 1 次提交
  22. 20 8月, 2014 2 次提交
  23. 19 8月, 2014 2 次提交
  24. 03 1月, 2015 1 次提交
    • B
      drm/radeon: Initialize compute vmid · 08dcc57f
      Ben Goz 提交于
      This patch moves to radeon the initialization of compute vmid.
      
      That initializations was done in kfd-->kgd interface, but doing it in radeon
      as part of radeon's H/W initialization routines is more appropriate.
      
      In addition, this simplifies the kfd-->kgd interface.
      
      The patch removes the function from the interface file and from the interface
      declaration file.
      
      The function initializes memory apertures to fixed base/limit address and non
      cached memory types.
      Signed-off-by: NBen Goz <ben.goz@amd.com>
      Signed-off-by: NOded Gabbay <oded.gabbay@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      08dcc57f
  25. 15 8月, 2014 1 次提交
  26. 05 8月, 2014 1 次提交
    • M
      drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) · 39dc5454
      Mario Kleiner 提交于
      Skip the "manual" pageflip completion checks via polling and
      guessing in the vblank handler radeon_crtc_handle_vblank() on
      asics which are known to reliably support hw pageflip completion
      irqs. Those pflip irqs are a more reliable and race-free method
      of handling pageflip completion detection, whereas the "classic"
      polling method has some small races in combination with dpm on,
      and with the reworked pageflip implementation since Linux 3.16.
      
      On old asics without pflip irqs, the classic method is used.
      
      On asics with known good pflip irqs, only pflip irqs are used
      by default, but a new module parameter "use_pflipirqs" allows to
      override this in case we encounter asics in the wild with
      unreliable or faulty pflip irqs. A module parameter of 0 allows
      to use the classic method only in such a case. A parameter of 1
      allows to use both classic method and pflip irqs as additional
      band-aid to avoid some small races which could happen with the
      classic method alone. The setting 1 gives Linux 3.16 behaviour.
      
      Hw pflip irqs are available since R600.
      
      Tested on DCE-4, AMD Cedar - FirePro 2270.
      
      v2:  agd5f: only enable pflip interrupts on DCE4+ as they are not
      reliable on older asics.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      39dc5454