mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Ao Xu <ao.xu@amlogic.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: neil.armstrong@linaro.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	dri-devel@lists.freedesktop.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 00/11] Subject: [PATCH 00/11] Add DRM support for Amlogic S4
Date: Tue, 10 Feb 2026 14:05:19 +0800	[thread overview]
Message-ID: <1a93d6ad-7f09-467c-9b2d-9e706f66adaf@amlogic.com> (raw)
In-Reply-To: <CAFBinCA374KQiKn=_M5JNfY+Re_uw_40A169G=pU2-MghmUV2g@mail.gmail.com>


在 2026/2/10 5:26, Martin Blumenstingl 写道:
> [ EXTERNAL EMAIL ]
>
> Hi Ao Xu,
>
> On Thu, Feb 5, 2026 at 12:56 PM Ao Xu <ao.xu@amlogic.com> wrote:
>> Hi neil, martin, jerome
>>
>> This email proposes a refactoring of the Meson DRM driver to adopt a
>> component-based pipeline management model, inspired by the ARM Komeda DRM
>> driver.
> First of all: thanks for working on a plan on how to move things forward!

Hi,martin

     thanks for your comments.

>
>> The current Meson DRM implementation tightly couples drm_plane and
>> drm_crtc logic with specific hardware blocks (OSD MIF, AFBC, scaler,
>> blend, postblend), which makes it increasingly difficult to scale to
>> newer SoCs.
> I have to admit that I'm new to this part of the DRM driver /
> subsystem - so I will probably ask some novice questions.
>
>> The attached /vpu-block/ file describes the proposed VPU block pipeline.
>>
>> This implement introduces a generic pipeline framework where:
>>
>> - Hardware blocks (MIF, AFBC, SCALER, BLEND, POSTBLEND) are modeled as
>>     independent components with well-defined capabilities.
>>
>> - drm_plane and drm_crtc are responsible only for building and validating
>>     a pipeline, not for directly programming hardware registers.
>> - Per-block atomic state is separated from SoC-specific register layouts,
>>     similar to Komeda's component_state and pipeline_state model.
> I have two questions here:
> - How is per-SoC register access managed?
> - How are "common" (shared across multiple - or even all SoCs)
> registers managed?
>
> It seems that the komeda driver uses komeda_dev_funcs for the
> per-variant access.
> However, it's not clear how this scales as only two mostly identical
> display controllers (D32 and D71) ever made it into the driver.

I would like to first describe the current state.

    In atomic_update and atomic_disable, register values are derived
    from the property information and stored into the priv->viu and
    priv->afbc structures.
    In meson_crtc_irq, the previously saved values are then written into
    the hardware registers.

In future SoCs, we may encounter the following scenarios:

  * The register addresses of a given block may change. For example, on
    S905X2, the OSD1 scaler registers are located at 0x1dc0–0x1dcd,
    while on A311D2, the same OSD1 scaler registers move to 0x5a00–0x5a0d.
  * A block's functionality may be reduced or extended, which can
    include changes to existing register bits or the introduction of new
    control registers. For instance, the OSD MIF block previously
    required canvas configuration, while on T7C the canvas mechanism is
    completely removed.
  * An entire block may be removed or newly added. For example, GFCD,
    which internally integrates AFBC and AFRC hardware modules, is
    present on A9.

Register programming is performed through RDMA hardware.When RDMA is 
available, the flow is different.

    In atomic_update and atomic_disable, register values are written
    directly into the RDMA register table, and there is no need to cache
    the register values in software.
    Once all register writes are prepared, rdma_config is used to let
    the hardware flush the RDMA register table into the real registers
    on the next VSync.

On a given SoC, each internal block contains fields that determine which 
register set it should use.
This information is SoC-specific and must be provided by the SoC description

>
>> This is achieved by introducing four core objects, as shown in the
>> attached class-diagram document.
>>
>> - meson_vpu_block
>> - meson_vpu_block_state
>> - meson_pipeline
>> - meson_pipeline_state
>>
>>
>> The atomic flow is structured as shown in the attached commit-flow document.
> The public A311D datasheet page 304 [0] shows that CVBS, HDMITX and
> MIPI_DSI are part of the VPU block.
> Those aren't mentioned in your flows. Is that because they are "after"
> POSTBLEND and would therefore be part of a future refactoring
> approach?
This proposal focuses only on VPU OSD and video-related blocks.
Encoder and connector handling is a separate and much larger topic.
I am currently investigating how to reuse existing PHY and clock tree 
interfaces for that part, but it is intentionally kept out of this 
proposal.
>
> Also RMDA is shown in the same diagram as part of VPU. Neil had to
> work hard to implement it back then for AFBC.
> You haven't listed it in your diagrams but I assume it is going to be
> part of the implementation as it is/was mandatory for AFBC.
> Can you confirm my understanding here (or clear up my confusion)?
Yes, we will add RDMA function support firstly.
>
>> The intention of this proposal is not to change hardware behavior, but to
>> gradually restructure the driver to improve maintainability, scalability,
>> and correctness of atomic state handling across different Meson SoCs.
>>
>> This is an initial proposal intended to gather feedback on the overall
>> architecture before converting existing code paths incrementally.
> Making incremental changes sounds great! The meson DRM driver is too
> big to "just" copy it and make modifications (or even modifying it
> directly with one huge patch).
>
>
> Best regards,
> Martin
>
>
> [0] https://dl.khadas.com/products/vim3/datasheet/a311d-datasheet.pdf

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-02-10  6:06 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10  5:39 Ao Xu via B4 Relay
2025-01-10  5:39 ` [PATCH 01/11] dt-bindings: display: meson-dw-hdmi: Add compatible for S4 HDMI controller Ao Xu via B4 Relay
2025-01-11 10:17   ` Krzysztof Kozlowski
2025-11-18 14:50   ` Piotr Oniszczuk
2025-11-19  2:57     ` Chuan Liu
2025-11-19 10:27       ` Piotr Oniszczuk
2025-11-21  2:55         ` Ao Xu
2025-11-21  9:54           ` Piotr Oniszczuk
2025-12-02  8:29           ` Piotr Oniszczuk
2025-12-03  5:56             ` Ao Xu
2025-12-05  7:09               ` Ao Xu
2025-12-05 10:03                 ` Piotr Oniszczuk
2025-01-10  5:39 ` [PATCH 02/11] dt-bindings: display: meson-vpu: Add compatible for S4 display controller Ao Xu via B4 Relay
2025-01-10 14:07   ` Krzysztof Kozlowski
2025-01-10  5:39 ` [PATCH 03/11] drm: meson: add S4 compatible for DRM driver Ao Xu via B4 Relay
2025-01-10 13:36   ` Jerome Brunet
2025-01-11  6:40   ` kernel test robot
2025-01-11  7:47   ` kernel test robot
2025-01-10  5:39 ` [PATCH 04/11] drm: meson: add primary and overlay plane support for S4 Ao Xu via B4 Relay
2025-01-10  5:39 ` [PATCH 05/11] drm: meson: update VIU and VPP " Ao Xu via B4 Relay
2025-01-10  5:39 ` [PATCH 06/11] drm: meson: add meson_dw_hdmi " Ao Xu via B4 Relay
2025-01-10 14:08   ` Krzysztof Kozlowski
2025-01-10  5:39 ` [PATCH 07/11] drm: meson: change api call parameter Ao Xu via B4 Relay
2025-01-10  5:39 ` [PATCH 08/11] drm: meson: add hdmitx vmode timing support for S4 Ao Xu via B4 Relay
2025-01-10  5:39 ` [PATCH 09/11] drm: meson: add vpu clk setting " Ao Xu via B4 Relay
2025-01-10  5:40 ` [PATCH 10/11] drm: meson: add CVBS support " Ao Xu via B4 Relay
2025-01-10  5:40 ` [PATCH 11/11] arm64: dts: amlogic: s4: add DRM support [1/1] Ao Xu via B4 Relay
2025-01-10 10:10 ` [PATCH 00/11] Subject: [PATCH 00/11] Add DRM support for Amlogic S4 Neil Armstrong
2026-02-05 11:56   ` Ao Xu
2026-02-09 21:26     ` Martin Blumenstingl
2026-02-10  6:05       ` Ao Xu [this message]
2026-02-26 22:12         ` Martin Blumenstingl
2025-01-10 22:43 ` Rob Herring (Arm)
2025-01-12 22:44 ` Martin Blumenstingl
2025-01-14 17:50   ` Jerome Brunet
2025-01-15  6:15     ` Ao Xu
2025-01-22  9:50     ` Ao Xu
2025-01-22 10:38       ` Jerome Brunet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a93d6ad-7f09-467c-9b2d-9e706f66adaf@amlogic.com \
    --to=ao.xu@amlogic.com \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome