Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E24B7CD5BD0 for ; Sat, 30 May 2026 19:29:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95158112992; Sat, 30 May 2026 19:29:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="RoC+iCMK"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB94A112989 for ; Sat, 30 May 2026 19:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780169280; x=1811705280; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PnW9znJnD21xpsx3kcHmwvFHlisKVf5TfABFU1BGeTY=; b=RoC+iCMKG9XD9ihvRYlFm+mqV76i5rlJJfMQbveks+My0Q7X1MDOUF2q TwTGecf+Ghg9qpfjkrMWY+ruzyCAMhv0yf2wQ1es2+qG4frMunSdM5Nfx GEwCMC06aFna99QLpb2zdNWig9Vl0hXwwKF5T54X9op+5EKbRBI3O720R Ty7dARISH/G8SBSk9LI7hdlWRCT4+YIl9+fFblz1H/I3+60aLt2hHxdXL oiMtqfDwWo15joqxWUS6VPWIpZXStVnGKpCgJ2HCVhUm9ZxySkwxCuDAl WKVfpM9mGcmlvGXaEHJ343UGQpUP7n0Usz3TG0CzxVjAI+QcZd3DGtlr1 Q==; X-CSE-ConnectionGUID: 7/WfEI59QR2x+j43UwJZcA== X-CSE-MsgGUID: 3WZunfwQTxqmv/S+KKwRCA== X-IronPort-AV: E=McAfee;i="6800,10657,11802"; a="103657577" X-IronPort-AV: E=Sophos;i="6.24,178,1774335600"; d="scan'208";a="103657577" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2026 12:28:00 -0700 X-CSE-ConnectionGUID: 1Zsg1RtpQReB2pnLhqD/XA== X-CSE-MsgGUID: i+ZMNz4yQMCKXh3SAKACww== X-ExtLoop1: 1 Received: from linux-x299-aorus-gaming-3-pro.iind.intel.com ([10.223.34.115]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2026 12:27:58 -0700 From: Swati Sharma To: igt-dev@lists.freedesktop.org Cc: Swati Sharma Subject: [PATCH i-g-t,v7 4/5] tests/intel/kms_dsc_helper: Add helper func() Date: Sun, 31 May 2026 01:06:39 +0530 Message-Id: <20260530193640.2551688-5-swati2.sharma@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260530193640.2551688-1-swati2.sharma@intel.com> References: <20260530193640.2551688-1-swati2.sharma@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Introduce check_dsc_joiner_constraints() to validate minimum pipe count, consecutive HW pipe availability, DSC slice requirements, and joiner support for DSC joiner scenarios. Update meson.build to link kms_joiner_helper.c into DSC-related tests so the new helper can call igt_is_joiner_supported_by_source(). v2: -Avoid hardcoding min_pipes/min_slices, use enum values (Santhosh) v3: -Handle JOINED_PIPES_NONE/DEFAULT explicitly, return true (Karthik) -Fix indentation/style issues (Karthik) v4: -Move consecutive pipe check (igt_crtc_for_pipe) into helper rather than having it in the test (Karthik) Co-developed-by: Claude Opus 4.6 Signed-off-by: Swati Sharma --- tests/intel/kms_dsc_helper.c | 67 ++++++++++++++++++++++++++++++++++++ tests/intel/kms_dsc_helper.h | 5 +++ tests/meson.build | 17 +++++---- 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/tests/intel/kms_dsc_helper.c b/tests/intel/kms_dsc_helper.c index 29b998c2f..7856e33ef 100644 --- a/tests/intel/kms_dsc_helper.c +++ b/tests/intel/kms_dsc_helper.c @@ -203,3 +203,70 @@ bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *outp return true; } + +bool check_dsc_joiner_constraints(int drm_fd, + igt_output_t *output, + igt_display_t *display, + enum pipe pipe, + int num_pipes, + enum joined_pipes type) +{ + int min_pipes = 0, min_slices = 0; + + if (!igt_is_joiner_supported_by_source(drm_fd, type)) + return false; + + /* + * For joiner, 2 slices per pipe is used + * i.e. min_slices = 2 * min_pipes + */ + switch (type) { + case JOINED_PIPES_BIG_JOINER: + min_pipes = JOINED_PIPES_BIG_JOINER; + min_slices = min_pipes * 2; + break; + case JOINED_PIPES_ULTRA_JOINER: + min_pipes = JOINED_PIPES_ULTRA_JOINER; + min_slices = min_pipes * 2; + break; + case JOINED_PIPES_NONE: + case JOINED_PIPES_DEFAULT: + return true; + default: + igt_info("Unknown joiner type: %d\n", type); + return false; + } + + if (num_pipes < min_pipes) { + igt_info("%s requires minimum %d pipes\n", + igt_get_joined_pipes_name(type), min_pipes); + return false; + } + + /* Verify consecutive HW pipes are available from this pipe */ + if (type == JOINED_PIPES_BIG_JOINER && + !igt_crtc_for_pipe(display, pipe + 1)) + return false; + + if (type == JOINED_PIPES_ULTRA_JOINER && + (!igt_crtc_for_pipe(display, pipe + 1) || + !igt_crtc_for_pipe(display, pipe + 2) || + !igt_crtc_for_pipe(display, pipe + 3))) + return false; + + if (igt_get_dsc_sink_max_slice_count(drm_fd, output->name) < min_slices) { + igt_info("Output %s doesn't support minimum %d slice count for %s\n", + igt_output_name(output), min_slices, + igt_get_joined_pipes_name(type)); + return false; + } + + if (!igt_has_force_joiner_debugfs(drm_fd, output->name)) { + igt_info("Output %s doesn't support force_joiner debugfs for %s\n", + igt_output_name(output), + igt_get_joined_pipes_name(type)); + return false; + } + + return true; +} diff --git a/tests/intel/kms_dsc_helper.h b/tests/intel/kms_dsc_helper.h index ee419c849..542fe46de 100644 --- a/tests/intel/kms_dsc_helper.h +++ b/tests/intel/kms_dsc_helper.h @@ -8,6 +8,7 @@ #include "igt.h" #include "igt_sysfs.h" +#include "kms_joiner_helper.h" #include #include #include @@ -39,5 +40,9 @@ void force_dsc_fractional_bpp_enable(int drmfd, igt_output_t *output); void save_force_dsc_fractional_bpp_en(int drmfd, igt_output_t *output); void restore_force_dsc_fractional_bpp_en(void); bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *output); +bool check_dsc_joiner_constraints(int drm_fd, igt_output_t *output, + igt_display_t *display, enum pipe pipe, + int num_pipes, + enum joined_pipes type); #endif diff --git a/tests/meson.build b/tests/meson.build index fe0818118..3255e9282 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -399,14 +399,19 @@ extra_sources = { 'kms_chamelium_hpd': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], 'kms_chamelium_sharpness_filter': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ], 'kms_dp_linktrain_fallback': [ - join_paths ('intel', 'kms_mst_helper.c'), - join_paths ('intel', 'kms_dsc_helper.c') ], + join_paths ('intel', 'kms_mst_helper.c'), + join_paths ('intel', 'kms_dsc_helper.c'), + join_paths ('intel', 'kms_joiner_helper.c') ], 'kms_dp_link_training': [ - join_paths ('intel', 'kms_mst_helper.c'), - join_paths ('intel', 'kms_joiner_helper.c') ], - 'kms_dsc': [ join_paths ('intel', 'kms_dsc_helper.c') ], + join_paths ('intel', 'kms_mst_helper.c'), + join_paths ('intel', 'kms_joiner_helper.c') ], + 'kms_dsc': [ + join_paths ('intel', 'kms_dsc_helper.c'), + join_paths ('intel', 'kms_joiner_helper.c') ], 'kms_joiner': [ join_paths ('intel', 'kms_joiner_helper.c') ], - 'kms_psr2_sf': [ join_paths ('intel', 'kms_dsc_helper.c') ], + 'kms_psr2_sf': [ + join_paths ('intel', 'kms_dsc_helper.c'), + join_paths ('intel', 'kms_joiner_helper.c') ], } # Extra dependencies used on core and Intel drivers -- 2.25.1