summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-01-18 12:28:45 -0500
committerRobert Foss <robert.foss@collabora.com>2017-01-31 16:19:35 -0500
commit36656239ef9679059a10f812db074bee990934d3 (patch)
tree5f5c3da91e448270ef02a47738a21c839b3dfebf /lib/igt_kms.h
parent260df259ce3b7e56adbb8fd223a5de2e84774c14 (diff)
lib/igt_kms: Implement dynamic plane count support
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe. The simple fix for this would be to simply bump hardcoded value for number of frames per pipe. But a better solution would be to add support for dynamic number of planes per pipe to i-g-t. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'lib/igt_kms.h')
-rw-r--r--lib/igt_kms.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 4e298f89..510657a3 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -61,21 +61,22 @@ int kmstest_pipe_to_index(char pipe);
/* We namespace this enum to not conflict with the Android i915_drm.h */
enum igt_plane {
- IGT_PLANE_1 = 0,
- IGT_PLANE_PRIMARY = IGT_PLANE_1,
- IGT_PLANE_2,
- IGT_PLANE_3,
- IGT_PLANE_4,
- IGT_PLANE_5,
- IGT_PLANE_6,
- IGT_PLANE_7,
- IGT_PLANE_8,
- IGT_PLANE_9,
- IGT_PLANE_CURSOR, /* IGT_PLANE_CURSOR is always the last plane. */
- IGT_MAX_PLANES,
+ IGT_PLANE_1 = 0,
+ IGT_PLANE_PRIMARY = IGT_PLANE_1,
+ IGT_PLANE_2,
+ IGT_PLANE_3,
+ IGT_PLANE_4,
+ IGT_PLANE_5,
+ IGT_PLANE_6,
+ IGT_PLANE_7,
+ IGT_PLANE_8,
+ IGT_PLANE_9,
+ IGT_PLANE_CURSOR, /* IGT_PLANE_CURSOR is always the last plane. */
+ IGT_MAX_PLANES,
};
const char *kmstest_plane_name(enum igt_plane plane);
+const char *kmstest_plane_type_name(int plane_type);
enum port {
PORT_A = 0,
@@ -272,6 +273,7 @@ typedef struct {
igt_pipe_t *pipe;
int index;
/* capabilities */
+ int type;
unsigned int is_primary : 1;
unsigned int is_cursor : 1;
/* state tracking */
@@ -308,8 +310,11 @@ struct igt_pipe {
igt_display_t *display;
enum pipe pipe;
bool enabled;
+
int n_planes;
- igt_plane_t planes[IGT_MAX_PLANES];
+ int plane_cursor;
+ int plane_primary;
+ igt_plane_t *planes;
uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS];
@@ -369,9 +374,11 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);
void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
void igt_output_set_pipe(igt_output_t *output, enum pipe pipe);
void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode);
-igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane);
+igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx);
+igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int plane_type);
igt_output_t *igt_output_from_connector(igt_display_t *display,
- drmModeConnector *connector);
+ drmModeConnector *connector);
+igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type);
bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
uint32_t *prop_id, uint64_t *value,
drmModePropertyPtr *prop);