From c3393ac1098d1f191e37eed73bf366ebc88ac4ee Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 11 Sep 2024 14:49:05 +0100 Subject: [PATCH] drm/vc4: Correct condition for ignoring a plane to src rect =0, not <1.0 The logic for dropping a plane less than zero didn't account for the possibility that a plane could be being upscaled with a src_rect with width/height < 1 pixel, but not 0 subpixels. Check for not 0 subpixels, not < 1, in both vc4 and vc6 paths. Fixes: dac616899f87 ("drm/vc4: Drop planes that have 0 destination size") Fixes: f73b18eb0d48 ("drm/vc4: Drop planes that are completely off-screen") Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_plane.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -1160,7 +1160,8 @@ static int vc4_plane_mode_set(struct drm width = vc4_state->src_w[0] >> 16; height = vc4_state->src_h[0] >> 16; - if (!width || !height || !vc4_state->crtc_w || !vc4_state->crtc_h) { + if (!vc4_state->src_w[0] || !vc4_state->src_h[0] || + !vc4_state->crtc_w || !vc4_state->crtc_h) { /* 0 source size probably means the plane is offscreen */ vc4_state->dlist_initialized = 1; return 0; @@ -1698,7 +1699,8 @@ static int vc6_plane_mode_set(struct drm width = vc4_state->src_w[0] >> 16; height = vc4_state->src_h[0] >> 16; - if (!width || !height || !vc4_state->crtc_w || !vc4_state->crtc_h) { + if (!vc4_state->src_w[0] || !vc4_state->src_h[0] || + !vc4_state->crtc_w || !vc4_state->crtc_h) { /* 0 source size probably means the plane is offscreen. * 0 destination size is a redundant plane. */