amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Gravenor, Joseph" <Joseph.Gravenor@amd.com>
To: "Liu, Zhan" <Zhan.Liu@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/display: Add aconnector condition check for dpcd read
Date: Fri, 21 Feb 2020 20:31:37 +0000	[thread overview]
Message-ID: <CH2PR12MB40245FA27CCE227A020377BDEC120@CH2PR12MB4024.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200210210832.2779-1-zhan.liu@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 3019 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Joseph Gravenor <Joseph.Gravenor@amd.com>

________________________________
From: Liu, Zhan <Zhan.Liu@amd.com>
Sent: Monday, February 10, 2020 4:08 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Liu, Zhan <Zhan.Liu@amd.com>; Gravenor, Joseph <Joseph.Gravenor@amd.com>
Subject: [PATCH] drm/amd/display: Add aconnector condition check for dpcd read

[Why]
core_link_read_dpcd() will invoke dm_helpers_dp_read_dpcd(),
which needs to read dpcd info with the help of aconnector.
If aconnector (dc->links[i]->prev) is NULL, then dpcd status
 cannot be read.

As a result, dpcd read fails and a line of error will be
printed out in dmesg.log as:
"*ERROR* Failed to found connector for link!"

[How]
Make sure that aconnector (dc->links[i]->prev) is not NULL,
then read dpcd status.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
---
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 42fcfee2c31b..92e1574073fd 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1331,11 +1331,20 @@ void dcn10_init_hw(struct dc *dc)
                         if (dc->links[i]->connector_signal != SIGNAL_TYPE_DISPLAY_PORT) {
                                 continue;
                         }
-                       /* if any of the displays are lit up turn them off */
-                       status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
-                                                    &dpcd_power_state, sizeof(dpcd_power_state));
-                       if (status == DC_OK && dpcd_power_state == DP_POWER_STATE_D0) {
-                               dp_receiver_power_ctrl(dc->links[i], false);
+
+                       /*
+                        * core_link_read_dpcd() will invoke dm_helpers_dp_read_dpcd(),
+                        * which needs to read dpcd info with the help of aconnector.
+                        * If aconnector (dc->links[i]->prev) is NULL, then dpcd status
+                        * cannot be read.
+                        */
+                       if (dc->links[i]->priv) {
+                               /* if any of the displays are lit up turn them off */
+                               status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
+                                                               &dpcd_power_state, sizeof(dpcd_power_state));
+                               if (status == DC_OK && dpcd_power_state == DP_POWER_STATE_D0) {
+                                       dp_receiver_power_ctrl(dc->links[i], false);
+                               }
                         }
                 }
         }
--
2.17.1


[-- Attachment #1.2: Type: text/html, Size: 7808 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      reply	other threads:[~2020-02-21 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 21:08 [PATCH] drm/amd/display: Add aconnector condition check for dpcd read Zhan Liu
2020-02-21 20:31 ` Gravenor, Joseph [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR12MB40245FA27CCE227A020377BDEC120@CH2PR12MB4024.namprd12.prod.outlook.com \
    --to=joseph.gravenor@amd.com \
    --cc=Zhan.Liu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).