@@ -99,6 +99,7 @@ static int vkms_config_show(struct seq_file *m, void *data)
seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback);
seq_printf(m, "cursor=%d\n", vkmsdev->config->cursor);
seq_printf(m, "overlay=%d\n", vkmsdev->config->overlay);
+ seq_printf(m, "overlay_planes=%d\n", vkmsdev->config->overlay_planes);
return 0;
}
@@ -230,6 +231,7 @@ static int __init vkms_init(void)
config->cursor = enable_cursor;
config->writeback = enable_writeback;
config->overlay = enable_overlay;
+ config->overlay_planes = NUM_OVERLAY_PLANES;
ret = vkms_create(config);
if (ret)
@@ -112,6 +112,7 @@ struct vkms_config {
bool writeback;
bool cursor;
bool overlay;
+ unsigned int overlay_planes;
/* only set when instantiated */
struct vkms_device *dev;
};
@@ -63,7 +63,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
return PTR_ERR(primary);
if (vkmsdev->config->overlay) {
- for (n = 0; n < NUM_OVERLAY_PLANES; n++) {
+ for (n = 0; n < vkmsdev->config->overlay_planes; n++) {
ret = vkms_add_overlay_plane(vkmsdev, index, crtc);
if (ret)
return ret;
And init it by default to NUM_OVERLAY_PLANES. This change would allow us to configure the amount of overlay planes we can have in combination with multiple pipes, in case we'll exceed the number of planes we can have. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ drivers/gpu/drm/vkms/vkms_drv.h | 1 + drivers/gpu/drm/vkms/vkms_output.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-)