diff options
author | Dhinakaran Pandiyan <[email protected]> | 2018-02-02 21:12:57 -0800 |
---|---|---|
committer | Rodrigo Vivi <[email protected]> | 2018-02-15 11:49:42 -0800 |
commit | 9038aa480d34c1f87dccd4afb944bb3c7cce8ec7 (patch) | |
tree | a04e65886de11217024c882720dfb604c066f263 | |
parent | 23effc1100975a36953255c1db737f18adf8dd0d (diff) |
drm/radeon: Handle 64-bit return from drm_crtc_vblank_count()
570e86963a51 ("drm: Widen vblank count to 64-bits [v3]") changed the
return type for drm_crtc_vblank_count() to u64. This could cause
potential problems if the return value is used in arithmetic operations
with a 32-bit reference HW vblank count. Explicitly typecasting this down
to u32 either fixes a potential problem or serves to add clarity in case
the implicit typecasting was already correct.
Cc: Keith Packard <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Harry Wentland <[email protected]>
Signed-off-by: Dhinakaran Pandiyan <[email protected]>
Reviewed-by: Keith Packard <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index dfda5e0ed166..26129b2b082d 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -570,7 +570,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, base &= ~7; } work->base = base; - work->target_vblank = target - drm_crtc_vblank_count(crtc) + + work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) + dev->driver->get_vblank_counter(dev, work->crtc_id); /* We borrow the event spin lock for protecting flip_work */ |