Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13822002pxu; Mon, 4 Jan 2021 05:32:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfg6Ws4hoyu2Nm8KgkNai2aIPKNrKrE5+gZcIgdWzB74UdVkVGAuzVJRWcQeFk+d6v84kO X-Received: by 2002:a50:cd9c:: with SMTP id p28mr69173132edi.83.1609767149328; Mon, 04 Jan 2021 05:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609767149; cv=none; d=google.com; s=arc-20160816; b=p9BGAwchKo6eKGokm6iN9gIRNUPAi45shEeJZQBMb9Xvzrp10pu1l9ZrE2bBwSntMS FtcQs9FFSmmNOwKhr+r/apNYeo1aTk7mr/wsuiTWvYlxHFrzMznNinvnQhbkbZKEdVPy qFOjGUxo91zVxQ+FPdSaPDu9FQOm3DIFbH8JrJvLumilF4N0uFHN/kC1vYGZ1lr69DSX lW9JnaTCJA5kHysFJvPG+bWdpS5guUi2gksy2k/Zf4Jc5jbtT2JBDPihcQY7h2cg8/Xh uZIZ8JgA6YZl1wBqZJ2SXeHrK+hX5MxX0DQdCMGR5M5so+RhEEoN83cD96YZIocXuKY0 OYNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :autocrypt:from:references:cc:to:subject:dkim-signature; bh=CeT1gpZAsO0ZqFeo+qXRWjnihFBZp/Zvxstr2M1W2a4=; b=Kwg+JWJSQZ8LR8SM20R1YMV0htYbwEAbA4PdxXBQJlNoLzqSpX/onl2uzloD5Qde9E 0vvCQYEY0H/QopK7vDexZJXdFd6VThIlZe3vjYxUWNYBgPdL5+MReiFuVRsTnBXaaXQI 9IuGWzCayn64jor80tKmgmvnMfmHLl/stQxb8K0s7Z8ZE2UDpEaJixcNPx3E6gTKGViZ iZKi6zbfjhuWtgVQxMky02ht0Vbs2Xn963HR8TvZ4D40rw4upspyk0KguTR6Leo/J10L X40E6magfEaw1zc+/beaSMVN/I461UMWcfm0OTEQN2rawwfy/Roc+yaSNd2wcEqroBxF qLpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oEE8jU7g; 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 h6si24400790edf.132.2021.01.04.05.32.06; Mon, 04 Jan 2021 05:32:29 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oEE8jU7g; 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 S1726396AbhADN3x (ORCPT + 99 others); Mon, 4 Jan 2021 08:29:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbhADN3w (ORCPT ); Mon, 4 Jan 2021 08:29:52 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 411B1C061574 for ; Mon, 4 Jan 2021 05:29:12 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id r7so32144337wrc.5 for ; Mon, 04 Jan 2021 05:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:autocrypt:organization:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CeT1gpZAsO0ZqFeo+qXRWjnihFBZp/Zvxstr2M1W2a4=; b=oEE8jU7gcio8gOy5LjnxQ6xWzkjlhrxcCm4c8u4CQ4YwD8wGQldewFZLoIx4WE+zJK am8IqWqYyZH+RtR/caotqBCv0QWrMbFe6ycwi3Z/F8DtWutbF4WKc+SWEtiCd8jvkfTF iqepCnDD/Qxo2CgI/kRvZf1J0scisOpYmhFHVU2/Hxdj3BobEPL1cii+WCi4CogBNcHX 7oO6UEN+pKEkY8j0MurK+FEHEoHUm5JWXGe/tzW3Sf9YphZwQ0PA7AH5QdnUZoXMbaCm O8VS2S0runpdHO/uqbBQviRG9Ig8Vgc+bdmP05nbMO6INZgYL/km0WvXOHvDRcvLpLls 0+9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=CeT1gpZAsO0ZqFeo+qXRWjnihFBZp/Zvxstr2M1W2a4=; b=hMfXswr8kJsdccOQnpzEwHAwJA34+bpi1uyY4UjdIUu96qVdiXhSuAEWcgyzVcxISu gKLRZlGde6a1VAaK4/HSxRQdI+H53ldmX3xi98IeqxLucBTBxapRseEJYPQNSVZm5O7o 0freeOcEA9xLeJ+UGljcmtRyynwlfTVvZJSV9LYcXJtfb6FRzpJamhbFRLI3Kj3L5Uvk rdUcVdjA3tiHwwoVu3IOUTZ9wtxLjZhp1ok0/CA+UV9SB3rjIoFQzdJIEpw2guE91IDB QRWtAwVPR40tHylz1eLFcWOyccSDLhrNz5HTNLsPEcoTyTqaUSAZeJii69C5WM0uaDiH tp9A== X-Gm-Message-State: AOAM532a5Q6Y72dBniVnq6gR+YgFjPXrlIjtaxZjhaGab1n+66pFcoe7 RURa+qYOe7GMTIeot2LPQdmU8nZm6SJcbSHs X-Received: by 2002:a5d:498a:: with SMTP id r10mr79337606wrq.238.1609766950793; Mon, 04 Jan 2021 05:29:10 -0800 (PST) Received: from ?IPv6:2a01:e35:2ec0:82b0:17a:9662:5ead:50af? ([2a01:e35:2ec0:82b0:17a:9662:5ead:50af]) by smtp.gmail.com with ESMTPSA id r15sm89538602wrq.1.2021.01.04.05.29.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 05:29:10 -0800 (PST) Subject: Re: discussion: re-structuring of the Amlogic Meson VPU DRM driver To: Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, airlied@linux.ie, daniel@ffwll.ch References: From: Neil Armstrong Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= mQENBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAG0KE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT6JATsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62oKOFlgOTYCMkYpm2aAOZZLf6VKHKc7DoVwuUkjHfIRXdslbrxi4pk5VKU6ZP9AKsN NtMZntB8WrBTtkAZfZbTF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3iM /4Wh4V2eqGEgpdeSp5K+LdaNyNgaqzMOtt4HYk86LYLSHfFXywdlbGrY9+TqiJ+ZVW4trmui NIJCOku8SYansq34QzYM0x3UFRwff+45zNBEVzctSnremg1mVgrzOfXU8rt+4N1b2MxorPF8 619aCwVP7U16qNSBaqiAJr4e5SNEnoAq18+1Gp8QsFG0ARY8xp+qaKBByWES7lRi3QbqAKZf yOHS6gmYo9gBmuAhc65/VtHMJtxwjpUeN4Bcs9HUpDMDVHdfeRa73wM+wY5potfQ5zkSp0Jp bxnv/cRBH6+c43stTffprd//4Hgz+nJcCgZKtCYIAPkUxABC85ID2CidzbraErVACmRoizhT KR2OiqSLW2x4xdmSiFNcIWkWJB6Qdri0Fzs2dHe8etD1HYaht1ZhZ810s7QOL7JwypO8dscN KTEkyoTGn6cWj0CX+PeP4xp8AR8ot4d0BhtUY34UPzjE1/xyrQFAdnLd0PP4wXxdIUuRs0+n WLY9Aou/vC1LAdlaGsoTVzJ2gX4fkKQIWhX0WVk41BSFeDKQ3RQ2pnuzwedLO94Bf6X0G48O VsbXrP9BZ6snXyHfebPnno/te5XRqZTL9aJOytB/1iUna+1MAwBxGFPvqeEUUyT+gx1l3Acl ZaTUOEkgIor5losDrePdPgE= Organization: Baylibre Message-ID: <57a65a09-606a-8773-e1ff-4202e83779c8@baylibre.com> Date: Mon, 4 Jan 2021 14:29:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Sorry for the delay... On 31/12/2020 00:24, Martin Blumenstingl wrote: > Hi Neil and all interested people, > > in the past there were concerns about how some of the components are > coupled in our Meson DRM driver(s). > With this discussion I would like to achieve four things: > 1. understand the current issues that we have> 2. come up with a TODO list of things that need to be tackled as well > as recommendations how to solve it (for example: "driver ABC function > ABC uses the recommended way - take that as reference") > 3. one by one work on the items on the TODO list > 4. add support for the 32-bit SoCs to the Meson VPU DRM driver > (without adding more "not recommended" code) > > Disclaimer: I am not familiar with the DRM subsystem - so apologies if > the terminology is not correct. > > drivers/gpu/drm/meson/meson_dw_hdmi.c currently serves four purposes: > 1. manage the TOP (glue) registers for the dw-hdmi IP > This is Amlogic specific and consists of things like HPD filtering, > some internal resets, etc. > In my opinion this part is supposed to stay in this driver Yep, it's tightly coupled to the DW-HDMI core > > 2. load the driver for the dw-hdmi IP by calling dw_hdmi_probe() > I read somewhere that this is not recommended anymore and should be replaced. > Is my understanding correct and what is the recommended replacement? Yeah in fact the dw-hdmi glue should be a pure bridge, not a component anymore. This means it should probe by itself entirely, should not use the component stuff. This also means all the VPU related part (mainly encoder and clock) should be moved out of this file as a bridge and built with the meson_drm driver, then find the "next bridge" like other drivers. > > 3. it manages the HDMI PHY registers in the HHI register area > For the 32-bit SoCs I will not follow this pattern and will create a > separate PHY instead. > As a long-term goal I think we should also move this into a dedicated > PHY driver. I looked at it, and ... it's complex. For the 32-bit socs it's easy because you only have a single PHY setup, for the new gens you have to deal with the 4k modes and co. This could be handle by adding a new parameters set to the phy_configure union, but what should we add in it to be super generic ? > > 4. call back into VPU/VENC functions to set up these registers > This is a blocker for 32-bit SoC support as I would have to duplicate > this code if we don't make any changes. This includes things like > calculating (and setting) clock frequencies, calling > meson_venc_hdmi_mode_set for setting up the DVI pixel encoder, etc. > My understanding is that this part should not be part of the > meson_dw_hdmi driver, but "some other" driver. I don't understand > which driver that's supposed to be though and how things would be > wired up in the end. Yep it should be a bridge. You can chain bridges, it's designed for such use case. We will have internal bridges for encoders, ENCL+ENCP grouped for HDMI and ENCL. CVBS can be handled separately without bridges. I can have a try to move stuff if you can review/test on your side. Would it be a good start ? > > In addition to HDMI my understanding is that for adding MIPI DSI > support you would > a) either have to follow the pattern from the meson_dw_hdmi driver or > b) also require some better way to achieve this With the cut I described before, we'll need a add a simple ENCL bridge in meson_drm and a standalone bridge for dw-mipi-dsi. > > The biggest question marks for me are #2 and #4 from the list above. > Also is there anything I have missed? > Any input, feedback and questions are welcome! > > PS: an additional topic on the TODO list will be "use the common clock > framework" for clock setup. it's currently not clear to me if that's > possible on the 64-bit SoCs in all cases. It's the same issue for 4k & co, the high freqs needs special PLL settings, not sure how this would be easily doable in the PLL driver. We may need to add a gx/g12 HDMI specific pll driver. > I will start a separate discussion for that topic after this one. > > > Best regards, > Martin > Thanks for starting the thread ! Neil