drm/vkms: Updates to meet basic kms_flip requirements
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
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
@@ -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
PATCH 2/4 drm/vkms: Add atomic helpers functions
In reply to Rodrigo SiqueiraThis 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
@@ -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
PATCH 3/4 drm/vkms: Add connectors helpers
In reply to Rodrigo SiqueiraThis 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
@@ -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
@@ -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
@@ -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
PATCH 4/4 drm/vkms: Add plane helper struct
In reply to Rodrigo SiqueiraThis 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
@@ -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
Quoted 7 lines · Rodrigo Siqueira
Currently, we are trying to make VKMS pass in the
kms_fliptest (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 bykms_flip. This patchset comprises all the simple modifications used until now to make thekms_flippartially works. It is important to highlight, that VKMS still not pass in thekms_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 structdrivers/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
Quoted 11 lines · Daniel Vetter
Quoted 7 lines · Rodrigo Siqueira
Currently, we are trying to make VKMS pass in the
kms_fliptest (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 bykms_flip. This patchset comprises all the simple modifications used until now to make thekms_flippartially works. It is important to highlight, that VKMS still not pass in thekms_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 structdrivers/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.1Signature · 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