Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/display: fix ttm_bo_access() usage
@ 2024-12-02 15:41 Matthew Auld
  2024-12-02 15:47 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Matthew Auld @ 2024-12-02 15:41 UTC (permalink / raw)
  To: intel-xe; +Cc: Thomas Hellström, Matthew Brost, Jani Nikula

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-12-02 17:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 15:41 [PATCH] drm/xe/display: fix ttm_bo_access() usage Matthew Auld
2024-12-02 15:47 ` ✓ CI.Patch_applied: success for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox