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/{i915, xe}: deduplicate intel_alloc_initial_plane_obj() FB modifier checks

Move the modifier checks into common code to deduplicate.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/3c62ad48595aa2306219b1d6a215cf7680a67da2.1765812266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+14 -26
+14
drivers/gpu/drm/i915/display/intel_initial_plane.c
··· 1 1 // SPDX-License-Identifier: MIT 2 2 /* Copyright © 2025 Intel Corporation */ 3 3 4 + #include <drm/drm_print.h> 4 5 #include <drm/intel/display_parent_interface.h> 5 6 6 7 #include "intel_display_core.h" ··· 48 47 struct intel_initial_plane_config *plane_config) 49 48 { 50 49 struct intel_display *display = to_intel_display(crtc); 50 + struct intel_framebuffer *fb = plane_config->fb; 51 + 52 + switch (fb->base.modifier) { 53 + case DRM_FORMAT_MOD_LINEAR: 54 + case I915_FORMAT_MOD_X_TILED: 55 + case I915_FORMAT_MOD_Y_TILED: 56 + case I915_FORMAT_MOD_4_TILED: 57 + break; 58 + default: 59 + drm_dbg_kms(display->drm, "Unsupported modifier for initial FB: 0x%llx\n", 60 + fb->base.modifier); 61 + return NULL; 62 + } 51 63 52 64 return display->parent->initial_plane->alloc_obj(&crtc->base, plane_config); 53 65 }
-13
drivers/gpu/drm/i915/i915_initial_plane.c
··· 240 240 struct drm_framebuffer *fb = &plane_config->fb->base; 241 241 struct i915_vma *vma; 242 242 243 - switch (fb->modifier) { 244 - case DRM_FORMAT_MOD_LINEAR: 245 - case I915_FORMAT_MOD_X_TILED: 246 - case I915_FORMAT_MOD_Y_TILED: 247 - case I915_FORMAT_MOD_4_TILED: 248 - break; 249 - default: 250 - drm_dbg(display->drm, 251 - "Unsupported modifier for initial FB: 0x%llx\n", 252 - fb->modifier); 253 - return NULL; 254 - } 255 - 256 243 vma = initial_plane_vma(display, plane_config); 257 244 if (!vma) 258 245 return NULL;
-13
drivers/gpu/drm/xe/display/xe_initial_plane.c
··· 134 134 struct drm_framebuffer *fb = &plane_config->fb->base; 135 135 struct xe_bo *bo; 136 136 137 - switch (fb->modifier) { 138 - case DRM_FORMAT_MOD_LINEAR: 139 - case I915_FORMAT_MOD_X_TILED: 140 - case I915_FORMAT_MOD_Y_TILED: 141 - case I915_FORMAT_MOD_4_TILED: 142 - break; 143 - default: 144 - drm_dbg_kms(&xe->drm, 145 - "Unsupported modifier for initial FB: 0x%llx\n", 146 - fb->modifier); 147 - return NULL; 148 - } 149 - 150 137 mode_cmd.pixel_format = fb->format->format; 151 138 mode_cmd.width = fb->width; 152 139 mode_cmd.height = fb->height;