Commit df2d385c authored by José Expósito's avatar José Expósito Committed by Melissa Wen

drm/vkms: add support for multiple overlay planes

Create 8 overlay planes instead of 1 when the "enable_overlay" module
parameter is set.

The following igt-gpu-tools tests were executed without finding
regressions. Notice than the numbers are identical:

                    |     master branch     |      this  patch      |
                    | SUCCESS | SKIP | FAIL | SUCCESS | SKIP | FAIL |
 kms_atomic         |      10 |   02 |   00 |      10 |   02 |   00 |
 kms_plane_cursor   |      09 |   45 |   00 |      09 |   45 |   00 |
 kms_plane_multiple |      01 |   23 |   00 |      01 |   23 |   00 |
 kms_writeback      |      04 |   00 |   00 |      04 |   00 |   00 |
Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107182809.141003-2-jose.exposito89@gmail.com
parent 5edaa2b9
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#define XRES_MAX 8192 #define XRES_MAX 8192
#define YRES_MAX 8192 #define YRES_MAX 8192
#define NUM_OVERLAY_PLANES 8
struct vkms_writeback_job { struct vkms_writeback_job {
struct dma_buf_map map[DRM_FORMAT_MAX_PLANES]; struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
struct dma_buf_map data[DRM_FORMAT_MAX_PLANES]; struct dma_buf_map data[DRM_FORMAT_MAX_PLANES];
......
...@@ -57,16 +57,19 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) ...@@ -57,16 +57,19 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
struct vkms_plane *primary, *cursor = NULL; struct vkms_plane *primary, *cursor = NULL;
int ret; int ret;
int writeback; int writeback;
unsigned int n;
primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index); primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index);
if (IS_ERR(primary)) if (IS_ERR(primary))
return PTR_ERR(primary); return PTR_ERR(primary);
if (vkmsdev->config->overlay) { if (vkmsdev->config->overlay) {
for (n = 0; n < NUM_OVERLAY_PLANES; n++) {
ret = vkms_add_overlay_plane(vkmsdev, index, crtc); ret = vkms_add_overlay_plane(vkmsdev, index, crtc);
if (ret) if (ret)
return ret; return ret;
} }
}
if (vkmsdev->config->cursor) { if (vkmsdev->config->cursor) {
cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR, index); cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR, index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment