aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Barnish <dave.barnish@arm.com>2013-11-14 15:01:23 +0000
committerDave Barnish <dave.barnish@arm.com>2013-11-14 15:01:23 +0000
commit3be1f6273441fe95dd442f44064387322e16b7e9 (patch)
treeee21d813b375d826947a40582fa4e220dc148358
parent43483233cbcf48198cbcecf6a84d80fd76e143b1 (diff)
downloadxf86-video-armsoc-3be1f6273441fe95dd442f44064387322e16b7e9.tar.gz
For Exynos, always request non-contiguous buffers.
Contiguous buffers are not supported in some drm versions. Where they are, all buffers are contiguous anyway. Also stopped using the exynos_drm.h kernel header Change-Id: Id6920c0315e5c4b8c8fd1e3ce97d670fe283c5d5
-rw-r--r--src/drmmode_exynos/drmmode_exynos.c31
-rw-r--r--src/drmmode_pl111/drmmode_pl111.c2
2 files changed, 21 insertions, 12 deletions
diff --git a/src/drmmode_exynos/drmmode_exynos.c b/src/drmmode_exynos/drmmode_exynos.c
index 8d4eb02..91723df 100644
--- a/src/drmmode_exynos/drmmode_exynos.c
+++ b/src/drmmode_exynos/drmmode_exynos.c
@@ -27,10 +27,10 @@
#include <xf86drmMode.h>
#include <xf86drm.h>
#include <sys/ioctl.h>
-#include <drm/exynos_drm.h>
-#ifndef DRM_EXYNOS_PLANE_SET_ZPOS
-/* DRM_EXYNOS_PLANE_SET_ZPOS is not defined in kernel version > 3.5 */
+/* Following ioctls should be included from libdrm exynos_drm.h but
+ * libdrm doesn't install this correctly so for now they are here.
+ */
struct drm_exynos_plane_set_zpos {
__u32 plane_id;
__s32 zpos;
@@ -38,12 +38,19 @@ struct drm_exynos_plane_set_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)
-#endif
-#ifndef EXYNOS_BO_CONTIG
-/* EXYNOS_BO_CONTIG is not defined in kernel version < 3.5 */
#define EXYNOS_BO_CONTIG 0
-#endif
+#define EXYNOS_BO_NONCONTIG 1
+
+struct drm_exynos_gem_create {
+ uint64_t size;
+ unsigned int flags;
+ unsigned int handle;
+};
+
+#define DRM_EXYNOS_GEM_CREATE 0x00
+#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
/* Cursor dimensions
* Technically we probably don't have any size limit.. since we
@@ -118,10 +125,12 @@ static int create_custom_gem(int fd, struct armsoc_create_gem *create_gem)
assert((create_gem->buf_type == ARMSOC_BO_SCANOUT) ||
(create_gem->buf_type == ARMSOC_BO_NON_SCANOUT));
- if (create_gem->buf_type == ARMSOC_BO_SCANOUT)
- create_exynos.flags = EXYNOS_BO_CONTIG;
- else
- create_exynos.flags = EXYNOS_BO_NONCONTIG;
+
+ /* Contiguous allocations are not supported in some exynos drm versions.
+ * When they are supported all allocations are effectively contiguous
+ * anyway, so for simplicity we always request non contiguous buffers.
+ */
+ create_exynos.flags = EXYNOS_BO_NONCONTIG;
ret = drmIoctl(fd, DRM_IOCTL_EXYNOS_GEM_CREATE, &create_exynos);
if (ret)
diff --git a/src/drmmode_pl111/drmmode_pl111.c b/src/drmmode_pl111/drmmode_pl111.c
index b302432..2f7f064 100644
--- a/src/drmmode_pl111/drmmode_pl111.c
+++ b/src/drmmode_pl111/drmmode_pl111.c
@@ -55,7 +55,7 @@
#define PL111_BOT_CACHED (0x2 << 1)
/* TODO MIDEGL-1718: this should be included
- * from kernel headers when pl111 is mainline */
+ * from libdrm headers when pl111 is mainline */
struct drm_pl111_gem_create {
uint32_t height;
uint32_t width;