Return-Path: Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2085.outbound.protection.outlook.com [40.107.92.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 656E110E34E for ; Thu, 28 Apr 2022 16:59:46 +0000 (UTC) From: David Zhang To: Date: Thu, 28 Apr 2022 12:59:25 -0400 Message-ID: <20220428165925.1406641-3-dingchen.zhang@amd.com> In-Reply-To: <20220428165925.1406641-1-dingchen.zhang@amd.com> References: <20220428165925.1406641-1-dingchen.zhang@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Subject: [igt-dev] [PATCH 2/2] tests/amdgpu/amd_psr: trigger full modeset if visual confirm enabled List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: [why] In amdgpu kernel, to enable PSR visual confirm debug option, it needs a full modeset to call the DM PSR setup helper which in turn to set the visual confirm debug option. Currently before test run there is such full modeset, and after test run ends the visual confirm option is restored to be disabled. Although the IGT clean up after test run ends will do DPMS transition and trigger a full modeset, but at the moment the visual confirm is already disabled. This means that even from command line, visual confirm option is set, the DC visual confirm debug is never enabled actually during any PSR-SU test run. [how] If visual confirm option is set from command line parameter, before any PSR-SU test run, we manually trigger a DPMS off->ON transition which in turn to trigger a full modeset in kernel from test_init(), to enable the visual confirm. Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Leo Li Cc: Jay Pillai Cc: Wayne Lin Signed-off-by: David Zhang --- tests/amdgpu/amd_psr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c index 2ca41927..7838066c 100644 --- a/tests/amdgpu/amd_psr.c +++ b/tests/amdgpu/amd_psr.c @@ -182,6 +182,16 @@ static void test_init(data_t *data) data->pb_h = data->h / 2; data->ob_w = data->w; data->ob_h = data->h; + + if (opt.visual_confirm) { + /** + * if visual confirm option is enabled, we'd trigger a full modeset before test run + * to make PSR visual confirm enable take effect. DPMS off -> ON transition is one of + * the approaches. + */ + kmstest_set_connector_dpms(data->fd, data->output->config.connector, DRM_MODE_DPMS_OFF); + kmstest_set_connector_dpms(data->fd, data->output->config.connector, DRM_MODE_DPMS_ON); + } } /* Common test cleanup. */ static void test_fini(data_t *data) -- 2.25.1