Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550772

Re: [PATCH] drm/meson: Fix plane atomic check when no crtc for the plane

From Ville Syrjälä <ville.syrjala@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] drm/meson: Fix plane atomic check when no crtc for the plane
Date 2017-01-04 14:30 +0100
Message-ID <sVTNE-5e8-13@gated-at.bofh.it> (permalink)
References <sVtzP-4gf-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 03, 2017 at 10:20:54AM +0100, Neil Armstrong wrote:
> 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>
> ---
>  drivers/gpu/drm/meson/meson_plane.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
> index 4942ca0..7890e30 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;
> +

Since you're not going to call drm_plane_helper_check_state() you will
fail to update plane_state->visible.

What i915 does in this case is look for state->crtc first, and if that's
NULL it'll pick the crtc from the old state (plane->state->crtc). It
looks a bit ugly, but maybe we should hide it in a small helper function
that could be used by all drivers?

>  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
>  	if (IS_ERR(crtc_state))
>  		return PTR_ERR(crtc_state);
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] drm/meson: Fix plane atomic check when no crtc for the  plane Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-01-04 14:30 +0100
  Re: [PATCH] drm/meson: Fix plane atomic check when no crtc for the  plane Neil Armstrong <narmstrong@baylibre.com> - 2017-01-04 14:50 +0100

csiph-web