Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: vop2: use correct destination rectangle height check
@ 2025-10-11 13:04 Alok Tiwari
  2025-10-12  3:12 ` kernel test robot
  2025-10-12 11:28 ` Christian Hewitt
  0 siblings, 2 replies; 4+ messages in thread
From: Alok Tiwari @ 2025-10-11 13:04 UTC (permalink / raw)
  To: michael.riesch, robh, s.hauer, dri-devel, simona, airlied,
	tzimmermann, mripard, hjc, heiko, andy.yan, maarten.lankhorst
  Cc: alok.a.tiwari, linux-arm-kernel, linux-rockchip

The vop2_plane_atomic_check() function incorrectly checks
drm_rect_width(dest) twice instead of verifying both width and height.
Fix the second condition to use drm_rect_height(dest) so that invalid
destination rectangles with height < 4 are correctly rejected.

Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index b50927a824b4..697f54777a32 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1031,7 +1031,7 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,
 		return format;
 
 	if (drm_rect_width(src) >> 16 < 4 || drm_rect_height(src) >> 16 < 4 ||
-	    drm_rect_width(dest) < 4 || drm_rect_width(dest) < 4) {
+	    drm_rect_width(dest) < 4 || drm_rect_heigh(dest) < 4) {
 		drm_err(vop2->drm, "Invalid size: %dx%d->%dx%d, min size is 4x4\n",
 			drm_rect_width(src) >> 16, drm_rect_height(src) >> 16,
 			drm_rect_width(dest), drm_rect_height(dest));
-- 
2.50.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-12 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-11 13:04 [PATCH] drm/rockchip: vop2: use correct destination rectangle height check Alok Tiwari
2025-10-12  3:12 ` kernel test robot
2025-10-12 11:28 ` Christian Hewitt
2025-10-12 11:31   ` [External] : " ALOK TIWARI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox