summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>2018-05-16 20:55:36 -0300
committerGustavo Padovan <gustavo.padovan@collabora.com>2018-07-05 09:46:15 -0300
commitc04372ea4abd83ec6c86083f2afe9322515ee293 (patch)
tree346eb82e9f3183872ca2f001f501fd85f7eb2222 /drivers
parent41111ce17ee7277cb7451e8a21e319220afc130d (diff)
drm/vkms: Add mode_config initialization
Initialize minimum and maximum width and height of the frame buffers with default values. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/75c55df671f24b037f9172700b479f4bb2fa7c92.1526514457.git.rodrigosiqueiramelo@gmail.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/vkms/vkms_drv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 35517b09538e..aec3f180f96d 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -9,6 +9,7 @@
#include <drm/drmP.h>
#include <drm/drm_gem.h>
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic_helper.h>
#include "vkms_drv.h"
#define DRIVER_NAME "vkms"
@@ -17,6 +18,12 @@
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 0
+#define XRES_MIN 32
+#define YRES_MIN 32
+
+#define XRES_MAX 8192
+#define YRES_MAX 8192
+
static struct vkms_device *vkms_device;
static const struct file_operations vkms_driver_fops = {
@@ -67,6 +74,11 @@ static const struct drm_connector_funcs vkms_connector_funcs = {
.destroy = vkms_connector_destroy,
};
+static const struct drm_mode_config_funcs vkms_mode_funcs = {
+ .atomic_check = drm_atomic_helper_check,
+ .atomic_commit = drm_atomic_helper_commit,
+};
+
static int __init vkms_init(void)
{
int ret;
@@ -87,6 +99,11 @@ static int __init vkms_init(void)
}
drm_mode_config_init(&vkms_device->drm);
+ vkms_device->drm.mode_config.funcs = &vkms_mode_funcs;
+ vkms_device->drm.mode_config.min_width = XRES_MIN;
+ vkms_device->drm.mode_config.min_height = YRES_MIN;
+ vkms_device->drm.mode_config.max_width = XRES_MAX;
+ vkms_device->drm.mode_config.max_height = YRES_MAX;
ret = drm_connector_init(&vkms_device->drm, &vkms_device->connector,
&vkms_connector_funcs,