Call drm_client_setup() to run the kernel's default client setup for DRM. Set fbdev_probe in struct drm_driver, so that the client setup can start the common fbdev client. The logicvc driver specifies a preferred color mode from the value in struct drm_mode_config. Use it to select the default format. Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx> Cc: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx> --- drivers/gpu/drm/logicvc/logicvc_drm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c index 01a37e28c080..88a978f3f088 100644 --- a/drivers/gpu/drm/logicvc/logicvc_drm.c +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c @@ -16,8 +16,10 @@ #include <linux/types.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_client_setup.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_dma.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_dma_helper.h> #include <drm/drm_print.h> @@ -55,6 +57,7 @@ static struct drm_driver logicvc_drm_driver = { .minor = 0, DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(logicvc_drm_gem_dma_dumb_create), + DRM_FBDEV_DMA_DRIVER_OPS, }; static struct regmap_config logicvc_drm_regmap_config = { @@ -301,7 +304,6 @@ 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; @@ -441,15 +443,12 @@ static int logicvc_drm_probe(struct platform_device *pdev) switch (drm_dev->mode_config.preferred_depth) { case 16: - preferred_bpp = 16; + drm_client_setup(drm_dev, drm_format_info(DRM_FORMAT_RGB565)); break; - case 24: - case 32: default: - preferred_bpp = 32; + drm_client_setup(drm_dev, NULL); break; } - drm_fbdev_dma_setup(drm_dev, preferred_bpp); return 0; -- 2.46.0