Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp469201pxb; Mon, 25 Oct 2021 11:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0FldNOdMNKC26eiZiF4dVZTmaOUseMtMbOIQbuNrbjbexM/eTkLQOAZR3xorkcQV6WW/9 X-Received: by 2002:a05:6402:1cc1:: with SMTP id ds1mr28620377edb.386.1635187801860; Mon, 25 Oct 2021 11:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635187801; cv=none; d=google.com; s=arc-20160816; b=IP9tW0qV5GnKIjyoeJsDkCrOhUw4gaASxru6xU5jPDwHmh/VrauKw/wlh/kZ3ssMjX jTM22R7UdXEzbJs1a79jx81jIKPnP0iWH+mcauGAgMQd4r3vN8tUyUuLdQSj+/aY/Iqn 9I5C3e1aFh/DNGinXU/khfDnp/A7YYNxws7hjouyuNEuqu2J61GQpLuPrEmt7nxZn/No HGL4vKXDHYyI1b6kXu4coybib6lchInikZPCMGKNkzGZgA4Jj3v7nLtAFTMqixNqkdif ST3qsejvYa1+tcUEzl4clu2KojYDq2XlqMa2L7PiiZdAPhsgSpcr0k7rjimLkT/6Bk9j lwXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=CfX8ir9dvIX1TZhCsctRqYoHiCgLCU95nZl/me3GQSo=; b=1I9ZPDT3Ac3yKL2gVGoQpC6tCG2pFhPATkMVDzPW125oe42NY2ACmoXIm7sKQxol+7 ZRZlKJ4OJrGvxXcqLYeqvvaLlIajXjXiMepNY9efDX+zKtLCK2D244XK4kMb4hccCCJk VQy5y151tW6FKR/+0PrVeNSUiSUHej5/dhDk480HOWLaDZO05ox5Xjv9HZ95ZKKm6vFm StncKL4hZF5xkta52LW7Qzdj6xzpb+/rnOkaxN2YVTo1DzqyCSiHpBqZuUoNqv2wHYUc NEObHTBnAhe26o/XMeL5a0fHpVkN7rHTGVflGO4Mun+ZJcccV/kRfbbJXxwwxu5Q7jEC pqtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si22861797edf.34.2021.10.25.11.49.36; Mon, 25 Oct 2021 11:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231128AbhJYN07 (ORCPT + 99 others); Mon, 25 Oct 2021 09:26:59 -0400 Received: from mail.netline.ch ([148.251.143.180]:57246 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbhJYN06 (ORCPT ); Mon, 25 Oct 2021 09:26:58 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 982FF20201B; Mon, 25 Oct 2021 15:24:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hLnYRS65WIdU; Mon, 25 Oct 2021 15:24:34 +0200 (CEST) Received: from thor (24.99.2.85.dynamic.wline.res.cust.swisscom.ch [85.2.99.24]) by netline-mail3.netline.ch (Postfix) with ESMTPA id F2F5120201A; Mon, 25 Oct 2021 15:24:33 +0200 (CEST) Received: from [127.0.0.1] by thor with esmtp (Exim 4.95) (envelope-from ) id 1mezxp-000X47-F6; Mon, 25 Oct 2021 15:24:33 +0200 Message-ID: <9e9ddab2-5bcd-f826-2343-d1db691a308e@daenzer.net> Date: Mon, 25 Oct 2021 15:24:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-CA To: Javier Martinez Canillas , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann , Peter Robinson , Neal Gompa , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , dri-devel@lists.freedesktop.org References: <20211022144040.3418284-1-javierm@redhat.com> <931230b4-1e73-948d-abaf-f1d62ea58239@daenzer.net> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Subject: Re: [RFC PATCH] drm/aperture: Add param to disable conflicting framebuffers removal In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-25 14:28, Javier Martinez Canillas wrote: > Hello Michel, > > On 10/25/21 12:45, Michel Dänzer wrote: >> On 2021-10-24 22:32, Javier Martinez Canillas wrote: >>> Hello Ville, >>> >>> On 10/22/21 21:12, Ville Syrjälä wrote: >>>> On Fri, Oct 22, 2021 at 04:40:40PM +0200, Javier Martinez Canillas wrote: >>>>> The simpledrm driver allows to use the frame buffer that was set-up by the >>>>> firmware. This gives early video output before the platform DRM driver is >>>>> probed and takes over. >>>>> >>>>> But it would be useful to have a way to disable this take over by the real >>>>> DRM drivers. For example, there may be bugs in the DRM drivers that could >>>>> cause the display output to not work correctly. >>>>> >>>>> For those cases, it would be good to keep the simpledrm driver instead and >>>>> at least get a working display as set-up by the firmware. >>>>> >>>>> Let's add a drm.remove_fb boolean kernel command line parameter, that when >>>>> set to false will prevent the conflicting framebuffers to being removed. >>>>> >>>>> Since the drivers call drm_aperture_remove_conflicting_framebuffers() very >>>>> early in their probe callback, this will cause the drivers' probe to fail. >>>> >>>> Why is that better than just modprobe.blacklisting those drivers? >>> >>> Because would allow to deny list all native (as Thomas called it) DRM drivers >>> and only allow the simpledrm driver to be probed. This is useful for distros, >>> since could add a "Basic graphics mode" to the boot menu entries, that could >>> boot the kernel passing a "drm.disable_native_drivers=1" cmdline option. >>> >>> That way, if there's any problem with a given DRM driver, the distro may be >>> installed and booted using the simpledrm driver and troubleshoot why a native >>> DRM driver is not working. Or try updating the kernel package, etc. >> >> For troubleshooting, it'll be helpful if this new parameter can be enabled for the boot via the kernel command line, then disabled again after boot-up. One simple possibility for this would be allowing the parameter to be changed via /sys/module > > That's already the case with the current patch, i.e: > > $ grep -o drm.* /proc/cmdline > drm.disable_native_drivers=1 > > $ cat /proc/fb > 0 simpledrm > > $ modprobe virtio_gpu > > $ dmesg > [ 125.731549] [drm] pci: virtio-vga detected at 0000:00:01.0 > [ 125.732410] virtio_gpu: probe of virtio0 failed with error -16 > > $ echo 0 > /sys/module/drm/parameters/disable_native_drivers > > $ modprobe virtio_gpu > > $ dmesg > [ 187.889136] [drm] pci: virtio-vga detected at 0000:00:01.0 > [ 187.894578] Console: switching to colour dummy device 80x25 > [ 187.897090] virtio-pci 0000:00:01.0: vgaarb: deactivate vga console > [ 187.899983] [drm] features: -virgl +edid -resource_blob -host_visible > [ 187.907176] [drm] number of scanouts: 1 > [ 187.907714] [drm] number of cap sets: 0 > [ 187.914108] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor 1 > [ 187.930807] Console: switching to colour frame buffer device 128x48 > [ 187.938737] virtio_gpu virtio0: [drm] fb0: virtio_gpu frame buffer device > > $ cat /proc/fb > 0 virtio_gpu > > /drm/parameters/, which I suspect doesn't work with the patch as is (due to the 0600 permissions). >> >> > > I followed the convention used by other drm module parameters, hence the > 0600. Do you mean that for this parameter we should be less restrictive ? No, it was simply a brain fart on my part. :} Thanks for confirming this works! -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer