Hi Manasi,

Santhosh from our team has tested this out at our end. Thanks Santhosh.

Will get this merged.

Thanks and Regards,
Karthik.B.S

On 5/6/2026 3:58 AM, Manasi Navare wrote:
Hi @Karthik B S , were you able to test this locally for regressions?
If you could add your R-B , we can get this landed as soon as possible.
This is time critical for us and is required to scale to MTK platform

Regards
Manasi

On Mon, May 4, 2026 at 1:32 PM Manasi Navare <navaremanasi@google.com> wrote:
Thanks a lot @Karthik B S  for your response,
And appreciate you trying this on your end and for your help on getting this landed.

Regards
Manasi

On Mon, May 4, 2026 at 1:31 AM Karthik B S <karthik.b.s@intel.com> wrote:

Hi Manasi,

On 5/1/2026 4:29 AM, Manasi Navare wrote:
This change looks good to me,

Reviewed-by: Manasi Navare <navaremanasi@google.com>

@Karthik B S  and others from Intel signal boosting this, could we get some traction on this, its reviewed by the team, could we please land this?

Sure, the idea LGTM in general. Will try this out at our end once before merging as this test doesn't have coverage on CI currently.

Regards,
Karthik.B.S

Regards
Manasi

On Wed, Apr 29, 2026 at 1:31 PM Manasi Navare <navaremanasi@google.com> wrote:
Thanks Jason-JH for this improvement in the kms_content_protection IGT test.
It makes sense to create a fb per CRTC given that each CRTC can have different mode timings/resolutions.

Could you please take a look at this patch and help provide feedback?
We would like to get this landed as it helps improve our testing.

Regards
Manasi



On Sun, Mar 29, 2026 at 8:22 PM Jason-JH Lin <jason-jh.lin@mediatek.com> wrote:
Replace global framebuffers (data.red/green) with per-CRTC array
(data.fbs[IGT_MAX_PIPES]) to support multiple outputs with different
resolutions.

Add create_fbs()/remove_fbs() to manage framebuffer lifecycle at
test initialization/cleanup, creating each FB with the resolution of
the first output that can connect to that CRTC.

Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
---
 tests/kms_content_protection.c | 50 +++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index caf3d7a56ae4..df9ff5efcaa2 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -107,10 +107,15 @@

 IGT_TEST_DESCRIPTION("Test content protection (HDCP)");

+struct hdcp_test_fbs {
+       struct igt_fb red;
+       struct igt_fb green;
+};
+
 struct data {
        int drm_fd;
        igt_display_t display;
-       struct igt_fb red, green;
+       struct hdcp_test_fbs fbs[IGT_MAX_PIPES];
        unsigned int cp_tests;
        struct udev_monitor *uevent_monitor;
        bool is_force_hdcp14;
@@ -991,31 +996,49 @@ static void test_content_protection_cleanup(void)
                igt_info("CP Prop being UNDESIRED on %s\n", output->name);
                test_cp_disable(output, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
        }
-
-       igt_remove_fb(data.drm_fd, &data.red);
-       igt_remove_fb(data.drm_fd, &data.green);
 }

 static void create_fbs(void)
 {
-       uint16_t width = 0, height = 0;
        drmModeModeInfo *mode;
        igt_output_t *output;
+       igt_crtc_t *crtc;

+       /* Create framebuffers for each connected output's pipe */
        for_each_connected_output(&data.display, output) {
                mode = igt_output_get_mode(output);
                igt_assert(mode);

-               width = max(width, mode->hdisplay);
-               height = max(height, mode->vdisplay);
+               /* Find a valid crtc for this output */
+               for_each_crtc(&data.display, crtc) {
+                       if (!igt_crtc_connector_valid(crtc, output))
+                               continue;
+
+                       /* Skip if already created for this crtc */
+                       if (data.fbs[crtc->crtc_index].red.fb_id)
+                               continue;
+
+                       igt_create_color_fb(data.drm_fd, mode->hdisplay, mode->vdisplay,
+                                           DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
+                                           1.f, 0.f, 0.f, &data.fbs[crtc->crtc_index].red);
+                       igt_create_color_fb(data.drm_fd, mode->hdisplay, mode->vdisplay,
+                                           DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
+                                           0.f, 1.f, 0.f, &data.fbs[crtc->crtc_index].green);
+                       break;
+               }
        }
+}

-       igt_create_color_fb(data.drm_fd, width, height,
-                           DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
-                           1.f, 0.f, 0.f, &data.red);
-       igt_create_color_fb(data.drm_fd, width, height,
-                           DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
-                           0.f, 1.f, 0.f, &data.green);
+static void remove_fbs(void)
+{
+       igt_crtc_t *crtc;
+
+       for_each_crtc(&data.display, crtc) {
+               if (data.fbs[crtc->crtc_index].red.fb_id)
+                       igt_remove_fb(data.drm_fd, &data.fbs[crtc->crtc_index].red);
+               if (data.fbs[crtc->crtc_index].green.fb_id)
+                       igt_remove_fb(data.drm_fd, &data.fbs[crtc->crtc_index].green);
+       }
 }

 static const struct {
@@ -1241,6 +1264,7 @@ int igt_main()

        igt_fixture() {
                test_content_protection_cleanup();
+               remove_fbs();
                igt_display_fini(&data.display);
                drm_close_driver(data.drm_fd);
        }
--
2.43.0