Skip to contentSkip to conversation

libdrm: add patches for tiler rotation and cma/tiler memory option

PATCH New Denys Dmytriyenko 1 participant 1 message May 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libdrm: add patches for tiler rotation and cma/tiler memory option

These will be upstreamed, when corresponding kernel changes land in mainline.

---
 ...1-omap-fix-omap_bo_size-for-tiled-buffers.patch | 41 +++++++++++++++
 ...OMAP_BO-flags-to-affect-buffer-allocation.patch | 59 ++++++++++++++++++++++
 .../recipes-graphics/drm/libdrm_%.bbappend         |  8 ++-
 3 files changed, 106 insertions(+), 2 deletions(-)
 create mode 100644 meta-arago-distro/recipes-graphics/drm/libdrm/0001-omap-fix-omap_bo_size-for-tiled-buffers.patch
 create mode 100644 meta-arago-distro/recipes-graphics/drm/libdrm/0002-omap-add-OMAP_BO-flags-to-affect-buffer-allocation.patch
meta-arago-distro/recipes-graphics/drm/libdrm/0001-omap-fix-omap_bo_size-for-tiled-buffers.patch new file +41 -0
new file mode 100644
index 0000000..5234919
@@ -0,0 +1,41 @@
+From 6554635378ef4c6ee5f1bf8521b1cf4fe7911fa1 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <[email protected]>
+Date: Thu, 18 May 2017 12:18:28 +0300
+Subject: [PATCH 1/2] omap: fix omap_bo_size for tiled buffers
+
+The buffer size is calculated using pixels, not bytes as it should. The
+result is often correct, though, as the stride is aligned to page size,
+but there are still many cases where the size ends up being wrong.
+
+Fix this by not calculating the size at all, as in that case
+DRM_OMAP_GEM_INFO ioctl is used to get the correct size from the kernel.
+This is better in any case as then the userspace library doesn't need to
+know how the tiled buffers need to be aligned.
+
+Upstream-Status: Pending
+Signed-off-by: Tomi Valkeinen <[email protected]>
+---
+ omap/omap_drm.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/omap/omap_drm.c b/omap/omap_drm.c
+index 08ba64e..a6f8a21 100644
+--- a/omap/omap_drm.c
++++ b/omap/omap_drm.c
+@@ -215,11 +215,9 @@ static struct omap_bo * omap_bo_new_impl(struct omap_device *dev,
+ 	bo = bo_from_handle(dev, req.handle);
+ 	pthread_mutex_unlock(&table_lock);
+ 
+-	if (flags & OMAP_BO_TILED) {
+-		bo->size = round_up(size.tiled.width, PAGE_SIZE) * size.tiled.height;
+-	} else {
++	/* for tiled buffers we get the size with DRM_OMAP_GEM_INFO later */
++	if (!(flags & OMAP_BO_TILED))
+ 		bo->size = size.bytes;
+-	}
+ 
+ 	return bo;
+ 
+-- 
+2.7.4
+
meta-arago-distro/recipes-graphics/drm/libdrm/0002-omap-add-OMAP_BO-flags-to-affect-buffer-allocation.patch new file +59 -0

59 lines not on this page · raw message

meta-arago-distro/recipes-graphics/drm/libdrm_%.bbappend +6 -2
index 978231f..9945149 100644
@@ -1,8 +1,12 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-SRC_URI += "file://0001-Add-option-to-run-a-test-indefinitely.patch"
+SRC_URI += " \
+file://0001-Add-option-to-run-a-test-indefinitely.patch \
+file://0001-omap-fix-omap_bo_size-for-tiled-buffers.patch \
+file://0002-omap-add-OMAP_BO-flags-to-affect-buffer-allocation.patch \
+"
 
-PR_append = ".arago1"
+PR_append = ".arago2"
 
 inherit update-alternatives
 
Signature · 1 line
2.7.4