diff mbox

[DPU,03/19] drm/msm: dpu_plane: Replace DPU_EVT with tracepoints

Message ID 20180620204841.56354-4-seanpaul@chromium.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sean Paul June 20, 2018, 8:48 p.m. UTC
This patch converts all DPU_EVTs in dpu_plane with either a DRM_* log
message or a linux tracepoint.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 19 +++-------
 drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h | 44 +++++++++++++++++++++++
 2 files changed, 49 insertions(+), 14 deletions(-)

Comments

Rajesh Yadav June 26, 2018, 6:39 a.m. UTC | #1
On 2018-06-21 02:18, Sean Paul wrote:
> This patch converts all DPU_EVTs in dpu_plane with either a DRM_* log
> message or a linux tracepoint.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Rajesh Yadav <ryadav@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 19 +++-------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h | 44 +++++++++++++++++++++++
>  2 files changed, 49 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 6090ace6012a..2c3dc00477b3 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -609,18 +609,9 @@ static inline void _dpu_plane_set_scanout(struct
> drm_plane *plane,
>  	else if (ret)
>  		DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
>  	else if (pdpu->pipe_hw->ops.setup_sourceaddress) {
> -		DPU_EVT32_VERBOSE(pdpu->pipe_hw->idx,
> -				pipe_cfg->layout.width,
> -				pipe_cfg->layout.height,
> -				pipe_cfg->layout.plane_addr[0],
> -				pipe_cfg->layout.plane_size[0],
> -				pipe_cfg->layout.plane_addr[1],
> -				pipe_cfg->layout.plane_size[1],
> -				pipe_cfg->layout.plane_addr[2],
> -				pipe_cfg->layout.plane_size[2],
> -				pipe_cfg->layout.plane_addr[3],
> -				pipe_cfg->layout.plane_size[3],
> -				pstate->multirect_index);
> +		trace_dpu_plane_set_scanout(pdpu->pipe_hw->idx,
> +					    &pipe_cfg->layout,
> +					    pstate->multirect_index);
>  		pdpu->pipe_hw->ops.setup_sourceaddress(pdpu->pipe_hw, pipe_cfg,
>  						pstate->multirect_index);
>  	}
> @@ -1420,8 +1411,8 @@ static void _dpu_plane_atomic_disable(struct
> drm_plane *plane,
>  	state = plane->state;
>  	pstate = to_dpu_plane_state(state);
> 
> -	DPU_EVT32(DRMID(plane), is_dpu_plane_virtual(plane),
> -			pstate->multirect_mode);
> +	trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane),
> +				pstate->multirect_mode);
> 
>  	pstate->pending = true;
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
> index 877621184782..5d3aa5a994be 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
> @@ -725,6 +725,50 @@ TRACE_EVENT(dpu_crtc_disable_frame_pending,
>  		  __entry->frame_pending)
>  );
> 
> +TRACE_EVENT(dpu_plane_set_scanout,
> +	TP_PROTO(enum dpu_sspp index, struct dpu_hw_fmt_layout *layout,
> +		 enum dpu_sspp_multirect_index multirect_index),
> +	TP_ARGS(index, layout, multirect_index),
> +	TP_STRUCT__entry(
> +		__field(	enum dpu_sspp,			index	)
> +		__field(	struct dpu_hw_fmt_layout*,	layout	)
> +		__field(	enum dpu_sspp_multirect_index,	multirect_index)
> +	),
> +	TP_fast_assign(
> +		__entry->index = index;
> +		__entry->layout = layout;
> +		__entry->multirect_index = multirect_index;
> +	),
> +	TP_printk("index:%d layout:{%ux%u @ [%u/%u, %u/%u, %u/%u, %u/%u]} "
> +		  "multirect_index:%d", __entry->index, __entry->layout->width,
> +		  __entry->layout->height, __entry->layout->plane_addr[0],
> +		  __entry->layout->plane_size[0],
> +		  __entry->layout->plane_addr[1],
> +		  __entry->layout->plane_size[1],
> +		  __entry->layout->plane_addr[2],
> +		  __entry->layout->plane_size[2],
> +		  __entry->layout->plane_addr[3],
> +		  __entry->layout->plane_size[3], __entry->multirect_index)
> +);
> +
> +TRACE_EVENT(dpu_plane_disable,
> +	TP_PROTO(uint32_t drm_id, bool is_virtual, uint32_t multirect_mode),
> +	TP_ARGS(drm_id, is_virtual, multirect_mode),
> +	TP_STRUCT__entry(
> +		__field(	uint32_t,		drm_id		)
> +		__field(	bool,			is_virtual	)
> +		__field(	uint32_t,		multirect_mode	)
> +	),
> +	TP_fast_assign(
> +		__entry->drm_id = drm_id;
> +		__entry->is_virtual = is_virtual;
> +		__entry->multirect_mode = multirect_mode;
> +	),
> +	TP_printk("id:%u is_virtual:%s multirect_mode:%u", __entry->drm_id,
> +		  __entry->is_virtual ? "true" : "false",
> +		  __entry->multirect_mode)
> +);
> +
>  #define DPU_ATRACE_END(name) trace_tracing_mark_write(current->tgid, 
> name, 0)
>  #define DPU_ATRACE_BEGIN(name) trace_tracing_mark_write(current->tgid, 
> name, 1)
>  #define DPU_ATRACE_FUNC() DPU_ATRACE_BEGIN(__func__)
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 6090ace6012a..2c3dc00477b3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -609,18 +609,9 @@  static inline void _dpu_plane_set_scanout(struct drm_plane *plane,
 	else if (ret)
 		DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
 	else if (pdpu->pipe_hw->ops.setup_sourceaddress) {
-		DPU_EVT32_VERBOSE(pdpu->pipe_hw->idx,
-				pipe_cfg->layout.width,
-				pipe_cfg->layout.height,
-				pipe_cfg->layout.plane_addr[0],
-				pipe_cfg->layout.plane_size[0],
-				pipe_cfg->layout.plane_addr[1],
-				pipe_cfg->layout.plane_size[1],
-				pipe_cfg->layout.plane_addr[2],
-				pipe_cfg->layout.plane_size[2],
-				pipe_cfg->layout.plane_addr[3],
-				pipe_cfg->layout.plane_size[3],
-				pstate->multirect_index);
+		trace_dpu_plane_set_scanout(pdpu->pipe_hw->idx,
+					    &pipe_cfg->layout,
+					    pstate->multirect_index);
 		pdpu->pipe_hw->ops.setup_sourceaddress(pdpu->pipe_hw, pipe_cfg,
 						pstate->multirect_index);
 	}
@@ -1420,8 +1411,8 @@  static void _dpu_plane_atomic_disable(struct drm_plane *plane,
 	state = plane->state;
 	pstate = to_dpu_plane_state(state);
 
-	DPU_EVT32(DRMID(plane), is_dpu_plane_virtual(plane),
-			pstate->multirect_mode);
+	trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane),
+				pstate->multirect_mode);
 
 	pstate->pending = true;
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
index 877621184782..5d3aa5a994be 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h
@@ -725,6 +725,50 @@  TRACE_EVENT(dpu_crtc_disable_frame_pending,
 		  __entry->frame_pending)
 );
 
