Skip to content

Add new formats support to vkms

Igor Torrente dri-devel 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest9 patches 1 replyIn review
  2. v6 posting 2/29 patches 11 repliesSuperseded
  3. v6 posting 1/29 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v59 patches34 repliesSuperseded
v49 patches21 repliesSuperseded
v39 patches2 repliesSuperseded
v2 posting 2/28 patches18 repliesSuperseded
v2 posting 1/25 of 8 patches0 repliesSuperseded
v16 patches17 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9drm: vkms: Replace hardcoded value of `vkms_composer.map` to DRM_FORMAT_MAX_PLANESdrivers/gpu/drm/vkms/vkms_drv.h+1 -10 replies
2/9drm: vkms: Rename `vkms_composer` to `vkms_frame_info`drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_plane.c+66 -650 replies
3/9drm: drm_atomic_helper: Add a new helper to deal with the writeback connector validationdrivers/gpu/drm/drm_atomic_helper.c drivers/gpu/drm/vkms/vkms_writeback.c include/drm/drm_atomic_helper.h+46 -50 replies
4/9drm: vkms: get the reference to `drm_framebuffer` instead if coping itdrivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_plane.c+8 -80 replies
5/9drm: vkms: Add fb information to `vkms_writeback_job`drivers/gpu/drm/vkms/vkms_drv.h drivers/gpu/drm/vkms/vkms_writeback.c+35 -80 replies
6/9drm: vkms: Refactor the plane composer to accept new formatsDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/Makefile drivers/gpu/drm/vkms/vkms_composer.c +4 more+318 -1820 replies
7/9drm: vkms: Supports to the case where primary plane doesn't match the CRTCDocumentation/gpu/vkms.rst drivers/gpu/drm/vkms/vkms_composer.c drivers/gpu/drm/vkms/vkms_writeback.c+33 -330 replies
8/9drm: vkms: Adds XRGB_16161616 and ARGB_1616161616 formatsdrivers/gpu/drm/vkms/vkms_formats.c drivers/gpu/drm/vkms/vkms_plane.c drivers/gpu/drm/vkms/vkms_writeback.c+83 -10 replies
9/9drm: vkms: Add support to the RGB565 formatdrivers/gpu/drm/vkms/vkms_formats.c drivers/gpu/drm/vkms/vkms_plane.c drivers/gpu/drm/vkms/vkms_writeback.c+76 -30 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchThomas ZimmermannMelissa Wen
1/9A-b R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/9] Add new formats support to vkms

Summary
=======
This series of patches refactor some vkms components in order to introduce new formats to the planes and writeback connector.

Now in the blend function, the plane's pixels are converted to ARGB16161616 and then blended together.

The CRC is calculated based on the ARGB1616161616 buffer. And if required, this buffer is copied/converted to the writeback buffer format.

And to handle the pixel conversion, new functions were added to convert from a specific format to ARGB16161616 (the reciprocal is also true).

Tests
=====
This patch series was tested using the following igt tests:
-t ".*kms_plane.*"
-t ".*kms_writeback.*"
-t ".*kms_cursor_crc*"
-t ".*kms_flip.*"

New tests passing
-------------------
- pipe-A-cursor-size-change
- pipe-A-cursor-alpha-transparent

Performance
-----------
It's running slightly faster than the current implementation.

Results running the IGT[1] test igt@kms_cursor_crc@pipe-a-cursor-512x512-onscreen ten times:

|                  Frametime                   |
|:--------------------------------------------:|
|  Implementation |  Current  |   This commit  |
|:---------------:|:---------:|:--------------:|
| frametime range |  9~22 ms  |     10~22 ms   |
|     Average     |  11.4 ms  |     12.32 ms   |

Memory consumption
==================
It consumes less memory than the current implementation in the common case (more detail in the commit message).

| Memory consumption (output dimensions) |
|:--------------------------------------:|
|       Current      |     This patch    |
|:------------------:|:-----------------:|
|   Width * Heigth   |     2 * Width     |

[1] IGT commit id: bc3f6833a12221a46659535dac06ebb312490eb4

XRGB to ARGB behavior
=====================
During the development, I decided to always fill the alpha channel of the output pixel whenever the conversion from a format without an alpha channel to ARGB16161616 is necessary. Therefore, I ignore the value received from the XRGB and overwrite the value with 0xFFFF.

Primary plane and CRTC size
===========================
This patch series reworks the blend function to accept a primary plane with a different size and position from CRTC.
Because now we need to fill the background, we had a loss in performance with this change

Alpha channel output for XRGB formats
=====================================
There's still an open question about which value the writeback alpha channel should be for XRGB formats.
The current igt test implementation is expecting the channel to not be change. But it's not entirely clear if this should be the behavior followed by vkms (or any other driver).

Open issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/118
---
Igor Torrente (9):
drm: vkms: Replace hardcoded value of vkms_composer.map to
DRM_FORMAT_MAX_PLANES
drm: vkms: Rename vkms_composer to vkms_frame_info
drm: drm_atomic_helper: Add a new helper to deal with the writeback
connector validation
drm: vkms: get the reference to drm_framebuffer instead if coping it
drm: vkms: Add fb information to vkms_writeback_job
drm: vkms: Refactor the plane composer to accept new formats
drm: vkms: Supports to the case where primary plane doesn't match the
CRTC
drm: vkms: Adds XRGB_16161616 and ARGB_1616161616 formats
drm: vkms: Add support to the RGB565 format

 Documentation/gpu/vkms.rst            |   7 +-
 drivers/gpu/drm/drm_atomic_helper.c   |  39 ++++
 drivers/gpu/drm/vkms/Makefile         |   1 +
 drivers/gpu/drm/vkms/vkms_composer.c  | 314 ++++++++++++--------------
 drivers/gpu/drm/vkms/vkms_drv.h       |  33 ++-
 drivers/gpu/drm/vkms/vkms_formats.c   | 302 +++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_formats.h   |  12 +
 drivers/gpu/drm/vkms/vkms_plane.c     |  50 ++--
 drivers/gpu/drm/vkms/vkms_writeback.c |  39 +++-
 include/drm/drm_atomic_helper.h       |   3 +
 10 files changed, 580 insertions(+), 220 deletions(-)
 create mode 100644 drivers/gpu/drm/vkms/vkms_formats.c
 create mode 100644 drivers/gpu/drm/vkms/vkms_formats.h
Signature · 1 line
2.30.2