summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Stevenson <dave.stevenson@raspberrypi.com>2024-09-11 14:49:05 +0100
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>2024-11-07 11:45:02 +0000
commitc3393ac1098d1f191e37eed73bf366ebc88ac4ee (patch)
tree4fb2c07848baf554e07093fbb8c8d0d656d7b567
parentce65ed02cb6707ae5c9f3a304f5b0124f4eed559 (diff)
downloadlinux-rpi-c3393ac1098d1f191e37eed73bf366ebc88ac4ee.tar.gz
linux-rpi-c3393ac1098d1f191e37eed73bf366ebc88ac4ee.tar.bz2
linux-rpi-c3393ac1098d1f191e37eed73bf366ebc88ac4ee.zip
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 <dave.stevenson@raspberrypi.com>
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index acedc1b89f2e..1a6aa51a94c6 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1291,7 +1291,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
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;
@@ -1829,7 +1830,8 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
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.
*/