Improve crc-core driver interface
Subsystems (8)
cover Improve crc-core driver interface
This series improves crc-core <-> driver interface. This series adds following functionality in the crc-core
- Now control node will print all the available sources if implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup of crtc_crc_open function first allocate memory before enabling CRC generation
- Don't block open() call instead wait in crc read call.
Following IGT will fail due to crc-core <-> driver interface change igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crc
AMD/Rockchip/rcar code path is not validated and need inputs
Mahesh Kumar (10):
drm: crc: Introduce verify_crc_source callback
drm: crc: Introduce get_crc_sources callback drm/rockchip/crc: Implement verify_crc_source callback drm/amdgpu_dm/crc: Implement verify_crc_source callback drm/rcar-du/crc: Implement verify_crc_source callback drm/i915/crc: implement verify_crc_source callback drm/i915/crc: implement get_crc_sources callback drm/crc: Cleanup crtc_crc_open function
Revert "drm: crc: Wait for a frame before returning from open()" drm/rcar-du/crc: Implement get_crc_sources callback
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++- drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++------- drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_drv.h | 9 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 119 ++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 + drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++- include/drm/drm_crtc.h | 40 ++++++- 14 files changed, 396 insertions(+), 74 deletions(-)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/10 drm: crc: Introduce verify_crc_source callback
This patch adds a new callback function "verify_crc_source" which will be used during setting the crc source in control node. This will help in avoiding setting of wrong string for source.
Changes since V1:
- do not yet verify_crc_source during open.
--- drivers/gpu/drm/drm_debugfs_crc.c | 8 ++++++++ include/drm/drm_crtc.h | 15 +++++++++++++++ 2 files changed, 23 insertions(+)
drivers/gpu/drm/drm_debugfs_crc.c +8 -0
@@ -87,6 +87,8 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf,struct drm_crtc *crtc = m->private;struct drm_crtc_crc *crc = &crtc->crc;char *source; +size_t values_cnt; +int ret =0 ;if (len ==0 )return 0 ;
@@ -104,6 +106,12 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf,if (source[len] =='\n' ) source[len] ='\0' ; +if (crtc->funcs->verify_crc_source) { + ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt); +if (ret) +return ret; + } +spin_lock_irq (&crc->lock);if (crc->opened) {
include/drm/drm_crtc.h +15 -0
@@ -684,6 +684,21 @@ struct drm_crtc_funcs {*/ int (*set_crc_source)(struct drm_crtc *crtc,const char *source,size_t *values_cnt); +/** +* @verify_crc_source: +* +* verifies the source of CRC checksums of frames before setting the +* source for CRC and during crc open. +* +* This callback is optional if the driver does not support any CRC +* generation functionality. +* +* RETURNS: +* +* 0 on success or a negative error code on failure. +*/ +int (*verify_crc_source)(struct drm_crtc *crtc,const char *source, +size_t *values_cnt);/** * @atomic_print_state:
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/10] drm: crc: Introduce verify_crc_source callback
Hi Mahesh,
Thank you for the patch.
Quoted 21 lines · On Thursday, 12 July 2018 11:36:26 EEST Mahesh Kumar wrote:
This patch adds a new callback function "
verify_crc_source" which will be used during setting the crc source in control node. This will help in avoiding setting of wrong string for source.Changes since V1:
- do not yetverify_crc_sourceduring open.Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>Reviewed-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/drm_debugfs_crc.c | 8 ++++++++ include/drm/drm_crtc.h | 15 +++++++++++++++ 2 files changed, 23 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_debugfs_crc.cindex99961192bf03..1956acb61cc8100644
drivers/gpu/drm/drm_debugfs_crc.c static ssize_t crc_control_write(struct file *file, const · line 91
Quoted 5 lines
drivers/gpu/drm/drm_debugfs_crc.c +2
-0@@ -87,6 +87,8 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf, struct drm_crtc *crtc = m->private;struct drm_crtc_crc *crc = &crtc->crc;char *source; +size_t values_cnt; +int ret =0 ;
No need to initialize ret to 0 here.
Quoted 21 lines
drivers/gpu/drm/drm_debugfs_crc.c +6
-0if (len ==0 )return 0 ;@@ -104,6 +106,12 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf, if (source[len] == '\n') source[len] ='\0' ; +if (crtc->funcs->verify_crc_source) { + ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt); +if (ret) +return ret; + } +spin_lock_irq (&crc->lock);if (crc->opened) {include/drm/drm_crtc.h +0
-0
include/drm/drm_crtc.h struct drm_crtc_funcs { · line 691
Quoted 8 lines
include/drm/drm_crtc.h +5
-0@@ -684,6 +684,21 @@ struct drm_crtc_funcs {*/ int (*set_crc_source)(struct drm_crtc *crtc,const char *source,size_t *values_cnt); +/** +* @verify_crc_source: +* +* verifies the source of CRC checksums of frames before setting the +* source for CRC and during crc open.
Please also document whether the source parameter can be NULL.
It would also be nice to document values_cnt, but as that's not documented for the .set_crc_source() operation at the moment, I won't block the patch for this.
Apart from that,
Quoted 13 lines
include/drm/drm_crtc.h +10
-0+* +* This callback is optional if the driver does not support any CRC +* generation functionality. +* +* RETURNS: +* +* 0 on success or a negative error code on failure. +*/ +int (*verify_crc_source)(struct drm_crtc *crtc,const char *source, +size_t *values_cnt);/** * @atomic_print_state:
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/10 drm: crc: Introduce get_crc_sources callback
In reply to Mahesh KumarThis patch introduce a callback function "get_crc_sources" which will be called during read of control node. It is an optional callback function and if driver implements this callback, driver should return a constant pointer to an array of crc sources list and update count according to the number of source in the list.
Changes Since V1: (Daniel)
- return const pointer to an array of crc sources list
- do validation of sources in CRC-core
Changes Since V2:
- update commit message
- update callback documentation
- print one source name per line
--- drivers/gpu/drm/drm_debugfs_crc.c | 23 ++++++++++++++++++++++- include/drm/drm_crtc.h | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_debugfs_crc.c +22 -1
@@ -68,8 +68,29 @@ static int crc_control_show(struct seq_file *m, void *data) {struct drm_crtc *crtc = m->private; -seq_printf (m,"%s\n" , crtc->crc.source); +if (crtc->funcs->get_crc_sources) { +size_t count; +const char *const *sources = crtc->funcs->get_crc_sources (crtc, + &count); +size_t values_cnt; +int i; + +if (count ==0 || !sources) + goto out; + +for (i =0 ; i < count; i++) +if (!crtc->funcs->verify_crc_source (crtc, sources[i], + &values_cnt)) { +if (strcmp (sources[i], crtc->crc.source)) +seq_printf (m,"%s\n" , sources[i]); +else +seq_printf (m,"%s*\n" , sources[i]); + } + } +return 0 ; +out: +seq_printf (m,"%s*\n" , crtc->crc.source);return 0 ; }
include/drm/drm_crtc.h +22 -0
@@ -699,6 +699,28 @@ struct drm_crtc_funcs {*/ int (*verify_crc_source)(struct drm_crtc *crtc,const char *source,size_t *values_cnt); +/** +* @get_crc_sources: +* +* Driver callback for getting a list of all the available sources for +* CRC generation. This callback depends upon verify_crc_source, So +* verify_crc_source callback should be implemented before implementing +* this. Driver can pass full list of available crc sources, this +* callback does the verification on each crc-source before passing it +* to userspace. +* +* This callback is optional if the driver does not support exporting of +* possible CRC sources list. +* +* RETURNS: +* +* a constant character pointer to the list of all the available CRC +* sources. On failure driver should return NULL. count should be +* updated with number of sources in list. if zero we don't process any +* source from the list. +*/ +const char *const *(*get_crc_sources)(struct drm_crtc *crtc, +size_t *count);/** * @atomic_print_state:
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/10] drm: crc: Introduce get_crc_sources callback
Hi Mahesh,
Thank you for the patch.
Quoted 28 lines · On Thursday, 12 July 2018 11:36:27 EEST Mahesh Kumar wrote:
This patch introduce a callback function "
get_crc_sources" which will be called during read of control node. It is an optional callback function and if driver implements this callback, driver should return a constant pointer to an array of crc sources list and update count according to the number of source in the list.Changes Since V1: (Daniel)
- return const pointer to an array of crc sources list
- do validation of sources in CRC-core
Changes Since V2:
- update commit message
- update callback documentation
- print one source name per lineSigned-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>Reviewed-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/drm_debugfs_crc.c | 23 ++++++++++++++++++++++- include/drm/drm_crtc.h | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_debugfs_crc.cindex1956acb61cc8..940b76a1ab71100644
drivers/gpu/drm/drm_debugfs_crc.c static int crc_control_show(struct seq_file *m, void · line 76
Quoted 10 lines
drivers/gpu/drm/drm_debugfs_crc.c +6
-1@@ -68,8 +68,29 @@ static int crc_control_show(struct seq_file *m, void *data) {struct drm_crtc *crtc = m->private; -seq_printf (m,"%s\n" , crtc->crc.source); +if (crtc->funcs->get_crc_sources) { +size_t count; +const char *const *sources = crtc->funcs->get_crc_sources (crtc, + &count); +size_t values_cnt; +int i;
i only takes positive values, you can make it an unsigned int.
Quoted 24 lines
drivers/gpu/drm/drm_debugfs_crc.c +15
-0+if (count ==0 || !sources) + goto out; + +for (i =0 ; i < count; i++) +if (!crtc->funcs->verify_crc_source (crtc, sources[i], + &values_cnt)) { +if (strcmp (sources[i], crtc->crc.source)) +seq_printf (m,"%s\n" , sources[i]); +else +seq_printf (m,"%s*\n" , sources[i]); + } + } +return 0 ; +out: +seq_printf (m,"%s*\n" , crtc->crc.source);return 0 ; }include/drm/drm_crtc.h +0
-0
include/drm/drm_crtc.h struct drm_crtc_funcs { · line 706
Quoted 8 lines
include/drm/drm_crtc.h +5
-0@@ -699,6 +699,28 @@ struct drm_crtc_funcs {*/ int (*verify_crc_source)(struct drm_crtc *crtc,const char *source,size_t *values_cnt); +/** +* @get_crc_sources: +* +* Driver callback for getting a list of all the available sources for +* CRC generation. This callback depends upon verify_crc_source, So
s/So/so/
include/drm/drm_crtc.h struct drm_crtc_funcs { · line 719
Quoted 13 lines
include/drm/drm_crtc.h +13
-0+* verify_crc_source callback should be implemented before implementing +* this. Driver can pass full list of available crc sources, this +* callback does the verification on each crc-source before passing it +* to userspace. +* +* This callback is optional if the driver does not support exporting of +* possible CRC sources list. +* +* RETURNS: +* +* a constant character pointer to the list of all the available CRC +* sources. On failure driver should return NULL. count should be +* updated with number of sources in list. if zero we don't process any
s/if zero/If zero/
Apart from that,
Quoted 7 lines
include/drm/drm_crtc.h +4
-0+* source from the list. +*/ +const char *const *(*get_crc_sources)(struct drm_crtc *crtc, +size_t *count);/** * @atomic_print_state:
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/10 drm/rockchip/crc: Implement verify_crc_source callback
In reply to Mahesh KumarThis patch implements "verify_crc_source" callback function for rockchip drm driver.
Changes since V1:
- simplify the verification (Jani N)
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +20 -0
@@ -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)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/10 drm/amdgpu_dm/crc: Implement verify_crc_source callback
In reply to Mahesh KumarThis patch implements "verify_crc_source" callback function for AMD drm driver.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 4 ++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 16 ++++++++++++++++ 3 files changed, 21 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -2608,6 +2608,7 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .atomic_duplicate_state = dm_crtc_duplicate_state, .atomic_destroy_state = dm_crtc_destroy_state, .set_crc_source = amdgpu_dm_crtc_set_crc_source, + .verify_crc_source = amdgpu_dm_crtc_verify_crc_source, .enable_vblank = dm_enable_vblank, .disable_vblank = dm_disable_vblank, };
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +4 -0
@@ -260,9 +260,13 @@ amdgpu_dm_remove_sink_from_freesync_module(struct drm_connector *connector);#ifdef CONFIG_DEBUG_FS int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name,size_t *values_cnt); +int amdgpu_dm_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *src_name, +size_t *values_cnt);void amdgpu_dm_crtc_handle_crc_irq (struct drm_crtc *crtc);#else #define amdgpu_dm_crtc_set_crc_source NULL +#define amdgpu_dm_crtc_verify_crc_source NULL#define amdgpu_dm_crtc_handle_crc_irq (x)#endif
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +16 -0
@@ -46,6 +46,22 @@ static enum amdgpu_dm_pipe_crc_source dm_parse_crc_source(const char *source)return AMDGPU_DM_PIPE_CRC_SOURCE_INVALID ; } +int +amdgpu_dm_crtc_verify_crc_source (struct drm_crtc *crtc,const char *src_name, +size_t *values_cnt) +{ +enum amdgpu_dm_pipe_crc_source source =dm_parse_crc_source (src_name); + +if (source <0 ) { +DRM_DEBUG_DRIVER ("Unknown CRC source %s for CRTC%d\n" , + src_name, crtc->index); +return -EINVAL ; + } + + *values_cnt =3 ; +return 0 ; +} +int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name,size_t *values_cnt) {
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/10 drm/rcar-du/crc: Implement verify_crc_source callback
In reply to Mahesh KumarThis patch implements "verify_crc_source" callback function for rcar drm driver.
Changes Since V1:
- avoid duplication of code
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 66 +++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 13 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +53 -13
@@ -756,17 +756,66 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) rcrtc->vblank_enable = false; } +static int rcar_du_get_plane_index (struct drm_crtc *crtc, +const char *source_name, +unsigned int *index) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +unsigned int i; +int ret =0 ; + + ret =kstrtouint (source_name +strlen ("plane" ),10 , index); +if (ret <0 ) +return ret; + +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +if (*index == rcrtc->vsp->planes[i].plane.base.id) { + *index = i; +break ; + } + } + +if (i >= rcrtc->vsp->num_planes) +return -EINVAL ; + +return ret; +} + +static int rcar_du_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name, +size_t *values_cnt) +{ +int ret; +unsigned int index; +/* +* Parse the source name. Supported values are "plane%u" to compute the +* CRC on an input plane (%u is the plane ID), and "auto" to compute the +* CRC on the composer (VSP) output. +*/ +if (!source_name || !strcmp (source_name,"auto" )) { + goto out; + }else if (strstarts (source_name,"plane" )) { + ret =rcar_du_get_plane_index (crtc, source_name, &index); +if (ret <0 ) +return ret; + }else { +return -EINVAL ; + } + +out: + *values_cnt =1 ; +return 0 ; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt) { -struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc);struct drm_modeset_acquire_ctx ctx;struct drm_crtc_state *crtc_state;struct drm_atomic_state *state;enum vsp1_du_crc_source source;unsigned int index =0 ; -unsigned int i;int ret;/*
@@ -781,19 +830,9 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, }else if (strstarts (source_name,"plane" )) { source =VSP1_DU_CRC_PLANE ; - ret =kstrtouint (source_name +strlen ("plane" ),10 , &index); + ret =rcar_du_get_plane_index (crtc, source_name, &index);if (ret <0 )return ret; - -for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { -if (index == rcrtc->vsp->planes[i].plane.base.id) { - index = i; -break ; - } - } - -if (i >= rcrtc->vsp->num_planes) -return -EINVAL ; }else {return -EINVAL ; }
@@ -861,6 +900,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen3 = { .enable_vblank = rcar_du_crtc_enable_vblank, .disable_vblank = rcar_du_crtc_disable_vblank, .set_crc_source = rcar_du_crtc_set_crc_source, + .verify_crc_source = rcar_du_crtc_verify_crc_source, };/* -----------------------------------------------------------------------------
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/10] drm/rcar-du/crc: Implement verify_crc_source callback
Hi Mahesh,
Thank you for the patch.
Quoted 20 lines · On Thursday, 12 July 2018 11:36:30 EEST Mahesh Kumar wrote:
This patch implements "
verify_crc_source" callback function for rcar drm driver.Changes Since V1:
- avoid duplication of codeSigned-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>Reviewed-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 66 ++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 13 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex15dc9caa128b..7124918372f8100644
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct · line 759
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-0@@ -756,17 +756,66 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) rcrtc->vblank_enable = false; } +static int rcar_du_get_plane_index(struct drm_crtc *crtc,
Please pass a struct rcar_du_crtc pointer to this function, as callers should already have it (or can easily compute it).
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) · line 761
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+const char *source_name, + unsigned int *index)
I think you can simplify this by returning the index, which is always positive, or a negative error code in case of error.
I think you could share even more code if you named this function rcar_du_crtc_parse_crc_source() and returned both the index and the vsp1_du_crc_source (one of them through a pointer).
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) · line 765
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +4
-0+{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +unsigned int i; +int ret =0 ;
No need to initialize ret to 0.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) · line 767
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+ + ret =kstrtouint (source_name +strlen ("plane" ),10 , index);
This assumes that the caller will always ensure that source_nam starts with "plane", otherwise you could access the string beyond its end. This patch is fine, but it would be easy to use the function erroneously in the future. How about moving the strstarts(source_name, "plane") check at the beginning of this function ?
Quoted 12 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +12
-0+if (ret <0 ) +return ret; + +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +if (*index == rcrtc->vsp->planes[i].plane.base.id) { + *index = i; +break ; + } + } + +if (i >= rcrtc->vsp->num_planes) +return -EINVAL ;
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) · line 789
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +10
-0+ +return ret; +} + +static int rcar_du_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name, +size_t *values_cnt) +{ +int ret; +unsigned int index;
Please sort variable declarations roughly by line length to match the style of the driver.
You need a blank line here.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) · line 795
Quoted 6 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +6
-0+/* +* Parse the source name. Supported values are "plane%u" to compute the +* CRC on an input plane (%u is the plane ID), and "auto" to compute the +* CRC on the composer (VSP) output. +*/ +if (!source_name || !strcmp (source_name,"auto" )) {
Can source_name be NULL here ?
Quoted 57 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +16
-13+ goto out; + }else if (strstarts (source_name,"plane" )) { + ret =rcar_du_get_plane_index (crtc, source_name, &index); +if (ret <0 ) +return ret; + }else { +return -EINVAL ; + } + +out: + *values_cnt =1 ; +return 0 ; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt) { -struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc);struct drm_modeset_acquire_ctx ctx;struct drm_crtc_state *crtc_state;struct drm_atomic_state *state;enum vsp1_du_crc_source source;unsigned int index =0 ; -unsigned int i;int ret;/* @@ -781,19 +830,9 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, } else if (strstarts(source_name, "plane")) { source =VSP1_DU_CRC_PLANE ; - ret =kstrtouint (source_name +strlen ("plane" ),10 , &index); + ret =rcar_du_get_plane_index (crtc, source_name, &index);if (ret <0 )return ret; - -for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { -if (index == rcrtc->vsp->planes[i].plane.base.id) { - index = i; -break ; - } - } - -if (i >= rcrtc->vsp->num_planes) -return -EINVAL ; }else {return -EINVAL ; }@@ -861,6 +900,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen3 = { .enable_vblank = rcar_du_crtc_enable_vblank, .disable_vblank = rcar_du_crtc_disable_vblank, .set_crc_source = rcar_du_crtc_set_crc_source, + .verify_crc_source = rcar_du_crtc_verify_crc_source, };/* ------------------------------------------------------------------------
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/10 drm/i915/crc: implement verify_crc_source callback
In reply to Mahesh KumarThis patch implements verify_crc_source callback function introduced earlier in this series.
--- drivers/gpu/drm/i915/intel_display.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 3 + drivers/gpu/drm/i915/intel_pipe_crc.c | 108 ++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -12895,6 +12895,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { .atomic_duplicate_state = intel_crtc_duplicate_state, .atomic_destroy_state = intel_crtc_destroy_state, .set_crc_source = intel_crtc_set_crc_source, + .verify_crc_source = intel_crtc_verify_crc_source, };struct wait_rps_boost {
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -2157,10 +2157,13 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);#ifdef CONFIG_DEBUG_FS int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt); +int intel_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name,size_t *values_cnt);void intel_crtc_disable_pipe_crc (struct intel_crtc *crtc);void intel_crtc_enable_pipe_crc (struct intel_crtc *crtc);#else #define intel_crtc_set_crc_source NULL +#define intel_crtc_verify_crc_source NULLstatic inline void intel_crtc_disable_pipe_crc (struct intel_crtc *crtc) { }
drivers/gpu/drm/i915/intel_pipe_crc.c +108 -0
114 lines not on this page · raw message
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/10 drm/i915/crc: implement get_crc_sources callback
In reply to Mahesh KumarThis patch implements get_crc_sources callback, which returns list of all the valid crc sources supported by driver in current platform.
Changes since V1:
- Return array of crc sources
--- drivers/gpu/drm/i915/intel_display.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 3 +++ drivers/gpu/drm/i915/intel_pipe_crc.c | 7 +++++++ 3 files changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -12896,6 +12896,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { .atomic_destroy_state = intel_crtc_destroy_state, .set_crc_source = intel_crtc_set_crc_source, .verify_crc_source = intel_crtc_verify_crc_source, + .get_crc_sources = intel_crtc_get_crc_sources, };struct wait_rps_boost {
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -2159,11 +2159,14 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, size_t *values_cnt);int intel_crtc_verify_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt); +const char *const *intel_crtc_get_crc_sources (struct drm_crtc *crtc, +size_t *count);void intel_crtc_disable_pipe_crc (struct intel_crtc *crtc);void intel_crtc_enable_pipe_crc (struct intel_crtc *crtc);#else #define intel_crtc_set_crc_source NULL#define intel_crtc_verify_crc_source NULL +#define intel_crtc_get_crc_sources NULLstatic inline void intel_crtc_disable_pipe_crc (struct intel_crtc *crtc) { }
drivers/gpu/drm/i915/intel_pipe_crc.c +7 -0
@@ -556,6 +556,13 @@ intel_is_valid_crc_source(struct drm_i915_private *dev_priv,return ivb_crc_source_valid (dev_priv, source); } +const char *const *intel_crtc_get_crc_sources (struct drm_crtc *crtc, +size_t *count) +{ + *count =ARRAY_SIZE (pipe_crc_sources); +return pipe_crc_sources; +} +int intel_crtc_verify_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt) {
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/10 drm/crc: Cleanup crtc_crc_open function
In reply to Mahesh KumarThis patch make changes to allocate crc-entries buffer before enabling CRC generation.
It moves all the failure check early in the function before setting the source or memory allocation.
Now set_crc_source takes only two variable inputs, values_cnt we already gets as part of verify_crc_source.
Changes since V1:
- refactor code to use single spin lock
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 4 +- drivers/gpu/drm/drm_debugfs_crc.c | 61 ++++++++++------------ drivers/gpu/drm/i915/intel_drv.h | 3 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 4 +- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 5 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +-- include/drm/drm_crtc.h | 3 +- 8 files changed, 37 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -2
@@ -258,8 +258,7 @@ amdgpu_dm_remove_sink_from_freesync_module(struct drm_connector *connector);/* amdgpu_dm_crc.c */ #ifdef CONFIG_DEBUG_FS -int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name, -size_t *values_cnt); +int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name);int amdgpu_dm_crtc_verify_crc_source (struct drm_crtc *crtc,const char *src_name,size_t *values_cnt);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 -3
@@ -62,8 +62,7 @@ amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name,return 0 ; } -int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name, -size_t *values_cnt) +int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name) {struct dm_crtc_state *crtc_state =to_dm_crtc_state (crtc->state);struct dc_stream_state *stream_state = crtc_state->stream;
@@ -99,7 +98,6 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name,return -EINVAL ; } - *values_cnt =3 ;/* Reset crc_skipped on dm state */ crtc_state->crc_skip_count =0 ;return 0 ;
drivers/gpu/drm/drm_debugfs_crc.c +29 -32
103 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +1 -2
@@ -2155,8 +2155,7 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);/* intel_pipe_crc.c */ #ifdef CONFIG_DEBUG_FS -int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name, -size_t *values_cnt); +int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name);int intel_crtc_verify_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt); const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
drivers/gpu/drm/i915/intel_pipe_crc.c +1 -3
@@ -583,8 +583,7 @@ int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,return -EINVAL ; } -int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name, -size_t *values_cnt) +int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[crtc->index];
@@ -623,7 +622,6 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, } pipe_crc->skipped =0 ; - *values_cnt =5 ; out:intel_display_power_put (dev_priv, power_domain);
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1 -4
@@ -808,8 +808,7 @@ static int rcar_du_crtc_verify_crc_source(struct drm_crtc *crtc, }static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name, -size_t *values_cnt) +const char *source_name) {struct drm_modeset_acquire_ctx ctx;struct drm_crtc_state *crtc_state;
@@ -837,8 +836,6 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,return -EINVAL ; } - *values_cnt =1 ; -/* Perform an atomic commit to set the CRC source. */ drm_modeset_acquire_init (&ctx,0 );
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -4
@@ -1117,7 +1117,7 @@ static struct drm_connector *vop_get_edp_connector(struct vop *vop) }static int vop_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name,size_t *values_cnt) +const char *source_name) {struct vop *vop =to_vop (crtc);struct drm_connector *connector;
@@ -1127,8 +1127,6 @@ static int vop_crtc_set_crc_source(struct drm_crtc *crtc,if (!connector)return -EINVAL ; - *values_cnt =3 ; -if (source_name &&strcmp (source_name,"auto" ) ==0 ) ret =analogix_dp_start_crc (connector);else if (!source_name)
@@ -1152,7 +1150,7 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,#else static int vop_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name,size_t *values_cnt) +const char *source_name) {return -ENODEV ; }
include/drm/drm_crtc.h +1 -2
@@ -682,8 +682,7 @@ struct drm_crtc_funcs {* * 0 on success or a negative error code on failure. */ -int (*set_crc_source)(struct drm_crtc *crtc,const char *source, -size_t *values_cnt); +int (*set_crc_source)(struct drm_crtc *crtc,const char *source);/** * @verify_crc_source: *
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/10] drm/crc: Cleanup crtc_crc_open function
Hi Mahesh,
Thank you for the patch.
Quoted 7 lines · On Thursday, 12 July 2018 11:36:33 EEST Mahesh Kumar wrote:
This patch make changes to allocate crc-entries buffer before enabling CRC generation.
It moves all the failure check early in the function before setting the source or memory allocation.
Nowset_crc_sourcetakes only two variable inputs,values_cntwe already gets as part ofverify_crc_source.
Quoted 8 lines
Changes since V1:
- refactor code to use single spin lockSigned-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>Reviewed-by Maarten Lankhorst <[email protected]>Acked-by Leo Li <[email protected]>
For core code and the R-Car DU driver,
Quoted 271 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 4 +- drivers/gpu/drm/drm_debugfs_crc.c | 61 +++++++++---------- drivers/gpu/drm/i915/intel_drv.h | 3 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 4 +- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 5 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +-- include/drm/drm_crtc.h | 3 +- 8 files changed, 37 insertions(+), 52 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.hindexe43ed064dc46..54056d180003100644drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1
-1@@ -258,8 +258,7 @@ amdgpu_dm_remove_sink_from_freesync_module(struct drm_connector *connector);/* amdgpu_dm_crc.c */ #ifdef CONFIG_DEBUG_FS -int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name, - size_t *values_cnt); +int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name);int amdgpu_dm_crtc_verify_crc_source (struct drm_crtc *crtc,const char *src_name,size_t *values_cnt);(quoted diff) +0
-0
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.cindexdfcca594d52a..e7ad528f5853100644drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1
-2@@ -62,8 +62,7 @@ amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name, return 0; } -int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name, - size_t *values_cnt) +int amdgpu_dm_crtc_set_crc_source (struct drm_crtc *crtc,const char *src_name) {struct dm_crtc_state *crtc_state =to_dm_crtc_state (crtc->state);struct dc_stream_state *stream_state = crtc_state->stream;@@ -99,7 +98,6 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name, return -EINVAL; } - *values_cnt =3 ;/* Reset crc_skipped on dm state */ crtc_state->crc_skip_count =0 ;return 0 ;(quoted diff) +0
-0
b/drivers/gpu/drm/drm_debugfs_crc.cindex940b76a1ab71..7386391636e3100644drivers/gpu/drm/drm_debugfs_crc.c +29
-32@@ -127,11 +127,9 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf, if (source[len] == '\n') source[len] ='\0' ; -if (crtc->funcs->verify_crc_source) { - ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt); -if (ret) -return ret; - } + ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt); +if (ret) +return ret;spin_lock_irq (&crc->lock);@@ -197,40 +195,40 @@ static int crtc_crc_open(struct inode *inode, struct file *filep) return ret; } + ret = crtc->funcs->verify_crc_source (crtc, crc->source, &values_cnt); +if (ret) +return ret; + +if (WARN_ON (values_cnt >DRM_MAX_CRC_NR )) +return -EINVAL ; + +if (WARN_ON (values_cnt ==0 )) +return -EINVAL ; + + entries =kcalloc (DRM_CRC_ENTRIES_NR ,sizeof (*entries),GFP_KERNEL ); +if (!entries) +return -ENOMEM ; +spin_lock_irq (&crc->lock); -if (!crc->opened) +if (!crc->opened) { crc->opened = true; -else + crc->entries = entries; + crc->values_cnt = values_cnt; + }else { ret = -EBUSY ; + }spin_unlock_irq (&crc->lock); -if (ret) +if (ret) { +kfree (entries);return ret; + } - ret = crtc->funcs->set_crc_source (crtc, crc->source, &values_cnt); + ret = crtc->funcs->set_crc_source (crtc, crc->source);if (ret) goto err; -if (WARN_ON (values_cnt >DRM_MAX_CRC_NR )) { - ret = -EINVAL ; - goto err_disable; - } - -if (WARN_ON (values_cnt ==0 )) { - ret = -EINVAL ; - goto err_disable; - } - - entries =kcalloc (DRM_CRC_ENTRIES_NR ,sizeof (*entries),GFP_KERNEL ); -if (!entries) { - ret = -ENOMEM ; - goto err_disable; - } -spin_lock_irq (&crc->lock); - crc->entries = entries; - crc->values_cnt = values_cnt; -/* * Only return once we got a first frame, so userspace doesn't have to * guess when this particular piece of HW will be ready to start @@ -247,7 +245,7 @@ static int crtc_crc_open(struct inode *inode, struct file *filep) return 0; err_disable: - crtc->funcs->set_crc_source (crtc,NULL , &values_cnt); + crtc->funcs->set_crc_source (crtc,NULL ); err:spin_lock_irq (&crc->lock);crtc_crc_cleanup (crc);@@ -259,9 +257,8 @@ static int crtc_crc_release(struct inode *inode, struct file *filep) {struct drm_crtc *crtc = filep->f_inode->i_private;struct drm_crtc_crc *crc = &crtc->crc; -size_t values_cnt; - crtc->funcs->set_crc_source (crtc,NULL , &values_cnt); + crtc->funcs->set_crc_source (crtc,NULL );spin_lock_irq (&crc->lock);crtc_crc_cleanup (crc);@@ -367,7 +364,7 @@ int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc) {struct dentry *crc_ent, *ent; -if (!crtc->funcs->set_crc_source) +if (!crtc->funcs->set_crc_source || !crtc->funcs->verify_crc_source)return 0 ; crc_ent =debugfs_create_dir ("crc" , crtc->debugfs_entry);(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_drv.hindex29b054de9e13..814f6f3e1595100644drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -2155,8 +2155,7 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);/* intel_pipe_crc.c */ #ifdef CONFIG_DEBUG_FS -int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name, - size_t *values_cnt); +int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name);int intel_crtc_verify_crc_source (struct drm_crtc *crtc,const char *source_name,size_t *values_cnt); const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_pipe_crc.cindex83f9ade0cd81..f3c9010e332a100644drivers/gpu/drm/i915/intel_pipe_crc.c +1
-2@@ -583,8 +583,7 @@ int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, return -EINVAL; } -int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name, - size_t *values_cnt) +int intel_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[crtc->index];@@ -623,7 +622,6 @@ int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, } pipe_crc->skipped =0 ; - *values_cnt =5 ; out:intel_display_power_put (dev_priv, power_domain);(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex7124918372f8..72db1834dd50100644drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-4@@ -808,8 +808,7 @@ static int rcar_du_crtc_verify_crc_source(struct drm_crtc *crtc, }static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name, -size_t *values_cnt) +const char *source_name) {struct drm_modeset_acquire_ctx ctx;struct drm_crtc_state *crtc_state;@@ -837,8 +836,6 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, return -EINVAL ; } - *values_cnt =1 ; -/* Perform an atomic commit to set the CRC source. */ drm_modeset_acquire_init (&ctx,0 );(quoted diff) +0
-0
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.cindex 77e91b15ddb4..657372306623 100644drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2
-4@@ -1117,7 +1117,7 @@ static struct drm_connector *vop_get_edp_connector(struct vop *vop) }static int vop_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name,size_t *values_cnt) +const char *source_name) {struct vop *vop =to_vop (crtc);struct drm_connector *connector;@@ -1127,8 +1127,6 @@ static int vop_crtc_set_crc_source(struct drm_crtc *crtc, if (!connector) return -EINVAL; - *values_cnt =3 ; -if (source_name &&strcmp (source_name,"auto" ) ==0 ) ret =analogix_dp_start_crc (connector);else if (!source_name)@@ -1152,7 +1150,7 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,#else static int vop_crtc_set_crc_source (struct drm_crtc *crtc, - const char *source_name, size_t *values_cnt) +const char *source_name) {return -ENODEV ;}
include/drm/drm_crtc.h +1
-2@@ -682,8 +682,7 @@ struct drm_crtc_funcs {* * 0 on success or a negative error code on failure. */ -int (*set_crc_source)(struct drm_crtc *crtc,const char *source, -size_t *values_cnt); +int (*set_crc_source)(struct drm_crtc *crtc,const char *source);/** * @verify_crc_source: *
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/10 Revert "drm: crc: Wait for a frame before returning from open()"
In reply to Mahesh KumarThis reverts commit e8fa5671183c80342d520ad81d14fa79a9d4a680.
Don't wait for first CRC during crtc_crc_open. It avoids one frame wait during open. If application want to wait after read call, it can use poll/read blocking read() call.
--- drivers/gpu/drm/drm_debugfs_crc.c | 16 ---------------- 1 file changed, 16 deletions(-)
drivers/gpu/drm/drm_debugfs_crc.c +0 -16
@@ -228,24 +228,8 @@ static int crtc_crc_open(struct inode *inode, struct file *filep)if (ret) goto err; -spin_lock_irq (&crc->lock); -/* -* Only return once we got a first frame, so userspace doesn't have to -* guess when this particular piece of HW will be ready to start -* generating CRCs. -*/ - ret =wait_event_interruptible_lock_irq (crc->wq, -crtc_crc_data_count (crc), - crc->lock); -spin_unlock_irq (&crc->lock); - -if (ret) - goto err_disable; -return 0 ; -err_disable: - crtc->funcs->set_crc_source (crtc,NULL ); err:spin_lock_irq (&crc->lock);crtc_crc_cleanup (crc);
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/10 drm/rcar-du/crc: Implement get_crc_sources callback
In reply to Mahesh KumarThis patch implements get_crc_sources callback, which returns list of all the crc sources supported by driver in current platform.
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 11 ++++++ drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 + drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + 5 files changed, 83 insertions(+)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +11 -0
@@ -807,6 +807,16 @@ static int rcar_du_crtc_verify_crc_source(struct drm_crtc *crtc,return 0 ; } +const char *const *rcar_du_crtc_get_crc_sources (struct drm_crtc *crtc, +size_t *count) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +struct rcar_du_device *rcdu = rcrtc->group->dev; + + *count = rcdu->sources_count; +return (const char *const *)rcdu->sources; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {
@@ -898,6 +908,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen3 = { .disable_vblank = rcar_du_crtc_disable_vblank, .set_crc_source = rcar_du_crtc_set_crc_source, .verify_crc_source = rcar_du_crtc_verify_crc_source, + .get_crc_sources = rcar_du_crtc_get_crc_sources, };/* -----------------------------------------------------------------------------
drivers/gpu/drm/rcar-du/rcar_du_drv.c +2 -0
@@ -401,6 +401,8 @@ static int rcar_du_remove(struct platform_device *pdev)drm_dev_unregister (ddev); +rcar_du_crc_sources_list_uninit (rcdu); +if (rcdu->fbdev)drm_fbdev_cma_fini (rcdu->fbdev);
drivers/gpu/drm/rcar-du/rcar_du_drv.h +2 -0
@@ -92,6 +92,8 @@ struct rcar_du_device {unsigned int dpad0_source;unsigned int vspd1_sink; +char **sources; +size_t sources_count; }; static inline bool rcar_du_has(struct rcar_du_device *rcdu,
drivers/gpu/drm/rcar-du/rcar_du_kms.c +67 -0
79 lines not on this page · raw message
drivers/gpu/drm/rcar-du/rcar_du_kms.h +1 -0
@@ -32,6 +32,7 @@ struct rcar_du_format_info {const struct rcar_du_format_info *rcar_du_format_info (u32 fourcc);int rcar_du_modeset_init (struct rcar_du_device *rcdu); +void rcar_du_crc_sources_list_uninit (struct rcar_du_device *rcdu);int rcar_du_dumb_create (struct drm_file *file,struct drm_device *dev,struct drm_mode_create_dumb *args);
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/10] drm/rcar-du/crc: Implement get_crc_sources callback
Hi Mahesh,
Thank you for the patch.
Quoted 21 lines · On Thursday, 12 July 2018 11:36:35 EEST Mahesh Kumar wrote:
This patch implements
get_crc_sourcescallback, which returns list of all the crc sources supported by driver in current platform.Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 11 ++++++ drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 + drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 +++++++++++++++++++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + 5 files changed, 83 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex72db1834dd50..8da064daf9c9100644drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0
-0@@ -807,6 +807,16 @@ static int rcar_du_crtc_verify_crc_source(struct drm_crtc *crtc, return 0; }
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static int rcar_du_crtc_verify_crc_source(struct · line 818
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +9
-0+const char *const *rcar_du_crtc_get_crc_sources (struct drm_crtc *crtc, +size_t *count) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +struct rcar_du_device *rcdu = rcrtc->group->dev; + + *count = rcdu->sources_count; +return (const char *const *)rcdu->sources; +}
The list of sources has to be stored per-CRTC, as in most cases planes are not shared between CRTCs on Gen3 hardware where CRC computation is available. On Gen2 hardware planes are shared between CRTCs (but in groups of two CRTCs), but CRC computation isn't available, so you shouldn't compute the list of sources in that case.
Quoted 17 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-0static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {@@ -898,6 +908,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen3 = { .disable_vblank = rcar_du_crtc_disable_vblank, .set_crc_source = rcar_du_crtc_set_crc_source, .verify_crc_source = rcar_du_crtc_verify_crc_source, + .get_crc_sources = rcar_du_crtc_get_crc_sources, };/* ------------------------------------------------------------------------ (quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_drv.cindex02aee6cb0e53..b2c9b7e862d5100644
drivers/gpu/drm/rcar-du/rcar_du_drv.c static int rcar_du_remove(struct platform_device *pdev) · line 404
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1
-0@@ -401,6 +401,8 @@ static int rcar_du_remove(struct platform_device *pdev)drm_dev_unregister (ddev); +rcar_du_crc_sources_list_uninit (rcdu);
As the sources list has to be stored per-CRTC, you can move this to the CRTC cleanup handler.
drivers/gpu/drm/rcar-du/rcar_du_drv.h struct rcar_du_device { · line 95
Quoted 13 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0
-0if (rcdu->fbdev)drm_fbdev_cma_fini (rcdu->fbdev);(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_drv.hindexb3a25e8e07d0..fe0e2ec724b5100644drivers/gpu/drm/rcar-du/rcar_du_drv.h +1
-0@@ -92,6 +92,8 @@ struct rcar_du_device {unsigned int dpad0_source;unsigned int vspd1_sink; +char **sources;
Let's make this const.
drivers/gpu/drm/rcar-du/rcar_du_drv.h struct rcar_du_device { · line 96
Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_drv.h +1
-0+size_t sources_count;
It's not a size but a number of elements, I'd use unsigned int.
Quoted 9 lines
drivers/gpu/drm/rcar-du/rcar_du_drv.h +0
-0}; static inline bool rcar_du_has(struct rcar_du_device *rcdu,(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_kms.cindexf0bc7cc0e913..c74ced480c74100644
drivers/gpu/drm/rcar-du/rcar_du_kms.c static int rcar_du_properties_init(struct · line 430
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_kms.c +7
-0@@ -421,6 +421,70 @@ static int rcar_du_properties_init(struct rcar_du_device *rcdu) return 0; } +static void rcar_du_crc_sources_list_init (struct rcar_du_device *rcdu) +{ +struct drm_device *dev = rcdu->ddev; +struct drm_plane *plane; +char **sources; +size_t count; +int i =0 ;
i is never negative, you can make it an unsigned int.
Quoted 33 lines
drivers/gpu/drm/rcar-du/rcar_du_kms.c +33
-0+/* reserve 1 for "auto" source */ + count =1 ; + +drm_for_each_plane (plane, dev) + count++; + + sources =kmalloc_array (count,sizeof (char *),GFP_KERNEL ); +if (!sources) + goto fail; + + sources[i] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem; + + i++; +drm_for_each_plane (plane, dev) { +char name[16 ]; + +sprintf (name,"plane%d" , plane->base.id); + sources[i] =kstrdup (name,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem; + i++; + } + + rcdu->sources = sources; + rcdu->sources_count = count; +return ; + +fail_no_mem: +while (i >0 ) { + i--; +kfree (sources[i]);
drivers/gpu/drm/rcar-du/rcar_du_kms.c static int rcar_du_properties_init(struct rcar_du_device *rcdu) · line 474
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_kms.c +10
-0+ } +kfree (sources); +fail: + rcdu->sources =NULL ; + rcdu->sources_count =0 ; +} + +void rcar_du_crc_sources_list_uninit (struct rcar_du_device *rcdu) +{ +int i = rcdu->sources_count;
i is never negative, you can make it an unsigned int.
drivers/gpu/drm/rcar-du/rcar_du_kms.c static int rcar_du_properties_init(struct rcar_du_device *rcdu) · line 482
Quoted 7 lines
drivers/gpu/drm/rcar-du/rcar_du_kms.c +7
-0+if (!rcdu->sources) +return ; + +while (i >0 ) { + i--; +kfree (rcdu->sources[i]); + }
Anything wrong with a classic for loop ?
for (i = 0; i < rcdu->sources_count; ++i) kfree(rcdu->sources[i]);
Quoted 31 lines
drivers/gpu/drm/rcar-du/rcar_du_kms.c +8
-0+kfree (rcdu->sources); + rcdu->sources =NULL ; + rcdu->sources_count =0 ; +} +static int rcar_du_vsps_init (struct rcar_du_device *rcdu) {const struct device_node *np = rcdu->dev->of_node;@@ -591,6 +655,9 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)return ret; } +/* Initialize CRC-sources list */ +rcar_du_crc_sources_list_init (rcdu); +/* Initialize the encoders. */ ret =rcar_du_encoders_init (rcdu);if (ret <0 )(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_kms.hindex07951d5fe38b..29120e6b5666100644drivers/gpu/drm/rcar-du/rcar_du_kms.h +1
-0@@ -32,6 +32,7 @@ struct rcar_du_format_info {const struct rcar_du_format_info *rcar_du_format_info (u32 fourcc);int rcar_du_modeset_init (struct rcar_du_device *rcdu); +void rcar_du_crc_sources_list_uninit (struct rcar_du_device *rcdu);int rcar_du_dumb_create (struct drm_file *file,struct drm_device *dev,struct drm_mode_create_dumb *args);
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for Improve crc-core driver interface (rev6)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev6)
URL : https://patchwork.freedesktop.org/series/45246/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Commit: drm: crc: Introduce verify_crc_source callback Okay!
Commit: drm: crc: Introduce get_crc_sources callback Okay!
Commit: drm/rockchip/crc: Implement verify_crc_source callback Okay!
Commit: drm/amdgpu_dm/crc: Implement verify_crc_source callback -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3043:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static? -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3821:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3821:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3825:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3825:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3932:58: warning: Using plain integer as NULL pointer +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3044:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3822:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3822:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3933:58: warning: Using plain integer as NULL pointer
Commit: drm/rcar-du/crc: Implement verify_crc_source callback Okay!
Commit: drm/i915/crc: implement verify_crc_source callback Okay!
Commit: drm/i915/crc: implement get_crc_sources callback Okay!
Commit: drm/crc: Cleanup crtc_crc_open function
Okay!
Commit: Revert "drm: crc: Wait for a frame before returning from open()" Okay!
Commit: drm/rcar-du/crc: Implement get_crc_sources callback Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for Improve crc-core driver interface (rev6)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev6)
URL : https://patchwork.freedesktop.org/series/45246/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4474 -> Patchwork_9625 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9625 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9625, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/45246/revisions/6/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9625:
=== IGT changes ===
==== Possible regressions ====
igt@kms_pipe_crc_basic@bad-source:
{fi-cfl-8109u}: PASS -> FAIL +6
fi-skl-6770hq: PASS -> FAIL +6
fi-bwr-2160: PASS -> FAIL +4
fi-hsw-4770r: PASS -> FAIL +6
fi-glk-j4005: PASS -> FAIL
fi-cfl-8700k: PASS -> FAIL +6
fi-kbl-x1275: PASS -> FAIL
fi-kbl-guc: PASS -> FAIL
fi-glk-dsi: PASS -> FAIL
fi-bsw-n3050: PASS -> FAIL
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-ivb-3520m: PASS -> FAIL +6
fi-cfl-s3: PASS -> FAIL +6
fi-skl-6700hq: PASS -> FAIL +6
fi-skl-guc: PASS -> FAIL +6
fi-blb-e6850: PASS -> FAIL +4
fi-byt-j1900: PASS -> FAIL +4
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
fi-ilk-650: PASS -> FAIL +4
fi-byt-n2820: PASS -> FAIL +4
fi-snb-2520m: PASS -> FAIL +4
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
fi-bdw-5557u: PASS -> FAIL +6
fi-pnv-d510: PASS -> FAIL +4
fi-skl-6600u: PASS -> FAIL +6
fi-bxt-dsi: PASS -> FAIL +6
fi-hsw-4770: PASS -> FAIL +6
fi-cfl-guc: PASS -> FAIL +6
fi-ivb-3770: PASS -> FAIL +6
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
fi-hsw-peppy: PASS -> FAIL +6
fi-bdw-gvtdvm: PASS -> FAIL +6
fi-gdg-551: PASS -> FAIL +4
fi-kbl-7500u: PASS -> FAIL +6
fi-snb-2600: PASS -> FAIL +4
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-kbl-7567u: PASS -> FAIL +6
fi-skl-6260u: PASS -> FAIL +6
fi-skl-6700k2: PASS -> FAIL +6
fi-skl-gvtdvm: PASS -> FAIL +6
{fi-skl-iommu}: PASS -> FAIL +6
fi-bxt-j4205: PASS -> FAIL +6
fi-kbl-7560u: PASS -> FAIL +6
fi-whl-u: PASS -> FAIL +6
fi-kbl-r: PASS -> FAIL +6== Known issues ==
Here are the changes found in Patchwork_9625 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: PASS -> DMESG-FAIL (fdo#102614)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-glk-j4005: PASS -> FAIL (fdo#106211) +5
fi-bsw-n3050: PASS -> FAIL (fdo#106211) +1
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence:
fi-glk-dsi: PASS -> FAIL (fdo#106211) +5 {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#106211 https://bugs.freedesktop.org/show_bug.cgi?id=106211
== Participating hosts (45 -> 41) ==
Missing (4): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4474 -> Patchwork_9625
CI_DRM_4474: c298e0700edde3d016ae9b16d0ce2a098bee1022 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4549: e19fd5549e9cf603251704117fc64f4068be5016 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9625: a1bc1a978b7563fd9e1b66d6926229a4cd501f47 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
a1bc1a978b75 drm/rcar-du/crc: Implement get_crc_sources callback db679cae185b Revert "drm: crc: Wait for a frame before returning from open()" 95e9e595af65 drm/crc: Cleanup crtc_crc_open functionc6d9fef8d371 drm/i915/crc: implement get_crc_sources callback b99344d50a7c drm/i915/crc: implement verify_crc_source callback 2a47e1ef9ce0 drm/rcar-du/crc: Implement verify_crc_source callback ae604ad08730 drm/amdgpu_dm/crc: Implement verify_crc_source callback ed1d349d1af1 drm/rockchip/crc: Implement verify_crc_source callback bad8a20d0674 drm: crc: Introduce get_crc_sources callback 35784eaaf4f1 drm: crc: Introduce verify_crc_source callback
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9625/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Mahesh,
Thank you for the patches.
When resubmitting patch series, could you please add a version number to the [PATCH] prefix ? Otherwise it gets difficult to figure out which version is the latest. This can be done automatically with the -v argument to git-format- patch.
Quoted 46 lines · On Thursday, 12 July 2018 11:36:25 EEST Mahesh Kumar wrote:
This series improves crc-core <-> driver interface. This series adds following functionality in the crc-core
- Now control node will print all the available sources if implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup ofcrtc_crc_openfunction first allocate memory before enabling CRC generation
- Don't blockopen()call instead wait in crc read call.Following IGT will fail due to crc-core <-> driver interface change igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crcAMD/Rockchip/rcar code path is not validated and need inputs
Mahesh Kumar (10):
drm: crc: Introduceverify_crc_sourcecallback
drm: crc: Introduceget_crc_sourcescallback drm/rockchip/crc: Implementverify_crc_sourcecallback drm/amdgpu_dm/crc: Implementverify_crc_sourcecallback drm/rcar-du/crc: Implementverify_crc_sourcecallback drm/i915/crc: implementverify_crc_sourcecallback drm/i915/crc: implementget_crc_sourcescallback drm/crc: Cleanupcrtc_crc_openfunction
Revert "drm: crc: Wait for a frame before returning fromopen()" drm/rcar-du/crc: Implementget_crc_sourcescallbackdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++- drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++------- drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_drv.h | 9 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 119 +++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 + drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++- include/drm/drm_crtc.h | 40 ++++++- 14 files changed, 396 insertions(+), 74 deletions(-)
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi,
thanks for the review.
Quoted 8 lines · Laurent Pinchart
Hi Mahesh,
Thank you for the patches.
When resubmitting patch series, could you please add a version number to the [PATCH] prefix ? Otherwise it gets difficult to figure out which version is the latest. This can be done automatically with the -v argument to git-format- patch.
sure :), added patch prefix (now v4) and re-floated the series after addressing review comments in patches 03/10, 08/10 & 10/10.
-Mahesh
Quoted 33 lines · On Thursday, 12 July 2018 11:36:25 EEST Mahesh Kumar wrote:
Quoted 31 lines
This series improves crc-core <-> driver interface. This series adds following functionality in the crc-core
- Now control node will print all the available sources if implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup ofcrtc_crc_openfunction first allocate memory before enabling CRC generation
- Don't blockopen()call instead wait in crc read call.Following IGT will fail due to crc-core <-> driver interface change igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crcAMD/Rockchip/rcar code path is not validated and need inputs
Mahesh Kumar (10):
drm: crc: Introduceverify_crc_sourcecallback
drm: crc: Introduceget_crc_sourcescallback drm/rockchip/crc: Implementverify_crc_sourcecallback drm/amdgpu_dm/crc: Implementverify_crc_sourcecallback drm/rcar-du/crc: Implementverify_crc_sourcecallback drm/i915/crc: implementverify_crc_sourcecallback drm/i915/crc: implementget_crc_sourcescallback drm/crc: Cleanupcrtc_crc_openfunction
Revert "drm: crc: Wait for a frame before returning fromopen()" drm/rcar-du/crc: Implementget_crc_sourcescallback
Quoted 15 lines
Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++- drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++------- drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_drv.h | 9 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 119 +++++++++++++++++-Quoted 8 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++--- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 + drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++- include/drm/drm_crtc.h | 40 ++++++- 14 files changed, 396 insertions(+), 74 deletions(-)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx