All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude <cpaul@redhat.com>
To: xorg-driver-ati@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Lyude <cpaul@redhat.com>,
	stable@vger.kernel.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Mario Kleiner" <mario.kleiner.de@gmail.com>,
	"Arindam Nath" <arindam.nath@amd.com>,
	"Nils Wallménius" <nils.wallmenius@gmail.com>,
	dri-devel@lists.freedesktop.org (open list:RADEON and AMDGPU DRM
	DRIVERS), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/2] drm/amdgpu: Poll for both connect/disconnect on analog connectors
Date: Fri, 24 Jun 2016 17:45:57 -0400	[thread overview]
Message-ID: <1466804762-14526-2-git-send-email-cpaul@redhat.com> (raw)
In-Reply-To: <1466804762-14526-1-git-send-email-cpaul@redhat.com>

DRM_CONNECTOR_POLL_CONNECT only enables polling for connections, not
disconnections. Because of this, we end up losing hotplug polling for
analog connectors once they get connected.

Easy way to reproduce:
 - Grab a machine with an AMD GPU and a VGA port
 - Plug a monitor into the VGA port, wait for it to update the connector
   from disconnected to connected
 - Disconnect the monitor on VGA, a hotplug event is never sent for the
   removal of the connector.

Originally, only using DRM_CONNECTOR_POLL_CONNECT might have been a good
idea since doing VGA polling can sometimes result in having to mess with
the DAC voltages to figure out whether or not there's actually something
there since VGA doesn't have HPD. Doing this would have the potential of
showing visible artifacts on the screen every time we ran a poll while a
VGA display was connected. Luckily, amdgpu_vga_detect() only resorts to
this sort of polling if the poll is forced, and DRM's polling helper
doesn't force it's polls.

Additionally, this removes some assignments to connector->polled that
weren't actually doing anything.

Cc: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index cb07da4..ff0b55a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1690,7 +1690,6 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 						   DRM_MODE_SCALE_NONE);
 			/* no HPD on analog connectors */
 			amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE;
-			connector->polled = DRM_CONNECTOR_POLL_CONNECT;
 			connector->interlace_allowed = true;
 			connector->doublescan_allowed = true;
 			break;
@@ -1893,8 +1892,10 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 	}
 
 	if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) {
-		if (i2c_bus->valid)
-			connector->polled = DRM_CONNECTOR_POLL_CONNECT;
+		if (i2c_bus->valid) {
+			connector->polled = DRM_CONNECTOR_POLL_CONNECT |
+			                    DRM_CONNECTOR_POLL_DISCONNECT;
+		}
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Lyude <cpaul@redhat.com>
To: xorg-driver-ati@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: "Nils Wallménius" <nils.wallmenius@gmail.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, "Arindam Nath" <arindam.nath@amd.com>,
	"open list:RADEON and AMDGPU DRM DRIVERS"
	<dri-devel@lists.freedesktop.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	Lyude <cpaul@redhat.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 2/2] drm/amdgpu: Poll for both connect/disconnect on analog connectors
Date: Fri, 24 Jun 2016 17:45:57 -0400	[thread overview]
Message-ID: <1466804762-14526-2-git-send-email-cpaul@redhat.com> (raw)
In-Reply-To: <1466804762-14526-1-git-send-email-cpaul@redhat.com>

DRM_CONNECTOR_POLL_CONNECT only enables polling for connections, not
disconnections. Because of this, we end up losing hotplug polling for
analog connectors once they get connected.

Easy way to reproduce:
 - Grab a machine with an AMD GPU and a VGA port
 - Plug a monitor into the VGA port, wait for it to update the connector
   from disconnected to connected
 - Disconnect the monitor on VGA, a hotplug event is never sent for the
   removal of the connector.

Originally, only using DRM_CONNECTOR_POLL_CONNECT might have been a good
idea since doing VGA polling can sometimes result in having to mess with
the DAC voltages to figure out whether or not there's actually something
there since VGA doesn't have HPD. Doing this would have the potential of
showing visible artifacts on the screen every time we ran a poll while a
VGA display was connected. Luckily, amdgpu_vga_detect() only resorts to
this sort of polling if the poll is forced, and DRM's polling helper
doesn't force it's polls.

Additionally, this removes some assignments to connector->polled that
weren't actually doing anything.

Cc: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index cb07da4..ff0b55a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1690,7 +1690,6 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 						   DRM_MODE_SCALE_NONE);
 			/* no HPD on analog connectors */
 			amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE;
-			connector->polled = DRM_CONNECTOR_POLL_CONNECT;
 			connector->interlace_allowed = true;
 			connector->doublescan_allowed = true;
 			break;
@@ -1893,8 +1892,10 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 	}
 
 	if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) {
-		if (i2c_bus->valid)
-			connector->polled = DRM_CONNECTOR_POLL_CONNECT;
+		if (i2c_bus->valid) {
+			connector->polled = DRM_CONNECTOR_POLL_CONNECT |
+			                    DRM_CONNECTOR_POLL_DISCONNECT;
+		}
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-06-24 21:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 21:45 [PATCH 1/2] drm/radeon: Poll for both connect/disconnect on analog connectors Lyude
2016-06-24 21:45 ` Lyude
2016-06-24 21:45 ` Lyude [this message]
2016-06-24 21:45   ` [PATCH 2/2] drm/amdgpu: " Lyude
2016-06-24 21:45 ` [PATCH v6 0/4] Fixes for HPD Lyude
2016-06-24 21:45   ` Lyude
2016-06-24 22:01   ` Ignore these, sorry! Lyude
2016-06-24 22:01     ` Lyude
2016-06-24 21:45 ` [PATCH v6 1/4] drm/i915/vlv: Make intel_crt_reset() per-encoder Lyude
2016-06-24 21:45 ` Lyude
2016-06-24 21:45   ` Lyude
2016-06-24 21:46 ` [PATCH v6 2/4] drm/i915/vlv: Reset the ADPA in vlv_display_power_well_init() Lyude
2016-06-24 21:46 ` Lyude
2016-06-24 21:46   ` Lyude
2016-06-24 21:52 ` [PATCH 1/2] drm/radeon: Poll for both connect/disconnect on analog connectors Lyude

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=1466804762-14526-2-git-send-email-cpaul@redhat.com \
    --to=cpaul@redhat.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arindam.nath@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.kleiner.de@gmail.com \
    --cc=nils.wallmenius@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=xorg-driver-ati@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.