diff mbox

[V2,5/5] drm/vkms: Add plane helper struct

Message ID 5cd8199e93880c282643c2a09ae86ecb7bfff322.1529582970.git.rodrigosiqueiramelo@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Siqueira June 21, 2018, 12:17 p.m. UTC
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(+)

Comments

Daniel Vetter July 11, 2018, 7:30 a.m. UTC | #1
On Thu, Jun 21, 2018 at 09:17:25AM -0300, Rodrigo Siqueira wrote:
> 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)
> +{
> +}

Again no dummy functions pls, and I'd squash this in with whatever patch
actually needs it. Not sure we do need it already (I think Haneen does,
but she can pick this all up into her series).
-Daniel

> +
> +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
>
diff mbox

Patch

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;
 }