]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/amdgpu: Correct get_crtc_scanoutpos behavior when vpos >= vtotal
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Thu, 1 Nov 2018 15:00:59 +0000 (11:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 28 Nov 2018 20:55:35 +0000 (15:55 -0500)
commit520f08df45fbe300ed650da786a74093d658b7e1
treedc96165bb00e864bb57aa4fde67a413120279dde
parentab7a664f7a2d6230689ba6b7c8976f23789179d7
drm/amdgpu: Correct get_crtc_scanoutpos behavior when vpos >= vtotal

When variable refresh rate is active the hardware counter can return
a position >= vtotal. This results in a vpos being returned from
amdgpu_display_get_crtc_scanoutpos that's a positive value. The
positive value indicates to the caller that the display is
currently in scanout when the display is actually still in vblank.

This is because the vfront porch duration is unknown with variable
refresh active and will end when either a page flip occurs or the
timeout specified by the driver/display is reached.

The behavior of the amdgpu_display_get_crtc_scanoutpos remains the
same when the position is below vtotal. When the position is above
vtotal the function will return a value that is effectively -vbl_end,
the size of the vback porch.

The only caller affected by this change is the DRM helper for
calculating vblank timestamps. This change corrects behavior for
calculating the page flip timestamp from being the previous timestamp
to the calculation to the next timestamp when position >= vtotal.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c