mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
drm: Pass the format info to .fb_create()
Pass along the format information from the top to .fb_create()
so that we can avoid redundant (and somewhat expensive) lookups
in the drivers.
Done with cocci (with some manual fixups):
@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
(
- const struct drm_format_info *info = drm_get_format_info(...);
|
- const struct drm_format_info *info;
...
- info = drm_get_format_info(...);
)
<...
- if (!info)
- return ...;
...>
}
@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
}
@find@
identifier fb_create_func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *fb_create_func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd);
@@
identifier find.fb_create_func;
expression dev, file, mode_cmd;
@@
fb_create_func(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create_with_dirty(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file_priv, mode_cmd;
identifier info, fb;
@@
info = drm_get_format_info(...);
...
fb = dev->mode_config.funcs->fb_create(dev, file_priv
+ ,info
,mode_cmd);
@@
identifier dev, file_priv, mode_cmd;
@@
struct drm_mode_config_funcs {
...
struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
struct drm_file *file_priv,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd);
...
};
v2: Fix kernel docs (Laurent)
Fix commit msg (Geert)
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Cc: Marek Vasut <marex@denx.de>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Andy Yan <andy.yan@rock-chips.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: "Maíra Canal" <mcanal@igalia.com>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: virtualization@lists.linux.dev
Cc: spice-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-5-ville.syrjala@linux.intel.com
This commit is contained in:
parent
d5d6340c0b
commit
81112eaac5
38 changed files with 59 additions and 49 deletions
|
|
@ -1297,6 +1297,7 @@ static int amdgpu_display_framebuffer_init(struct drm_device *dev,
|
|||
struct drm_framebuffer *
|
||||
amdgpu_display_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct amdgpu_framebuffer *amdgpu_fb;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
|
|||
struct drm_framebuffer *
|
||||
amdgpu_display_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
const struct drm_format_info *
|
||||
amdgpu_lookup_format_info(u32 format, uint64_t modifier);
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev, struct komeda_fb *kfb,
|
|||
|
||||
struct drm_framebuffer *
|
||||
komeda_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct komeda_dev *mdev = dev->dev_private;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ struct komeda_fb {
|
|||
|
||||
struct drm_framebuffer *
|
||||
komeda_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
int komeda_fb_check_src_coords(const struct komeda_fb *kfb,
|
||||
u32 src_x, u32 src_y, u32 src_w, u32 src_h);
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ malidp_verify_afbc_framebuffer(struct drm_device *dev, struct drm_file *file,
|
|||
|
||||
static struct drm_framebuffer *
|
||||
malidp_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
if (mode_cmd->modifier[0]) {
|
||||
|
|
@ -384,7 +385,7 @@ malidp_fb_create(struct drm_device *dev, struct drm_file *file,
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file, info, mode_cmd);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs malidp_mode_config_funcs = {
|
||||
|
|
|
|||
|
|
@ -84,11 +84,9 @@ struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev,
|
|||
}
|
||||
|
||||
struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
|
||||
struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode)
|
||||
struct drm_file *dfile, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev,
|
||||
mode->pixel_format,
|
||||
mode->modifier[0]);
|
||||
struct armada_gem_object *obj;
|
||||
struct armada_framebuffer *dfb;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -19,5 +19,6 @@ struct armada_framebuffer {
|
|||
struct armada_framebuffer *armada_framebuffer_create(struct drm_device *,
|
||||
const struct drm_mode_fb_cmd2 *, struct armada_gem_object *);
|
||||
struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
|
||||
struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode);
|
||||
struct drm_file *dfile, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ drm_internal_framebuffer_create(struct drm_device *dev,
|
|||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
fb = dev->mode_config.funcs->fb_create(dev, file_priv, r);
|
||||
fb = dev->mode_config.funcs->fb_create(dev, file_priv, info, r);
|
||||
if (IS_ERR(fb)) {
|
||||
drm_dbg_kms(dev, "could not create framebuffer\n");
|
||||
return fb;
|
||||
|
|
|
|||
|
|
@ -264,6 +264,7 @@ static const struct drm_framebuffer_funcs drm_gem_fb_funcs = {
|
|||
* &drm_mode_config_funcs.fb_create callback
|
||||
* @dev: DRM device
|
||||
* @file: DRM file that holds the GEM handle(s) backing the framebuffer
|
||||
* @info: pixel format information
|
||||
* @mode_cmd: Metadata from the userspace framebuffer creation request
|
||||
*
|
||||
* This function creates a new framebuffer object described by
|
||||
|
|
@ -283,6 +284,7 @@ static const struct drm_framebuffer_funcs drm_gem_fb_funcs = {
|
|||
*/
|
||||
struct drm_framebuffer *
|
||||
drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
return drm_gem_fb_create_with_funcs(dev, file, mode_cmd,
|
||||
|
|
@ -301,6 +303,7 @@ static const struct drm_framebuffer_funcs drm_gem_fb_funcs_dirtyfb = {
|
|||
* &drm_mode_config_funcs.fb_create callback
|
||||
* @dev: DRM device
|
||||
* @file: DRM file that holds the GEM handle(s) backing the framebuffer
|
||||
* @info: pixel format information
|
||||
* @mode_cmd: Metadata from the userspace framebuffer creation request
|
||||
*
|
||||
* This function creates a new framebuffer object described by
|
||||
|
|
@ -321,6 +324,7 @@ static const struct drm_framebuffer_funcs drm_gem_fb_funcs_dirtyfb = {
|
|||
*/
|
||||
struct drm_framebuffer *
|
||||
drm_gem_fb_create_with_dirty(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
return drm_gem_fb_create_with_funcs(dev, file, mode_cmd,
|
||||
|
|
|
|||
|
|
@ -94,11 +94,9 @@ err:
|
|||
|
||||
static struct drm_framebuffer *
|
||||
exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev,
|
||||
mode_cmd->pixel_format,
|
||||
mode_cmd->modifier[0]);
|
||||
struct exynos_drm_gem *exynos_gem[MAX_FB_BUFFER];
|
||||
struct drm_framebuffer *fb;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ struct drm_framebuffer *psb_framebuffer_create(struct drm_device *dev,
|
|||
*/
|
||||
static struct drm_framebuffer *psb_user_framebuffer_create
|
||||
(struct drm_device *dev, struct drm_file *filp,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *cmd)
|
||||
{
|
||||
struct drm_gem_object *obj;
|
||||
|
|
|
|||
|
|
@ -2324,6 +2324,7 @@ err:
|
|||
struct drm_framebuffer *
|
||||
intel_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *filp,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *user_mode_cmd)
|
||||
{
|
||||
struct drm_framebuffer *fb;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ intel_framebuffer_create(struct drm_gem_object *obj,
|
|||
struct drm_framebuffer *
|
||||
intel_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *filp,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *user_mode_cmd);
|
||||
|
||||
bool intel_fb_modifier_uses_dpt(struct intel_display *display, u64 modifier);
|
||||
|
|
|
|||
|
|
@ -901,14 +901,15 @@ static void ingenic_drm_disable_vblank(struct drm_crtc *crtc)
|
|||
|
||||
static struct drm_framebuffer *
|
||||
ingenic_drm_gem_fb_create(struct drm_device *drm, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct ingenic_drm *priv = drm_device_get_priv(drm);
|
||||
|
||||
if (priv->soc_info->map_noncoherent)
|
||||
return drm_gem_fb_create_with_dirty(drm, file, mode_cmd);
|
||||
return drm_gem_fb_create_with_dirty(drm, file, info, mode_cmd);
|
||||
|
||||
return drm_gem_fb_create(drm, file, mode_cmd);
|
||||
return drm_gem_fb_create(drm, file, info, mode_cmd);
|
||||
}
|
||||
|
||||
static struct drm_gem_object *
|
||||
|
|
|
|||
|
|
@ -43,16 +43,13 @@ static const struct drm_mode_config_helper_funcs mtk_drm_mode_config_helpers = {
|
|||
static struct drm_framebuffer *
|
||||
mtk_drm_mode_fb_create(struct drm_device *dev,
|
||||
struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev,
|
||||
cmd->pixel_format,
|
||||
cmd->modifier[0]);
|
||||
|
||||
if (info->num_planes != 1)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
return drm_gem_fb_create(dev, file, cmd);
|
||||
return drm_gem_fb_create(dev, file, info, cmd);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs mtk_drm_mode_config_funcs = {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,8 @@ uint32_t msm_framebuffer_iova(struct drm_framebuffer *fb, int plane);
|
|||
struct drm_gem_object *msm_framebuffer_bo(struct drm_framebuffer *fb, int plane);
|
||||
const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb);
|
||||
struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
struct drm_file *file, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
struct drm_framebuffer * msm_alloc_stolen_fb(struct drm_device *dev,
|
||||
int w, int h, int p, uint32_t format);
|
||||
|
||||
|
|
|
|||
|
|
@ -139,11 +139,9 @@ const struct msm_format *msm_framebuffer_format(struct drm_framebuffer *fb)
|
|||
}
|
||||
|
||||
struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
struct drm_file *file, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev,
|
||||
mode_cmd->pixel_format,
|
||||
mode_cmd->modifier[0]);
|
||||
struct drm_gem_object *bos[4] = {0};
|
||||
struct drm_framebuffer *fb;
|
||||
int ret, i, n = info->num_planes;
|
||||
|
|
|
|||
|
|
@ -91,21 +91,15 @@ void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb)
|
|||
|
||||
static struct drm_framebuffer *
|
||||
mxsfb_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct drm_format_info *info;
|
||||
|
||||
info = drm_get_format_info(dev, mode_cmd->pixel_format,
|
||||
mode_cmd->modifier[0]);
|
||||
if (!info)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (mode_cmd->width * info->cpp[0] != mode_cmd->pitches[0]) {
|
||||
dev_dbg(dev->dev, "Invalid pitch: fb width must match pitch\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file_priv, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file_priv, info, mode_cmd);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = {
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@ nouveau_framebuffer_new(struct drm_device *dev,
|
|||
struct drm_framebuffer *
|
||||
nouveau_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_framebuffer *fb;
|
||||
|
|
|
|||
|
|
@ -67,5 +67,6 @@ nouveau_framebuffer_get_layout(struct drm_framebuffer *fb, uint32_t *tile_mode,
|
|||
|
||||
struct drm_framebuffer *
|
||||
nouveau_user_framebuffer_create(struct drm_device *, struct drm_file *,
|
||||
const struct drm_format_info *,
|
||||
const struct drm_mode_fb_cmd2 *);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -335,11 +335,9 @@ void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
|
|||
#endif
|
||||
|
||||
struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
struct drm_file *file, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(dev,
|
||||
mode_cmd->pixel_format,
|
||||
mode_cmd->modifier[0]);
|
||||
unsigned int num_planes = info->num_planes;
|
||||
struct drm_gem_object *bos[4];
|
||||
struct drm_framebuffer *fb;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ struct omap_overlay_info;
|
|||
struct seq_file;
|
||||
|
||||
struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
struct drm_file *file, const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
|
||||
int omap_framebuffer_pin(struct drm_framebuffer *fb);
|
||||
|
|
|
|||
|
|
@ -1176,6 +1176,7 @@ err_drm_connector_cleanup:
|
|||
static struct drm_framebuffer *
|
||||
qxl_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
return drm_gem_fb_create_with_funcs(dev, file_priv, mode_cmd,
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,7 @@ radeon_framebuffer_init(struct drm_device *dev,
|
|||
static struct drm_framebuffer *
|
||||
radeon_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_gem_object *obj;
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev,
|
|||
|
||||
static struct drm_framebuffer *
|
||||
rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct rcar_du_device *rcdu = to_rcar_du_device(dev);
|
||||
|
|
@ -490,7 +491,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||
}
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file_priv, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file_priv, info, mode_cmd);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ int rzg2l_du_dumb_create(struct drm_file *file, struct drm_device *dev,
|
|||
|
||||
static struct drm_framebuffer *
|
||||
rzg2l_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct rzg2l_du_format_info *format;
|
||||
|
|
@ -214,7 +215,7 @@ rzg2l_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file_priv, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file_priv, info, mode_cmd);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ const struct shmob_drm_format_info *shmob_drm_format_info(u32 fourcc)
|
|||
|
||||
static struct drm_framebuffer *
|
||||
shmob_drm_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
const struct shmob_drm_format_info *format;
|
||||
|
|
@ -144,7 +145,7 @@ shmob_drm_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||
}
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file_priv, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file_priv, info, mode_cmd);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs shmob_drm_mode_config_funcs = {
|
||||
|
|
|
|||
|
|
@ -30,17 +30,12 @@ static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers =
|
|||
|
||||
static struct drm_framebuffer *
|
||||
rockchip_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_afbc_framebuffer *afbc_fb;
|
||||
const struct drm_format_info *info;
|
||||
int ret;
|
||||
|
||||
info = drm_get_format_info(dev, mode_cmd->pixel_format,
|
||||
mode_cmd->modifier[0]);
|
||||
if (!info)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
afbc_fb = kzalloc(sizeof(*afbc_fb), GFP_KERNEL);
|
||||
if (!afbc_fb)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm,
|
|||
unsigned int num_planes);
|
||||
struct drm_framebuffer *tegra_fb_create(struct drm_device *drm,
|
||||
struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *cmd);
|
||||
|
||||
#ifdef CONFIG_DRM_FBDEV_EMULATION
|
||||
|
|
|
|||
|
|
@ -132,11 +132,9 @@ struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm,
|
|||
|
||||
struct drm_framebuffer *tegra_fb_create(struct drm_device *drm,
|
||||
struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *cmd)
|
||||
{
|
||||
const struct drm_format_info *info = drm_get_format_info(drm,
|
||||
cmd->pixel_format,
|
||||
cmd->modifier[0]);
|
||||
struct tegra_bo *planes[4];
|
||||
struct drm_gem_object *gem;
|
||||
struct drm_framebuffer *fb;
|
||||
|
|
|
|||
|
|
@ -363,6 +363,7 @@ struct drm_framebuffer_test_priv {
|
|||
|
||||
static struct drm_framebuffer *fb_create_mock(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_framebuffer_test_priv *priv = container_of(dev, typeof(*priv), dev);
|
||||
|
|
|
|||
|
|
@ -530,6 +530,7 @@ static int vc4_atomic_commit_setup(struct drm_atomic_state *state)
|
|||
|
||||
static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
|
|
@ -568,7 +569,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev,
|
|||
mode_cmd = &mode_cmd_local;
|
||||
}
|
||||
|
||||
return drm_gem_fb_create(dev, file_priv, mode_cmd);
|
||||
return drm_gem_fb_create(dev, file_priv, info, mode_cmd);
|
||||
}
|
||||
|
||||
/* Our CTM has some peculiar limitations: we can only enable it for one CRTC
|
||||
|
|
|
|||
|
|
@ -293,6 +293,7 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
|
|||
static struct drm_framebuffer *
|
||||
virtio_gpu_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_gem_object *obj = NULL;
|
||||
|
|
|
|||
|
|
@ -712,6 +712,7 @@ vmw_kms_new_framebuffer(struct vmw_private *dev_priv,
|
|||
|
||||
static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct vmw_private *dev_priv = vmw_priv(dev);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ static const struct drm_framebuffer_funcs fb_funcs = {
|
|||
|
||||
static struct drm_framebuffer *
|
||||
fb_create(struct drm_device *dev, struct drm_file *filp,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct xen_drm_front_drm_info *drm_info = dev->dev_private;
|
||||
|
|
|
|||
|
|
@ -373,6 +373,7 @@ static int zynqmp_dpsub_dumb_create(struct drm_file *file_priv,
|
|||
|
||||
static struct drm_framebuffer *
|
||||
zynqmp_dpsub_fb_create(struct drm_device *drm, struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm);
|
||||
|
|
@ -383,7 +384,7 @@ zynqmp_dpsub_fb_create(struct drm_device *drm, struct drm_file *file_priv,
|
|||
for (i = 0; i < ARRAY_SIZE(cmd.pitches); ++i)
|
||||
cmd.pitches[i] = ALIGN(cmd.pitches[i], dpsub->dma_align);
|
||||
|
||||
return drm_gem_fb_create(drm, file_priv, &cmd);
|
||||
return drm_gem_fb_create(drm, file_priv, info, &cmd);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs zynqmp_dpsub_mode_config_funcs = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ struct drm_afbc_framebuffer;
|
|||
struct drm_device;
|
||||
struct drm_fb_helper_surface_size;
|
||||
struct drm_file;
|
||||
struct drm_format_info;
|
||||
struct drm_framebuffer;
|
||||
struct drm_framebuffer_funcs;
|
||||
struct drm_gem_object;
|
||||
|
|
@ -32,9 +33,11 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file,
|
|||
const struct drm_framebuffer_funcs *funcs);
|
||||
struct drm_framebuffer *
|
||||
drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
struct drm_framebuffer *
|
||||
drm_gem_fb_create_with_dirty(struct drm_device *dev, struct drm_file *file,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
|
||||
int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map,
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ struct drm_mode_config_funcs {
|
|||
*/
|
||||
struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
const struct drm_format_info *info,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue