diff options
| author | Ville Syrjälä <[email protected]> | 2025-07-01 09:07:05 +0000 |
|---|---|---|
| committer | Ville Syrjälä <[email protected]> | 2025-07-16 17:01:13 +0000 |
| commit | 0e7d5874fb6b80c44be3cfbcf1cf356e81d91232 (patch) | |
| tree | 2da2214e0f213a01d25b78d0e482f793ae016040 /drivers/gpu/drm/omapdrm/omap_fb.c | |
| parent | drm: Pass pixel_format+modifier to .get_format_info() (diff) | |
| download | kernel-0e7d5874fb6b80c44be3cfbcf1cf356e81d91232.tar.gz kernel-0e7d5874fb6b80c44be3cfbcf1cf356e81d91232.zip | |
drm: Pass pixel_format+modifier directly to drm_get_format_info()
Decouple drm_get_format_info() from struct drm_mode_fb_cmd2 and just
pass the pixel format+modifier combo in by hand.
We may want to use drm_get_format_info() outside of the normal
addfb paths where we won't have a struct drm_mode_fb_cmd2, and
creating a temporary one just for this seems silly.
Done with cocci:
@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd
+ u32 pixel_format, u64 modifier
)
{
<...
(
- mode_cmd->pixel_format
+ pixel_format
|
- mode_cmd->modifier[0]
+ modifier
)
...>
}
@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd
+ u32 pixel_format, u64 modifier
);
@@
expression dev, mode_cmd;
@@
- drm_get_format_info(dev, mode_cmd)
+ drm_get_format_info(dev, mode_cmd->pixel_format, mode_cmd->modifier[0])
v2: Fix kernel docs (Laurent)
Drop drm_mode_fb_cmd2 forward declaration (Thomas)
Cc: Liviu Dudau <[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: Alex Deucher <[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: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Acked-by: Alex Deucher <[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.c')
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 449d521c78fe..e18878068c57 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -338,7 +338,8 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd) { const struct drm_format_info *info = drm_get_format_info(dev, - mode_cmd); + 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; @@ -378,7 +379,8 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, dev, mode_cmd, mode_cmd->width, mode_cmd->height, (char *)&mode_cmd->pixel_format); - format = drm_get_format_info(dev, mode_cmd); + format = drm_get_format_info(dev, mode_cmd->pixel_format, + mode_cmd->modifier[0]); for (i = 0; i < ARRAY_SIZE(formats); i++) { if (formats[i] == mode_cmd->pixel_format) |
