From: Jani Nikula <jani.nikula@intel.com>
To: Jason-JH Lin <jason-jh.lin@mediatek.com>,
igt-dev@lists.freedesktop.org,
Karthik B S <karthik.b.s@intel.com>,
Swati Sharma <swati2.sharma@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
Fei Shao <fshao@chromium.org>
Cc: Jason-JH Lin <jason-jh.lin@mediatek.com>,
Paul-PL Chen <paul-pl.chen@mediatek.com>,
Nancy Lin <nancy.lin@mediatek.com>,
Singo Chang <singo.chang@mediatek.com>,
Gil Dekel <gildekel@google.com>, Yacoub <markyacoub@chromium.org>,
Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH i-g-t v4] tests/kms_content_protection: Optimize framebuffer management
Date: Fri, 27 Mar 2026 12:40:51 +0200 [thread overview]
Message-ID: <9500f111b76bdfd7dfe77dfb5d70b7d525cfa0f5@intel.com> (raw)
In-Reply-To: <20260327035405.3151190-1-jason-jh.lin@mediatek.com>
On Fri, 27 Mar 2026, Jason-JH Lin <jason-jh.lin@mediatek.com> wrote:
> Refactor framebuffer management to improve reusability:
> - Create framebuffers once per CRTC at test initialization via
> create_fbs() and reuse them across all subtests
> - Centralize cleanup in remove_fbs() called at test fixture end
> - Use per-CRTC framebuffer array (data.fbs[IGT_MAX_PIPES]) indexed
> by crtc->crtc_index instead of single global framebuffers
>
> Each framebuffer is created with the actual resolution of the first
> output that can connect to that CRTC, avoiding buffer size mismatch
> issues (e.g., 3504x2190 panel incorrectly using 3840x2160 buffer).
>
> For MST tests, multiple outputs share bandwidth and may require mode
> override to fit within bandwidth constraints. When mode override
> changes the resolution, properly detach planes before removing the
> existing framebuffers, then recreate them with the new dimensions.
Feels like there's a bunch of changes grouped together in one commit
that should probably be split up.
For example, passing the crtc around is a change. Adding the fb cleanup
is another. Adding multiple fbs is another.
The point is, if a bisected regression landed here, would you be able to
immediately tell what the problem is?
> Suggested-by: Karthik B.S <karthik.b.s@intel.com>
> Reviewed-by: Fei Shao <fshao@chromium.org>
> Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
> tests/kms_content_protection.c | 190 ++++++++++++++++++++++++---------
> 1 file changed, 142 insertions(+), 48 deletions(-)
>
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index caf3d7a56ae4..8b131277ffea 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -258,7 +263,15 @@ commit_display_and_wait_for_flip(enum igt_commit_style commit_style)
> }
> }
>
> -static void modeset_with_fb(igt_output_t *output,
> +static igt_crtc_t *output_get_driving_crtc_assert(igt_output_t *output)
> +{
> + igt_crtc_t *crtc = igt_output_get_driving_crtc(output);
> +
> + igt_assert(crtc);
> + return crtc;
> +}
I'm personally not fond of abstracting/hiding asserts like this. Do you
even need it really? It's a test logic issue if you hit this.
> +
> +static void modeset_with_fb(igt_output_t *output, igt_crtc_t *crtc,
> enum igt_commit_style commit_style)
> {
> igt_display_t *display = &data.display;
> @@ -268,18 +281,19 @@ static void modeset_with_fb(igt_output_t *output,
> @@ -1180,9 +1264,18 @@ static const struct {
> int igt_main()
> {
> igt_fixture() {
> + igt_crtc_t *crtc;
> +
> data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> igt_display_require(&data.display, data.drm_fd);
> igt_display_require_output(&data.display);
> +
> + /* Ensure all CRTCs can be indexed within our framebuffer array */
> + for_each_crtc(&data.display, crtc)
> + igt_assert_f(crtc->crtc_index < IGT_MAX_PIPES,
> + "crtc_index %u exceeds IGT_MAX_PIPES %u\n",
> + crtc->crtc_index, IGT_MAX_PIPES);
This is handled by igt_display_require(), and is completely unnecessary
here.
BR,
Jani.
> +
> create_fbs();
> }
>
> @@ -1241,6 +1334,7 @@ int igt_main()
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-03-27 10:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 3:53 [PATCH i-g-t v4] tests/kms_content_protection: Optimize framebuffer management Jason-JH Lin
2026-03-27 4:45 ` ✓ Xe.CI.BAT: success for tests/kms_content_protection: Optimize framebuffer management (rev3) Patchwork
2026-03-27 5:08 ` ✓ i915.CI.BAT: " Patchwork
2026-03-27 10:40 ` Jani Nikula [this message]
2026-03-30 2:40 ` [PATCH i-g-t v4] tests/kms_content_protection: Optimize framebuffer management Jason-JH Lin (林睿祥)
2026-03-27 20:55 ` ✓ Xe.CI.FULL: success for tests/kms_content_protection: Optimize framebuffer management (rev3) Patchwork
2026-03-28 5:00 ` ✗ i915.CI.Full: failure " Patchwork
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=9500f111b76bdfd7dfe77dfb5d70b7d525cfa0f5@intel.com \
--to=jani.nikula@intel.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=bhanuprakash.modem@gmail.com \
--cc=fshao@chromium.org \
--cc=gildekel@google.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jason-jh.lin@mediatek.com \
--cc=juhapekka.heikkila@gmail.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=karthik.b.s@intel.com \
--cc=markyacoub@chromium.org \
--cc=nancy.lin@mediatek.com \
--cc=paul-pl.chen@mediatek.com \
--cc=singo.chang@mediatek.com \
--cc=swati2.sharma@intel.com \
/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