drm/xe/display: Don't try to use vram if not available
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Thu, 12 Oct 2023 13:52:08 +0000 (16:52 +0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:44:32 +0000 (11:44 -0500)
Trying to get bo from vram when vram not available will cause
WARN_ON() hence avoid touching vram if not available.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/display/xe_fb_pin.c

index 16e04b2..9fc2147 100644 (file)
@@ -62,11 +62,12 @@ static int __xe_pin_fb_vma_dpt(struct intel_framebuffer *fb,
                dpt_size = ALIGN(intel_rotation_info_size(&view->rotated) * 8,
                                 XE_PAGE_SIZE);
 
-       dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
-                                 ttm_bo_type_kernel,
-                                 XE_BO_CREATE_VRAM0_BIT |
-                                 XE_BO_CREATE_GGTT_BIT);
-       if (IS_ERR(dpt))
+       if (IS_DGFX(xe))
+               dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
+                                          ttm_bo_type_kernel,
+                                          XE_BO_CREATE_VRAM0_BIT |
+                                          XE_BO_CREATE_GGTT_BIT);
+       else
                dpt = xe_bo_create_pin_map(xe, tile0, NULL, dpt_size,
                                           ttm_bo_type_kernel,
                                           XE_BO_CREATE_STOLEN_BIT |