From patchwork Wed Aug 31 07:13:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 1115132 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7V7GP59016718 for ; Wed, 31 Aug 2011 07:16:45 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE4709E958 for ; Wed, 31 Aug 2011 00:16:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp-outbound-2.vmware.com (smtp-outbound-2.vmware.com [65.115.85.73]) by gabe.freedesktop.org (Postfix) with ESMTP id 6497C9E761 for ; Wed, 31 Aug 2011 00:15:30 -0700 (PDT) Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 3D8E41C011; Wed, 31 Aug 2011 00:15:30 -0700 (PDT) Received: from mailhost4.vmware.com (unknown [10.23.99.1]) by mailhost3.vmware.com (Postfix) with ESMTP id 16633CDA9C; Wed, 31 Aug 2011 00:15:28 -0700 (PDT) From: Thomas Hellstrom To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH 01/10] vmwgfx: Let SVGA_REG_NUM_DISPLAYS determine output connectivity Date: Wed, 31 Aug 2011 09:13:40 +0200 Message-Id: <1314774829-8981-2-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1314774829-8981-1-git-send-email-thellstrom@vmware.com> References: <1314774829-8981-1-git-send-email-thellstrom@vmware.com> Cc: Thomas Hellstrom X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 07:16:45 +0000 (UTC) Signed-off-by: Thomas Hellstrom --- 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 b3a2cd5..7b8115a 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 const struct drm_display_mode vmw_ldu_connector_builtin[] = {