From patchwork Fri Oct 18 14:11:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 3068181 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 34B669F372 for ; Fri, 18 Oct 2013 14:58:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F90F202C7 for ; Fri, 18 Oct 2013 14:58:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D863B20237 for ; Fri, 18 Oct 2013 14:58:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81285E73F5 for ; Fri, 18 Oct 2013 07:58:36 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 772B6E632F for ; Fri, 18 Oct 2013 07:12:18 -0700 (PDT) Received: by mail-ee0-f51.google.com with SMTP id c1so2054876eek.10 for ; Fri, 18 Oct 2013 07:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ncf1SBEBiFPnLT9fdqjzlm0KdhBzCiuNO8I1FscCF2Y=; b=cIu8hrcMi4LlsLN6xycxzI//DKh1LYUWXL/QLyg7hIavK8yKN/BjLwmBUQ/ueauR5c C3EW/Wve7JNqHO/IEYBYwqUsiJHlK46hJXZYpsN8+voGL6KR1FSjexlsvSf+HjYKPY9U F4NvNTCUFYKVJJoO0ppYqfwmDqiWQgSePjXGXwq7v6MHXkYJ57+oM08SN8k5lLzDJe/v mkRHNyZUseUXTXL7YRIY7UInOV5Ewb9hJ3kfxtPbfXoU+ZAAILcNiAb14Apc9tInV0+m tCpw/vcIKO8W06Yeqoa8imqAu4omC2rW2KEoxYQ7i6br8IcmvX3QdbKJAYQPIbRFnDZB gTbw== X-Received: by 10.14.5.3 with SMTP id 3mr4823204eek.49.1382105537675; Fri, 18 Oct 2013 07:12:17 -0700 (PDT) Received: from localhost (122.Red-83-45-5.dynamicIP.rima-tde.net. [83.45.5.122]) by mx.google.com with ESMTPSA id m54sm5059263eex.2.2013.10.18.07.12.15 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2013 07:12:16 -0700 (PDT) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" To: dri-devel@lists.freedesktop.org Subject: [PATCH 7/7] drm/qxl: fix disabling extra monitors from client Date: Fri, 18 Oct 2013 16:11:33 +0200 Message-Id: <1382105493-2152-7-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382105493-2152-1-git-send-email-marcandre.lureau@redhat.com> References: <1382105493-2152-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Cc: airlied@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To disable a monitor, a Spice client sends a monitor config with the monitor resolution to 0x0. However, before qxl_crtc_disable() is reached after the hotplug event, it can happen that another monitor is reconfigured, and qxl_send_monitors_config() is called with the old config, which will re-enable the monitor on the client. Reset config if monitor is found disconnected, during drm_helper_hpd_irq_event(). Signed-off-by: Marc-André Lureau --- drivers/gpu/drm/qxl/qxl_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 4f28060..61974cb 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -803,7 +803,10 @@ static enum drm_connector_status qxl_conn_detect( qdev->client_monitors_config->count > output->index && qxl_head_enabled(&qdev->client_monitors_config->heads[output->index])); - DRM_DEBUG("\n"); + DRM_DEBUG("#%d connected: %d\n", output->index, connected); + if (!connected) + qxl_monitors_config_set(qdev, output->index, 0, 0, 0, 0, 0); + return connected ? connector_status_connected : connector_status_disconnected; }