Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/fbdev: Extract intel_fbdev_fb_prefer_stolen()

Pull the "should we keep the bios fb in stolen?" logic into
into a helper function, same as was done for i915. Gives us
a single place where to tweak the heuristics.

v2: changes related to rebase and consolidated other conditions
for the stolen preference into this single function (Vinod)

v3: avoid including intel_display_core.h (Jani Nikula)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260220170908.201422-5-vinod.govindapillai@intel.com

authored by

Ville Syrjälä and committed by
Vinod Govindapillai
27c56f73 94c7d286

+26 -10
+24 -1
drivers/gpu/drm/xe/display/intel_fbdev_fb.c
··· 23 23 return ALIGN(stride, XE_PAGE_SIZE); 24 24 } 25 25 26 + bool intel_fbdev_fb_prefer_stolen(struct drm_device *drm, unsigned int size) 27 + { 28 + struct xe_device *xe = to_xe_device(drm); 29 + struct ttm_resource_manager *stolen; 30 + 31 + stolen = ttm_manager_type(&xe->ttm, XE_PL_STOLEN); 32 + if (!stolen) 33 + return false; 34 + 35 + if (IS_DGFX(xe)) 36 + return false; 37 + 38 + if (XE_DEVICE_WA(xe, 22019338487_display)) 39 + return false; 40 + 41 + /* 42 + * If the FB is too big, just don't use it since fbdev is not very 43 + * important and we should probably use that space with FBC or other 44 + * features. 45 + */ 46 + return stolen->size >= size * 2; 47 + } 48 + 26 49 struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size) 27 50 { 28 51 struct xe_device *xe = to_xe_device(drm); ··· 53 30 54 31 obj = ERR_PTR(-ENODEV); 55 32 56 - if (!IS_DGFX(xe) && !XE_DEVICE_WA(xe, 22019338487_display)) { 33 + if (intel_fbdev_fb_prefer_stolen(drm, size)) { 57 34 obj = xe_bo_create_pin_map_novm(xe, xe_device_get_root_tile(xe), 58 35 size, 59 36 ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
+2 -9
drivers/gpu/drm/xe/display/xe_initial_plane.c
··· 17 17 #include "intel_display_regs.h" 18 18 #include "intel_display_types.h" 19 19 #include "intel_fb.h" 20 + #include "intel_fbdev_fb.h" 20 21 #include "intel_fb_pin.h" 21 22 #include "xe_bo.h" 22 23 #include "xe_vram_types.h" ··· 91 90 phys_base = base; 92 91 flags |= XE_BO_FLAG_STOLEN; 93 92 94 - if (XE_DEVICE_WA(xe, 22019338487_display)) 95 - return NULL; 96 - 97 - /* 98 - * If the FB is too big, just don't use it since fbdev is not very 99 - * important and we should probably use that space with FBC or other 100 - * features. 101 - */ 102 93 if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) && 103 - plane_config->size * 2 > stolen->size) 94 + !intel_fbdev_fb_prefer_stolen(&xe->drm, plane_config->size)) 104 95 return NULL; 105 96 } 106 97