2 * Copyright (C) STMicroelectronics SA 2014
3 * Author: Benjamin Gaignard <benjamin.gaignard@st.com> for STMicroelectronics.
4 * License terms: GNU General Public License (GPL), version 2
11 #include <drm/drm_atomic_helper.h>
12 #include <drm/drm_plane_helper.h>
14 extern struct drm_plane_funcs sti_plane_helpers_funcs;
16 #define to_sti_plane(x) container_of(x, struct sti_plane, drm_plane)
18 #define STI_PLANE_TYPE_SHIFT 8
19 #define STI_PLANE_TYPE_MASK (~((1 << STI_PLANE_TYPE_SHIFT) - 1))
22 STI_GDP = 1 << STI_PLANE_TYPE_SHIFT,
23 STI_VDP = 2 << STI_PLANE_TYPE_SHIFT,
24 STI_CUR = 3 << STI_PLANE_TYPE_SHIFT,
25 STI_BCK = 4 << STI_PLANE_TYPE_SHIFT
28 enum sti_plane_id_of_type {
36 STI_GDP_0 = STI_GDP | STI_ID_0,
37 STI_GDP_1 = STI_GDP | STI_ID_1,
38 STI_GDP_2 = STI_GDP | STI_ID_2,
39 STI_GDP_3 = STI_GDP | STI_ID_3,
40 STI_HQVDP_0 = STI_VDP | STI_ID_0,
45 enum sti_plane_status {
56 unsigned int curr_frame_counter;
57 unsigned int last_frame_counter;
58 unsigned int curr_field_counter;
59 unsigned int last_field_counter;
60 struct timespec last_timestamp;
61 char fps_str[FPS_LENGTH];
62 char fips_str[FPS_LENGTH];
68 * @plane: drm plane it is bound to (if any)
69 * @desc: plane type & id
70 * @status: to know the status of the plane
71 * @zorder: plane z-order
72 * @fps_info: frame per second info
75 struct drm_plane drm_plane;
76 enum sti_plane_desc desc;
77 enum sti_plane_status status;
79 struct sti_fps_info fps_info;
82 const char *sti_plane_to_str(struct sti_plane *plane);
83 void sti_plane_update_fps(struct sti_plane *plane,
86 void sti_plane_init_property(struct sti_plane *plane,
87 enum drm_plane_type type);