drm/vc4: Drop planes that are completely off-screen
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 17 Nov 2023 14:43:44 +0000 (14:43 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:15 +0000 (11:35 +0000)
commit50fcdfb3b984865ef6050a4af3e1e6ea9be6418c
tree80de4a48392851309f2605a9272da2f3ddd3bf6c
parent7cadd09ec90295e4d8aced40ff6d880fd420fc8f
drm/vc4: Drop planes that are completely off-screen

It is permitted for a plane to be configured such that none
of it is on-screen via either negative dest rectangle X,Y
offset, or just an offset that is greater than the crtc
dimensions.

These planes were resized via drm_atomic_helper_check_plane_state
such that the source rectangle had a zero width or height, but
they still created a dlist entry even though they contributed
no pixels. In the case of vc6_plane_mode_set, that it could result
in negative values being written into registers, which caused
incorrect behaviour.

Drop planes that result in a source width or height of 0 pixels
to avoid the incorrect rendering.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/gpu/drm/vc4/vc4_plane.c