drm/qxl: only report first monitor as connected if we have no state

If the server isn't new enough to give us state, report the first
monitor as always connected, otherwise believe the server side.

Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2015-09-14 10:28:34 +10:00
parent 1f93e4a96c
commit 69e5d3f893
1 changed files with 7 additions and 5 deletions

View File

@ -886,13 +886,15 @@ static enum drm_connector_status qxl_conn_detect(
drm_connector_to_qxl_output(connector); drm_connector_to_qxl_output(connector);
struct drm_device *ddev = connector->dev; struct drm_device *ddev = connector->dev;
struct qxl_device *qdev = ddev->dev_private; struct qxl_device *qdev = ddev->dev_private;
int connected; bool connected = false;
/* The first monitor is always connected */ /* The first monitor is always connected */
connected = (output->index == 0) || if (!qdev->client_monitors_config) {
(qdev->client_monitors_config && if (output->index == 0)
qdev->client_monitors_config->count > output->index && connected = true;
qxl_head_enabled(&qdev->client_monitors_config->heads[output->index])); } else
connected = qdev->client_monitors_config->count > output->index &&
qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]);
DRM_DEBUG("#%d connected: %d\n", output->index, connected); DRM_DEBUG("#%d connected: %d\n", output->index, connected);
if (!connected) if (!connected)