Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2211717rdb; Fri, 8 Dec 2023 01:14:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr1rXvEL/7txMOu9n/kHh+hpjJxdAo2rYyTprI7bxyoIj8dQRDX5NETLgi5VW2OPrYNNEw X-Received: by 2002:a17:90a:f2d6:b0:286:9b50:b98 with SMTP id gt22-20020a17090af2d600b002869b500b98mr909860pjb.5.1702026887412; Fri, 08 Dec 2023 01:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702026887; cv=none; d=google.com; s=arc-20160816; b=D+fnbpp2HJLs6SQ7+m67CwLUFu0Oat7x+mjocVzeLeUhL/eXqgROnXD30db5HIz3me LIaVuh94iy6Jw42xffNg66ipdscUG990KYIp7z3eZTCfKcORmxb3rKhku9OqoXFPgxgm N1uRDXIOdQsKdZ4dEiQELGPCCLqQNSqrofr62osK9xmTw8BcP2xAdHVAbBbNUg61GffN C/Hp2GgC4Sh/6TgZNvR0xuutdjEvANf1gEDS0OILNmUSHICwi/3yx7Bzg7k45n+/H5/c D7ML4taW/eTAXoLAdBGPKulYEtdwjaMYS3wznFraOxT8dMUAJYG/SgQOLe2+0jYISk27 iQzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GayLZBJU1TyJsI0Dcy6LmBA3hL8FMDvsOT7n0ZqpTBc=; fh=UpreF/1FgZIAXUW2f2ykQmdX51OvdoaOmdDOWS5Ln5A=; b=dWr/eUYkwJqFRf9472EIMToFLr6i5wRAWkMLhIoezpldLX2a3J8dI6yLGVhIPnmMgY 1qaXYhXV92xaPI0eBe57KKcnXuer0aeqcL5ZKODKHquPBmLRXbIPaFrJGdw+9qOy6yrQ h+jyvzQ6M+0vsuP7nq0hQWY37LpUke+HLwMkUmLtlcc8LlzCCRC8Iye0F4P7fOFYYevF wRSFIn+Apz5w1wUaRXlME4a27o/FG8lYzMyY3Ra9MNz1El/g9N/wy8ulWePYX6+Pf1nc OJlUvLjpIh1wNrU7mr4GZGwRsCVAQfmyzDlMCHFdzqsMtDITyIlVXCq5oI9TTvGrJvaJ EEZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c6kPkn7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e1-20020a17090301c100b001cfe0129fcbsi1380434plh.139.2023.12.08.01.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:14:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c6kPkn7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D46918370019; Fri, 8 Dec 2023 01:14:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233242AbjLHJOV (ORCPT + 99 others); Fri, 8 Dec 2023 04:14:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233238AbjLHJOR (ORCPT ); Fri, 8 Dec 2023 04:14:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5481735 for ; Fri, 8 Dec 2023 01:14:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E997C433C7; Fri, 8 Dec 2023 09:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702026862; bh=PpqkV81OadB/h6MWWmM9uepUUBI4O85xxP4qkQ1Svng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c6kPkn7C4GMyEI0IstxPAmJl+5gtuWg9EvwvwW+IgUrErh0VwVr6MkcTST66NuYny jYC6UwgLdz8QGoz2D8pU2gRmKjH8hh1FalxlQnWwM4WhdncRiQ/Ihttua20jlBJpcU KgIROty+rbO3i0wmTkI9aN0mxcFcd7OXIF9cVGtdI4sdfQwFiCJp47R6m9VPsXoN42 Cv770NYTWFTDiltQsX+DFu0l4OEGsIK5HoXh8NwD8gMKiCvVyley9c00h5farkpYiu GXt1o9sHdq1eYrpph9nWc9FDlN2mXFUUdTS/Q2lst8jO7708rLH9y39SZDy+cpjmEM ab6dZPzpB71GA== Date: Fri, 8 Dec 2023 10:14:19 +0100 From: Maxime Ripard To: Andy Yan Cc: Keith Zhao , "devicetree@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "tzimmermann@suse.de" , "airlied@gmail.com" , "krzysztof.kozlowski+dt@linaro.org" , William Qiu , Xingyu Wu , "paul.walmsley@sifive.com" , "aou@eecs.berkeley.edu" , "palmer@dabbelt.com" , "p.zabel@pengutronix.de" , Shengyang Chen , Jack Zhu , Changhuang Liang , "maarten.lankhorst@linux.intel.com" , "suijingfeng@loongson.cn" Subject: Re: [v3 5/6] drm/vs: Add hdmi driver Message-ID: References: <20231204123315.28456-6-keith.zhao@starfivetech.com> <94a1f9fc-82fb-4a04-a44b-f9b20c2bdfdd@starfivetech.com> <40cdd3c7-174e-4611-9ea6-22cb56d1f62b@starfivetech.com> <43e42269.314.18c46dbb4c5.Coremail.andyshrk@163.com> <5a79a4b9.1bd7.18c4773c1ea.Coremail.andyshrk@163.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mclzxbyf7a4jkefy" Content-Disposition: inline In-Reply-To: <5a79a4b9.1bd7.18c4773c1ea.Coremail.andyshrk@163.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 01:14:44 -0800 (PST) --mclzxbyf7a4jkefy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Dec 08, 2023 at 11:23:37AM +0800, Andy Yan wrote: > =E5=9C=A8 2023-12-08 11:00:31=EF=BC=8C"Keith Zhao" =E5=86=99=E9=81=93=EF=BC=9A > > > > > >On 2023/12/8 8:37, Andy Yan wrote: > >> Hi Keth=EF=BC=9A > >>=20 > >>=20 > >>=20 > >>=20 > >>=20 > >>=20 > >> =E5=9C=A8 2023-12-07 18:48:13=EF=BC=8C"Keith Zhao" =E5=86=99=E9=81=93=EF=BC=9A > >>> > >>> > >>>On 2023/12/7 17:02, Andy Yan wrote: > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>> Hi Keith=EF=BC=9A > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>>=20 > >>>> At 2023-12-06 22:11:33, "Keith Zhao" w= rote: > >>>>> > >>>>> > >>>>>On 2023/12/6 20:56, Maxime Ripard wrote: > >>>>>> On Wed, Dec 06, 2023 at 08:02:55PM +0800, Keith Zhao wrote: > >>>>>>> >> +static const struct of_device_id starfive_hdmi_dt_ids[] =3D { > >>>>>>> >> + { .compatible =3D "starfive,jh7110-inno-hdmi",}, > >>>>>>> >=20 > >>>>>>> > So it's inno hdmi, just like Rockchip then? > >>>>>>> >=20 > >>>>>>> > This should be a common driver. > >>>>>>> > >>>>>>> Rockchip has a inno hdmi IP. and Starfive has a inno hdmi IP. > >>>>>>> but the harewawre difference of them is big , it is not easy to u= se the common driver > >>>>>>> maybe i need the inno hdmi version here to make a distinction > >>>>>>=20 > >>>>>> I just had a look at the rockchip header file: all the registers b= ut the > >>>>>> STARFIVE_* ones are identical. > >>>>>>=20 > >>>>>> There's no need to have two identical drivers then, please use the > >>>>>> rockchip driver instead. > >>>>>>=20 > >>>>>> Maxime > >>>>> > >>>>>ok, have a simple test , edid can get . i will continue=20 > >>>>=20 > >>>> Maybe you can take drivers/gpu/drm/bridge/synopsys/dw-hdmi as a refe= rence=EF=BC=8C this > >>>> is also a hdmi ip used by rockchip/meson/sunxi/jz/imx=E3=80=82 > >>>> We finally make it share one driver=E3=80=82 > >>>>> > >>>hi Andy: > >>> > >>>dw_hdmi seems a good choice , it can handle inno hdmi hardware by defi= ne its dw_hdmi_plat_data. > >>>does it means i can write own driver files such as(dw_hdmi-starfive.c)= based on dw_hdmi instead of add plat_data in inno_hdmi.c > >>> > >>=20 > >> I think the process maybe like this=EF=BC=9A > >>=20 > >> 1. split the inno_hdmi.c under rockchip to inno_hdmi.c(the common par= t), inno_hdmi-rockchip.c(the soc specific part) > >> 2. move the common part inno_hdmi.c to drivers/gpu/drm/bridge/innosili= con/ > >> 3. add startfive specific part, inno_hdmi-startfive.c > >>=20 > >> bellow git log from kernel three show how we convert dw_hdmi to a com= mon driver:=20 > >>=20 > >>=20 > >>=20 > >> 12b9f204e804 drm: bridge/dw_hdmi: add rockchip rk3288 support > >> 74af9e4d03b8 dt-bindings: Add documentation for rockchip dw hdmi > >> d346c14eeea9 drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare > >> a4d3b8b050d5 drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_= wait_i2c_done > >> 632d035bace2 drm: bridge/dw_hdmi: add mode_valid support > >> 0cd9d1428322 drm: bridge/dw_hdmi: add support for multi-byte register = width access > >> cd152393967e dt-bindings: add document for dw_hdmi > >> b21f4b658df8 drm: imx: imx-hdmi: move imx-hdmi to bridge/dw_hdmi > >> aaa757a092c2 drm: imx: imx-hdmi: split phy configuration to platform d= river > >> 3d1b35a3d9f3 drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode > >> c2c3848851a7 drm: imx: imx-hdmi: return defer if can't get ddc i2c ada= pter > >> b587833933de drm: imx: imx-hdmi: make checkpatch happy > >>=20 > >hi Andy: > >I got you means,=20 > >as I don't have a rockchip board on hand , to split the inno_hdmi.c can = not be tested. > > > >how adout this idea: > >1=E3=80=81split the starfive_hdmi.c under verisilicion to inno_hdmi.c(t= he common part), inno_hdmi-starfive.c(the soc specific part) > >2. move the common part inno_hdmi.c to drivers/gpu/drm/bridge/innosilico= n/ > >3. In the future, inno hdmi.c under rockchip will reuse the public drive= r. >=20 > I am not sure if drm maintainers are happy with this=E3=80=82 Not really, no. Because we would still have two drivers for the same controller, and a common one that haven't really been tested on anything but a single platform. So arguably a worse situation than what you were suggesting in the first place. The best solution would be to find someone with a Rockchip board to test your changes, or to get one if it's doable so you can test yourself. Maxime --mclzxbyf7a4jkefy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZXLeZgAKCRDj7w1vZxhR xX+VAQCDN8mU1ig+h/k3GOiSARtjlUBm/gfNxSrc+w8Z+uccaQEAiaFT6xKN1A/R YHgxfBULnV+2196VN7w4qNeVghA3BA0= =oX5D -----END PGP SIGNATURE----- --mclzxbyf7a4jkefy--