Skip to content

Commit 7f38a14

Browse files
aloktiwammind
authored andcommitted
drm/rockchip: vop2: use correct destination rectangle height check
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: 604be85 ("drm/rockchip: Add VOP2 driver") Signed-off-by: Alok Tiwari <[email protected]> Reviewed-by: Andy Yan <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0952327 commit 7f38a14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,
10311031
return format;
10321032

10331033
if (drm_rect_width(src) >> 16 < 4 || drm_rect_height(src) >> 16 < 4 ||
1034-
drm_rect_width(dest) < 4 || drm_rect_width(dest) < 4) {
1034+
drm_rect_width(dest) < 4 || drm_rect_height(dest) < 4) {
10351035
drm_err(vop2->drm, "Invalid size: %dx%d->%dx%d, min size is 4x4\n",
10361036
drm_rect_width(src) >> 16, drm_rect_height(src) >> 16,
10371037
drm_rect_width(dest), drm_rect_height(dest));

0 commit comments

Comments
 (0)