summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-09-21 14:30:09 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-10-20 11:17:31 +0200
commit5e42c6232dab3a7bb96963aec5a9f90e169df20c (patch)
tree7712cde4dec9ad8782df956cf67c9bfc412c266b /lib/igt_kms.h
parent13ead623602b6f60033a2258d17f34094f1418be (diff)
lib/igt_kms: Rework plane properties to be more atomic, v5.
In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties. Changes since v1: - Remove special dumping of src and crtc coordinates. - Dump all modified coordinates. Changes since v2: - Move igt_plane_set_prop_changed up slightly. Changes since v3: - Fix wrong ordering of set_position in kms_plane_lowres causing a test failure. Changes since v4: - Back out resetting crtc position in igt_plane_set_fb() and document it during init. Tests appear to rely on it being preserved. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'lib/igt_kms.h')
-rw-r--r--lib/igt_kms.h59
1 files changed, 24 insertions, 35 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1ef10e7d..f87f8be3 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -252,6 +252,9 @@ enum igt_atomic_plane_properties {
IGT_PLANE_CRTC_W,
IGT_PLANE_CRTC_H,
+/* Append new properties after IGT_PLANE_COORD_CHANGED_MASK */
+#define IGT_PLANE_COORD_CHANGED_MASK 0xff
+
IGT_PLANE_FB_ID,
IGT_PLANE_CRTC_ID,
IGT_PLANE_IN_FENCE_FD,
@@ -286,37 +289,19 @@ typedef struct {
int index;
/* capabilities */
int type;
- /* state tracking */
- unsigned int fb_changed : 1;
- unsigned int position_changed : 1;
- unsigned int rotation_changed : 1;
- unsigned int size_changed : 1;
+
/*
* drm_plane can be NULL for primary and cursor planes (when not
* using the atomic modeset API)
*/
drmModePlane *drm_plane;
- struct igt_fb *fb;
-
- uint32_t rotation_property;
-
- /* position within pipe_src_w x pipe_src_h */
- int crtc_x, crtc_y;
- /* size within pipe_src_w x pipe_src_h */
- int crtc_w, crtc_h;
- /* position within the framebuffer */
- uint32_t src_x;
- uint32_t src_y;
- /* size within the framebuffer*/
- uint32_t src_w;
- uint32_t src_h;
+ /* gem handle for fb */
+ uint32_t gem_handle;
- igt_rotation_t rotation;
-
- /* in fence fd */
- int fence_fd;
- uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS];
+ uint64_t changed;
+ uint32_t props[IGT_NUM_PLANE_PROPS];
+ uint64_t values[IGT_NUM_PLANE_PROPS];
} igt_plane_t;
struct igt_pipe {
@@ -407,7 +392,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
{
- return plane->rotation_property != 0;
+ return plane->props[IGT_PLANE_ROTATION] != 0;
}
void igt_pipe_request_out_fence(igt_pipe_t *pipe);
void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
@@ -527,16 +512,20 @@ static inline bool igt_output_is_connected(igt_output_t *output)
#define IGT_FIXED(i,f) ((i) << 16 | (f))
-/**
- * igt_atomic_populate_plane_req:
- * @req: A pointer to drmModeAtomicReq
- * @plane: A pointer igt_plane_t
- * @prop: one of igt_atomic_plane_properties
- * @value: the value to add
- */
-#define igt_atomic_populate_plane_req(req, plane, prop, value) \
- igt_assert_lt(0, drmModeAtomicAddProperty(req, plane->drm_plane->plane_id,\
- plane->atomic_props_plane[prop], value))
+#define igt_plane_is_prop_changed(plane, prop) \
+ (!!((plane)->changed & (1 << (prop))))
+
+#define igt_plane_set_prop_changed(plane, prop) \
+ (plane)->changed |= 1 << (prop)
+
+#define igt_plane_clear_prop_changed(plane, prop) \
+ (plane)->changed &= ~(1 << (prop))
+
+#define igt_plane_set_prop_value(plane, prop, value) \
+ do { \
+ plane->values[prop] = value; \
+ igt_plane_set_prop_changed(plane, prop); \
+ } while (0)
/**
* igt_atomic_populate_crtc_req: