igt_kms: Provide a get_plane_property() shorthand

So one doesn't have to write the plane type all the time.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
Damien Lespiau 2014-07-08 14:56:54 +01:00
parent 33842d5940
commit 143c3a7575

View File

@ -633,6 +633,14 @@ out:
return found; return found;
} }
static bool
get_plane_property(igt_display_t *display, uint32_t plane_id, const char *name,
uint32_t *prop_id /* out */, uint64_t *value /* out */)
{
return get_property(display, plane_id, DRM_MODE_OBJECT_PLANE,
name, prop_id, value);
}
/* /*
* Walk a plane's property list to determine its type. If we don't * Walk a plane's property list to determine its type. If we don't
* find a type property, then the kernel doesn't support universal * find a type property, then the kernel doesn't support universal
@ -643,8 +651,8 @@ static int get_drm_plane_type(igt_display_t *display, uint32_t plane_id)
uint64_t value; uint64_t value;
bool has_prop; bool has_prop;
has_prop = get_property(display, plane_id, DRM_MODE_OBJECT_PLANE, has_prop = get_plane_property(display, plane_id, "type",
"type", NULL /* prop_id */, &value); NULL /* prop_id */, &value);
if (has_prop) if (has_prop)
return (int)value; return (int)value;