Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1099953rdb; Sat, 18 Nov 2023 03:11:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiChXUbe19ovOSW3sDplGqy1xzNQKslVdl+af5lYH55t5e//h8r8z4rKp9Kpub7F6fqf+D X-Received: by 2002:a17:90b:3149:b0:27d:7ebe:2e8 with SMTP id ip9-20020a17090b314900b0027d7ebe02e8mr2424889pjb.9.1700305886623; Sat, 18 Nov 2023 03:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700305886; cv=none; d=google.com; s=arc-20160816; b=wj7xXqUnvIsuYunooBS5Sqv78ATz7mYdNs+anisYml5hohaKyaz4rTegCavw2VWbwZ 9o0xDBk8YUrUDj0vVq3gE3leYvwGiXJuH8sUQscPFx30uQUeGTmmtcenMbB2xmYEDrc7 G6VW97SNIxmm1RnLd2HPQro3oATkB8bShtTYPHE38TNisaQmuAzvDuSic51uy3zpVC8j 9x2g17C3HiKBXv0102l4jh9A3914Ca+xcSOrpbWiksUWAXKB4tlvLSd6gZguqBAxhIk/ jYsbmD3KteFGlxJcPgH38cPZWBaPe2CkEthtcnP+poHm+WSN1KS3e33YZQ8SM78znl36 2zwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=zcW40Pm/C2VhC3hYpvH2rN7+M3PaPEN3Ao5G1XKi4yM=; fh=7QVSkZ9EPcItS0szpUk0hzXablAT7JToejAktmtgBZs=; b=KBcqKNMyixO6u7KjZVse5iM5c8OZjYuXWAg1tmyixu+a5mnwJYqm8w0WiurDOQ/M2X mVr3zP+0r+4/8V2TqnyO/gf5RaU+jl/4z3q1UERWM+ySsxS8RFZMEKAucXNkWhHYzLLr /wVnlPBU9ctveXM3/wdBCrVnkIcaxtnjr1KBYEx1Crx3wK43d3ZPPGy731q611ky3/Fg g5C5kySD/n6bPFu2r/smf2HjbMvMPBbdZ/SH+1Fm8wBkWsie7HI0cXEfI6Qof3AW7hF1 rFkGw75MECadIIl5nzxaMmRCnWStUAiD5wjA+eNIa17gCqy8ZqT08ERizLdcipvKu29w v2yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OEdsLfjc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id z23-20020a17090a541700b0028074aabfecsi6178354pjh.128.2023.11.18.03.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 03:11:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OEdsLfjc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8BBE780698E5; Sat, 18 Nov 2023 03:11:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbjKRLKz (ORCPT + 99 others); Sat, 18 Nov 2023 06:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjKRLKy (ORCPT ); Sat, 18 Nov 2023 06:10:54 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593DBD6C for ; Sat, 18 Nov 2023 03:10:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700305849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zcW40Pm/C2VhC3hYpvH2rN7+M3PaPEN3Ao5G1XKi4yM=; b=OEdsLfjcdDRwEE9Mxl7WQL713jqJ8J1PEqAukqrObtaRViHDxvqZakO2zBdtSq4NHDkDWD pOQKDVIV8s8VrMpcAOncIZPxt2fcF8BIL8yzfoM138+esC+FZ/ZEsSWzQZY2ype6HR/oUW IoXPXCjhaDuOyKt5Z7BXm+S8FDuxrOY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-247-YJxqXrZiM-Sq6Et9oJhhlA-1; Sat, 18 Nov 2023 06:10:47 -0500 X-MC-Unique: YJxqXrZiM-Sq6Et9oJhhlA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4083a670d25so2471965e9.0 for ; Sat, 18 Nov 2023 03:10:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700305846; x=1700910646; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zcW40Pm/C2VhC3hYpvH2rN7+M3PaPEN3Ao5G1XKi4yM=; b=lgc1dT0enOcX7aOHZ84E46ariGZzkeHjqwmCkGYHDqZ2ir5uRKvXSv8UDNnHcjog2M 5ZCRW31ribUjKQoOCcCpWp0lOSF3pbzXMnCN3F+KyKCUHxkB4x5BxakJEbKmhBCNp2ya bCvK6Q9LiLu3p5Ztrg9zWNTCjNFVFINm2aGPQUXrPputLsrlu3gjzedG4GtYYrx2f6Qh 1K5BwSVlAFo4B+duRvXpCjbyjfL8BYm63oHodOsYfSo6gJsgWjLnOvUANzrCrt2AStG7 RHpTImV+lSQ8U2Z1TVKZss2WAmklvC6Cq7Z8zF50R4KTgImDtyRtD6admXAcgJ85UTl4 Fg/Q== X-Gm-Message-State: AOJu0YyXkylzIdCz4eu9R5FlOC6LRIo0HclkDhUmoJgJtDHR0dcUTkK2 td5nmr8yI1L9KBTKws1HhvMQlgQhOfaFPKE5buiThvZOzS8mWUKyKUH5FUW+7Sm8f/b3y/xFzba 1ffArKSpy+OHn34nrPmopqMLI X-Received: by 2002:adf:ef92:0:b0:32d:9cdd:a23 with SMTP id d18-20020adfef92000000b0032d9cdd0a23mr1563667wro.25.1700305846414; Sat, 18 Nov 2023 03:10:46 -0800 (PST) X-Received: by 2002:adf:ef92:0:b0:32d:9cdd:a23 with SMTP id d18-20020adfef92000000b0032d9cdd0a23mr1563650wro.25.1700305845984; Sat, 18 Nov 2023 03:10:45 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id o6-20020a5d4086000000b003316e684c5esm2950657wrp.79.2023.11.18.03.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 03:10:45 -0800 (PST) From: Javier Martinez Canillas To: Ard Biesheuvel , Rob Herring Cc: devicetree@vger.kernel.org, Sergio Lopez , Sima Vetter , Hector Martin , Andrew Worsley , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Frank Rowand , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] of/platform: Disable sysfb if a simple-framebuffer node is found In-Reply-To: References: <20231113085305.1823455-1-javierm@redhat.com> <87jzqi59bt.fsf@minerva.mail-host-address-is-not-set> Date: Sat, 18 Nov 2023 12:10:44 +0100 Message-ID: <874jhj1fm3.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 18 Nov 2023 03:11:23 -0800 (PST) Ard Biesheuvel writes: Hello Ard, > On Fri, 17 Nov 2023 at 00:09, Rob Herring wrote: [...] >> > > >> > > This could also lead to an interesting scenario. As simple-framebuffer >> > > can define its memory in a /reserved-memory node, but that is ignored >> > > in EFI boot. Probably would work, but only because EFI probably >> > > generates its memory map table from the /reserved-memory nodes. >> > > >> > >> > I see. So what would be the solution then? Ignoring creating a platform >> > device for "simple-framebuffer" if booted using EFI and have an EFI-GOP? >> >> Shrug. I don't really know anything more about EFI FB, but I would >> guess it can't support handling resources like clocks, power domains, >> regulators, etc. that simple-fb can. So if a platform needs those, do >> we say they should not setup EFI-GOP? Or is there a use case for >> having both? Clients that don't muck with resources can use EFI-GOP >> and those that do use simple-fb. For example, does/can grub use >> EFI-GOP, but not simple-fb? >> > > The EFI GOP is just a dumb framebuffer, and it is not even generally > possible to cross reference the GOP with a particular device in the > device hierarchy unless you e.g., compare the BARs of each device with > the region described by the GOP protocol. > > GRUB for EFI will use the GOP and nothing else, but only at boot time > (the GOP protocol is more than a magic linear memory region, it also > implements a Blt() abstraction that permits the use of framebuffers > that are not mapped linearly into the address space at all, and GRUB > makes use of this) > > The EFI stub will only expose GOPs to the kernel if they are in fact > linear framebuffers, but has zero insight into whether the hardware > needs clocks and regulators, and whether or not the framebuffer needs > IOMMU pass through (which might be the case if the scanout is using > DMA into system memory) > > So calling EFI GOP 'source of truth' is rather generous, and I think > it makes sense to prioritize more accurate descriptions of the > underlying framebuffer over EFI GOP. > That was my opinion as well and the reason why I called the DTB the single source of truth. > However, making 'simple-framebuffer' magic in this regard doesn't seem > like a great approach to me. Is there a better way we could get the > resource conflict to be decided in a way where the EFI GOP gets > superseded if its resources are claimed by another device? > There is an aperture [0] framework that is used by the fbdev and DRM subsystems to allow native drivers to remove any conflicting devices that share the same framebuffer aperture. But it only makes sense for native drivers to use that I think, but in this case is about two drivers that attempt to use the same frame buffer provided by the firmware but getting it from different places. I don't have a better idea than this patch but maybe Thomas or Sima do? [0]: https://elixir.bootlin.com/linux/latest/source/drivers/video/aperture.c -- Best regards, Javier Martinez Canillas Core Platforms Red Hat