diff options
| author | Ville Syrjälä <[email protected]> | 2025-07-01 09:07:07 +0000 |
|---|---|---|
| committer | Ville Syrjälä <[email protected]> | 2025-07-16 17:03:14 +0000 |
| commit | 81112eaac559ccd451b3dce3bbb64d6b69083961 (patch) | |
| tree | ac6cf6f699b5c91f4d71857c9004016779295f0b /drivers/gpu/drm/omapdrm/omap_fb.h | |
| parent | drm: Look up the format info earlier (diff) | |
| download | kernel-81112eaac559ccd451b3dce3bbb64d6b69083961.tar.gz kernel-81112eaac559ccd451b3dce3bbb64d6b69083961.zip | |
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 <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Patrik Jakobsson <[email protected]>
Cc: Chun-Kuang Hu <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Abhinav Kumar <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Marijn Suijten <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Danilo Krummrich <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Dave Airlie <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Biju Das <[email protected]>
Cc: Sandy Huang <[email protected]>
Cc: "Heiko Stübner" <[email protected]>
Cc: Andy Yan <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Mikko Perttunen <[email protected]>
Cc: Dave Stevenson <[email protected]>
Cc: "Maíra Canal" <[email protected]>
Cc: Raspberry Pi Kernel Maintenance <[email protected]>
Cc: Dmitry Osipenko <[email protected]>
Cc: Gurchetan Singh <[email protected]>
Cc: Chia-I Wu <[email protected]>
Cc: Zack Rusin <[email protected]>
Cc: Broadcom internal kernel review list <[email protected]>
Cc: Oleksandr Andrushchenko <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Laurent Pinchart <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Acked-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.h')
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h index b75f0b5ef1d8..0873f953cf1d 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.h +++ b/drivers/gpu/drm/omapdrm/omap_fb.h @@ -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); |
