diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2014-08-06 12:14:56 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2014-08-07 15:42:22 -0300 |
commit | 4924b78368fa44f96fa61f6bcf402d4a55f8d4de (patch) | |
tree | 2c2cf6316734a889a69e6c8f1c90361698cd7ee1 /lib | |
parent | 053c10432254d2d58c33346f0ef08f024c3781ce (diff) |
igt_kms: document and export kmstest_get_property()
So we can use it on pm_rpm.c.
v2: Rename to kmstest_get_property (Daniel)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_kms.c | 28 | ||||
-rw-r--r-- | lib/igt_kms.h | 3 |
2 files changed, 25 insertions, 6 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 664b9e83..ecb4ec83 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -592,10 +592,26 @@ static void igt_output_refresh(igt_output_t *output) display->pipes_in_use |= 1 << output->config.pipe; } -static bool -get_property(int drm_fd, uint32_t object_id, uint32_t object_type, - const char *name, uint32_t *prop_id /* out */, - uint64_t *value /* out */, drmModePropertyPtr *prop /* out */) +/** + * kmstest_get_property: + * @drm_fd: drm file descriptor + * @object_id: object whose properties we're going to get + * @object_type: type of obj_id (DRM_MODE_OBJECT_*) + * @name: name of the property we're going to get + * @prop_id: if not NULL, returns the property id + * @value: if not NULL, returns the property value + * @prop: if not NULL, returns the property, and the caller will have to free + * it manually. + * + * Finds a property with the given name on the given object. + * + * Returns: true in case we found something. + */ +bool +kmstest_get_property(int drm_fd, uint32_t object_id, uint32_t object_type, + const char *name, uint32_t *prop_id /* out */, + uint64_t *value /* out */, + drmModePropertyPtr *prop /* out */) { drmModeObjectPropertiesPtr proplist; drmModePropertyPtr _prop; @@ -633,8 +649,8 @@ get_plane_property(int drm_fd, uint32_t plane_id, const char *name, uint32_t *prop_id /* out */, uint64_t *value /* out */, drmModePropertyPtr *prop /* out */) { - return get_property(drm_fd, plane_id, DRM_MODE_OBJECT_PLANE, - name, prop_id, value, prop); + return kmstest_get_property(drm_fd, plane_id, DRM_MODE_OBJECT_PLANE, + name, prop_id, value, prop); } static void diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 08b46ab8..5f9eedea 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -143,6 +143,9 @@ const char *kmstest_encoder_type_str(int type); const char *kmstest_connector_status_str(int type); const char *kmstest_connector_type_str(int type); void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode); +bool kmstest_get_property(int drm_fd, uint32_t object_id, uint32_t object_type, + const char *name, uint32_t *prop_id, uint64_t *value, + drmModePropertyPtr *prop); /* * A small modeset API |