Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/fbdev: Limit the usage of stolen for LNL+

As per recommendation in the workarounds:
WA_22019338487

There is an issue with accessing Stolen memory pages due a
hardware limitation. Limit the usage of stolen memory for
fbdev for LNL+. Don't use BIOS FB from stolen on LNL+ and
assign the same from system memory.

v2: Corrected the WA Number, limited WA to LNL and
Adopted XE_WA framework as suggested by Lucas and Matt.

v3: Introduced the waxxx_display to implement display side
of WA changes on Lunarlake. Used xe_root_mmio_gt and
avoid the for loop (Suggested by Lucas)

v4: Fixed some nits (Luca)

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240717082252.3875909-1-uma.shankar@intel.com

+12 -1
+5 -1
drivers/gpu/drm/xe/display/intel_fbdev_fb.c
··· 10 10 #include "xe_bo.h" 11 11 #include "xe_gt.h" 12 12 #include "xe_ttm_stolen_mgr.h" 13 + #include "xe_wa.h" 14 + 15 + #include <generated/xe_wa_oob.h> 13 16 14 17 struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, 15 18 struct drm_fb_helper_surface_size *sizes) ··· 40 37 size = PAGE_ALIGN(size); 41 38 obj = ERR_PTR(-ENODEV); 42 39 43 - if (!IS_DGFX(xe)) { 40 + if (!IS_DGFX(xe) && !XE_WA(xe_root_mmio_gt(xe), 22019338487_display)) { 44 41 obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), 45 42 NULL, size, 46 43 ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT | ··· 51 48 else 52 49 drm_info(&xe->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj)); 53 50 } 51 + 54 52 if (IS_ERR(obj)) { 55 53 obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, size, 56 54 ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
+6
drivers/gpu/drm/xe/display/xe_plane_initial.c
··· 18 18 #include "intel_frontbuffer.h" 19 19 #include "intel_plane_initial.h" 20 20 #include "xe_bo.h" 21 + #include "xe_wa.h" 22 + 23 + #include <generated/xe_wa_oob.h> 21 24 22 25 static bool 23 26 intel_reuse_initial_plane_obj(struct intel_crtc *this, ··· 106 103 return NULL; 107 104 phys_base = base; 108 105 flags |= XE_BO_FLAG_STOLEN; 106 + 107 + if (XE_WA(xe_root_mmio_gt(xe), 22019338487_display)) 108 + return NULL; 109 109 110 110 /* 111 111 * If the FB is too big, just don't use it since fbdev is not very
+1
drivers/gpu/drm/xe/xe_wa_oob.rules
··· 29 29 13011645652 GRAPHICS_VERSION(2004) 30 30 22019338487 MEDIA_VERSION(2000) 31 31 GRAPHICS_VERSION(2001) 32 + 22019338487_display PLATFORM(LUNARLAKE) 32 33 16023588340 GRAPHICS_VERSION(2001)