Skip to content

Commit

Permalink
drm/vc4: Correct condition for ignoring a plane to src rect =0, not <1.0
Browse files Browse the repository at this point in the history
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: dac6168 ("drm/vc4: Drop planes that have 0 destination size")
Fixes: f73b18e ("drm/vc4: Drop planes that are completely off-screen")
Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Sep 11, 2024
1 parent e4c2a77 commit e089435
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,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;
Expand Down Expand Up @@ -1656,7 +1657,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.
*/
Expand Down

0 comments on commit e089435

Please sign in to comment.