diff mbox series

[48/59] drm/arc: Drop fb/crtc check in arc_pgu_update

Message ID 20200415074034.175360-49-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series devm_drm_dev_alloc, v2 | expand

Commit Message

Daniel Vetter April 15, 2020, 7:40 a.m. UTC
First it's redundant, fb and crtc are only ever both set or not set.
2nd, the atomic_check code in simple display pipe helpers guarantees
that this never happens. So nice bugfix for arcpgu driver here, since
it was lacking a call to drm_atomic_helper_check_plane_state().

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
---
 drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Sam Ravnborg April 24, 2020, 5:45 p.m. UTC | #1
Hi Daniel.

On Wed, Apr 15, 2020 at 09:40:23AM +0200, Daniel Vetter wrote:
> First it's redundant, fb and crtc are only ever both set or not set.


> 2nd, the atomic_check code in simple display pipe helpers guarantees
> that this never happens.
I looked at drm_simple_kms_plane_atomic_check() - which I assume you
refer to. And I see no code that will guarantee both.

What have I missed?

	Sam


So nice bugfix for arcpgu driver here, since
> it was lacking a call to drm_atomic_helper_check_plane_state().
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
> index 5c6d7e34ca73..4655f03e37f1 100644
> --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
> +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
> @@ -143,9 +143,6 @@ static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
>  	struct arcpgu_drm_private *arcpgu;
>  	struct drm_gem_cma_object *gem;
>  
> -	if (!pipe->plane.state->crtc || !pipe->plane.state->fb)
> -		return;
> -
>  	arcpgu = pipe_to_arcpgu_priv(pipe);
>  	gem = drm_fb_cma_get_gem_obj(pipe->plane.state->fb, 0);
>  	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);
> -- 
> 2.25.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
index 5c6d7e34ca73..4655f03e37f1 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -143,9 +143,6 @@  static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
 	struct arcpgu_drm_private *arcpgu;
 	struct drm_gem_cma_object *gem;
 
-	if (!pipe->plane.state->crtc || !pipe->plane.state->fb)
-		return;
-
 	arcpgu = pipe_to_arcpgu_priv(pipe);
 	gem = drm_fb_cma_get_gem_obj(pipe->plane.state->fb, 0);
 	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);