summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 07e5389)
raw | patch | inline | side by side (parent: 07e5389)
author | Subhajit Paul <subhajit_paul@ti.com> | |
Thu, 4 Jul 2019 10:49:04 +0000 (16:19 +0530) | ||
committer | Subhajit Paul <subhajit_paul@ti.com> | |
Thu, 4 Jul 2019 11:09:42 +0000 (16:39 +0530) |
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
drm_util.c | patch | blob | history |
diff --git a/drm_util.c b/drm_util.c
index f47e96205c5d1963d2b1a26fb8172336e9d7e133..34f3c0ca638ba1a45f3529efd54afb3b174fea00 100644 (file)
--- a/drm_util.c
+++ b/drm_util.c
return -1;
}
return -1;
}
+static int get_zorder(int fd, uint32_t plane_id)
+{
+ int i, r;
+ drmModeObjectPropertiesPtr props = NULL;
+
+ props = drmModeObjectGetProperties(fd, plane_id, DRM_MODE_OBJECT_PLANE);
+ if(!props) {
+ printf("drmModeObjectGetProperties for plane %u failed\n", plane_id);
+ return -1;
+ }
+
+ for(i = 0; i < props->count_props; i++) {
+ drmModePropertyPtr prop = drmModeGetProperty(fd, props->props[i]);
+ if(!prop) {
+ printf("getting prop = %u for plane %u failed\n", props->props[i], plane_id);
+ drmModeFreeObjectProperties(props);
+ return -1;
+ }
+ if(strcmp("zpos", prop->name) == 0) {
+ r = props->prop_values[i];
+ drmModeFreeProperty(prop);
+ drmModeFreeObjectProperties(props);
+ return r;
+ }
+ drmModeFreeProperty(prop);
+
+ }
+ printf("could not find property zpos for plane = %u\n", plane_id);
+ drmModeFreeObjectProperties(props);
+
+ return -1;
+}
+
static int add_property(int fd, drmModeAtomicReqPtr req, uint32_t id, uint32_t type, char *prop_name, uint64_t value)
{
int i, r;
static int add_property(int fd, drmModeAtomicReqPtr req, uint32_t id, uint32_t type, char *prop_name, uint64_t value)
{
int i, r;
if(occupied)
continue;
if(occupied)
continue;
- if(true /*zorder check here!!! but broken right now*/ )
+ if(get_zorder(drm.fd, plane->plane_id) == zorder)
break;
}
break;
}