[PATCH] drm/virtio: Add option to disable KMS support

Dmitry Osipenko dmitry.osipenko at collabora.com
Sat Feb 25 15:10:18 UTC 2023


On 2/24/23 21:02, Rob Clark wrote:
>  obj-$(CONFIG_DRM_VIRTIO_GPU) += virtio-gpu.o
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
> index ae97b98750b6..9cb7d6dd3da6 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> @@ -172,7 +172,11 @@ MODULE_AUTHOR("Alon Levy");
>  DEFINE_DRM_GEM_FOPS(virtio_gpu_driver_fops);
>  
>  static const struct drm_driver driver = {
> -	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC,
> +	.driver_features =
> +#if defined(CONFIG_DRM_VIRTIO_GPU_KMS)

Could you please replace s/defined/IS_ENABLED/ and also the #ifdefs with
"if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS))" in the code? The ifdefs are
always not nice to have in the code. The IS_ENABLED usage will also make
code compile-tested regardless of the CONFIG_DRM_VIRTIO_GPU_KMS option
state.

Otherwise looks good!

-- 
Best regards,
Dmitry



More information about the dri-devel mailing list