[PATCH] drm/drm_vblank.c: using u32 instead of the int to store frame size

Sui Jingfeng 15330273260 at 189.cn
Tue May 23 10:23:28 UTC 2023


From: Sui Jingfeng <suijingfeng at loongson.cn>

Both mode->crtc_htotal and mode->crtc_vtotal are u16 type, using a u32 is
to store the result instead of int.

Signed-off-by: Sui Jingfeng <suijingfeng at loongson.cn>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Maxime Ripard <mripard at kernel.org>
Cc: Thomas Zimmermann <tzimmermann at suse.de>
Cc: David Airlie <airlied at gmail.com>
Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: dri-devel at lists.freedesktop.org
Cc: linux-kernel at vger.kernel.org
Cc: loongson-kernel at lists.loongnix.cn
---
 drivers/gpu/drm/drm_vblank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 877e2067534f..a8dfe5551b7c 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -622,7 +622,7 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
 
 	/* Valid dotclock? */
 	if (dotclock > 0) {
-		int frame_size = mode->crtc_htotal * mode->crtc_vtotal;
+		u32 frame_size = mode->crtc_htotal * mode->crtc_vtotal;
 
 		/*
 		 * Convert scanline length in pixels and video
-- 
2.25.1



More information about the dri-devel mailing list