mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
drm/{i915, xe}/fbdev: pass struct drm_device to intel_fbdev_fb_alloc()
The function doesn't actually need struct drm_fb_helper for anything, just pass struct drm_device. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/16360584f80cdc5ee35fd94cfd92fd3955588dfd.1758184771.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
6979d2c80c
commit
9e5cf822a2
|
|
@ -237,7 +237,7 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
|||
if (!fb || drm_WARN_ON(display->drm, !intel_fb_bo(&fb->base))) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"no BIOS fb, allocating a new one\n");
|
||||
fb = intel_fbdev_fb_alloc(helper, sizes);
|
||||
fb = intel_fbdev_fb_alloc(display->drm, sizes);
|
||||
if (IS_ERR(fb))
|
||||
return PTR_ERR(fb);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
#include "intel_fb.h"
|
||||
#include "intel_fbdev_fb.h"
|
||||
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
|
||||
struct drm_fb_helper_surface_size *sizes)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(helper->dev);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_display *display = to_intel_display(drm);
|
||||
struct drm_i915_private *dev_priv = to_i915(drm);
|
||||
struct drm_framebuffer *fb;
|
||||
struct drm_mode_fb_cmd2 mode_cmd = {};
|
||||
struct drm_i915_gem_object *obj;
|
||||
|
|
@ -58,12 +58,12 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
|
|||
}
|
||||
|
||||
if (IS_ERR(obj)) {
|
||||
drm_err(display->drm, "failed to allocate framebuffer (%pe)\n", obj);
|
||||
drm_err(drm, "failed to allocate framebuffer (%pe)\n", obj);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
fb = intel_framebuffer_create(intel_bo_to_drm_bo(obj),
|
||||
drm_get_format_info(display->drm,
|
||||
drm_get_format_info(drm,
|
||||
mode_cmd.pixel_format,
|
||||
mode_cmd.modifier[0]),
|
||||
&mode_cmd);
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
#ifndef __INTEL_FBDEV_FB_H__
|
||||
#define __INTEL_FBDEV_FB_H__
|
||||
|
||||
struct drm_fb_helper;
|
||||
struct drm_device;
|
||||
struct drm_fb_helper_surface_size;
|
||||
struct drm_gem_object;
|
||||
struct fb_info;
|
||||
struct i915_vma;
|
||||
struct intel_display;
|
||||
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
|
||||
struct drm_fb_helper_surface_size *sizes);
|
||||
int intel_fbdev_fb_fill_info(struct intel_display *display, struct fb_info *info,
|
||||
struct drm_gem_object *obj, struct i915_vma *vma);
|
||||
|
|
|
|||
|
|
@ -15,12 +15,11 @@
|
|||
|
||||
#include <generated/xe_wa_oob.h>
|
||||
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
|
||||
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
|
||||
struct drm_fb_helper_surface_size *sizes)
|
||||
{
|
||||
struct drm_framebuffer *fb;
|
||||
struct drm_device *dev = helper->dev;
|
||||
struct xe_device *xe = to_xe_device(dev);
|
||||
struct xe_device *xe = to_xe_device(drm);
|
||||
struct drm_mode_fb_cmd2 mode_cmd = {};
|
||||
struct xe_bo *obj;
|
||||
int size;
|
||||
|
|
@ -67,7 +66,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
|
|||
}
|
||||
|
||||
fb = intel_framebuffer_create(&obj->ttm.base,
|
||||
drm_get_format_info(dev,
|
||||
drm_get_format_info(drm,
|
||||
mode_cmd.pixel_format,
|
||||
mode_cmd.modifier[0]),
|
||||
&mode_cmd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user