8000 drm/vc4: Drop planes that have 0 destination size · 6by9/linux@dac6168 · GitHub
[go: up one dir, main page]

Skip to content

Commit dac6168

Browse files
6by9popcornmix
authored andcommitted
drm/vc4: Drop planes that have 0 destination size
There is no point in trying to create a dlist entry for planes that have a 0 crtc size, and it can also cause grief in the vc6 dlist generation as it takes width-1 and height-1, causing wrap around. Drop these planes. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 5f391cd commit dac6168

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
11141114
width = vc4_state->src_w[0] >> 16;
11151115
height = vc4_state->src_h[0] >> 16;
11161116

1117-
if (!width || !height) {
1117+
if (!width || !height || !vc4_state->crtc_w || !vc4_state->crtc_h) {
11181118
/* 0 source size probably means the plane is offscreen */
11191119
vc4_state->dlist_initialized = 1;
11201120
return 0;
@@ -1641,8 +1641,10 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
16411641
width = vc4_state->src_w[0] >> 16;
16421642
height = vc4_state->src_h[0] >> 16;
16431643

1644-
if (!width || !height) {
1645-
/* 0 source size probably means the plane is offscreen */
1644+
if (!width || !height || !vc4_state->crtc_w || !vc4_state->crtc_h) {
1645+
/* 0 source size probably means the plane is offscreen.
1646+
* 0 destination size is a redundant plane.
1647+
*/
16461648
vc4_state->dlist_initialized = 1;
16471649
return 0;
16481650
}
@@ -2018,7 +2020,8 @@ int vc4_plane_atomic_check(struct drm_plane *plane,
20182020
if (ret)
20192021
return ret;
20202022

2021-
if (!vc4_state->src_w[0] || !vc4_state->src_h[0])
2023+
if (!vc4_state->src_w[0] || !vc4_state->src_h[0] ||
2024+
!vc4_state->crtc_w || !vc4_state->crtc_h)
20222025
return 0;
20232026

20242027
ret = vc4_plane_allocate_lbm(new_plane_state);

0 commit comments

Comments
 (0)
0