Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1721726ybj; Wed, 6 May 2020 04:13:29 -0700 (PDT) X-Google-Smtp-Source: APiQypKuPwHTT5EO5JbHkW4jgT//YTQigMNvHpPiWudkz4/wMiPFWQp1nmxJzdHhR5qESGVeEQiN X-Received: by 2002:a17:907:948d:: with SMTP id dm13mr1363653ejc.138.1588763609172; Wed, 06 May 2020 04:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588763609; cv=none; d=google.com; s=arc-20160816; b=snV+30JfckmsueklQsjdViImnFT+nfQPvWyOZgwi9xFoeF7VXLbx+OsDY42NsBP+AG Wz1ThJHRqvdbA1QGLAKttDZVS0cPxm49x/SX3JXbvfJy0dPJ4E4uk82fSYjIF63OGuLq OKqM4Kvrk50WkJ0rxOyUqxbfBNOpmJsXAO/kWssA78ZVkCWNdOn/O62S8N6UqGcOILQG yqgE2O6wIcAe8PviCF+iymM5kT++/HkisyQiLD2/yAOcO47Shv7YyS7Lk5tctSRB2vrx 42wF5RBKpeccTnjc9MLvLdsabkLQ5Y7F33LX4s9HyQO1ocz3JMY05eIQR3rebMXc5OIU fEWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=/NeGXpLNDIq5GbsxGQJPnBN2KUD4BRudx09OnMz+7GU=; b=GH2g5DKfI4NvV/UaXcgnqPEE3/ApNI77fsCzKxJECGL4h/dffXvF+rUtAxDdMXpACr EuhIJoyyKNgNceFnRWcn8mDCLHwfM9ls4RxyWbIUq78Ws+ZzTMmKbPevRmZF2r9htELA IsrJQmvknzbV/4OuOQKMLOewkV5+8xXA4CtcNv8oESh1iQBuGNWOnZKTLgfNUX+SOIc+ /vYGAzrV9kUjJYTDDg+YrAxPO1PtG5Put6pkll7WOHF1VmRdFTh0Oc3nsx6m1bGmXz+q QhkCKkvkwiwj9uqIaqX9Cv5xBnDiRi7XKV8XzmhebJCg5fHiWvxaJX4aR2hhvQqRusfB zB2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=iWH1f4Qq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i28si267044edj.224.2020.05.06.04.13.06; Wed, 06 May 2020 04:13:29 -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=@ffwll.ch header.s=google header.b=iWH1f4Qq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729101AbgEFKlP (ORCPT + 99 others); Wed, 6 May 2020 06:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728768AbgEFKlO (ORCPT ); Wed, 6 May 2020 06:41:14 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E089AC061A41 for ; Wed, 6 May 2020 03:41:13 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id w7so760878wre.13 for ; Wed, 06 May 2020 03:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=/NeGXpLNDIq5GbsxGQJPnBN2KUD4BRudx09OnMz+7GU=; b=iWH1f4QqsEPpgH3h50sdAGIvtLjTFwEukqcVR4urRmS3ns0t/tyRzOjcNxaXyIeSAF RqZCk36XQcOo84nVfgm1splC5QcsaFuqKZYz6RLyvQoXBrn0Fdp2H2MLToabHgG1/801 7x8CnDJRzQLUh9+IyBGgWg/ysJpfTAKKTZ080= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=/NeGXpLNDIq5GbsxGQJPnBN2KUD4BRudx09OnMz+7GU=; b=QdXH1GMEXOcix6p69weqflloCcEzlJaZVAC19ueZ50WnNbbSJrgohIPwNcVmXQgvGo 81Kg8wmeHMSIrAoO82I9DaIm9HFFWQqvpW/7sX/+1rlLCE+nyMKDkkmPu5i8csS9BchF ytkSJ3aYKRYLA+e+eoNGAEcDP64ib54rnmFr1jfW2NhUIn/LDuxZYkoVjpZwMFy2+unb XINjpCzHH9PsbOdYo6ZT6vqzLmuqofBBU46idvzJJ7kz6hIozRUitbYVH98rz+cUCtjV bx08b6SHjo9IaAJWibYlzYAgyZgHwRXdZmZa2bpXKm1+ztstcNex3zW0+unlSZjJZXum 3Aqg== X-Gm-Message-State: AGi0PuYVYIbLbiwnAr90oeJ8yjxkCj9LYUKqGaraq0xqoEZZ965pz+Rd /mcb5EzlyRwinUW1i3ijhSAlvg== X-Received: by 2002:a05:6000:108b:: with SMTP id y11mr8067326wrw.380.1588761672465; Wed, 06 May 2020 03:41:12 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id c128sm2345878wma.42.2020.05.06.03.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 03:41:11 -0700 (PDT) Date: Wed, 6 May 2020 12:41:09 +0200 From: Daniel Vetter To: Angelo Ribeiro Cc: Daniel Vetter , "dri-devel@lists.freedesktop.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Maarten Lankhorst , Maxime Ripard , David Airlie , Sam Ravnborg , Gustavo Pimentel , Joao Pinto Subject: Re: [PATCH v3 3/4] drm: ipk: Add extensions for DW MIPI DSI Host driver Message-ID: <20200506104109.GW10381@phenom.ffwll.local> Mail-Followup-To: Angelo Ribeiro , "dri-devel@lists.freedesktop.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Maarten Lankhorst , Maxime Ripard , David Airlie , Sam Ravnborg , Gustavo Pimentel , Joao Pinto References: <24372475c0afe1e88f323efec16300903d1c6294.1587992776.git.angelo.ribeiro@synopsys.com> <20200428152815.GX3456981@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.4.0-4-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 09:56:16AM +0000, Angelo Ribeiro wrote: > From: Daniel Vetter > Date: Tue, Apr 28, 2020 at 16:28:15 > > > On Mon, Apr 27, 2020 at 04:00:35PM +0200, Angelo Ribeiro wrote: > > > Add Synopsys DesignWare IPK specific extensions for Synopsys DesignWare > > > MIPI DSI Host driver. > > > > > > Cc: Maarten Lankhorst > > > Cc: Maxime Ripard > > > Cc: David Airlie > > > Cc: Daniel Vetter > > > Cc: Sam Ravnborg > > > Cc: Gustavo Pimentel > > > Cc: Joao Pinto > > > Signed-off-by: Angelo Ribeiro > > > > I've dumped this on a pile of bridge drivers by now, but I don't think the > > dw-mipi-dsi organization makes much sense. > > > > I think what we'd need is: > > > > - drm_encoder is handled by the drm_device driver, not by dw-mipi-dsi > > drm_bridge driver > > > > - the glue code for the various soc specific implementations (like ipk > > here) should be put behind the drm_bridge abstraction. Otherwise I'm not > > really seeing why exactly dw-mipi-dsi is a bridge driver if it doesn't > > work like a bridge driver > > > > - Probably we should put all these files into drm/bridge/dw-mipi-dsi/ > > > > - drm_device drivers should get at their bridges with one of the standard > > of helpers we have in drm_bridge, not by directly calling into a bridge > > drivers. > > > > I know that dw-hdmi is using the exact same code pattern, but we got to > > stop this eventually or it becomes an unfixable mess. > > -Daniel > > Hi Daniel, > > Sorry for the late answer. > > I understand what you stated and the conversion of > this driver in a help library could be a good solution since > you can use the DSI as bridge or as encoder, as your pipeline > requires. > > Also most of the code implemented by each glue is essential PHY related, > the development of a PHY driver could make this more clear. > > However, this needs a lot of work and consensus. Do you think that we > can go ahead with this driver and do the rework later? > I'm available and interested to help on this rework. There's a bunch of these in the works right now, so minimally we need to make sure that we do actually have consensus among all stakeholders (all the existing and new drivers plus people working on dw-mipi-dsi drivers). E.g. I'm not clear whether a helper library is a good interface for drm_device drivers, that really should be doable as a standard drm_bridge with no drm_encoder. I think the best way to ensure that consensus is by adding a todo entry to Documentation/gpu/todo.rst for both dw-hdmi and dw-mipi-dsi (same design really), with acks from everyone. Once we have agreement and on how to best get there I'm all happy. -Daniel > > Thanks, > Angelo > > > > > > --- > > > Changes since v3: > > > - Rearranged headers. > > > --- > > > drivers/gpu/drm/ipk/Kconfig | 9 + > > > drivers/gpu/drm/ipk/Makefile | 2 + > > > drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c | 557 ++++++++++++++++++++++++++++++++++ > > > 3 files changed, 568 insertions(+) > > > create mode 100644 drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c > > > > > > diff --git a/drivers/gpu/drm/ipk/Kconfig b/drivers/gpu/drm/ipk/Kconfig > > > index 1f87444..49819e5 100644 > > > --- a/drivers/gpu/drm/ipk/Kconfig > > > +++ b/drivers/gpu/drm/ipk/Kconfig > > > @@ -11,3 +11,12 @@ config DRM_IPK > > > Enable support for the Synopsys DesignWare DRM DSI. > > > To compile this driver as a module, choose M here: the module > > > will be called ipk-drm. > > > + > > > +config DRM_IPK_DSI > > > + tristate "Synopsys DesignWare IPK specific extensions for MIPI DSI" > > > + depends on DRM_IPK > > > + select DRM_DW_MIPI_DSI > > > + help > > > + Choose this option for Synopsys DesignWare IPK MIPI DSI support. > > > + To compile this driver as a module, choose M here: the module > > > + will be called dw-mipi-dsi-ipk. > > > diff --git a/drivers/gpu/drm/ipk/Makefile b/drivers/gpu/drm/ipk/Makefile > > > index 6a1a911..f22d590 100644 > > > --- a/drivers/gpu/drm/ipk/Makefile > > > +++ b/drivers/gpu/drm/ipk/Makefile > > > @@ -2,3 +2,5 @@ > > > ipk-drm-y := dw-drv.o dw-vpg.o > > > > > > obj-$(CONFIG_DRM_IPK) += ipk-drm.o > > > + > > > +obj-$(CONFIG_DRM_IPK_DSI) += dw-mipi-dsi-ipk.o > > > diff --git a/drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c b/drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c > > > new file mode 100644 > > > index 0000000..f8ac4ca > > > --- /dev/null > > > +++ b/drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c > > > @@ -0,0 +1,557 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > > +/* > > > + * Copyright (c) 2019-2020 Synopsys, Inc. and/or its affiliates. > > > + * Synopsys DesignWare MIPI DSI solution driver > > > + * > > > + * Author: Angelo Ribeiro > > > + * Author: Luis Oliveira > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include