Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp643487imp; Wed, 20 Feb 2019 06:37:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IbwzT2i7I5YQFO3cEKVjJ7DPrkAX/H6XbG4jYSA24kJqfLKx5RkOcwuw989amkO8OZKxk+z X-Received: by 2002:aa7:8392:: with SMTP id u18mr35148098pfm.59.1550673467021; Wed, 20 Feb 2019 06:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550673467; cv=none; d=google.com; s=arc-20160816; b=O3VHD8YU/Z02ZrjeaFHnzjpPytMmO7pJwPZW4gV/eixShINuE3vNhMcr06x+sdbgmx lpAAoCDyhTj83L0YWZIG2hvgCvg2aoLcI8DYg4fQb4ymQx+VjxmXb9ltPvPsWUfpKPih +mgu8TAFz5yCdCW8ggNhcPvWOk6qdL7BZFaJLdTI1fqCczs/P9ARCRx/e0LSLcHWyagz XrhQtfqIUZscAqMgn6FtiH2Zg9wN1SUhEAb6z+EuFEzTHQFXhlh9phfOvR3LD/Y6AYLn U/xNhREJVsqgSvUsww7I4dVNxZK6eY4bo2cCfHcUp0gZCSeGMGuCM6XDjYfPVZVj8Jck /njA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=B8npkGvFPpWOrbu/tozWbWjXSUt92AtfXyi9xpemSLs=; b=w+OcS1gjHLRXpibywCI7SWXDf6V+IYttv7OTU6UHfttoH7aD6wa9omkmT4HS8QMOo2 C+O6wnLHfYaHO3QGWoedxmNy0v8cj5G5MIuKnitK0bDBe9+gwXcBzkFEl1RKeYNbIC42 dcpx8l1XxILcJzfmuo1JpoPZ3chMGYV16tocpv+MPUGwDizYoquSAoSS2zRizJ/J/Wp3 7J/1ycoA881J7e5puDy3pUceLb+1NDI/xyvRhRrw38MoPyf9Ggh+Cm9CD9LsewNKLPw3 KYlgLzUV4oC7bNCZ0msBWjXdMa76IDa62p7/vci80IvAw+WQye0RlVzazoeIEkw7y77D 5hfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d133si19557154pfd.163.2019.02.20.06.37.31; Wed, 20 Feb 2019 06:37:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726285AbfBTOgp (ORCPT + 99 others); Wed, 20 Feb 2019 09:36:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52454 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfBTOgo (ORCPT ); Wed, 20 Feb 2019 09:36:44 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1F0313BF4C; Wed, 20 Feb 2019 14:36:43 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-228.ams2.redhat.com [10.36.116.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68E3E60BE8; Wed, 20 Feb 2019 14:36:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3A5C211AAF; Wed, 20 Feb 2019 15:36:40 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , Dave Airlie , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), spice-devel@lists.freedesktop.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/qxl: unbind vgacon Date: Wed, 20 Feb 2019 15:36:40 +0100 Message-Id: <20190220143640.9970-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Feb 2019 14:36:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Problem: qxl switches from native mode back into vga compatibility mode when it notices someone is accessing vga registers. And vgacon does exactly that before fbcon takes over. Before qxl switched to the generic fbdev emulation that didn't cause any problems. With the generic fbdev emulation the switch to vga mode happens now and then, probably caused by a initialization order change and triggered by a printk in a bad moment. So make sure we take vgacon out of the picture by making dummycon taking over the console early enough. Not entriely happy with the approach, I'm open to better ideas. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index bb81e310eb..88349dc13e 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -89,6 +90,11 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) drm_kms_helper_poll_init(&qdev->ddev); + /* unbind vgacon to make sure it doesn't touch our vga registers */ + console_lock(); + ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, true); + console_unlock(); + /* Complete initialization. */ ret = drm_dev_register(&qdev->ddev, ent->driver_data); if (ret) -- 2.9.3