diff options
author | Ray Smith <raymond.smith@arm.com> | 2013-04-03 10:06:18 +0100 |
---|---|---|
committer | Ray Smith <raymond.smith@arm.com> | 2013-04-03 10:06:18 +0100 |
commit | b93cd89d99e0952add6f1e539b09138407807c8e (patch) | |
tree | d39088ee9ada43e175728f3a5b52aad49eabf603 /src/drmmode_exynos/drmmode_exynos.c | |
parent | 3c33c3d13f4cf05e9c48c52e8c3cde8eb2d8c65d (diff) |
Abstract cursor plane initialization
To allow driver-specific plane z-ordering, at least.
This provides the same functionality as:
https://gerrit.chromium.org/gerrit/#/c/25276/
Change-Id: I89ccd656028c490f64138c5fc1741996e73e3987
Diffstat (limited to 'src/drmmode_exynos/drmmode_exynos.c')
-rw-r--r-- | src/drmmode_exynos/drmmode_exynos.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/drmmode_exynos/drmmode_exynos.c b/src/drmmode_exynos/drmmode_exynos.c index 1bd174e..a8bd908 100644 --- a/src/drmmode_exynos/drmmode_exynos.c +++ b/src/drmmode_exynos/drmmode_exynos.c @@ -23,11 +23,33 @@ */ #include "../drmmode_driver.h" +#include <xf86drmMode.h> +#include <sys/ioctl.h> + +struct drm_exynos_plane_set_zpos { + __u32 plane_id; + __s32 zpos; +}; + +#define DRM_EXYNOS_PLANE_SET_ZPOS 0x06 +#define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ + DRM_EXYNOS_PLANE_SET_ZPOS, 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; + + data.plane_id = plane_id; + data.zpos = 1; + + return ioctl(drm_fd, DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS, &data); +} struct drmmode_interface exynos_interface = { 0x00000001 /* dumb_scanout_flags */, 0x00000001 /* dumb_no_scanout_flags */, - 1 /* use_page_flip_events */ + 1 /* use_page_flip_events */, + init_plane_for_cursor /* init_plane_for_cursor */ }; struct drmmode_interface *drmmode_interface_get_implementation(int drm_fd) |