aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti/sti_plane.h
diff options
context:
space:
mode:
authorVincent Abriou <vincent.abriou@st.com>2016-02-08 11:34:31 +0100
committerVincent Abriou <vincent.abriou@st.com>2016-02-26 10:06:23 +0100
commitbf8f9e4a810206dc91f82a68f50b0eb34f8710ef (patch)
treef17d540e3de474d45b1fe4b89626d274ad84969c /drivers/gpu/drm/sti/sti_plane.h
parentdrm/sti: add debugfs entries for TVOUT encoders (diff)
downloadlinux-dev-bf8f9e4a810206dc91f82a68f50b0eb34f8710ef.tar.xz
linux-dev-bf8f9e4a810206dc91f82a68f50b0eb34f8710ef.zip
drm/sti: add debugfs fps_show/fps_get mechanism for planes
Display fps on demand for each used plane: cat /sys/kernel/debug/dri/0/fps_get Display fps in live in the console for each used plane: echo 255 > /sys/kernel/debug/dri/0/fps_show Signed-off-by: Vincent Abriou <vincent.abriou@st.com> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/sti/sti_plane.h')
-rw-r--r--drivers/gpu/drm/sti/sti_plane.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sti/sti_plane.h b/drivers/gpu/drm/sti/sti_plane.h
index 86f1e6fc81b9..c50a3b9f5d37 100644
--- a/drivers/gpu/drm/sti/sti_plane.h
+++ b/drivers/gpu/drm/sti/sti_plane.h
@@ -50,6 +50,18 @@ enum sti_plane_status {
STI_PLANE_DISABLED,
};
+#define FPS_LENGTH 64
+struct sti_fps_info {
+ bool output;
+ unsigned int curr_frame_counter;
+ unsigned int last_frame_counter;
+ unsigned int curr_field_counter;
+ unsigned int last_field_counter;
+ struct timespec last_timestamp;
+ char fps_str[FPS_LENGTH];
+ char fips_str[FPS_LENGTH];
+};
+
/**
* STI plane structure
*
@@ -57,15 +69,20 @@ enum sti_plane_status {
* @desc: plane type & id
* @status: to know the status of the plane
* @zorder: plane z-order
+ * @fps_info: frame per second info
*/
struct sti_plane {
struct drm_plane drm_plane;
enum sti_plane_desc desc;
enum sti_plane_status status;
int zorder;
+ struct sti_fps_info fps_info;
};
const char *sti_plane_to_str(struct sti_plane *plane);
+void sti_plane_update_fps(struct sti_plane *plane,
+ bool new_frame,
+ bool new_field);
void sti_plane_init_property(struct sti_plane *plane,
enum drm_plane_type type);
#endif