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>
This commit is contained in:
Jani Nikula
2025-12-15 17:28:20 +02:00
parent a13f152a6c
commit 6bb14ea387
3 changed files with 10 additions and 19 deletions

View File

@@ -26,6 +26,16 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
static void plane_config_fini(struct intel_display *display,
struct intel_initial_plane_config *plane_config)
{
if (plane_config->fb) {
struct drm_framebuffer *fb = &plane_config->fb->base;
/* We may only have the stub and not a full framebuffer */
if (drm_framebuffer_read_refcount(fb))
drm_framebuffer_put(fb);
else
kfree(fb);
}
display->parent->initial_plane->config_fini(plane_config);
}

View File

@@ -395,16 +395,6 @@ i915_find_initial_plane_obj(struct drm_crtc *_crtc,
static void i915_plane_config_fini(struct intel_initial_plane_config *plane_config)
{
if (plane_config->fb) {
struct drm_framebuffer *fb = &plane_config->fb->base;
/* We may only have the stub and not a full framebuffer */
if (drm_framebuffer_read_refcount(fb))
drm_framebuffer_put(fb);
else
kfree(fb);
}
if (plane_config->vma)
i915_vma_put(plane_config->vma);
}

View File

@@ -277,15 +277,6 @@ xe_find_initial_plane_obj(struct drm_crtc *_crtc,
static void xe_plane_config_fini(struct intel_initial_plane_config *plane_config)
{
if (plane_config->fb) {
struct drm_framebuffer *fb = &plane_config->fb->base;
/* We may only have the stub and not a full framebuffer */
if (drm_framebuffer_read_refcount(fb))
drm_framebuffer_put(fb);
else
kfree(fb);
}
}
const struct intel_display_initial_plane_interface xe_display_initial_plane_interface = {