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 loongson driver specifies a preferred color mode of 32. As this
is the default if no format has been given, leave it out entirely.

v5:
- select DRM_CLIENT_SELECTION

Signed-off-by: Thomas Zimmermann <tzimmerm...@suse.de>
Cc: Sui Jingfeng <suijingf...@loongson.cn>
Acked-by: Sui Jingfeng <sui.jingf...@linux.dev>
---
 drivers/gpu/drm/loongson/Kconfig    | 1 +
 drivers/gpu/drm/loongson/lsdc_drv.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/loongson/Kconfig b/drivers/gpu/drm/loongson/Kconfig
index 9ed463a76ae2..552edfec7afb 100644
--- a/drivers/gpu/drm/loongson/Kconfig
+++ b/drivers/gpu/drm/loongson/Kconfig
@@ -4,6 +4,7 @@ config DRM_LOONGSON
        tristate "DRM support for Loongson Graphics"
        depends on DRM && PCI && MMU
        depends on LOONGARCH || MIPS || COMPILE_TEST
+       select DRM_CLIENT_SELECTION
        select DRM_KMS_HELPER
        select DRM_TTM
        select DRM_TTM_HELPER
diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c 
b/drivers/gpu/drm/loongson/lsdc_drv.c
index adc7344d2f80..a19dce35c839 100644
--- a/drivers/gpu/drm/loongson/lsdc_drv.c
+++ b/drivers/gpu/drm/loongson/lsdc_drv.c
@@ -9,6 +9,7 @@
 #include <drm/drm_aperture.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_client_setup.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fbdev_ttm.h>
 #include <drm/drm_gem_framebuffer_helper.h>
@@ -47,6 +48,7 @@ static const struct drm_driver lsdc_drm_driver = {
        .dumb_create = lsdc_dumb_create,
        .dumb_map_offset = lsdc_dumb_map_offset,
        .gem_prime_import_sg_table = lsdc_prime_import_sg_table,
+       DRM_FBDEV_TTM_DRIVER_OPS,
 };
 
 static const struct drm_mode_config_funcs lsdc_mode_config_funcs = {
@@ -314,7 +316,7 @@ static int lsdc_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        if (ret)
                return ret;
 
-       drm_fbdev_ttm_setup(ddev, 32);
+       drm_client_setup(ddev, NULL);
 
        return 0;
 }
-- 
2.46.0

Reply via email to