@@ -1870,7 +1870,7 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
intel_frontbuffer_put(intel_fb->frontbuffer);
- intel_fb_bo_framebuffer_fini(intel_fb_obj(fb));
+ intel_fb_bo_framebuffer_fini(intel_fb_bo(fb));
kfree(intel_fb);
}
@@ -2076,7 +2076,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
err_frontbuffer_put:
intel_frontbuffer_put(intel_fb->frontbuffer);
err:
- intel_fb_bo_framebuffer_fini(to_intel_bo(obj));
+ intel_fb_bo_framebuffer_fini(obj);
return ret;
}
@@ -11,7 +11,7 @@
#include "intel_fb.h"
#include "intel_fb_bo.h"
-void intel_fb_bo_framebuffer_fini(struct drm_i915_gem_object *obj)
+void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj)
{
/* Nothing to do for i915 */
}
@@ -8,12 +8,11 @@
struct drm_file;
struct drm_gem_object;
-struct drm_i915_gem_object;
struct drm_i915_private;
struct drm_mode_fb_cmd2;
struct intel_framebuffer;
-void intel_fb_bo_framebuffer_fini(struct drm_i915_gem_object *obj);
+void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj);
int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
struct drm_gem_object *obj,
@@ -11,8 +11,10 @@
#include "intel_fb_bo.h"
#include "xe_bo.h"
-void intel_fb_bo_framebuffer_fini(struct xe_bo *bo)
+void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj)
{
+ struct xe_bo *bo = gem_to_xe_bo(obj);
+
if (bo->flags & XE_BO_FLAG_PINNED) {
/* Unpin our kernel fb first */
xe_bo_lock(bo, false);
deleted file mode 100644
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2021 Intel Corporation
- */
-
-#ifndef __INTEL_FB_BO_H__
-#define __INTEL_FB_BO_H__
-
-struct drm_file;
-struct drm_gem_object;
-struct drm_i915_private;
-struct drm_mode_fb_cmd2;
-struct intel_framebuffer;
-struct xe_bo;
-
-void intel_fb_bo_framebuffer_fini(struct xe_bo *bo);
-int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
- struct drm_gem_object *obj,
- struct drm_mode_fb_cmd2 *mode_cmd);
-
-struct drm_gem_object *intel_fb_bo_lookup_valid_bo(struct drm_i915_private *i915,
- struct drm_file *filp,
- const struct drm_mode_fb_cmd2 *mode_cmd);
-
-#endif
Prefer the driver agnostic struct drm_gem_object over i915 specific struct drm_i915_gem_object. The xe specific intel_fb_bo.h becomes redundant. Remove it, and rely on the common header in i915 display. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/display/intel_fb.c | 4 ++-- drivers/gpu/drm/i915/display/intel_fb_bo.c | 2 +- drivers/gpu/drm/i915/display/intel_fb_bo.h | 3 +-- drivers/gpu/drm/xe/display/intel_fb_bo.c | 4 +++- drivers/gpu/drm/xe/display/intel_fb_bo.h | 25 ---------------------- 5 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 drivers/gpu/drm/xe/display/intel_fb_bo.h