From 927f777e6ac6d383bbf3c45ac49ec6055816111c Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:56:15 +0200 Subject: [PATCH] drm hack2 --- scripts/patches/drm_record_hack.patch | 36 +++++++++++++++++++++++++++ scripts/patches/openhd_utils.patch | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 scripts/patches/drm_record_hack.patch diff --git a/scripts/patches/drm_record_hack.patch b/scripts/patches/drm_record_hack.patch new file mode 100644 index 0000000000000..bcc7f91f043af --- /dev/null +++ b/scripts/patches/drm_record_hack.patch @@ -0,0 +1,36 @@ +From cf6c7d289b053c89ad27a67a88351a063c0c82ae Mon Sep 17 00:00:00 2001 +From: Taichun Yuan +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 + diff --git a/scripts/patches/openhd_utils.patch b/scripts/patches/openhd_utils.patch index c0d83eaf693ab..aa9aee93fa5fc 100644 --- a/scripts/patches/openhd_utils.patch +++ b/scripts/patches/openhd_utils.patch @@ -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 @@ -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