From: Igor Paunovic <royalnet026@gmail.com>
To: Sandy Huang <hjc@rock-chips.com>,
Heiko Stuebner <heiko@sntech.de>,
Andy Yan <andy.yan@rock-chips.com>
Cc: Igor Paunovic <royalnet026@gmail.com>,
Cristian Ciocaltea <cristian.ciocaltea@collabora.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Chaoyi Chen <chaoyi.chen@rock-chips.com>,
Alexey Charkov <alchark@flipper.net>,
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>,
dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/rockchip: vop2: Scale the AXI clock to the bandwidth the mode needs
Date: Thu, 13 Aug 2026 12:13:00 +0200 [thread overview]
Message-ID: <20260813101307.10945-1-royalnet026@gmail.com> (raw)
In-Reply-To: <20260813100027.349761F000E9@smtp.kernel.org>
The review bot found three things on v2 and all three are right. I am
answering rather than sending a v3 straight away, because the fix for
the two High ones is a single change that touches a file shared by
every Rockchip SoC, and I would rather ask about that than guess.
Both High findings come from the same shortcut. v2 keeps the
requirement in a global atomic state object, which I still think is the
right container, but it applies the rate from vop2_crtc_atomic_enable()
and _disable() rather than from the commit tail:
- Out of order commits. Two non-blocking commits on different CRTCs
share only the private object, and nothing orders them, so a commit
that took its snapshot before another CRTC raised the rate can land
after it and lower it again.
- Multi-CRTC disable. atomic_disable() runs once per CRTC, and the
first one already sees a state in which every participating CRTC is
off, so the rate drops while the others are still scanning out and
waiting for dsp_hold_completion.
vc4 solves both of these for its core clock, and what I did was take
half of that pattern instead of all of it:
- vc4_atomic_commit_setup() records a pending commit per channel in
the private state and the next commit waits on it with
drm_crtc_commit_wait(). That is the ordering v2 has no equivalent
of.
- vc4_atomic_commit_tail() holds max(old, new) for the length of the
commit and only drops to the new rate after
drm_atomic_helper_wait_for_flip_done(). That is exactly the window
the second finding describes.
Hence the question. Doing the same in rockchip means adding both
.atomic_commit_setup and .atomic_commit_tail to
rockchip_mode_config_helpers in rockchip_drm_fb.c, which today carries
only .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm and is
shared by every SoC this driver supports, VOP as well as VOP2. The
commit tail would be a thin wrapper around the rpm helper with the
clock work on either side of it, and both hooks would do nothing on
anything that is not RK3588.
Is that acceptable, or would you rather this stayed inside vop2 in some
other shape? I am happy to write it either way, but I would rather find
that out before than after.
The Medium finding needs no discussion: if
drm_atomic_private_obj_init() fails, the jump to err_crtcs does not
undo rockchip_rgb_init(). It is also new in this patch, since before it
nothing after rockchip_rgb_init() could fail, so it is mine and it will
be fixed in the next version whatever shape the rest takes.
Igor
WARNING: multiple messages have this Message-ID (diff)
From: Igor Paunovic <royalnet026@gmail.com>
To: Sandy Huang <hjc@rock-chips.com>,
Heiko Stuebner <heiko@sntech.de>,
Andy Yan <andy.yan@rock-chips.com>
Cc: Igor Paunovic <royalnet026@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
linux-kernel@vger.kernel.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Maxime Ripard <mripard@kernel.org>,
Chaoyi Chen <chaoyi.chen@rock-chips.com>,
Alexey Charkov <alchark@flipper.net>,
linux-rockchip@lists.infradead.org,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] drm/rockchip: vop2: Scale the AXI clock to the bandwidth the mode needs
Date: Thu, 13 Aug 2026 12:13:00 +0200 [thread overview]
Message-ID: <20260813101307.10945-1-royalnet026@gmail.com> (raw)
In-Reply-To: <20260813100027.349761F000E9@smtp.kernel.org>
The review bot found three things on v2 and all three are right. I am
answering rather than sending a v3 straight away, because the fix for
the two High ones is a single change that touches a file shared by
every Rockchip SoC, and I would rather ask about that than guess.
Both High findings come from the same shortcut. v2 keeps the
requirement in a global atomic state object, which I still think is the
right container, but it applies the rate from vop2_crtc_atomic_enable()
and _disable() rather than from the commit tail:
- Out of order commits. Two non-blocking commits on different CRTCs
share only the private object, and nothing orders them, so a commit
that took its snapshot before another CRTC raised the rate can land
after it and lower it again.
- Multi-CRTC disable. atomic_disable() runs once per CRTC, and the
first one already sees a state in which every participating CRTC is
off, so the rate drops while the others are still scanning out and
waiting for dsp_hold_completion.
vc4 solves both of these for its core clock, and what I did was take
half of that pattern instead of all of it:
- vc4_atomic_commit_setup() records a pending commit per channel in
the private state and the next commit waits on it with
drm_crtc_commit_wait(). That is the ordering v2 has no equivalent
of.
- vc4_atomic_commit_tail() holds max(old, new) for the length of the
commit and only drops to the new rate after
drm_atomic_helper_wait_for_flip_done(). That is exactly the window
the second finding describes.
Hence the question. Doing the same in rockchip means adding both
.atomic_commit_setup and .atomic_commit_tail to
rockchip_mode_config_helpers in rockchip_drm_fb.c, which today carries
only .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm and is
shared by every SoC this driver supports, VOP as well as VOP2. The
commit tail would be a thin wrapper around the rpm helper with the
clock work on either side of it, and both hooks would do nothing on
anything that is not RK3588.
Is that acceptable, or would you rather this stayed inside vop2 in some
other shape? I am happy to write it either way, but I would rather find
that out before than after.
The Medium finding needs no discussion: if
drm_atomic_private_obj_init() fails, the jump to err_crtcs does not
undo rockchip_rgb_init(). It is also new in this patch, since before it
nothing after rockchip_rgb_init() could fail, so it is mine and it will
be fixed in the next version whatever shape the rest takes.
Igor
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-08-13 10:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 9:45 [PATCH v2] drm/rockchip: vop2: Scale the AXI clock to the bandwidth the mode needs Igor Paunovic
2026-08-13 9:45 ` Igor Paunovic
2026-08-13 10:00 ` sashiko-bot
2026-08-13 10:13 ` Igor Paunovic [this message]
2026-08-13 10:13 ` Igor Paunovic
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=20260813101307.10945-1-royalnet026@gmail.com \
--to=royalnet026@gmail.com \
--cc=airlied@gmail.com \
--cc=alchark@flipper.net \
--cc=andy.yan@rock-chips.com \
--cc=chaoyi.chen@rock-chips.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=sebastian.reichel@collabora.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.