* [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support
@ 2024-10-01 6:42 Hermes Wu
2024-10-01 6:43 ` [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Hermes Wu @ 2024-10-01 6:42 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Kenneth Hung, Pet Weng, Hermes Wu, Allen Chen,
AngeloGioacchino Del Regno, open list:DRM DRIVERS, Hermes Wu,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, open list,
Robert Foss
From: Hermes Wu <Hermes.wu@ite.com.tw>
This is a v5 patch-set.
There are lots of failure items while running HDCP CTS using UNIGRAF DPR-100.
In Order to fix those failures, HDCP flow needs to be changed.
The DisplayPort AUX protocol supports I2C transport.
In Order to support MCCS via the aux channel, the aux-i2c operation is added.
v4 ->v5:
-add more messages for changes.
-[2/10] modified AUX transfer data size judgment.
change for-loop to do-while.
-[7/10] change for-loop to do-while.
-[9/10] change wait timer with timer_after()
links:
https://lore.kernel.org/all/20240926074755.22176-4-Hermes.Wu@ite.com.tw/
https://lore.kernel.org/all/20240926075134.22394-1-Hermes.Wu@ite.com.tw/
v3 ->v4:
-split changes into patches.
v2- > v3:
-split aux read KSV function to a patch.
-[1/3] new in v3
-[2/3] add description of patch
v1 -> v2 :
- ignored.
Hermes Wu (10):
drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
drm/bridge: it6505: improve AUX operation for edid read
drm/bridge: it6505: add AUX operation for HDCP KSV list read
drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
drm/bridge: it6505: fix HDCP Bstatus check
drm/bridge: it6505: fix HDCP encryption when R0 ready
drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100.
drm/bridge: it6505: fix HDCP CTS compare V matching
drm/bridge: it6505: fix HDCP CTS KSV list wait timer
drm/bridge: it6505: add I2C functionality on AUX
drivers/gpu/drm/bridge/ite-it6505.c | 334 +++++++++++++++++++++++-----
1 file changed, 277 insertions(+), 57 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
@ 2024-10-01 6:43 ` Hermes Wu
2024-10-14 11:49 ` Dmitry Baryshkov
2024-10-01 6:43 ` [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read Hermes Wu
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Hermes Wu @ 2024-10-01 6:43 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Kenneth Hung, Pet Weng, Hermes Wu, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Hermes Wu, AngeloGioacchino Del Regno, Allen Chen,
open list:DRM DRIVERS, open list
From: Hermes Wu <Hermes.wu@ite.com.tw>
The hardware AUX FIFO is 16 bytes
Change definition of AUX_FIFO_MAX_SIZE to 16
Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index f372c05360f2..28a8043229d3 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -300,7 +300,7 @@
#define MAX_CR_LEVEL 0x03
#define MAX_EQ_LEVEL 0x03
#define AUX_WAIT_TIMEOUT_MS 15
-#define AUX_FIFO_MAX_SIZE 32
+#define AUX_FIFO_MAX_SIZE 16
#define PIXEL_CLK_DELAY 1
#define PIXEL_CLK_INVERSE 0
#define ADJUST_PHASE_THRESHOLD 80000
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
2024-10-01 6:43 ` [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu
@ 2024-10-01 6:43 ` Hermes Wu
2024-10-14 11:51 ` Dmitry Baryshkov
2024-10-01 6:43 ` [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read Hermes Wu
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Hermes Wu @ 2024-10-01 6:43 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Kenneth Hung, Pet Weng, Hermes Wu, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, open list:DRM DRIVERS, open list
From: Hermes Wu <Hermes.wu@ite.com.tw>
The original AUX operation using data registers is limited to 4 bytes.
The AUX operation command CMD_AUX_I2C_EDID_READ uses AUX FIFO and is capable of reading 16 bytes.
This improves the speed of EDID read.
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 28a8043229d3..864fab7e388f 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -1076,10 +1076,13 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
size_t size, enum aux_cmd_reply *reply)
{
int i, ret_size, ret = 0, request_size;
+ int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
mutex_lock(&it6505->aux_lock);
- for (i = 0; i < size; i += 4) {
- request_size = min((int)size - i, 4);
+ i = 0;
+ do {
+ request_size = min_t(int, (int)size - i, fifo_max_size);
+
ret_size = it6505_aux_operation(it6505, cmd, address + i,
buffer + i, request_size,
reply);
@@ -1088,8 +1091,9 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
goto aux_op_err;
}
+ i += request_size;
ret += ret_size;
- }
+ } while (i < size);
aux_op_err:
mutex_unlock(&it6505->aux_lock);
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
2024-10-01 6:43 ` [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu
2024-10-01 6:43 ` [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read Hermes Wu
@ 2024-10-01 6:43 ` Hermes Wu
2024-10-14 11:52 ` Dmitry Baryshkov
2024-10-01 6:43 ` [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Hermes Wu
2024-10-14 14:05 ` [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Dmitry Baryshkov
4 siblings, 1 reply; 12+ messages in thread
From: Hermes Wu @ 2024-10-01 6:43 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Kenneth Hung, Pet Weng, Hermes Wu, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, open list:DRM DRIVERS, open list
From: Hermes Wu <Hermes.wu@ite.com.tw>
HDCP KSV list readback can choose to use AUX FIFO or general data register.
For some DisplayPort devices, the KSV list must be read in 5 byte boundaries.
The original AUX read command does not support these devices.
The AUX command operation control register "REG_AUX_CMD_REQ" uses b[3:0] as AUX operacion control, and b[7:4] are status bits and read only.
To change KSV read operation uses "CMD_AUX_NATIVE_READ" from using the data registers to using AUX FIFO.
The extended command "CMD_AUX_GET_KSV_LIST" is added as "CMD_AUX_NATIVE_READ" with the 0x10 flag which selects AUX FIFO mode.
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 864fab7e388f..9a022c095af4 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -126,6 +126,7 @@
#define REG_AUX_OUT_DATA0 0x27
#define REG_AUX_CMD_REQ 0x2B
+#define M_AUX_REQ_CMD 0x0F
#define AUX_BUSY BIT(5)
#define REG_AUX_DATA_0_7 0x2C
@@ -324,6 +325,9 @@ enum aux_cmd_type {
CMD_AUX_NATIVE_READ = 0x0,
CMD_AUX_NATIVE_WRITE = 0x5,
CMD_AUX_I2C_EDID_READ = 0xB,
+
+ /* KSV read with AUX FIFO extend from CMD_AUX_NATIVE_READ*/
+ CMD_AUX_GET_KSV_LIST = 0x10,
};
enum aux_cmd_reply {
@@ -965,7 +969,8 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
it6505_set_bits(it6505, REG_AUX_CTRL, AUX_USER_MODE, AUX_USER_MODE);
aux_op_start:
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ /* HW AUX FIFO supports only EDID and DCPD KSV FIFO area */
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
/* AUX EDID FIFO has max length of AUX_FIFO_MAX_SIZE bytes. */
size = min_t(size_t, size, AUX_FIFO_MAX_SIZE);
/* Enable AUX FIFO read back and clear FIFO */
@@ -996,7 +1001,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
size);
/* Aux Fire */
- it6505_write(it6505, REG_AUX_CMD_REQ, cmd);
+ it6505_write(it6505, REG_AUX_CMD_REQ, FIELD_GET(M_AUX_REQ_CMD, cmd));
ret = it6505_aux_wait(it6505);
if (ret < 0)
@@ -1030,7 +1035,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
goto aux_op_start;
}
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
for (i = 0; i < size; i++) {
ret = it6505_read(it6505, REG_AUX_DATA_FIFO);
if (ret < 0)
@@ -1055,7 +1060,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
ret = i;
aux_op_err:
- if (cmd == CMD_AUX_I2C_EDID_READ) {
+ if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
/* clear AUX FIFO */
it6505_set_bits(it6505, REG_AUX_CTRL,
AUX_EN_FIFO_READ | CLR_EDID_FIFO,
@@ -1076,7 +1081,8 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
size_t size, enum aux_cmd_reply *reply)
{
int i, ret_size, ret = 0, request_size;
- int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
+ int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) ?
+ AUX_FIFO_MAX_SIZE : 4;
mutex_lock(&it6505->aux_lock);
i = 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
` (2 preceding siblings ...)
2024-10-01 6:43 ` [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read Hermes Wu
@ 2024-10-01 6:43 ` Hermes Wu
2024-10-14 11:53 ` Dmitry Baryshkov
2024-10-14 14:05 ` [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Dmitry Baryshkov
4 siblings, 1 reply; 12+ messages in thread
From: Hermes Wu @ 2024-10-01 6:43 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Kenneth Hung, Pet Weng, Hermes Wu, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, open list:DRM DRIVERS, open list
From: Hermes Wu <Hermes.wu@ite.com.tw>
A HDCP source device shall support max downstream to 127 devices.
Change definition MAX_HDCP_DOWN_STREAM_COUNT to 127
KSVs shall save for DRM blocked devices check.
This results in struct it6505 growth by ~0.5 KiB.
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 9a022c095af4..dde45e9b0f20 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -297,7 +297,7 @@
#define MAX_LANE_COUNT 4
#define MAX_LINK_RATE HBR
#define AUTO_TRAIN_RETRY 3
-#define MAX_HDCP_DOWN_STREAM_COUNT 10
+#define MAX_HDCP_DOWN_STREAM_COUNT 127
#define MAX_CR_LEVEL 0x03
#define MAX_EQ_LEVEL 0x03
#define AUX_WAIT_TIMEOUT_MS 15
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
2024-10-01 6:43 ` [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu
@ 2024-10-14 11:49 ` Dmitry Baryshkov
0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-10-14 11:49 UTC (permalink / raw)
To: Hermes Wu
Cc: Pin-yen Lin, Kenneth Hung, Pet Weng, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter,
AngeloGioacchino Del Regno, Allen Chen, open list:DRM DRIVERS,
open list
On Tue, Oct 01, 2024 at 02:43:00PM +0800, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
>
> The hardware AUX FIFO is 16 bytes
> Change definition of AUX_FIFO_MAX_SIZE to 16
>
> Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> ---
> drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read
2024-10-01 6:43 ` [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read Hermes Wu
@ 2024-10-14 11:51 ` Dmitry Baryshkov
0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-10-14 11:51 UTC (permalink / raw)
To: Hermes Wu
Cc: Pin-yen Lin, Kenneth Hung, Pet Weng, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter,
open list:DRM DRIVERS, open list
On Tue, Oct 01, 2024 at 02:43:01PM +0800, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
>
> The original AUX operation using data registers is limited to 4 bytes.
> The AUX operation command CMD_AUX_I2C_EDID_READ uses AUX FIFO and is capable of reading 16 bytes.
> This improves the speed of EDID read.
Nit: Improve the speed of EDID reads by using CMD_AUX_I2C_EDID_READ.
>
> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> ---
> drivers/gpu/drm/bridge/ite-it6505.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read
2024-10-01 6:43 ` [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read Hermes Wu
@ 2024-10-14 11:52 ` Dmitry Baryshkov
2024-10-15 3:37 ` Hermes.Wu
0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-10-14 11:52 UTC (permalink / raw)
To: Hermes Wu
Cc: Pin-yen Lin, Kenneth Hung, Pet Weng, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter,
open list:DRM DRIVERS, open list
On Tue, Oct 01, 2024 at 02:43:02PM +0800, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
>
> HDCP KSV list readback can choose to use AUX FIFO or general data register.
> For some DisplayPort devices, the KSV list must be read in 5 byte boundaries.
> The original AUX read command does not support these devices.
>
> The AUX command operation control register "REG_AUX_CMD_REQ" uses b[3:0] as AUX operacion control, and b[7:4] are status bits and read only.
> To change KSV read operation uses "CMD_AUX_NATIVE_READ" from using the data registers to using AUX FIFO.
> The extended command "CMD_AUX_GET_KSV_LIST" is added as "CMD_AUX_NATIVE_READ" with the 0x10 flag which selects AUX FIFO mode.
Please keep the commit message wrapped at 72-75 chars.
Other than that:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> ---
> drivers/gpu/drm/bridge/ite-it6505.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
> index 864fab7e388f..9a022c095af4 100644
> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> @@ -126,6 +126,7 @@
> #define REG_AUX_OUT_DATA0 0x27
>
> #define REG_AUX_CMD_REQ 0x2B
> +#define M_AUX_REQ_CMD 0x0F
> #define AUX_BUSY BIT(5)
>
> #define REG_AUX_DATA_0_7 0x2C
> @@ -324,6 +325,9 @@ enum aux_cmd_type {
> CMD_AUX_NATIVE_READ = 0x0,
> CMD_AUX_NATIVE_WRITE = 0x5,
> CMD_AUX_I2C_EDID_READ = 0xB,
> +
> + /* KSV read with AUX FIFO extend from CMD_AUX_NATIVE_READ*/
> + CMD_AUX_GET_KSV_LIST = 0x10,
> };
>
> enum aux_cmd_reply {
> @@ -965,7 +969,8 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
> it6505_set_bits(it6505, REG_AUX_CTRL, AUX_USER_MODE, AUX_USER_MODE);
>
> aux_op_start:
> - if (cmd == CMD_AUX_I2C_EDID_READ) {
> + /* HW AUX FIFO supports only EDID and DCPD KSV FIFO area */
> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
> /* AUX EDID FIFO has max length of AUX_FIFO_MAX_SIZE bytes. */
> size = min_t(size_t, size, AUX_FIFO_MAX_SIZE);
> /* Enable AUX FIFO read back and clear FIFO */
> @@ -996,7 +1001,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
> size);
>
> /* Aux Fire */
> - it6505_write(it6505, REG_AUX_CMD_REQ, cmd);
> + it6505_write(it6505, REG_AUX_CMD_REQ, FIELD_GET(M_AUX_REQ_CMD, cmd));
>
> ret = it6505_aux_wait(it6505);
> if (ret < 0)
> @@ -1030,7 +1035,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
> goto aux_op_start;
> }
>
> - if (cmd == CMD_AUX_I2C_EDID_READ) {
> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
> for (i = 0; i < size; i++) {
> ret = it6505_read(it6505, REG_AUX_DATA_FIFO);
> if (ret < 0)
> @@ -1055,7 +1060,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
> ret = i;
>
> aux_op_err:
> - if (cmd == CMD_AUX_I2C_EDID_READ) {
> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
> /* clear AUX FIFO */
> it6505_set_bits(it6505, REG_AUX_CTRL,
> AUX_EN_FIFO_READ | CLR_EDID_FIFO,
> @@ -1076,7 +1081,8 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
> size_t size, enum aux_cmd_reply *reply)
> {
> int i, ret_size, ret = 0, request_size;
> - int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
> + int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) ?
> + AUX_FIFO_MAX_SIZE : 4;
>
> mutex_lock(&it6505->aux_lock);
> i = 0;
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
2024-10-01 6:43 ` [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Hermes Wu
@ 2024-10-14 11:53 ` Dmitry Baryshkov
0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-10-14 11:53 UTC (permalink / raw)
To: Hermes Wu
Cc: Pin-yen Lin, Kenneth Hung, Pet Weng, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter,
open list:DRM DRIVERS, open list
On Tue, Oct 01, 2024 at 02:43:03PM +0800, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
>
> A HDCP source device shall support max downstream to 127 devices.
> Change definition MAX_HDCP_DOWN_STREAM_COUNT to 127
>
> KSVs shall save for DRM blocked devices check.
> This results in struct it6505 growth by ~0.5 KiB.
>
> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> ---
> drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
` (3 preceding siblings ...)
2024-10-01 6:43 ` [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Hermes Wu
@ 2024-10-14 14:05 ` Dmitry Baryshkov
2024-10-15 10:44 ` Hermes.Wu
4 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2024-10-14 14:05 UTC (permalink / raw)
To: Hermes Wu
Cc: Pin-yen Lin, Kenneth Hung, Pet Weng, Allen Chen,
AngeloGioacchino Del Regno, open list:DRM DRIVERS, Jernej Skrabec,
Jonas Karlman, Laurent Pinchart, open list, Robert Foss
On Tue, Oct 01, 2024 at 02:42:59PM +0800, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
>
> This is a v5 patch-set.
Please check the way you are sending your patches. For some reason my
email client lists patches 0-4 separately, patches 6-8 as a separate
thread and patches 5, 9, 10 as individual patches. Please use single git
send-email command to send the whole patchset.
>
> There are lots of failure items while running HDCP CTS using UNIGRAF DPR-100.
> In Order to fix those failures, HDCP flow needs to be changed.
>
> The DisplayPort AUX protocol supports I2C transport.
> In Order to support MCCS via the aux channel, the aux-i2c operation is added.
>
> v4 ->v5:
> -add more messages for changes.
> -[2/10] modified AUX transfer data size judgment.
> change for-loop to do-while.
> -[7/10] change for-loop to do-while.
> -[9/10] change wait timer with timer_after()
>
> links:
> https://lore.kernel.org/all/20240926074755.22176-4-Hermes.Wu@ite.com.tw/
> https://lore.kernel.org/all/20240926075134.22394-1-Hermes.Wu@ite.com.tw/
>
> v3 ->v4:
> -split changes into patches.
>
> v2- > v3:
> -split aux read KSV function to a patch.
> -[1/3] new in v3
> -[2/3] add description of patch
>
> v1 -> v2 :
> - ignored.
>
>
>
> Hermes Wu (10):
> drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
> drm/bridge: it6505: improve AUX operation for edid read
> drm/bridge: it6505: add AUX operation for HDCP KSV list read
> drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
> drm/bridge: it6505: fix HDCP Bstatus check
> drm/bridge: it6505: fix HDCP encryption when R0 ready
> drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100.
> drm/bridge: it6505: fix HDCP CTS compare V matching
> drm/bridge: it6505: fix HDCP CTS KSV list wait timer
> drm/bridge: it6505: add I2C functionality on AUX
>
> drivers/gpu/drm/bridge/ite-it6505.c | 334 +++++++++++++++++++++++-----
> 1 file changed, 277 insertions(+), 57 deletions(-)
>
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read
2024-10-14 11:52 ` Dmitry Baryshkov
@ 2024-10-15 3:37 ` Hermes.Wu
0 siblings, 0 replies; 12+ messages in thread
From: Hermes.Wu @ 2024-10-15 3:37 UTC (permalink / raw)
To: dmitry.baryshkov
Cc: treapking, Kenneth.Hung, Pet.Weng, andrzej.hajda, neil.armstrong,
rfoss, Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, dri-devel, linux-kernel
>-----Original Message-----
>From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>Sent: Monday, October 14, 2024 7:53 PM
>To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw>
>Cc: Pin-yen Lin <treapking@chromium.org>; Kenneth Hung (洪家倫) <Kenneth.Hung@ite.com.tw>; Pet Weng (翁玉芬) <Pet.Weng@ite.com.tw>; Andrzej Hajda <andrzej.hajda@intel.com>; Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>; Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; Jonas Karlman <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@gmail.com>; Simona Vetter <simona@ffwll.ch>; open list:DRM DRIVERS <dri-devel@lists.freedesktop.org>; open list <linux-kernel@vger.kernel.org>
>Subject: Re: [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read
>
>On Tue, Oct 01, 2024 at 02:43:02PM +0800, Hermes Wu wrote:
>> From: Hermes Wu <Hermes.wu@ite.com.tw>
>>
>> HDCP KSV list readback can choose to use AUX FIFO or general data register.
>> For some DisplayPort devices, the KSV list must be read in 5 byte boundaries.
>> The original AUX read command does not support these devices.
>>
>> The AUX command operation control register "REG_AUX_CMD_REQ" uses b[3:0] as AUX operacion control, and b[7:4] are status bits and read only.
>> To change KSV read operation uses "CMD_AUX_NATIVE_READ" from using the data registers to using AUX FIFO.
>> The extended command "CMD_AUX_GET_KSV_LIST" is added as "CMD_AUX_NATIVE_READ" with the 0x10 flag which selects AUX FIFO mode.
>
>Please keep the commit message wrapped at 72-75 chars.
>
>Other than that:
Should I send new v6 patches with commit message wrapped at 72-75 chars?
Thanks.
>
>Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
>
>>
>> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
>> ---
>> drivers/gpu/drm/bridge/ite-it6505.c | 16 +++++++++++-----
>> 1 file changed, 11 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c
>> b/drivers/gpu/drm/bridge/ite-it6505.c
>> index 864fab7e388f..9a022c095af4 100644
>> --- a/drivers/gpu/drm/bridge/ite-it6505.c
>> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
>> @@ -126,6 +126,7 @@
>> #define REG_AUX_OUT_DATA0 0x27
>>
>> #define REG_AUX_CMD_REQ 0x2B
>> +#define M_AUX_REQ_CMD 0x0F
>> #define AUX_BUSY BIT(5)
>>
>> #define REG_AUX_DATA_0_7 0x2C
>> @@ -324,6 +325,9 @@ enum aux_cmd_type {
>> CMD_AUX_NATIVE_READ = 0x0,
>> CMD_AUX_NATIVE_WRITE = 0x5,
>> CMD_AUX_I2C_EDID_READ = 0xB,
>> +
>> + /* KSV read with AUX FIFO extend from CMD_AUX_NATIVE_READ*/
>> + CMD_AUX_GET_KSV_LIST = 0x10,
>> };
>>
>> enum aux_cmd_reply {
>> @@ -965,7 +969,8 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
>> it6505_set_bits(it6505, REG_AUX_CTRL, AUX_USER_MODE, AUX_USER_MODE);
>>
>> aux_op_start:
>> - if (cmd == CMD_AUX_I2C_EDID_READ) {
>> + /* HW AUX FIFO supports only EDID and DCPD KSV FIFO area */
>> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
>> /* AUX EDID FIFO has max length of AUX_FIFO_MAX_SIZE bytes. */
>> size = min_t(size_t, size, AUX_FIFO_MAX_SIZE);
>> /* Enable AUX FIFO read back and clear FIFO */ @@ -996,7 +1001,7 @@
>> static ssize_t it6505_aux_operation(struct it6505 *it6505,
>> size);
>>
>> /* Aux Fire */
>> - it6505_write(it6505, REG_AUX_CMD_REQ, cmd);
>> + it6505_write(it6505, REG_AUX_CMD_REQ, FIELD_GET(M_AUX_REQ_CMD,
>> +cmd));
>>
>> ret = it6505_aux_wait(it6505);
>> if (ret < 0)
>> @@ -1030,7 +1035,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
>> goto aux_op_start;
>> }
>>
>> - if (cmd == CMD_AUX_I2C_EDID_READ) {
>> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
>> for (i = 0; i < size; i++) {
>> ret = it6505_read(it6505, REG_AUX_DATA_FIFO);
>> if (ret < 0)
>> @@ -1055,7 +1060,7 @@ static ssize_t it6505_aux_operation(struct it6505 *it6505,
>> ret = i;
>>
>> aux_op_err:
>> - if (cmd == CMD_AUX_I2C_EDID_READ) {
>> + if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) {
>> /* clear AUX FIFO */
>> it6505_set_bits(it6505, REG_AUX_CTRL,
>> AUX_EN_FIFO_READ | CLR_EDID_FIFO, @@ -1076,7 +1081,8 @@ static
>> ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
>> size_t size, enum aux_cmd_reply *reply) {
>> int i, ret_size, ret = 0, request_size;
>> - int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_SIZE : 4;
>> + int fifo_max_size = (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST) ?
>> + AUX_FIFO_MAX_SIZE : 4;
>>
>> mutex_lock(&it6505->aux_lock);
>> i = 0;
>> --
>> 2.34.1
>>
>
>--
>With best wishes
>Dmitry
>
>
BR,
Hermes
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support
2024-10-14 14:05 ` [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Dmitry Baryshkov
@ 2024-10-15 10:44 ` Hermes.Wu
0 siblings, 0 replies; 12+ messages in thread
From: Hermes.Wu @ 2024-10-15 10:44 UTC (permalink / raw)
To: dmitry.baryshkov
Cc: treapking, Kenneth.Hung, Pet.Weng, angelogioacchino.delregno,
dri-devel, jernej.skrabec, jonas, Laurent.pinchart, linux-kernel,
rfoss
>
>-----Original Message-----
>From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>Sent: Monday, October 14, 2024 10:06 PM
>To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw>
>Cc: Pin-yen Lin <treapking@chromium.org>; Kenneth Hung (洪家倫) <Kenneth.Hung@ite.com.tw>; Pet Weng (翁玉芬) <Pet.Weng@ite.com.tw>; Allen Chen <allen.chen@ite.com.tw>; AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>; open list:DRM DRIVERS <dri-devel@lists.freedesktop.org>; Jernej Skrabec <jernej.skrabec@gmail.com>; Jonas Karlman <jonas@kwiboo.se>; Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; open list <linux-kernel@vger.kernel.org>; Robert Foss <rfoss@kernel.org>
>Subject: Re: [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support
>
>On Tue, Oct 01, 2024 at 02:42:59PM +0800, Hermes Wu wrote:
>> From: Hermes Wu <Hermes.wu@ite.com.tw>
>>
>> This is a v5 patch-set.
>
>Please check the way you are sending your patches. For some reason my
>email client lists patches 0-4 separately, patches 6-8 as a separate
>thread and patches 5, 9, 10 as individual patches. Please use single git
>send-email command to send the whole patchset.
Sending patches use git send-email via smtp server in a short period of time
reach limits.
Next patches will try to use web submission endpoint
>>
>> There are lots of failure items while running HDCP CTS using UNIGRAF DPR-100.
>> In Order to fix those failures, HDCP flow needs to be changed.
>>
>> The DisplayPort AUX protocol supports I2C transport.
>> In Order to support MCCS via the aux channel, the aux-i2c operation is added.
>>
>> v4 ->v5:
>> -add more messages for changes.
>> -[2/10] modified AUX transfer data size judgment.
>> change for-loop to do-while.
>> -[7/10] change for-loop to do-while.
>> -[9/10] change wait timer with timer_after()
>>
>> links:
>> https://urldefense.com/v3/__https://lore.kernel.org/all/20240926074755.22176-4-Hermes.Wu@ite.com.tw/__;!!HtnLE8A!AHGwhLuU6axG3E60-Fc1M5cQVc_EUwgklnN1nc4YeDP3wvtVzTCo8I2tEcw-aFSDLxE-TDDjJgQHw6RYIfeJf4B4JETE$
>> https://urldefense.com/v3/__https://lore.kernel.org/all/20240926075134.22394-1-Hermes.Wu@ite.com.tw/__;!!HtnLE8A!AHGwhLuU6axG3E60-Fc1M5cQVc_EUwgklnN1nc4YeDP3wvtVzTCo8I2tEcw-aFSDLxE-TDDjJgQHw6RYIfeJf1ep_d4X$
>>
>> v3 ->v4:
>> -split changes into patches.
>>
>> v2- > v3:
>> -split aux read KSV function to a patch.
>> -[1/3] new in v3
>> -[2/3] add description of patch
>>
>> v1 -> v2 :
>> - ignored.
>>
>>
>>
>> Hermes Wu (10):
>> drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
>> drm/bridge: it6505: improve AUX operation for edid read
>> drm/bridge: it6505: add AUX operation for HDCP KSV list read
>> drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
>> drm/bridge: it6505: fix HDCP Bstatus check
>> drm/bridge: it6505: fix HDCP encryption when R0 ready
>> drm/bridge: it6505: fix HDCP CTS KSV list read with UNIGRAF DPR-100.
>> drm/bridge: it6505: fix HDCP CTS compare V matching
>> drm/bridge: it6505: fix HDCP CTS KSV list wait timer
>> drm/bridge: it6505: add I2C functionality on AUX
>>
>> drivers/gpu/drm/bridge/ite-it6505.c | 334 +++++++++++++++++++++++-----
>> 1 file changed, 277 insertions(+), 57 deletions(-)
>>
>> --
>> 2.34.1
>>
>
>--
>With best wishes
>Dmitry
>
>
BR,
Hermes
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-10-15 10:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 6:42 [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Hermes Wu
2024-10-01 6:43 ` [PATCH v5 01/10] drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE Hermes Wu
2024-10-14 11:49 ` Dmitry Baryshkov
2024-10-01 6:43 ` [PATCH v5 02/10] drm/bridge: it6505: improve AUX operation for edid read Hermes Wu
2024-10-14 11:51 ` Dmitry Baryshkov
2024-10-01 6:43 ` [PATCH v5 03/10] drm/bridge: it6505: add AUX operation for HDCP KSV list read Hermes Wu
2024-10-14 11:52 ` Dmitry Baryshkov
2024-10-15 3:37 ` Hermes.Wu
2024-10-01 6:43 ` [PATCH v5 04/10] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Hermes Wu
2024-10-14 11:53 ` Dmitry Baryshkov
2024-10-14 14:05 ` [PATCH v5 00/10]drm/bridge: it6505: fix HDCP CTS fail items and add MCCS support Dmitry Baryshkov
2024-10-15 10:44 ` Hermes.Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox