linux/drivers/gpu/drm/radeon
Daniel Vetter 1bf6ad622b drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos
If we restrict this helper to only kms drivers (which is the case) we
can look up the correct mode easily ourselves. But it's a bit tricky:

- All legacy drivers look at crtc->hwmode. But that is updated already
  at the beginning of the modeset helper, which means when we disable
  a pipe. Hence the final timestamps might be a bit off. But since
  this is an existing bug I'm not going to change it, but just try to
  be bug-for-bug compatible with the current code. This only applies
  to radeon&amdgpu.

- i915 tries to get it perfect by updating crtc->hwmode when the pipe
  is off (i.e. vblank->enabled = false).

- All other atomic drivers look at crtc->state->adjusted_mode. Those
  that look at state->requested_mode simply don't adjust their mode,
  so it's the same. That has two problems: Accessing crtc->state from
  interrupt handling code is unsafe, and it's updated before we shut
  down the pipe. For nonblocking modesets it's even worse.

For atomic drivers try to implement what i915 does. To do that we add
a new hwmode field to the vblank structure, and update it from
drm_calc_timestamping_constants(). For atomic drivers that's called
from the right spot by the helper library already, so all fine. But
for safety let's enforce that.

For legacy driver this function is only called at the end (oh the
fun), which is broken, so again let's not bother and just stay
bug-for-bug compatible.

The  benefit is that we can use drm_calc_vbltimestamp_from_scanoutpos
directly to implement ->get_vblank_timestamp in every driver, deleting
a lot of code.

v2: Completely new approach, trying to mimick the i915 solution.

v3: Fixup kerneldoc.

v4: Drop the WARN_ON to check that the vblank is off, atomic helpers
currently unconditionally call this. Recomputing the same stuff should
be harmless.

v5: Fix typos and move misplaced hunks to the right patches (Neil).

v6: Undo hunk movement (kbuild).

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Cc: Eric Anholt <eric@anholt.net>
Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-4-daniel.vetter@ffwll.ch
2017-05-10 10:21:31 +02:00
..
reg_srcs
.gitignore
atom-bits.h
atom-names.h
atom-types.h
atom.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
atom.h
atombios.h scripts/spelling.txt: add "aligment" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
atombios_crtc.c drm: Nuke fb->pixel_format 2016-12-15 14:55:34 +02:00
atombios_dp.c
atombios_encoders.c drm/radeon: add missing header dependencies 2016-10-25 14:38:18 -04:00
atombios_i2c.c
avivod.h
btc_dpm.c
btc_dpm.h
btcd.h
cayman_blit_shaders.c
cayman_blit_shaders.h
ci_dpm.c
ci_dpm.h
ci_smc.c
cik.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
cik_blit_shaders.c
cik_blit_shaders.h
cik_reg.h
cik_sdma.c
cikd.h drm/amd: Spelling s/SDMA_WRTIE_SUB_OPCODE_TILED/SDMA_WRITE_SUB_OPCODE_TILED/ 2017-03-29 23:53:21 -04:00
clearstate_cayman.h
clearstate_ci.h
clearstate_defs.h
clearstate_evergreen.h
clearstate_si.h
cypress_dpm.c
cypress_dpm.h
dce3_1_afmt.c
dce6_afmt.c
evergreen.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
evergreen_blit_shaders.c
evergreen_blit_shaders.h
evergreen_cs.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
evergreen_dma.c
evergreen_hdmi.c
evergreen_reg.h
evergreen_smc.h
evergreend.h
Kconfig
kv_dpm.c
kv_dpm.h
kv_smc.c
Makefile
mkregtable.c
ni.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
ni_dma.c
ni_dpm.c
ni_dpm.h
ni_reg.h
nid.h
nislands_smc.h
ObjectID.h
ppsmc.h
pptable.h
r100.c drm/radeon: fix typo in bandwidth calculation 2017-04-07 12:20:41 -04:00
r100_track.h
r100d.h
r200.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r300.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r300_reg.h
r300d.h
r420.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r420d.h
r500_reg.h
r520.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r520d.h
r600.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r600_blit_shaders.c
r600_blit_shaders.h
r600_cs.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
r600_dma.c
r600_dpm.c drm: Use pr_cont where appropriate 2017-03-29 23:53:24 -04:00
r600_dpm.h
r600_hdmi.c
r600_reg.h
r600d.h
radeon.h drm/radeon: Maintain prime import/export refcount for BOs 2017-04-07 12:20:40 -04:00
radeon_acpi.c
radeon_acpi.h drm/radeon: add new ATIF ACPI method 2017-03-29 23:53:49 -04:00
radeon_agp.c
radeon_asic.c
radeon_asic.h
radeon_atombios.c drm/radeon: add missing header dependencies 2016-10-25 14:38:18 -04:00
radeon_atpx_handler.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
radeon_audio.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
radeon_audio.h
radeon_benchmark.c
radeon_bios.c drm/radeon: remove some dead code 2017-02-08 21:04:29 -05:00
radeon_clocks.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
radeon_combios.c
radeon_connectors.c drm/radeon: Fix kernel panic on shutdown 2016-10-31 12:19:39 -04:00
radeon_cs.c drm/radeon: Refuse to migrate a prime BO to VRAM. (v2) 2017-04-07 12:20:41 -04:00
radeon_cursor.c drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor 2017-02-16 11:03:03 -05:00
radeon_device.c Merge tag 'drm-misc-next-2017-03-31' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-04-03 16:30:24 +10:00
radeon_display.c Merge tag 'drm-misc-next-2017-04-07' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-04-11 07:41:10 +10:00
radeon_dp_auxch.c drm/radeon/dp_auxch: Ratelimit aux transfer debug messages 2017-03-29 23:53:21 -04:00
radeon_dp_mst.c drm/dp: Split drm_dp_mst_allocate_vcpi 2017-03-22 21:47:44 +01:00
radeon_drv.c drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos 2017-05-10 10:21:31 +02:00
radeon_drv.h
radeon_encoders.c
radeon_family.h
radeon_fb.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
radeon_fence.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
radeon_gart.c
radeon_gem.c drm/radeon: Refuse to migrate a prime BO to VRAM. (v2) 2017-04-07 12:20:41 -04:00
radeon_i2c.c drm/radeon: fix up dp aux tear down (v2) 2016-10-12 15:44:13 -04:00
radeon_ib.c
radeon_ioc32.c
radeon_irq_kms.c drm/radeon|amdgpu: Remove redundant num_connectors check 2016-12-18 14:18:12 +01:00
radeon_kfd.c
radeon_kfd.h
radeon_kms.c drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos 2017-05-10 10:21:31 +02:00
radeon_legacy_crtc.c drm: Nuke fb->bits_per_pixel 2016-12-15 14:55:34 +02:00
radeon_legacy_encoders.c drm/radeon: add missing header dependencies 2016-10-25 14:38:18 -04:00
radeon_legacy_tv.c
radeon_mn.c
radeon_mode.h drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos 2017-05-10 10:21:31 +02:00
radeon_object.c drm/radeon: Refuse to migrate a prime BO to VRAM. (v2) 2017-04-07 12:20:41 -04:00
radeon_object.h drm/ttm: add evict parameter to ttm_bo_driver::move_notify 2017-01-27 11:13:15 -05:00
radeon_pm.c drm/radeon/pm: autoswitch power state when in balanced mode 2016-10-25 14:44:03 -04:00
radeon_prime.c drm/radeon: Maintain prime import/export refcount for BOs 2017-04-07 12:20:40 -04:00
radeon_reg.h
radeon_ring.c
radeon_sa.c
radeon_semaphore.c
radeon_sync.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
radeon_test.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
radeon_trace.h
radeon_trace_points.c
radeon_ttm.c Linux 4.11-rc6 2017-04-11 07:40:42 +10:00
radeon_ucode.c
radeon_ucode.h
radeon_uvd.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
radeon_vce.c
radeon_vm.c
rs100d.h
rs400.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
rs400d.h
rs600.c
rs600d.h
rs690.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
rs690d.h
rs780_dpm.c
rs780_dpm.h
rs780d.h
rv6xx_dpm.c
rv6xx_dpm.h
rv6xxd.h
rv200d.h
rv250d.h
rv350d.h
rv515.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
rv515d.h
rv730_dpm.c
rv730d.h
rv740_dpm.c
rv740d.h
rv770.c
rv770_dma.c
rv770_dpm.c
rv770_dpm.h
rv770_smc.c
rv770_smc.h
rv770d.h
si.c gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
si_blit_shaders.c
si_blit_shaders.h
si_dma.c
si_dpm.c drm/radeon: reinstate oland workaround for sclk 2017-03-16 10:06:11 -04:00
si_dpm.h
si_reg.h
si_smc.c
sid.h drm/radeon: allow TA_CS_BC_BASE_ADDR on SI 2016-10-12 15:44:15 -04:00
sislands_smc.h
smu7.h
smu7_discrete.h
smu7_fusion.h
sumo_dpm.c
sumo_dpm.h
sumo_smc.c
sumod.h
trinity_dpm.c
trinity_dpm.h
trinity_smc.c
trinityd.h
uvd_v1_0.c
uvd_v2_2.c
uvd_v3_1.c
uvd_v4_2.c
vce_v1_0.c drm/radeon: avoid kernel segfault in vce when gpu fails to resume 2017-02-08 20:59:16 -05:00
vce_v2_0.c