* Re: [PATCH 00/10] Improve crc-core driver interface
[not found] <20180626062259.15563-1-mahesh1.kumar@intel.com>
@ 2018-06-26 6:32 ` Kumar, Mahesh
0 siblings, 0 replies; 19+ messages in thread
From: Kumar, Mahesh @ 2018-06-26 6:32 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 2294 bytes --]
Cc:dri-devel@lists.freedesktop.org
On 6/26/2018 11:52 AM, Mahesh Kumar wrote:
> This series improves crc-core <-> driver interface.
> This series adds following functionality in the crc-core
> - Now control node will print all the available sources if
> implemented by driver along with current source.
> - Setting of sorce will fail if provided source is not supported
> - cleanup of crtc_crc_open function first allocate memory before
> enabling CRC generation
> - Don't block open() call instead wait in crc read call.
>
> Following IGT will fail due to crc-core <-> driver interface change
> igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
> In nonblocking crc tests we'll get lesser crc's due to skipping crc
>
> AMD/Rockchip/rcar code path is not validated and need inputs
>
> Changes:
> - Add dri-devel in Cc
>
> Mahesh Kumar (10):
> drm: crc: Introduce verify_crc_source callback
> drm: crc: Introduce pre_crc_read function
> 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()"
>
> 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 | 62 ++++++-----
> drivers/gpu/drm/i915/intel_display.c | 2 +
> drivers/gpu/drm/i915/intel_drv.h | 8 +-
> drivers/gpu/drm/i915/intel_pipe_crc.c | 124 ++++++++++++++++++++-
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 45 +++++++-
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 27 ++++-
> include/drm/drm_crtc.h | 42 ++++++-
> 10 files changed, 288 insertions(+), 50 deletions(-)
>
[-- Attachment #1.2: Type: text/html, Size: 2677 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 00/10] Improve crc-core driver interface
@ 2018-06-27 14:44 Mahesh Kumar
0 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-06-27 14:44 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, dri-devel
This series improves crc-core <-> driver interface.
This series adds following functionality in the crc-core
- Now control node will print all the available sources if
implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup of crtc_crc_open function first allocate memory before
enabling CRC generation
- Don't block open() call instead wait in crc read call.
Following IGT will fail due to crc-core <-> driver interface change
igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crc
AMD/Rockchip/rcar code path is not validated and need inputs
Changes:
- Add dri-devel in Cc
Changes rev2:
- now get_crc_sources returns a constant pointer to an array of
source list and crc-core does the verification
Cc: dri-devel@lists.freedesktop.org
Mahesh Kumar (10):
drm: crc: Introduce verify_crc_source callback
drm: crc: Introduce pre_crc_read function
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()"
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 | 78 ++++++++------
drivers/gpu/drm/i915/intel_display.c | 2 +
drivers/gpu/drm/i915/intel_drv.h | 8 +-
drivers/gpu/drm/i915/intel_pipe_crc.c | 118 ++++++++++++++++++++-
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 45 +++++++-
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
include/drm/drm_crtc.h | 47 +++++++-
10 files changed, 301 insertions(+), 51 deletions(-)
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 00/10] Improve crc-core driver interface
@ 2018-07-02 11:07 Mahesh Kumar
2018-07-02 16:15 ` Alex Deucher
0 siblings, 1 reply; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-02 11:07 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
This series improves crc-core <-> driver interface.
This series adds following functionality in the crc-core
- Now control node will print all the available sources if
implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup of crtc_crc_open function first allocate memory before
enabling CRC generation
- Don't block open() call instead wait in crc read call.
Following IGT will fail due to crc-core <-> driver interface change
igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crc
AMD/Rockchip/rcar code path is not validated and need inputs
Changes:
- Add dri-devel in Cc
Changes rev2:
- now get_crc_sources returns a constant pointer to an array of
source list and crc-core does the verification
Changes rev3:
- reorg patches to push non r-b patches to the last
- add r-b tag
Cc: dri-devel@lists.freedesktop.org
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: crc: Introduce pre_crc_read function
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 | 79 ++++++++------
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 | 45 +++++++-
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
include/drm/drm_crtc.h | 48 ++++++++-
10 files changed, 305 insertions(+), 51 deletions(-)
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] Improve crc-core driver interface
2018-07-02 11:07 Mahesh Kumar
@ 2018-07-02 16:15 ` Alex Deucher
0 siblings, 0 replies; 19+ messages in thread
From: Alex Deucher @ 2018-07-02 16:15 UTC (permalink / raw)
To: Mahesh Kumar, Wentland, Harry, Leo (Sunpeng) Li
Cc: Intel Graphics Development, Maling list - DRI developers
+ Harry and Leo
On Mon, Jul 2, 2018 at 7:07 AM, Mahesh Kumar <mahesh1.kumar@intel.com> wrote:
> This series improves crc-core <-> driver interface.
> This series adds following functionality in the crc-core
> - Now control node will print all the available sources if
> implemented by driver along with current source.
> - Setting of sorce will fail if provided source is not supported
> - cleanup of crtc_crc_open function first allocate memory before
> enabling CRC generation
> - Don't block open() call instead wait in crc read call.
>
> Following IGT will fail due to crc-core <-> driver interface change
> igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
> In nonblocking crc tests we'll get lesser crc's due to skipping crc
>
> AMD/Rockchip/rcar code path is not validated and need inputs
>
> Changes:
> - Add dri-devel in Cc
> Changes rev2:
> - now get_crc_sources returns a constant pointer to an array of
> source list and crc-core does the verification
> Changes rev3:
> - reorg patches to push non r-b patches to the last
> - add r-b tag
>
> Cc: dri-devel@lists.freedesktop.org
>
> 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: crc: Introduce pre_crc_read function
>
> 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 | 79 ++++++++------
> 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 | 45 +++++++-
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
> include/drm/drm_crtc.h | 48 ++++++++-
> 10 files changed, 305 insertions(+), 51 deletions(-)
>
> --
> 2.16.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 00/10] Improve crc-core driver interface
@ 2018-07-12 8:36 Mahesh Kumar
2018-07-12 11:08 ` Laurent Pinchart
0 siblings, 1 reply; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-12 8:36 UTC (permalink / raw)
To: intel-gfx; +Cc: laurent.pinchart, dri-devel
This series improves crc-core <-> driver interface.
This series adds following functionality in the crc-core
- Now control node will print all the available sources if
implemented by driver along with current source.
- Setting of sorce will fail if provided source is not supported
- cleanup of crtc_crc_open function first allocate memory before
enabling CRC generation
- Don't block open() call instead wait in crc read call.
Following IGT will fail due to crc-core <-> driver interface change
igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
In nonblocking crc tests we'll get lesser crc's due to skipping crc
AMD/Rockchip/rcar code path is not validated and need inputs
Cc: dri-devel@lists.freedesktop.org
Mahesh Kumar (10):
drm: crc: Introduce verify_crc_source callback
drm: crc: Introduce get_crc_sources callback
drm/rockchip/crc: Implement verify_crc_source callback
drm/amdgpu_dm/crc: Implement verify_crc_source callback
drm/rcar-du/crc: Implement verify_crc_source callback
drm/i915/crc: implement verify_crc_source callback
drm/i915/crc: implement get_crc_sources callback
drm/crc: Cleanup crtc_crc_open function
Revert "drm: crc: Wait for a frame before returning from open()"
drm/rcar-du/crc: Implement get_crc_sources callback
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +-
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++-
drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++-------
drivers/gpu/drm/i915/intel_display.c | 2 +
drivers/gpu/drm/i915/intel_drv.h | 9 +-
drivers/gpu/drm/i915/intel_pipe_crc.c | 119 ++++++++++++++++++++-
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++---
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +
drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 +
drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++
drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 +
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
include/drm/drm_crtc.h | 40 ++++++-
14 files changed, 396 insertions(+), 74 deletions(-)
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] Improve crc-core driver interface
2018-07-12 8:36 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
@ 2018-07-12 11:08 ` Laurent Pinchart
2018-07-16 14:24 ` Kumar, Mahesh
0 siblings, 1 reply; 19+ messages in thread
From: Laurent Pinchart @ 2018-07-12 11:08 UTC (permalink / raw)
To: Mahesh Kumar; +Cc: intel-gfx, dri-devel
Hi Mahesh,
Thank you for the patches.
When resubmitting patch series, could you please add a version number to the
[PATCH] prefix ? Otherwise it gets difficult to figure out which version is
the latest. This can be done automatically with the -v argument to git-format-
patch.
On Thursday, 12 July 2018 11:36:25 EEST Mahesh Kumar wrote:
> This series improves crc-core <-> driver interface.
> This series adds following functionality in the crc-core
> - Now control node will print all the available sources if
> implemented by driver along with current source.
> - Setting of sorce will fail if provided source is not supported
> - cleanup of crtc_crc_open function first allocate memory before
> enabling CRC generation
> - Don't block open() call instead wait in crc read call.
>
> Following IGT will fail due to crc-core <-> driver interface change
> igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
> In nonblocking crc tests we'll get lesser crc's due to skipping crc
>
> AMD/Rockchip/rcar code path is not validated and need inputs
>
> Cc: dri-devel@lists.freedesktop.org
>
> Mahesh Kumar (10):
> drm: crc: Introduce verify_crc_source callback
> drm: crc: Introduce get_crc_sources callback
> drm/rockchip/crc: Implement verify_crc_source callback
> drm/amdgpu_dm/crc: Implement verify_crc_source callback
> drm/rcar-du/crc: Implement verify_crc_source callback
> drm/i915/crc: implement verify_crc_source callback
> drm/i915/crc: implement get_crc_sources callback
> drm/crc: Cleanup crtc_crc_open function
> Revert "drm: crc: Wait for a frame before returning from open()"
> drm/rcar-du/crc: Implement get_crc_sources callback
>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +-
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++-
> drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++-------
> drivers/gpu/drm/i915/intel_display.c | 2 +
> drivers/gpu/drm/i915/intel_drv.h | 9 +-
> drivers/gpu/drm/i915/intel_pipe_crc.c | 119 +++++++++++++++++-
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++---
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +
> drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 +
> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++
> drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 +
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
> include/drm/drm_crtc.h | 40 ++++++-
> 14 files changed, 396 insertions(+), 74 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 00/10] Improve crc-core driver interface
@ 2018-07-13 13:59 Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 01/10] drm: crc: Introduce verify_crc_source callback Mahesh Kumar
` (8 more replies)
0 siblings, 9 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: laurent.pinchart, dri-devel
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
Cc: dri-devel@lists.freedesktop.org
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(-)
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v4 01/10] drm: crc: Introduce verify_crc_source callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 02/10] drm: crc: Introduce get_crc_sources callback Mahesh Kumar
` (7 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, laurent.pinchart, dri-devel
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
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_debugfs_crc.c | 8 ++++++++
include/drm/drm_crtc.h | 16 ++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 99961192bf03..72bfd8af3f7a 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -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) {
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 17f4f93340b8..664be20b763f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -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:
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 02/10] drm: crc: Introduce get_crc_sources callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 01/10] drm: crc: Introduce verify_crc_source callback Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 03/10] drm/rockchip/crc: Implement verify_crc_source callback Mahesh Kumar
` (6 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: laurent.pinchart, dri-devel
This patch introduce a callback function "get_crc_sources" which
will be called during read of control node. It is an optional
callback function and if driver implements this callback, driver
should return a constant pointer to an array of crc sources list
and update count according to the number of source in the list.
Changes Since V1: (Daniel)
- return const pointer to an array of crc sources list
- do validation of sources in CRC-core
Changes Since V2:
- update commit message
- update callback documentation
- print one source name per line
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_debugfs_crc.c | 23 ++++++++++++++++++++++-
include/drm/drm_crtc.h | 22 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 72bfd8af3f7a..d7e626331eca 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -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;
}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 664be20b763f..c309f371853d 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -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:
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 03/10] drm/rockchip/crc: Implement verify_crc_source callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 01/10] drm: crc: Introduce verify_crc_source callback Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 02/10] drm: crc: Introduce get_crc_sources callback Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 04/10] drm/amdgpu_dm/crc: " Mahesh Kumar
` (5 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, laurent.pinchart, dri-devel
This patch implements "verify_crc_source" callback function for
rockchip drm driver.
Changes since V1:
- simplify the verification (Jani N)
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index effecbed2d11..77e91b15ddb4 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1138,12 +1138,31 @@ static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
return ret;
}
+
+static int
+vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
+ size_t *values_cnt)
+{
+ if (source_name && strcmp(source_name, "auto") != 0)
+ return -EINVAL;
+
+ *values_cnt = 3;
+ return 0;
+}
+
#else
static int vop_crtc_set_crc_source(struct drm_crtc *crtc,
const char *source_name, size_t *values_cnt)
{
return -ENODEV;
}
+
+static int
+vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
+ size_t *values_cnt)
+{
+ return -ENODEV;
+}
#endif
static const struct drm_crtc_funcs vop_crtc_funcs = {
@@ -1156,6 +1175,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
.enable_vblank = vop_crtc_enable_vblank,
.disable_vblank = vop_crtc_disable_vblank,
.set_crc_source = vop_crtc_set_crc_source,
+ .verify_crc_source = vop_crtc_verify_crc_source,
};
static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 04/10] drm/amdgpu_dm/crc: Implement verify_crc_source callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (2 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 03/10] drm/rockchip/crc: Implement verify_crc_source callback Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 05/10] drm/rcar-du/crc: " Mahesh Kumar
` (4 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, laurent.pinchart, dri-devel
This patch implements "verify_crc_source" callback function for
AMD drm driver.
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
---
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(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ca017c1dd4da..2ab2030a97d7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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,
};
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index a29dc35954c9..e43ed064dc46 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -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
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
index 52f2c01349e3..dfcca594d52a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
@@ -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)
{
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 05/10] drm/rcar-du/crc: Implement verify_crc_source callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (3 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 04/10] drm/amdgpu_dm/crc: " Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-19 10:56 ` Laurent Pinchart
2018-07-13 13:59 ` [PATCH v4 06/10] drm/i915/crc: implement " Mahesh Kumar
` (3 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: laurent.pinchart, dri-devel
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
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 71 ++++++++++++++++++++++++----------
1 file changed, 51 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 15dc9caa128b..dfbba1acc31f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -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,
};
/* -----------------------------------------------------------------------------
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 06/10] drm/i915/crc: implement verify_crc_source callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (4 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 05/10] drm/rcar-du/crc: " Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 07/10] drm/i915/crc: implement get_crc_sources callback Mahesh Kumar
` (2 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: laurent.pinchart, dri-devel
This patch implements verify_crc_source callback function introduced
earlier in this series.
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/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(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7998e70a3174..cb29789586e1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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 {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 61e715ddd0d5..eaea10a7a600 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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 NULL
static inline void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
{
}
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index 849e1b69ba73..03025c50cb38 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -468,6 +468,114 @@ void intel_display_crc_init(struct drm_i915_private *dev_priv)
}
}
+static int i8xx_crc_source_valid(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ switch (source) {
+ case INTEL_PIPE_CRC_SOURCE_PIPE:
+ case INTEL_PIPE_CRC_SOURCE_NONE:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int i9xx_crc_source_valid(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ switch (source) {
+ case INTEL_PIPE_CRC_SOURCE_PIPE:
+ case INTEL_PIPE_CRC_SOURCE_TV:
+ case INTEL_PIPE_CRC_SOURCE_DP_B:
+ case INTEL_PIPE_CRC_SOURCE_DP_C:
+ case INTEL_PIPE_CRC_SOURCE_DP_D:
+ case INTEL_PIPE_CRC_SOURCE_NONE:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int vlv_crc_source_valid(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ switch (source) {
+ case INTEL_PIPE_CRC_SOURCE_PIPE:
+ case INTEL_PIPE_CRC_SOURCE_DP_B:
+ case INTEL_PIPE_CRC_SOURCE_DP_C:
+ case INTEL_PIPE_CRC_SOURCE_DP_D:
+ case INTEL_PIPE_CRC_SOURCE_NONE:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int ilk_crc_source_valid(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ switch (source) {
+ case INTEL_PIPE_CRC_SOURCE_PIPE:
+ case INTEL_PIPE_CRC_SOURCE_PLANE1:
+ case INTEL_PIPE_CRC_SOURCE_PLANE2:
+ case INTEL_PIPE_CRC_SOURCE_NONE:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int ivb_crc_source_valid(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ switch (source) {
+ case INTEL_PIPE_CRC_SOURCE_PIPE:
+ case INTEL_PIPE_CRC_SOURCE_PLANE1:
+ case INTEL_PIPE_CRC_SOURCE_PLANE2:
+ case INTEL_PIPE_CRC_SOURCE_PF:
+ case INTEL_PIPE_CRC_SOURCE_NONE:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int
+intel_is_valid_crc_source(struct drm_i915_private *dev_priv,
+ const enum intel_pipe_crc_source source)
+{
+ if (IS_GEN2(dev_priv))
+ return i8xx_crc_source_valid(dev_priv, source);
+ else if (INTEL_GEN(dev_priv) < 5)
+ return i9xx_crc_source_valid(dev_priv, source);
+ else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
+ return vlv_crc_source_valid(dev_priv, source);
+ else if (IS_GEN5(dev_priv) || IS_GEN6(dev_priv))
+ return ilk_crc_source_valid(dev_priv, source);
+ else
+ return ivb_crc_source_valid(dev_priv, source);
+}
+
+int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
+ size_t *values_cnt)
+{
+ struct drm_i915_private *dev_priv = to_i915(crtc->dev);
+ enum intel_pipe_crc_source source;
+
+ if (display_crc_ctl_parse_source(source_name, &source) < 0) {
+ DRM_DEBUG_DRIVER("unknown source %s\n", source_name);
+ return -EINVAL;
+ }
+
+ if (source == INTEL_PIPE_CRC_SOURCE_AUTO ||
+ intel_is_valid_crc_source(dev_priv, source) == 0) {
+ *values_cnt = 5;
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
size_t *values_cnt)
{
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 07/10] drm/i915/crc: implement get_crc_sources callback
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (5 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 06/10] drm/i915/crc: implement " Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 08/10] drm/crc: Cleanup crtc_crc_open function Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 09/10] Revert "drm: crc: Wait for a frame before returning from open()" Mahesh Kumar
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, laurent.pinchart, dri-devel
This 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
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/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(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index cb29789586e1..30491d4cb010 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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 {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index eaea10a7a600..29b054de9e13 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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 NULL
static inline void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
{
}
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index 03025c50cb38..83f9ade0cd81 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -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)
{
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 08/10] drm/crc: Cleanup crtc_crc_open function
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (6 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 07/10] drm/i915/crc: implement get_crc_sources callback Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 09/10] Revert "drm: crc: Wait for a frame before returning from open()" Mahesh Kumar
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, laurent.pinchart, dri-devel
This patch make changes to allocate crc-entries buffer before
enabling CRC generation.
It moves all the failure check early in the function before setting
the source or memory allocation.
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
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index e43ed064dc46..54056d180003 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -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);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
index dfcca594d52a..e7ad528f5853 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
@@ -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;
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index d7e626331eca..3e0a2cfaa35c 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -127,11 +127,9 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf,
if (source[len] == '\n')
source[len] = '\0';
- if (crtc->funcs->verify_crc_source) {
- ret = crtc->funcs->verify_crc_source(crtc, source, &values_cnt);
- if (ret)
- return ret;
- }
+ ret = crtc->funcs->verify_crc_source(crtc, source, &values_cnt);
+ if (ret)
+ return ret;
spin_lock_irq(&crc->lock);
@@ -197,40 +195,40 @@ static int crtc_crc_open(struct inode *inode, struct file *filep)
return ret;
}
+ ret = crtc->funcs->verify_crc_source(crtc, crc->source, &values_cnt);
+ if (ret)
+ return ret;
+
+ if (WARN_ON(values_cnt > DRM_MAX_CRC_NR))
+ return -EINVAL;
+
+ if (WARN_ON(values_cnt == 0))
+ return -EINVAL;
+
+ entries = kcalloc(DRM_CRC_ENTRIES_NR, sizeof(*entries), GFP_KERNEL);
+ if (!entries)
+ return -ENOMEM;
+
spin_lock_irq(&crc->lock);
- if (!crc->opened)
+ if (!crc->opened) {
crc->opened = true;
- else
+ crc->entries = entries;
+ crc->values_cnt = values_cnt;
+ } else {
ret = -EBUSY;
+ }
spin_unlock_irq(&crc->lock);
- if (ret)
+ if (ret) {
+ kfree(entries);
return ret;
+ }
- ret = crtc->funcs->set_crc_source(crtc, crc->source, &values_cnt);
+ ret = crtc->funcs->set_crc_source(crtc, crc->source);
if (ret)
goto err;
- if (WARN_ON(values_cnt > DRM_MAX_CRC_NR)) {
- ret = -EINVAL;
- goto err_disable;
- }
-
- if (WARN_ON(values_cnt == 0)) {
- ret = -EINVAL;
- goto err_disable;
- }
-
- entries = kcalloc(DRM_CRC_ENTRIES_NR, sizeof(*entries), GFP_KERNEL);
- if (!entries) {
- ret = -ENOMEM;
- goto err_disable;
- }
-
spin_lock_irq(&crc->lock);
- crc->entries = entries;
- crc->values_cnt = values_cnt;
-
/*
* Only return once we got a first frame, so userspace doesn't have to
* guess when this particular piece of HW will be ready to start
@@ -247,7 +245,7 @@ static int crtc_crc_open(struct inode *inode, struct file *filep)
return 0;
err_disable:
- crtc->funcs->set_crc_source(crtc, NULL, &values_cnt);
+ crtc->funcs->set_crc_source(crtc, NULL);
err:
spin_lock_irq(&crc->lock);
crtc_crc_cleanup(crc);
@@ -259,9 +257,8 @@ static int crtc_crc_release(struct inode *inode, struct file *filep)
{
struct drm_crtc *crtc = filep->f_inode->i_private;
struct drm_crtc_crc *crc = &crtc->crc;
- size_t values_cnt;
- crtc->funcs->set_crc_source(crtc, NULL, &values_cnt);
+ crtc->funcs->set_crc_source(crtc, NULL);
spin_lock_irq(&crc->lock);
crtc_crc_cleanup(crc);
@@ -367,7 +364,7 @@ int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
{
struct dentry *crc_ent, *ent;
- if (!crtc->funcs->set_crc_source)
+ if (!crtc->funcs->set_crc_source || !crtc->funcs->verify_crc_source)
return 0;
crc_ent = debugfs_create_dir("crc", crtc->debugfs_entry);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 29b054de9e13..814f6f3e1595 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -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,
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index 83f9ade0cd81..f3c9010e332a 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -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);
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index dfbba1acc31f..6a29055a4ab0 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -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);
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 77e91b15ddb4..657372306623 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -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;
}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c309f371853d..60672dfd8848 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -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:
*
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4 09/10] Revert "drm: crc: Wait for a frame before returning from open()"
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
` (7 preceding siblings ...)
2018-07-13 13:59 ` [PATCH v4 08/10] drm/crc: Cleanup crtc_crc_open function Mahesh Kumar
@ 2018-07-13 13:59 ` Mahesh Kumar
8 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-13 13:59 UTC (permalink / raw)
To: intel-gfx; +Cc: Tomeu Vizoso, laurent.pinchart, dri-devel
This 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.
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/drm_debugfs_crc.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 3e0a2cfaa35c..00e743153e94 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -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);
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] Improve crc-core driver interface
2018-07-12 11:08 ` Laurent Pinchart
@ 2018-07-16 14:24 ` Kumar, Mahesh
0 siblings, 0 replies; 19+ messages in thread
From: Kumar, Mahesh @ 2018-07-16 14:24 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: intel-gfx, dri-devel
Hi,
thanks for the review.
On 7/12/2018 4:38 PM, Laurent Pinchart wrote:
> Hi Mahesh,
>
> Thank you for the patches.
>
> When resubmitting patch series, could you please add a version number to the
> [PATCH] prefix ? Otherwise it gets difficult to figure out which version is
> the latest. This can be done automatically with the -v argument to git-format-
> patch.
sure :), added patch prefix (now v4) and re-floated the series after
addressing review comments in patches 03/10, 08/10 & 10/10.
-Mahesh
>
> On Thursday, 12 July 2018 11:36:25 EEST Mahesh Kumar wrote:
>> This series improves crc-core <-> driver interface.
>> This series adds following functionality in the crc-core
>> - Now control node will print all the available sources if
>> implemented by driver along with current source.
>> - Setting of sorce will fail if provided source is not supported
>> - cleanup of crtc_crc_open function first allocate memory before
>> enabling CRC generation
>> - Don't block open() call instead wait in crc read call.
>>
>> Following IGT will fail due to crc-core <-> driver interface change
>> igt@kms_pipe_crc_basic@bad-source <now setting bad-source itself will fail>
>> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X
>> ig@kms_pipe_crc_basic@nonblocking-crc-pipe-X-frame-sequence
>> In nonblocking crc tests we'll get lesser crc's due to skipping crc
>>
>> AMD/Rockchip/rcar code path is not validated and need inputs
>>
>> Cc: dri-devel@lists.freedesktop.org
>>
>> Mahesh Kumar (10):
>> drm: crc: Introduce verify_crc_source callback
>> drm: crc: Introduce get_crc_sources callback
>> drm/rockchip/crc: Implement verify_crc_source callback
>> drm/amdgpu_dm/crc: Implement verify_crc_source callback
>> drm/rcar-du/crc: Implement verify_crc_source callback
>> drm/i915/crc: implement verify_crc_source callback
>> drm/i915/crc: implement get_crc_sources callback
>> drm/crc: Cleanup crtc_crc_open function
>> Revert "drm: crc: Wait for a frame before returning from open()"
>> drm/rcar-du/crc: Implement get_crc_sources callback
>>
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 7 +-
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 20 +++-
>> drivers/gpu/drm/drm_debugfs_crc.c | 92 +++++++++-------
>> drivers/gpu/drm/i915/intel_display.c | 2 +
>> drivers/gpu/drm/i915/intel_drv.h | 9 +-
>> drivers/gpu/drm/i915/intel_pipe_crc.c | 119 +++++++++++++++++-
>> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 82 +++++++++++---
>> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +
>> drivers/gpu/drm/rcar-du/rcar_du_drv.h | 2 +
>> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 67 ++++++++++++
>> drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 +
>> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 26 ++++-
>> include/drm/drm_crtc.h | 40 ++++++-
>> 14 files changed, 396 insertions(+), 74 deletions(-)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v4 05/10] drm/rcar-du/crc: Implement verify_crc_source callback
2018-07-13 13:59 ` [PATCH v4 05/10] drm/rcar-du/crc: " Mahesh Kumar
@ 2018-07-19 10:56 ` Laurent Pinchart
2018-07-23 10:38 ` [PATCH v5 " Mahesh Kumar
0 siblings, 1 reply; 19+ messages in thread
From: Laurent Pinchart @ 2018-07-19 10:56 UTC (permalink / raw)
To: Mahesh Kumar; +Cc: intel-gfx, dri-devel
Hi Mahesh,
Thank you for the patch.
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 code
>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 71 +++++++++++++++++++++----------
> 1 file changed, 51 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 15dc9caa128b..dfbba1acc31f
> 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> @@ -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.
> {
> - 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;
Please use braces for the outer for loop. Even if not strictly required by the
C language, it matches the style of the driver.
> if (i >= rcrtc->vsp->num_planes)
> return -EINVAL;
Won't this check always be true ? You can return -EINVAL unconditionally here.
> - } 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;
No need to initialize index to 0.
With those small issues fixed,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + 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,
> };
>
> /*
> ---------------------------------------------------------------------------
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 05/10] drm/rcar-du/crc: Implement verify_crc_source callback
2018-07-19 10:56 ` Laurent Pinchart
@ 2018-07-23 10:38 ` Mahesh Kumar
0 siblings, 0 replies; 19+ messages in thread
From: Mahesh Kumar @ 2018-07-23 10:38 UTC (permalink / raw)
To: intel-gfx; +Cc: Mahesh Kumar, Laurent Pinchart, dri-devel
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
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 69 ++++++++++++++++++++++++----------
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 15dc9caa128b..80226cac88e2 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -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,
};
/* -----------------------------------------------------------------------------
--
2.16.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2018-07-23 10:38 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13 13:59 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 01/10] drm: crc: Introduce verify_crc_source callback Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 02/10] drm: crc: Introduce get_crc_sources callback Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 03/10] drm/rockchip/crc: Implement verify_crc_source callback Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 04/10] drm/amdgpu_dm/crc: " Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 05/10] drm/rcar-du/crc: " Mahesh Kumar
2018-07-19 10:56 ` Laurent Pinchart
2018-07-23 10:38 ` [PATCH v5 " Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 06/10] drm/i915/crc: implement " Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 07/10] drm/i915/crc: implement get_crc_sources callback Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 08/10] drm/crc: Cleanup crtc_crc_open function Mahesh Kumar
2018-07-13 13:59 ` [PATCH v4 09/10] Revert "drm: crc: Wait for a frame before returning from open()" Mahesh Kumar
-- strict thread matches above, loose matches on Subject: below --
2018-07-12 8:36 [PATCH 00/10] Improve crc-core driver interface Mahesh Kumar
2018-07-12 11:08 ` Laurent Pinchart
2018-07-16 14:24 ` Kumar, Mahesh
2018-07-02 11:07 Mahesh Kumar
2018-07-02 16:15 ` Alex Deucher
2018-06-27 14:44 Mahesh Kumar
[not found] <20180626062259.15563-1-mahesh1.kumar@intel.com>
2018-06-26 6:32 ` Kumar, Mahesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).