diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-08-31 07:13:40 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-09-01 09:37:21 +0100 |
commit | 654a4ef07a53c6b20e5411718e3aebe04c6a985f (patch) | |
tree | c68cea3645259d648ac00e6d8c50869f8818292b /drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | |
parent | d3ed74027f1dd197b7e08247a40d3bf9be1852b0 (diff) | |
download | blackbird-op-linux-654a4ef07a53c6b20e5411718e3aebe04c6a985f.tar.gz blackbird-op-linux-654a4ef07a53c6b20e5411718e3aebe04c6a985f.zip |
vmwgfx: Let SVGA_REG_NUM_DISPLAYS determine output connectivity
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c')
-rw-r--r-- | 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 b3a2cd5118d7..7b8115aab54d 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[] = { |