mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
drm/vkms: Enable/Disable cursor support with module option
Cursor support is not complete yet. Add module option 'enable_cursor' to enable/disable cursor support which is used for testing currently. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/b47f44f518d3c9858f1469193f1136e0c490060b.1536210181.git.hamohammed.sa@gmail.com
This commit is contained in:
parent
db7f419c06
commit
b8789ea71d
3 changed files with 14 additions and 5 deletions
|
@ -21,6 +21,10 @@
|
||||||
|
|
||||||
static struct vkms_device *vkms_device;
|
static struct vkms_device *vkms_device;
|
||||||
|
|
||||||
|
bool enable_cursor;
|
||||||
|
module_param_named(enable_cursor, enable_cursor, bool, 0444);
|
||||||
|
MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support");
|
||||||
|
|
||||||
static const struct file_operations vkms_driver_fops = {
|
static const struct file_operations vkms_driver_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = drm_open,
|
.open = drm_open,
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#define XRES_MAX 8192
|
#define XRES_MAX 8192
|
||||||
#define YRES_MAX 8192
|
#define YRES_MAX 8192
|
||||||
|
|
||||||
|
extern bool enable_cursor;
|
||||||
|
|
||||||
static const u32 vkms_formats[] = {
|
static const u32 vkms_formats[] = {
|
||||||
DRM_FORMAT_XRGB8888,
|
DRM_FORMAT_XRGB8888,
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,10 +56,12 @@ int vkms_output_init(struct vkms_device *vkmsdev)
|
||||||
if (IS_ERR(primary))
|
if (IS_ERR(primary))
|
||||||
return PTR_ERR(primary);
|
return PTR_ERR(primary);
|
||||||
|
|
||||||
cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR);
|
if (enable_cursor) {
|
||||||
if (IS_ERR(cursor)) {
|
cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR);
|
||||||
ret = PTR_ERR(cursor);
|
if (IS_ERR(cursor)) {
|
||||||
goto err_cursor;
|
ret = PTR_ERR(cursor);
|
||||||
|
goto err_cursor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = vkms_crtc_init(dev, crtc, primary, cursor);
|
ret = vkms_crtc_init(dev, crtc, primary, cursor);
|
||||||
|
@ -112,7 +114,8 @@ int vkms_output_init(struct vkms_device *vkmsdev)
|
||||||
drm_crtc_cleanup(crtc);
|
drm_crtc_cleanup(crtc);
|
||||||
|
|
||||||
err_crtc:
|
err_crtc:
|
||||||
drm_plane_cleanup(cursor);
|
if (enable_cursor)
|
||||||
|
drm_plane_cleanup(cursor);
|
||||||
|
|
||||||
err_cursor:
|
err_cursor:
|
||||||
drm_plane_cleanup(primary);
|
drm_plane_cleanup(primary);
|
||||||
|
|
Loading…
Reference in a new issue