diff options
| author | Louis Chauvet <louis.chauvet@bootlin.com> | 2024-09-05 15:27:06 +0200 |
|---|---|---|
| committer | Maíra Canal <mcanal@igalia.com> | 2024-09-24 20:37:40 -0300 |
| commit | 6e5eb6dcb3042adcda432a3498d0d62d91588c4d (patch) | |
| tree | fa9a2ee8ede55794634d6f6ba52475ea531c1c11 /drivers/gpu/drm/vkms/vkms_output.c | |
| parent | 80fd814e93f10fe60d02d8a31c46718ff9e9edec (diff) | |
drm/vkms: Add documentation
Add documentation around vkms_output and its initialization.
Add some documentation on pixel conversion functions.
Update of outdated comments for pixel_write functions.
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240905-google-clarifications-v4-1-e43c1f2e3d87@bootlin.com
Diffstat (limited to 'drivers/gpu/drm/vkms/vkms_output.c')
| -rw-r--r-- | drivers/gpu/drm/vkms/vkms_output.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 5ce70dd946aa..0a5a185aa0b0 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -21,6 +21,7 @@ static int vkms_conn_get_modes(struct drm_connector *connector) { int count; + /* Use the default modes list from DRM */ count = drm_add_modes_noedid(connector, XRES_MAX, YRES_MAX); drm_set_preferred_mode(connector, XRES_DEF, YRES_DEF); @@ -58,6 +59,12 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) int writeback; unsigned int n; + /* + * Initialize used plane. One primary plane is required to perform the composition. + * + * The overlay and cursor planes are not mandatory, but can be used to perform complex + * composition. + */ primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index); if (IS_ERR(primary)) return PTR_ERR(primary); @@ -76,6 +83,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) return PTR_ERR(cursor); } + /* [1]: Allocation of a CRTC, its index will be BIT(0) = 1 */ ret = vkms_crtc_init(dev, crtc, &primary->base, &cursor->base); if (ret) return ret; @@ -95,7 +103,11 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) DRM_ERROR("Failed to init encoder\n"); goto err_encoder; } - encoder->possible_crtcs = 1; + /* + * This is a hardcoded value to select crtc for the encoder. + * BIT(0) here designate the first registered CRTC, the one allocated in [1] + */ + encoder->possible_crtcs = BIT(0); ret = drm_connector_attach_encoder(connector, encoder); if (ret) { |
