[PATCH 05/10] drm/tegra: Handle 64-bit return from drm_crtc_vblank_count()

Dhinakaran Pandiyan dhinakaran.pandiyan at intel.com
Fri Feb 2 03:26:45 UTC 2018

570e86963a51 ("drm: Widen vblank count to 64-bits [v3]") changed the
return type for drm_crtc_vblank_count() to u64. This could cause
problems if the return from the function is directly compared against
a 32-bit reference vblank count. Typecast explicitly to make the data type

Cc: Keith Packard <keithp at keithp.com>
Cc: Thierry Reding <treding at nvidia.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
 drivers/gpu/drm/tegra/dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index b8403ed48285..49df2db2ad46 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1359,7 +1359,7 @@ static u32 tegra_dc_get_vblank_counter(struct drm_crtc *crtc)
 		return host1x_syncpt_read(dc->syncpt);
 	/* fallback to software emulated VBLANK counter */
-	return drm_crtc_vblank_count(&dc->base);
+	return (u32)drm_crtc_vblank_count(&dc->base);
 static int tegra_dc_enable_vblank(struct drm_crtc *crtc)

More information about the Intel-gfx-trybot mailing list