Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code
@ 2018-09-24 16:22 Bruce Wang
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Removes uneeded checks and unused variables. Changes some
function that do not need return values to void.

Bruce Wang (7):
  drm/msm/dpu: Remove unneeded checks in dpu_plane.c
  drm/msm/dpu: Clean up plane atomic disable/update
  drm/msm/dpu: Remove unneeded checks in dpu_crtc.c
  drm/msm/dpu: Change _dpu_crtc_power_enable to void
  drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void
  drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void
  drm/msm/dpu: Make _dpu_plane_get_aspace void

 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  | 253 ++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 280 +++-------------------
 2 files changed, 70 insertions(+), 463 deletions(-)

-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 1/7] drm/msm/dpu: Remove unneeded checks in dpu_plane.c
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:22   ` Bruce Wang
       [not found]     ` <20180924162228.180689-2-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 2/7] drm/msm/dpu: Clean up plane atomic disable/update Bruce Wang
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Removes some checks from dpu_plane.c that will never result in an error.
Subsequent variable assignments become part of the initialization wherever
possible. Unused variables are removed.

v3: removed additional impossible checks and called helper function
_dpu_plane_get_kms() where possible.

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

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 1ce76460d710..8f986ea10963 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -123,13 +123,8 @@ struct dpu_plane {
 
 static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
 {
-	struct msm_drm_private *priv;
+	struct msm_drm_private *priv = plane->dev->dev_private;
 
-	if (!plane || !plane->dev)
-		return NULL;
-	priv = plane->dev->dev_private;
-	if (!priv)
-		return NULL;
 	return to_dpu_kms(priv->kms);
 }
 
@@ -148,7 +143,7 @@ static inline int _dpu_plane_calc_fill_level(struct drm_plane *plane,
 	u32 fixed_buff_size;
 	u32 total_fl;
 
-	if (!plane || !fmt || !plane->state || !src_width || !fmt->bpp) {
+	if (!fmt || !plane->state || !src_width || !fmt->bpp) {
 		DPU_ERROR("invalid arguments\n");
 		return 0;
 	}
@@ -229,26 +224,11 @@ static u64 _dpu_plane_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
 static void _dpu_plane_set_qos_lut(struct drm_plane *plane,
 		struct drm_framebuffer *fb)
 {
-	struct dpu_plane *pdpu;
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 	const struct dpu_format *fmt = NULL;
 	u64 qos_lut;
 	u32 total_fl = 0, lut_usage;
 
-	if (!plane || !fb) {
-		DPU_ERROR("invalid arguments plane %d fb %d\n",
-				plane != 0, fb != 0);
-		return;
-	}
-
-	pdpu = to_dpu_plane(plane);
-
-	if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	} else if (!pdpu->pipe_hw->ops.setup_creq_lut) {
-		return;
-	}
-
 	if (!pdpu->is_rt_pipe) {
 		lut_usage = DPU_QOS_LUT_USAGE_NRT;
 	} else {
@@ -290,24 +270,10 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane,
 static void _dpu_plane_set_danger_lut(struct drm_plane *plane,
 		struct drm_framebuffer *fb)
 {
-	struct dpu_plane *pdpu;
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 	const struct dpu_format *fmt = NULL;
 	u32 danger_lut, safe_lut;
 
-	if (!plane || !fb) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	}
-
-	pdpu = to_dpu_plane(plane);
-
-	if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	} else if (!pdpu->pipe_hw->ops.setup_danger_safe_lut) {
-		return;
-	}
-
 	if (!pdpu->is_rt_pipe) {
 		danger_lut = pdpu->catalog->perf.danger_lut_tbl
 				[DPU_QOS_LUT_USAGE_NRT];
@@ -361,21 +327,7 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane,
 static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
 	bool enable, u32 flags)
 {
-	struct dpu_plane *pdpu;
-
-	if (!plane) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	}
-
-	pdpu = to_dpu_plane(plane);
-
-	if (!pdpu->pipe_hw || !pdpu->pipe_sblk) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	} else if (!pdpu->pipe_hw->ops.setup_qos_ctrl) {
-		return;
-	}
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 
 	if (flags & DPU_PLANE_QOS_VBLANK_CTRL) {
 		pdpu->pipe_qos_cfg.creq_vblank = pdpu->pipe_sblk->creq_vblank;
@@ -450,29 +402,9 @@ int dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
 static void _dpu_plane_set_ot_limit(struct drm_plane *plane,
 		struct drm_crtc *crtc)
 {
-	struct dpu_plane *pdpu;
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 	struct dpu_vbif_set_ot_params ot_params;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-
-	if (!plane || !plane->dev || !crtc) {
-		DPU_ERROR("invalid arguments plane %d crtc %d\n",
-				plane != 0, crtc != 0);
-		return;
-	}
-
-	priv = plane->dev->dev_private;
-	if (!priv || !priv->kms) {
-		DPU_ERROR("invalid KMS reference\n");
-		return;
-	}
-
-	dpu_kms = to_dpu_kms(priv->kms);
-	pdpu = to_dpu_plane(plane);
-	if (!pdpu->pipe_hw) {
-		DPU_ERROR("invalid pipe reference\n");
-		return;
-	}
+	struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
 
 	memset(&ot_params, 0, sizeof(ot_params));
 	ot_params.xin_id = pdpu->pipe_hw->cap->xin_id;
@@ -494,28 +426,9 @@ static void _dpu_plane_set_ot_limit(struct drm_plane *plane,
  */
 static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
 {
-	struct dpu_plane *pdpu;
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 	struct dpu_vbif_set_qos_params qos_params;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-
-	if (!plane || !plane->dev) {
-		DPU_ERROR("invalid arguments\n");
-		return;
-	}
-
-	priv = plane->dev->dev_private;
-	if (!priv || !priv->kms) {
-		DPU_ERROR("invalid KMS reference\n");
-		return;
-	}
-
-	dpu_kms = to_dpu_kms(priv->kms);
-	pdpu = to_dpu_plane(plane);
-	if (!pdpu->pipe_hw) {
-		DPU_ERROR("invalid pipe reference\n");
-		return;
-	}
+	struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
 
 	memset(&qos_params, 0, sizeof(qos_params));
 	qos_params.vbif_idx = VBIF_RT;
@@ -549,10 +462,6 @@ static int _dpu_plane_get_aspace(
 	}
 
 	kms = _dpu_plane_get_kms(&pdpu->base);
-	if (!kms) {
-		DPU_ERROR("invalid kms\n");
-		return -EINVAL;
-	}
 
 	*aspace = kms->base.aspace;
 
@@ -564,23 +473,10 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
 		struct dpu_hw_pipe_cfg *pipe_cfg,
 		struct drm_framebuffer *fb)
 {
-	struct dpu_plane *pdpu;
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
 	struct msm_gem_address_space *aspace = NULL;
 	int ret;
 
-	if (!plane || !pstate || !pipe_cfg || !fb) {
-		DPU_ERROR(
-			"invalid arg(s), plane %d state %d cfg %d fb %d\n",
-			plane != 0, pstate != 0, pipe_cfg != 0, fb != 0);
-		return;
-	}
-
-	pdpu = to_dpu_plane(plane);
-	if (!pdpu->pipe_hw) {
-		DPU_ERROR_PLANE(pdpu, "invalid pipe_hw\n");
-		return;
-	}
-
 	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
 	if (ret) {
 		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
@@ -610,15 +506,6 @@ static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu,
 {
 	uint32_t i;
 
-	if (!pdpu || !pstate || !scale_cfg || !fmt || !chroma_subsmpl_h ||
-			!chroma_subsmpl_v) {
-		DPU_ERROR(
-			"pdpu %d pstate %d scale_cfg %d fmt %d smp_h %d smp_v %d\n",
-			!!pdpu, !!pstate, !!scale_cfg, !!fmt, chroma_subsmpl_h,
-			chroma_subsmpl_v);
-		return;
-	}
-
 	memset(scale_cfg, 0, sizeof(*scale_cfg));
 	memset(&pstate->pixel_ext, 0, sizeof(struct dpu_hw_pixel_ext));
 
@@ -722,17 +609,8 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu,
 		struct dpu_plane_state *pstate,
 		const struct dpu_format *fmt, bool color_fill)
 {
-	struct dpu_hw_pixel_ext *pe;
 	uint32_t chroma_subsmpl_h, chroma_subsmpl_v;
 
-	if (!pdpu || !fmt || !pstate) {
-		DPU_ERROR("invalid arg(s), plane %d fmt %d state %d\n",
-				pdpu != 0, fmt != 0, pstate != 0);
-		return;
-	}
-
-	pe = &pstate->pixel_ext;
-
 	/* don't chroma subsample if decimating */
 	chroma_subsmpl_h =
 		drm_format_horz_chroma_subsampling(fmt->base.pixel_format);
@@ -760,21 +638,8 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu,
 		uint32_t color, uint32_t alpha)
 {
 	const struct dpu_format *fmt;
-	const struct drm_plane *plane;
-	struct dpu_plane_state *pstate;
-
-	if (!pdpu || !pdpu->base.state) {
-		DPU_ERROR("invalid plane\n");
-		return -EINVAL;
-	}
-
-	if (!pdpu->pipe_hw) {
-		DPU_ERROR_PLANE(pdpu, "invalid plane h/w pointer\n");
-		return -EINVAL;
-	}
-
-	plane = &pdpu->base;
-	pstate = to_dpu_plane_state(plane->state);
+	const struct drm_plane *plane = &pdpu->base;
+	struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state);
 
 	DPU_DEBUG_PLANE(pdpu, "\n");
 
@@ -825,12 +690,7 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu,
 
 void dpu_plane_clear_multirect(const struct drm_plane_state *drm_state)
 {
-	struct dpu_plane_state *pstate;
-
-	if (!drm_state)
-		return;
-
-	pstate = to_dpu_plane_state(drm_state);
+	struct dpu_plane_state *pstate = to_dpu_plane_state(drm_state);
 
 	pstate->multirect_index = DPU_SSPP_RECT_SOLO;
 	pstate->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
@@ -961,15 +821,6 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane)
 void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl,
 		u32 *flush_sspp)
 {
-	struct dpu_plane_state *pstate;
-
-	if (!plane || !flush_sspp) {
-		DPU_ERROR("invalid parameters\n");
-		return;
-	}
-
-	pstate = to_dpu_plane_state(plane->state);
-
 	*flush_sspp = ctl->ops.get_bitmask_sspp(ctl, dpu_plane_pipe(plane));
 }
 
@@ -1389,8 +1240,7 @@ static void dpu_plane_destroy(struct drm_plane *plane)
 		/* this will destroy the states as well */
 		drm_plane_cleanup(plane);
 
-		if (pdpu->pipe_hw)
-			dpu_hw_sspp_destroy(pdpu->pipe_hw);
+		dpu_hw_sspp_destroy(pdpu->pipe_hw);
 
 		kfree(pdpu);
 	}
@@ -1737,33 +1587,11 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
 	struct drm_plane *plane = NULL, *master_plane = NULL;
 	const struct dpu_format_extended *format_list;
 	struct dpu_plane *pdpu;
-	struct msm_drm_private *priv;
-	struct dpu_kms *kms;
+	struct msm_drm_private *priv = dev->dev_private;
+	struct dpu_kms *kms = to_dpu_kms(priv->kms);
 	int zpos_max = DPU_ZPOS_MAX;
 	int ret = -EINVAL;
 
-	if (!dev) {
-		DPU_ERROR("[%u]device is NULL\n", pipe);
-		goto exit;
-	}
-
-	priv = dev->dev_private;
-	if (!priv) {
-		DPU_ERROR("[%u]private data is NULL\n", pipe);
-		goto exit;
-	}
-
-	if (!priv->kms) {
-		DPU_ERROR("[%u]invalid KMS reference\n", pipe);
-		goto exit;
-	}
-	kms = to_dpu_kms(priv->kms);
-
-	if (!kms->catalog) {
-		DPU_ERROR("[%u]invalid catalog reference\n", pipe);
-		goto exit;
-	}
-
 	/* create and zero local structure */
 	pdpu = kzalloc(sizeof(*pdpu), GFP_KERNEL);
 	if (!pdpu) {
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 2/7] drm/msm/dpu: Clean up plane atomic disable/update
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 1/7] drm/msm/dpu: Remove unneeded checks in dpu_plane.c Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
       [not found]     ` <20180924162228.180689-3-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 3/7] drm/msm/dpu: Remove unneeded checks in dpu_crtc.c Bruce Wang
                     ` (5 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

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(-)

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

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 3/7] drm/msm/dpu: Remove unneeded checks in dpu_crtc.c
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 1/7] drm/msm/dpu: Remove unneeded checks in dpu_plane.c Bruce Wang
  2018-09-24 16:22   ` [PATCH v3 2/7] drm/msm/dpu: Clean up plane atomic disable/update Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
       [not found]     ` <20180924162228.180689-4-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void Bruce Wang
                     ` (4 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Removes impossible checks in dpu_crtc.c.
Variable assignments are moved up to be initializations where
possible. Some variables are no longer used, these are removed.

v3: reverted back to original patch

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

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index a8f2dd7a37c7..e31e70f5dbac 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -55,17 +55,7 @@ static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate,
 
 static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
-	struct msm_drm_private *priv;
-
-	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid crtc\n");
-		return NULL;
-	}
-	priv = crtc->dev->dev_private;
-	if (!priv || !priv->kms) {
-		DPU_ERROR("invalid kms\n");
-		return NULL;
-	}
+	struct msm_drm_private *priv = crtc->dev->dev_private;
 
 	return to_dpu_kms(priv->kms);
 }
@@ -177,28 +167,17 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 	struct drm_plane *plane;
 	struct drm_framebuffer *fb;
 	struct drm_plane_state *state;
-	struct dpu_crtc_state *cstate;
+	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
 	struct dpu_plane_state *pstate = NULL;
 	struct dpu_format *format;
-	struct dpu_hw_ctl *ctl;
-	struct dpu_hw_mixer *lm;
-	struct dpu_hw_stage_cfg *stage_cfg;
+	struct dpu_hw_ctl *ctl = mixer->lm_ctl;
+	struct dpu_hw_stage_cfg *stage_cfg = &dpu_crtc->stage_cfg;
 
 	u32 flush_mask;
 	uint32_t stage_idx, lm_idx;
 	int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 };
 	bool bg_alpha_enable = false;
 
-	if (!dpu_crtc || !mixer) {
-		DPU_ERROR("invalid dpu_crtc or mixer\n");
-		return;
-	}
-
-	ctl = mixer->lm_ctl;
-	lm = mixer->hw_lm;
-	stage_cfg = &dpu_crtc->stage_cfg;
-	cstate = to_dpu_crtc_state(crtc->state);
-
 	drm_atomic_crtc_for_each_plane(plane, crtc) {
 		state = plane->state;
 		if (!state)
@@ -217,10 +196,6 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 				state->fb ? state->fb->base.id : -1);
 
 		format = to_dpu_format(msm_framebuffer_format(pstate->base.fb));
-		if (!format) {
-			DPU_ERROR("invalid format\n");
-			return;
-		}
 
 		if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable)
 			bg_alpha_enable = true;
@@ -261,21 +236,13 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
  */
 static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
 {
-	struct dpu_crtc *dpu_crtc;
-	struct dpu_crtc_state *cstate;
-	struct dpu_crtc_mixer *mixer;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
+	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
+	struct dpu_crtc_mixer *mixer = cstate->mixers;
 	struct dpu_hw_ctl *ctl;
 	struct dpu_hw_mixer *lm;
-
 	int i;
 
-	if (!crtc)
-		return;
-
-	dpu_crtc = to_dpu_crtc(crtc);
-	cstate = to_dpu_crtc_state(crtc->state);
-	mixer = cstate->mixers;
-
 	DPU_DEBUG("%s\n", dpu_crtc->name);
 
 	for (i = 0; i < cstate->num_mixers; i++) {
@@ -377,34 +344,13 @@ static void dpu_crtc_vblank_cb(void *data)
 
 static void dpu_crtc_frame_event_work(struct kthread_work *work)
 {
-	struct msm_drm_private *priv;
-	struct dpu_crtc_frame_event *fevent;
-	struct drm_crtc *crtc;
-	struct dpu_crtc *dpu_crtc;
-	struct dpu_kms *dpu_kms;
+	struct dpu_crtc_frame_event *fevent = container_of(work,
+			struct dpu_crtc_frame_event, work);
+	struct drm_crtc *crtc = fevent->crtc;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
 	unsigned long flags;
 	bool frame_done = false;
 
-	if (!work) {
-		DPU_ERROR("invalid work handle\n");
-		return;
-	}
-
-	fevent = container_of(work, struct dpu_crtc_frame_event, work);
-	if (!fevent->crtc || !fevent->crtc->state) {
-		DPU_ERROR("invalid crtc\n");
-		return;
-	}
-
-	crtc = fevent->crtc;
-	dpu_crtc = to_dpu_crtc(crtc);
-
-	dpu_kms = _dpu_crtc_get_kms(crtc);
-	if (!dpu_kms) {
-		DPU_ERROR("invalid kms handle\n");
-		return;
-	}
-	priv = dpu_kms->dev->dev_private;
 	DPU_ATRACE_BEGIN("crtc_frame_event");
 
 	DRM_DEBUG_KMS("crtc%d event:%u ts:%lld\n", crtc->base.id, fevent->event,
@@ -470,11 +416,6 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event)
 	unsigned long flags;
 	u32 crtc_id;
 
-	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid parameters\n");
-		return;
-	}
-
 	/* Nothing to do on idle event */
 	if (event & DPU_ENCODER_FRAME_EVENT_IDLE)
 		return;
@@ -583,23 +524,12 @@ static void _dpu_crtc_setup_mixers(struct drm_crtc *crtc)
 static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
 		struct drm_crtc_state *state)
 {
-	struct dpu_crtc *dpu_crtc;
-	struct dpu_crtc_state *cstate;
-	struct drm_display_mode *adj_mode;
-	u32 crtc_split_width;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
+	struct dpu_crtc_state *cstate = to_dpu_crtc_state(state);
+	struct drm_display_mode *adj_mode = &state->adjusted_mode;
+	u32 crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode);
 	int i;
 
-	if (!crtc || !state) {
-		DPU_ERROR("invalid args\n");
-		return;
-	}
-
-	dpu_crtc = to_dpu_crtc(crtc);
-	cstate = to_dpu_crtc_state(state);
-
-	adj_mode = &state->adjusted_mode;
-	crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode);
-
 	for (i = 0; i < cstate->num_mixers; i++) {
 		struct drm_rect *r = &cstate->lm_bounds[i];
 		r->x1 = crtc_split_width * i;
@@ -693,11 +623,6 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,
 	unsigned long flags;
 	struct dpu_crtc_state *cstate;
 
-	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid crtc\n");
-		return;
-	}
-
 	if (!crtc->state->enable) {
 		DPU_DEBUG("crtc%d -> enable %d, skip atomic_flush\n",
 				crtc->base.id, crtc->state->enable);
@@ -790,15 +715,9 @@ static void dpu_crtc_destroy_state(struct drm_crtc *crtc,
 
 static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
 {
-	struct dpu_crtc *dpu_crtc;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
 	int ret, rc = 0;
 
-	if (!crtc) {
-		DPU_ERROR("invalid argument\n");
-		return -EINVAL;
-	}
-	dpu_crtc = to_dpu_crtc(crtc);
-
 	if (!atomic_read(&dpu_crtc->frame_pending)) {
 		DPU_DEBUG("no frames pending\n");
 		return 0;
@@ -819,29 +738,12 @@ static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
 void dpu_crtc_commit_kickoff(struct drm_crtc *crtc)
 {
 	struct drm_encoder *encoder;
-	struct drm_device *dev;
-	struct dpu_crtc *dpu_crtc;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-	struct dpu_crtc_state *cstate;
+	struct drm_device *dev = crtc->dev;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
+	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
+	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
 	int ret;
 
-	if (!crtc) {
-		DPU_ERROR("invalid argument\n");
-		return;
-	}
-	dev = crtc->dev;
-	dpu_crtc = to_dpu_crtc(crtc);
-	dpu_kms = _dpu_crtc_get_kms(crtc);
-
-	if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev_private) {
-		DPU_ERROR("invalid argument\n");
-		return;
-	}
-
-	priv = dpu_kms->dev->dev_private;
-	cstate = to_dpu_crtc_state(crtc->state);
-
 	/*
 	 * If no mixers has been allocated in dpu_crtc_atomic_check(),
 	 * it means we are trying to start a CRTC whose state is disabled:
@@ -969,24 +871,9 @@ static int _dpu_crtc_vblank_enable_no_lock(
  */
 static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
 {
-	struct dpu_crtc *dpu_crtc;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
 	int ret = 0;
 
-	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid crtc\n");
-		return;
-	}
-	dpu_crtc = to_dpu_crtc(crtc);
-	priv = crtc->dev->dev_private;
-
-	if (!priv->kms) {
-		DPU_ERROR("invalid crtc kms\n");
-		return;
-	}
-	dpu_kms = to_dpu_kms(priv->kms);
-
 	DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable);
 
 	mutex_lock(&dpu_crtc->crtc_lock);
@@ -1079,16 +966,8 @@ static void dpu_crtc_reset(struct drm_crtc *crtc)
 static void dpu_crtc_handle_power_event(u32 event_type, void *arg)
 {
 	struct drm_crtc *crtc = arg;
-	struct dpu_crtc *dpu_crtc;
+	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
 	struct drm_encoder *encoder;
-	struct dpu_crtc_state *cstate;
-
-	if (!crtc) {
-		DPU_ERROR("invalid crtc\n");
-		return;
-	}
-	dpu_crtc = to_dpu_crtc(crtc);
-	cstate = to_dpu_crtc_state(dpu_crtc->base.state);
 
 	mutex_lock(&dpu_crtc->crtc_lock);
 
@@ -1673,8 +1552,6 @@ static int _dpu_crtc_init_debugfs(struct drm_crtc *crtc)
 	dpu_crtc = to_dpu_crtc(crtc);
 
 	dpu_kms = _dpu_crtc_get_kms(crtc);
-	if (!dpu_kms)
-		return -EINVAL;
 
 	dpu_crtc->debugfs_root = debugfs_create_dir(dpu_crtc->name,
 			crtc->dev->primary->debugfs_root);
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2018-09-24 16:22   ` [PATCH v3 3/7] drm/msm/dpu: Remove unneeded checks in dpu_crtc.c Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
       [not found]     ` <20180924162228.180689-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:22   ` [PATCH v3 5/7] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void Bruce Wang
                     ` (3 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

All checks for _dpu_crtc_power_enable are not true, so the function
can never return an error code. All calls of the function have also
been changed so that they don't expect a return value.

v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and
_dpu_crtc_power_disable for clarity.

Signed-off-by: Bruce Wang <bzwang@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 44 ++++++------------------
 1 file changed, 11 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index e31e70f5dbac..cb71e2a2e02e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -60,37 +60,19 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 	return to_dpu_kms(priv->kms);
 }
 
-static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
-{
-	struct drm_crtc *crtc;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-
-	if (!dpu_crtc) {
-		DPU_ERROR("invalid dpu crtc\n");
-		return -EINVAL;
-	}
-
-	crtc = &dpu_crtc->base;
-	if (!crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid drm device\n");
-		return -EINVAL;
-	}
 
-	priv = crtc->dev->dev_private;
-	if (!priv->kms) {
-		DPU_ERROR("invalid kms\n");
-		return -EINVAL;
-	}
+static inline void _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc)
+{
+	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
 
-	dpu_kms = to_dpu_kms(priv->kms);
+	pm_runtime_get_sync(&dpu_kms->pdev->dev);
+}
 
-	if (enable)
-		pm_runtime_get_sync(&dpu_kms->pdev->dev);
-	else
-		pm_runtime_put_sync(&dpu_kms->pdev->dev);
+static inline void _dpu_crtc_power_disable(struct dpu_crtc *dpu_crtc)
+{
+	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
 
-	return 0;
+	pm_runtime_put_sync(&dpu_kms->pdev->dev);
 }
 
 static void dpu_crtc_destroy(struct drm_crtc *crtc)
@@ -823,14 +805,10 @@ static int _dpu_crtc_vblank_enable_no_lock(
 	dev = crtc->dev;
 
 	if (enable) {
-		int ret;
-
 		/* drop lock since power crtc cb may try to re-acquire lock */
 		mutex_unlock(&dpu_crtc->crtc_lock);
-		ret = _dpu_crtc_power_enable(dpu_crtc, true);
+		_dpu_crtc_power_enable(dpu_crtc);
 		mutex_lock(&dpu_crtc->crtc_lock);
-		if (ret)
-			return ret;
 
 		list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
 			if (enc->crtc != crtc)
@@ -857,7 +835,7 @@ static int _dpu_crtc_vblank_enable_no_lock(
 
 		/* drop lock since power crtc cb may try to re-acquire lock */
 		mutex_unlock(&dpu_crtc->crtc_lock);
-		_dpu_crtc_power_enable(dpu_crtc, false);
+		_dpu_crtc_power_disable(dpu_crtc);
 		mutex_lock(&dpu_crtc->crtc_lock);
 	}
 
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 5/7] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (3 preceding siblings ...)
  2018-09-24 16:22   ` [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
  2018-09-24 16:22   ` [PATCH v3 6/7] drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void Bruce Wang
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Removes redundant tests for _dpu_crtc_vblank_enable_no_lock.
Function return type is now void and all function calls have
been changed accordingly.

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

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index cb71e2a2e02e..276f98f1fbd7 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -786,24 +786,14 @@ void dpu_crtc_commit_kickoff(struct drm_crtc *crtc)
  * _dpu_crtc_vblank_enable_no_lock - update power resource and vblank request
  * @dpu_crtc: Pointer to dpu crtc structure
  * @enable: Whether to enable/disable vblanks
- *
- * @Return: error code
  */
-static int _dpu_crtc_vblank_enable_no_lock(
+static void _dpu_crtc_vblank_enable_no_lock(
 		struct dpu_crtc *dpu_crtc, bool enable)
 {
-	struct drm_device *dev;
-	struct drm_crtc *crtc;
+	struct drm_crtc *crtc = &dpu_crtc->base;
+	struct drm_device *dev = crtc->dev;
 	struct drm_encoder *enc;
 
-	if (!dpu_crtc) {
-		DPU_ERROR("invalid crtc\n");
-		return -EINVAL;
-	}
-
-	crtc = &dpu_crtc->base;
-	dev = crtc->dev;
-
 	if (enable) {
 		/* drop lock since power crtc cb may try to re-acquire lock */
 		mutex_unlock(&dpu_crtc->crtc_lock);
@@ -838,8 +828,6 @@ static int _dpu_crtc_vblank_enable_no_lock(
 		_dpu_crtc_power_disable(dpu_crtc);
 		mutex_lock(&dpu_crtc->crtc_lock);
 	}
-
-	return 0;
 }
 
 /**
@@ -850,7 +838,6 @@ static int _dpu_crtc_vblank_enable_no_lock(
 static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
 {
 	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
-	int ret = 0;
 
 	DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable);
 
@@ -865,10 +852,7 @@ static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
 		DPU_DEBUG("crtc%d suspend already set to %d, ignoring update\n",
 				crtc->base.id, enable);
 	else if (dpu_crtc->enabled && dpu_crtc->vblank_requested) {
-		ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, !enable);
-		if (ret)
-			DPU_ERROR("%s vblank enable failed: %d\n",
-					dpu_crtc->name, ret);
+		_dpu_crtc_vblank_enable_no_lock(dpu_crtc, !enable);
 	}
 
 	dpu_crtc->suspend = enable;
@@ -969,7 +953,6 @@ static void dpu_crtc_disable(struct drm_crtc *crtc)
 	struct drm_display_mode *mode;
 	struct drm_encoder *encoder;
 	struct msm_drm_private *priv;
-	int ret;
 	unsigned long flags;
 
 	if (!crtc || !crtc->dev || !crtc->dev->dev_private || !crtc->state) {
@@ -1000,10 +983,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc)
 	trace_dpu_crtc_disable(DRMID(crtc), false, dpu_crtc);
 	if (dpu_crtc->enabled && !dpu_crtc->suspend &&
 			dpu_crtc->vblank_requested) {
-		ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, false);
-		if (ret)
-			DPU_ERROR("%s vblank enable failed: %d\n",
-					dpu_crtc->name, ret);
+		_dpu_crtc_vblank_enable_no_lock(dpu_crtc, false);
 	}
 	dpu_crtc->enabled = false;
 
@@ -1049,7 +1029,6 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
 	struct dpu_crtc *dpu_crtc;
 	struct drm_encoder *encoder;
 	struct msm_drm_private *priv;
-	int ret;
 
 	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
 		DPU_ERROR("invalid crtc\n");
@@ -1071,10 +1050,7 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
 	trace_dpu_crtc_enable(DRMID(crtc), true, dpu_crtc);
 	if (!dpu_crtc->enabled && !dpu_crtc->suspend &&
 			dpu_crtc->vblank_requested) {
-		ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, true);
-		if (ret)
-			DPU_ERROR("%s vblank enable failed: %d\n",
-					dpu_crtc->name, ret);
+		_dpu_crtc_vblank_enable_no_lock(dpu_crtc, true);
 	}
 	dpu_crtc->enabled = true;
 
@@ -1329,7 +1305,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 int dpu_crtc_vblank(struct drm_crtc *crtc, bool en)
 {
 	struct dpu_crtc *dpu_crtc;
-	int ret;
 
 	if (!crtc) {
 		DPU_ERROR("invalid crtc\n");
@@ -1340,10 +1315,7 @@ int dpu_crtc_vblank(struct drm_crtc *crtc, bool en)
 	mutex_lock(&dpu_crtc->crtc_lock);
 	trace_dpu_crtc_vblank(DRMID(&dpu_crtc->base), en, dpu_crtc);
 	if (dpu_crtc->enabled && !dpu_crtc->suspend) {
-		ret = _dpu_crtc_vblank_enable_no_lock(dpu_crtc, en);
-		if (ret)
-			DPU_ERROR("%s vblank enable failed: %d\n",
-					dpu_crtc->name, ret);
+		_dpu_crtc_vblank_enable_no_lock(dpu_crtc, en);
 	}
 	dpu_crtc->vblank_requested = en;
 	mutex_unlock(&dpu_crtc->crtc_lock);
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 6/7] drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (4 preceding siblings ...)
  2018-09-24 16:22   ` [PATCH v3 5/7] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
  2018-09-24 16:22   ` [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns Bruce Wang
  2018-09-28  7:42   ` [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code Sean Paul
  7 siblings, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Removed all impossible checks from the function, which eliminates
the need for a return value. This function is also never used
outside of dpu_plane.c, so the function is made static.

v3: Using helper function _dpu_plane_get_kms() instead of doing
it locally.

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

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index dd27bb925547..924e321a5ac4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -363,35 +363,17 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
 			&pdpu->pipe_qos_cfg);
 }
 
-int dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
+static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
 {
-	struct dpu_plane *pdpu;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-
-	if (!plane || !plane->dev) {
-		DPU_ERROR("invalid arguments\n");
-		return -EINVAL;
-	}
-
-	priv = plane->dev->dev_private;
-	if (!priv || !priv->kms) {
-		DPU_ERROR("invalid KMS reference\n");
-		return -EINVAL;
-	}
-
-	dpu_kms = to_dpu_kms(priv->kms);
-	pdpu = to_dpu_plane(plane);
+	struct dpu_plane *pdpu = to_dpu_plane(plane);
+	struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
 
 	if (!pdpu->is_rt_pipe)
-		goto end;
+		return;
 
 	pm_runtime_get_sync(&dpu_kms->pdev->dev);
 	_dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
 	pm_runtime_put_sync(&dpu_kms->pdev->dev);
-
-end:
-	return 0;
 }
 
 /**
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (5 preceding siblings ...)
  2018-09-24 16:22   ` [PATCH v3 6/7] drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void Bruce Wang
@ 2018-09-24 16:22   ` Bruce Wang
       [not found]     ` <20180924162228.180689-8-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-28  7:42   ` [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code Sean Paul
  7 siblings, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:22 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Remove unneeded checks from _dpu_plane_get_aspace. The function
no longer needs to return anything so it is changed to void.

v3: Made return value of function struct msm_gem_address_space* instead
of passing one in to reflect the purpose of the function.

Signed-off-by: Bruce Wang <bzwang@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 924e321a5ac4..2ed8bc741139 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -431,23 +431,14 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
 /**
  * _dpu_plane_get_aspace: gets the address space
  */
-static int _dpu_plane_get_aspace(
+static void _dpu_plane_get_aspace(
 		struct dpu_plane *pdpu,
 		struct dpu_plane_state *pstate,
 		struct msm_gem_address_space **aspace)
 {
-	struct dpu_kms *kms;
-
-	if (!pdpu || !pstate || !aspace) {
-		DPU_ERROR("invalid parameters\n");
-		return -EINVAL;
-	}
-
-	kms = _dpu_plane_get_kms(&pdpu->base);
+	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
 
 	*aspace = kms->base.aspace;
-
-	return 0;
 }
 
 static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
@@ -824,11 +815,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 
 	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
 
-	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
-	if (ret) {
-		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
-		return ret;
-	}
+	_dpu_plane_get_aspace(pdpu, pstate, &aspace);
 
 	/* cache aspace */
 	pstate->aspace = aspace;
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/7] drm/msm/dpu: Remove unneeded checks in dpu_plane.c
       [not found]     ` <20180924162228.180689-2-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:45       ` Jordan Crouse
  0 siblings, 0 replies; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 16:45 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:22PM -0400, Bruce Wang wrote:
> Removes some checks from dpu_plane.c that will never result in an error.
> Subsequent variable assignments become part of the initialization wherever
> possible. Unused variables are removed.
> 
> v3: removed additional impossible checks and called helper function
> _dpu_plane_get_kms() where possible.

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 | 204 ++--------------------
>  1 file changed, 16 insertions(+), 188 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 1ce76460d710..8f986ea10963 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -123,13 +123,8 @@ struct dpu_plane {
>  
>  static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
>  {
> -	struct msm_drm_private *priv;
> +	struct msm_drm_private *priv = plane->dev->dev_private;
>  
> -	if (!plane || !plane->dev)
> -		return NULL;
> -	priv = plane->dev->dev_private;
> -	if (!priv)
> -		return NULL;
>  	return to_dpu_kms(priv->kms);
>  }
>  
> @@ -148,7 +143,7 @@ static inline int _dpu_plane_calc_fill_level(struct drm_plane *plane,
>  	u32 fixed_buff_size;
>  	u32 total_fl;
>  
> -	if (!plane || !fmt || !plane->state || !src_width || !fmt->bpp) {
> +	if (!fmt || !plane->state || !src_width || !fmt->bpp) {
>  		DPU_ERROR("invalid arguments\n");
>  		return 0;
>  	}
> @@ -229,26 +224,11 @@ static u64 _dpu_plane_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
>  static void _dpu_plane_set_qos_lut(struct drm_plane *plane,
>  		struct drm_framebuffer *fb)
>  {
> -	struct dpu_plane *pdpu;
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  	const struct dpu_format *fmt = NULL;
>  	u64 qos_lut;
>  	u32 total_fl = 0, lut_usage;
>  
> -	if (!plane || !fb) {
> -		DPU_ERROR("invalid arguments plane %d fb %d\n",
> -				plane != 0, fb != 0);
> -		return;
> -	}
> -
> -	pdpu = to_dpu_plane(plane);
> -
> -	if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	} else if (!pdpu->pipe_hw->ops.setup_creq_lut) {
> -		return;
> -	}
> -
>  	if (!pdpu->is_rt_pipe) {
>  		lut_usage = DPU_QOS_LUT_USAGE_NRT;
>  	} else {
> @@ -290,24 +270,10 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane,
>  static void _dpu_plane_set_danger_lut(struct drm_plane *plane,
>  		struct drm_framebuffer *fb)
>  {
> -	struct dpu_plane *pdpu;
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  	const struct dpu_format *fmt = NULL;
>  	u32 danger_lut, safe_lut;
>  
> -	if (!plane || !fb) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	}
> -
> -	pdpu = to_dpu_plane(plane);
> -
> -	if (!pdpu->pipe_hw || !pdpu->pipe_sblk || !pdpu->catalog) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	} else if (!pdpu->pipe_hw->ops.setup_danger_safe_lut) {
> -		return;
> -	}
> -
>  	if (!pdpu->is_rt_pipe) {
>  		danger_lut = pdpu->catalog->perf.danger_lut_tbl
>  				[DPU_QOS_LUT_USAGE_NRT];
> @@ -361,21 +327,7 @@ static void _dpu_plane_set_danger_lut(struct drm_plane *plane,
>  static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
>  	bool enable, u32 flags)
>  {
> -	struct dpu_plane *pdpu;
> -
> -	if (!plane) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	}
> -
> -	pdpu = to_dpu_plane(plane);
> -
> -	if (!pdpu->pipe_hw || !pdpu->pipe_sblk) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	} else if (!pdpu->pipe_hw->ops.setup_qos_ctrl) {
> -		return;
> -	}
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  
>  	if (flags & DPU_PLANE_QOS_VBLANK_CTRL) {
>  		pdpu->pipe_qos_cfg.creq_vblank = pdpu->pipe_sblk->creq_vblank;
> @@ -450,29 +402,9 @@ int dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
>  static void _dpu_plane_set_ot_limit(struct drm_plane *plane,
>  		struct drm_crtc *crtc)
>  {
> -	struct dpu_plane *pdpu;
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  	struct dpu_vbif_set_ot_params ot_params;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> -
> -	if (!plane || !plane->dev || !crtc) {
> -		DPU_ERROR("invalid arguments plane %d crtc %d\n",
> -				plane != 0, crtc != 0);
> -		return;
> -	}
> -
> -	priv = plane->dev->dev_private;
> -	if (!priv || !priv->kms) {
> -		DPU_ERROR("invalid KMS reference\n");
> -		return;
> -	}
> -
> -	dpu_kms = to_dpu_kms(priv->kms);
> -	pdpu = to_dpu_plane(plane);
> -	if (!pdpu->pipe_hw) {
> -		DPU_ERROR("invalid pipe reference\n");
> -		return;
> -	}
> +	struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
>  
>  	memset(&ot_params, 0, sizeof(ot_params));
>  	ot_params.xin_id = pdpu->pipe_hw->cap->xin_id;
> @@ -494,28 +426,9 @@ static void _dpu_plane_set_ot_limit(struct drm_plane *plane,
>   */
>  static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
>  {
> -	struct dpu_plane *pdpu;
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  	struct dpu_vbif_set_qos_params qos_params;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> -
> -	if (!plane || !plane->dev) {
> -		DPU_ERROR("invalid arguments\n");
> -		return;
> -	}
> -
> -	priv = plane->dev->dev_private;
> -	if (!priv || !priv->kms) {
> -		DPU_ERROR("invalid KMS reference\n");
> -		return;
> -	}
> -
> -	dpu_kms = to_dpu_kms(priv->kms);
> -	pdpu = to_dpu_plane(plane);
> -	if (!pdpu->pipe_hw) {
> -		DPU_ERROR("invalid pipe reference\n");
> -		return;
> -	}
> +	struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
>  
>  	memset(&qos_params, 0, sizeof(qos_params));
>  	qos_params.vbif_idx = VBIF_RT;
> @@ -549,10 +462,6 @@ static int _dpu_plane_get_aspace(
>  	}
>  
>  	kms = _dpu_plane_get_kms(&pdpu->base);
> -	if (!kms) {
> -		DPU_ERROR("invalid kms\n");
> -		return -EINVAL;
> -	}
>  
>  	*aspace = kms->base.aspace;
>  
> @@ -564,23 +473,10 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
>  		struct dpu_hw_pipe_cfg *pipe_cfg,
>  		struct drm_framebuffer *fb)
>  {
> -	struct dpu_plane *pdpu;
> +	struct dpu_plane *pdpu = to_dpu_plane(plane);
>  	struct msm_gem_address_space *aspace = NULL;
>  	int ret;
>  
> -	if (!plane || !pstate || !pipe_cfg || !fb) {
> -		DPU_ERROR(
> -			"invalid arg(s), plane %d state %d cfg %d fb %d\n",
> -			plane != 0, pstate != 0, pipe_cfg != 0, fb != 0);
> -		return;
> -	}
> -
> -	pdpu = to_dpu_plane(plane);
> -	if (!pdpu->pipe_hw) {
> -		DPU_ERROR_PLANE(pdpu, "invalid pipe_hw\n");
> -		return;
> -	}
> -
>  	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
>  	if (ret) {
>  		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
> @@ -610,15 +506,6 @@ static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu,
>  {
>  	uint32_t i;
>  
> -	if (!pdpu || !pstate || !scale_cfg || !fmt || !chroma_subsmpl_h ||
> -			!chroma_subsmpl_v) {
> -		DPU_ERROR(
> -			"pdpu %d pstate %d scale_cfg %d fmt %d smp_h %d smp_v %d\n",
> -			!!pdpu, !!pstate, !!scale_cfg, !!fmt, chroma_subsmpl_h,
> -			chroma_subsmpl_v);
> -		return;
> -	}
> -
>  	memset(scale_cfg, 0, sizeof(*scale_cfg));
>  	memset(&pstate->pixel_ext, 0, sizeof(struct dpu_hw_pixel_ext));
>  
> @@ -722,17 +609,8 @@ static void _dpu_plane_setup_scaler(struct dpu_plane *pdpu,
>  		struct dpu_plane_state *pstate,
>  		const struct dpu_format *fmt, bool color_fill)
>  {
> -	struct dpu_hw_pixel_ext *pe;
>  	uint32_t chroma_subsmpl_h, chroma_subsmpl_v;
>  
> -	if (!pdpu || !fmt || !pstate) {
> -		DPU_ERROR("invalid arg(s), plane %d fmt %d state %d\n",
> -				pdpu != 0, fmt != 0, pstate != 0);
> -		return;
> -	}
> -
> -	pe = &pstate->pixel_ext;
> -
>  	/* don't chroma subsample if decimating */
>  	chroma_subsmpl_h =
>  		drm_format_horz_chroma_subsampling(fmt->base.pixel_format);
> @@ -760,21 +638,8 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu,
>  		uint32_t color, uint32_t alpha)
>  {
>  	const struct dpu_format *fmt;
> -	const struct drm_plane *plane;
> -	struct dpu_plane_state *pstate;
> -
> -	if (!pdpu || !pdpu->base.state) {
> -		DPU_ERROR("invalid plane\n");
> -		return -EINVAL;
> -	}
> -
> -	if (!pdpu->pipe_hw) {
> -		DPU_ERROR_PLANE(pdpu, "invalid plane h/w pointer\n");
> -		return -EINVAL;
> -	}
> -
> -	plane = &pdpu->base;
> -	pstate = to_dpu_plane_state(plane->state);
> +	const struct drm_plane *plane = &pdpu->base;
> +	struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state);
>  
>  	DPU_DEBUG_PLANE(pdpu, "\n");
>  
> @@ -825,12 +690,7 @@ static int _dpu_plane_color_fill(struct dpu_plane *pdpu,
>  
>  void dpu_plane_clear_multirect(const struct drm_plane_state *drm_state)
>  {
> -	struct dpu_plane_state *pstate;
> -
> -	if (!drm_state)
> -		return;
> -
> -	pstate = to_dpu_plane_state(drm_state);
> +	struct dpu_plane_state *pstate = to_dpu_plane_state(drm_state);
>  
>  	pstate->multirect_index = DPU_SSPP_RECT_SOLO;
>  	pstate->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
> @@ -961,15 +821,6 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane)
>  void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl,
>  		u32 *flush_sspp)
>  {
> -	struct dpu_plane_state *pstate;
> -
> -	if (!plane || !flush_sspp) {
> -		DPU_ERROR("invalid parameters\n");
> -		return;
> -	}
> -
> -	pstate = to_dpu_plane_state(plane->state);
> -
>  	*flush_sspp = ctl->ops.get_bitmask_sspp(ctl, dpu_plane_pipe(plane));
>  }
>  
> @@ -1389,8 +1240,7 @@ static void dpu_plane_destroy(struct drm_plane *plane)
>  		/* this will destroy the states as well */
>  		drm_plane_cleanup(plane);
>  
> -		if (pdpu->pipe_hw)
> -			dpu_hw_sspp_destroy(pdpu->pipe_hw);
> +		dpu_hw_sspp_destroy(pdpu->pipe_hw);
>  
>  		kfree(pdpu);
>  	}
> @@ -1737,33 +1587,11 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
>  	struct drm_plane *plane = NULL, *master_plane = NULL;
>  	const struct dpu_format_extended *format_list;
>  	struct dpu_plane *pdpu;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *kms;
> +	struct msm_drm_private *priv = dev->dev_private;
> +	struct dpu_kms *kms = to_dpu_kms(priv->kms);
>  	int zpos_max = DPU_ZPOS_MAX;
>  	int ret = -EINVAL;
>  
> -	if (!dev) {
> -		DPU_ERROR("[%u]device is NULL\n", pipe);
> -		goto exit;
> -	}
> -
> -	priv = dev->dev_private;
> -	if (!priv) {
> -		DPU_ERROR("[%u]private data is NULL\n", pipe);
> -		goto exit;
> -	}
> -
> -	if (!priv->kms) {
> -		DPU_ERROR("[%u]invalid KMS reference\n", pipe);
> -		goto exit;
> -	}
> -	kms = to_dpu_kms(priv->kms);
> -
> -	if (!kms->catalog) {
> -		DPU_ERROR("[%u]invalid catalog reference\n", pipe);
> -		goto exit;
> -	}
> -
>  	/* create and zero local structure */
>  	pdpu = kzalloc(sizeof(*pdpu), GFP_KERNEL);
>  	if (!pdpu) {
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 2/7] drm/msm/dpu: Clean up plane atomic disable/update
       [not found]     ` <20180924162228.180689-3-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:45       ` Jordan Crouse
  0 siblings, 0 replies; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 16:45 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 3/7] drm/msm/dpu: Remove unneeded checks in dpu_crtc.c
       [not found]     ` <20180924162228.180689-4-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:45       ` Jordan Crouse
  0 siblings, 0 replies; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 16:45 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:24PM -0400, Bruce Wang wrote:
> Removes impossible checks in dpu_crtc.c.
> Variable assignments are moved up to be initializations where
> possible. Some variables are no longer used, these are removed.
> 
> v3: reverted back to original patch
> 
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_crtc.c | 167 +++--------------------
>  1 file changed, 22 insertions(+), 145 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index a8f2dd7a37c7..e31e70f5dbac 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -55,17 +55,7 @@ static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate,
>  
>  static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
>  {
> -	struct msm_drm_private *priv;
> -
> -	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid crtc\n");
> -		return NULL;
> -	}
> -	priv = crtc->dev->dev_private;
> -	if (!priv || !priv->kms) {
> -		DPU_ERROR("invalid kms\n");
> -		return NULL;
> -	}
> +	struct msm_drm_private *priv = crtc->dev->dev_private;
>  
>  	return to_dpu_kms(priv->kms);
>  }
> @@ -177,28 +167,17 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
>  	struct drm_plane *plane;
>  	struct drm_framebuffer *fb;
>  	struct drm_plane_state *state;
> -	struct dpu_crtc_state *cstate;
> +	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
>  	struct dpu_plane_state *pstate = NULL;
>  	struct dpu_format *format;
> -	struct dpu_hw_ctl *ctl;
> -	struct dpu_hw_mixer *lm;
> -	struct dpu_hw_stage_cfg *stage_cfg;
> +	struct dpu_hw_ctl *ctl = mixer->lm_ctl;
> +	struct dpu_hw_stage_cfg *stage_cfg = &dpu_crtc->stage_cfg;
>  
>  	u32 flush_mask;
>  	uint32_t stage_idx, lm_idx;
>  	int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 };
>  	bool bg_alpha_enable = false;
>  
> -	if (!dpu_crtc || !mixer) {
> -		DPU_ERROR("invalid dpu_crtc or mixer\n");
> -		return;
> -	}
> -
> -	ctl = mixer->lm_ctl;
> -	lm = mixer->hw_lm;
> -	stage_cfg = &dpu_crtc->stage_cfg;
> -	cstate = to_dpu_crtc_state(crtc->state);
> -
>  	drm_atomic_crtc_for_each_plane(plane, crtc) {
>  		state = plane->state;
>  		if (!state)
> @@ -217,10 +196,6 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
>  				state->fb ? state->fb->base.id : -1);
>  
>  		format = to_dpu_format(msm_framebuffer_format(pstate->base.fb));
> -		if (!format) {
> -			DPU_ERROR("invalid format\n");
> -			return;
> -		}
>  
>  		if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable)
>  			bg_alpha_enable = true;
> @@ -261,21 +236,13 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
>   */
>  static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
>  {
> -	struct dpu_crtc *dpu_crtc;
> -	struct dpu_crtc_state *cstate;
> -	struct dpu_crtc_mixer *mixer;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
> +	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
> +	struct dpu_crtc_mixer *mixer = cstate->mixers;
>  	struct dpu_hw_ctl *ctl;
>  	struct dpu_hw_mixer *lm;
> -
>  	int i;
>  
> -	if (!crtc)
> -		return;
> -
> -	dpu_crtc = to_dpu_crtc(crtc);
> -	cstate = to_dpu_crtc_state(crtc->state);
> -	mixer = cstate->mixers;
> -
>  	DPU_DEBUG("%s\n", dpu_crtc->name);
>  
>  	for (i = 0; i < cstate->num_mixers; i++) {
> @@ -377,34 +344,13 @@ static void dpu_crtc_vblank_cb(void *data)
>  
>  static void dpu_crtc_frame_event_work(struct kthread_work *work)
>  {
> -	struct msm_drm_private *priv;
> -	struct dpu_crtc_frame_event *fevent;
> -	struct drm_crtc *crtc;
> -	struct dpu_crtc *dpu_crtc;
> -	struct dpu_kms *dpu_kms;
> +	struct dpu_crtc_frame_event *fevent = container_of(work,
> +			struct dpu_crtc_frame_event, work);
> +	struct drm_crtc *crtc = fevent->crtc;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
>  	unsigned long flags;
>  	bool frame_done = false;
>  
> -	if (!work) {
> -		DPU_ERROR("invalid work handle\n");
> -		return;
> -	}
> -
> -	fevent = container_of(work, struct dpu_crtc_frame_event, work);
> -	if (!fevent->crtc || !fevent->crtc->state) {
> -		DPU_ERROR("invalid crtc\n");
> -		return;
> -	}
> -
> -	crtc = fevent->crtc;
> -	dpu_crtc = to_dpu_crtc(crtc);
> -
> -	dpu_kms = _dpu_crtc_get_kms(crtc);
> -	if (!dpu_kms) {
> -		DPU_ERROR("invalid kms handle\n");
> -		return;
> -	}
> -	priv = dpu_kms->dev->dev_private;
>  	DPU_ATRACE_BEGIN("crtc_frame_event");
>  
>  	DRM_DEBUG_KMS("crtc%d event:%u ts:%lld\n", crtc->base.id, fevent->event,
> @@ -470,11 +416,6 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event)
>  	unsigned long flags;
>  	u32 crtc_id;
>  
> -	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid parameters\n");
> -		return;
> -	}
> -
>  	/* Nothing to do on idle event */
>  	if (event & DPU_ENCODER_FRAME_EVENT_IDLE)
>  		return;
> @@ -583,23 +524,12 @@ static void _dpu_crtc_setup_mixers(struct drm_crtc *crtc)
>  static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
>  		struct drm_crtc_state *state)
>  {
> -	struct dpu_crtc *dpu_crtc;
> -	struct dpu_crtc_state *cstate;
> -	struct drm_display_mode *adj_mode;
> -	u32 crtc_split_width;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
> +	struct dpu_crtc_state *cstate = to_dpu_crtc_state(state);
> +	struct drm_display_mode *adj_mode = &state->adjusted_mode;
> +	u32 crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode);
>  	int i;
>  
> -	if (!crtc || !state) {
> -		DPU_ERROR("invalid args\n");
> -		return;
> -	}
> -
> -	dpu_crtc = to_dpu_crtc(crtc);
> -	cstate = to_dpu_crtc_state(state);
> -
> -	adj_mode = &state->adjusted_mode;
> -	crtc_split_width = _dpu_crtc_get_mixer_width(cstate, adj_mode);
> -
>  	for (i = 0; i < cstate->num_mixers; i++) {
>  		struct drm_rect *r = &cstate->lm_bounds[i];
>  		r->x1 = crtc_split_width * i;
> @@ -693,11 +623,6 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,
>  	unsigned long flags;
>  	struct dpu_crtc_state *cstate;
>  
> -	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid crtc\n");
> -		return;
> -	}
> -
>  	if (!crtc->state->enable) {
>  		DPU_DEBUG("crtc%d -> enable %d, skip atomic_flush\n",
>  				crtc->base.id, crtc->state->enable);
> @@ -790,15 +715,9 @@ static void dpu_crtc_destroy_state(struct drm_crtc *crtc,
>  
>  static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
>  {
> -	struct dpu_crtc *dpu_crtc;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
>  	int ret, rc = 0;
>  
> -	if (!crtc) {
> -		DPU_ERROR("invalid argument\n");
> -		return -EINVAL;
> -	}
> -	dpu_crtc = to_dpu_crtc(crtc);
> -
>  	if (!atomic_read(&dpu_crtc->frame_pending)) {
>  		DPU_DEBUG("no frames pending\n");
>  		return 0;
> @@ -819,29 +738,12 @@ static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
>  void dpu_crtc_commit_kickoff(struct drm_crtc *crtc)
>  {
>  	struct drm_encoder *encoder;
> -	struct drm_device *dev;
> -	struct dpu_crtc *dpu_crtc;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> -	struct dpu_crtc_state *cstate;
> +	struct drm_device *dev = crtc->dev;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
> +	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
> +	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
>  	int ret;
>  
> -	if (!crtc) {
> -		DPU_ERROR("invalid argument\n");
> -		return;
> -	}
> -	dev = crtc->dev;
> -	dpu_crtc = to_dpu_crtc(crtc);
> -	dpu_kms = _dpu_crtc_get_kms(crtc);
> -
> -	if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev_private) {
> -		DPU_ERROR("invalid argument\n");
> -		return;
> -	}
> -
> -	priv = dpu_kms->dev->dev_private;
> -	cstate = to_dpu_crtc_state(crtc->state);
> -
>  	/*
>  	 * If no mixers has been allocated in dpu_crtc_atomic_check(),
>  	 * it means we are trying to start a CRTC whose state is disabled:
> @@ -969,24 +871,9 @@ static int _dpu_crtc_vblank_enable_no_lock(
>   */
>  static void _dpu_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
>  {
> -	struct dpu_crtc *dpu_crtc;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
>  	int ret = 0;
>  
> -	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid crtc\n");
> -		return;
> -	}
> -	dpu_crtc = to_dpu_crtc(crtc);
> -	priv = crtc->dev->dev_private;
> -
> -	if (!priv->kms) {
> -		DPU_ERROR("invalid crtc kms\n");
> -		return;
> -	}
> -	dpu_kms = to_dpu_kms(priv->kms);
> -
>  	DRM_DEBUG_KMS("crtc%d suspend = %d\n", crtc->base.id, enable);
>  
>  	mutex_lock(&dpu_crtc->crtc_lock);
> @@ -1079,16 +966,8 @@ static void dpu_crtc_reset(struct drm_crtc *crtc)
>  static void dpu_crtc_handle_power_event(u32 event_type, void *arg)
>  {
>  	struct drm_crtc *crtc = arg;
> -	struct dpu_crtc *dpu_crtc;
> +	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
>  	struct drm_encoder *encoder;
> -	struct dpu_crtc_state *cstate;
> -
> -	if (!crtc) {
> -		DPU_ERROR("invalid crtc\n");
> -		return;
> -	}
> -	dpu_crtc = to_dpu_crtc(crtc);
> -	cstate = to_dpu_crtc_state(dpu_crtc->base.state);
>  
>  	mutex_lock(&dpu_crtc->crtc_lock);
>  
> @@ -1673,8 +1552,6 @@ static int _dpu_crtc_init_debugfs(struct drm_crtc *crtc)
>  	dpu_crtc = to_dpu_crtc(crtc);
>  
>  	dpu_kms = _dpu_crtc_get_kms(crtc);
> -	if (!dpu_kms)
> -		return -EINVAL;
>  
>  	dpu_crtc->debugfs_root = debugfs_create_dir(dpu_crtc->name,
>  			crtc->dev->primary->debugfs_root);
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void
       [not found]     ` <20180924162228.180689-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:46       ` Jordan Crouse
  2018-09-26  8:10       ` Sean Paul
  1 sibling, 0 replies; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 16:46 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:25PM -0400, Bruce Wang wrote:
> All checks for _dpu_crtc_power_enable are not true, so the function
> can never return an error code. All calls of the function have also
> been changed so that they don't expect a return value.
> 
> v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and
> _dpu_crtc_power_disable for clarity.
> 

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

> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 44 ++++++------------------
>  1 file changed, 11 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index e31e70f5dbac..cb71e2a2e02e 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -60,37 +60,19 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
>  	return to_dpu_kms(priv->kms);
>  }
>  
> -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
> -{
> -	struct drm_crtc *crtc;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> -
> -	if (!dpu_crtc) {
> -		DPU_ERROR("invalid dpu crtc\n");
> -		return -EINVAL;
> -	}
> -
> -	crtc = &dpu_crtc->base;
> -	if (!crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid drm device\n");
> -		return -EINVAL;
> -	}
>  
> -	priv = crtc->dev->dev_private;
> -	if (!priv->kms) {
> -		DPU_ERROR("invalid kms\n");
> -		return -EINVAL;
> -	}
> +static inline void _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc)
> +{
> +	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
>  
> -	dpu_kms = to_dpu_kms(priv->kms);
> +	pm_runtime_get_sync(&dpu_kms->pdev->dev);
> +}
>  
> -	if (enable)
> -		pm_runtime_get_sync(&dpu_kms->pdev->dev);
> -	else
> -		pm_runtime_put_sync(&dpu_kms->pdev->dev);
> +static inline void _dpu_crtc_power_disable(struct dpu_crtc *dpu_crtc)
> +{
> +	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
>  
> -	return 0;
> +	pm_runtime_put_sync(&dpu_kms->pdev->dev);
>  }
>  
>  static void dpu_crtc_destroy(struct drm_crtc *crtc)
> @@ -823,14 +805,10 @@ static int _dpu_crtc_vblank_enable_no_lock(
>  	dev = crtc->dev;
>  
>  	if (enable) {
> -		int ret;
> -
>  		/* drop lock since power crtc cb may try to re-acquire lock */
>  		mutex_unlock(&dpu_crtc->crtc_lock);
> -		ret = _dpu_crtc_power_enable(dpu_crtc, true);
> +		_dpu_crtc_power_enable(dpu_crtc);
>  		mutex_lock(&dpu_crtc->crtc_lock);
> -		if (ret)
> -			return ret;
>  
>  		list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
>  			if (enc->crtc != crtc)
> @@ -857,7 +835,7 @@ static int _dpu_crtc_vblank_enable_no_lock(
>  
>  		/* drop lock since power crtc cb may try to re-acquire lock */
>  		mutex_unlock(&dpu_crtc->crtc_lock);
> -		_dpu_crtc_power_enable(dpu_crtc, false);
> +		_dpu_crtc_power_disable(dpu_crtc);
>  		mutex_lock(&dpu_crtc->crtc_lock);
>  	}
>  
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns
       [not found]     ` <20180924162228.180689-8-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 16:47       ` Jordan Crouse
       [not found]         ` <20180924164729.GE10761-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 16:47 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:28PM -0400, Bruce Wang wrote:
> Remove unneeded checks from _dpu_plane_get_aspace. The function
> no longer needs to return anything so it is changed to void.
> 
> v3: Made return value of function struct msm_gem_address_space* instead
> of passing one in to reflect the purpose of the function.

Oops - it looks like this actually didn't happen?  Maybe an old version of the
patch got out by accident.

Jordan

> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 19 +++----------------
>  1 file changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 924e321a5ac4..2ed8bc741139 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -431,23 +431,14 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
>  /**
>   * _dpu_plane_get_aspace: gets the address space
>   */
> -static int _dpu_plane_get_aspace(
> +static void _dpu_plane_get_aspace(
>  		struct dpu_plane *pdpu,
>  		struct dpu_plane_state *pstate,
>  		struct msm_gem_address_space **aspace)
>  {
> -	struct dpu_kms *kms;
> -
> -	if (!pdpu || !pstate || !aspace) {
> -		DPU_ERROR("invalid parameters\n");
> -		return -EINVAL;
> -	}
> -
> -	kms = _dpu_plane_get_kms(&pdpu->base);
> +	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
>  
>  	*aspace = kms->base.aspace;
> -
> -	return 0;
>  }
>  
>  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
> @@ -824,11 +815,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
>  
>  	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
>  
> -	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> -	if (ret) {
> -		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
> -		return ret;
> -	}
> +	_dpu_plane_get_aspace(pdpu, pstate, &aspace);
>  
>  	/* cache aspace */
>  	pstate->aspace = aspace;
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns
       [not found]         ` <20180924164729.GE10761-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
@ 2018-09-24 16:57           ` Bruce Wang
  2018-09-24 17:45           ` [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void Bruce Wang
  1 sibling, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 16:57 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Sean Paul,
	jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Rob Clark,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

On Mon, Sep 24, 2018 at 12:47 PM Jordan Crouse <jcrouse@codeaurora.org> wrote:
>
> On Mon, Sep 24, 2018 at 12:22:28PM -0400, Bruce Wang wrote:
> > Remove unneeded checks from _dpu_plane_get_aspace. The function
> > no longer needs to return anything so it is changed to void.
> >
> > v3: Made return value of function struct msm_gem_address_space* instead
> > of passing one in to reflect the purpose of the function.
>
> Oops - it looks like this actually didn't happen?  Maybe an old version of the
> patch got out by accident.
>
> Jordan
>

Oh darn, my mistake. Good catch!

> > Signed-off-by: Bruce Wang <bzwang@chromium.org>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 19 +++----------------
> >  1 file changed, 3 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > index 924e321a5ac4..2ed8bc741139 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > @@ -431,23 +431,14 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
> >  /**
> >   * _dpu_plane_get_aspace: gets the address space
> >   */
> > -static int _dpu_plane_get_aspace(
> > +static void _dpu_plane_get_aspace(
> >               struct dpu_plane *pdpu,
> >               struct dpu_plane_state *pstate,
> >               struct msm_gem_address_space **aspace)
> >  {
> > -     struct dpu_kms *kms;
> > -
> > -     if (!pdpu || !pstate || !aspace) {
> > -             DPU_ERROR("invalid parameters\n");
> > -             return -EINVAL;
> > -     }
> > -
> > -     kms = _dpu_plane_get_kms(&pdpu->base);
> > +     struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
> >
> >       *aspace = kms->base.aspace;
> > -
> > -     return 0;
> >  }
> >
> >  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
> > @@ -824,11 +815,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
> >
> >       DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
> >
> > -     ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> > -     if (ret) {
> > -             DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
> > -             return ret;
> > -     }
> > +     _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> >
> >       /* cache aspace */
> >       pstate->aspace = aspace;
> > --
> > 2.19.0.444.g18242da7ef-goog
> >
>
> --
> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void
       [not found]         ` <20180924164729.GE10761-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
  2018-09-24 16:57           ` Bruce Wang
@ 2018-09-24 17:45           ` Bruce Wang
       [not found]             ` <20180924174555.11494-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  1 sibling, 1 reply; 23+ messages in thread
From: Bruce Wang @ 2018-09-24 17:45 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Remove unneeded checks from _dpu_plane_get_aspace. The function
no longer needs to return anything so it is changed to void.

v3: change _dpu_plane_get_aspace to return a struct
*msm_gem_address_space instead passing in a pointer of the same
type to edit.

Signed-off-by: Bruce Wang <bzwang@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++-------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 924e321a5ac4..02c27240d38f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
 /**
  * _dpu_plane_get_aspace: gets the address space
  */
-static int _dpu_plane_get_aspace(
-		struct dpu_plane *pdpu,
-		struct dpu_plane_state *pstate,
-		struct msm_gem_address_space **aspace)
+static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
+		struct dpu_plane *pdpu)
 {
-	struct dpu_kms *kms;
-
-	if (!pdpu || !pstate || !aspace) {
-		DPU_ERROR("invalid parameters\n");
-		return -EINVAL;
-	}
-
-	kms = _dpu_plane_get_kms(&pdpu->base);
+	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
 
-	*aspace = kms->base.aspace;
-
-	return 0;
+	return kms->base.aspace;
 }
 
 static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
@@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
 		struct drm_framebuffer *fb)
 {
 	struct dpu_plane *pdpu = to_dpu_plane(plane);
-	struct msm_gem_address_space *aspace = NULL;
+	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
 	int ret;
 
-	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
-	if (ret) {
-		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
-		return;
-	}
-
 	ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout);
 	if (ret == -EAGAIN)
 		DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n");
@@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 	struct drm_gem_object *obj;
 	struct msm_gem_object *msm_obj;
 	struct dma_fence *fence;
-	struct msm_gem_address_space *aspace;
+	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
 	int ret;
 
 	if (!new_state->fb)
@@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 
 	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
 
-	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
-	if (ret) {
-		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
-		return ret;
-	}
-
 	/* cache aspace */
 	pstate->aspace = aspace;
 
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void
       [not found]             ` <20180924174555.11494-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2018-09-24 17:53               ` Jordan Crouse
  2018-09-24 18:01               ` Jeykumar Sankaran
  1 sibling, 0 replies; 23+ messages in thread
From: Jordan Crouse @ 2018-09-24 17:53 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 01:45:55PM -0400, Bruce Wang wrote:
> Remove unneeded checks from _dpu_plane_get_aspace. The function
> no longer needs to return anything so it is changed to void.
> 
> v3: change _dpu_plane_get_aspace to return a struct
> *msm_gem_address_space instead passing in a pointer of the same
> type to edit.

Thats the stuff... :)

> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++-------------------
>  1 file changed, 6 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 924e321a5ac4..02c27240d38f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
>  /**
>   * _dpu_plane_get_aspace: gets the address space
>   */
> -static int _dpu_plane_get_aspace(
> -		struct dpu_plane *pdpu,
> -		struct dpu_plane_state *pstate,
> -		struct msm_gem_address_space **aspace)
> +static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
> +		struct dpu_plane *pdpu)
>  {
> -	struct dpu_kms *kms;
> -
> -	if (!pdpu || !pstate || !aspace) {
> -		DPU_ERROR("invalid parameters\n");
> -		return -EINVAL;
> -	}
> -
> -	kms = _dpu_plane_get_kms(&pdpu->base);
> +	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
>  
> -	*aspace = kms->base.aspace;
> -
> -	return 0;
> +	return kms->base.aspace;
>  }
>  
>  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
> @@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
>  		struct drm_framebuffer *fb)
>  {
>  	struct dpu_plane *pdpu = to_dpu_plane(plane);
> -	struct msm_gem_address_space *aspace = NULL;
> +	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
>  	int ret;
>  
> -	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> -	if (ret) {
> -		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
> -		return;
> -	}
> -
>  	ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout);
>  	if (ret == -EAGAIN)
>  		DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n");
> @@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
>  	struct drm_gem_object *obj;
>  	struct msm_gem_object *msm_obj;
>  	struct dma_fence *fence;
> -	struct msm_gem_address_space *aspace;
> +	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
>  	int ret;
>  
>  	if (!new_state->fb)
> @@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
>  
>  	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
>  
> -	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> -	if (ret) {
> -		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
> -		return ret;
> -	}
> -
>  	/* cache aspace */
>  	pstate->aspace = aspace;

Nit - aspace is only used to assign pstate->aspace so you can skip the middleman
and assign it directly.

That said it appears that outside of this function pstate->aspace is only used
in dpu_plane_cleanup_fb and I'm not sure why we couldn't just use
_dpu_plane_get_aspace() at that point and save storing the aspace in pstate.

But don't let that derail an otherwise great patch.

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

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void
       [not found]             ` <20180924174555.11494-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 17:53               ` Jordan Crouse
@ 2018-09-24 18:01               ` Jeykumar Sankaran
       [not found]                 ` <41c32e7d920f1e9d5d80d82cdd3a2067-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  1 sibling, 1 reply; 23+ messages in thread
From: Jeykumar Sankaran @ 2018-09-24 18:01 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-09-24 10:45, Bruce Wang wrote:
> Remove unneeded checks from _dpu_plane_get_aspace. The function
> no longer needs to return anything so it is changed to void.
> 
Are the subject and text still appropriate for the patch? The function 
is returning
a ptr to msm_gem_address_space.

> v3: change _dpu_plane_get_aspace to return a struct
> *msm_gem_address_space instead passing in a pointer of the same
> type to edit.
> 
> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++-------------------
>  1 file changed, 6 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 924e321a5ac4..02c27240d38f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct
> drm_plane *plane)
>  /**
>   * _dpu_plane_get_aspace: gets the address space
>   */
> -static int _dpu_plane_get_aspace(
> -		struct dpu_plane *pdpu,
> -		struct dpu_plane_state *pstate,
> -		struct msm_gem_address_space **aspace)
> +static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
> +		struct dpu_plane *pdpu)
>  {
> -	struct dpu_kms *kms;
> -
> -	if (!pdpu || !pstate || !aspace) {
> -		DPU_ERROR("invalid parameters\n");
> -		return -EINVAL;
> -	}
> -
> -	kms = _dpu_plane_get_kms(&pdpu->base);
> +	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
> 
> -	*aspace = kms->base.aspace;
> -
> -	return 0;
> +	return kms->base.aspace;
>  }
> 
>  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
> @@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct
> drm_plane *plane,
>  		struct drm_framebuffer *fb)
>  {
>  	struct dpu_plane *pdpu = to_dpu_plane(plane);
> -	struct msm_gem_address_space *aspace = NULL;
> +	struct msm_gem_address_space *aspace =
> _dpu_plane_get_aspace(pdpu);
>  	int ret;
> 
> -	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> -	if (ret) {
> -		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
> -		return;
> -	}
> -
>  	ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout);
>  	if (ret == -EAGAIN)
>  		DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n");
> @@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane
> *plane,
>  	struct drm_gem_object *obj;
>  	struct msm_gem_object *msm_obj;
>  	struct dma_fence *fence;
> -	struct msm_gem_address_space *aspace;
> +	struct msm_gem_address_space *aspace =
> _dpu_plane_get_aspace(pdpu);
>  	int ret;
> 
>  	if (!new_state->fb)
> @@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane
> *plane,
> 
>  	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
> 
> -	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> -	if (ret) {
> -		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
> -		return ret;
> -	}
> -
>  	/* cache aspace */
>  	pstate->aspace = aspace;

-- 
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void
       [not found]                 ` <41c32e7d920f1e9d5d80d82cdd3a2067-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2018-09-25 13:56                   ` Bruce Wang
  2018-09-25 21:10                   ` [PATCH v3 7/7] drm/msm/dpu: Revise _dpu_plane_get_aspace Bruce Wang
  1 sibling, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-25 13:56 UTC (permalink / raw)
  To: jsanka-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ,
	Rob Clark, Sean Paul, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 2:01 PM Jeykumar Sankaran <jsanka@codeaurora.org> wrote:
>
> On 2018-09-24 10:45, Bruce Wang wrote:
> > Remove unneeded checks from _dpu_plane_get_aspace. The function
> > no longer needs to return anything so it is changed to void.
> >
> Are the subject and text still appropriate for the patch? The function
> is returning
> a ptr to msm_gem_address_space.
>

Good point! Will fix

> > v3: change _dpu_plane_get_aspace to return a struct
> > *msm_gem_address_space instead passing in a pointer of the same
> > type to edit.
> >
> > Signed-off-by: Bruce Wang <bzwang@chromium.org>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++-------------------
> >  1 file changed, 6 insertions(+), 29 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > index 924e321a5ac4..02c27240d38f 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > @@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct
> > drm_plane *plane)
> >  /**
> >   * _dpu_plane_get_aspace: gets the address space
> >   */
> > -static int _dpu_plane_get_aspace(
> > -             struct dpu_plane *pdpu,
> > -             struct dpu_plane_state *pstate,
> > -             struct msm_gem_address_space **aspace)
> > +static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
> > +             struct dpu_plane *pdpu)
> >  {
> > -     struct dpu_kms *kms;
> > -
> > -     if (!pdpu || !pstate || !aspace) {
> > -             DPU_ERROR("invalid parameters\n");
> > -             return -EINVAL;
> > -     }
> > -
> > -     kms = _dpu_plane_get_kms(&pdpu->base);
> > +     struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
> >
> > -     *aspace = kms->base.aspace;
> > -
> > -     return 0;
> > +     return kms->base.aspace;
> >  }
> >
> >  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
> > @@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct
> > drm_plane *plane,
> >               struct drm_framebuffer *fb)
> >  {
> >       struct dpu_plane *pdpu = to_dpu_plane(plane);
> > -     struct msm_gem_address_space *aspace = NULL;
> > +     struct msm_gem_address_space *aspace =
> > _dpu_plane_get_aspace(pdpu);
> >       int ret;
> >
> > -     ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> > -     if (ret) {
> > -             DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
> > -             return;
> > -     }
> > -
> >       ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout);
> >       if (ret == -EAGAIN)
> >               DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n");
> > @@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane
> > *plane,
> >       struct drm_gem_object *obj;
> >       struct msm_gem_object *msm_obj;
> >       struct dma_fence *fence;
> > -     struct msm_gem_address_space *aspace;
> > +     struct msm_gem_address_space *aspace =
> > _dpu_plane_get_aspace(pdpu);
> >       int ret;
> >
> >       if (!new_state->fb)
> > @@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane
> > *plane,
> >
> >       DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
> >
> > -     ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
> > -     if (ret) {
> > -             DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
> > -             return ret;
> > -     }
> > -
> >       /* cache aspace */
> >       pstate->aspace = aspace;
>
> --
> Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 7/7] drm/msm/dpu: Revise _dpu_plane_get_aspace
       [not found]                 ` <41c32e7d920f1e9d5d80d82cdd3a2067-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  2018-09-25 13:56                   ` Bruce Wang
@ 2018-09-25 21:10                   ` Bruce Wang
  1 sibling, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-25 21:10 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

Remove unneeded checks from _dpu_plane_get_aspace.

v3: change _dpu_plane_get_aspace to return a struct
*msm_gem_address_space instead passing in a pointer of the same
type to edit. Remove uneeded arguments.

Signed-off-by: Bruce Wang <bzwang@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 ++++-------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 924e321a5ac4..02c27240d38f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -431,23 +431,12 @@ static void _dpu_plane_set_qos_remap(struct drm_plane *plane)
 /**
  * _dpu_plane_get_aspace: gets the address space
  */
-static int _dpu_plane_get_aspace(
-		struct dpu_plane *pdpu,
-		struct dpu_plane_state *pstate,
-		struct msm_gem_address_space **aspace)
+static inline struct msm_gem_address_space *_dpu_plane_get_aspace(
+		struct dpu_plane *pdpu)
 {
-	struct dpu_kms *kms;
-
-	if (!pdpu || !pstate || !aspace) {
-		DPU_ERROR("invalid parameters\n");
-		return -EINVAL;
-	}
-
-	kms = _dpu_plane_get_kms(&pdpu->base);
+	struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
 
-	*aspace = kms->base.aspace;
-
-	return 0;
+	return kms->base.aspace;
 }
 
 static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
@@ -456,15 +445,9 @@ static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
 		struct drm_framebuffer *fb)
 {
 	struct dpu_plane *pdpu = to_dpu_plane(plane);
-	struct msm_gem_address_space *aspace = NULL;
+	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
 	int ret;
 
-	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
-	if (ret) {
-		DPU_ERROR_PLANE(pdpu, "Failed to get aspace %d\n", ret);
-		return;
-	}
-
 	ret = dpu_format_populate_layout(aspace, fb, &pipe_cfg->layout);
 	if (ret == -EAGAIN)
 		DPU_DEBUG_PLANE(pdpu, "not updating same src addrs\n");
@@ -816,7 +799,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 	struct drm_gem_object *obj;
 	struct msm_gem_object *msm_obj;
 	struct dma_fence *fence;
-	struct msm_gem_address_space *aspace;
+	struct msm_gem_address_space *aspace = _dpu_plane_get_aspace(pdpu);
 	int ret;
 
 	if (!new_state->fb)
@@ -824,12 +807,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 
 	DPU_DEBUG_PLANE(pdpu, "FB[%u]\n", fb->base.id);
 
-	ret = _dpu_plane_get_aspace(pdpu, pstate, &aspace);
-	if (ret) {
-		DPU_ERROR_PLANE(pdpu, "Failed to get aspace\n");
-		return ret;
-	}
-
 	/* cache aspace */
 	pstate->aspace = aspace;
 
-- 
2.19.0.444.g18242da7ef-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void
       [not found]     ` <20180924162228.180689-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2018-09-24 16:46       ` Jordan Crouse
@ 2018-09-26  8:10       ` Sean Paul
  2018-09-26 21:28         ` [PATCH v4 4/7] drm/msm/dpu: Remove _dpu_crtc_power_enable Bruce Wang
  1 sibling, 1 reply; 23+ messages in thread
From: Sean Paul @ 2018-09-26  8:10 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:25PM -0400, Bruce Wang wrote:
> All checks for _dpu_crtc_power_enable are not true, so the function
> can never return an error code. All calls of the function have also
> been changed so that they don't expect a return value.
> 
> v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and
> _dpu_crtc_power_disable for clarity.
> 
> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 44 ++++++------------------
>  1 file changed, 11 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index e31e70f5dbac..cb71e2a2e02e 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -60,37 +60,19 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
>  	return to_dpu_kms(priv->kms);
>  }
>  
> -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
> -{
> -	struct drm_crtc *crtc;
> -	struct msm_drm_private *priv;
> -	struct dpu_kms *dpu_kms;
> -
> -	if (!dpu_crtc) {
> -		DPU_ERROR("invalid dpu crtc\n");
> -		return -EINVAL;
> -	}
> -
> -	crtc = &dpu_crtc->base;
> -	if (!crtc->dev || !crtc->dev->dev_private) {
> -		DPU_ERROR("invalid drm device\n");
> -		return -EINVAL;
> -	}
>  
> -	priv = crtc->dev->dev_private;
> -	if (!priv->kms) {
> -		DPU_ERROR("invalid kms\n");
> -		return -EINVAL;
> -	}
> +static inline void _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc)
> +{
> +	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
>  
> -	dpu_kms = to_dpu_kms(priv->kms);
> +	pm_runtime_get_sync(&dpu_kms->pdev->dev);
> +}
>  
> -	if (enable)
> -		pm_runtime_get_sync(&dpu_kms->pdev->dev);
> -	else
> -		pm_runtime_put_sync(&dpu_kms->pdev->dev);
> +static inline void _dpu_crtc_power_disable(struct dpu_crtc *dpu_crtc)
> +{
> +	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base);
>  
> -	return 0;
> +	pm_runtime_put_sync(&dpu_kms->pdev->dev);
>  }
>  
>  static void dpu_crtc_destroy(struct drm_crtc *crtc)
> @@ -823,14 +805,10 @@ static int _dpu_crtc_vblank_enable_no_lock(
>  	dev = crtc->dev;
>  
>  	if (enable) {
> -		int ret;
> -
>  		/* drop lock since power crtc cb may try to re-acquire lock */
>  		mutex_unlock(&dpu_crtc->crtc_lock);
> -		ret = _dpu_crtc_power_enable(dpu_crtc, true);
> +		_dpu_crtc_power_enable(dpu_crtc);

It seems you could just call the runtime func directly? Something like:

        pm_runtime_get_sync(&dev->dev);

>  		mutex_lock(&dpu_crtc->crtc_lock);
> -		if (ret)
> -			return ret;
>  
>  		list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
>  			if (enc->crtc != crtc)
> @@ -857,7 +835,7 @@ static int _dpu_crtc_vblank_enable_no_lock(
>  
>  		/* drop lock since power crtc cb may try to re-acquire lock */
>  		mutex_unlock(&dpu_crtc->crtc_lock);
> -		_dpu_crtc_power_enable(dpu_crtc, false);
> +		_dpu_crtc_power_disable(dpu_crtc);

        pm_runtime_put_sync(&dev->dev);

>  		mutex_lock(&dpu_crtc->crtc_lock);
>  	}
>  
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v4 4/7] drm/msm/dpu: Remove _dpu_crtc_power_enable
  2018-09-26  8:10       ` Sean Paul
@ 2018-09-26 21:28         ` Bruce Wang
  0 siblings, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-26 21:28 UTC (permalink / raw)
  To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, jcrouse-sgV2jX0FEOL9JmXXK+q4OQ,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ

All checks for _dpu_crtc_power_enable are not true, so the function
can never return an error code. This removes the need for the
function as pm_runtime functions can be used instead.

v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and
_dpu_crtc_power_disable for clarity.

v4: Removed both _dpu_crtc_power_enable and _dpu_crtc_power_disable
and called pm_runtime_get_sync and pm_runtime_put_sync from all
call points

Signed-off-by: Bruce Wang <bzwang@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 41 ++----------------------
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index e31e70f5dbac..c5373a6b51e9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -60,39 +60,6 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 	return to_dpu_kms(priv->kms);
 }
 
-static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
-{
-	struct drm_crtc *crtc;
-	struct msm_drm_private *priv;
-	struct dpu_kms *dpu_kms;
-
-	if (!dpu_crtc) {
-		DPU_ERROR("invalid dpu crtc\n");
-		return -EINVAL;
-	}
-
-	crtc = &dpu_crtc->base;
-	if (!crtc->dev || !crtc->dev->dev_private) {
-		DPU_ERROR("invalid drm device\n");
-		return -EINVAL;
-	}
-
-	priv = crtc->dev->dev_private;
-	if (!priv->kms) {
-		DPU_ERROR("invalid kms\n");
-		return -EINVAL;
-	}
-
-	dpu_kms = to_dpu_kms(priv->kms);
-
-	if (enable)
-		pm_runtime_get_sync(&dpu_kms->pdev->dev);
-	else
-		pm_runtime_put_sync(&dpu_kms->pdev->dev);
-
-	return 0;
-}
-
 static void dpu_crtc_destroy(struct drm_crtc *crtc)
 {
 	struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
@@ -823,14 +790,10 @@ static int _dpu_crtc_vblank_enable_no_lock(
 	dev = crtc->dev;
 
 	if (enable) {
-		int ret;
-
 		/* drop lock since power crtc cb may try to re-acquire lock */
 		mutex_unlock(&dpu_crtc->crtc_lock);
-		ret = _dpu_crtc_power_enable(dpu_crtc, true);
+		pm_runtime_get_sync(dev->dev);
 		mutex_lock(&dpu_crtc->crtc_lock);
-		if (ret)
-			return ret;
 
 		list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
 			if (enc->crtc != crtc)
@@ -857,7 +820,7 @@ static int _dpu_crtc_vblank_enable_no_lock(
 
 		/* drop lock since power crtc cb may try to re-acquire lock */
 		mutex_unlock(&dpu_crtc->crtc_lock);
-		_dpu_crtc_power_enable(dpu_crtc, false);
+		pm_runtime_put_sync(dev->dev);
 		mutex_lock(&dpu_crtc->crtc_lock);
 	}
 
-- 
2.19.0.605.g01d371f741-goog

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code
       [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
                     ` (6 preceding siblings ...)
  2018-09-24 16:22   ` [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns Bruce Wang
@ 2018-09-28  7:42   ` Sean Paul
  2018-09-28 20:41     ` Bruce Wang
  7 siblings, 1 reply; 23+ messages in thread
From: Sean Paul @ 2018-09-28  7:42 UTC (permalink / raw)
  To: Bruce Wang
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, seanpaul-F7+t8E8rja9g9hUCZPvPmw,
	jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Sep 24, 2018 at 12:22:21PM -0400, Bruce Wang wrote:
> Removes uneeded checks and unused variables. Changes some
> function that do not need return values to void.
> 
> Bruce Wang (7):
>   drm/msm/dpu: Remove unneeded checks in dpu_plane.c
>   drm/msm/dpu: Clean up plane atomic disable/update
>   drm/msm/dpu: Remove unneeded checks in dpu_crtc.c
>   drm/msm/dpu: Change _dpu_crtc_power_enable to void
>   drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void
>   drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void
>   drm/msm/dpu: Make _dpu_plane_get_aspace void


Applied to dpu-staging.

Congrats on your first patches!
                                   .''.       
       .''.      .        *''*    :_\/_:     . 
      :_\/_:   _\(/_  .:.*_\/_*   : /\ :  .'.:.'.
  .''.: /\ :   ./)\   ':'* /\ * :  '..'.  -=:o:=-
 :_\/_:'.:::.    ' *''*    * '.\'/.' _\(/_'.':'.'
 : /\ : :::::     *_\/_*     -= o =-  /)\    '  *
  '..'  ':::'     * /\ *     .'/.\'.   '
                   *..*         :

Sean


> 
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  | 253 ++++---------------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 280 +++-------------------
>  2 files changed, 70 insertions(+), 463 deletions(-)
> 
> -- 
> 2.19.0.444.g18242da7ef-goog
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code
  2018-09-28  7:42   ` [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code Sean Paul
@ 2018-09-28 20:41     ` Bruce Wang
  0 siblings, 0 replies; 23+ messages in thread
From: Bruce Wang @ 2018-09-28 20:41 UTC (permalink / raw)
  To: sean-p7yTbzM4H96eqtR555YLDQ
  Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ,
	Rob Clark, Sean Paul, jsanka-sgV2jX0FEOL9JmXXK+q4OQ,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Fri, Sep 28, 2018 at 3:42 AM Sean Paul <sean@poorly.run> wrote:
>
> On Mon, Sep 24, 2018 at 12:22:21PM -0400, Bruce Wang wrote:
> > Removes uneeded checks and unused variables. Changes some
> > function that do not need return values to void.
> >
> > Bruce Wang (7):
> >   drm/msm/dpu: Remove unneeded checks in dpu_plane.c
> >   drm/msm/dpu: Clean up plane atomic disable/update
> >   drm/msm/dpu: Remove unneeded checks in dpu_crtc.c
> >   drm/msm/dpu: Change _dpu_crtc_power_enable to void
> >   drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void
> >   drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void
> >   drm/msm/dpu: Make _dpu_plane_get_aspace void
>
>
> Applied to dpu-staging.
>
> Congrats on your first patches!
>                                    .''.
>        .''.      .        *''*    :_\/_:     .
>       :_\/_:   _\(/_  .:.*_\/_*   : /\ :  .'.:.'.
>   .''.: /\ :   ./)\   ':'* /\ * :  '..'.  -=:o:=-
>  :_\/_:'.:::.    ' *''*    * '.\'/.' _\(/_'.':'.'
>  : /\ : :::::     *_\/_*     -= o =-  /)\    '  *
>   '..'  ':::'     * /\ *     .'/.\'.   '
>                    *..*         :
>
> Sean
>

Haha, I have no idea what that ascii art is supposed to be but thanks Sean!
Also, a big thank you to Jordan and Jeykumar as well for the comments
and reviews

Bruce

>
> >
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  | 253 ++++---------------
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 280 +++-------------------
> >  2 files changed, 70 insertions(+), 463 deletions(-)
> >
> > --
> > 2.19.0.444.g18242da7ef-goog
> >
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-09-28 20:41 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24 16:22 [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code Bruce Wang
     [not found] ` <20180924162228.180689-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:22   ` [PATCH v3 1/7] drm/msm/dpu: Remove unneeded checks in dpu_plane.c Bruce Wang
     [not found]     ` <20180924162228.180689-2-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:45       ` Jordan Crouse
2018-09-24 16:22   ` [PATCH v3 2/7] drm/msm/dpu: Clean up plane atomic disable/update Bruce Wang
     [not found]     ` <20180924162228.180689-3-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:45       ` Jordan Crouse
2018-09-24 16:22   ` [PATCH v3 3/7] drm/msm/dpu: Remove unneeded checks in dpu_crtc.c Bruce Wang
     [not found]     ` <20180924162228.180689-4-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:45       ` Jordan Crouse
2018-09-24 16:22   ` [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void Bruce Wang
     [not found]     ` <20180924162228.180689-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:46       ` Jordan Crouse
2018-09-26  8:10       ` Sean Paul
2018-09-26 21:28         ` [PATCH v4 4/7] drm/msm/dpu: Remove _dpu_crtc_power_enable Bruce Wang
2018-09-24 16:22   ` [PATCH v3 5/7] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock to void Bruce Wang
2018-09-24 16:22   ` [PATCH v3 6/7] drm/msm/dpu: Make dpu_plane_danger_signal_ctrl void Bruce Wang
2018-09-24 16:22   ` [PATCH v3 7/7] drm/msm/dpu: _dpu_plane_get_aspace returns Bruce Wang
     [not found]     ` <20180924162228.180689-8-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 16:47       ` Jordan Crouse
     [not found]         ` <20180924164729.GE10761-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-09-24 16:57           ` Bruce Wang
2018-09-24 17:45           ` [PATCH v3 7/7] drm/msm/dpu: Make _dpu_plane_get_aspace void Bruce Wang
     [not found]             ` <20180924174555.11494-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-24 17:53               ` Jordan Crouse
2018-09-24 18:01               ` Jeykumar Sankaran
     [not found]                 ` <41c32e7d920f1e9d5d80d82cdd3a2067-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-09-25 13:56                   ` Bruce Wang
2018-09-25 21:10                   ` [PATCH v3 7/7] drm/msm/dpu: Revise _dpu_plane_get_aspace Bruce Wang
2018-09-28  7:42   ` [PATCH v3 0/7] drm/msm/dpu: Clean up dpu code Sean Paul
2018-09-28 20:41     ` Bruce Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox