aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@arm.com>2013-10-03 15:42:33 +0100
committerJavier Martin <javier.martin@arm.com>2013-10-10 08:56:49 +0100
commit45b8cd24c36a52176e3fcf24cca26fb6c9a7f652 (patch)
tree38cc1a5db050a6e901f601cbb5a099ba1ed11f81
parent70df8aef0672a5148e93ae81f7c542c3615f4bbe (diff)
downloadxf86-video-armsoc-45b8cd24c36a52176e3fcf24cca26fb6c9a7f652.tar.gz
Change custom GEM creation flags for pl111.
GEM flags in the pl111 DRM driver have been changed so that we can specify the backing storage (SHM/DMA) and the kind of user space mapping (non cached, cached, writecombine). Support for cached mappings for SHM objects is not stable yet, so keep on using non cached mappings for now. Change-Id: I0085d01a37f142d8ad196ecb0d1624ff4f15a1ef
-rw-r--r--src/drmmode_pl111/drmmode_pl111.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/drmmode_pl111/drmmode_pl111.c b/src/drmmode_pl111/drmmode_pl111.c
index 3b9f92f..b302432 100644
--- a/src/drmmode_pl111/drmmode_pl111.c
+++ b/src/drmmode_pl111/drmmode_pl111.c
@@ -37,8 +37,22 @@
/* Padding added down each side of cursor image */
#define CURSORPAD (0)
-#define PL111_SCANOUT_FLAGS 0x00000001
-#define PL111_NON_SCANOUT_FLAGS 0x00000000
+/*
+ * Parameters for different buffer objects:
+ * bit [0]: backing storage
+ * (0 -> DMA)
+ * (1 -> SHM)
+ * bit [2:1]: kind of mapping
+ * (0x0 -> uncached)
+ * (0x1 -> write combine)
+ * (0x2 -> cached)
+ */
+#define PL111_BOT_MASK (0x7)
+#define PL111_BOT_SHM (0x0 << 0)
+#define PL111_BOT_DMA (0x1 << 0)
+#define PL111_BOT_UNCACHED (0x0 << 1)
+#define PL111_BOT_WC (0x1 << 1)
+#define PL111_BOT_CACHED (0x2 << 1)
/* TODO MIDEGL-1718: this should be included
* from kernel headers when pl111 is mainline */
@@ -70,10 +84,11 @@ 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_pl111.flags = PL111_SCANOUT_FLAGS;
+ create_pl111.flags = PL111_BOT_DMA | PL111_BOT_UNCACHED;
else
- create_pl111.flags = PL111_NON_SCANOUT_FLAGS;
+ create_pl111.flags = PL111_BOT_SHM | PL111_BOT_UNCACHED;
ret = drmIoctl(fd, DRM_IOCTL_PL111_GEM_CREATE, &create_pl111);
if (ret)