From patchwork Thu Mar 15 20:03:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Lohr X-Patchwork-Id: 10285715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA57A60621 for ; Thu, 15 Mar 2018 20:03:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEEEE28BAF for ; Thu, 15 Mar 2018 20:03:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3B6E28BFA; Thu, 15 Mar 2018 20:03:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20BE728BAF for ; Thu, 15 Mar 2018 20:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751314AbeCOUDM (ORCPT ); Thu, 15 Mar 2018 16:03:12 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:38119 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeCOUDJ (ORCPT ); Thu, 15 Mar 2018 16:03:09 -0400 Received: by mail-oi0-f41.google.com with SMTP id t69so6096627oih.5 for ; Thu, 15 Mar 2018 13:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=d2pj26uJkRFxhdRIb63hGt6HUZCkan0IotwlD28F9u8=; b=hBPZaMJPRDmXV+mU0Bff5BDvgY5YDDuXcO3apOibwlxOGryfOTFBmp/B7x/OYJ5RsT fntg+aTdT11rCTXsZcCNp7U5CvMweGmKNdGd9ic6AWQI2sA96+0li1s3Uu4kq/0zTVkY dzrcMXv53eiWQd6bbRl09+x8FW2PDcHg7DirMIgt+RHV778C5QmvoSmieIuHTm81quwO 8QFkiyOolGigVci+K/d+lhHQPoz2cbTC+pbADG+ZbvuVaQOClh9DFzhb4Y8iBmsV4sEC 28LP1Xvs3GDyNhv2aNpljo0wvgJoF4oWkaRvwTfazHCj1Iqi97LUUXzjnfU0COgDEbAa 4dRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=d2pj26uJkRFxhdRIb63hGt6HUZCkan0IotwlD28F9u8=; b=kacYMihro7wtShYaA9SOEtcmG9a7sPRLiu4FExmZoAYZO1hagXx1okuENojil2eyhr 1mkyVfyw99M+GicXq/RuzYUhfa0iNf7/S3xhXtNegwQno6VAennM6taiUxKIahy6WpHo WvFHhixCXbnGU/LEtYEhaN/BybMMlwnf8OFGxrqJopfIqxZagetVeYtV6JsyK1d3qver kldHdvMvZ7HHVJddmLfBrYaj/ykX+1A6hPudBURywiCzN2uM8Iv+5thZWR6CyLAs+7sD uF/yaxY4Ih6WNg0+ZodsdA2nkeBvMgjn/kmxh3kmMnCF3TZ0s0pbvZAgN186A6B35CAf nC8A== X-Gm-Message-State: AElRT7G+9crxYt0tgmEW8sShHHOrJvtyPf2E1jveCin97BvEOfrV072h HMdVvF0kaqr/6IZ8RuPK2KHXtI3spTsUhaxFJgDGvA== X-Google-Smtp-Source: AG47ELvOBCOdJPezrKGrvXHYAPihCjQA46tquxALy0cAufseuO4WbdS4Gb7gtPj/Kvz88TZ3WsQt4mfvNzt0ob89P8Q= X-Received: by 10.202.106.19 with SMTP id f19mr6343455oic.4.1521144189057; Thu, 15 Mar 2018 13:03:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1922:0:0:0:0:0 with HTTP; Thu, 15 Mar 2018 13:03:08 -0700 (PDT) In-Reply-To: <87zi39yyx1.fsf@keithp.com> References: <87zi39yyx1.fsf@keithp.com> From: Charles Lohr Date: Thu, 15 Mar 2018 16:03:08 -0400 Message-ID: Subject: Re: fbcon non-desktop display use To: Keith Packard Cc: dri-devel@lists.freedesktop.org, David Airlie , Bartlomiej Zolnierkiewicz , Daniel Vetter , Linux Fbdev development list Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To try to address both concerns, it feels easiest to do not in-line. 1) Just for background: The H3, and many other ARM systems use the framebuffer for all video access, 3D accelerated as well as X11. If we want to permit HMD (headmount display) or other non-desktop displays on these devices are going to be used at all, it seems DRM must be set up for them. I don't think of this as a "feature". 2) Although I "wish" there was a way to permit non-desktop use with multiple displays, I am having difficulty finding a specific need to be able to turn it on/off. All applications I can imagine with the HMD currently would involve the HMD being the only connected device. I am still "submitting" the patch with the parameter, however, if you folks decide not to accept it, I intend to re-submit with just the && strict fix (which I just tested and it's good!) -- unless you (Keith) are willing to put forward the && strict as a patch. 3) I am trying "plain text mode" for my patch, so hopefully it doesn't truncate the lines. Also, I misunderstood "Signed-off-by" Thanks! Signed-off-by: Charles Lohr @@ -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 && strict) return false; if (strict) On Thu, Mar 15, 2018 at 2:30 PM, Keith Packard wrote: > Charles Lohr 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 --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 035784ddd..e14624d0f 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]"); + static LIST_HEAD(kernel_fb_helper_list); static DEFINE_MUTEX(kernel_fb_helper_lock);