Skip to contentSkip to conversation

drm/vkms: Updates to meet basic kms_flip requirements

PATCH Superseded Rodrigo Siqueira 2 participants 7 messages Jun 20, 2018 – Jun 21, 2018

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover drm/vkms: Updates to meet basic kms_flip requirements

Currently, we are trying to make VKMS pass in the kms_flip test (IGT). As a result, we made a series of small changes in the module with the goal to meet some of the necessary steps required by kms_flip. This patchset comprises all the simple modifications used until now to make the kms_flip partially works. It is important to highlight, that VKMS still not pass in the kms_flip, but I send these modifications with the intention to avoid rework.

Rodrigo Siqueira (4):
drm/vkms: Add helper for framebuffer create
drm/vkms: Add atomic helpers functions
drm/vkms: Add connectors helpers
drm/vkms: Add plane helper struct

 drivers/gpu/drm/vkms/vkms_crtc.c   | 18 ++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_drv.c    |  9 +++------
 drivers/gpu/drm/vkms/vkms_drv.h    |  9 +++++++++
 drivers/gpu/drm/vkms/vkms_output.c | 27 +++++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_plane.c  | 18 ++++++++++++++++++
 5 files changed, 75 insertions(+), 6 deletions(-)
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/4 drm/vkms: Add helper for framebuffer create

This patch adds the basic hook required to create framebuffer which is necessary for providing some of the vkms features.

---
 drivers/gpu/drm/vkms/vkms_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/vkms/vkms_drv.c +3 -0
index 638bab9083b5..cc046fff985c 100644
@@ -9,6 +9,8 @@
 #include <drm/drm_gem.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_fb_helper.h>
 #include "vkms_drv.h"
 
 #define DRIVER_NAME	"vkms"
@@ -68,6 +70,7 @@ static struct drm_driver vkms_driver = {
 };
 
 static const struct drm_mode_config_funcs vkms_mode_funcs = {
+	.fb_create = drm_gem_fb_create,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/4 drm/vkms: Add atomic helpers functions

In reply to Rodrigo Siqueira

This patch adds the struct drm_crtc_helper_funcs with simple atomic_check and atomic_enable functions.

---
 drivers/gpu/drm/vkms/vkms_crtc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/vkms/vkms_crtc.c +18 -0
index bf76cd39ece7..84cc05506b09 100644
@@ -19,6 +19,22 @@ static const struct drm_crtc_funcs vkms_crtc_funcs = {
 	.atomic_destroy_state   = drm_atomic_helper_crtc_destroy_state,
 };
 
+static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
+				  struct drm_crtc_state *state)
+{
+	return 0;
+}
+
+static void vkms_crtc_atomic_enable(struct drm_crtc *crtc,
+				    struct drm_crtc_state *old_state)
+{
+}
+
+static const struct drm_crtc_helper_funcs vkms_crtc_helper_funcs = {
+	.atomic_check  = vkms_crtc_atomic_check,
+	.atomic_enable = vkms_crtc_atomic_enable,
+};
+
 int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
 		   struct drm_plane *primary, struct drm_plane *cursor)
 {
@@ -31,5 +47,7 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
 		return ret;
 	}
 
+	drm_crtc_helper_add(crtc, &vkms_crtc_helper_funcs);
+
 	return ret;
 }
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/4 drm/vkms: Add connectors helpers

In reply to Rodrigo Siqueira

This patch adds the struct drm_connector_helper_funcs with some necessary hooks. Additionally, it also adds some missing hooks at drm_connector_funcs.

---
 drivers/gpu/drm/vkms/vkms_drv.c    |  6 ------
 drivers/gpu/drm/vkms/vkms_drv.h    |  9 +++++++++
 drivers/gpu/drm/vkms/vkms_output.c | 27 +++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 6 deletions(-)
drivers/gpu/drm/vkms/vkms_drv.c +0 -6
index cc046fff985c..fe93f8c17997 100644
@@ -19,12 +19,6 @@
 #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 = {
drivers/gpu/drm/vkms/vkms_drv.h +9 -0
index 54bb3dd2b2c1..76f1720f81a5 100644
@@ -6,6 +6,15 @@
 #include <drm/drm_gem.h>
 #include <drm/drm_encoder.h>
 
+#define XRES_MIN    32
+#define YRES_MIN    32
+
+#define XRES_DEF  1024
+#define YRES_DEF   768
+
+#define XRES_MAX  8192
+#define YRES_MAX  8192
+
 static const u32 vkms_formats[] = {
 	DRM_FORMAT_XRGB8888,
 };
