From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 02/11] drm/i915: Decouple intel_fb_bo.h interfaces from driver specific types
Date: Fri, 24 Jan 2025 18:30:31 +0200 [thread overview]
Message-ID: <20250124163040.8886-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20250124163040.8886-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Make the intel_fb_bo.h interfaces operated purely in base
drm_ types so that each driver (i915 and xe) doesn't have to
know about each other, or the display stuff.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_fb.c | 5 ++---
drivers/gpu/drm/i915/display/intel_fb_bo.c | 5 +++--
drivers/gpu/drm/i915/display/intel_fb_bo.h | 8 ++++----
drivers/gpu/drm/xe/display/intel_fb_bo.c | 7 ++++---
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 3121371635bb..f8944eaa9995 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -2078,7 +2078,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
int ret = -EINVAL;
int i;
- ret = intel_fb_bo_framebuffer_init(intel_fb, obj, mode_cmd);
+ ret = intel_fb_bo_framebuffer_init(fb, obj, mode_cmd);
if (ret)
return ret;
@@ -2194,9 +2194,8 @@ intel_user_framebuffer_create(struct drm_device *dev,
struct drm_framebuffer *fb;
struct drm_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
- struct drm_i915_private *i915 = to_i915(dev);
- obj = intel_fb_bo_lookup_valid_bo(i915, filp, &mode_cmd);
+ obj = intel_fb_bo_lookup_valid_bo(dev, filp, &mode_cmd);
if (IS_ERR(obj))
return ERR_CAST(obj);
diff --git a/drivers/gpu/drm/i915/display/intel_fb_bo.c b/drivers/gpu/drm/i915/display/intel_fb_bo.c
index 810ca6ff8640..56f029962261 100644
--- a/drivers/gpu/drm/i915/display/intel_fb_bo.c
+++ b/drivers/gpu/drm/i915/display/intel_fb_bo.c
@@ -16,7 +16,7 @@ void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj)
/* Nothing to do for i915 */
}
-int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
+int intel_fb_bo_framebuffer_init(struct drm_framebuffer *fb,
struct drm_gem_object *_obj,
struct drm_mode_fb_cmd2 *mode_cmd)
{
@@ -76,10 +76,11 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
}
struct drm_gem_object *
-intel_fb_bo_lookup_valid_bo(struct drm_i915_private *i915,
+intel_fb_bo_lookup_valid_bo(struct drm_device *dev,
struct drm_file *filp,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
+ struct drm_i915_private *i915 = to_i915(dev);
struct drm_i915_gem_object *obj;
obj = i915_gem_object_lookup(filp, mode_cmd->handles[0]);
diff --git a/drivers/gpu/drm/i915/display/intel_fb_bo.h b/drivers/gpu/drm/i915/display/intel_fb_bo.h
index e71acd1bcb24..1357ecad5a0a 100644
--- a/drivers/gpu/drm/i915/display/intel_fb_bo.h
+++ b/drivers/gpu/drm/i915/display/intel_fb_bo.h
@@ -6,20 +6,20 @@
#ifndef __INTEL_FB_BO_H__
#define __INTEL_FB_BO_H__
+struct drm_device;
struct drm_file;
+struct drm_framebuffer;
struct drm_gem_object;
-struct drm_i915_private;
struct drm_mode_fb_cmd2;
-struct intel_framebuffer;
void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj);
-int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
+int intel_fb_bo_framebuffer_init(struct drm_framebuffer *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,
+intel_fb_bo_lookup_valid_bo(struct drm_device *dev,
struct drm_file *filp,
const struct drm_mode_fb_cmd2 *user_mode_cmd);
diff --git a/drivers/gpu/drm/xe/display/intel_fb_bo.c b/drivers/gpu/drm/xe/display/intel_fb_bo.c
index 4d209ebc26c2..c97f61569b89 100644
--- a/drivers/gpu/drm/xe/display/intel_fb_bo.c
+++ b/drivers/gpu/drm/xe/display/intel_fb_bo.c
@@ -24,7 +24,7 @@ void intel_fb_bo_framebuffer_fini(struct drm_gem_object *obj)
xe_bo_put(bo);
}
-int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
+int intel_fb_bo_framebuffer_init(struct drm_framebuffer *fb,
struct drm_gem_object *obj,
struct drm_mode_fb_cmd2 *mode_cmd)
{
@@ -68,10 +68,11 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
return ret;
}
-struct drm_gem_object *intel_fb_bo_lookup_valid_bo(struct drm_i915_private *i915,
+struct drm_gem_object *intel_fb_bo_lookup_valid_bo(struct drm_device *dev,
struct drm_file *filp,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
+ struct xe_device *xe = to_xe_device(dev);
struct xe_bo *bo;
struct drm_gem_object *gem = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
@@ -80,7 +81,7 @@ struct drm_gem_object *intel_fb_bo_lookup_valid_bo(struct drm_i915_private *i915
bo = gem_to_xe_bo(gem);
/* Require vram placement or dma-buf import */
- if (IS_DGFX(i915) &&
+ if (IS_DGFX(xe) &&
!xe_bo_can_migrate(bo, XE_PL_VRAM0) &&
bo->ttm.type != ttm_bo_type_sg) {
drm_gem_object_put(gem);
--
2.45.3
next prev parent reply other threads:[~2025-01-24 16:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 16:30 [PATCH 00/11] drm/i915: intel_display conversions and some debug improvements Ville Syrjala
2025-01-24 16:30 ` [PATCH 01/11] drm/i915: Decouple i915_gem_dumb_create() from the display a bit Ville Syrjala
2025-02-04 11:15 ` Jani Nikula
2025-01-24 16:30 ` Ville Syrjala [this message]
2025-01-24 16:30 ` [PATCH 03/11] drm/i915: Convert intel_crtc.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 04/11] drm/i915: Convert intel_fb.c " Ville Syrjala
2025-01-24 16:30 ` [PATCH 05/11] drm/i915: Convert intel_display_power_{get, put}*() to intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 06/11] drm/i915: Convert i9xx_plane.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 07/11] drm/i915: Finish intel_sprite.c struct intel_display conversion Ville Syrjala
2025-01-24 16:30 ` [PATCH 08/11] drm/i915: Convert intel_cursor.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 09/11] drm/i915: Convert skl_univeral_plane.c " Ville Syrjala
2025-01-24 16:30 ` [PATCH 10/11] drm/i915: Use DRM_RECT_FMT & co. for plane debugs Ville Syrjala
2025-01-24 16:30 ` [PATCH 11/11] drm/i915: Pimp " Ville Syrjala
2025-01-28 7:04 ` Borah, Chaitanya Kumar
2025-01-24 16:39 ` ✓ CI.Patch_applied: success for drm/i915: intel_display conversions and some debug improvements Patchwork
2025-01-24 16:40 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-24 16:41 ` ✓ CI.KUnit: success " Patchwork
2025-01-24 17:03 ` ✓ CI.Build: " Patchwork
2025-01-24 17:05 ` ✗ CI.Hooks: failure " Patchwork
2025-01-24 17:07 ` ✗ CI.checksparse: warning " Patchwork
2025-01-24 17:27 ` ✗ Fi.CI.CHECKPATCH: " Patchwork
2025-01-24 17:27 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-24 17:41 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-24 17:42 ` ✓ i915.CI.BAT: " Patchwork
2025-01-24 23:24 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-25 5:29 ` ✗ i915.CI.Full: " Patchwork
2025-02-04 11:14 ` [PATCH 00/11] " Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250124163040.8886-3-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.