diff mbox series

[v4,03/11] drm/bridge: it6505: add aux operation for HDCP ksv list read

Message ID 20240926074755.22176-4-Hermes.Wu@ite.com.tw (mailing list archive)
State New, archived
Headers show
Series fix HDCP CTS fail items and add MCCS support | expand

Commit Message

Hermes Wu Sept. 26, 2024, 7:47 a.m. UTC
From: Hermes Wu <Hermes.wu@ite.com.tw>

Add aux operaction command which supports read DPCD KSV FIFO
with aux fifo.


Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
 drivers/gpu/drm/bridge/ite-it6505.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Dmitry Baryshkov Sept. 26, 2024, 7:57 a.m. UTC | #1
On Thu, Sep 26, 2024 at 03:47:53PM GMT, Hermes Wu wrote:
> From: Hermes Wu <Hermes.wu@ite.com.tw>
> 
> Add aux operaction command which supports read DPCD KSV FIFO
> with aux fifo.

Nit: AUX, FIFO. Please be consistent in your commit messages.

> 
> 
> Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")

Why is this considered to be a fix? From the commit message it sounds
like a new feature.

LGTM otherwise

> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> ---
>  drivers/gpu/drm/bridge/ite-it6505.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
> index b451d3c2ac1d..0583abdca75f 100644
> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> @@ -324,6 +324,9 @@ enum aux_cmd_type {
>  	CMD_AUX_NATIVE_READ = 0x0,
>  	CMD_AUX_NATIVE_WRITE = 0x5,
>  	CMD_AUX_I2C_EDID_READ = 0xB,
> +
> +	/* KSV list read using AUX native read with FIFO */
> +	CMD_AUX_GET_KSV_LIST = 0x10,
>  };
>  
>  enum aux_cmd_reply {
> @@ -965,7 +968,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 aread */
> +	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 */
> @@ -1030,7 +1034,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 +1059,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,
> @@ -1079,7 +1083,7 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
>  
>  	mutex_lock(&it6505->aux_lock);
>  	for (i = 0; i < size; ) {
> -		if (cmd == CMD_AUX_I2C_EDID_READ)
> +		if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST)
>  			request_size = min_t(int, (int)size - i, AUX_FIFO_MAX_SIZE);
>  		else
>  			request_size = min_t(int, (int)size - i, 4);
> -- 
> 2.34.1
>
Hermes Wu Sept. 26, 2024, 9:46 a.m. UTC | #2
>On Thu, Sep 26, 2024 at 03:47:53PM GMT, Hermes Wu wrote:
>> From: Hermes Wu <Hermes.wu@ite.com.tw>
>> 
>> Add aux operaction command which supports read DPCD KSV FIFO with aux 
>> fifo.
>
>Nit: AUX, FIFO. Please be consistent in your commit messages.
>
>> 
>> 
>> Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
>
>Why is this considered to be a fix? From the commit message it sounds like a new feature.

It will be a necessary change for HDCP reads KSV FIFO.


>
>LGTM otherwise
>
>> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
>> ---
>>  drivers/gpu/drm/bridge/ite-it6505.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c 
>> b/drivers/gpu/drm/bridge/ite-it6505.c
>> index b451d3c2ac1d..0583abdca75f 100644
>> --- a/drivers/gpu/drm/bridge/ite-it6505.c
>> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
>> @@ -324,6 +324,9 @@ enum aux_cmd_type {
>>  	CMD_AUX_NATIVE_READ = 0x0,
>>  	CMD_AUX_NATIVE_WRITE = 0x5,
>>  	CMD_AUX_I2C_EDID_READ = 0xB,
>> +
>> +	/* KSV list read using AUX native read with FIFO */
>> +	CMD_AUX_GET_KSV_LIST = 0x10,
>>  };
>>  
>>  enum aux_cmd_reply {
>> @@ -965,7 +968,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 aread */
>> +	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 */ @@ -1030,7 +1034,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 +1059,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, @@ -1079,7 +1083,7 @@ static 
>> ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
>>  
>>  	mutex_lock(&it6505->aux_lock);
>>  	for (i = 0; i < size; ) {
>> -		if (cmd == CMD_AUX_I2C_EDID_READ)
>> +		if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST)
>>  			request_size = min_t(int, (int)size - i, AUX_FIFO_MAX_SIZE);
>>  		else
>>  			request_size = min_t(int, (int)size - i, 4);
>> --
>> 2.34.1
>> 
>
>-- 
>With best wishes
>Dmitry
>

BR,
Hermes
Dmitry Baryshkov Sept. 26, 2024, 12:17 p.m. UTC | #3
On Thu, 26 Sept 2024 at 11:46, <Hermes.Wu@ite.com.tw> wrote:
>
> >On Thu, Sep 26, 2024 at 03:47:53PM GMT, Hermes Wu wrote:
> >> From: Hermes Wu <Hermes.wu@ite.com.tw>
> >>
> >> Add aux operaction command which supports read DPCD KSV FIFO with aux
> >> fifo.
> >
> >Nit: AUX, FIFO. Please be consistent in your commit messages.
> >
> >>
> >>
> >> Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver")
> >
> >Why is this considered to be a fix? From the commit message it sounds like a new feature.
>
> It will be a necessary change for HDCP reads KSV FIFO.

First of all, it should be a part of the commit message, because the
patch itself doesn't fix an issue.
Judging by the amount and the intrusivity of the patches, I'd say that
all KSV / HDCP-related patches constitute a new development, rather
than a bugfix.

>
>
> >
> >LGTM otherwise
> >
> >> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
> >> ---
> >>  drivers/gpu/drm/bridge/ite-it6505.c | 12 ++++++++----
> >>  1 file changed, 8 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c
> >> b/drivers/gpu/drm/bridge/ite-it6505.c
> >> index b451d3c2ac1d..0583abdca75f 100644
> >> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> >> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> >> @@ -324,6 +324,9 @@ enum aux_cmd_type {
> >>      CMD_AUX_NATIVE_READ = 0x0,
> >>      CMD_AUX_NATIVE_WRITE = 0x5,
> >>      CMD_AUX_I2C_EDID_READ = 0xB,
> >> +
> >> +    /* KSV list read using AUX native read with FIFO */
> >> +    CMD_AUX_GET_KSV_LIST = 0x10,
> >>  };
> >>
> >>  enum aux_cmd_reply {
> >> @@ -965,7 +968,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 aread */
> >> +    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 */ @@ -1030,7 +1034,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 +1059,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, @@ -1079,7 +1083,7 @@ static
> >> ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
> >>
> >>      mutex_lock(&it6505->aux_lock);
> >>      for (i = 0; i < size; ) {
> >> -            if (cmd == CMD_AUX_I2C_EDID_READ)
> >> +            if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST)
> >>                      request_size = min_t(int, (int)size - i, AUX_FIFO_MAX_SIZE);
> >>              else
> >>                      request_size = min_t(int, (int)size - i, 4);
> >> --
> >> 2.34.1
> >>
> >
> >--
> >With best wishes
> >Dmitry
> >
>
> BR,
> Hermes
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index b451d3c2ac1d..0583abdca75f 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -324,6 +324,9 @@  enum aux_cmd_type {
 	CMD_AUX_NATIVE_READ = 0x0,
 	CMD_AUX_NATIVE_WRITE = 0x5,
 	CMD_AUX_I2C_EDID_READ = 0xB,
+
+	/* KSV list read using AUX native read with FIFO */
+	CMD_AUX_GET_KSV_LIST = 0x10,
 };
 
 enum aux_cmd_reply {
@@ -965,7 +968,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 aread */
+	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 */
@@ -1030,7 +1034,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 +1059,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,
@@ -1079,7 +1083,7 @@  static ssize_t it6505_aux_do_transfer(struct it6505 *it6505,
 
 	mutex_lock(&it6505->aux_lock);
 	for (i = 0; i < size; ) {
-		if (cmd == CMD_AUX_I2C_EDID_READ)
+		if (cmd == CMD_AUX_I2C_EDID_READ || cmd == CMD_AUX_GET_KSV_LIST)
 			request_size = min_t(int, (int)size - i, AUX_FIFO_MAX_SIZE);
 		else
 			request_size = min_t(int, (int)size - i, 4);