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

Signed-off-by: Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_initial_plane.c | 10 ++++++++++
 drivers/gpu/drm/i915/i915_initial_plane.c          | 10 ----------
 drivers/gpu/drm/xe/display/xe_initial_plane.c      |  9 ---------
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c 
b/drivers/gpu/drm/i915/display/intel_initial_plane.c
index 561a2ba2a486..62f4fb3be9f0 100644
--- a/drivers/gpu/drm/i915/display/intel_initial_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_initial_plane.c
@@ -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);
 }
 
diff --git a/drivers/gpu/drm/i915/i915_initial_plane.c 
b/drivers/gpu/drm/i915/i915_initial_plane.c
index 68cf2499855a..d8f2a2a11dd0 100644
--- a/drivers/gpu/drm/i915/i915_initial_plane.c
+++ b/drivers/gpu/drm/i915/i915_initial_plane.c
@@ -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);
 }
diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c 
b/drivers/gpu/drm/xe/display/xe_initial_plane.c
index 0007337c60da..95000f8b0662 100644
--- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
+++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
@@ -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 = {
-- 
2.47.3

Reply via email to