aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Smith <raymond.smith@arm.com>2013-08-15 10:24:44 +0100
committerRay Smith <raymond.smith@arm.com>2013-08-15 10:24:44 +0100
commitd53e94e67ccd3387355d7655b29fbded42feee6f (patch)
treef7f394959b10d9d748f9715326aae9a646f640f4
parente762b12a21d46f45937aa2140c26293a286e5ee9 (diff)
downloadxf86-video-armsoc-d53e94e67ccd3387355d7655b29fbded42feee6f.tar.gz
Use plane property for setting Exynos zpos
On older kernel versions there was an Exynos-specific ioctl to set the plane Z position. More recent kernels have replaced this with a property on the plane objects. This patch attempts to use the property first, and falls back to the old method if that fails. Change-Id: I9b22c1b0eb128cee2f0e7c5907012a49592787e1
-rw-r--r--src/drmmode_exynos/drmmode_exynos.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/src/drmmode_exynos/drmmode_exynos.c b/src/drmmode_exynos/drmmode_exynos.c
index a5a98d2..0c2a895 100644
--- a/src/drmmode_exynos/drmmode_exynos.c
+++ b/src/drmmode_exynos/drmmode_exynos.c
@@ -48,12 +48,45 @@ struct drm_exynos_plane_set_zpos {
static int init_plane_for_cursor(int drm_fd, uint32_t plane_id)
{
- struct drm_exynos_plane_set_zpos data;
+ int res = -1;
+ drmModeObjectPropertiesPtr props;
+ props = drmModeObjectGetProperties(drm_fd, plane_id,
+ DRM_MODE_OBJECT_PLANE);
- data.plane_id = plane_id;
- data.zpos = 1;
+ if (props) {
+ int i;
- return ioctl(drm_fd, DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS, &data);
+ for (i = 0; i < props->count_props; i++) {
+ drmModePropertyPtr this_prop;
+ this_prop = drmModeGetProperty(drm_fd, props->props[i]);
+
+ if (this_prop) {
+ if (!strncmp(this_prop->name, "zpos",
+ DRM_PROP_NAME_LEN)) {
+ res = drmModeObjectSetProperty(drm_fd,
+ plane_id,
+ DRM_MODE_OBJECT_PLANE,
+ this_prop->prop_id,
+ 1);
+ drmModeFreeProperty(this_prop);
+ break;
+ }
+ drmModeFreeProperty(this_prop);
+ }
+ }
+ drmModeFreeObjectProperties(props);
+ }
+
+ if (res) {
+ /* Try the old method */
+ struct drm_exynos_plane_set_zpos data;
+ data.plane_id = plane_id;
+ data.zpos = 1;
+
+ res = ioctl(drm_fd, DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS, &data);
+ }
+
+ return res;
}
/* The cursor format is ARGB so the image can be copied straight over.