mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Alex Deucher <alexander.deucher@amd.com>,
	Dave Airlie <airlied@redhat.com>
Subject: [25/26] drm/radeon/kms: dont try to be smart in the hpd handler
Date: Mon, 15 Aug 2011 19:43:08 -0700	[thread overview]
Message-ID: <20110816024455.856250121@pistachio.kroah.org> (raw)
In-Reply-To: <20110816024553.GA5631@kroah.com>

3.0-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

commit d5811e8731213f80c80d89e980505052f16aca1c upstream.

Attempting to try and turn off disconnected display hw in the
hotput handler lead to more problems than it helped.  For
now just register an event and only attempt the do something
interesting with DP.  Other connectors are just too problematic:
- Some systems have an HPD pin assigned to LVDS, but it's rarely
if ever connected properly and we don't really care about hpd
events on LVDS anyway since it's always connected.
- The HPD pin is wired up correctly for eDP, but we don't really
have to do anything since the events since it's always connected.
- Some HPD pins fire more than once when you connect/disconnect
- etc.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=39882

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/gpu/drm/radeon/atombios_dp.c       |   12 ++++++++++++
 drivers/gpu/drm/radeon/radeon_connectors.c |   14 ++++++--------
 drivers/gpu/drm/radeon/radeon_mode.h       |    1 +
 3 files changed, 19 insertions(+), 8 deletions(-)

--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -613,6 +613,18 @@ static bool radeon_dp_get_link_status(st
 	return true;
 }
 
+bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector)
+{
+	u8 link_status[DP_LINK_STATUS_SIZE];
+	struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
+
+	if (!radeon_dp_get_link_status(radeon_connector, link_status))
+		return false;
+	if (dp_channel_eq_ok(link_status, dig->dp_lane_count))
+		return false;
+	return true;
+}
+
 struct radeon_dp_link_train_info {
 	struct radeon_device *rdev;
 	struct drm_encoder *encoder;
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -64,18 +64,16 @@ void radeon_connector_hotplug(struct drm
 	if (connector->dpms != DRM_MODE_DPMS_ON)
 		return;
 
-	/* powering up/down the eDP panel generates hpd events which
-	 * can interfere with modesetting.
-	 */
-	if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
-		return;
+	/* just deal with DP (not eDP) here. */
+	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
+		int saved_dpms = connector->dpms;
 
-	/* pre-r600 did not always have the hpd pins mapped accurately to connectors */
-	if (rdev->family >= CHIP_R600) {
-		if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
+		if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) &&
+		    radeon_dp_needs_link_train(radeon_connector))
 			drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
 		else
 			drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+		connector->dpms = saved_dpms;
 	}
 }
 
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -479,6 +479,7 @@ extern void radeon_dp_set_link_config(st
 				      struct drm_display_mode *mode);
 extern void radeon_dp_link_train(struct drm_encoder *encoder,
 				 struct drm_connector *connector);
+extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector);
 extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
 extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
 extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);



  parent reply	other threads:[~2011-08-16  2:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16  2:45 [00/26] 3.0.3-stable review Greg KH
2011-08-16  2:42 ` [01/26] staging: rtl8192u: declare MODULE_FIRMWARE Greg KH
2011-08-16  2:42 ` [02/26] USB: xhci: fix OS want to own HC Greg KH
2011-08-16  2:42 ` [03/26] xhci: Dont submit commands or URBs to halted hosts Greg KH
2011-08-16  2:42 ` [04/26] usb/config: use proper endian access for wMaxPacketSize Greg KH
2011-08-16  2:42 ` [05/26] usb: musb: fix oops on musb_gadget_pullup Greg KH
2011-08-16  2:42 ` [06/26] USB: assign instead of equal in usbtmc.c Greg KH
2011-08-16  2:42 ` [07/26] USB: ftdi_sio: fix minor typo in get_ftdi_divisor Greg KH
2011-08-16  2:42 ` [08/26] USB: usb-storage: unusual_devs entry for ARM V2M Greg KH
2011-08-16  2:42 ` [09/26] USB: Serial: Added device ID for Qualcomm Modem in Greg KH
2011-08-16  2:42 ` [10/26] USB: option driver: add PID for Vodafone-Huawei K3770 Greg KH
2011-08-16  2:42 ` [11/26] USB: option driver: add PID for Vodafone-Huawei K3771 Greg KH
2011-08-16  2:42 ` [12/26] USB: option driver: add PID for Vodafone-Huawei K4510 Greg KH
2011-08-16  2:42 ` [13/26] USB: option driver: add PID for Vodafone-Huawei K4511 Greg KH
2011-08-16  2:42 ` [14/26] atm: br2864: sent packets truncated in VC routed mode Greg KH
2011-08-16  2:42 ` [15/26] hwmon: (ibmaem) add missing kfree Greg KH
2011-08-16  2:42 ` [16/26] ALSA: snd-usb-caiaq: Correct offset fields of outbound iso_frame_desc Greg KH
2011-08-16  2:43 ` [17/26] ASoC: Fix binding of WM8750 on Jive Greg KH
2011-08-16  2:43 ` [18/26] ASoC: Tegra: tegra_pcm_deallocate_dma_buffer: Dont OOPS Greg KH
2011-08-16  2:43 ` [19/26] ASoC: Tegra: wm8903 machine driver: Allow re-insertion of Greg KH
2011-08-16  2:43 ` [20/26] ath5k: fix error handling in ath5k_beacon_send Greg KH
2011-08-16  2:43 ` [21/26] mm: fix wrong vmap address calculations with odd NR_CPUS values Greg KH
2011-08-16  2:43 ` [22/26] lguest: allow booting guest with CONFIG_RELOCATABLE=y Greg KH
2011-08-16  2:43 ` [23/26] drm/radeon/kms: dont enable connectors that are off in the Greg KH
2011-08-16  2:43 ` [24/26] drm/radeon/kms: fix regression is handling >2 heads on Greg KH
2011-08-16  2:43 ` Greg KH [this message]
2011-08-16  2:43 ` [26/26] perf tools: do not look at ./config for configuration Greg KH

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=20110816024455.856250121@pistachio.kroah.org \
    --to=gregkh@suse.de \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alexander.deucher@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®