Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp196733ybr; Fri, 22 May 2020 04:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC+NBlyr+ElC7OIOET2TpCtIjp0d9Udgwz0xxFp055mnSbuxqSKXkEJI95/QIwV39m4qQc X-Received: by 2002:a17:906:4995:: with SMTP id p21mr7732413eju.19.1590147261039; Fri, 22 May 2020 04:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590147261; cv=none; d=google.com; s=arc-20160816; b=CfxVwBdX4+ih3um46Lgw0/zEgJawjLU08VULNtGNHpapR6+UjhszTucU1X/cgY4r4k gG0Y+buATmzAlu5GvRTvVzDJ9pm8u/ryxWjUdNkYFsnVh8lklo+TayoGqGRCx05y4QxG yftf8oWvIADCINLaw9tt+PV8BHK0oyw1xiSBvpRAPmbkgHKP8x3hypfEd443b3WK2EvH GaV/DGLt9yIgUS4XEMybXwQZJc1UM+CMv72JwcSFD+CC+A4Lyxd8SDLYwuNJRelb7jH2 wjQLbbFqMhhReNXzgFsbjzGP+TnULKXjjAOeIRTI5yvSsM/p1jRxPeZmbQk3r3kvCsF/ XfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U4LquBwhpn1xhFCeRgj1virah+C2s80rhl/B94y8L04=; b=Kni7RU9dOErelIm6EkzIldqTuR6t2xJpafqwWOHn8efaQsVuOTF3N68iFNHDFL1WTQ UlP6Mm3n3TcT0D2wa+vgVlqFX0zTlvsnlXrCGeMCp1xkInLt/XgfxeRzsbXWmk42GIUG tkzhmOX1G7D2q8T5FfU4RinH0xkV0ZMTY2m/Sq4WfYOLGKXIsJ/TfCL8Cd2zAGPB72jf SzdRyCwqpfcpCUMij+AObeHx3YAZPPZDT0D14wWjKYmtKuO1GAife8rsXNK9zBu4+6rZ zWTW3dnn8WpoeS0KIDNRfIJpAkXQEV+7hRjhuLqJODsb7Yweq2TK6gmTuX43qPlrFNRy 8Efw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rfh4SEbA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si4881440ejl.434.2020.05.22.04.33.57; Fri, 22 May 2020 04:34:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Rfh4SEbA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729688AbgEVLcZ (ORCPT + 99 others); Fri, 22 May 2020 07:32:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:41558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728281AbgEVLcY (ORCPT ); Fri, 22 May 2020 07:32:24 -0400 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A756420825; Fri, 22 May 2020 11:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590147143; bh=btO8dneIHmfPGOmIgBvqxryNd/NmrdBoDkXLictJqrk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Rfh4SEbAEPtCnYXpk3OHCC/o+2FL9NyR+ypO4n1PpNFyghj99NyQgvlG0klOuTppN sKe3uLE3Kz5n12u4Ni0xxikCCePD6wLj+NKO76W71TNMm0wbTCJJNdkiGIqjmd9Dr/ m0YsyCiXUxEUxbPEDwpSMKbnZ+40SMwiFOPeXDSw= Received: by mail-io1-f50.google.com with SMTP id d5so1478475ios.9; Fri, 22 May 2020 04:32:23 -0700 (PDT) X-Gm-Message-State: AOAM530FMj5UZFelj7Un0Vlv2tFXurdDubcQlXJ3Z/zgdGNKANG1wLkP EvEiLGYOzRNWU0f6y9gd2OeuQl8/eDxxYZqoxSg= X-Received: by 2002:a5d:81d7:: with SMTP id t23mr1676129iol.142.1590147142933; Fri, 22 May 2020 04:32:22 -0700 (PDT) MIME-Version: 1.0 References: <1584200119-18594-1-git-send-email-mikelley@microsoft.com> <1584200119-18594-10-git-send-email-mikelley@microsoft.com> <4202ea20-6e51-31d3-44b1-3861798a8158@nvidia.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 22 May 2020 13:32:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 09/10] arm64: efi: Export screen_info To: Nikhil Mahale Cc: Michael Kelley , Arnd Bergmann , Will Deacon , Catalin Marinas , Mark Rutland , Marc Zyngier , Linux ARM , gregkh , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , linux-efi , linux-arch , "olaf@aepfle.de" , Andy Whitcroft , vkuznets , Jason Wang , "marcelo.cerri@canonical.com" , KY Srinivasan , Sunil Muthuswamy , Boqun Feng Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 May 2020 at 13:15, Nikhil Mahale wrote: > > On 5/18/20 6:21 PM, Ard Biesheuvel wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, 18 May 2020 at 06:25, Nikhil Mahale wrote: > >> > >> On 5/13/20 7:56 PM, Nikhil Mahale wrote: > >>> On 3/20/20 3:16 AM, Michael Kelley wrote: > >>>> From: Arnd Bergmann Sent: Wednesday, March 18, 2020 2:27 AM > >>>>> > >>>>> On Wed, Mar 18, 2020 at 1:18 AM Michael Kelley wrote: > >>>>>> From: Arnd Bergmann > >>>>>>> On Sat, Mar 14, 2020 at 4:36 PM Michael Kelley wrote: > >>>>>>>> > >>>>>>>> The Hyper-V frame buffer driver may be built as a module, and > >>>>>>>> it needs access to screen_info. So export screen_info. > >>>>>>>> > >>>>>>>> Signed-off-by: Michael Kelley > >>>>>>> > >>>>>>> Is there any chance of using a more modern KMS based driver for the screen > >>>>>>> than the old fbdev subsystem? I had hoped to one day completely remove > >>>>>>> support for the old CONFIG_VIDEO_FBDEV and screen_info from modern > >>>>>>> architectures. > >>>>>>> > >>>>>> > >>>>>> The current hyperv_fb.c driver is all we have today for the synthetic Hyper-V > >>>>>> frame buffer device. That driver builds and runs on both ARM64 and x86. > >>>>>> > >>>>>> I'm not knowledgeable about video/graphics drivers, but when you > >>>>>> say "a more modern KMS based driver", are you meaning one based on > >>>>>> DRM & KMS? Does DRM make sense for a "dumb" frame buffer device? > >>>>>> Are there any drivers that would be a good pattern to look at? > >>>>> > >>>>> It used to be a lot harder to write a DRM driver compared to an fbdev > >>>>> driver, but this has changed to the opposite over the years. > >>>>> > >>>>> A fairly minimal example would be drivers/gpu/drm/pl111/pl111_drv.c > >>>>> or anything in drivers/gpu/drm/tiny/, but you may want to look at the > >>>>> other hypervisor platforms first, i.e drivers/gpu/drm/virtio/virtgpu_drv.c, > >>>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c, drivers/gpu/drm/xen/xen_drm_front.c, > >>>>> drivers/gpu/drm/qxl/qxl_drv.c, and drivers/gpu/drm/bochs/bochs_drv.c. > >>>>> > >>>> > >>>> Thanks for the pointers, especially for the other hypervisors. > >>>> > >>> Sorry if anybody in 'to' or 'cc' is receiving this reply multiple times. > >>> I had configured by email client incorrectly to reply. > >>> > >>> screen_info is still useful with a modern KMS-based driver. It exposes > >>> the mode parameters that the GOP driver chose. This information is > >>> needed to implement seamless or glitchless boot, by both ensuring that > >>> the scanout parameters don't change and being able to read back the > >>> scanout image to populate the initial contents of the new surface. > >>> > >>> This works today on arches which implement (U)EFI and export > >>> screen_info, including x86 and powerpc, but doesn't work on arm or > >>> arm64. As arm64 systems that implement UEFI with real GOP drivers > >>> become more prevalent, it would be nice to be have these features there > >>> as well. > >> > >> In addition to this, even if a driver doesn't implement a framebuffer > >> console, or if it does but has an option to disable it, the driver still > >> needs to know whether the EFI console is using resources on the GPU so > >> it can avoid clobbering them. For example screen_info provides information > >> like offset and size of EFI console, using this information driver can > >> reserve memory used by console and prevent corruption on it. > >> > >> I think arm64 should export screen_info. > >> > > > > If there are reasons why KMS or fbdev drivers may need to access the > > information in screen_info, it should be exported. I don't think that > > is under debate here. > > > > Hi Ard, thanks for your feedback. If my understanding is correct, > you are agree to export screen_info. Can you provide guidance on how can > we proceed here? are you willing to accept this current patch as-is or > would you like me to re-submit the patch with the additional rationale > provided? > Please (re-)submit it along with the code that actually makes use of it.