1 From 2c987545a88507acdd8a572a3bd23a4ca0124d14 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Thu, 13 Apr 2023 17:41:11 +0100
4 Subject: [PATCH] drm/vc4: Treat zero sized destination as full screen
6 Kodi video planes come through with all zeros for fullscreen
7 Without this check, we WARN when writing width-1, height-1
10 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
12 drivers/gpu/drm/vc4/vc4_plane.c | 5 +++++
13 1 file changed, 5 insertions(+)
15 --- a/drivers/gpu/drm/vc4/vc4_plane.c
16 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
17 @@ -484,6 +484,11 @@ static int vc4_plane_setup_clipping_and_
18 vc4_state->crtc_w = state->dst.x2 - state->dst.x1;
19 vc4_state->crtc_h = state->dst.y2 - state->dst.y1;
21 + if (!vc4_state->crtc_w)
22 + vc4_state->crtc_w = state->crtc->mode.hdisplay;
23 + if (!vc4_state->crtc_h)
24 + vc4_state->crtc_h = state->crtc->mode.vdisplay;
26 ret = vc4_plane_margins_adj(state);