From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Jani Nikula" <jani.nikula@intel.com>
Subject: [PATCH] drm/xe/display: fix ttm_bo_access() usage
Date: Mon, 2 Dec 2024 15:41:24 +0000 [thread overview]
Message-ID: <20241202154123.76887-2-matthew.auld@intel.com> (raw)
ttm_bo_access() returns the size on success. Account for that otherwise
the caller incorrectly thinks this is an error in
intel_atomic_prepare_plane_clear_colors().
Fixes: b6308aaa24a7 ("drm/xe/display: Update intel_bo_read_from_page to use ttm_bo_access")
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3661
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/xe/display/intel_bo.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/display/intel_bo.c b/drivers/gpu/drm/xe/display/intel_bo.c
index 43141964f6f2..b2a8d06cc78a 100644
--- a/drivers/gpu/drm/xe/display/intel_bo.c
+++ b/drivers/gpu/drm/xe/display/intel_bo.c
@@ -40,8 +40,13 @@ int intel_bo_fb_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
int intel_bo_read_from_page(struct drm_gem_object *obj, u64 offset, void *dst, int size)
{
struct xe_bo *bo = gem_to_xe_bo(obj);
+ int ret;
- return ttm_bo_access(&bo->ttm, offset, dst, size, 0);
+ ret = ttm_bo_access(&bo->ttm, offset, dst, size, 0);
+ if (ret == size)
+ ret = 0;
+
+ return ret;
}
struct intel_frontbuffer *intel_bo_get_frontbuffer(struct drm_gem_object *obj)
--
2.47.0
next reply other threads:[~2024-12-02 15:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 15:41 Matthew Auld [this message]
2024-12-02 15:47 ` ✓ CI.Patch_applied: success for drm/xe/display: fix ttm_bo_access() usage Patchwork
2024-12-02 15:47 ` ✓ CI.checkpatch: " Patchwork
2024-12-02 15:48 ` ✓ CI.KUnit: " Patchwork
2024-12-02 15:56 ` [PATCH] " Thomas Hellström
2024-12-02 16:28 ` Matthew Auld
2024-12-02 16:33 ` Thomas Hellström
2024-12-02 16:38 ` Matthew Auld
2024-12-02 16:14 ` ✓ CI.Build: success for " Patchwork
2024-12-02 16:18 ` ✓ CI.Hooks: " Patchwork
2024-12-02 16:20 ` ✓ CI.checksparse: " Patchwork
2024-12-02 16:41 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-02 17:47 ` ✗ Xe.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241202154123.76887-2-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=matthew.brost@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox