diff mbox series

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

Message ID 20240715190043.3775819-1-uma.shankar@intel.com (mailing list archive)
State New, archived
Headers show
Series [v3] drm/xe/fbdev: Limit the usage of stolen for LNL+ | expand

Commit Message

Shankar, Uma July 15, 2024, 7 p.m. UTC
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 avoid tipping on other WA.
    Used xe_root_mmio_gt and avoid the for loop.
    (Suggested by Lucas)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/xe/display/intel_fbdev_fb.c   | 10 +++++++++-
 drivers/gpu/drm/xe/display/xe_plane_initial.c |  6 ++++++
 drivers/gpu/drm/xe/xe_wa_oob.rules            |  1 +
 3 files changed, 16 insertions(+), 1 deletion(-)

Comments

Lucas De Marchi July 16, 2024, 3:48 p.m. UTC | #1
On Tue, Jul 16, 2024 at 12:30:43AM GMT, Uma Shankar wrote:
>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 avoid tipping on other WA.

it's actually the same WA, just a different part of it

a few nits below, otherwise this is

// Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

>    Used xe_root_mmio_gt and avoid the for loop.
>    (Suggested by Lucas)
>
>Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>---
> drivers/gpu/drm/xe/display/intel_fbdev_fb.c   | 10 +++++++++-
> drivers/gpu/drm/xe/display/xe_plane_initial.c |  6 ++++++
> drivers/gpu/drm/xe/xe_wa_oob.rules            |  1 +
> 3 files changed, 16 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
>index 816ad13821a8..0f02e6222ada 100644
>--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
>+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
>@@ -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)
>@@ -20,6 +23,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> 	struct drm_mode_fb_cmd2 mode_cmd = {};
> 	struct drm_i915_gem_object *obj;
> 	int size;
>+	bool wa_22019338487 = false;

no need for the bool, just use XE_WA() in the one place needed.

>
> 	/* we don't do packed 24bpp */
> 	if (sizes->surface_bpp == 24)
>@@ -37,7 +41,10 @@ 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 (XE_WA(xe_root_mmio_gt(xe), 22019338487_display))
>+		wa_22019338487 = true;
>+
>+	if (!IS_DGFX(xe) && !wa_22019338487) {
> 		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 +55,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 |
>diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c
>index 5eccd6abb3ef..a50ab9eae40a 100644
>--- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
>+++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
>@@ -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
>diff --git a/drivers/gpu/drm/xe/xe_wa_oob.rules b/drivers/gpu/drm/xe/xe_wa_oob.rules
>index 08f7336881e3..6ec23c4b972e 100644
>--- a/drivers/gpu/drm/xe/xe_wa_oob.rules
>+++ b/drivers/gpu/drm/xe/xe_wa_oob.rules
>@@ -30,3 +30,4 @@
> 22019338487	MEDIA_VERSION(2000)
> 		GRAPHICS_VERSION(2001)

better to put the line here as it's actually the same WA, just a
different part of it. It's easier if we group them close together.

Daniele, can you check the gsc patch now works with this addition to the
WA?

thanks
Lucas De Marchi

> 16023588340	GRAPHICS_VERSION(2001)
>+22019338487_display	PLATFORM(LUNARLAKE)
>-- 
>2.42.0
>
Shankar, Uma July 17, 2024, 8:12 a.m. UTC | #2
> -----Original Message-----
> From: De Marchi, Lucas <lucas.demarchi@intel.com>
> Sent: Tuesday, July 16, 2024 9:19 PM
> To: Shankar, Uma <uma.shankar@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org;
> ville.syrjala@linux.intel.com; Ceraolo Spurio, Daniele
> <daniele.ceraolospurio@intel.com>; Belgaumkar, Vinay
> <vinay.belgaumkar@intel.com>; Roper, Matthew D
> <matthew.d.roper@intel.com>
> Subject: Re: [v3] drm/xe/fbdev: Limit the usage of stolen for LNL+
> 
> On Tue, Jul 16, 2024 at 12:30:43AM GMT, Uma Shankar wrote:
> >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 avoid tipping on other WA.
> 
> it's actually the same WA, just a different part of it
> 
> a few nits below, otherwise this is

> // Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Thanks Lucas for the review. Will address the nits and float a next version.

Regards,
Uma Shankar

> >    Used xe_root_mmio_gt and avoid the for loop.
> >    (Suggested by Lucas)
> >
> >Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> >---
> > drivers/gpu/drm/xe/display/intel_fbdev_fb.c   | 10 +++++++++-
> > drivers/gpu/drm/xe/display/xe_plane_initial.c |  6 ++++++
> > drivers/gpu/drm/xe/xe_wa_oob.rules            |  1 +
> > 3 files changed, 16 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> >b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> >index 816ad13821a8..0f02e6222ada 100644
> >--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> >+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> >@@ -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) @@ -20,6 +23,7
> >@@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper
> *helper,
> > 	struct drm_mode_fb_cmd2 mode_cmd = {};
> > 	struct drm_i915_gem_object *obj;
> > 	int size;
> >+	bool wa_22019338487 = false;
> 
> no need for the bool, just use XE_WA() in the one place needed.
> 
> >
> > 	/* we don't do packed 24bpp */
> > 	if (sizes->surface_bpp == 24)
> >@@ -37,7 +41,10 @@ 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 (XE_WA(xe_root_mmio_gt(xe), 22019338487_display))
> >+		wa_22019338487 = true;
> >+
> >+	if (!IS_DGFX(xe) && !wa_22019338487) {
> > 		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 +55,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 | diff --git
> >a/drivers/gpu/drm/xe/display/xe_plane_initial.c
> >b/drivers/gpu/drm/xe/display/xe_plane_initial.c
> >index 5eccd6abb3ef..a50ab9eae40a 100644
> >--- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
> >+++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
> >@@ -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
> >diff --git a/drivers/gpu/drm/xe/xe_wa_oob.rules
> >b/drivers/gpu/drm/xe/xe_wa_oob.rules
> >index 08f7336881e3..6ec23c4b972e 100644
> >--- a/drivers/gpu/drm/xe/xe_wa_oob.rules
> >+++ b/drivers/gpu/drm/xe/xe_wa_oob.rules
> >@@ -30,3 +30,4 @@
> > 22019338487	MEDIA_VERSION(2000)
> > 		GRAPHICS_VERSION(2001)
> 
> better to put the line here as it's actually the same WA, just a different part of it.
> It's easier if we group them close together.
> 
> Daniele, can you check the gsc patch now works with this addition to the WA?
> 
> thanks
> Lucas De Marchi
> 
> > 16023588340	GRAPHICS_VERSION(2001)
> >+22019338487_display	PLATFORM(LUNARLAKE)
> >--
> >2.42.0
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
index 816ad13821a8..0f02e6222ada 100644
--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
@@ -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)
@@ -20,6 +23,7 @@  struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
 	struct drm_mode_fb_cmd2 mode_cmd = {};
 	struct drm_i915_gem_object *obj;
 	int size;
+	bool wa_22019338487 = false;
 
 	/* we don't do packed 24bpp */
 	if (sizes->surface_bpp == 24)
@@ -37,7 +41,10 @@  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 (XE_WA(xe_root_mmio_gt(xe), 22019338487_display))
+		wa_22019338487 = true;
+
+	if (!IS_DGFX(xe) && !wa_22019338487) {
 		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 +55,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 |
diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c
index 5eccd6abb3ef..a50ab9eae40a 100644
--- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
+++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
@@ -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
diff --git a/drivers/gpu/drm/xe/xe_wa_oob.rules b/drivers/gpu/drm/xe/xe_wa_oob.rules
index 08f7336881e3..6ec23c4b972e 100644
--- a/drivers/gpu/drm/xe/xe_wa_oob.rules
+++ b/drivers/gpu/drm/xe/xe_wa_oob.rules
@@ -30,3 +30,4 @@ 
 22019338487	MEDIA_VERSION(2000)
 		GRAPHICS_VERSION(2001)
 16023588340	GRAPHICS_VERSION(2001)
+22019338487_display	PLATFORM(LUNARLAKE)