Interest in Contributing to VKMS Development

Louis Chauvet louis.chauvet at bootlin.com
Sun Dec 1 05:36:53 UTC 2024


+Cc: dri-devel at lists.freedesktop.org 

On 30/11/24 - 13:49, Ananta Srikar Puranam wrote:
> Dear Louis Chauvet,

Hi Srikar!

> I was able to successfully compile Linux with VKMS enabled and have set up
> igt-gpu-tests in a QEMU machine. I can now run some tests successfully.

Congratulation!
 
> I have a surface-level understanding of the DRM and KMS subsystems
> (framebuffers, planes, CRTCs, encoders, and connectors) and am eager to dive
> deeper into the VKMS module and contribute.

I am very happy to see some interest in VKMS development, do you have a 
specific feature that you want to test?

> I understand VKMS helps test the DRM subsystem, but I’m struggling to fully
> grasp how the absence of visible display output aligns with its testing
> goals. Any guidance on this would be highly appreciated.

That the whole point of "V"KMS, everything is virtual, even the display 
output :)

There are two way to get some information about the output content:
- CRC compuation [1]
- Writeback connector [2]

The CRC will allows you to write a test like this:

	create_reference_image();
	ref_crc = grab_crc();

	test_procedure();
	test_crc = grab_crc();

	assert(ref_crc, test_crc);

This is used in the igt test "kms_plane" to test color conversion, they 
compute a reference CRC and then test the conversion between multiple 
formats [3].

The writeback connector is useful to grab a "screenshot" of the output, 
but it is a bit less efficient. It can be used when a simple "reference 
CRC" is not possible. 
To grab a picture from the writeback connector, you have to do something 
like this:

	setup_pipeline();
	wb_fb = create_fb();
	while (true) {
		send_fb_to_wb_connector(wb_fb);
		wait_for_picture();
		do_something_with_result(wb_fb);
	}

There is a writeback example in igt [4], but I don't know how it works.

[1]:https://elixir.bootlin.com/linux/v6.12.1/source/drivers/gpu/drm/vkms/vkms_composer.c#L209
[2]:https://elixir.bootlin.com/linux/v6.12.1/source/drivers/gpu/drm/vkms/vkms_writeback.c#L171
[3]:https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tests/kms_plane.c#L1036
[4]:https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tests/kms_writeback.c

> Additionally, I noticed the TODO item to add the plane feature (background
> color KMS property). It seems like a good starting point, and I would be
> grateful for direction on how to approach it.

I think this is the good direction, yes!

All your patches must be on top of drm-misc-next [5]. If you are not 
familiar with kernel contribution, I invite you to look at the kernel 
documentation [6] and at the amazing b4 tool [7].

For the implementation itself, I think you have to work in the function 
blend, probably around the fill_background function [8]. You also need to 
attach a BACKGROUND property on the CRTC [9]. I think you have to do it 
somewhere in crtc initialization [10].

[5]:https://gitlab.freedesktop.org/drm/misc/kernel/-/tree/drm-misc-next 
[6]:https://docs.kernel.org/process/contribution-maturity-model.html
[7]:https://b4.docs.kernel.org/
[8]:https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/vkms/vkms_composer.c#L389
[9]:https://drmdb.emersion.fr/properties/3435973836/BACKGROUND
[10]:https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/vkms/vkms_crtc.c?ref_type=heads#L273

> Thank you for your time, and I look forward to your guidance.
> 
> Best regards,
> Srikar

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the dri-devel mailing list