mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-18 21:41:52 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user