diff mbox series

[5/7] drm/msm/dp: return correct edid checksum after corrupted edid checksum read

Message ID 1625592020-22658-6-git-send-email-khsieh@codeaurora.org
State Superseded
Headers show
Series add fixes to pass DP Link Layer compliance test cases | expand

Commit Message

Kuogee Hsieh July 6, 2021, 5:20 p.m. UTC
Response with correct edid checksum saved at connector after corrupted edid
checksum read. This fixes Link Layer CTS cases 4.2.2.3, 4.2.2.6.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
---
 drivers/gpu/drm/msm/dp/dp_panel.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Stephen Boyd July 8, 2021, 7:14 a.m. UTC | #1
Quoting Kuogee Hsieh (2021-07-06 10:20:18)
> Response with correct edid checksum saved at connector after corrupted edid
> checksum read. This fixes Link Layer CTS cases 4.2.2.3, 4.2.2.6.
>
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dp/dp_panel.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
> index 88196f7..0fdb551 100644
> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
> @@ -271,7 +271,7 @@ static u8 dp_panel_get_edid_checksum(struct edid *edid)
>  {
>         struct edid *last_block;
>         u8 *raw_edid;
> -       bool is_edid_corrupt;
> +       bool is_edid_corrupt = false;
>
>         if (!edid) {
>                 DRM_ERROR("invalid edid input\n");
> @@ -303,7 +303,12 @@ void dp_panel_handle_sink_request(struct dp_panel *dp_panel)
>         panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
>
>         if (panel->link->sink_request & DP_TEST_LINK_EDID_READ) {
> -               u8 checksum = dp_panel_get_edid_checksum(dp_panel->edid);
> +               u8 checksum;
> +
> +               if (dp_panel->edid)
> +                       checksum = dp_panel_get_edid_checksum(dp_panel->edid);
> +               else
> +                       checksum = dp_panel->connector->real_edid_checksum;
>
>                 dp_link_send_edid_checksum(panel->link, checksum);

It looks like this can be drm_dp_send_real_edid_checksum()? Then we
don't have to look at the connector internals sometimes and can drop
dp_panel_get_edid_checksum() entirely?

>                 dp_link_send_test_response(panel->link);
Kuogee Hsieh July 9, 2021, 6:16 p.m. UTC | #2
On 2021-07-08 00:14, Stephen Boyd wrote:
> Quoting Kuogee Hsieh (2021-07-06 10:20:18)

>> Response with correct edid checksum saved at connector after corrupted 

>> edid

>> checksum read. This fixes Link Layer CTS cases 4.2.2.3, 4.2.2.6.

>> 

>> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

>> ---

>>  drivers/gpu/drm/msm/dp/dp_panel.c | 9 +++++++--

>>  1 file changed, 7 insertions(+), 2 deletions(-)

>> 

>> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c 

>> b/drivers/gpu/drm/msm/dp/dp_panel.c

>> index 88196f7..0fdb551 100644

>> --- a/drivers/gpu/drm/msm/dp/dp_panel.c

>> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c

>> @@ -271,7 +271,7 @@ static u8 dp_panel_get_edid_checksum(struct edid 

>> *edid)

>>  {

>>         struct edid *last_block;

>>         u8 *raw_edid;

>> -       bool is_edid_corrupt;

>> +       bool is_edid_corrupt = false;

>> 

>>         if (!edid) {

>>                 DRM_ERROR("invalid edid input\n");

>> @@ -303,7 +303,12 @@ void dp_panel_handle_sink_request(struct dp_panel 

>> *dp_panel)

>>         panel = container_of(dp_panel, struct dp_panel_private, 

>> dp_panel);

>> 

>>         if (panel->link->sink_request & DP_TEST_LINK_EDID_READ) {

>> -               u8 checksum = 

>> dp_panel_get_edid_checksum(dp_panel->edid);

>> +               u8 checksum;

>> +

>> +               if (dp_panel->edid)

>> +                       checksum = 

>> dp_panel_get_edid_checksum(dp_panel->edid);

>> +               else

>> +                       checksum = 

>> dp_panel->connector->real_edid_checksum;

>> 

>>                 dp_link_send_edid_checksum(panel->link, checksum);

> 

> It looks like this can be drm_dp_send_real_edid_checksum()? Then we

> don't have to look at the connector internals sometimes and can drop

> dp_panel_get_edid_checksum() entirely?

you still need to pass read edid checksum into 
drm_dp_send_real_edid_checksum().
> 

>>                 dp_link_send_test_response(panel->link);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index 88196f7..0fdb551 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -271,7 +271,7 @@  static u8 dp_panel_get_edid_checksum(struct edid *edid)
 {
 	struct edid *last_block;
 	u8 *raw_edid;
-	bool is_edid_corrupt;
+	bool is_edid_corrupt = false;
 
 	if (!edid) {
 		DRM_ERROR("invalid edid input\n");
@@ -303,7 +303,12 @@  void dp_panel_handle_sink_request(struct dp_panel *dp_panel)
 	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
 
 	if (panel->link->sink_request & DP_TEST_LINK_EDID_READ) {
-		u8 checksum = dp_panel_get_edid_checksum(dp_panel->edid);
+		u8 checksum;
+
+		if (dp_panel->edid)
+			checksum = dp_panel_get_edid_checksum(dp_panel->edid);
+		else
+			checksum = dp_panel->connector->real_edid_checksum;
 
 		dp_link_send_edid_checksum(panel->link, checksum);
 		dp_link_send_test_response(panel->link);