All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
To: Gustavo Padovan <gustavo@padovan.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sean Paul <seanpaul@google.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH V3 1/3] drm/vkms: Add mode_config initialization
Date: Mon, 21 May 2018 22:04:57 -0300	[thread overview]
Message-ID: <94d355d47b15f047d6d650dc40cbca9cc9fd84bd.1526948540.git.rodrigosiqueiramelo@gmail.com> (raw)
In-Reply-To: <cover.1526948540.git.rodrigosiqueiramelo@gmail.com>

Set a frame buffer default size for width and height (minimum and
maximum).

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_drv.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

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,
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-22  1:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22  1:04 [PATCH V3 0/3] Expanding the basic vkms features Rodrigo Siqueira
2018-05-22  1:04 ` Rodrigo Siqueira [this message]
2018-05-22  1:06 ` [PATCH V3 2/3] drm/vkms: Add basic CRTC initialization Rodrigo Siqueira
2018-05-22  2:57   ` Haneen Mohammed
2018-05-22 12:02     ` Rodrigo Siqueira
2018-10-22 15:30   ` Emil Velikov
2018-10-22 23:57     ` Rodrigo Siqueira
2018-10-23 12:40       ` Emil Velikov
2018-05-22  1:07 ` [PATCH V3 3/3] drm/vkms: Add extra information about vkms Rodrigo Siqueira
2018-05-23  9:15 ` [PATCH V3 0/3] Expanding the basic vkms features Daniel Vetter
2018-05-24  2:42   ` Haneen Mohammed
2018-05-24  8:15     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94d355d47b15f047d6d650dc40cbca9cc9fd84bd.1526948540.git.rodrigosiqueiramelo@gmail.com \
    --to=rodrigosiqueiramelo@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=seanpaul@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.