Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp535045imp; Thu, 21 Feb 2019 06:25:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IZrp+b8ex+tj75h4RixeRJUWpRETUuSR/mM2AANcBkd6biLr+HbqHLB9vedBVUdVizyUzNE X-Received: by 2002:a62:1c45:: with SMTP id c66mr40839229pfc.90.1550759102392; Thu, 21 Feb 2019 06:25:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550759102; cv=none; d=google.com; s=arc-20160816; b=KYkHPok8SQz4kQOphK0Uld/GIrY8B76amV5I1M+a86zGSu4L7R1Lo6rfD6YFE6Pzbz gDSX0Vnni2vHZIQiSHbPBeJvc8theiXMzSrT0d0Gt8AK0xNZ+zCaHb52Si5tD1u9ES7n FGxlXIbvus5pfq2OgAQx3qQO+oQ5f4Q5b9syXdHXbEyVOlzuzcRfzDw+BYBUFKyR4xCg CGW+HlbRYMemtgM0yNkvvTrnVZTnCEThaBFTOqKDMOD2MbSwHjksIrAEU44sj507AQPS tzr7p7xfgVz0vnooJVAlSHZ07A+qfFocnvnbsLnyFS4KwWI4Va0ud/Mm4vzuvFzyJNfq 105g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=ZQAFUDUjwfCpg7XfgJQwpJJFuZFeiMRAsGcLm7XG51c=; b=hWf5jOLMa5PdyG1SLAwHjeMAiEltkeBBc/I7ExMFwL9iGyRX3iYpKr703ZJ77W0MlH GjIyDv60BS2FF0oxptu7F/rOR1ebs4VKve7lKf/JeUVaMkxyeUO+yD2lLFxXywcQwFZY Q0P+UwpnG/dQz+Dbw1Y/Qey4sKocyn6fOmHDldOCDL+ExhLTScshlQvY958cqiNfN1uy +SeNi2uny0ZUZ3+lqnyBTanGFdPEbwtP/HdLBWw1XQ6LMse0Msv0N8sVQ3Wlqn375H5Y 0PAuFaByiz+HJhjVzSNvJPRqRRnFVMvhjAMyN6tgZswOFHJQkNPUYqW78YGpa1RaaPhr 1QVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=H8Dv7D1O; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si19917631pgo.356.2019.02.21.06.24.47; Thu, 21 Feb 2019 06:25:02 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=H8Dv7D1O; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726617AbfBUOYX (ORCPT + 99 others); Thu, 21 Feb 2019 09:24:23 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:37553 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbfBUOYW (ORCPT ); Thu, 21 Feb 2019 09:24:22 -0500 Received: by mail-ed1-f68.google.com with SMTP id m12so23271159edv.4 for ; Thu, 21 Feb 2019 06:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ZQAFUDUjwfCpg7XfgJQwpJJFuZFeiMRAsGcLm7XG51c=; b=H8Dv7D1OwmAC25lxy94ihuw+uGssAnZYN59GjrvaKDEZubnUvYWc5lTvmsv4zt9gmM WTF+Oesa5l6K8AGURTWwZYcPUf4DC0AhmP5CFp8PrRH0rA7nIZv9MFiH38PO80Fv74hX uTCYAYv6bCVaWiKh+B8yqxHtqAPcEo8AFQdHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ZQAFUDUjwfCpg7XfgJQwpJJFuZFeiMRAsGcLm7XG51c=; b=Xuom3q0FOvZ20lHwMZvhfQDKfA8L03vjTXkNKNFKD2DnQ1bfIh8RLf1kLsjAas9Jru 3It4PdQjdM94OJxSGF0mGJ55cFtn6YC0FUpDk65ewj0r/CAcKY2/gNI2WCmzEEhKB0kb qD7BJFp66HiBlt+V1sG70I0j0xVZAY2uSyQZJL9S8BbwyOvncB4N6XjjpDvc0+QWbNEl 0i/izpTlq3tCTr2Xwh/mzNgpL21hewHqntzVBFhGlaT0ALZR4p0TBbjeSS3szygoxMsY 9edyeVDUhnA4vuM8Px6u9Vgkfahi8InFayL/U7hEZse9ieupnIlhzqLWcqs0yVqWS0ML Ga/Q== X-Gm-Message-State: AHQUAuaftbjAty+MhPVesOxRlDgqAEbhICaWI8xWPhkRSqe4cGRNc6D9 KdT5CGvRaqpvwqpZhdWVBl69Uw== X-Received: by 2002:a17:906:2643:: with SMTP id i3mr27696587ejc.157.1550759060531; Thu, 21 Feb 2019 06:24:20 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id s3sm5432079edm.78.2019.02.21.06.24.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Feb 2019 06:24:19 -0800 (PST) Date: Thu, 21 Feb 2019 15:24:17 +0100 From: Daniel Vetter To: Gerd Hoffmann Cc: dri-devel@lists.freedesktop.org, Dave Airlie , David Airlie , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , open list Subject: Re: [PATCH v2 2/2] drm/qxl: kick out vgacon Message-ID: <20190221142417.GT2665@phenom.ffwll.local> Mail-Followup-To: Gerd Hoffmann , dri-devel@lists.freedesktop.org, Dave Airlie , David Airlie , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , open list References: <20190221113534.20764-1-kraxel@redhat.com> <20190221113534.20764-3-kraxel@redhat.com> <20190221122011.GP2665@phenom.ffwll.local> <20190221130623.rjtmtoe2qf7dgy2t@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190221130623.rjtmtoe2qf7dgy2t@sirius.home.kraxel.org> X-Operating-System: Linux phenom 4.19.0-1-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 02:06:23PM +0100, Gerd Hoffmann wrote: > On Thu, Feb 21, 2019 at 01:20:11PM +0100, Daniel Vetter wrote: > > On Thu, Feb 21, 2019 at 12:35:34PM +0100, Gerd Hoffmann wrote: > > > 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. So make sure we kick out vgacon > > > early enough that it wouldn't disturb us. > > > > > > Signed-off-by: Gerd Hoffmann > > > --- > > > drivers/gpu/drm/qxl/qxl_drv.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c > > > index bb81e310eb..08446561aa 100644 > > > --- a/drivers/gpu/drm/qxl/qxl_drv.c > > > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > > > @@ -95,6 +95,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > > > goto modeset_cleanup; > > > > > > drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); > > > + drm_fb_helper_kick_out_vgacon(); > > > > I was thinking of checking whether pdev is a VGA class device and whether > > it decodes vga access, and in that case automatically calling > > kick_out_vgacon from remove_conflicting_pci_framebuffer. Since that's what > > drivers want anyway, and those who don't can open code it. > > > > Or is there an issue with that? > > It'll need more careful testing to make sure we don't have unwanted side > effects when just doing it for everyone. And I guess most drivers don't > care much because their hardware ignores vga port writes once they are > switched out of vga text mode. > > Dunno why i915 needs this. The problem isn't loading, it's unloading again. If you boot with vgacon, but no fbdev driver (which iirc also has magic code to throw out the vga console), then when you unload your kms driver vgacon kicks back in. And a pile of things go really sideways when that happens. I have no idea whether it's just intel hw or maybe pci decoding or something else, but seems like good practice to kick out all existing drivers, to make sure they can never get at the hw again. So don't think it'll hurt to do this for everyone. But yeah maybe we can do that as a follow-up (and convert i915 over), dunno. -Daniel > In case of qxl it is more a historical leftover. The very first qxl > device revision had no explicit qxl command to switch from qxl native > mode back to vga compatibility mode, vga port access was used for that > instead. It's long fixed, but the qxl device still has that quirk for > compatibility with very old guest drivers. > > cheers, > Gerd > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch