Skip to content

Commit 71d1226

Browse files
icklerodrigovivi
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]> (cherry picked from commit 9faf5fa) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent d43e245 commit 71d1226

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
@@ -235,6 +235,11 @@ static int intelfb_create(struct drm_fb_helper *helper,
235235
info->apertures->ranges[0].base = ggtt->gmadr.start;
236236
info->apertures->ranges[0].size = ggtt->mappable_end;
237237

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

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

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

0 commit comments

Comments
 (0)