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 may 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 | 165 ++++++++++++++++++--- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 +++- include/drm/drm_crtc.h | 41 ++++- 11 files changed, 407 insertions(+), 78 deletions(-)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 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.
Changes since V1:
- improve callback description
--- drivers/gpu/drm/drm_debugfs_crc.c | 8 ++++++++ include/drm/drm_crtc.h | 16 ++++++++++++++++ 2 files changed, 24 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;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 +16 -0
@@ -684,6 +684,22 @@ 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. Source parameter can be NULL +* while disabling crc source. +* +* 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
PATCH v4 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
@@ -700,6 +700,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
PATCH v4 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 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 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
@@ -2611,6 +2611,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 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 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
Changes Since V2:
- further optimize the code
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 71 ++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 20 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +51 -20
@@ -756,17 +756,11 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) rcrtc->vblank_enable = false; } -static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name, -size_t *values_cnt) +static int rcar_du_crtc_parse_crc_source (struct rcar_du_crtc *rcrtc, +const char *source_name, +enum vsp1_du_crc_source *s) { -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; +unsigned int index;int ret;/*
@@ -774,30 +768,66 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,* CRC on an input plane (%u is the plane ID), and "auto" to compute the * CRC on the composer (VSP) output. */ +if (!source_name) { - source =VSP1_DU_CRC_NONE ; + *s =VSP1_DU_CRC_NONE ; +return 0 ; }else if (!strcmp (source_name,"auto" )) { - source =VSP1_DU_CRC_OUTPUT ; + *s =VSP1_DU_CRC_OUTPUT ; +return 0 ; }else if (strstarts (source_name,"plane" )) { - source =VSP1_DU_CRC_PLANE ; +unsigned int i; + + *s =VSP1_DU_CRC_PLANE ; 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 ; - } - } +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) +if (index == rcrtc->vsp->planes[i].plane.base.id) +return i;if (i >= rcrtc->vsp->num_planes)return -EINVAL ; - }else { + } + +return -EINVAL ; +} + +static int rcar_du_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name, +size_t *values_cnt) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +enum vsp1_du_crc_source source; + +if (rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source) <0 ) { +DRM_DEBUG_DRIVER ("unknown source %s\n" , source_name);return -EINVAL ; } + *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 ; +int ret; + + ret =rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source); +if (ret <0 ) +return ret; + + index = ret; *values_cnt =1 ;/* Perform an atomic commit to set the CRC source. */
@@ -861,6 +891,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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 05/10] drm/rcar-du/crc: Implement verify_crc_source callback
Hi Mahesh,
Thank you for the patch.
Quoted 22 lines · On Friday, 13 July 2018 16:59:37 EEST Mahesh Kumar wrote:
This patch implements "
verify_crc_source" callback function for rcar drm driver.Changes Since V1:
- avoid duplication of code
Changes Since V2:
- further optimize the 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 | 71 +++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 20 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex15dc9caa128b..dfbba1acc31f100644
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static void rcar_du_crtc_disable_vblank(struct · line 761
Quoted 9 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-3@@ -756,17 +756,11 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) rcrtc->vblank_enable = false; } -static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name, -size_t *values_cnt) +static int rcar_du_crtc_parse_crc_source (struct rcar_du_crtc *rcrtc, +const char *source_name, +enum vsp1_du_crc_source *s)
I'd name the parameter source, it's more explicit.
Quoted 34 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-7{ -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; +unsigned int index;int ret;/* @@ -774,30 +768,66 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, * CRC on an input plane (%u is the plane ID), and "auto" to computethe * CRC on the composer (VSP) output.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +8
-3*/ +if (!source_name) { - source =VSP1_DU_CRC_NONE ; + *s =VSP1_DU_CRC_NONE ; +return 0 ; }else if (!strcmp (source_name,"auto" )) { - source =VSP1_DU_CRC_OUTPUT ; + *s =VSP1_DU_CRC_OUTPUT ; +return 0 ; }else if (strstarts (source_name,"plane" )) { - source =VSP1_DU_CRC_PLANE ; +unsigned int i; + + *s =VSP1_DU_CRC_PLANE ; ret =kstrtouint (source_name +strlen ("plane" ),10 , &index);if (ret <0 )return ret;
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, · line 789
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-6-for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { -if (index == rcrtc->vsp->planes[i].plane.base.id) { - index = i; -break ; - } - } +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) +if (index == rcrtc->vsp->planes[i].plane.base.id) +return i;
Please use braces for the outer for loop. Even if not strictly required by the C language, it matches the style of the driver.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0
-0if (i >= rcrtc->vsp->num_planes)return -EINVAL ;
Won't this check always be true ? You can return -EINVAL unconditionally here.
Quoted 22 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +18
-1- }else { + } + +return -EINVAL ; +} + +static int rcar_du_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name, +size_t *values_cnt) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +enum vsp1_du_crc_source source; + +if (rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source) <0 ) { +DRM_DEBUG_DRIVER ("unknown source %s\n" , source_name);return -EINVAL ; } + *values_cnt =1 ; +return 0 ; +} +
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc, · line 823
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +10
-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 ;
No need to initialize index to 0.
With those small issues fixed,
Quoted 19 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +8
-1+int ret; + + ret =rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source); +if (ret <0 ) +return ret; + + index = ret; *values_cnt =1 ;/* Perform an atomic commit to set the CRC source. */ @@ -861,6 +891,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 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v5 5/10 drm/rcar-du/crc: Implement verify_crc_source callback
This patch implements "verify_crc_source" callback function for rcar drm driver.
Changes Since V1:
- avoid duplication of code
Changes Since V2:
- further optimize the code
Changes Since V3:
- Adopt to driver style
- Address review comments from Laurent Pinchart
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 69 ++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 20 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +49 -20
@@ -756,17 +756,11 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc) rcrtc->vblank_enable = false; } -static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc, -const char *source_name, -size_t *values_cnt) +static int rcar_du_crtc_parse_crc_source (struct rcar_du_crtc *rcrtc, +const char *source_name, +enum vsp1_du_crc_source *source) { -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; +unsigned int index;int ret;/*
@@ -774,30 +768,64 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,* CRC on an input plane (%u is the plane ID), and "auto" to compute the * CRC on the composer (VSP) output. */ +if (!source_name) { - source =VSP1_DU_CRC_NONE ; + *source =VSP1_DU_CRC_NONE ; +return 0 ; }else if (!strcmp (source_name,"auto" )) { - source =VSP1_DU_CRC_OUTPUT ; + *source =VSP1_DU_CRC_OUTPUT ; +return 0 ; }else if (strstarts (source_name,"plane" )) { - source =VSP1_DU_CRC_PLANE ; +unsigned int i; + + *source =VSP1_DU_CRC_PLANE ; 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 (index == rcrtc->vsp->planes[i].plane.base.id) +return i; } + } -if (i >= rcrtc->vsp->num_planes) -return -EINVAL ; - }else { +return -EINVAL ; +} + +static int rcar_du_crtc_verify_crc_source (struct drm_crtc *crtc, +const char *source_name, +size_t *values_cnt) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); +enum vsp1_du_crc_source source; + +if (rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source) <0 ) { +DRM_DEBUG_DRIVER ("unknown source %s\n" , source_name);return -EINVAL ; } + *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; +int ret; + + ret =rcar_du_crtc_parse_crc_source (rcrtc, source_name, &source); +if (ret <0 ) +return ret; + + index = ret; *values_cnt =1 ;/* Perform an atomic commit to set the CRC source. */
@@ -861,6 +889,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
PATCH v4 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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 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 v4 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
Changes since V2:
- rebase
--- 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 | 4 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +-- include/drm/drm_crtc.h | 3 +- 8 files changed, 37 insertions(+), 51 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 -3
@@ -812,8 +812,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 rcar_du_crtc *rcrtc =to_rcar_crtc (crtc);struct drm_modeset_acquire_ctx ctx;
@@ -828,7 +827,6 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,return ret; index = ret; - *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
PATCH v4 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 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 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.
Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 96 +++++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 98 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +95 -1
@@ -691,6 +691,79 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, }; +static void rcar_du_crtc_crc_sources_list_init (struct rcar_du_crtc *rcrtc) +{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +struct drm_device *dev = rcrtc->crtc.dev; +struct drm_crtc *crtc = &rcrtc->crtc; +struct drm_plane *plane; +unsigned int count; +const char **sources; +u32 plane_mask; +int i =0 ; + +/* CRC available only on Gen3 HW */ +if (rcdu->info->gen <3 ) + goto fail; + +drm_for_each_plane (plane, dev) { +if (drm_crtc_mask (crtc) & plane->possible_crtcs) { + count++; + plane_mask |=drm_plane_mask (plane); + } + } + +/* reserve 1 for "auto" source */ + count +=1 ; + 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_mask (plane, dev, plane_mask) { +char name[16 ]; + +sprintf (name,"plane%d" , plane->base.id); + sources[i] =kstrdup (name,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem; + i++; + } + + rcrtc->sources = sources; + rcrtc->sources_count = count; +return ; + +fail_no_mem: +while (i >0 ) { + i--; +kfree (sources[i]); + } +kfree (sources); +fail: + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} + +static void rcar_du_crtc_crc_sources_list_uninit (struct rcar_du_crtc *rcrtc) +{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} +static struct drm_crtc_state *rcar_du_crtc_atomic_duplicate_state (struct drm_crtc *crtc) {
@@ -717,6 +790,15 @@ static void rcar_du_crtc_atomic_destroy_state(struct drm_crtc *crtc,kfree (to_rcar_crtc_state (state)); } +static void rcar_du_crtc_cleanup (struct drm_crtc *crtc) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); + +rcar_du_crtc_crc_sources_list_uninit (rcrtc); + +return drm_crtc_cleanup (crtc); +} +static void rcar_du_crtc_reset (struct drm_crtc *crtc) {struct rcar_du_crtc_state *state;
@@ -811,6 +893,15 @@ 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); + + *count = rcrtc->sources_count; +return (const char *const *)rcrtc->sources; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {
@@ -881,7 +972,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen2 = {static const struct drm_crtc_funcs crtc_funcs_gen3 = { .reset = rcar_du_crtc_reset, - .destroy = drm_crtc_cleanup, + .destroy = rcar_du_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,
@@ -890,6 +981,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, };/* -----------------------------------------------------------------------------
@@ -1028,5 +1120,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,return ret; } +rcar_du_crtc_crc_sources_list_init (rcrtc); +return 0 ; }
drivers/gpu/drm/rcar-du/rcar_du_crtc.h +3 -0
@@ -67,6 +67,9 @@ struct rcar_du_crtc {struct rcar_du_group *group;struct rcar_du_vsp *vsp;unsigned int vsp_pipe; + +const char **sources; +unsigned int sources_count; };#define to_rcar_crtc (c) container_of(c, struct rcar_du_crtc, crtc)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 10/10] drm/rcar-du/crc: Implement get_crc_sources callback
Hi Mahesh,
Thank you for the patch.
Quoted 23 lines · On Friday, 13 July 2018 16:59:42 EEST Mahesh Kumar wrote:
This patch implements
get_crc_sourcescallback, which returns list of all the crc sources supported by driver in current platform.Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 96 ++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 98 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex6a29055a4ab0..bbe417e93fe3100644drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0
-0@@ -691,6 +691,79 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, };
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 703
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +10
-0+static void rcar_du_crtc_crc_sources_list_init (struct rcar_du_crtc *rcrtc) +{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +struct drm_device *dev = rcrtc->crtc.dev; +struct drm_crtc *crtc = &rcrtc->crtc; +struct drm_plane *plane; +unsigned int count; +const char **sources; +u32 plane_mask; +int i =0 ;
i never takes negative values, it can be an unsigned int.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 705
Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-0+/* CRC available only on Gen3 HW */
Please capitalize sentences and end them with a period in comments to match the driver's style. This applies to other locations in this patch.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 706
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+if (rcdu->info->gen <3 ) + goto fail;
You can just return here, sources_count and sources are initialized to 0 when the rcar_du_crtc structure is allocated.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 714
Quoted 6 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +6
-0+drm_for_each_plane (plane, dev) { +if (drm_crtc_mask (crtc) & plane->possible_crtcs) { + count++; + plane_mask |=drm_plane_mask (plane); + } + }
You can instead iterate over the planes of the associated VSP (hardware composer).
/* Reserve 1 for "auto" source. */ count = rcrtc->vsp->num_planes + 1;
and get rid of plane_mask.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 718
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-0+/* reserve 1 for "auto" source */ + count +=1 ; + sources =kmalloc_array (count,sizeof (char *),GFP_KERNEL );
s/sizeof(char *)/sizeof(*sources)/
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 730
Quoted 12 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +12
-0+if (!sources) + goto fail; + + sources[i] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem; + + i++; +drm_for_each_plane_mask (plane, dev, plane_mask) { +char name[16 ]; + +sprintf (name,"plane%d" , plane->base.id);
The ID is an unsigned integer, you should use %u.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 733
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-0+ sources[i] =kstrdup (name,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem;
As there will be a single error label, you can just name it "error".
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 732
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+ i++; + }
You can iterate over the VSP planes here too.
for (i = 0; i < rcrtc->vsp->num_planes; ++i) {
struct drm_plane *plane = &rcrtc->vsp->planes[i].plane;
char name[16];
sprintf(name, "plane%u", plane->base.id);
sources[i+1] = kstrdup(name, GFP_KERNEL);
if (!sources[i+1])
goto error;
}drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 745
Quoted 9 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +9
-0+ rcrtc->sources = sources; + rcrtc->sources_count = count; +return ; + +fail_no_mem: +while (i >0 ) { + i--; +kfree (sources[i]); + }
You'll have to adapt it based on the code above.
Quoted 42 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +30
-0+kfree (sources); +fail: + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} + +static void rcar_du_crtc_crc_sources_list_uninit (struct rcar_du_crtc *rcrtc) +{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} +static struct drm_crtc_state *rcar_du_crtc_atomic_duplicate_state (struct drm_crtc *crtc) {@@ -717,6 +790,15 @@ static void rcar_du_crtc_atomic_destroy_state(structdrm_crtc *crtc,kfree (to_rcar_crtc_state (state )); } +static void rcar_du_crtc_cleanup (struct drm_crtc *crtc) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); + +rcar_du_crtc_crc_sources_list_uninit (rcrtc); + +return drm_crtc_cleanup (crtc); +} +static void rcar_du_crtc_reset (struct drm_crtc *crtc) {struct rcar_du_crtc_state *state;
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static int rcar_du_crtc_verify_crc_source(struct · line 902
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +7
-0@@ -811,6 +893,15 @@ 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); + + *count = rcrtc->sources_count; +return (const char *const *)rcrtc->sources;
Shouldn't you declare rcrtc->sources as a const char * const * field instead of casting it here ?
Quoted 46 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +4
-3+} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {@@ -881,7 +972,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen2 = {static const struct drm_crtc_funcs crtc_funcs_gen3 = { .reset = rcar_du_crtc_reset, - .destroy = drm_crtc_cleanup, + .destroy = rcar_du_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,@@ -890,6 +981,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, };/* --------------------------------------------------------------------------- -- @@ -1028,5 +1120,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex, return ret;
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0} +rcar_du_crtc_crc_sources_list_init (rcrtc); +return 0 ; }(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.hindex7680cb2636c8..0cd0c1655beb100644drivers/gpu/drm/rcar-du/rcar_du_crtc.h +3
-0@@ -67,6 +67,9 @@ struct rcar_du_crtc {struct rcar_du_group *group;struct rcar_du_vsp *vsp;unsigned int vsp_pipe; + +const char **sources; +unsigned int sources_count; };#define to_rcar_crtc (c) container_of(c, struct rcar_du_crtc, crtc)
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 10/10] drm/rcar-du/crc: Implement get_crc_sources callback
Hi Laurent!
Thanks for the review. :)
will update patch and resubmit
-Mahesh
Quoted 212 lines · Laurent Pinchart
Hi Mahesh,
Thank you for the patch.
Quoted 23 lines · On Friday, 13 July 2018 16:59:42 EEST Mahesh Kumar wrote:
This patch implements
get_crc_sourcescallback, which returns list of all the crc sources supported by driver in current platform.Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 96 ++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 98 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex6a29055a4ab0..bbe417e93fe3100644drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0
-0@@ -691,6 +691,79 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, };drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 703
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +10
-0+static void rcar_du_crtc_crc_sources_list_init (struct rcar_du_crtc *rcrtc) +{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +struct drm_device *dev = rcrtc->crtc.dev; +struct drm_crtc *crtc = &rcrtc->crtc; +struct drm_plane *plane; +unsigned int count; +const char **sources; +u32 plane_mask; +int i =0 ;i never takes negative values, it can be an unsigned int.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 705
Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-0+/* CRC available only on Gen3 HW */ Please capitalize sentences and end them with a period in comments to match the driver's style. This applies to other locations in this patch.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 706
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+if (rcdu->info->gen <3 ) + goto fail;You can just return here,
sources_countand sources are initialized to 0 when thercar_du_crtcstructure is allocated.drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 714
Quoted 6 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +6
-0+drm_for_each_plane (plane, dev) { +if (drm_crtc_mask (crtc) & plane->possible_crtcs) { + count++; + plane_mask |=drm_plane_mask (plane); + } + }You can instead iterate over the planes of the associated VSP (hardware composer).
/* Reserve 1 for "auto" source. */ count = rcrtc->vsp->num_planes + 1;and get rid of
plane_mask.drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 718
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-0+/* reserve 1 for "auto" source */ + count +=1 ; + sources =kmalloc_array (count,sizeof (char *),GFP_KERNEL );s/sizeof(char *)/sizeof(*sources)/
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 730
Quoted 12 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +12
-0+if (!sources) + goto fail; + + sources[i] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem; + + i++; +drm_for_each_plane_mask (plane, dev, plane_mask) { +char name[16 ]; + +sprintf (name,"plane%d" , plane->base.id);The ID is an unsigned integer, you should use %u.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 733
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-0+ sources[i] =kstrdup (name,GFP_KERNEL ); +if (!sources[i]) + goto fail_no_mem;As there will be a single error label, you can just name it "error".
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 732
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+ i++; + }You can iterate over the VSP planes here too.
for (i = 0; i < rcrtc->vsp->num_planes; ++i) { struct drm_plane *plane = &rcrtc->vsp->planes[i].plane; char name[16]; sprintf(name, "plane%u", plane->base.id); sources[i+1] = kstrdup(name, GFP_KERNEL); if (!sources[i+1]) goto error; }drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 745
Quoted 9 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +9
-0+ rcrtc->sources = sources; + rcrtc->sources_count = count; +return ; + +fail_no_mem: +while (i >0 ) { + i--; +kfree (sources[i]); + }You'll have to adapt it based on the code above.
Quoted 42 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +30
-0+kfree (sources); +fail: + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} + +static void rcar_du_crtc_crc_sources_list_uninit (struct rcar_du_crtc *rcrtc) +{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} +static struct drm_crtc_state *rcar_du_crtc_atomic_duplicate_state (struct drm_crtc *crtc) {@@ -717,6 +790,15 @@ static void rcar_du_crtc_atomic_destroy_state(structdrm_crtc *crtc,kfree (to_rcar_crtc_state (state )); } +static void rcar_du_crtc_cleanup (struct drm_crtc *crtc) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); + +rcar_du_crtc_crc_sources_list_uninit (rcrtc); + +return drm_crtc_cleanup (crtc); +} +static void rcar_du_crtc_reset (struct drm_crtc *crtc) {struct rcar_du_crtc_state *state;drivers/gpu/drm/rcar-du/rcar_du_crtc.c static int rcar_du_crtc_verify_crc_source(struct · line 902
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +7
-0@@ -811,6 +893,15 @@ 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); + + *count = rcrtc->sources_count; +return (const char *const *)rcrtc->sources;Shouldn't you declare
rcrtc->sourcesas a const char * const * field instead of casting it here ?Quoted 45 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +4
-3+} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {@@ -881,7 +972,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen2 = {static const struct drm_crtc_funcs crtc_funcs_gen3 = { .reset = rcar_du_crtc_reset, - .destroy = drm_crtc_cleanup, + .destroy = rcar_du_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,@@ -890,6 +981,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, };/* --------------------------------------------------------------------------- -- @@ -1028,5 +1120,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex, return ret;
}drivers/gpu/drm/rcar-du/rcar_du_crtc.c +2
-0+rcar_du_crtc_crc_sources_list_init (rcrtc); +return 0 ; }(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.hindex7680cb2636c8..0cd0c1655beb100644drivers/gpu/drm/rcar-du/rcar_du_crtc.h +3
-0@@ -67,6 +67,9 @@ struct rcar_du_crtc {struct rcar_du_group *group;struct rcar_du_vsp *vsp;unsigned int vsp_pipe; + +const char **sources; +unsigned int sources_count; };
Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_crtc.h struct rcar_du_crtc { · line 75
Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_crtc.h +0
-0#define to_rcar_crtc (c) container_of(c, struct rcar_du_crtc, crtc)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 10/10 drm/rcar-du/crc: Implement get_crc_sources callback
In reply to Laurent PinchartThis patch implements get_crc_sources callback, which returns list of all the crc sources supported by driver in current platform.
Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3
Changes Since V2:
- Adopt to driver style
- Address other review comments from Laurent Pinchart
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 85 +++++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 87 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +84 -1
@@ -691,6 +691,68 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, }; +static void rcar_du_crtc_crc_sources_list_init (struct rcar_du_crtc *rcrtc) +{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +const char **sources; +unsigned int count; +int i =-1 ; + +/* CRC available only on Gen3 HW. */ +if (rcdu->info->gen <3 ) +return ; + +/* Reserve 1 for "auto" source. */ + count = rcrtc->vsp->num_planes +1 ; + + sources =kmalloc_array (count,sizeof (*sources),GFP_KERNEL ); +if (!sources) +return ; + + sources[0 ] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[0 ]) + goto error; + +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +struct drm_plane *plane = &rcrtc->vsp->planes[i].plane; +char name[16 ]; + +sprintf (name,"plane%u" , plane->base.id); + sources[i +1 ] =kstrdup (name,GFP_KERNEL ); +if (!sources[i +1 ]) + goto error; + } + + rcrtc->sources = sources; + rcrtc->sources_count = count; +return ; + +error: +while (i >=0 ) { +kfree (sources[i]); + i--; + } +kfree (sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} + +static void rcar_du_crtc_crc_sources_list_uninit (struct rcar_du_crtc *rcrtc) +{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} +static struct drm_crtc_state *rcar_du_crtc_atomic_duplicate_state (struct drm_crtc *crtc) {
@@ -717,6 +779,15 @@ static void rcar_du_crtc_atomic_destroy_state(struct drm_crtc *crtc,kfree (to_rcar_crtc_state (state)); } +static void rcar_du_crtc_cleanup (struct drm_crtc *crtc) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); + +rcar_du_crtc_crc_sources_list_uninit (rcrtc); + +return drm_crtc_cleanup (crtc); +} +static void rcar_du_crtc_reset (struct drm_crtc *crtc) {struct rcar_du_crtc_state *state;
@@ -809,6 +880,15 @@ 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); + + *count = rcrtc->sources_count; +return rcrtc->sources; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {
@@ -879,7 +959,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen2 = {static const struct drm_crtc_funcs crtc_funcs_gen3 = { .reset = rcar_du_crtc_reset, - .destroy = drm_crtc_cleanup, + .destroy = rcar_du_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,
@@ -888,6 +968,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, };/* -----------------------------------------------------------------------------
@@ -1026,5 +1107,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,return ret; } +rcar_du_crtc_crc_sources_list_init (rcrtc); +return 0 ; }
drivers/gpu/drm/rcar-du/rcar_du_crtc.h +3 -0
@@ -67,6 +67,9 @@ struct rcar_du_crtc {struct rcar_du_group *group;struct rcar_du_vsp *vsp;unsigned int vsp_pipe; + +const char *const *sources; +unsigned int sources_count; };#define to_rcar_crtc (c) container_of(c, struct rcar_du_crtc, crtc)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 10/10] drm/rcar-du/crc: Implement get_crc_sources callback
Hi Mahesh,
Thank you for the patch.
Quoted 9 lines · On Monday, 23 July 2018 13:44:51 EEST Mahesh Kumar wrote:
This patch implements
get_crc_sourcescallback, which returns list of all the crc sources supported by driver in current platform.Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3
Changes Since V2:
- Adopt to driver style
- Address other review comments from Laurent Pinchart
I'm pretty sure this has changed since v4 as well.
Quoted 14 lines
Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 85 ++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 87 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.cindex43e67cffdee0..39981ce422e1100644
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs · line 695
Quoted 5 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1
-0@@ -691,6 +691,68 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, }; +static void rcar_du_crtc_crc_sources_list_init (struct rcar_du_crtc *rcrtc)
Let's shorten the function name to rcar_du_crtc_crc_init().
Quoted 34 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +34
-0+{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +const char **sources; +unsigned int count; +int i =-1 ; + +/* CRC available only on Gen3 HW. */ +if (rcdu->info->gen <3 ) +return ; + +/* Reserve 1 for "auto" source. */ + count = rcrtc->vsp->num_planes +1 ; + + sources =kmalloc_array (count,sizeof (*sources),GFP_KERNEL ); +if (!sources) +return ; + + sources[0 ] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[0 ]) + goto error; + +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +struct drm_plane *plane = &rcrtc->vsp->planes[i].plane; +char name[16 ]; + +sprintf (name,"plane%u" , plane->base.id); + sources[i +1 ] =kstrdup (name,GFP_KERNEL ); +if (!sources[i +1 ]) + goto error; + } + + rcrtc->sources = sources; + rcrtc->sources_count = count; +return ;
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = { · line 738
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +10
-0+ +error: +while (i >=0 ) { +kfree (sources[i]); + i--; + } +kfree (sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ;
The two last lines are not needed as ->sources and ->sources_count are only initialized at the very end of the function if no error occurred.
drivers/gpu/drm/rcar-du/rcar_du_crtc.c static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +3
-0+} + +static void rcar_du_crtc_crc_sources_list_uninit (struct rcar_du_crtc *rcrtc)
Similarly, and for consistency as the driver uses the _cleanup suffix throughout the code, I would name this rcar_du_crtc_crc_cleanup().
With those three small changes,
Quoted 13 lines
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +13
-0+{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +}
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v6 10/10 drm/rcar-du/crc: Implement get_crc_sources callback
This patch implements get_crc_sources callback, which returns list of all the crc sources supported by driver in current platform.
Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3
Changes Since V2:
- Adopt to driver style
- Address other review comments from Laurent Pinchart
Changes Since V3/4/5: (Laurent Pinchart review)
- s/rcar_du_crtc_crc_sources_list_init/rcar_du_crtc_crc_init
- s/rcar_du_crtc_crc_sources_list_uninit/rcar_du_crtc_crc_cleanup
- other cleanup
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++++++++++++++++++++++++- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 3 ++ 2 files changed, 84 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +81 -1
@@ -691,6 +691,65 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .atomic_disable = rcar_du_crtc_atomic_disable, }; +static void rcar_du_crtc_crc_init (struct rcar_du_crtc *rcrtc) +{ +struct rcar_du_device *rcdu = rcrtc->group->dev; +const char **sources; +unsigned int count; +int i =-1 ; + +/* CRC available only on Gen3 HW. */ +if (rcdu->info->gen <3 ) +return ; + +/* Reserve 1 for "auto" source. */ + count = rcrtc->vsp->num_planes +1 ; + + sources =kmalloc_array (count,sizeof (*sources),GFP_KERNEL ); +if (!sources) +return ; + + sources[0 ] =kstrdup ("auto" ,GFP_KERNEL ); +if (!sources[0 ]) + goto error; + +for (i =0 ; i < rcrtc->vsp->num_planes; ++i) { +struct drm_plane *plane = &rcrtc->vsp->planes[i].plane; +char name[16 ]; + +sprintf (name,"plane%u" , plane->base.id); + sources[i +1 ] =kstrdup (name,GFP_KERNEL ); +if (!sources[i +1 ]) + goto error; + } + + rcrtc->sources = sources; + rcrtc->sources_count = count; +return ; + +error: +while (i >=0 ) { +kfree (sources[i]); + i--; + } +kfree (sources); +} + +static void rcar_du_crtc_crc_cleanup (struct rcar_du_crtc *rcrtc) +{ +unsigned int i; + +if (!rcrtc->sources) +return ; + +for (i =0 ; i < rcrtc->sources_count; i++) +kfree (rcrtc->sources[i]); +kfree (rcrtc->sources); + + rcrtc->sources =NULL ; + rcrtc->sources_count =0 ; +} +static struct drm_crtc_state *rcar_du_crtc_atomic_duplicate_state (struct drm_crtc *crtc) {
@@ -717,6 +776,15 @@ static void rcar_du_crtc_atomic_destroy_state(struct drm_crtc *crtc,kfree (to_rcar_crtc_state (state)); } +static void rcar_du_crtc_cleanup (struct drm_crtc *crtc) +{ +struct rcar_du_crtc *rcrtc =to_rcar_crtc (crtc); + +rcar_du_crtc_crc_cleanup (rcrtc); + +return drm_crtc_cleanup (crtc); +} +static void rcar_du_crtc_reset (struct drm_crtc *crtc) {struct rcar_du_crtc_state *state;
@@ -809,6 +877,15 @@ 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); + + *count = rcrtc->sources_count; +return rcrtc->sources; +} +static int rcar_du_crtc_set_crc_source (struct drm_crtc *crtc,const char *source_name) {
@@ -879,7 +956,7 @@ static const struct drm_crtc_funcs crtc_funcs_gen2 = {static const struct drm_crtc_funcs crtc_funcs_gen3 = { .reset = rcar_du_crtc_reset, - .destroy = drm_crtc_cleanup, + .destroy = rcar_du_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,
@@ -888,6 +965,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, };/* -----------------------------------------------------------------------------
@@ -1026,5 +1104,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,return ret; } +rcar_du_crtc_crc_init (rcrtc); +return 0 ; }
drivers/gpu/drm/rcar-du/rcar_du_crtc.h +3 -0
@@ -67,6 +67,9 @@ struct rcar_du_crtc {struct rcar_du_group *group;struct rcar_du_vsp *vsp;unsigned int vsp_pipe; + +const char *const *sources; +unsigned int sources_count; };#define to_rcar_crtc (c) container_of(c, struct rcar_du_crtc, crtc)
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [PATCH V6 10/10] drm/rcar-du/crc: Implement get_crc_sources callback
Hey,
Op 08-08-18 om 17:26 schreef Mahesh Kumar:
Quoted 14 lines
This patch implements
get_crc_sourcescallback, which returns list of all the crc sources supported by driver in current platform.Changes Since V1:
- move sources list per-crtc
- init sources-list only for gen3
Changes Since V2:
- Adopt to driver style
- Address other review comments from Laurent Pinchart
Changes Since V3/4/5: (Laurent Pinchart review)
- s/rcar_du_crtc_crc_sources_list_init/rcar_du_crtc_crc_init
- s/rcar_du_crtc_crc_sources_list_uninit/rcar_du_crtc_crc_cleanup
- other cleanup
Quoted 4 lines
Signed-off-by Mahesh Kumar <[email protected]>Cc Laurent Pinchart <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>
Thanks, I've pushed this and patch 1-7 to drm-misc-next. 8/ needs to be rebased because the VKMS driver appears to be able to generate CRC's now.
Didn't yet push 9/ because of the polling change needed in igt.
~Maarten
_______________________________________________
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 (rev7)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev7)
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 (rev7)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev7)
URL : https://patchwork.freedesktop.org/series/45246/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4485 -> Patchwork_9646 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9646 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9646, 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/7/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9646:
=== 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: NOTRUN -> 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-elk-e7500: 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_9646 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@basic-flip-vs-modeset:
fi-skl-6700hq: PASS -> DMESG-WARN (fdo#105998) +1
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#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
fdo#106211 https://bugs.freedesktop.org/show_bug.cgi?id=106211
== Participating hosts (46 -> 42) ==
Additional (1): fi-ivb-3520m
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4485 -> Patchwork_9646
CI_DRM_4485: d3d471400bf907f8a6e51c8a475202a61bcdf2de @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4554: a742ebd9b4908c7eaca8a3d54f86b3d14583b5b5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9646: 6e17371f1118b5496d412cc59cdacc02fba74f44 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
6e17371f1118 drm/rcar-du/crc: Implement get_crc_sources callback 1588307b4c59 Revert "drm: crc: Wait for a frame before returning from open()" 6a4907c3d9d8 drm/crc: Cleanup crtc_crc_open function28e8ba2109d7 drm/i915/crc: implement get_crc_sources callback 4281e14868f5 drm/i915/crc: implement verify_crc_source callback cbace60311c0 drm/rcar-du/crc: Implement verify_crc_source callback 9a8298c0c01e drm/amdgpu_dm/crc: Implement verify_crc_source callback e5ad5dd3068a drm/rockchip/crc: Implement verify_crc_source callback 6d182e66ee7e drm: crc: Introduce get_crc_sources callback 297a2ab890ee drm: crc: Introduce verify_crc_source callback
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9646/issues.html
_______________________________________________
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 (rev9)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev9)
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:3834:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3834:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3838:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3838:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3945: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:3835:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3835:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3839:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3839:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3946: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 (rev9)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev9)
URL : https://patchwork.freedesktop.org/series/45246/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4527 -> Patchwork_9746 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9746 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9746, 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/9/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9746:
=== IGT changes ===
==== Possible regressions ====
igt@drv_selftest@mock_sanitycheck:
fi-glk-j4005: PASS -> DMESG-WARN
igt@kms_pipe_crc_basic@bad-source:
{fi-cfl-8109u}: PASS -> FAIL
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
fi-cfl-guc: PASS -> FAIL
fi-kbl-x1275: PASS -> FAIL
fi-kbl-guc: PASS -> FAIL
fi-glk-dsi: PASS -> FAIL
fi-bsw-n3050: PASS -> FAIL
fi-cfl-s3: PASS -> FAIL
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-ivb-3520m: 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-elk-e7500: 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-bsw-kefka}: PASS -> FAIL +4
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-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_9746 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_hangcheck:
fi-skl-guc: PASS -> DMESG-FAIL (fdo#107174)
fi-skl-6600u: PASS -> DMESG-FAIL (fdo#107174, fdo#106560)
fi-kbl-x1275: PASS -> DMESG-FAIL (fdo#106947, fdo#106560)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-cfl-s3: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
{fi-cfl-8109u}: PASS -> FAIL (fdo#103481) +5
fi-cfl-guc: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-glk-j4005: PASS -> FAIL (fdo#106211) +5
fi-cfl-8700k: PASS -> FAIL (fdo#103481) +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
igt@prime_vgem@basic-fence-flip:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106000)
==== Possible fixes ====
igt@kms_flip@basic-plain-flip:
fi-glk-j4005: DMESG-WARN (fdo#106097) -> PASS
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: DMESG-FAIL (fdo#106103, fdo#102614) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
fi-glk-j4005: DMESG-WARN (fdo#106000) -> PASS {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#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
fdo#106211 https://bugs.freedesktop.org/show_bug.cgi?id=106211
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
== Participating hosts (47 -> 42) ==
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4527 -> Patchwork_9746
CI_DRM_4527: 4557d4e14760a3dcb43a6be65432ee6bafacdb9e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4571: 65fccc149b85968cdce4737266b056059c1510f3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9746: 34cd5eb5aa8e22ca2168a73bf6aecb77fd0ac993 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
34cd5eb5aa8e drm/rcar-du/crc: Implement get_crc_sources callback 4953549de5f4 Revert "drm: crc: Wait for a frame before returning from open()" 4c3271493e66 drm/crc: Cleanup crtc_crc_open functione18b95917d80 drm/i915/crc: implement get_crc_sources callback 99951bdccc59 drm/i915/crc: implement verify_crc_source callback f484de58e02c drm/rcar-du/crc: Implement verify_crc_source callback 1ca03bdca98e drm/amdgpu_dm/crc: Implement verify_crc_source callback aee68f5bf02f drm/rockchip/crc: Implement verify_crc_source callback cfa3bcaa154f drm: crc: Introduce get_crc_sources callback 9bd2acce126a drm: crc: Introduce verify_crc_source callback
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9746/issues.html
_______________________________________________
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 (rev9)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev9)
URL : https://patchwork.freedesktop.org/series/45246/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4606 -> Patchwork_9842 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9842 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9842, 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/9/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9842:
=== IGT changes ===
==== Possible regressions ====
igt@kms_pipe_crc_basic@bad-source:
{fi-cfl-8109u}: PASS -> FAIL
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
fi-cfl-guc: PASS -> FAIL
fi-cnl-psr: PASS -> FAIL
fi-kbl-x1275: PASS -> FAIL
fi-kbl-guc: PASS -> FAIL
fi-glk-dsi: PASS -> FAIL
{fi-bsw-kefka}: PASS -> FAIL
fi-bsw-n3050: PASS -> FAIL
fi-cfl-s3: PASS -> FAIL
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-ivb-3520m: 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-elk-e7500: 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-ivb-3770: PASS -> FAIL +6
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
{fi-bdw-samus}: PASS -> FAIL +6
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_9842 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_coherency:
fi-gdg-551: PASS -> DMESG-FAIL (fdo#107164)
igt@drv_selftest@live_hangcheck:
fi-kbl-guc: PASS -> DMESG-FAIL (fdo#106947)
igt@drv_selftest@live_workarounds:
{fi-bsw-kefka}: PASS -> DMESG-FAIL (fdo#107292)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: PASS -> DMESG-FAIL (fdo#102614)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-cfl-s3: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
{fi-bsw-kefka}: PASS -> FAIL (fdo#106211) +3
{fi-cfl-8109u}: PASS -> FAIL (fdo#103481) +5
fi-cfl-guc: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
fi-cnl-psr: PASS -> FAIL (fdo#106211) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-glk-j4005: PASS -> FAIL (fdo#106211) +5
fi-cfl-8700k: PASS -> FAIL (fdo#103481) +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
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-bxt-dsi: PASS -> INCOMPLETE (fdo#103927)
{igt@kms_psr@primary_mmap_gtt}:
fi-cnl-psr: PASS -> DMESG-WARN (fdo#107372)
==== Possible fixes ====
igt@drv_selftest@live_workarounds:
fi-cnl-psr: DMESG-FAIL (fdo#107292) -> PASS
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-bsw-n3050: FAIL (fdo#100368) -> PASS
==== Warnings ====
{igt@kms_psr@primary_page_flip}:
fi-cnl-psr: DMESG-WARN (fdo#107372) -> DMESG-FAIL (fdo#107372) {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#106211 https://bugs.freedesktop.org/show_bug.cgi?id=106211
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107292 https://bugs.freedesktop.org/show_bug.cgi?id=107292
fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
== Participating hosts (51 -> 45) ==
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper
== Build changes ==
* Linux: CI_DRM_4606 -> Patchwork_9842
CI_DRM_4606: 603c0696f3c56d3f1e47c283de897448473c9041 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4584: 33f47ff4d64bd3996995dc5493deee26294e3aa3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9842: a0404fe90b280e5e4d28dc60893c2de6edb6e341 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
a0404fe90b28 drm/rcar-du/crc: Implement get_crc_sources callback 0df91446faf6 Revert "drm: crc: Wait for a frame before returning from open()" 1b246f61323a drm/crc: Cleanup crtc_crc_open function29b70c35d617 drm/i915/crc: implement get_crc_sources callback 9d020bad94f5 drm/i915/crc: implement verify_crc_source callback 92236958b71c drm/rcar-du/crc: Implement verify_crc_source callback a719041d8c6e drm/amdgpu_dm/crc: Implement verify_crc_source callback 0d7679b3fb43 drm/rockchip/crc: Implement verify_crc_source callback 9c8eab6d5336 drm: crc: Introduce get_crc_sources callback dcfdb93ad14d drm: crc: Introduce verify_crc_source callback
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9842/issues.html
_______________________________________________
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 (rev10)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev10)
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:3028: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:3819:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3819:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3823:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3823:27: warning: expression using sizeof(void) -drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3930:58: warning: Using plain integer as NULL pointer +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3029: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:3820:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3820:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3824:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3824:27: warning: expression using sizeof(void) +drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3931: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 (rev10)
In reply to Mahesh Kumar== Series Details ==
== Series Details ==
Series: Improve crc-core driver interface (rev10)
URL : https://patchwork.freedesktop.org/series/45246/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4633 -> Patchwork_9889 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_9889 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9889, 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/10/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9889:
=== IGT changes ===
==== Possible regressions ====
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-ivb-3520m: PASS -> FAIL +5
fi-skl-6700hq: PASS -> FAIL +5
fi-skl-guc: PASS -> FAIL +5
fi-blb-e6850: PASS -> FAIL +3
fi-byt-j1900: PASS -> FAIL +3
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
fi-ilk-650: PASS -> FAIL +3
fi-elk-e7500: PASS -> FAIL +3
fi-byt-n2820: PASS -> FAIL +3
fi-snb-2520m: PASS -> FAIL +3
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
fi-bdw-5557u: PASS -> FAIL +5
fi-pnv-d510: PASS -> FAIL +3
fi-skl-6600u: PASS -> FAIL +5
{fi-byt-clapper}: PASS -> FAIL +3
fi-bxt-dsi: NOTRUN -> FAIL +5
fi-hsw-4770: PASS -> FAIL +5
fi-ivb-3770: PASS -> FAIL +5
fi-bwr-2160: PASS -> FAIL +3
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
{fi-bdw-samus}: PASS -> FAIL +5
fi-hsw-peppy: PASS -> FAIL +5
fi-bdw-gvtdvm: PASS -> FAIL +5
fi-gdg-551: PASS -> FAIL +3
fi-kbl-7500u: PASS -> FAIL +5
fi-snb-2600: PASS -> FAIL +3
fi-hsw-4770r: PASS -> FAIL +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-kbl-7567u: PASS -> FAIL +5
fi-skl-6260u: PASS -> FAIL +5
fi-skl-6700k2: PASS -> FAIL +5
fi-skl-gvtdvm: PASS -> FAIL +5
{fi-skl-iommu}: PASS -> FAIL +5
fi-skl-6770hq: PASS -> FAIL +5
fi-bxt-j4205: PASS -> FAIL +5
fi-kbl-7560u: PASS -> FAIL +5
fi-whl-u: PASS -> FAIL +5
fi-kbl-r: PASS -> FAIL +5
==== Warnings ====
igt@kms_pipe_crc_basic@bad-source:
{fi-kbl-8809g}: SKIP -> PASS
fi-kbl-x1275: SKIP -> PASS
fi-kbl-guc: SKIP -> PASS
fi-bsw-n3050: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_9889 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_coherency:
fi-gdg-551: PASS -> DMESG-FAIL (fdo#107164)
igt@drv_selftest@live_workarounds:
fi-cnl-psr: PASS -> DMESG-FAIL (fdo#107292)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-cfl-s3: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
{fi-bsw-kefka}: PASS -> FAIL (fdo#106211) +3
{fi-cfl-8109u}: PASS -> FAIL (fdo#103481) +5
fi-cfl-guc: PASS -> FAIL (fdo#103481) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
fi-cnl-psr: PASS -> FAIL (fdo#106211) +5
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
fi-glk-j4005: PASS -> FAIL (fdo#106211) +5
fi-cfl-8700k: PASS -> FAIL (fdo#103481) +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
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-snb-2520m: PASS -> INCOMPLETE (fdo#103713)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
fi-skl-guc: DMESG-FAIL (fdo#107174) -> PASS
igt@drv_selftest@live_workarounds:
fi-whl-u: DMESG-FAIL (fdo#107292) -> PASS
fi-kbl-x1275: DMESG-FAIL (fdo#107292) -> PASS
igt@kms_frontbuffer_tracking@basic:
{fi-byt-clapper}: FAIL (fdo#103167) -> PASS
==== Warnings ====
{igt@kms_psr@primary_page_flip}:
fi-cnl-psr: DMESG-FAIL (fdo#107372) -> DMESG-WARN (fdo#107372) {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#106211 https://bugs.freedesktop.org/show_bug.cgi?id=106211
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
fdo#107292 https://bugs.freedesktop.org/show_bug.cgi?id=107292
fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
== Participating hosts (51 -> 47) ==
Additional (1): fi-bxt-dsi
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4633 -> Patchwork_9889
CI_DRM_4633: ea6e3f703e4d234c9c8eaec6c533355c7454ecb6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4588: 7e5abbe4d9b2129bbbf02be77a70cad3da2ab941 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9889: 432c0a6a408acd47a092fbabba45796d2d429754 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
432c0a6a408a drm/rcar-du/crc: Implement get_crc_sources callback d37d1b4e8bfd Revert "drm: crc: Wait for a frame before returning from open()" 4a86a4c0b6a0 drm/crc: Cleanup crtc_crc_open function209144d3555d drm/i915/crc: implement get_crc_sources callback 9c3927f091ca drm/i915/crc: implement verify_crc_source callback 4fdf3c9930b5 drm/rcar-du/crc: Implement verify_crc_source callback 427b3b1d73d7 drm/amdgpu_dm/crc: Implement verify_crc_source callback ea9b8bf14a2a drm/rockchip/crc: Implement verify_crc_source callback 1b7eddeaba70 drm: crc: Introduce get_crc_sources callback 5c9fb7c8257a drm: crc: Introduce verify_crc_source callback
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9889/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx