Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH v2 7/9] drm/i915: Change intel_fbdev_fb_alloc() return type
Date: Fri, 10 May 2024 13:22:33 +0300	[thread overview]
Message-ID: <20240510102233.25057-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20240506125718.26001-8-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Change intel_fbdev_fb_alloc() to return struct intel_fb instead
of struct drm_framebuffer. Let's us eliminate some annoying
aliasing variables in the fbdev setup code.

v2: Assing the results to the correct variable (Jani)
    Fix xe's copy

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c    | 9 ++++-----
 drivers/gpu/drm/i915/display/intel_fbdev_fb.c | 6 +++---
 drivers/gpu/drm/i915/display/intel_fbdev_fb.h | 4 ++--
 drivers/gpu/drm/xe/display/intel_fbdev_fb.c   | 9 +++++----
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index bda702c2cab8..4bbbf481bb3a 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -207,13 +207,12 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		intel_fb = ifbdev->fb = NULL;
 	}
 	if (!intel_fb || drm_WARN_ON(dev, !intel_fb_obj(&intel_fb->base))) {
-		struct drm_framebuffer *fb;
 		drm_dbg_kms(&dev_priv->drm,
 			    "no BIOS fb, allocating a new one\n");
-		fb = intel_fbdev_fb_alloc(helper, sizes);
-		if (IS_ERR(fb))
-			return PTR_ERR(fb);
-		intel_fb = ifbdev->fb = to_intel_framebuffer(fb);
+		intel_fb = intel_fbdev_fb_alloc(helper, sizes);
+		if (IS_ERR(intel_fb))
+			return PTR_ERR(intel_fb);
+		ifbdev->fb = intel_fb;
 	} else {
 		drm_dbg_kms(&dev_priv->drm, "re-using BIOS fb\n");
 		prealloc = true;
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
index 0665f943f65f..497525ef9668 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
@@ -11,8 +11,8 @@
 #include "intel_display_types.h"
 #include "intel_fbdev_fb.h"
 
-struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
-					     struct drm_fb_helper_surface_size *sizes)
+struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
+					       struct drm_fb_helper_surface_size *sizes)
 {
 	struct drm_framebuffer *fb;
 	struct drm_device *dev = helper->dev;
@@ -63,7 +63,7 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
 	fb = intel_framebuffer_create(obj, &mode_cmd);
 	i915_gem_object_put(obj);
 
-	return fb;
+	return to_intel_framebuffer(fb);
 }
 
 int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info,
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
index a395b2c65d33..4832fe688fbf 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
+++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
@@ -13,8 +13,8 @@ struct drm_i915_private;
 struct fb_info;
 struct i915_vma;
 
-struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
-					     struct drm_fb_helper_surface_size *sizes);
+struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
+					       struct drm_fb_helper_surface_size *sizes);
 int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info,
 			     struct drm_i915_gem_object *obj, struct i915_vma *vma);
 
diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
index 9e4bcfdbc7e5..f6bf5896ff1b 100644
--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
@@ -13,8 +13,8 @@
 #include "i915_drv.h"
 #include "intel_display_types.h"
 
-struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
-			 struct drm_fb_helper_surface_size *sizes)
+struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
+					       struct drm_fb_helper_surface_size *sizes)
 {
 	struct drm_framebuffer *fb;
 	struct drm_device *dev = helper->dev;
@@ -70,10 +70,11 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
 	}
 
 	drm_gem_object_put(intel_bo_to_drm_bo(obj));
-	return fb;
+
+	return to_intel_framebuffer(fb);
 
 err:
-	return fb;
+	return ERR_CAST(fb);
 }
 
 int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info,
-- 
2.43.2


  parent reply	other threads:[~2024-05-10 10:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 12:57 [PATCH 0/9] drm/i915: Plane fb refactoring Ville Syrjala
2024-05-06 12:57 ` [PATCH 1/9] drm/i915: Split gen2 vs. gen3 .max_stride() Ville Syrjala
2024-05-06 13:57   ` Jani Nikula
2024-05-06 12:57 ` [PATCH 2/9] drm/i915: Clean up skl+ plane stride limits Ville Syrjala
2024-05-06 14:03   ` Jani Nikula
2024-05-06 16:38     ` Ville Syrjälä
2024-05-07  9:02       ` Jani Nikula
2024-05-06 12:57 ` [PATCH 3/9] drm/i915: Drop 'uses_fence' parameter from intel_pin_fb_obj_dpt() Ville Syrjala
2024-05-06 14:04   ` Jani Nikula
2024-05-06 12:57 ` [PATCH 4/9] drm/i915: Extract intel_plane_needs_physical() Ville Syrjala
2024-05-06 14:05   ` Jani Nikula
2024-05-06 12:57 ` [PATCH 5/9] drm/i915: Polish types in fb calculations Ville Syrjala
2024-05-06 14:07   ` Jani Nikula
2024-05-06 12:57 ` [PATCH 6/9] drm/i915: Constify 'fb' in during pinning Ville Syrjala
2024-05-06 14:11   ` Jani Nikula
2024-05-06 12:57 ` [PATCH 7/9] drm/i915: Change intel_fbdev_fb_alloc() reuturn type Ville Syrjala
2024-05-06 14:16   ` Jani Nikula
2024-05-06 16:51     ` Ville Syrjälä
2024-05-06 18:19       ` Ville Syrjälä
2024-05-10 10:22   ` Ville Syrjala [this message]
2024-05-10 11:30     ` [PATCH v2 7/9] drm/i915: Change intel_fbdev_fb_alloc() return type Jani Nikula
2024-05-06 12:57 ` [PATCH 8/9] drm/i915: Cleanup fbdev fb setup Ville Syrjala
2024-05-10 10:22   ` [PATCH v2 " Ville Syrjala
2024-05-10 11:32     ` Jani Nikula
2024-05-06 12:57 ` [PATCH 9/9] drm/i915: Rename the fb pinning functions to indicate the address space Ville Syrjala
2024-05-10 11:35   ` Jani Nikula
2024-05-06 13:02 ` ✓ CI.Patch_applied: success for drm/i915: Plane fb refactoring Patchwork
2024-05-06 13:03 ` ✓ CI.checkpatch: " Patchwork
2024-05-06 13:03 ` ✓ CI.KUnit: " Patchwork
2024-05-06 13:15 ` ✓ CI.Build: " Patchwork
2024-05-06 13:18 ` ✓ CI.Hooks: " Patchwork
2024-05-06 13:19 ` ✗ CI.checksparse: warning " Patchwork
2024-05-06 13:53 ` ✓ CI.BAT: success " Patchwork
2024-05-06 15:07 ` ✓ CI.FULL: " Patchwork
2024-05-10 10:52 ` ✓ CI.Patch_applied: success for drm/i915: Plane fb refactoring (rev3) Patchwork
2024-05-10 10:53 ` ✓ CI.checkpatch: " Patchwork
2024-05-10 10:55 ` ✓ CI.KUnit: " Patchwork
2024-05-10 11:07 ` ✓ CI.Build: " Patchwork
2024-05-10 11:10 ` ✓ CI.Hooks: " Patchwork
2024-05-10 11:11 ` ✗ CI.checksparse: warning " Patchwork
2024-05-10 11:43 ` ✗ CI.BAT: failure " Patchwork
2024-05-10 13:54 ` ✓ CI.FULL: success " Patchwork
2024-05-10 16:55 ` [PATCH 0/9] drm/i915: Plane fb refactoring Ville Syrjälä
2024-05-11 19:00   ` Lucas De Marchi

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=20240510102233.25057-1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox