summaryrefslogtreecommitdiff
path: root/lib/igt_kms.h
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-10-04 16:29:51 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-10-20 11:43:48 +0200
commit2f7519a8f09315abc3db42e7dfe90821058a3583 (patch)
tree1ec3c851b032ccfdfd74ae835c0e4647e5f224a3 /lib/igt_kms.h
parentd04d63287056646eb5dbb5c60dc7cd7c64a38df7 (diff)
lib/igt_kms: Add igt_$obj_has_prop functions, v2.
This allows test to test whether a property is supported, in a nice and clean way. It removes the need for special case functions like igt_plane_supports_rotation. Convert the users of igt_plane_supports_rotation and remove the extra check in drm_plane_commit, this is already checked below when setting plane properties. Changes since v1: - Use the correct has_prop in kms_crtc_background_color.c 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.h62
1 files changed, 58 insertions, 4 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index b8a04af7..916cd359 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -374,10 +374,6 @@ bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
uint32_t *prop_id, uint64_t *value,
drmModePropertyPtr *prop);
-static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
-{
- return plane->props[IGT_PLANE_ROTATION] != 0;
-}
void igt_pipe_request_out_fence(igt_pipe_t *pipe);
void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
@@ -493,6 +489,20 @@ static inline bool igt_output_is_connected(igt_output_t *output)
#define IGT_FIXED(i,f) ((i) << 16 | (f))
+/**
+ * igt_plane_has_prop - Check whether plane supports a given property.
+ *
+ * @plane: Plane to check.
+ * @prop: Property to check.
+ *
+ * Returns: True if the property is supported, otherwise false.
+ */
+static inline bool
+igt_plane_has_prop(igt_plane_t *plane, enum igt_atomic_plane_properties prop)
+{
+ return plane->props[prop];
+}
+
#define igt_plane_is_prop_changed(plane, prop) \
(!!((plane)->changed & (1 << (prop))))
@@ -512,6 +522,20 @@ extern void igt_plane_replace_prop_blob(igt_plane_t *plane,
enum igt_atomic_plane_properties prop,
const void *ptr, size_t length);
+/**
+ * igt_output_has_prop - Check whether output supports a given property.
+ *
+ * @output: Output to check.
+ * @prop: Property to check.
+ *
+ * Returns: True if the property is supported, otherwise false.
+ */
+static inline bool
+igt_output_has_prop(igt_output_t *output, enum igt_atomic_connector_properties prop)
+{
+ return output->props[prop];
+}
+
#define igt_output_is_prop_changed(output, prop) \
(!!((output)->changed & (1 << (prop))))
#define igt_output_set_prop_changed(output, prop) \
@@ -530,6 +554,36 @@ extern void igt_output_replace_prop_blob(igt_output_t *output,
enum igt_atomic_connector_properties prop,
const void *ptr, size_t length);
+/**
+ * igt_pipe_obj_has_prop - Check whether pipe supports a given property.
+ *
+ * @pipe: Pipe to check.
+ * @prop: Property to check.
+ *
+ * Returns: True if the property is supported, otherwise false.
+ */
+static inline bool
+igt_pipe_obj_has_prop(igt_pipe_t *pipe, enum igt_atomic_crtc_properties prop)
+{
+ return pipe->props[prop];
+}
+
+/**
+ * igt_pipe_has_prop - Check whether pipe supports a given property.
+ *
+ * @display: Pointer to display.
+ * @pipe: Pipe to check.
+ * @prop: Property to check.
+ *
+ * Returns: True if the property is supported, otherwise false.
+ */
+static inline bool
+igt_pipe_has_prop(igt_display_t *display, enum pipe pipe,
+ enum igt_atomic_connector_properties prop)
+{
+ return display->pipes[pipe].props[prop];
+}
+
#define igt_pipe_obj_is_prop_changed(pipe_obj, prop) \
(!!((pipe_obj)->changed & (1 << (prop))))