brintos

brintos / linux-shallow public Read only

0
0
Text · 6.5 KiB · ba04ac7 Raw
196 lines · plain
1.. _vkms:2 3==========================================4 drm/vkms Virtual Kernel Modesetting5==========================================6 7.. kernel-doc:: drivers/gpu/drm/vkms/vkms_drv.c8   :doc: vkms (Virtual Kernel Modesetting)9 10Setup11=====12 13The VKMS driver can be setup with the following steps:14 15To check if VKMS is loaded, run::16 17  lsmod | grep vkms18 19This should list the VKMS driver. If no output is obtained, then20you need to enable and/or load the VKMS driver.21Ensure that the VKMS driver has been set as a loadable module in your22kernel config file. Do::23 24  make nconfig25 26  Go to `Device Drivers> Graphics support`27 28  Enable `Virtual KMS (EXPERIMENTAL)`29 30Compile and build the kernel for the changes to get reflected.31Now, to load the driver, use::32 33  sudo modprobe vkms34 35On running the lsmod command now, the VKMS driver will appear listed.36You can also observe the driver being loaded in the dmesg logs.37 38The VKMS driver has optional features to simulate different kinds of hardware,39which are exposed as module options. You can use the `modinfo` command40to see the module options for vkms::41 42  modinfo vkms43 44Module options are helpful when testing, and enabling modules45can be done while loading vkms. For example, to load vkms with cursor enabled,46use::47 48  sudo modprobe vkms enable_cursor=149 50To disable the driver, use ::51 52  sudo modprobe -r vkms53 54Testing With IGT55================56 57The IGT GPU Tools is a test suite used specifically for debugging and58development of the DRM drivers.59The IGT Tools can be installed from60`here <https://gitlab.freedesktop.org/drm/igt-gpu-tools>`_ .61 62The tests need to be run without a compositor, so you need to switch to text63only mode. You can do this by::64 65  sudo systemctl isolate multi-user.target66 67To return to graphical mode, do::68 69  sudo systemctl isolate graphical.target70 71Once you are in text only mode, you can run tests using the --device switch72or IGT_DEVICE variable to specify the device filter for the driver we want73to test. IGT_DEVICE can also be used with the run-test.sh script to run the74tests for a specific driver::75 76  sudo ./build/tests/<name of test> --device "sys:/sys/devices/platform/vkms"77  sudo IGT_DEVICE="sys:/sys/devices/platform/vkms" ./build/tests/<name of test>78  sudo IGT_DEVICE="sys:/sys/devices/platform/vkms" ./scripts/run-tests.sh -t <name of test>79 80For example, to test the functionality of the writeback library,81we can run the kms_writeback test::82 83  sudo ./build/tests/kms_writeback --device "sys:/sys/devices/platform/vkms"84  sudo IGT_DEVICE="sys:/sys/devices/platform/vkms" ./build/tests/kms_writeback85  sudo IGT_DEVICE="sys:/sys/devices/platform/vkms" ./scripts/run-tests.sh -t kms_writeback86 87You can also run subtests if you do not want to run the entire test::88 89  sudo ./build/tests/kms_flip --run-subtest basic-plain-flip --device "sys:/sys/devices/platform/vkms"90  sudo IGT_DEVICE="sys:/sys/devices/platform/vkms" ./build/tests/kms_flip --run-subtest basic-plain-flip91 92TODO93====94 95If you want to do any of the items listed below, please share your interest96with VKMS maintainers.97 98IGT better support99------------------100 101Debugging:102 103- kms_plane: some test cases are failing due to timeout on capturing CRC;104 105Virtual hardware (vblank-less) mode:106 107- VKMS already has support for vblanks simulated via hrtimers, which can be108  tested with kms_flip test; in some way, we can say that VKMS already mimics109  the real hardware vblank. However, we also have virtual hardware that does110  not support vblank interrupt and completes page_flip events right away; in111  this case, compositor developers may end up creating a busy loop on virtual112  hardware. It would be useful to support Virtual Hardware behavior in VKMS113  because this can help compositor developers to test their features in114  multiple scenarios.115 116Add Plane Features117------------------118 119There's lots of plane features we could add support for:120 121- Add background color KMS property[Good to get started].122 123- Scaling.124 125- Additional buffer formats, especially YUV formats for video like NV12.126  Low/high bpp RGB formats would also be interesting.127 128- Async updates (currently only possible on cursor plane using the legacy129  cursor api).130 131For all of these, we also want to review the igt test coverage and make sure132all relevant igt testcases work on vkms. They are good options for internship133project.134 135Runtime Configuration136---------------------137 138We want to be able to reconfigure vkms instance without having to reload the139module. Use/Test-cases:140 141- Hotplug/hotremove connectors on the fly (to be able to test DP MST handling142  of compositors).143 144- Configure planes/crtcs/connectors (we'd need some code to have more than 1 of145  them first).146 147- Change output configuration: Plug/unplug screens, change EDID, allow changing148  the refresh rate.149 150The currently proposed solution is to expose vkms configuration through151configfs. All existing module options should be supported through configfs152too.153 154Writeback support155-----------------156 157- The writeback and CRC capture operations share the use of composer_enabled158  boolean to ensure vblanks. Probably, when these operations work together,159  composer_enabled needs to refcounting the composer state to proper work.160  [Good to get started]161 162- Add support for cloned writeback outputs and related test cases using a163  cloned output in the IGT kms_writeback.164 165- As a v4l device. This is useful for debugging compositors on special vkms166  configurations, so that developers see what's really going on.167 168Output Features169---------------170 171- Variable refresh rate/freesync support. This probably needs prime buffer172  sharing support, so that we can use vgem fences to simulate rendering in173  testing. Also needs support to specify the EDID.174 175- Add support for link status, so that compositors can validate their runtime176  fallbacks when e.g. a Display Port link goes bad.177 178CRC API Improvements179--------------------180 181- Optimize CRC computation ``compute_crc()`` and plane blending ``blend()``182 183Atomic Check using eBPF184-----------------------185 186Atomic drivers have lots of restrictions which are not exposed to userspace in187any explicit form through e.g. possible property values. Userspace can only188inquiry about these limits through the atomic IOCTL, possibly using the189TEST_ONLY flag. Trying to add configurable code for all these limits, to allow190compositors to be tested against them, would be rather futile exercise. Instead191we could add support for eBPF to validate any kind of atomic state, and192implement a library of different restrictions.193 194This needs a bunch of features (plane compositing, multiple outputs, ...)195enabled already to make sense.196