Skip to content

RFC VKMS: Add configfs support

José Expósito dri-devel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest17 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17drm/vkms: Extract vkms_config headerdrivers/gpu/drm/vkms/Makefile drivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h +3 more+84 -370 replies
2/17drm/vkms: Move default_config creation to its own functiondrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_drv.c+21 -50 replies
3/17drm/vkms: Set device name from vkms_configdrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_drv.c +1 more+10 -41 reply
4/17drm/vkms: Allow to configure multiple CRTCsdrivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h +5 more+197 -1111 reply
5/17drm/vkms: Use managed memory to create encodersdrivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_output.c+30 -161 reply
6/17drm/vkms: Allow to configure multiple encodersdrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_output.c+73 -41 reply
7/17drm/vkms: Use managed memory to create connectorsdrivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_output.c+31 -271 reply
8/17drm/vkms: Allow to configure multiple connectorsdrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_output.c+59 -41 reply
9/17drm/vkms: Allow to configure multiple overlay planesdrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_drv.c +3 more+91 -341 reply
10/17drm/vkms: Allow to change connector statusdrivers/gpu/drm/vkms/vkms_config.c drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_output.c+47 -31 reply
11/17drm/vkms: Add and remove VKMS instances via configfsDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/Kconfig drivers/gpu/drm/vkms/Makefile +4 more+262 -41 reply
12/17drm/vkms: Allow to configure multiple CRTCs via configfsDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_configfs.c+166 -81 reply
13/17drm/vkms: Allow to configure multiple encoders via configfsDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_configfs.c+136 -81 reply
14/17drm/vkms: Allow to configure multiple encodersDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_configfs.c+188 -151 reply
15/17drm/vkms: Allow to configure multiple planes via configfsDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/vkms_config.h drivers/gpu/drm/vkms/vkms_configfs.c+136 -11 reply
16/17drm/vkms: Allow to configure the default device creationdrivers/gpu/drm/vkms/vkms_drv.c+9 -30 replies
17/17drm/vkms: Remove completed task from the TODO listDocumentation/gpu/vkms.rst+2 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/17] VKMS: Add configfs support

Hi everyone,

This RFC implements support to configure VKMS using configfs. It allows to:

- Create multiple devices
- Configure multiple overlay planes, CRTCs, encoders and connectors
- Enable or disable cursor plane and writeback connector for each CRTC
- Hot-plug/unplug connectors after device creation
- Disable the creation of the default VKMS instance to be able to use only the configfs ones

This work is based on a previous attempt to implement configfs support by Jim Shargo and Brandon Pollack [1].
I tried to keep the changes as minimal and simple as possible and addressed Sima's comments on [1].

Currently, there is another RFC by Louis Chauvet [2]. As I mentioned on his RFC, I'm not trying to push my implementation. Instead, I think that having 2 implementations will make code review way easier and I don't mind which implementation is used as long as we get the feature implemented :)

I'm looking forward to analyzing Louis's implementation, seeing what the differences are and finding a common solution.

What's missing?

- DebugFS only works for the default VKMS instance. If we want to support it on instances created with configfs I'll need to implement it.

Known bugs:

- When a CRTC is added and removed before device creation, there is a vblank warning.
The issue is caused because vblanks are referenced using the CRTC index but, because one of the CRTCs is removed, the indices are not consecutives and drm_crtc_vblank_crtc() tries to access and invalid index
I'm not sure if CRTC's indices *must* start at 0 and be consecutives or if this is a bug in the drm_crtc_vblank_crtc() implementation.

Best wishes,
José Expósito

[1] https://patchwork.kernel.org/project/dri-devel/list/?series=780110&archive=both
[2] https://lore.kernel.org/dri-devel/ZrZZFQW5RiG12ApN@louis-chauvet-laptop/T/#u

José Expósito (17):
drm/vkms: Extract vkms_config header
drm/vkms: Move default_config creation to its own function drm/vkms: Set device name from vkms_config drm/vkms: Allow to configure multiple CRTCs drm/vkms: Use managed memory to create encoders drm/vkms: Allow to configure multiple encoders drm/vkms: Use managed memory to create connectors drm/vkms: Allow to configure multiple connectors drm/vkms: Allow to configure multiple overlay planes drm/vkms: Allow to change connector status drm/vkms: Add and remove VKMS instances via configfs drm/vkms: Allow to configure multiple CRTCs via configfs drm/vkms: Allow to configure multiple encoders via configfs drm/vkms: Allow to configure multiple encoders drm/vkms: Allow to configure multiple planes via configfs drm/vkms: Allow to configure the default device creation drm/vkms: Remove completed task from the TODO list

 Documentation/gpu/vkms.rst            | 102 +++-
 drivers/gpu/drm/vkms/Kconfig          |   1 +
 drivers/gpu/drm/vkms/Makefile         |   4 +-
 drivers/gpu/drm/vkms/vkms_composer.c  |  30 +-
 drivers/gpu/drm/vkms/vkms_config.c    | 265 ++++++++++
 drivers/gpu/drm/vkms/vkms_config.h    | 101 ++++
 drivers/gpu/drm/vkms/vkms_configfs.c  | 721 ++++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_configfs.h  |   9 +
 drivers/gpu/drm/vkms/vkms_crtc.c      |  99 ++--
 drivers/gpu/drm/vkms/vkms_drv.c       |  75 ++-
 drivers/gpu/drm/vkms/vkms_drv.h       |  52 +-
 drivers/gpu/drm/vkms/vkms_output.c    | 187 ++++---
 drivers/gpu/drm/vkms/vkms_plane.c     |   6 +-
 drivers/gpu/drm/vkms/vkms_writeback.c |  27 +-
 14 files changed, 1464 insertions(+), 215 deletions(-)
 create mode 100644 drivers/gpu/drm/vkms/vkms_config.c
 create mode 100644 drivers/gpu/drm/vkms/vkms_config.h
 create mode 100644 drivers/gpu/drm/vkms/vkms_configfs.c
 create mode 100644 drivers/gpu/drm/vkms/vkms_configfs.h
Signature · 1 line
2.46.0