+TRACE_EVENT(dpu_plane_set_scanout,
+	TP_PROTO(enum dpu_sspp index, struct dpu_hw_fmt_layout *layout,
+		 enum dpu_sspp_multirect_index multirect_index),
+	TP_ARGS(index, layout, multirect_index),
+	TP_STRUCT__entry(
+		__field(	enum dpu_sspp,			index	)
+		__field(	struct dpu_hw_fmt_layout*,	layout	)
+		__field(	enum dpu_sspp_multirect_index,	multirect_index)
+	),
+	TP_fast_assign(
+		__entry->index = index;
+		__entry->layout = layout;
+		__entry->multirect_index = multirect_index;
+	),
+	TP_printk("index:%d layout:{%ux%u @ [%u/%u, %u/%u, %u/%u, %u/%u]} "
+		  "multirect_index:%d", __entry->index, __entry->layout->width,
+		  __entry->layout->height, __entry->layout->plane_addr[0],
+		  __entry->layout->plane_size[0],
+		  __entry->layout->plane_addr[1],
+		  __entry->layout->plane_size[1],
+		  __entry->layout->plane_addr[2],
+		  __entry->layout->plane_size[2],
+		  __entry->layout->plane_addr[3],
+		  __entry->layout->plane_size[3], __entry->multirect_index)
+);
+
+TRACE_EVENT(dpu_plane_disable,
+	TP_PROTO(uint32_t drm_id, bool is_virtual, uint32_t multirect_mode),
+	TP_ARGS(drm_id, is_virtual, multirect_mode),
+	TP_STRUCT__entry(
+		__field(	uint32_t,		drm_id		)
+		__field(	bool,			is_virtual	)
+		__field(	uint32_t,		multirect_mode	)
+	),
+	TP_fast_assign(
+		__entry->drm_id = drm_id;
+		__entry->is_virtual = is_virtual;
+		__entry->multirect_mode = multirect_mode;
+	),
+	TP_printk("id:%u is_virtual:%s multirect_mode:%u", __entry->drm_id,
+		  __entry->is_virtual ? "true" : "false",
+		  __entry->multirect_mode)
+);
+
 #define DPU_ATRACE_END(name) trace_tracing_mark_write(current->tgid, name, 0)
 #define DPU_ATRACE_BEGIN(name) trace_tracing_mark_write(current->tgid, name, 1)
 #define DPU_ATRACE_FUNC() DPU_ATRACE_BEGIN(__func__)