Bug 207593 - [AMDGPU] The HDMI status(/sys) is not change after HDMI connector pull out
Summary: [AMDGPU] The HDMI status(/sys) is not change after HDMI connector pull out
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-06 07:52 UTC by Aaron Chou
Modified: 2020-05-06 20:10 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.19.90
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Aaron Chou 2020-05-06 07:52:25 UTC
Hi all:

I'm a newer about the amdgpu driver.
I have a question about it.
In my company, there are some experiments about HDMI hotplug.
First, I introduce the lab environment:
cpu: huawei kunpeng
os: uos
kernel: 4.19.90
video card: Radeon HD 700

the lab step is:
1, I connect the hdmi and vga with the expand mode;
2. I disconnect the hdmi connector, but the app display in the hdmi is
not back to vga, and the mode is still expand mode.

I found when I disconnect the hdmi connector, the sys files about HDMI
are keep the connection status.
Such as the value of /sys/class/drm/card0-HDMI-A-1/status is
connected, and I can read the edid file correctly.
At this moment, I use I2C driver to read the edid via /dev/i2c-X. I
can not get the edid value.

In kernel source ,I found the suspicious points in
amdgpu_connector_dvi_detect() (amdgpu_connector.c)

In amdgpu_connector_dvi_detect() function,
The hpd status was correctly through the amdgpu_display_hpd_sence(),
but the ddc probe operation is successed via
amdgpu_display_ddc_probe()

I am so confused.

Is it a normal behavior?

I have written a workaround patch to fix this problem.

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index c770d73352a7..4809ceb56f5e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -975,7 +975,7 @@ amdgpu_connector_dvi_detect(struct drm_connector
*connector, bool force)
        const struct drm_encoder_helper_funcs *encoder_funcs;
        int r;
        enum drm_connector_status ret = connector_status_disconnected;
-       bool dret = false, broken_edid = false;
+       bool dret = false, broken_edid = false, unknown_status = false;

        if (!drm_kms_helper_is_poll_worker()) {
                r = pm_runtime_get_sync(connector->dev->dev);
@@ -990,7 +990,11 @@ amdgpu_connector_dvi_detect(struct drm_connector
*connector, bool force)

        if (amdgpu_connector->ddc_bus)
                dret = amdgpu_display_ddc_probe(amdgpu_connector, false);
-       if (dret) {
+
+       if (!amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd))
+               unknown_status = true;
+
+       if (dret && !unknown_status) {
                amdgpu_connector->detected_by_load = false;
                amdgpu_connector_free_edid(connector);
                amdgpu_connector_get_edid(connector);

Is it correctly?
Comment 1 Alex Deucher 2020-05-06 20:10:36 UTC
There's no need to open bugs in every bug tracker.  Just one is fine.  Let's use the gitlab tracker:
https://gitlab.freedesktop.org/drm/amd/-/issues/1135

Note You need to log in before you can comment on or make changes to this bug.