Skip to content

Commit

Permalink
drm hack2
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Aug 26, 2024
1 parent 0271d39 commit 927f777
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions scripts/patches/drm_record_hack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From cf6c7d289b053c89ad27a67a88351a063c0c82ae Mon Sep 17 00:00:00 2001
From: Taichun Yuan <[email protected]>
Date: Wed, 17 Aug 2022 11:31:01 +0800
Subject: [PATCH] drm: enable mapping of internal object for debugging

This is for debug tool which would like to map imported internal object
, such as BO, to userspace. Buffer capture tool is an example.
For debug only
---
drivers/gpu/drm/drm_gem.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 09c820045..f934c40a9 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -317,11 +317,15 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
if (!obj)
return -ENOENT;

- /* Don't allow imported objects to be mapped */
+ /*
+ * Enable mapping for imported objects, for debug only
+ */
+ /*
if (obj->import_attach) {
ret = -EINVAL;
goto out;
}
+ */

ret = drm_gem_create_mmap_offset(obj);
if (ret)
--
2.17.1

3 changes: 2 additions & 1 deletion scripts/patches/openhd_utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ diff --git a/lib/utils.sh b/lib/utils.sh
index bdb1bcd..2b5dd86 100644
--- a/lib/utils.sh
+++ b/lib/utils.sh
@@ -199,6 +199,41 @@ prepare_source() {
@@ -199,6 +199,42 @@ prepare_source() {
git reset --hard FETCH_HEAD
git clean -ffd
git switch --detach $origin/$BSP_BRANCH
Expand Down Expand Up @@ -37,6 +37,7 @@ index bdb1bcd..2b5dd86 100644
+ cd rtl8852bu
+ sed -i 's/aarch64\.l/arm64/' Makefile
+ cd ../../../../
+ patch -p1 -i drm_record_hack.patch
+ patch -p1 -i scripts/patches/openhd_drm.patch
+ patch -p1 -i scripts/patches/openhd_wifi.patch
+ patch -p1 -i scripts/patches/openhd_usb.patch
Expand Down

0 comments on commit 927f777

Please sign in to comment.