forked from radxa/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0271d39
commit 927f777
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters