Re: [PATCH 5/7] drm/simpledrm: Set preferred depth from format of scanout buffer

2022-11-18 Thread Javier Martinez Canillas
On 11/16/22 17:09, Thomas Zimmermann wrote:
> Set the preferred depth from the format of the scanout buffer. The
> value cannot be hardcoded, as the scanout buffer's is only known at
> runtime. Also derive the fbdev emulations bpp value from the scanout
> format.
> 
> Signed-off-by: Thomas Zimmermann 
> ---

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



[PATCH 5/7] drm/simpledrm: Set preferred depth from format of scanout buffer

2022-11-16 Thread Thomas Zimmermann
Set the preferred depth from the format of the scanout buffer. The
value cannot be hardcoded, as the scanout buffer's is only known at
runtime. Also derive the fbdev emulations bpp value from the scanout
format.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/tiny/simpledrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 162eb44dcba89..30e928d627e8f 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -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.min_height = 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 = _mode_config_funcs;
 
/* Primary plane */
@@ -834,7 +834,7 @@ static int simpledrm_probe(struct platform_device *pdev)
if (ret)
return ret;
 
-   drm_fbdev_generic_setup(dev, 0);
+   drm_fbdev_generic_setup(dev, drm_format_info_bpp(sdev->format, 0));
 
return 0;
 }
-- 
2.38.1