Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [CI 1/2] drm/i915/fbdev: fixup setting screen_size
@ 2022-03-04  9:59 Matthew Auld
  2022-03-04  9:59 ` [Intel-gfx] [CI 2/2] drm/i915: limit the async bind to bind_async_flags Matthew Auld
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Matthew Auld @ 2022-03-04  9:59 UTC (permalink / raw)
  To: intel-gfx

Since we are actually mapping the object and not the vma, when dealing
with LMEM, we should be careful and use the backing store size here,
since the vma->node.size could have all kinds of funny padding
constraints, which could result in us writing to OOB address.

v2(Chris):
  - Prefer vma->size here, which should be the backing store size. Some
    more rework is needed here to stop using node.size in some other
    places.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 2cd62a187df3..221336178991 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -279,7 +279,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		/* Our framebuffer is the entirety of fbdev's system memory */
 		info->fix.smem_start =
 			(unsigned long)(ggtt->gmadr.start + vma->node.start);
-		info->fix.smem_len = vma->node.size;
+		info->fix.smem_len = vma->size;
 	}
 
 	vaddr = i915_vma_pin_iomap(vma);
@@ -290,7 +290,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		goto out_unpin;
 	}
 	info->screen_base = vaddr;
-	info->screen_size = vma->node.size;
+	info->screen_size = vma->size;
 
 	drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Intel-gfx] [CI 1/2] drm/i915/fbdev: fixup setting screen_size
@ 2022-03-03 20:45 Matthew Auld
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Auld @ 2022-03-03 20:45 UTC (permalink / raw)
  To: intel-gfx

Since we are actually mapping the object and not the vma, when dealing
with LMEM, we should be careful and use the obj->base.size here, since
the vma could have all kinds of funny padding constraints.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 2cd62a187df3..3167ae334684 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -290,7 +290,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		goto out_unpin;
 	}
 	info->screen_base = vaddr;
-	info->screen_size = vma->node.size;
+	if (i915_gem_object_is_lmem(obj))
+		info->screen_size = vma->obj->base.size;
+	else
+		info->screen_size = vma->node.size;
 
 	drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
 
-- 
2.34.1


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

end of thread, other threads:[~2022-03-04 23:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-04  9:59 [Intel-gfx] [CI 1/2] drm/i915/fbdev: fixup setting screen_size Matthew Auld
2022-03-04  9:59 ` [Intel-gfx] [CI 2/2] drm/i915: limit the async bind to bind_async_flags Matthew Auld
2022-03-04 16:41   ` Thomas Hellström
2022-03-04 17:28     ` Matthew Auld
2022-03-04 12:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [CI,1/2] drm/i915/fbdev: fixup setting screen_size Patchwork
2022-03-04 17:22 ` [Intel-gfx] [CI 1/2] " Thomas Hellström (Intel)
2022-03-04 23:32 ` [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [CI,1/2] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-03-03 20:45 [Intel-gfx] [CI 1/2] " Matthew Auld

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