Commit 1e85b7d4 authored by Sumera Priyadarsini's avatar Sumera Priyadarsini Committed by Melissa Wen

drm/vkms: Add support for writeback module

Add enable_writeback feature to vkms_config as a module.
Signed-off-by: default avatarSumera Priyadarsini <sylphrenadin@gmail.com>
Reviewed-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/15802da4f1cdfed2b728c3d35731732f161dd073.1610391685.git.sylphrenadin@gmail.com
parent 2df7af93
......@@ -40,6 +40,10 @@ static bool enable_cursor = true;
module_param_named(enable_cursor, enable_cursor, bool, 0444);
MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support");
static bool enable_writeback = true;
module_param_named(enable_writeback, enable_writeback, bool, 0444);
MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback connector support");
DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
static void vkms_release(struct drm_device *dev)
......@@ -189,6 +193,7 @@ static int __init vkms_init(void)
default_config = config;
config->cursor = enable_cursor;
config->writeback = enable_writeback;
return vkms_create(config);
}
......
......@@ -83,6 +83,7 @@ struct vkms_output {
struct vkms_device;
struct vkms_config {
bool writeback;
bool cursor;
/* only set when instantiated */
struct vkms_device *dev;
......
......@@ -41,6 +41,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
struct drm_crtc *crtc = &output->crtc;
struct drm_plane *primary, *cursor = NULL;
int ret;
int writeback;
primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index);
if (IS_ERR(primary))
......@@ -80,9 +81,11 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
goto err_attach;
}
ret = vkms_enable_writeback_connector(vkmsdev);
if (ret)
DRM_ERROR("Failed to init writeback connector\n");
if (vkmsdev->config->writeback) {
writeback = vkms_enable_writeback_connector(vkmsdev);
if (writeback)
DRM_ERROR("Failed to init writeback connector\n");
}
drm_mode_config_reset(dev);
......
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