diff mbox

[13/23] drm/zte: Stop consulting plane->fb

Message ID 20180322152313.6561-14-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala March 22, 2018, 3:23 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We want to get rid of plane->fb on atomic drivers. Stop looking at it.

Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/zte/zx_vou.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maarten Lankhorst March 22, 2018, 4:12 p.m. UTC | #1
Op 22-03-18 om 16:23 schreef Ville Syrjala:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to get rid of plane->fb on atomic drivers. Stop looking at it.
>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/zte/zx_vou.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/zte/zx_vou.c b/drivers/gpu/drm/zte/zx_vou.c
> index 7491813131f3..57aae2e490f4 100644
> --- a/drivers/gpu/drm/zte/zx_vou.c
> +++ b/drivers/gpu/drm/zte/zx_vou.c
> @@ -629,7 +629,7 @@ void zx_vou_layer_enable(struct drm_plane *plane)
>  
>  void zx_vou_layer_disable(struct drm_plane *plane)
>  {
> -	struct zx_crtc *zcrtc = to_zx_crtc(plane->crtc);
> +	struct zx_crtc *zcrtc = to_zx_crtc(plane->state->crtc);
>  	struct zx_vou_hw *vou = zcrtc->vou;
>  	struct zx_plane *zplane = to_zx_plane(plane);
>  	const struct vou_layer_bits *bits = zplane->bits;

This function was not called with old_plane_state, which was ok when we still looked
at plane->crtc. But with the changes it seems that this will likely cause a null
pointer deref because when zx_plane_atomic_disable() is called, new_state->crtc is
probably NULL when disabling. I would look at old_state to be sure.

~Maarten
diff mbox

Patch

diff --git a/drivers/gpu/drm/zte/zx_vou.c b/drivers/gpu/drm/zte/zx_vou.c
index 7491813131f3..57aae2e490f4 100644
--- a/drivers/gpu/drm/zte/zx_vou.c
+++ b/drivers/gpu/drm/zte/zx_vou.c
@@ -629,7 +629,7 @@  void zx_vou_layer_enable(struct drm_plane *plane)
 
 void zx_vou_layer_disable(struct drm_plane *plane)
 {
-	struct zx_crtc *zcrtc = to_zx_crtc(plane->crtc);
+	struct zx_crtc *zcrtc = to_zx_crtc(plane->state->crtc);
 	struct zx_vou_hw *vou = zcrtc->vou;
 	struct zx_plane *zplane = to_zx_plane(plane);
 	const struct vou_layer_bits *bits = zplane->bits;