[PATCH 2/2] drm/xe/display: limit dpt creation to device where it's used

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Apr 16 18:14:06 UTC 2024


If running on discrete graphics dpt cannot be used from system memory

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 drivers/gpu/drm/xe/display/xe_fb_pin.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c
index 5382d76e8cb9..a091d149a607 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -94,18 +94,20 @@ static int __xe_pin_fb_vma_dpt(struct intel_framebuffer *fb,
 					   XE_BO_FLAG_VRAM0 |
 					   XE_BO_FLAG_GGTT |
 					   XE_BO_FLAG_PAGETABLE);
-	else
+	else {
 		dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
 					   ttm_bo_type_kernel,
 					   XE_BO_FLAG_STOLEN |
 					   XE_BO_FLAG_GGTT |
 					   XE_BO_FLAG_PAGETABLE);
-	if (IS_ERR(dpt))
-		dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
-					   ttm_bo_type_kernel,
-					   XE_BO_FLAG_SYSTEM |
-					   XE_BO_FLAG_GGTT |
-					   XE_BO_FLAG_PAGETABLE);
+		if (IS_ERR(dpt))
+			dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
+						   ttm_bo_type_kernel,
+						   XE_BO_FLAG_SYSTEM |
+						   XE_BO_FLAG_GGTT |
+						   XE_BO_FLAG_PAGETABLE);
+	}
+
 	if (IS_ERR(dpt))
 		return PTR_ERR(dpt);
 
-- 
2.25.1



More information about the Intel-xe mailing list