All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements
@ 2018-06-20 17:43 Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 1/4] drm/vkms: Add helper for framebuffer create Rodrigo Siqueira
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-20 17:43 UTC (permalink / raw)
  To: Gustavo Padovan, Sean Paul, Daniel Vetter, Haneen Mohammed; +Cc: dri-devel

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(-)

-- 
2.17.1

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] drm/vkms: Add helper for framebuffer create
  2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
@ 2018-06-20 17:43 ` Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 2/4] drm/vkms: Add atomic helpers functions Rodrigo Siqueira
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-20 17:43 UTC (permalink / raw)
  To: Gustavo Padovan, Sean Paul, Daniel Vetter, Haneen Mohammed; +Cc: dri-devel

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

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

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 638bab9083b5..cc046fff985c 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -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,
 };
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] drm/vkms: Add atomic helpers functions
  2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 1/4] drm/vkms: Add helper for framebuffer create Rodrigo Siqueira
@ 2018-06-20 17:43 ` Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 3/4] drm/vkms: Add connectors helpers Rodrigo Siqueira
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-20 17:43 UTC (permalink / raw)
  To: Gustavo Padovan, Sean Paul, Daniel Vetter, Haneen Mohammed; +Cc: dri-devel

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

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

diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index bf76cd39ece7..84cc05506b09 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -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;
 }
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] drm/vkms: Add connectors helpers
  2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 1/4] drm/vkms: Add helper for framebuffer create Rodrigo Siqueira
  2018-06-20 17:43 ` [PATCH 2/4] drm/vkms: Add atomic helpers functions Rodrigo Siqueira
@ 2018-06-20 17:43 ` Rodrigo Siqueira
  2018-06-20 17:44 ` [PATCH 4/4] drm/vkms: Add plane helper struct Rodrigo Siqueira
  2018-06-21  7:15 ` [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-20 17:43 UTC (permalink / raw)
  To: Gustavo Padovan, Sean Paul, Daniel Vetter, Haneen Mohammed; +Cc: dri-devel

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

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 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(-)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index cc046fff985c..fe93f8c17997 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -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 = {
diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
index 54bb3dd2b2c1..76f1720f81a5 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.h
+++ b/drivers/gpu/drm/vkms/vkms_drv.h
@@ -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,
 };
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 48143eac3c12..fef3b1c1b054 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -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");
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] drm/vkms: Add plane helper struct
  2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
                   ` (2 preceding siblings ...)
  2018-06-20 17:43 ` [PATCH 3/4] drm/vkms: Add connectors helpers Rodrigo Siqueira
@ 2018-06-20 17:44 ` Rodrigo Siqueira
  2018-06-21  7:15 ` [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-20 17:44 UTC (permalink / raw)
  To: Gustavo Padovan, Sean Paul, Daniel Vetter, Haneen Mohammed; +Cc: dri-devel

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

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

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 2c25b1d6ab5b..f7f63143f6d0 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -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;
 }
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements
  2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
                   ` (3 preceding siblings ...)
  2018-06-20 17:44 ` [PATCH 4/4] drm/vkms: Add plane helper struct Rodrigo Siqueira
@ 2018-06-21  7:15 ` Daniel Vetter
  2018-06-21 12:02   ` Rodrigo Siqueira
  4 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2018-06-21  7:15 UTC (permalink / raw)
  To: Rodrigo Siqueira; +Cc: dri-devel, Haneen Mohammed

On Wed, Jun 20, 2018 at 02:43:03PM -0300, Rodrigo Siqueira wrote:
> 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

> 
> 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(-)
> 
> -- 
> 2.17.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements
  2018-06-21  7:15 ` [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Daniel Vetter
@ 2018-06-21 12:02   ` Rodrigo Siqueira
  0 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2018-06-21 12:02 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel, Haneen Mohammed

On 06/21, Daniel Vetter wrote:
> On Wed, Jun 20, 2018 at 02:43:03PM -0300, Rodrigo Siqueira wrote:
> > 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

> -Daniel
> 
> > 
> > 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(-)
> > 
> > -- 
> > 2.17.1
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-21 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 17:43 [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Rodrigo Siqueira
2018-06-20 17:43 ` [PATCH 1/4] drm/vkms: Add helper for framebuffer create Rodrigo Siqueira
2018-06-20 17:43 ` [PATCH 2/4] drm/vkms: Add atomic helpers functions Rodrigo Siqueira
2018-06-20 17:43 ` [PATCH 3/4] drm/vkms: Add connectors helpers Rodrigo Siqueira
2018-06-20 17:44 ` [PATCH 4/4] drm/vkms: Add plane helper struct Rodrigo Siqueira
2018-06-21  7:15 ` [PATCH 0/4] drm/vkms: Updates to meet basic kms_flip requirements Daniel Vetter
2018-06-21 12:02   ` Rodrigo Siqueira

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.