diff mbox series

[6/6] drm/xe/stolen: ignore first page for FBC

Message ID 20240215174431.285069-12-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/tests/drm_buddy: fix 32b build | expand

Commit Message

Matthew Auld Feb. 15, 2024, 5:44 p.m. UTC
Seems like we can potentially hit underruns if the CFB offset is within
the first page of stolen. Just like i915 skip the first page.

BSpec: 50214
Reported-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Maarten Lankhorst Feb. 16, 2024, 1:59 p.m. UTC | #1
On 2024-02-15 18:44, Matthew Auld wrote:
> Seems like we can potentially hit underruns if the CFB offset is within
> the first page of stolen. Just like i915 skip the first page.
> 
> BSpec: 50214
> Reported-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
>   drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
> index bd233007c1b7..003474cfdf31 100644
> --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
> +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
> @@ -19,6 +19,9 @@ static inline int i915_gem_stolen_insert_node_in_range(struct xe_device *xe,
>   	int err;
>   	u32 flags = XE_BO_CREATE_PINNED_BIT | XE_BO_CREATE_STOLEN_BIT;
>   
> +	if (start < SZ_4K)
> +		start = SZ_4K;
> +
>   	if (align)
>   		size = ALIGN(size, align);
>   
Should start also be aligned?

If that's taken care of by other code, for both patches:
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
index bd233007c1b7..003474cfdf31 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
@@ -19,6 +19,9 @@  static inline int i915_gem_stolen_insert_node_in_range(struct xe_device *xe,
 	int err;
 	u32 flags = XE_BO_CREATE_PINNED_BIT | XE_BO_CREATE_STOLEN_BIT;
 
+	if (start < SZ_4K)
+		start = SZ_4K;
+
 	if (align)
 		size = ALIGN(size, align);