drivers/gpu/drm/vkms/vkms_output.c +27 -0
index 48143eac3c12..fef3b1c1b054 100644
@@ -8,6 +8,7 @@
 
 #include "vkms_drv.h"
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic_helper.h>
 
 static void vkms_connector_destroy(struct drm_connector *connector)
 {
@@ -18,12 +19,36 @@ static void vkms_connector_destroy(struct drm_connector *connector)
 static const struct drm_connector_funcs vkms_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.destroy = vkms_connector_destroy,
+	.reset = drm_atomic_helper_connector_reset,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
 static const struct drm_encoder_funcs vkms_encoder_funcs = {
 	.destroy = drm_encoder_cleanup,
 };
 
+static int vkms_conn_get_modes(struct drm_connector *connector)
+{
+	int count;
+
+	count = drm_add_modes_noedid(connector, XRES_MAX, YRES_MAX);
+	drm_set_preferred_mode(connector, XRES_DEF, YRES_DEF);
+
+	return count;
+}
+
+static int vkms_conn_mode_valid(struct drm_connector *connector,
+				struct drm_display_mode *mode)
+{
+	return MODE_OK;
+}
+
+static const struct drm_connector_helper_funcs vkms_conn_helper_funcs = {
+	.get_modes    = vkms_conn_get_modes,
+	.mode_valid   = vkms_conn_mode_valid,
+};
+
 int vkms_output_init(struct vkms_device *vkmsdev)
 {
 	struct vkms_output *output = &vkmsdev->output;
@@ -49,6 +74,8 @@ int vkms_output_init(struct vkms_device *vkmsdev)
 		goto err_connector;
 	}
 
+	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
+
 	ret = drm_connector_register(connector);
 	if (ret) {
 		DRM_ERROR("Failed to register connector\n");
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/4 drm/vkms: Add plane helper struct

In reply to Rodrigo Siqueira

This patch adds the struct drm_plane_helper_funcs and the required atomic hooks.

---
 drivers/gpu/drm/vkms/vkms_plane.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/gpu/drm/vkms/vkms_plane.c +18 -0
index 2c25b1d6ab5b..f7f63143f6d0 100644
@@ -19,6 +19,22 @@ static const struct drm_plane_funcs vkms_plane_funcs = {
 	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
 };
 
+static int vkms_plane_atomic_check(struct drm_plane *plane,
+				   struct drm_plane_state *state)
+{
+	return 0;
+}
+
+static void vkms_primary_plane_update(struct drm_plane *plane,
+				      struct drm_plane_state *old_state)
+{
+}
+
+static const struct drm_plane_helper_funcs vkms_primary_helper_funcs = {
+	.atomic_check		= vkms_plane_atomic_check,
+	.atomic_update		= vkms_primary_plane_update,
+};
+
 struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
 {
 	struct drm_device *dev = &vkmsdev->drm;
@@ -42,5 +58,7 @@ struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
 		return ERR_PTR(ret);
 	}
 
+	drm_plane_helper_add(plane, &vkms_primary_helper_funcs);
+
 	return plane;
 }
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
In reply to Rodrigo Siqueira
Quoted 7 lines · Rodrigo Siqueira

Currently, we are trying to make VKMS pass in the kms_flip test (IGT). As a result, we made a series of small changes in the module with the goal to meet some of the necessary steps required by kms_flip. This patchset comprises all the simple modifications used until now to make the kms_flip partially works. It is important to highlight, that VKMS still not pass in the kms_flip, but I send these modifications with the intention to avoid rework.

I guess this series should also contain your patch to wire up dumb buffer support?
-Daniel

Quoted 17 lines

Rodrigo Siqueira (4):
drm/vkms: Add helper for framebuffer create
drm/vkms: Add atomic helpers functions
drm/vkms: Add connectors helpers
drm/vkms: Add plane helper struct

 drivers/gpu/drm/vkms/vkms_crtc.c   | 18 ++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_drv.c    |  9 +++------
 drivers/gpu/drm/vkms/vkms_drv.h    |  9 +++++++++
 drivers/gpu/drm/vkms/vkms_output.c | 27 +++++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_plane.c  | 18 ++++++++++++++++++
 5 files changed, 75 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
Quoted 11 lines · Daniel Vetter
Quoted 7 lines · Rodrigo Siqueira

Currently, we are trying to make VKMS pass in the kms_flip test (IGT). As a result, we made a series of small changes in the module with the goal to meet some of the necessary steps required by kms_flip. This patchset comprises all the simple modifications used until now to make the kms_flip partially works. It is important to highlight, that VKMS still not pass in the kms_flip, but I send these modifications with the intention to avoid rework.

I guess this series should also contain your patch to wire up dumb buffer support?

Yes. Sorry about that, sometimes I take the wrong decision on how to split patches. I'm already preparing V2 including gem handler.

Thanks
Rodrigo Siqueira

Quoted 16 lines

-Daniel

Quoted 14 lines

Rodrigo Siqueira (4):
drm/vkms: Add helper for framebuffer create
drm/vkms: Add atomic helpers functions
drm/vkms: Add connectors helpers
drm/vkms: Add plane helper struct

 drivers/gpu/drm/vkms/vkms_crtc.c   | 18 ++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_drv.c    |  9 +++------
 drivers/gpu/drm/vkms/vkms_drv.h    |  9 +++++++++
 drivers/gpu/drm/vkms/vkms_output.c | 27 +++++++++++++++++++++++++++
 drivers/gpu/drm/vkms/vkms_plane.c  | 18 ++++++++++++++++++
 5 files changed, 75 insertions(+), 6 deletions(-)
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.17.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel