diff mbox

[V2,3/5] drm/vkms: Add atomic helpers functions

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

Commit Message

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

Comments

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

Please don't add empty functions when not requird (these callbacks should
all be optional). Also I'd squash this patch in with the patch adding the
vblank hrtimer, splitting this out doesn't really make sense.
-Daniel
> +
> +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
>
diff mbox

Patch

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