]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/xe/fbdev: Limit the usage of stolen for LNL+
authorUma Shankar <uma.shankar@intel.com>
Wed, 17 Jul 2024 08:22:52 +0000 (13:52 +0530)
committerUma Shankar <uma.shankar@intel.com>
Thu, 18 Jul 2024 05:13:27 +0000 (10:43 +0530)
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
drivers/gpu/drm/xe/display/intel_fbdev_fb.c
drivers/gpu/drm/xe/display/xe_plane_initial.c
drivers/gpu/drm/xe/xe_wa_oob.rules

index 816ad13821a837f6ad8d86b1635b1de9ee536ca9..cd8948c08661b5cc037b2fce904f69e793eb30f2 100644 (file)
@@ -10,6 +10,9 @@
 #include "xe_bo.h"
 #include "xe_gt.h"
 #include "xe_ttm_stolen_mgr.h"
+#include "xe_wa.h"
+
+#include <generated/xe_wa_oob.h>
 
 struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
                                               struct drm_fb_helper_surface_size *sizes)
@@ -37,7 +40,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
        size = PAGE_ALIGN(size);
        obj = ERR_PTR(-ENODEV);
 
-       if (!IS_DGFX(xe)) {
+       if (!IS_DGFX(xe) && !XE_WA(xe_root_mmio_gt(xe), 22019338487_display)) {
                obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe),
                                           NULL, size,
                                           ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
@@ -48,6 +51,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
                else
                        drm_info(&xe->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj));
        }
+
        if (IS_ERR(obj)) {
                obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, size,
                                           ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
index e135b20962d9c90be958505a7791ccb35e5d1622..ace101efd7d0855beb33ac77639633518eb85fd6 100644 (file)
@@ -18,6 +18,9 @@
 #include "intel_frontbuffer.h"
 #include "intel_plane_initial.h"
 #include "xe_bo.h"
+#include "xe_wa.h"
+
+#include <generated/xe_wa_oob.h>
 
 static bool
 intel_reuse_initial_plane_obj(struct intel_crtc *this,
@@ -104,6 +107,9 @@ initial_plane_bo(struct xe_device *xe,
                phys_base = base;
                flags |= XE_BO_FLAG_STOLEN;
 
+               if (XE_WA(xe_root_mmio_gt(xe), 22019338487_display))
+                       return NULL;
+
                /*
                 * If the FB is too big, just don't use it since fbdev is not very
                 * important and we should probably use that space with FBC or other
index 08f7336881e32dfd083c328c879f3fbfc48be495..540d38603f32b3faf963f0733a25897a8b4b6502 100644 (file)
@@ -29,4 +29,5 @@
 13011645652    GRAPHICS_VERSION(2004)
 22019338487    MEDIA_VERSION(2000)
                GRAPHICS_VERSION(2001)
+22019338487_display    PLATFORM(LUNARLAKE)
 16023588340    GRAPHICS_VERSION(2001)