drm/vc4: Ignore HVS unless initialised

An upstream commit to report HVS underruns causes VC4 in firmware KMS
mode to cross into the HVS side, where it crashes due to a NULL hvs
pointer.

Make the underrun masking conditional on the hvs pointer being
initialised.

Fixes: 531a1b622d ("drm/vc4: Report HVS underrun errors")

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
This commit is contained in:
Phil Elwell
2019-07-19 14:29:28 +01:00
committed by popcornmix
parent 28365453f2
commit da5e9d74f4
2 changed files with 3 additions and 2 deletions

View File

@@ -798,7 +798,8 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)
* the CRTC and encoder already reconfigured, leading to
* underruns. This can be seen when reconfiguring the CRTC.
*/
vc4_hvs_unmask_underrun(dev, vc4_crtc->channel);
if (vc4->hvs)
vc4_hvs_unmask_underrun(dev, vc4_crtc->channel);
}
spin_unlock_irqrestore(&dev->event_lock, flags);
}

View File

@@ -153,7 +153,7 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
struct vc4_crtc *vc4_crtc;
int i;
for (i = 0; i < dev->mode_config.num_crtc; i++) {
for (i = 0; vc4->hvs && i < dev->mode_config.num_crtc; i++) {
if (!state->crtcs[i].ptr || !state->crtcs[i].commit)
continue;