summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/meson/meson_plane.c
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2017-01-02 18:09:59 +0300
committerNeil Armstrong <narmstrong@baylibre.com>2017-01-03 12:23:02 +0300
commitdcafc45dcb6d8bb6d159ed0a903bd0f3de597fac (patch)
tree05b4d0a7ac9ac8017bddbfbe50bbc25af9efca19 /drivers/gpu/drm/meson/meson_plane.c
parent0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff)
downloadlinux-dcafc45dcb6d8bb6d159ed0a903bd0f3de597fac.tar.xz
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: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/gpu/drm/meson/meson_plane.c')
-rw-r--r--drivers/gpu/drm/meson/meson_plane.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
index 4942ca090b46..7890e30eb584 100644
--- a/drivers/gpu/drm/meson/meson_plane.c
+++ b/drivers/gpu/drm/meson/meson_plane.c
@@ -51,6 +51,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
struct drm_crtc_state *crtc_state;
struct drm_rect clip = { 0, };
+ if (!state->crtc)
+ return 0;
+
crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);