diff mbox series

[v3,2/7] drm/msm/dpu: Clean up plane atomic disable/update

Message ID 20180924162228.180689-3-bzwang@chromium.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show
Series drm/msm/dpu: Clean up dpu code | expand

Commit Message

Bruce Wang Sept. 24, 2018, 4:22 p.m. UTC
Removes unnecessary checks from dpu_plane_atomic_disable, old_state
argument for both dpu_plane_atomic_disable and
dpu_plane_sspp_atomic_update is removed as it is no longer used.

Signed-off-by: Bruce Wang <bzwang@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 31 +++++------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

Comments

Jordan Crouse Sept. 24, 2018, 4:45 p.m. UTC | #1
On Mon, Sep 24, 2018 at 12:22:23PM -0400, Bruce Wang wrote:
> Removes unnecessary checks from dpu_plane_atomic_disable, old_state
> argument for both dpu_plane_atomic_disable and
> dpu_plane_sspp_atomic_update is removed as it is no longer used.
> 

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 31 +++++------------------
>  1 file changed, 7 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 8f986ea10963..dd27bb925547 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -1043,8 +1043,7 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error)
>  	pdpu->is_error = error;
>  }
>  
> -static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
> -					 struct drm_plane_state *old_state)
> +static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
>  {
>  	uint32_t src_flags;
>  	struct dpu_plane *pdpu = to_dpu_plane(plane);
> @@ -1157,27 +1156,11 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
>  	_dpu_plane_set_qos_remap(plane);
>  }
>  
> -static void _dpu_plane_atomic_disable(struct drm_plane *plane,
> -				struct drm_plane_state *old_state)
> +static void _dpu_plane_atomic_disable(struct drm_plane *plane)
>  {
> -	struct dpu_plane *pdpu;
> -	struct drm_plane_state *state;
> -	struct dpu_plane_state *pstate;
> -
> -	if (!plane) {
> -		DPU_ERROR("invalid plane\n");
> -		return;
> -	} else if (!plane->state) {
> -		DPU_ERROR("invalid plane state\n");
> -		return;
> -	} else if (!old_state) {
> -		DPU_ERROR("invalid old state\n");
> -		return;
> -	}
> -
> -	pdpu = to_dpu_plane(plane);
> -	state = plane->state;
> -	pstate = to_dpu_plane_state(state);
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
> +	struct drm_plane_state *state = plane->state;
> +	struct dpu_plane_state *pstate = to_dpu_plane_state(state);
>  
>  	trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane),
>  				pstate->multirect_mode);
> @@ -1201,9 +1184,9 @@ static void dpu_plane_atomic_update(struct drm_plane *plane,
>  	DPU_DEBUG_PLANE(pdpu, "\n");
>  
>  	if (!state->visible) {
> -		_dpu_plane_atomic_disable(plane, old_state);
> +		_dpu_plane_atomic_disable(plane);
>  	} else {
> -		dpu_plane_sspp_atomic_update(plane, old_state);
> +		dpu_plane_sspp_atomic_update(plane);
>  	}
>  }
>  
> -- 
> 2.19.0.444.g18242da7ef-goog
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 8f986ea10963..dd27bb925547 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1043,8 +1043,7 @@  void dpu_plane_set_error(struct drm_plane *plane, bool error)
 	pdpu->is_error = error;
 }
 
-static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
-					 struct drm_plane_state *old_state)
+static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
 {
 	uint32_t src_flags;
 	struct dpu_plane *pdpu = to_dpu_plane(plane);
@@ -1157,27 +1156,11 @@  static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
 	_dpu_plane_set_qos_remap(plane);
 }
 
-static void _dpu_plane_atomic_disable(struct drm_plane *plane,
-				struct drm_plane_state *old_state)
+static void _dpu_plane_atomic_disable(struct drm_plane *plane)
 {
-	struct dpu_plane *pdpu;
-	struct drm_plane_state *state;
-	struct dpu_plane_state *pstate;
-
-	if (!plane) {
-		DPU_ERROR("invalid plane\n");
-		return;
-	} else if (!plane->state) {
-		DPU_ERROR("invalid plane state\n");
-		return;
-	} else if (!old_state) {
-		DPU_ERROR("invalid old state\n");
-		return;
-	}
-
-	pdpu = to_dpu_plane(plane);
-	state = plane->state;
-	pstate = to_dpu_plane_state(state);
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
+	struct drm_plane_state *state = plane->state;
+	struct dpu_plane_state *pstate = to_dpu_plane_state(state);
 
 	trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane),
 				pstate->multirect_mode);
@@ -1201,9 +1184,9 @@  static void dpu_plane_atomic_update(struct drm_plane *plane,
 	DPU_DEBUG_PLANE(pdpu, "\n");
 
 	if (!state->visible) {
-		_dpu_plane_atomic_disable(plane, old_state);
+		_dpu_plane_atomic_disable(plane);
 	} else {
-		dpu_plane_sspp_atomic_update(plane, old_state);
+		dpu_plane_sspp_atomic_update(plane);
 	}
 }