Commit 6f9f15e6 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/logicvc: Fix preferred fbdev cpp

Logicvc can have different values for the preferred color depth. Set
the fbdev bpp value depending on the runtime value.

v2:
	* remove unused color depth of 15 from switch (Javier)
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-3-tzimmermann@suse.de
parent 53225f30
...@@ -301,6 +301,7 @@ static int logicvc_drm_probe(struct platform_device *pdev) ...@@ -301,6 +301,7 @@ static int logicvc_drm_probe(struct platform_device *pdev)
struct regmap *regmap = NULL; struct regmap *regmap = NULL;
struct resource res; struct resource res;
void __iomem *base; void __iomem *base;
unsigned int preferred_bpp;
int irq; int irq;
int ret; int ret;
...@@ -438,7 +439,17 @@ static int logicvc_drm_probe(struct platform_device *pdev) ...@@ -438,7 +439,17 @@ static int logicvc_drm_probe(struct platform_device *pdev)
goto error_mode; goto error_mode;
} }
drm_fbdev_generic_setup(drm_dev, drm_dev->mode_config.preferred_depth); switch (drm_dev->mode_config.preferred_depth) {
case 16:
preferred_bpp = 16;
break;
case 24:
case 32:
default:
preferred_bpp = 32;
break;
}
drm_fbdev_generic_setup(drm_dev, preferred_bpp);
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