Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/virtgpu: Run DRM default client setup

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 virtgpu 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 <tzimmermann@suse.de>
Cc: David Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-62-tzimmermann@suse.de

+6 -1
+1
drivers/gpu/drm/virtio/Kconfig
··· 3 3 tristate "Virtio GPU driver" 4 4 depends on DRM && VIRTIO_MENU && MMU 5 5 select VIRTIO 6 + select DRM_CLIENT_SELECTION 6 7 select DRM_KMS_HELPER 7 8 select DRM_GEM_SHMEM_HELPER 8 9 select VIRTIO_DMA_SHARED_BUFFER
+5 -1
drivers/gpu/drm/virtio/virtgpu_drv.c
··· 34 34 #include <drm/drm.h> 35 35 #include <drm/drm_aperture.h> 36 36 #include <drm/drm_atomic_helper.h> 37 + #include <drm/drm_client_setup.h> 37 38 #include <drm/drm_drv.h> 38 39 #include <drm/drm_fbdev_shmem.h> 39 40 #include <drm/drm_file.h> ··· 104 103 if (ret) 105 104 goto err_deinit; 106 105 107 - drm_fbdev_shmem_setup(vdev->priv, 32); 106 + drm_client_setup(vdev->priv, NULL); 107 + 108 108 return 0; 109 109 110 110 err_deinit: ··· 185 183 186 184 .dumb_create = virtio_gpu_mode_dumb_create, 187 185 .dumb_map_offset = virtio_gpu_mode_dumb_mmap, 186 + 187 + DRM_FBDEV_SHMEM_DRIVER_OPS, 188 188 189 189 #if defined(CONFIG_DEBUG_FS) 190 190 .debugfs_init = virtio_gpu_debugfs_init,