Skip to content

Commit d26e853

Browse files
committed
drm/exynos: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
Plumb the format info from .fb_create() all the way to drm_helper_mode_fill_fb_struct() to avoid the redundant lookup. For the fbdev case a manual drm_get_format_info() lookup is needed. Cc: Inki Dae <[email protected]> Cc: Seung-Woo Kim <[email protected]> Cc: Kyungmin Park <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 797f8fc commit d26e853

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

drivers/gpu/drm/exynos/exynos_drm_fb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ static const struct drm_framebuffer_funcs exynos_drm_fb_funcs = {
5656

5757
struct drm_framebuffer *
5858
exynos_drm_framebuffer_init(struct drm_device *dev,
59+
const struct drm_format_info *info,
5960
const struct drm_mode_fb_cmd2 *mode_cmd,
6061
struct exynos_drm_gem **exynos_gem,
6162
int count)
@@ -76,7 +77,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
7677
fb->obj[i] = &exynos_gem[i]->base;
7778
}
7879

79-
drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
80+
drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
8081

8182
ret = drm_framebuffer_init(dev, fb, &exynos_drm_fb_funcs);
8283
if (ret < 0) {
@@ -124,7 +125,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
124125
}
125126
}
126127

127-
fb = exynos_drm_framebuffer_init(dev, mode_cmd, exynos_gem, i);
128+
fb = exynos_drm_framebuffer_init(dev, info, mode_cmd, exynos_gem, i);
128129
if (IS_ERR(fb)) {
129130
ret = PTR_ERR(fb);
130131
goto err;

drivers/gpu/drm/exynos/exynos_drm_fb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
struct drm_framebuffer *
1616
exynos_drm_framebuffer_init(struct drm_device *dev,
17+
const struct drm_format_info *info,
1718
const struct drm_mode_fb_cmd2 *mode_cmd,
1819
struct exynos_drm_gem **exynos_gem,
1920
int count);

drivers/gpu/drm/exynos/exynos_drm_fbdev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ int exynos_drm_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
116116
return PTR_ERR(exynos_gem);
117117

118118
helper->fb =
119-
exynos_drm_framebuffer_init(dev, &mode_cmd, &exynos_gem, 1);
119+
exynos_drm_framebuffer_init(dev,
120+
drm_get_format_info(dev, mode_cmd.pixel_format,
121+
mode_cmd.modifier[0]),
122+
&mode_cmd, &exynos_gem, 1);
120123
if (IS_ERR(helper->fb)) {
121124
DRM_DEV_ERROR(dev->dev, "failed to create drm framebuffer.\n");
122125
ret = PTR_ERR(helper->fb);

0 commit comments

Comments
 (0)