summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2016-08-19 13:46:09 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:53:33 +0900
commit95bc30fa225ca17bd589606bc7fc58f3c5305a08 (patch)
tree9563b65624c57a03f780ae39b088b703666e6be7
parentf09d2a5de83d362e50f7a5e9f1f2a26d3a13dad1 (diff)
drm/exynos: add trace support
This patch adds trace support and also inserts two trace points, one is win_commit and other is finish_pageflip. These would give us help to trace pageflip operation. Change-Id: I1cd912f03703ae40d3fe45a4b329eddfce5178e4 Signed-off-by: Inki Dae <inki.dae@samsung.com> [squashed with bugfixes and ported to v4.1 Tizen kernel] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/Makefile2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_trace.c18
-rw-r--r--drivers/gpu/drm/exynos/exynos_trace.h129
5 files changed, 159 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 99bbfd3674f7..2c38400f2757 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -6,7 +6,7 @@ ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/exynos
exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \
exynos_drm_crtc.o exynos_drm_fbdev.o exynos_drm_fb.o \
exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
- exynos_drm_plane.o exynos_drm_dmabuf.o
+ exynos_drm_plane.o exynos_drm_dmabuf.o exynos_trace.o
exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index db47a5138005..37faad2de1a6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -19,6 +19,7 @@
#include "exynos_drm_drv.h"
#include "exynos_drm_encoder.h"
#include "exynos_drm_plane.h"
+#include "exynos_trace.h"
static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
{
@@ -178,6 +179,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
if (!event)
return -EINVAL;
+ trace_exynos_request_pageflip(exynos_crtc);
+
+
spin_lock_irq(&dev->event_lock);
if (exynos_crtc->event) {
ret = -EBUSY;
@@ -324,6 +328,7 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
drm_vblank_put(dev, pipe);
wake_up(&exynos_crtc->pending_flip_queue);
+ trace_exynos_finish_vsync(exynos_crtc);
}
exynos_crtc->event = NULL;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 979108a52dcc..d8b398a9d68c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -18,6 +18,7 @@
#include "exynos_drm_fb.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_plane.h"
+#include "exynos_trace.h"
/*
* This function is to get X or Y size shown via screen. This needs length and
@@ -145,6 +146,7 @@ static void exynos_plane_update_cb(struct drm_reservation_cb *rcb, void *params)
struct exynos_drm_crtc *exynos_crtc =
to_exynos_crtc(exynos_plane->base.crtc);
+ trace_exynos_update_cb(exynos_crtc, exynos_plane);
if (exynos_crtc->ops->win_commit)
exynos_crtc->ops->win_commit(exynos_crtc,
exynos_plane->zpos);
@@ -193,18 +195,22 @@ static int exynos_plane_fence(struct exynos_drm_plane *plane,
plane->update_pending = true;
plane->pending_fence = fence;
+ trace_exynos_add_shared_fence(exynos_crtc, plane);
reservation_object_add_shared_fence(resv, plane->pending_fence);
if (!reservation_object_test_signaled_rcu(resv, false)) {
drm_reservation_cb_init(&plane->rcb, exynos_plane_update_cb, plane);
+ trace_exynos_cb_add(exynos_crtc, plane);
ret = drm_reservation_cb_add(&plane->rcb, resv, false);
if (ret < 0) {
DRM_ERROR("Adding reservation to callback failed: %d\n", ret);
goto err_fence;
}
+ trace_exynos_cb_done(exynos_crtc, plane);
drm_reservation_cb_done(&plane->rcb);
} else {
+ trace_exynos_cb_fast_path(exynos_crtc, plane);
exynos_plane_update_cb(&plane->rcb, plane);
}
diff --git a/drivers/gpu/drm/exynos/exynos_trace.c b/drivers/gpu/drm/exynos/exynos_trace.c
new file mode 100644
index 000000000000..696f5bfc8b59
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_trace.c
@@ -0,0 +1,18 @@
+/* exynos_trace.c
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Authors:
+ * Inki Dae <inki.dae@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include "exynos_drm_drv.h"
+
+#ifndef __CHECKER__
+#define CREATE_TRACE_POINTS
+#include "exynos_trace.h"
+#endif
diff --git a/drivers/gpu/drm/exynos/exynos_trace.h b/drivers/gpu/drm/exynos/exynos_trace.h
new file mode 100644
index 000000000000..cdf1206bf3ea
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_trace.h
@@ -0,0 +1,129 @@
+/* exynos_trace.h
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Authors:
+ * Inki Dae <inki.dae@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#if !defined(_EXYNOS_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
+#define _EXYNOS_TRACE_H_
+
+#include <linux/stringify.h>
+#include <linux/types.h>
+#include <linux/tracepoint.h>
+#include <linux/fence.h>
+
+#include <drm/drmP.h>
+#include "exynos_drm_drv.h"
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM exynos
+
+#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_FILE exynos_trace
+
+#ifdef CONFIG_DRM_DMA_SYNC
+DECLARE_EVENT_CLASS(exynos_fence,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane),
+
+ TP_STRUCT__entry(
+ __field(u32, seqno)
+ __field(u32, context)
+ __field(u32, count)
+ __field(u32, type)
+ __field(u32, zpos)
+ ),
+
+ TP_fast_assign(
+ __entry->seqno = plane->pending_fence->seqno;
+ __entry->context = plane->pending_fence->context;
+ __entry->count = atomic_read(&plane->rcb.count);
+ __entry->type = crtc->type;
+ __entry->zpos = plane->zpos;
+ ),
+
+ TP_printk("fence(%d) rcb(%d), crtc type(%d), plane zpos(%d)",
+ __entry->seqno, __entry->count,
+ __entry->type, __entry->zpos)
+);
+
+DEFINE_EVENT(exynos_fence, exynos_cb_add,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane)
+);
+
+DEFINE_EVENT(exynos_fence, exynos_add_shared_fence,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane)
+);
+
+DEFINE_EVENT(exynos_fence, exynos_cb_done,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane)
+);
+
+DEFINE_EVENT(exynos_fence, exynos_cb_fast_path,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane)
+);
+
+DEFINE_EVENT(exynos_fence, exynos_update_cb,
+ TP_PROTO(struct exynos_drm_crtc *crtc,
+ struct exynos_drm_plane *plane),
+
+ TP_ARGS(crtc, plane)
+);
+#endif
+
+DECLARE_EVENT_CLASS(exynos_modeset,
+ TP_PROTO(struct exynos_drm_crtc *crtc),
+
+ TP_ARGS(crtc),
+
+ TP_STRUCT__entry(
+ __field(u32, pipe)
+ __field(u32, type)
+ ),
+
+ TP_fast_assign(
+ __entry->pipe = crtc->pipe;
+ __entry->type = crtc->type;
+ ),
+
+ TP_printk("crtc pipe = %d, crtc type = %d",
+ __entry->pipe, __entry->type)
+);
+
+
+DEFINE_EVENT(exynos_modeset, exynos_finish_vsync,
+ TP_PROTO(struct exynos_drm_crtc *crtc),
+
+ TP_ARGS(crtc)
+);
+
+DEFINE_EVENT(exynos_modeset, exynos_request_pageflip,
+ TP_PROTO(struct exynos_drm_crtc *crtc),
+
+ TP_ARGS(crtc)
+);
+
+#endif /* _EXYNOS_TRACE_H_ */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>