Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5034379rdb; Tue, 12 Dec 2023 17:41:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4DqXavvSCt3Fwq3FnKikxia9ydh64tsoOla9gYZnvEMYodh/5dCHA9bragCMaq7A31WOq X-Received: by 2002:a05:6808:13ce:b0:3b9:dc8d:20e7 with SMTP id d14-20020a05680813ce00b003b9dc8d20e7mr8606240oiw.81.1702431673544; Tue, 12 Dec 2023 17:41:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702431673; cv=none; d=google.com; s=arc-20160816; b=FcaNgQiyJMqMM5ESr0dAYeV6+/EngDVgckjFuYe5vwF4CDJnd/w+USCiDGQm+8e51k vKgeAbYnD9VddQHnRZglTBzF1TwW/EkU8OQY74RGmyCglVU7H3c3aaQ4Ezm11TqVC1pI OSioj1QqeJQHU+5y85rxy/cfiBtPYzfW2Pbb7/7zDmcu0O6B5bP+ktcKXlUI8ALT7ojN li5CSeU3+tPO/pZxaEOrqQX3zRep0hVof0saVYs35E9qbSZ96rwi0BXpNam8k3ezniU/ yf1dapL+2DZWjzT3MU+mTjSsE8kgzq8cDEJVHEwnt7uX/9H994QAYK/jm8FcWCJA+yLy Ec4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=ZC9XVNTMyD4iyCNttPTRiv370kbGiXimQb8xZR23HFU=; fh=lTyPjb/A0DKwDyWbXXtqJ39/tOJT3XN/eo0WcXvG6+M=; b=lORredrMM+kusoDDRQnduIu25aLnpapR0hwf2Er8EfMb6ey3W3b7e+vuZYU+YK8+ll QZsrCTWpDOg62twIZU0r5+X2FLrP8e7QDf6jWvfIsSwSM3s/rVy1w+ABMMIe/aHwTBIU 9HkvgSJpqcH1FLLom7Xd4NHMoe9aYZ/vCQyWnAAUyf8DiZipK0bEZBZ6GWMobzYNlkfe LracIBNmPvEOvKwRT7HKhwYx7AnrG9PxrwljXigbGxAv2N7bpa81WQy+CH2TGLQFLPcD pZZt9uJ/YCyKp3eAK9UsT/rRbP39Sepr74Lle7qn7GetCf7k1zqOmjmzo0O2fy8B45Or JEqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z37-20020a056a001da500b006cef65a301asi6379959pfw.347.2023.12.12.17.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 17:41:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 246808098422; Tue, 12 Dec 2023 17:41:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378215AbjLMBkj convert rfc822-to-8bit (ORCPT + 99 others); Tue, 12 Dec 2023 20:40:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378199AbjLMBkh (ORCPT ); Tue, 12 Dec 2023 20:40:37 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0B77BE; Tue, 12 Dec 2023 17:40:39 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 01BF07FF9; Wed, 13 Dec 2023 09:40:32 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 13 Dec 2023 09:40:31 +0800 Received: from [192.168.60.110] (180.164.60.184) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 13 Dec 2023 09:40:31 +0800 Message-ID: <10e2ab3c-950f-4a1c-8806-74e5bba2c24a@starfivetech.com> Date: Wed, 13 Dec 2023 09:40:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v3 5/6] drm/vs: Add hdmi driver To: Andy Yan CC: Maxime Ripard , "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" 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> <2dc5ea49-9a5f-484a-98dc-1b35b79d0945@starfivetech.com> <6f7acc9d.5648.18c58cba9be.Coremail.andyshrk@163.com> Content-Language: en-US From: Keith Zhao In-Reply-To: <6f7acc9d.5648.18c58cba9be.Coremail.andyshrk@163.com> Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [180.164.60.184] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 17:41:10 -0800 (PST) On 2023/12/11 20:13, Andy Yan wrote: > Hi Keith: > > 在 2023-12-11 18:24:35,"Keith Zhao" 写道: >>hi Maxime: >>hi Andy: >> >>On 2023/12/8 17:14, Maxime Ripard wrote: >>> Hi, >>> >>> On Fri, Dec 08, 2023 at 11:23:37AM +0800, Andy Yan wrote: >>>> 在 2023-12-08 11:00:31,"Keith Zhao" 写道: >>>> > >>>> > >>>> >On 2023/12/8 8:37, Andy Yan wrote: >>>> >> Hi Keth: >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> 在 2023-12-07 18:48:13,"Keith Zhao" 写道: >>>> >>> >>>> >>> >>>> >>>On 2023/12/7 17:02, Andy Yan wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Hi Keith: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> At 2023-12-06 22:11:33, "Keith Zhao" wrote: >>>> >>>>> >>>> >>>>> >>>> >>>>>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[] = { >>>> >>>>>>> >> + { .compatible = "starfive,jh7110-inno-hdmi",}, >>>> >>>>>>> > >>>> >>>>>>> > So it's inno hdmi, just like Rockchip then? >>>> >>>>>>> > >>>> >>>>>>> > 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 use the common driver >>>> >>>>>>> maybe i need the inno hdmi version here to make a distinction >>>> >>>>>> >>>> >>>>>> I just had a look at the rockchip header file: all the registers but the >>>> >>>>>> STARFIVE_* ones are identical. >>>> >>>>>> >>>> >>>>>> There's no need to have two identical drivers then, please use the >>>> >>>>>> rockchip driver instead. >>>> >>>>>> >>>> >>>>>> Maxime >>>> >>>>> >>>> >>>>>ok, have a simple test , edid can get . i will continue >>>> >>>> >>>> >>>> Maybe you can take drivers/gpu/drm/bridge/synopsys/dw-hdmi as a reference, this >>>> >>>> is also a hdmi ip used by rockchip/meson/sunxi/jz/imx。 >>>> >>>> We finally make it share one driver。 >>>> >>>>> >>>> >>>hi Andy: >>>> >>> >>>> >>>dw_hdmi seems a good choice , it can handle inno hdmi hardware by define 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 >>>> >>> >>>> >> >>>> >> I think the process maybe like this: >>>> >> >>>> >> 1. split the inno_hdmi.c under rockchip to inno_hdmi.c(the common part), inno_hdmi-rockchip.c(the soc specific part) >>>> >> 2. move the common part inno_hdmi.c to drivers/gpu/drm/bridge/innosilicon/ >>>> >> 3. add startfive specific part, inno_hdmi-startfive.c >>>> >> >>>> >> bellow git log from kernel three show how we convert dw_hdmi to a common driver: >>>> >> >>>> >> >>>> >> >>>> >> 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 driver >>>> >> 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 adapter >>>> >> b587833933de drm: imx: imx-hdmi: make checkpatch happy >>>> >> >>>> >hi Andy: >>>> >I got you means, >>>> >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、split the starfive_hdmi.c under verisilicion to inno_hdmi.c(the common part), inno_hdmi-starfive.c(the soc specific part) >>>> >2. move the common part inno_hdmi.c to drivers/gpu/drm/bridge/innosilicon/ >>>> >3. In the future, inno hdmi.c under rockchip will reuse the public driver. >>>> >>>> I am not sure if drm maintainers are happy with this。 >>> >>> 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. >> >>ok I will also try to buy a Rockchip 3036 board for self-test. >>According to the commit log idea provided by Andy before, make the inno_hdmi driver common module. > > I finally make my rk3036 based kylin board bootup (use a linux 4.4 downstream bsp,I will find time to try boot > it with mainline)。 So I can help do the test for rockchip side。 > > It seems not that easy to buy a rk3036 based board from market now。 en, The online store seems to have stopped selling rk3036 really not easy to buy one , I write the code first , need help testing rk3036 in the future. thanks > >> >>would the steps be ok? (if I tested rockchip and starifve pass) >>1. split the inno_hdmi.c under rockchip to inno_hdmi.c(the common part), inno_hdmi-rockchip.c(the soc specific part) >>2. move the common part inno_hdmi.c to drivers/gpu/drm/bridge/innosilicon/ >>3. add startfive specific part, inno_hdmi-startfive.c >> >>Thanks >>> >>> Maxime