diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2022-11-23 14:53:43 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2022-11-24 16:07:52 +0300 |
commit | 6f9f15e63de607ffbe621d33e8c8d49481e1e845 (patch) | |
tree | 74db6d9311f56ddf38bf8afce08434c27cefecb2 /drivers/gpu/drm/logicvc | |
parent | 53225f30fa5db4bafbb3e662725a5b3a8121ba8d (diff) | |
download | linux-6f9f15e63de607ffbe621d33e8c8d49481e1e845.tar.xz |
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: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20221123115348.2521-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/logicvc')
-rw-r--r-- | drivers/gpu/drm/logicvc/logicvc_drm.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c index 9de24d9f0c96..2fb23697740a 100644 --- a/drivers/gpu/drm/logicvc/logicvc_drm.c +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c @@ -301,6 +301,7 @@ static int logicvc_drm_probe(struct platform_device *pdev) struct regmap *regmap = NULL; struct resource res; void __iomem *base; + unsigned int preferred_bpp; int irq; int ret; @@ -438,7 +439,17 @@ static int logicvc_drm_probe(struct platform_device *pdev) 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; |