diff mbox

[03/10] drm/rockchip/crc: Implement verify_crc_source callback

Message ID 20180702110729.8171-4-mahesh1.kumar@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kumar, Mahesh July 2, 2018, 11:07 a.m. UTC
This patch implements "verify_crc_source" callback function for
rockchip drm driver.

Changes since V1:
 - simplify the verification (Jani N)

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Maarten Lankhorst July 3, 2018, 10:16 a.m. UTC | #1
Op 02-07-18 om 13:07 schreef Mahesh Kumar:
> This patch implements "verify_crc_source" callback function for
> rockchip drm driver.
>
> Changes since V1:
>  - simplify the verification (Jani N)
>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index effecbed2d11..77e91b15ddb4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1138,12 +1138,31 @@ static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
>  
>  	return ret;
>  }
> +
> +static int
> +vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
> +			   size_t *values_cnt)
> +{
> +	if (source_name && strcmp(source_name, "auto") != 0)
> +		return -EINVAL;
> +
> +	*values_cnt = 3;
> +	return 0;
> +}
> +
>  #else
>  static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
>  				   const char *source_name, size_t *values_cnt)
>  {
>  	return -ENODEV;
>  }
> +
> +static int
> +vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
> +			   size_t *values_cnt)
> +{
> +	return -ENODEV;
> +}
>  #endif
>  
>  static const struct drm_crtc_funcs vop_crtc_funcs = {
> @@ -1156,6 +1175,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
>  	.enable_vblank = vop_crtc_enable_vblank,
>  	.disable_vblank = vop_crtc_disable_vblank,
>  	.set_crc_source = vop_crtc_set_crc_source,
> +	.verify_crc_source = vop_crtc_verify_crc_source,
>  };
>  
>  static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)

Ack for merging this and 8/10 through drm-misc?
Heiko Stuebner July 3, 2018, 10:46 a.m. UTC | #2
Hi Maarten,

Am Dienstag, 3. Juli 2018, 12:16:41 CEST schrieb Maarten Lankhorst:
> Op 02-07-18 om 13:07 schreef Mahesh Kumar:
> > This patch implements "verify_crc_source" callback function for
> > rockchip drm driver.
> > 
> > Changes since V1:
> >  - simplify the verification (Jani N)
> > 
> > Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

> Ack for merging this and 8/10 through drm-misc?

Sure, looking over the series on dri-devel briefly, this looks of
course sane, so
Acked-by: Heiko Stuebner <heiko@sntech.de>
diff mbox

Patch

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index effecbed2d11..77e91b15ddb4 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1138,12 +1138,31 @@  static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
 
 	return ret;
 }
+
+static int
+vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
+			   size_t *values_cnt)
+{
+	if (source_name && strcmp(source_name, "auto") != 0)
+		return -EINVAL;
+
+	*values_cnt = 3;
+	return 0;
+}
+
 #else
 static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
 				   const char *source_name, size_t *values_cnt)
 {
 	return -ENODEV;
 }
+
+static int
+vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
+			   size_t *values_cnt)
+{
+	return -ENODEV;
+}
 #endif
 
 static const struct drm_crtc_funcs vop_crtc_funcs = {
@@ -1156,6 +1175,7 @@  static const struct drm_crtc_funcs vop_crtc_funcs = {
 	.enable_vblank = vop_crtc_enable_vblank,
 	.disable_vblank = vop_crtc_disable_vblank,
 	.set_crc_source = vop_crtc_set_crc_source,
+	.verify_crc_source = vop_crtc_verify_crc_source,
 };
 
 static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)