Commit dcafc45d authored by Neil Armstrong's avatar Neil Armstrong

drm/meson: Fix plane atomic check when no crtc for the plane

When no CRTC is associated with the plane, the meson_plane_atomic_check()
call breaks the kernel with an Oops.

Fixes: bbbe775e ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent 0c744ea4
...@@ -51,6 +51,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane, ...@@ -51,6 +51,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
struct drm_rect clip = { 0, }; struct drm_rect clip = { 0, };
if (!state->crtc)
return 0;
crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc); crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
if (IS_ERR(crtc_state)) if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state); return PTR_ERR(crtc_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment