fbcon non-desktop display use

Keith Packard keithp at keithp.com
Thu Mar 15 18:30:18 UTC 2018


Charles Lohr <lohr85 at gmail.com> writes:

> Even if the vive is the only device connected, it will still not permit it
> to be operated.  See https://github.com/linux-sunxi/linux-sunxi/issues/291
> for dri with a lot of debugging turned on.

Oh, it's not supposed to do that. I had intended to write the code so
that if the only device available was a non-desktop device that it would
go ahead and use it. The X server patches did that, but the kernel ones
did not. It looks like that would be an easy patch -- just skip the
non_desktop check in the !strict case for drm_connector_enabled.

However, your patch is a good addition as it will allow you to also
enable the HMD when other monitors are connected.

> I can understand that most users would probably prefer that the vive isn't
> automatically used if no other displays are available, however, the current
> behavior prevents use of the vive on all devices that use fbdev for their
> primary output.

That was definitely not my intention, and thanks for discovering this!

> I've never sent an email to the kernel devel list, so I'm still a little
> nervous.  Especially because this is against a different branch, and I'm
> starting to think that I should be messaging there, but this is something
> that really needs to go upstream.

We'll get it sorted out; I'm not sure what Dave's preference is these
days anyways.

Aside from some minor formatting issues, this patch looks good to me.

> Signed-off-by:

You'll need to add your name and email address here.

> diff --git a/drivers/gpu/drm/drm_fb_helper.c
> b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd..8bfaf79ff 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -55,6 +55,11 @@ MODULE_PARM_DESC(drm_fbdev_overalloc,
>                  "Overallocation of the fbdev buffer (%) [default="
>                  __MODULE_STRING(CONFIG_DRM_FBDEV_OVERALLOC) "]");
>
> +static bool drm_fbdev_permit_non_desktop;
> +module_param(drm_fbdev_permit_non_desktop, bool, 0644);
> +MODULE_PARM_DESC(drm_fbdev_permit_non_desktop,
> +               "Allow the framebuffer to use non-desktop displays
> [default=off]");
> +

Your email client appears to be wrapping long lines, which breaks the patch.


>  static LIST_HEAD(kernel_fb_helper_list);
>  static DEFINE_MUTEX(kernel_fb_helper_lock);
>
> @@ -2109,7 +2114,7 @@ static bool drm_connector_enabled(struct
> drm_connector *connector, bool strict)
>  {
>         bool enable;
>
> -       if (connector->display_info.non_desktop)
> +       if (connector->display_info.non_desktop &&
> !drm_fbdev_permit_non_desktop)

If you added '&& strict' here, it will use the HMD if there aren't any
desktop monitors connected.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180315/1e5429d4/attachment-0001.sig>


More information about the dri-devel mailing list