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 plane_config_fini() between i915 and xe

Move the common code to display. Retain empty xe_plane_config_fini() for
now, in case it's needed in the future.

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

+10 -19
+10
drivers/gpu/drm/i915/display/intel_initial_plane.c
··· 26 26 static void plane_config_fini(struct intel_display *display, 27 27 struct intel_initial_plane_config *plane_config) 28 28 { 29 + if (plane_config->fb) { 30 + struct drm_framebuffer *fb = &plane_config->fb->base; 31 + 32 + /* We may only have the stub and not a full framebuffer */ 33 + if (drm_framebuffer_read_refcount(fb)) 34 + drm_framebuffer_put(fb); 35 + else 36 + kfree(fb); 37 + } 38 + 29 39 display->parent->initial_plane->config_fini(plane_config); 30 40 } 31 41
-10
drivers/gpu/drm/i915/i915_initial_plane.c
··· 395 395 396 396 static void i915_plane_config_fini(struct intel_initial_plane_config *plane_config) 397 397 { 398 - if (plane_config->fb) { 399 - struct drm_framebuffer *fb = &plane_config->fb->base; 400 - 401 - /* We may only have the stub and not a full framebuffer */ 402 - if (drm_framebuffer_read_refcount(fb)) 403 - drm_framebuffer_put(fb); 404 - else 405 - kfree(fb); 406 - } 407 - 408 398 if (plane_config->vma) 409 399 i915_vma_put(plane_config->vma); 410 400 }
-9
drivers/gpu/drm/xe/display/xe_initial_plane.c
··· 277 277 278 278 static void xe_plane_config_fini(struct intel_initial_plane_config *plane_config) 279 279 { 280 - if (plane_config->fb) { 281 - struct drm_framebuffer *fb = &plane_config->fb->base; 282 - 283 - /* We may only have the stub and not a full framebuffer */ 284 - if (drm_framebuffer_read_refcount(fb)) 285 - drm_framebuffer_put(fb); 286 - else 287 - kfree(fb); 288 - } 289 280 } 290 281 291 282 const struct intel_display_initial_plane_interface xe_display_initial_plane_interface = {