Commit 88f19f8b authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/simpledrm: Set preferred depth from format of scanout buffer

Set the preferred depth from the format of the scanout buffer. The
value cannot be hardcoded, as the scanout buffer is only known at
runtime. Also derive the fbdev emulation's bpp value from the scanout
format.

v2:
	* fix commit-message typo
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20221123115348.2521-6-tzimmermann@suse.de
parent 5580f263
...@@ -739,7 +739,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, ...@@ -739,7 +739,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
dev->mode_config.max_width = max_width; dev->mode_config.max_width = max_width;
dev->mode_config.min_height = height; dev->mode_config.min_height = height;
dev->mode_config.max_height = max_height; dev->mode_config.max_height = max_height;
dev->mode_config.preferred_depth = format->cpp[0] * 8; dev->mode_config.preferred_depth = format->depth;
dev->mode_config.funcs = &simpledrm_mode_config_funcs; dev->mode_config.funcs = &simpledrm_mode_config_funcs;
/* Primary plane */ /* Primary plane */
...@@ -834,7 +834,7 @@ static int simpledrm_probe(struct platform_device *pdev) ...@@ -834,7 +834,7 @@ static int simpledrm_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
drm_fbdev_generic_setup(dev, 0); drm_fbdev_generic_setup(dev, drm_format_info_bpp(sdev->format, 0));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment