Skip to content

Commit 9faf5fa

Browse files
icklejlahtine-intel
authored andcommitted
drm/i915/fbdev: Restore physical addresses for fb_mmap()
fbdev uses the physical address of our framebuffer for its fb_mmap() routine. While we need to adapt this address for the new io BAR, we have to fix v5.4 first! The simplest fix is to restore the smem back to v5.3 and we will then probably have to implement our fbops->fb_mmap() callback to handle local memory. Reported-by: Neil MacLeod <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112256 Fixes: 5f889b9 ("drm/i915: Disregard drm_mode_config.fb_base") Signed-off-by: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Maarten Lankhorst <[email protected]> Tested-by: Neil MacLeod <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit abc5520) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 7e89d50 commit 9faf5fa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/i915/display/intel_fbdev.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ static int intelfb_create(struct drm_fb_helper *helper,
234234
info->apertures->ranges[0].base = ggtt->gmadr.start;
235235
info->apertures->ranges[0].size = ggtt->mappable_end;
236236

237+
/* Our framebuffer is the entirety of fbdev's system memory */
238+
info->fix.smem_start =
239+
(unsigned long)(ggtt->gmadr.start + vma->node.start);
240+
info->fix.smem_len = vma->node.size;
241+
237242
vaddr = i915_vma_pin_iomap(vma);
238243
if (IS_ERR(vaddr)) {
239244
DRM_ERROR("Failed to remap framebuffer into virtual memory\n");
@@ -243,10 +248,6 @@ static int intelfb_create(struct drm_fb_helper *helper,
243248
info->screen_base = vaddr;
244249
info->screen_size = vma->node.size;
245250

246-
/* Our framebuffer is the entirety of fbdev's system memory */
247-
info->fix.smem_start = (unsigned long)info->screen_base;
248-
info->fix.smem_len = info->screen_size;
249-
250251
drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
251252

252253
/* If the object is shmemfs backed, it will have given us zeroed pages.

0 commit comments

Comments
 (0)