From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Javier Martinez Canillas <javierm@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Rob Clark <robdclark@gmail.com>
Cc: Rob Clark <robdclark@chromium.org>,
open list <linux-kernel@vger.kernel.org>,
dri-devel@lists.freedesktop.org,
Gurchetan Singh <gurchetansingh@chromium.org>,
Ryan Neph <ryanneph@chromium.org>,
David Airlie <airlied@redhat.com>,
"open list:VIRTIO GPU DRIVER"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH] drm/virtio: Add option to disable KMS support
Date: Tue, 28 Feb 2023 14:23:37 +0300 [thread overview]
Message-ID: <33f03f9e-4af3-3237-00dc-d79570d9022a@collabora.com> (raw)
In-Reply-To: <87a60yywo0.fsf@minerva.mail-host-address-is-not-set>
On 2/28/23 12:19, Javier Martinez Canillas wrote:
> Gerd Hoffmann <kraxel@redhat.com> writes:
>
> Hello Gerd,
>
>> On Mon, Feb 27, 2023 at 07:40:11AM -0800, Rob Clark wrote:
>>> On Sun, Feb 26, 2023 at 10:38 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>>>> On Fri, Feb 24, 2023 at 10:02:24AM -0800, Rob Clark wrote:
>>>>> From: Rob Clark <robdclark@chromium.org>
>>>>>
>>>>> Add a build option to disable modesetting support. This is useful in
>>>>> cases where the guest only needs to use the GPU in a headless mode, or
>>>>> (such as in the CrOS usage) window surfaces are proxied to a host
>>>>> compositor.
>>>> Why make that a compile time option? There is a config option for the
>>>> number of scanouts (aka virtual displays) a device has. Just set that
>>>> to zero (and fix the driver to not consider that configuration an
>>>> error).
>>> The goal is to not advertise DRIVER_MODESET (and DRIVER_ATOMIC).. I
>>> guess that could be done based on whether there are any scanouts, but
>>> it would mean making the drm_driver struct non-const.
>> Apparently there is a drm_device->driver_features override,
>> (amdgpu uses that). The driver could simply drop the DRIVER_MODESET and
>> DRIVER_ATOMIC bits in case no scanout is present instead of throwing an
>> error.
>>
>>> And I think it is legitimate to allow the guest to make this choice,
>>> regardless of what the host decides to expose, since it is about the
>>> ioctl surface area that the guest kernel exposes to guest userspace.
>> I think it is a bad idea to make that a compile time option, I'd suggest
>> a runtime switch instead, for example a module parameter to ask the
>> driver to ignore any scanouts.
>>
> I don't think there's a need for a new module parameter, there's already
> the virtio-gpu 'modeset' module parameter to enable/disable modsetting
> and the global 'nomodeset' kernel cmdline parameter to do it for all DRM
> drivers.
>
> Currently, many drivers just fail to probe when 'nomodeset' is present,
> but others only disable modsetting but keep the rendering part. In fact,
> most DRM only drivers just ignore the 'nomodeset' parameter.
IIUC, Rob's main point for having a config option is solely for security
reasons. The config option eliminates possibility of accidentally (or
intentionally) enabling KMS from software, which is better to have in
case of shipping a product (Chromebook) on which multiple teams are
working on.
--
Best regards,
Dmitry
next prev parent reply other threads:[~2023-02-28 11:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 18:02 Rob Clark
2023-02-25 15:10 ` Dmitry Osipenko
2023-02-27 6:38 ` Gerd Hoffmann
2023-02-27 15:40 ` Rob Clark
2023-02-27 16:06 ` Ville Syrjälä
2023-02-28 6:28 ` Gerd Hoffmann
2023-02-28 9:19 ` Javier Martinez Canillas
2023-02-28 11:23 ` Dmitry Osipenko [this message]
2023-02-28 11:37 ` Thomas Zimmermann
2023-02-28 11:58 ` Javier Martinez Canillas
2023-02-28 12:23 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33f03f9e-4af3-3237-00dc-d79570d9022a@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=javierm@redhat.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=ryanneph@chromium.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®