All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] drm/vmwgfx: Let SVGA_REG_NUM_DISPLAYS decide output connectivity
@ 2010-12-16 14:22 Thomas Hellstrom
  2010-12-20 11:55 ` Thomas Hellstrom
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Hellstrom @ 2010-12-16 14:22 UTC (permalink / raw)
  To: airlied; +Cc: Thomas Hellstrom, dri-devel

Makes the user able to determine the number of connected outputs from
the VMware GUI.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index 29113c9..335c91c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -340,9 +340,16 @@ static enum drm_connector_status
 	vmw_ldu_connector_detect(struct drm_connector *connector,
 				 bool force)
 {
-	if (vmw_connector_to_ldu(connector)->pref_active)
-		return connector_status_connected;
-	return connector_status_disconnected;
+	uint32_t num_displays;
+	struct drm_device *dev = connector->dev;
+	struct vmw_private *dev_priv = vmw_priv(dev);
+
+	mutex_lock(&dev_priv->hw_mutex);
+	num_displays = vmw_read(dev_priv, SVGA_REG_NUM_DISPLAYS);
+	mutex_unlock(&dev_priv->hw_mutex);
+
+	return ((vmw_connector_to_ldu(connector)->base.unit < num_displays) ?
+		connector_status_connected : connector_status_disconnected);
 }
 
 static struct drm_display_mode vmw_ldu_connector_builtin[] = {
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-20 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 14:22 [PATCH][next] drm/vmwgfx: Let SVGA_REG_NUM_DISPLAYS decide output connectivity Thomas Hellstrom
2010-12-20 11:55 ` Thomas Hellstrom

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.