From mboxrd@z Thu Jan 1 00:00:00 1970 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 7B406C25B77 for ; Sun, 12 May 2024 15:51:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 059B210E2C4; Sun, 12 May 2024 15:51:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Q649SPaG"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51EFF10E2C4 for ; Sun, 12 May 2024 15:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715529074; x=1747065074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J1CEx7dX+yOEuWes44W7iBoQahnwa+6cknMH7LaFZ9M=; b=Q649SPaGVGidaFKQALaefXNrwxa92DPgJPhVIEcWfxY36yrx46CQPMJ/ adLENqyh2Csk36+0xAHSqER8/KFsUjVWV2Dx8xsYBMY2WUdlPIY4GKnIN BYWf8ZPnd7W1dsxdhW/QiEoceMLOZ4/ec7SohACX2N+0SCJxkLAT9Qp07 Jpdn1OtEzUm4mlIxJ7Ygwc5w1qnqyC1QtcUSTH2819LHhgc8sQaK8VOSo mrqX090bFVC9XD6WbiOUzhUFSBYvSdIgl01US1EnjJAfqliOC2m8voZ1q q+KpXwzG/OhE7SqgxHHE7Mi/pCIsl9GXbyZfB8cHZatPEDhnFZFFzjQps Q==; X-CSE-ConnectionGUID: x3XKKrn4Q0+ravu1KCMkYw== X-CSE-MsgGUID: 1hHKKIGbTp2gUafueVxZKw== X-IronPort-AV: E=McAfee;i="6600,9927,11071"; a="22137087" X-IronPort-AV: E=Sophos;i="6.08,156,1712646000"; d="scan'208";a="22137087" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 08:51:14 -0700 X-CSE-ConnectionGUID: MbhUsVE5QBOvow1YWSotGA== X-CSE-MsgGUID: gGET7OWuQGyRVzhfddOymQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,156,1712646000"; d="scan'208";a="34623215" Received: from kunal-x299-aorus-gaming-3-pro.iind.intel.com ([10.190.239.13]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 08:51:13 -0700 From: Kunal Joshi To: igt-dev@lists.freedesktop.org Cc: Kunal Joshi Subject: [PATCH i-g-t 2/3] tests/kms_bw: allow physically connected only Date: Sun, 12 May 2024 21:31:57 +0530 Message-Id: <20240512160158.3328235-3-kunal1.joshi@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240512160158.3328235-1-kunal1.joshi@intel.com> References: <20240512160158.3328235-1-kunal1.joshi@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" modify kms_bw test to only run on physically connected displays, avoiding issues with forcing a 4K EDID on disconnected connectors. For instance, consider a system with 2 DP and 2 HDMI connectors (DP-1, DP-2, HDMI-1, HDMI-2). Forcing EDID on DP is currently problematic, and we only support forcing for HDMI. However, if there's only one TMDS encoder, we can only drive one HDMI display, not two. For now, the test will only run on physically connected displays. Future improvements may consider the encoder count to handle such scenarios more gracefully. Signed-off-by: Kunal Joshi --- tests/kms_bw.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/tests/kms_bw.c b/tests/kms_bw.c index b50f324af..4aabb02b7 100644 --- a/tests/kms_bw.c +++ b/tests/kms_bw.c @@ -61,6 +61,7 @@ typedef struct data { int h[IGT_MAX_PIPES]; int fd; int num_pipes; + int num_outputs; } data_t; static drmModeModeInfo test_mode[] = { @@ -105,8 +106,9 @@ static drmModeModeInfo test_mode[] = { static void test_init(data_t *data) { igt_display_t *display = &data->display; - int i, max_pipes = display->n_pipes; + int i; igt_output_t *output; + data->num_outputs = 0; for_each_pipe(display, i) { data->pipe_id[i] = i; @@ -118,23 +120,22 @@ static void test_init(data_t *data) IGT_PIPE_CRC_SOURCE_AUTO); } - for (i = 0; i < display->n_outputs && i < max_pipes; i++) { - if (!data->pipe[i]) - continue; - - output = &display->outputs[i]; - - data->output[i] = output; + i = 0; + for_each_output(display, output) { /* Only allow physically connected displays for the tests. */ if (!igt_output_is_connected(output)) continue; + data->output[i] = output; + data->num_outputs++; + igt_assert(kmstest_get_connector_default_mode( data->fd, output->config.connector, &data->mode[i])); data->w[i] = data->mode[i].hdisplay; data->h[i] = data->mode[i].vdisplay; + i++; } @@ -156,27 +157,12 @@ static void test_fini(data_t *data) igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0); } -/* Forces a mode for a connector. */ -static void force_output_mode(data_t *d, igt_output_t *output, - const drmModeModeInfo *mode) -{ - /* This allows us to create a virtual sink. */ - if (!igt_output_is_connected(output)) { - kmstest_force_edid(d->fd, output->config.connector, - igt_kms_get_4k_edid()); - - kmstest_force_connector(d->fd, output->config.connector, - FORCE_CONNECTOR_DIGITAL); - } - - igt_output_override_mode(output, mode); -} - static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo *mode) { igt_display_t *display = &data->display; igt_output_t *output; struct igt_fb buffer[IGT_MAX_PIPES]; igt_crc_t zero, captured[IGT_MAX_PIPES]; + int i = 0; int ret; igt_skip_on_f(pipe >= data->num_pipes, @@ -184,6 +170,10 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo test_init(data); + igt_skip_on_f(pipe >= data->num_outputs, + "%d connected outputs required but found %d\n", + pipe+1, data->num_outputs+1); + /* create buffers */ for (i = 0; i <= pipe; i++) { output = data->output[i]; @@ -191,7 +181,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo continue; } - force_output_mode(data, output, mode); + igt_output_override_mode(output, mode); igt_create_color_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, @@ -199,6 +189,9 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo &buffer[i]); igt_output_set_pipe(output, i); + igt_info("Assigned output %s to pipe %s with mode %dx%d@%d\n", + igt_output_name(output), kmstest_pipe_name(i), + mode->hdisplay, mode->vdisplay, mode->vrefresh); igt_plane_set_fb(data->primary[i], &buffer[i]); } -- 2.34.1