Commit 6eca4dbe authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Change intel_fbdev_fb_alloc() return type

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240510102233.25057-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Acked-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 67f5728a
...@@ -207,13 +207,12 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -207,13 +207,12 @@ static int intelfb_create(struct drm_fb_helper *helper,
intel_fb = ifbdev->fb = NULL; intel_fb = ifbdev->fb = NULL;
} }
if (!intel_fb || drm_WARN_ON(dev, !intel_fb_obj(&intel_fb->base))) { if (!intel_fb || drm_WARN_ON(dev, !intel_fb_obj(&intel_fb->base))) {
struct drm_framebuffer *fb;
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"no BIOS fb, allocating a new one\n"); "no BIOS fb, allocating a new one\n");
fb = intel_fbdev_fb_alloc(helper, sizes); intel_fb = intel_fbdev_fb_alloc(helper, sizes);
if (IS_ERR(fb)) if (IS_ERR(intel_fb))
return PTR_ERR(fb); return PTR_ERR(intel_fb);
intel_fb = ifbdev->fb = to_intel_framebuffer(fb); ifbdev->fb = intel_fb;
} else { } else {
drm_dbg_kms(&dev_priv->drm, "re-using BIOS fb\n"); drm_dbg_kms(&dev_priv->drm, "re-using BIOS fb\n");
prealloc = true; prealloc = true;
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_fbdev_fb.h" #include "intel_fbdev_fb.h"
struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes) struct drm_fb_helper_surface_size *sizes)
{ {
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
struct drm_device *dev = helper->dev; struct drm_device *dev = helper->dev;
...@@ -63,7 +63,7 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, ...@@ -63,7 +63,7 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
fb = intel_framebuffer_create(obj, &mode_cmd); fb = intel_framebuffer_create(obj, &mode_cmd);
i915_gem_object_put(obj); 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, int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info,
......
...@@ -13,8 +13,8 @@ struct drm_i915_private; ...@@ -13,8 +13,8 @@ struct drm_i915_private;
struct fb_info; struct fb_info;
struct i915_vma; struct i915_vma;
struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes); struct drm_fb_helper_surface_size *sizes);
int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info, 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); struct drm_i915_gem_object *obj, struct i915_vma *vma);
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_display_types.h" #include "intel_display_types.h"
struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes) struct drm_fb_helper_surface_size *sizes)
{ {
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
struct drm_device *dev = helper->dev; struct drm_device *dev = helper->dev;
...@@ -70,10 +70,11 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, ...@@ -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)); drm_gem_object_put(intel_bo_to_drm_bo(obj));
return fb;
return to_intel_framebuffer(fb);
err: err:
return fb; return ERR_CAST(fb);
} }
int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info, int intel_fbdev_fb_fill_info(struct drm_i915_private *i915, struct fb_info *info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment