Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7575768imu; Tue, 22 Jan 2019 08:08:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN5l7kbnuHNfcj88FYmcl8O7mEBwbn+vqsdHrXV8y7Q6ULtVxCXQPXAv3rJu2KcPYjCwotK+ X-Received: by 2002:a63:d50f:: with SMTP id c15mr32614572pgg.287.1548173310280; Tue, 22 Jan 2019 08:08:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548173310; cv=none; d=google.com; s=arc-20160816; b=iDPpPP2bwXFNqz5qSqROpwFrsD/h+8aknHhs+Lt+evEEzjNWLFQAEl9R4hSnb/y9x/ N1mmC9ptCwcgkcLAx4spXiwHQa1ToKXuoGaMGtjlFg4F0SygddWp6N7qkP7bOtOyR84B h+wueYMGrD+nzjbsnjitkf9sjObWd8QT7orIpxmsOON2ZJYKFNuo+xiqfWjh3NrUr889 DXxg9hSKfZUAGUyp0EGMbF7Obf543jhLKURQ0PMtLYUQ9nWvLU6H+5Zt5570sixeroDE hs0A1VDrVhunzqAOavQDaeiJ6jcR1zOva9AVSoruSs29iJWYSGtWJFpc8dt2+abLRSjW 8HCA== 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=OmkekRlZChxJ14w8TZsGVPxVx+OVd1mj/o06GgYFKUg=; b=Vo7cNZjhTMI4ESJd/a4jAzON6SMHrLSsQIv+ovMhVqkk1ZjTrDN9rxpHYiRVilhED6 //lkyAR+xAgUfbwiNoxnrowqp4z2+pFrfzMT7GIe/546UeavfTqNYHyCwVOD/co8kBJX Ev6766oj9RUlAzgnpb/L1u8HuWQonDOg4JTVsS7ZsajCdhTqs+t5VMyB0mSxnny9gSKQ yW1hwxHLyUv09rYZjnwgw13HV2qC6VoCYdnrAKP/E8l3vLILv2ayS8vZ9WFwbAACzeky sGbeal1M5rZVQNmvmyBBVdcqF0DjP/26iYIFo78ohXfQrvrWh4jt0YpljLU1/i69zee8 2Whg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GbrRUp2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id x3si16365558pgj.493.2019.01.22.08.08.14; Tue, 22 Jan 2019 08:08:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GbrRUp2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729037AbfAVQG1 (ORCPT + 99 others); Tue, 22 Jan 2019 11:06:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:40558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728580AbfAVQG0 (ORCPT ); Tue, 22 Jan 2019 11:06:26 -0500 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 13B1F21726; Tue, 22 Jan 2019 16:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548173185; bh=PX122dXlfAYGf/2qvoEwBQMZd2Rg2KJEaN3SLt8o620=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GbrRUp2aAvGt9IGJMA0ftZQ8l9DtKvP4OGsUN1f5erJySkcotRPHOCL2wHF+M6MSm fmPefpCwDTEcruI1dBzaA/sgA6Y2rxKy67AoV2oRuFOnN/dnScIgBfk6AlcJU7iPLn 3N80yPB5E6K9aiM3T4UZWtl9EJqgBaAwboYAxl1c= Received: by mail-qt1-f170.google.com with SMTP id e5so28077586qtr.12; Tue, 22 Jan 2019 08:06:25 -0800 (PST) X-Gm-Message-State: AJcUukcC+wk7CafP25dzF8OsCD0d+ehyEP+cNVzVQLPgXuq4rtaeQFt6 8qv/5Ojmq8ceNXCuFrfDJvUoKXDYhV1RVvlbLA== X-Received: by 2002:ac8:2d2b:: with SMTP id n40mr30769267qta.38.1548173184264; Tue, 22 Jan 2019 08:06:24 -0800 (PST) MIME-Version: 1.0 References: <20190120172534.24617-1-lkundrak@v3.sk> <20190120172534.24617-5-lkundrak@v3.sk> <3191cdde84978adf98d200a9db6f3c18e0a46390.camel@v3.sk> <20190121175301.lremzw6dul7dyff4@e5254000004ec.dyn.armlinux.org.uk> <20190122105843.cqtzit2adfoungku@e5254000004ec.dyn.armlinux.org.uk> In-Reply-To: <20190122105843.cqtzit2adfoungku@e5254000004ec.dyn.armlinux.org.uk> From: Rob Herring Date: Tue, 22 Jan 2019 10:06:12 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/6] dt-bindings: display: armada: Add display subsystem binding To: Russell King - ARM Linux admin Cc: Lubomir Rintel , Mark Rutland , dri-devel , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" 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 Tue, Jan 22, 2019 at 4:58 AM Russell King - ARM Linux admin wrote: > > On Mon, Jan 21, 2019 at 05:58:50PM -0600, Rob Herring wrote: > > On Mon, Jan 21, 2019 at 11:53 AM Russell King - ARM Linux admin > > wrote: > > > > > > On Mon, Jan 21, 2019 at 10:07:11AM -0600, Rob Herring wrote: > > > > On Mon, Jan 21, 2019 at 9:46 AM Lubomir Rintel wrote: > > > > > > > > > > On Mon, 2019-01-21 at 09:35 -0600, Rob Herring wrote: > > > > > > On Sun, Jan 20, 2019 at 11:26 AM Lubomir Rintel wrote: > > > > > > > The Marvell Armada DRM master device is a virtual device needed to list all > > > > > > > nodes that comprise the graphics subsystem. > > > > > > > > > > > > > > Signed-off-by: Lubomir Rintel > > > > > > > --- > > > > > > > .../display/armada/marvell-armada-drm.txt | 24 +++++++++++++++++++ > > > > > > > 1 file changed, 24 insertions(+) > > > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/display/armada/marvell-armada-drm.txt b/Documentation/devicetree/bindings/display/armada/marvell-armada-drm.txt > > > > > > > index de4cca9432c8..3dbfa8047f0b 100644 > > > > > > > --- a/Documentation/devicetree/bindings/display/armada/marvell-armada-drm.txt > > > > > > > +++ b/Documentation/devicetree/bindings/display/armada/marvell-armada-drm.txt > > > > > > > @@ -1,3 +1,27 @@ > > > > > > > +Marvell Armada DRM master device > > > > > > > +================================ > > > > > > > + > > > > > > > +The Marvell Armada DRM master device is a virtual device needed to list all > > > > > > > +nodes that comprise the graphics subsystem. > > > > > > > + > > > > > > > +Required properties: > > > > > > > + > > > > > > > + - compatible: value should be "marvell,dove-display-subsystem", > > > > > > > + "marvell,armada-display-subsystem" > > > > > > > + - ports: a list of phandles pointing to display interface ports of CRTC > > > > > > > + devices > > > > > > > + - memory-region: phandle to a node describing memory to be used for the > > > > > > > + framebuffer > > > > > > > + > > > > > > > +Example: > > > > > > > + > > > > > > > + display-subsystem { > > > > > > > + compatible = "marvell,dove-display-subsystem", > > > > > > > + "marvell,armada-display-subsystem"; > > > > > > > + memory-region = <&display_reserved>; > > > > > > > + ports = <&lcd0_port>; > > > > > > > > > > > > If there is only one device, you don't need this virtual node. > > > > > > > > > > By "one device" you mean one LCD controller (CRTC)? > > > > > > > > Yes. > > > > > > How does that work (as far as the Linux implementation) ? I can't see > > > a way that could work, while allowing the flexibility that Armada DRM > > > allows (two completely independent LCD controllers as two separate DRM > > > devices vs one DRM device containing both LCD controllers.) > > > > > > > > I suppose in the (single CRTC) example case, the display-subsystem node > > > > > used to associate it with the memory region reserved for allocating the > > > > > frame buffers from. Could that be done differently? > > > > > > > > Move memory-region to the LCD controller node. > > > > > > That doesn't work - it would appear in the wrong part of the driver. > > > > Why? You can fetch properties from other nodes. > > > > If you have 2 CRTCs, do you have 1 or 2 reserved memory regions? I'd > > think 2 with each one in the corresponding LCDC that uses them would > > be more flexible. > > There would still be one reserved memory region, since it is shared > between both LCDCs. > > > Or just get the data out of the /reserved-memory node directly. Surely > > it has a compatible that you can find it with. > > I see that the DT reserved memory support has progressed since I wrote > the armada code to deal with it, and it's now possible to make use of > reserved memory via of_reserved_mem_lookup() rather than using the > RESERVEDMEM_OF_DECLARE() and so forth. > > > > > > Also, if the node is indeed made optional, then it's going to > > > > > complicate things on the DRM side. Currently the driver that binds to > > > > > the node creates the DRM device once it sees all the components > > > > > connected to the ports appear. If we loose it, then the LCD controller > > > > > driver would somehow need to find out that it's alone and create the > > > > > DRM device itself. > > > > > > > > DT is not the only way to create devices. The DRM driver can bind to > > > > the LCDC node and then create a child CRTC device (or even multiple > > > > ones for h/w with multiple pipelines). > > > > > > That seems completely upside down and rediculous to me - are you > > > really suggesting that we should have some kind of virtual device > > > in DT, and omit the _real_ physical devices for that, having the > > > driver create the device with all the appropriate SoC resources? > > > > We create child platform devices that inherit from the parent in DT > > all the time. MFD child drivers are a common case. Sometime the child > > devices have DT nodes and sometimes they don't. > > I still don't think what you're saying is the right way to go about > this. > > You _appear_ to be saying to group _both_ LCD controllers into one > DT node, despite the fact that they are two separate devices with > different mmio resources, interrupts etc, and have code in the > kernel to split the DT device up into sub-devices. IOW: No, not at all. That was just an example of a h/w device having virtual child platform devices. If you want to have 1 DRM device with 2 CRTCs, you have to do as described below. I certainly want this to reflect the h/w. That's why we're having this discussion. [...] > > Otherwise, do it the other way around. Create a virtual DRM device > > conditioned on the SoC: > > > > if (of_machine_is_compatible("foo,bar")) > > platform_device_register_simple(...) > > I guess that's possible at the expense of losing the flexibility - my > original idea was to allow a case where you could have two DRM devices, > one per LCD controller if you wanted, rather than having a binding that > forces one DRM device optionally containing both LCD controllers. Sure, but that's an OS decision that has nothing to do with the hardware and DT. You'll just have to pass some flag to the DRM device platform driver and decide whether to create 1 device or 2. That decision could be based on either evolving DRM architecture or on the platform. That is more flexible than fixing it in DT. Rob