From patchwork Wed May 22 22:08:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13671138 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 5E060C25B7C for ; Wed, 22 May 2024 22:09:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BAD510E028; Wed, 22 May 2024 22:09:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="mBI8KYVU"; dkim-atps=neutral Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB71110E028; Wed, 22 May 2024 22:09:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oU8CU227bX4gbZsyf0nHS9xtBtE0qsZjum6yygFRB/uZY8QdaUgP/dW9eSdLTNiP42bd23PstgsX0fvh/VFOrosI0hCbZK/0gvz8Z39cF5gxOC4A5o/t1Erh5i9zOJrswSptzaW0e0r7sOdxnRgccapLxcnwbVZyyo9hsAHS5aKVNXhNwJplAdRRulH90xZuoZ+2lX0/bipvwkIV2xxVUtrBK6TXWgatLU9zU3fmt6r/6W5umoB8zu23AX4kXiP7VUb+eS748kr2hJfaMn+SBF2GN3PXP6ZwtOfDcTC6pzs0Ddoh44D/1Qkv0WX1+rf/nassGU5/ur9jiGjglE6bXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RKqjNh/CVDpsUn2t2w5AiD6HRJJbNhBonMQ88lItVws=; b=nYmAxhB56jV1kqJ4w4Hfske2L3eO64HgTNgkh2Y/lBIC71hznbrr7KREabdWlZiSEmWyW9ayX+JXtSBZsYyNwek8Tj0TpoMUFU3uuQMk/pL0AXhEUH8JpWr9OlZd5aK/83uirs116Og/SPjtFicFysnCRfQxTHVv6TS2tdlR/iS9H+ton30VUINXLgwlZAwbEH+1ul1+uXq0WU4xEEK+qDFsEH8Ipzc+bE6PY9xbQTvMTFfsvLGLeRO8eDeU0c8GhZVkgev4py34+SGas4Myd46oO2/rPar6T+Lc0BNWfG1RNR24LeJx87rc+bw4xpFlEJFmzqiN67eox20vRZRFsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RKqjNh/CVDpsUn2t2w5AiD6HRJJbNhBonMQ88lItVws=; b=mBI8KYVU4d8RKstHDQvXI5m6zhVXqw9GMr4hbVd/sqidVSvD1Y1g+/CwYl63i5b/5boBAlvP6wtBPQaJ6+JnBHBtvRsIPxyHsbYpb03xGaj3Uyxh08Mvs/r1FWmpZL8t9/Vw7bMrymaZF+JMds3rvelUVNGg8PnjIcWeGUcIuHs= Received: from MN2PR11CA0030.namprd11.prod.outlook.com (2603:10b6:208:23b::35) by DS7PR12MB5934.namprd12.prod.outlook.com (2603:10b6:8:7d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Wed, 22 May 2024 22:09:09 +0000 Received: from BL6PEPF0001AB4C.namprd04.prod.outlook.com (2603:10b6:208:23b:cafe::16) by MN2PR11CA0030.outlook.office365.com (2603:10b6:208:23b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.20 via Frontend Transport; Wed, 22 May 2024 22:09:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4C.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Wed, 22 May 2024 22:09:08 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 17:09:07 -0500 From: Mario Limonciello To: , Simon Ser CC: Harry Wentland , Xaver Hugl , , Leo Li , Sean Paul , Mario Limonciello Subject: [PATCH v2 1/4] Add support for API for drivers to set power saving policy Date: Wed, 22 May 2024 17:08:46 -0500 Message-ID: <20240522220849.33343-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522220849.33343-1-mario.limonciello@amd.com> References: <20240522220849.33343-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4C:EE_|DS7PR12MB5934:EE_ X-MS-Office365-Filtering-Correlation-Id: 21800a5b-fc57-4be1-d822-08dc7aabcd94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|376005|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: taJS0mZUO6Ekd0AhhzebbWLnpbDPXfkYIk9drMaminV16cgB6uVyIl35ruq9yt508MXAz7EAF8fa7vmQ61ZA6wX5I7XaezNOSFfGDMW5MbBAZ4SLoJBUm3+fvQrBESqDs5NR/GZX2qKmXkch9vkjhDg7pkjvHuMmdLQqemTkz2Rfwhw/RFeRyuW4fkPObmrRKU/LwcaIDLoKy1zSlccv/yUq+E3+KyyYL63BlcXwliUvzfmaaSbJ7MrY4lsoSlQY0aGlXSAy6FU+dW4zVadX+sV55iV6dCVc4PlxGiAH2sCAV+AZ6B1Ix+9OkIfEqPRq4cI5kMHNZl6qKGY5H9UYJ5yDOyK4szSJDd1lJZ3V3tMoppwGEibZaEUqwpdxyB0S8kHL2WN+jqsY1Hc/w7DQBUaATuL2OFB/fkwzDsWN8MndRZ5/uqs7RCrnRBchC9vss8ATT4EEQsf7XhC0qXZEvLqoP9hJtGnnwR6wL63urzpn1XPRZQpGHOM8W35o8VFjLB1svjoKa5pfyV1NDQpzN3h9GftB3eJr0+a5zilrjnWOhxQ25S/YdEkIZ/D3onk5SjVBo3oUt51ZYdrfEmIGLjid8bNdtiAHbcEA7ZAfNBGfNxAW4wnoGF66ZtyHb4cTUx2MiEJlgFPFbOcoImfoZVWyB4lVwOLQfB2H2X8LXPGwVkLBdKxDKW6lPKBnl0drTB9vt11GQ1eTTwy0nuw0zDqWsi+Q/WyBOK3eSplTkAfDk7908a1WDBH3ImDWd8ompahuiaXWafoLiJ0b+wvbKJfdlYyKb4XGFnqfE15sXOUWtp00RPOMAcOR/L8nKriwMVwteUDRiPCipJkVnIMZ57EJsfreifwcDHHEqUOFx0xaHIdJRP0ReB8+bOpR+ZG1kZvACmWOeE5VCSCY3vY5y8Hq1pgPiOKR9IUN408Ij6QnQGokqBp5l0dzbhXT0z6sEp0dboGsfoTpiHg8MFqXKv54gQ6lXcnJiTYUMC0ebEvuQPo6zpxiCc/I2USuujzGxSKRS6vYqTmxNQaTSd0N7dxlgCrw3kheDnfi/0TfzDIsdhy8XfgK8m1PEGcfSCaQ6rRRz5D8862BrZraUxLh4aDNFfgO5uHXKyN/P1xvgWD9AvFmwcmFOMFtRu5209FkDPHkeJrqXJ5mmrclyDPqjEysU8ztsWYd4by6x6nT1RMd1ednWxlOT+LusDT5tjX7yvyJuV3XwB2vKblXFTsIPWMi07UYi5GF1O8f5B18hmdWFz6XzyZtpI7cFwFLq2wIi1qd8I+w1vcWfOQrhHv/LN8Y+mnSz3ZKJvct3vNZRtwtIgDogZesljg6j5fvd7uyKavQ6oEidx1I112vQdalnkDVLZ2r7R7lIICj7kYxtkfSc1S4fmhLHHQH9H8PTHfa X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(376005)(36860700004)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 22:09:08.6379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21800a5b-fc57-4be1-d822-08dc7aabcd94 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5934 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --- lib/igt_kms.c | 26 ++++++++++++++++++++++++++ lib/igt_kms.h | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index af63d13b1..4ce5e4a95 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -6581,3 +6581,29 @@ int get_num_scalers(int drm_fd, enum pipe pipe) return num_scalers; } + +static int toggle_power_saving_policy_prop(int drm_fd, igt_output_t *output, uint64_t policy) +{ + uint32_t type = DRM_MODE_OBJECT_CONNECTOR; + bool prop_exists; + uint32_t prop_id; + + prop_exists = kmstest_get_property( + drm_fd, output->id, type, "power saving policy", + &prop_id, NULL, NULL); + + if (!prop_exists) + return -ENODEV; + + return drmModeObjectSetProperty(drm_fd, output->id, type, prop_id, policy); +} + +int clear_power_saving_policy(int drm_fd, igt_output_t *output) +{ + return toggle_power_saving_policy_prop(drm_fd, output, 0); +} + +int set_panel_power_saving_policy(int drm_fd, igt_output_t *output, uint64_t policy) +{ + return toggle_power_saving_policy_prop(drm_fd, output, policy); +} diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 01604dac9..129b88576 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -1223,4 +1223,10 @@ bool igt_check_output_is_dp_mst(igt_output_t *output); int igt_get_dp_mst_connector_id(igt_output_t *output); int get_num_scalers(int drm_fd, enum pipe pipe); +#define DRM_MODE_REQUIRE_COLOR_ACCURACY BIT(0) /* Compositor requires color accuracy */ +#define DRM_MODE_REQUIRE_LOW_LATENCY BIT(1) /* Compositor requires low latency */ + +int clear_power_saving_policy(int drm_fd, igt_output_t *output); +int set_panel_power_saving_policy(int drm_fd, igt_output_t *output, uint64_t policy); + #endif /* __IGT_KMS_H__ */ From patchwork Wed May 22 22:08:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13671140 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 29F50C25B7D for ; Wed, 22 May 2024 22:09:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C684810EE35; Wed, 22 May 2024 22:09:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="sLR3+Sag"; dkim-atps=neutral Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2087.outbound.protection.outlook.com [40.107.220.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41A4510EC59; Wed, 22 May 2024 22:09:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jlJhrnNimYux+bxnKSauylwxYksTjPsG2RMTACLEJ6blWFE10B06ScljB99qIMKCIUWu4du7SsBdkKMijKNHma9fFnn4vSItgeNR2Wug9e/usNbOvSoOAkAbT5kQop3x+qGQrPIWb+BvI/iFpUK5w7E8fUKz3iOe0fsysYFSYeqUN22ILfOYPNJx51ePXpOuTDpvF7dsNNPXNxH2+W2vd2tUpiSWa+3R5jCGtzkAcDybvwC9TYXJXJ4Zjo1Si+Nf4x9uDnkxidsZGFjFG/8L+4VL+PthARbBLkzm3a+lqIYAWmH1qVbC29hXVe3HikUo905fM3tNFnG2BdP7sRsk2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wjHZankrXsOb4Mrmxh40iDmZf7PJnyV2Xlb3To3csDU=; b=VCapy8+/CurtQwh0V5TW4o0xcss+gKxpMyfA4R6LhfRe/UytuXJ5WC1quCqjIYHotM/ogLbPQWwN4mf6hOGY72mATjp3cDUdFS0KBQzxIJUVaYQwKlN67SaTIPuhGLB0hhiRuljpLb3cRnD2dC2Fm5eoj/jI4FkwhkZ8ca7MGNgFpf+2eMOBsU046+hsTKx+w44wmBsLSUWVpKeNxephtPLhAbq/7xsvtT/BSmNtsy6uznEQ53hGUtJUkB9r708uFDdKnrRsJFQ0eh2zFzrmqKWGzlKQRzeONj9KVGEljxR68WzmDpzHKIW+W1ILXd5jAjHfYX+G6rbqzcfKUT/WBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wjHZankrXsOb4Mrmxh40iDmZf7PJnyV2Xlb3To3csDU=; b=sLR3+SagKcPsYiRwJlsYWmey9LBRQjGbmmOtcPl5puxQte6LGexOE0RShbR6gZWNnOL4GPxkRbCkbGwPOpaCH+6uigXbwZClCsNuo9dFXpGbfJ52fiu1JZQwv9Uvhywh49Tq3vU7ZXjky+dBgOHsGHt4r6thAVEWZ/REksiKgVI= Received: from LV3P220CA0018.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::19) by CH2PR12MB4054.namprd12.prod.outlook.com (2603:10b6:610:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Wed, 22 May 2024 22:09:15 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:408:234:cafe::59) by LV3P220CA0018.outlook.office365.com (2603:10b6:408:234::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.20 via Frontend Transport; Wed, 22 May 2024 22:09:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Wed, 22 May 2024 22:09:12 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 17:09:08 -0500 From: Mario Limonciello To: , Simon Ser CC: Harry Wentland , Xaver Hugl , , Leo Li , Sean Paul , Mario Limonciello , Mario Limonciello Subject: [PATCH v2 2/4] tests/amdgpu/amd_abm: Make set_abm_level return type int Date: Wed, 22 May 2024 17:08:47 -0500 Message-ID: <20240522220849.33343-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522220849.33343-1-mario.limonciello@amd.com> References: <20240522220849.33343-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|CH2PR12MB4054:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f0913a1-b2bb-4aba-0d22-08dc7aabcfc1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|36860700004|376005|82310400017; X-Microsoft-Antispam-Message-Info: pq217k0yRhT/3pEjwQGYX68BnC7BhnfNmkIfEvYhxpYW6cY64jptzYWNu0KCtJp0K2TKk6rb/XW1ev+BuZD9qNeeGU1B3iKFsD3RpNk+waYdiFieVWFVd8IW+krBCE0uqSz6/9QVIa1XCrVhU5CLqCFPp+cOZ2rJ6pcwbz0yvOCssgGkrbOGodRCSPL+bLSUVDMoy2g/WfT1f/76VwfBo9Z5hBaeIRgCXb0neiCJTYklIX12opnCdp0xFNkQIeUnEA3NqS6Z3lcg6e5EA6ueQ15GcA2yoRtcL90NfxCZccYBv4IBkttvO1JxcinTvwLFhaVbGEV4DSPwuXXnWDoeTKQJP/LWuumeeNwivMbuGiFJrRYwVVEhELHixa7PeUN05uU7YDAIRUjL781B//XBgfN1WFbsYJe3//lQdDaVY6jNUmR3j0u04ioZBnx2quNVVxWXnecgmR0/pDJ2q37eIPEcJBkekHRYjOvJ54VYsOYrI+aU9OvTIKJXxbYPyJScKCdcwFhaFIl85GfGjk/9CxmYHEtnB/JG7JlZKCCRYU+jNd2Y95E3pbKpquA/lcIGEjFyBcc80oVTda0j5xwzhH33saLnHCObyPNmC74OGmAqzNNSAY0dFnHhl4h7bsFP2A4yXURbcuRMAkRH+n07k9bP2YpSCVvEg3baoEXw0jQUEnoqCaSqGgBHEnUM5APayxX7cGQsapY/8tsCD+6paVCo74njTdMDbFxkIx8XbsHqnDvg4d8Kf+6G9+3rHH6Bjz2CY64YPeHTHX1qy83pezp3LQO3bmijhys3QK4toFtRljxUiy27F1AfEVGdUxnqrt4ekX+lN/Qijw1HS53ixEk6U29cuaE03ejZ7tZngScAxFOWlw0RikuAa/+3/3nVxw0e3EKYFnruSrx93vc6JHctdvnGHzQDcGv3s9BgdGFgbmNUmEUsAAgj+xTlzwFrjDMijT7hgQaVdO2rkz2ERj4TsTumunzHmEGJTKuWD4pVeubsMInB0JbAK+rYEEVEfont2W3X+Wqoncfy+Ik7GIPieKVN3tjN/+4o92g0obHPZ6y26w/TmXYeWbOJFhpR6yWTbNI/Ws5OLURpBSMfv2k13PV5kNsahj4SYK6LoWAfA/foN8U7lHu91kz8Ldp2Ea0GgMv7BwxAeyO0lD+i8gjjI2B1YBQYtWryOKeN9ud014AnQPtKwWEv2TKL//6iNMlgNnmzOQ3T7BDQcLDdiUWGjPsTVQSOvgy43RC1KGJb9LQ8v+P7Hih52ivnOpF9BOwDKYG3RjWl3jBrpEUJtNq9EQRv58MEL3JMfXVCxsC2RtyZv2XmWM661O3niZD8TnLD/PY+C5QcOblGb7qbZqGsDtTC8+yIGzGGcsb9TP7mTBuez+Jw6BDpMY41cDgm X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(36860700004)(376005)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 22:09:12.2987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f0913a1-b2bb-4aba-0d22-08dc7aabcfc1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4054 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Mario Limonciello In order to bubble of cases of expeted errors on set_abm_level() change the return type to int. Signed-off-by: Mario Limonciello --- tests/amdgpu/amd_abm.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/amdgpu/amd_abm.c b/tests/amdgpu/amd_abm.c index 2882c2c18..f74c3012c 100644 --- a/tests/amdgpu/amd_abm.c +++ b/tests/amdgpu/amd_abm.c @@ -104,10 +104,11 @@ static int backlight_write_brightness(int value) return 0; } -static void set_abm_level(data_t *data, igt_output_t *output, int level) +static int set_abm_level(data_t *data, igt_output_t *output, int level) { char buf[PATH_MAX]; int fd; + int ret; igt_assert(snprintf(buf, PATH_MAX, PANEL_POWER_SAVINGS_PATH, output->name) < PATH_MAX); @@ -116,8 +117,12 @@ static void set_abm_level(data_t *data, igt_output_t *output, int level) igt_assert(fd != -1); - igt_assert_eq(snprintf(buf, sizeof(buf), "%d", level), - write(fd, buf, 1)); + snprintf(buf, sizeof(buf), "%d", level); + ret = write(fd, buf, 1); + if (ret < 0) { + close(fd); + return ret; + } igt_assert_eq(close(fd), 0); @@ -129,6 +134,7 @@ static void set_abm_level(data_t *data, igt_output_t *output, int level) DRM_MODE_DPMS_OFF); kmstest_set_connector_dpms(data->drm_fd, output->config.connector, DRM_MODE_DPMS_ON); + return 0; } static int backlight_read_max_brightness(int *result) @@ -192,7 +198,8 @@ static void backlight_dpms_cycle(data_t *data) ret = backlight_read_max_brightness(&max_brightness); igt_assert_eq(ret, 0); - set_abm_level(data, output, 0); + ret = set_abm_level(data, output, 0); + igt_assert_eq(ret, 0); backlight_write_brightness(max_brightness / 2); usleep(100000); pwm_1 = read_target_backlight_pwm(data->drm_fd, output->name); @@ -223,7 +230,8 @@ static void backlight_monotonic_basic(data_t *data) brightness_step = max_brightness / 10; - set_abm_level(data, output, 0); + ret = set_abm_level(data, output, 0); + igt_assert_eq(ret, 0); backlight_write_brightness(max_brightness); usleep(100000); prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name); @@ -257,7 +265,8 @@ static void backlight_monotonic_abm(data_t *data) brightness_step = max_brightness / 10; for (i = 1; i < 5; i++) { - set_abm_level(data, output, 0); + ret = set_abm_level(data, output, 0); + igt_assert_eq(ret, 0); backlight_write_brightness(max_brightness); usleep(100000); prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name); @@ -289,14 +298,16 @@ static void abm_enabled(data_t *data) ret = backlight_read_max_brightness(&max_brightness); igt_assert_eq(ret, 0); - set_abm_level(data, output, 0); + ret = set_abm_level(data, output, 0); + igt_assert_eq(ret, 0); backlight_write_brightness(max_brightness); usleep(100000); prev_pwm = read_target_backlight_pwm(data->drm_fd, output->name); pwm_without_abm = prev_pwm; for (i = 1; i < 5; i++) { - set_abm_level(data, output, i); + ret = set_abm_level(data, output, i); + igt_assert_eq(ret, 0); usleep(100000); pwm = read_target_backlight_pwm(data->drm_fd, output->name); igt_assert(pwm <= prev_pwm); @@ -323,7 +334,8 @@ static void abm_gradual(data_t *data) igt_assert_eq(ret, 0); - set_abm_level(data, output, 0); + ret = set_abm_level(data, output, 0); + igt_assert_eq(ret, 0); backlight_write_brightness(max_brightness); sleep(convergence_delay); @@ -331,7 +343,8 @@ static void abm_gradual(data_t *data) curr = read_current_backlight_pwm(data->drm_fd, output->name); igt_assert_eq(prev_pwm, curr); - set_abm_level(data, output, 4); + ret = set_abm_level(data, output, 4); + igt_assert_eq(ret, 0); for (i = 0; i < 10; i++) { usleep(100000); pwm = read_current_backlight_pwm(data->drm_fd, output->name); From patchwork Wed May 22 22:08:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13671139 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 3E01AC25B7D for ; Wed, 22 May 2024 22:09:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F7AE10EB5D; Wed, 22 May 2024 22:09:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="QcDaentZ"; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2052.outbound.protection.outlook.com [40.107.237.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F92D10EA7B; Wed, 22 May 2024 22:09:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYQOxdwcnMgyUhIegsViKAbtBH7GMw1/LIyt9U1R8RW6c91UwTOrA+mVQ5WbsxU3ovXnHc1sZkhIZctov/jvUbXo0ubgxF13acA1Ov5IfevNgSHGXEULuu/qKpilROPEwnAFbPr21vNMGAxrzj/1p4hXuz1Fg/+aG1H8Vfs9upokuNvG7yNKtqRx2PJZzxUOH910pfg1W2JjfisHgDZbfhs3l+9R0h7YUj1k5pmpoSiXlotsaKGmIGjoZ3JOadogsP+PoPT9tkEu8H9ySbMn/Ajxgr0C42xbZVrISqDZbzwI8akdDGpozCAdF8i2W9svytMeYM9/A/pSHUUQGy9aeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AUuSy/hoy4tefE6/pkxEjstrWQoxdahMQjnaMyc12G0=; b=L6JQyyx/seP5FXMxpeqducNrFsaP3hi5d6yfyFmxz2ZO2ApeBkEyZPtF2w20gV3nktxXsR0x3x1aLtoPsgHLXqHDXAskkIZ1QKF0Q5bX7jZcGWkThgviHbLj75YMMff9v9kU+PkRstic+20yzL/O/l9+FTNYeNW1jl1FYwSQu700FBv6SZiPB6GsieP7wXLwqebIJhX+1Nw9c7EHuN8Lg8D9Mxbjf4Pao4Ig3hIMXOOwsgcGPavR8Cmryhah1TWot4/kI7+vm7IVFe4QQy0e7yn1dL15PY28/Pt8BXBKbmofrZPlSDW+2vcpT5OcT9jJRww1g+Lfsrxb2Z54oWhxBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AUuSy/hoy4tefE6/pkxEjstrWQoxdahMQjnaMyc12G0=; b=QcDaentZS1vnGY2jEDEpNn6yqju9NNxDHTLyQEIKMydbXZjwmBg+6uIFaeQZTPcGgWj6zTix3JTzlyp7velGGr3V2KzNQWCijE/nkIe7IUJgzEnmlvyjEhqTsMx+oCvAuZo3C5mOYfcNLFmFSGqwCiN0uYlCjSUXnmub2myXTwo= Received: from LV3P220CA0015.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::25) by BL1PR12MB5851.namprd12.prod.outlook.com (2603:10b6:208:396::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.19; Wed, 22 May 2024 22:09:15 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:408:234:cafe::b2) by LV3P220CA0015.outlook.office365.com (2603:10b6:408:234::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.21 via Frontend Transport; Wed, 22 May 2024 22:09:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Wed, 22 May 2024 22:09:15 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 17:09:09 -0500 From: Mario Limonciello To: , Simon Ser CC: Harry Wentland , Xaver Hugl , , Leo Li , Sean Paul , Mario Limonciello , Mario Limonciello Subject: [PATCH v2 3/4] tests/amdgpu/amd_abm: Add support for panel_power_saving property Date: Wed, 22 May 2024 17:08:48 -0500 Message-ID: <20240522220849.33343-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522220849.33343-1-mario.limonciello@amd.com> References: <20240522220849.33343-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|BL1PR12MB5851:EE_ X-MS-Office365-Filtering-Correlation-Id: b98949c6-37e0-4190-7f93-08dc7aabd1ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|1800799015|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: uBZkdq0BFHzFmM/5EeBY+kkfCEnRH6XKEa8E+hTWbBAg1JEliPqSz6GcTlhw8/UD/kMbd1WjsE9/enGSX7RTslzC+y2UoJltHHB3X2wkHN2nPjTrn8oIGvYu1LJtdPJ9E3g2xXv5CuzctMDSIpKSDTWMiWj4rlQl7irKIEBK3T/bTEi6prjJ6MaL+5dsfEcn0NqGkHGNOBaEh+my/ehFgSjl1kYuYu5OQhZX/9ct9apH4HqSTnzdvi/U/WIFwN0hwqT3YRCxOkBDcjzfBGHPhFh6lU4KEN5jkaQ3tDNF1Tw4h/y0VVIr3TK4qki4UP8af+hbJDb9HOLQ1P3VqphnrfW5nDmrZ6vcvLhas70LuUxXaDt7kuxdmYEUZq+wRBK14Yyi7TPMfWXXzSGEloHKi/dd5LpUiidJmYQhFwiKcKILw74rwEKDpWo/W8fFrdoY98GWcevhsc7cRY6BQ2NcQyHTqs82QLQTuGOT/0GvV9WvE7K+xdQs7QlGlQB7pAmSwADCKXbVqAQoLzPBwKs2EhsvmMaH0VZXIh9Mp7Aa6em2e8O9ywFgGipqqDQWXm6zkZCn11OOHm2YWflazTUXKQwCCHR+D6RnUfKuD65yFlOX2dQ/76G0xBrzYA4P1hrZIXzuvL/l0BwFLm0CphEV/MghS6R2gatrandUOgM24C2mJcfK4Ym2krxspNl19V3/OxoMInSCr+rrozvWADnLhNmeMlLV5Mgj8nqDJILHQIrXPJ/2NnCxWi943oFTAzXJhoXIzHl9/MXt5Zt6TS9+GZdnpebJX087ahW+txH8CHZQxXdarrGDTg/E+QOMnFq91QN7CiGEP+u+7miKbkeSFjnBkGEpGzrczm6lxmgvqxrSm1ScvT+huLc78YcRWSKfY8QtzZdd+wTeO3+Z1WTRQ5l06TZUp8HJhwlqvcdy2eXjn2Tu8oXxWJqV4VuYn5VVJvzym2tEG0D5QlTym4ieA6hBFiuqNILIlkKbcRPnGuQ+rLmKiSuSQVppAOL71MSNrPr2Vn6RE6MMomTLD9NL2LU7l6O6s7FW4KTSIFNVx8NujcCLJBJhnPvsiFxDAmJpnhDRUpFfwYMFQSkb9iUP0OiD5Mimiv3IPKj7JBRN1DTV7tdGdwNxw5qMNzs7lh46OsEehFo6swQ0t9Y2etzaMSCp4KW9waufsCGjnnlpkSc2QuBILKDu3E85RtzYpjKUUeuN88GN5z9KkF9dUgpMsed7Is+GjT83Ueoo4X5zBceBefaVLQSr8QbRGSE9jPXl5VqenU14eAae5A/2nB85Wqh0okiZ/4OAM3idhCnRlBgaosBHrxBGA8z9flaVbBK4L2uvPtZxHR//Qxqjp4j4Md4hYh5YiyeWyF6F0jRdkKs= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(376005)(1800799015)(82310400017)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 22:09:15.6112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b98949c6-37e0-4190-7f93-08dc7aabd1ba X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5851 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Mario Limonciello When the "panel power saving" property is set to forbidden the compositor has indicated that userspace prefers to have color accuracy and fidelity instead of power saving. Verify that the sysfs file behaves as expected in this situation. Signed-off-by: Mario Limonciello --- tests/amdgpu/amd_abm.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/amdgpu/amd_abm.c b/tests/amdgpu/amd_abm.c index f74c3012c..3fa1366fa 100644 --- a/tests/amdgpu/amd_abm.c +++ b/tests/amdgpu/amd_abm.c @@ -365,6 +365,43 @@ static void abm_gradual(data_t *data) } } + +static void abm_forbidden(data_t *data) +{ + igt_output_t *output; + enum pipe pipe; + int target, r; + + for_each_pipe_with_valid_output(&data->display, pipe, output) { + if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + + r = clear_power_saving_policy(data->drm_fd, output); + if (r == -ENODEV) { + igt_skip("No power saving policy prop\n"); + return; + } + igt_assert_eq(r, 0); + + target = 3; + r = set_abm_level(data, output, target); + igt_assert_eq(r, 0); + + r = set_panel_power_saving_policy(data->drm_fd, output, DRM_MODE_REQUIRE_COLOR_ACCURACY); + igt_assert_eq(r, 0); + + target = 0; + r = set_abm_level(data, output, target); + igt_assert_eq(r, -1); + + r = clear_power_saving_policy(data->drm_fd, output); + igt_assert_eq(r, 0); + + r = set_abm_level(data, output, target); + igt_assert_eq(r, 0); + } +} + igt_main { data_t data = {}; @@ -393,6 +430,8 @@ igt_main abm_enabled(&data); igt_subtest("abm_gradual") abm_gradual(&data); + igt_subtest("abm_forbidden") + abm_forbidden(&data); igt_fixture { igt_display_fini(&data.display); From patchwork Wed May 22 22:08:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13671141 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 13DD4C25B78 for ; Wed, 22 May 2024 22:09:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05DA510EF0D; Wed, 22 May 2024 22:09:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="xJuArExu"; dkim-atps=neutral Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCEAB10EB5D; Wed, 22 May 2024 22:09:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CctIkchQS0zOt/+RMGDjTVtab5MtABwH+ZkXiPe8qwfm0zyE7bKZap2wTSmLnYkZGGLUIobxK5O/9BCyPV2Gh0O203WWW220fPDNp2cNhEOTD0kSbuVzGAwjQpXQx3HBh8fNo0H0CbGS3JJHvw+ldIMu2HYR6VQ+pGLrR66/GN44bv6xM8UWUC6PjLDzh2gCEUOEi8vZIarh42pR9FVWGLkaxdJ104L8syLmyuZfINHfR2HfgdJeeqgnEc4WkYvhAndqFbUB9duBnvrUo0ATzuVFOyJoWEjDtlxfPsZ+cBV2HT7XogPFDq2xrybMN3WNNlwAvDHE1JUPfD/PmO0DFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W5t5nnJXOIJS97m8Vz+8mkhhPiUJyV4OYIgNCKCDOlI=; b=FhUrUquz2BfMhLL8JDSzy5FolHYdR9fw6jrOYtJNztrKGuk4GIZJdRsvYoIE6Q6e7t44eCABzgvm2oWc4o5+2/hrybbhKsPnpOmHiV90Nf2iGr4LhgRpbkcrmMfRpwzWW7Z4ZmI9awxRLFAmi5mDdw3CrGDhc/qZ8CrcEwMGBmMlLdoSEIafsRYKVgGnT5SChoZmYlgcPoTRLw0NAyAj1Ip0brDWQBJj6ccKo0kSp4Z5h08tENpVCwS6pqIfaFgxUPrZnO+BIf5LkdgITN07EZUpynITkKqaiiWGtN1HFxeISCKLM/YAkjqUguZRwZrPmq9KBJucg9Eda6p09qAPsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W5t5nnJXOIJS97m8Vz+8mkhhPiUJyV4OYIgNCKCDOlI=; b=xJuArExuK9pV7HZ943qYwxc7Ma1uOkzEWKti4gpRdyLevEFzvvWl4ZTu56SEPVZYwP2TL7JTz6m7PZ7cBpLDslm58EtVkTRySlbbLaOKhzBmBQBxwU/gJxb48q1Bq0O4KsG/JhSNbjIeuQOhgbNRgelGDGqHNDNuMzD6c7JPJDg= Received: from LV3P220CA0014.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::14) by SN7PR12MB8818.namprd12.prod.outlook.com (2603:10b6:806:34b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.19; Wed, 22 May 2024 22:09:16 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:408:234:cafe::e) by LV3P220CA0014.outlook.office365.com (2603:10b6:408:234::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.20 via Frontend Transport; Wed, 22 May 2024 22:09:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Wed, 22 May 2024 22:09:16 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 17:09:10 -0500 From: Mario Limonciello To: , Simon Ser CC: Harry Wentland , Xaver Hugl , , Leo Li , Sean Paul , Mario Limonciello Subject: [PATCH v2 4/4] tests/amdgpu/amd_psr: Add support for `power saving policy` property Date: Wed, 22 May 2024 17:08:49 -0500 Message-ID: <20240522220849.33343-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522220849.33343-1-mario.limonciello@amd.com> References: <20240522220849.33343-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|SN7PR12MB8818:EE_ X-MS-Office365-Filtering-Correlation-Id: 57c53f9b-5b5e-4a8a-df32-08dc7aabd1fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info: HVDdK0XTbiEdqPpZgJJIfg+26eB7S7phxK6iITE6flu/Bx1T4hsGIcoXh78frWrnLqqCZP2KktiHMiZYjowpGtpXhdtNA2E5k7A8XVy5qfEzc/AJFSOLWAby50pdxxIZaakorJoiOsBKnUvOSy5Yaynv5pPz5atd+MuofmGo+3ert9g+C+pV73vZbI+k1KA//f9gO+wQuHM53smQiBF8kAql1QuZY0rsB4S5NBhKEivqc+gKuGll7ywG8c4qwtPR3BCsPUcpejF1h3M3P6bwT5NgJbeEHLnwKLLfEWzEl8Rw3u569mnDa7S1jFzywKAnByORKztfpsotHqUiWHW5d3QVn3c6Qdufq3WB+Qb2MW7smq6TzcNghGCHciH87Iqv+dOqJQwr6YC2bX77oSAQTsgWI2lldXJvOcJ2dlvcDF0T3dz43pHqAcMeWAIcbuRD4J0sN9Ap9n6CV4Ib3lZn9IJRSfOge5QOCydvRjL1Po/CFm8OXwKOsmdPTeTbJaYXhteuDXln2Ja3Wl0L61NO7p/z47LKYYiVPnIr/IFwoNiR+tRetwKMXFADvyRby0YVSD6qMVIhvrv8/4RgdlRGCciRpL+YNgqARYoLz8EjtkPCLqL34SZNe1GWNY/zjWz7cw4xtrVU01+XRRZ3/CFjcC+N9jo8PI2WA1n6Dey9Cn2PRvmB4l1l0T/XtLEgHxHZQfadAMShuWENTL+8tPcFpql9SDO0LUcKcAEvsYEZgs1sFWSoIkst7wi+LeXVz1SJQHCLVJL4Nme0/98Uk8k97b9M3VvO79XElc5fZM6400MH0rr2sQpXgbyuBiuNho6WVastEMm8M2zP4+hH1C9l4MYfedq11Tu6c+WBrywuELig7ciU384Qi2DLn5tbh64lB4IMOYRJd6yegvcs6geRPOFGOEAAP1GC8Wjf/KIzqM4h6blyFykdFYSoWBry4xbrq9M+h5L9o/O5BkFw9N1L8FF/9WyDdlAfhU+eOD8dfNeo4h/FbjKmrOH7rbrz2kg0NyYops3p5UT6PZepkMNjfe18exzaFj1LuHsF6wpofNBkgShh5q17NUF7I80RpH5VJOYyrIzbsHdNK+Dk2odfmSjMBmcdRXFunO9n0BIn5kSXMgfcYjxGv+vjGtK8ajXe4sVKW7wUvIE3Mx+Us4iKYGtqudDNZh8hvJhY7lmjCHYTAH2QZDO2OI3GlD4XZSITB00doh7b4wzAnL0/u6jfrV6i+PbvjUoVPAB0WcaQd3uVclUHEeaJvzfRFAoN+eoECgirqOWxN3PtPOB4l8hvPI9Wz0aoptgQXsf1/XHiqONEsfnDe2OtYU+GngItHRuVi6zZVvU92ZaWPeJv2I0I2uJZN6Uo4twxP3ycbrEdPs1HrHfOQ8OtSjKK0vh7AfZU X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(82310400017)(1800799015)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 22:09:16.0330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57c53f9b-5b5e-4a8a-df32-08dc7aabd1fa X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8818 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Verify that the property has disabled PSR --- tests/amdgpu/amd_psr.c | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c index 9da161a09..a9f4a6aa5 100644 --- a/tests/amdgpu/amd_psr.c +++ b/tests/amdgpu/amd_psr.c @@ -338,6 +338,78 @@ static void run_check_psr(data_t *data, bool test_null_crtc) { test_fini(data); } +static void psr_forbidden(data_t *data) +{ + int edp_idx, ret, i, psr_state; + igt_fb_t ref_fb, ref_fb2; + igt_fb_t *flip_fb; + igt_output_t *output; + + test_init(data); + + edp_idx = check_conn_type(data, DRM_MODE_CONNECTOR_eDP); + igt_skip_on_f(edp_idx == -1, "no eDP connector found\n"); + + /* check if eDP support PSR1, PSR-SU. + */ + igt_skip_on(!psr_mode_supported(data, PSR_MODE_1) && !psr_mode_supported(data, PSR_MODE_2)); + for_each_connected_output(&data->display, output) { + + if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + ret = clear_power_saving_policy(data->fd, output); + if (ret == -ENODEV) { + igt_skip("No power saving policy prop\n"); + return; + } + igt_require(ret == 0); + + /* try to engage PSR */ + ret = set_panel_power_saving_policy(data->fd, output, DRM_MODE_REQUIRE_LOW_LATENCY); + igt_assert_eq(ret, 0); + + igt_create_color_fb(data->fd, data->mode->hdisplay, + data->mode->vdisplay, DRM_FORMAT_XRGB8888, 0, 1.0, + 0.0, 0.0, &ref_fb); + igt_create_color_fb(data->fd, data->mode->hdisplay, + data->mode->vdisplay, DRM_FORMAT_XRGB8888, 0, 0.0, + 1.0, 0.0, &ref_fb2); + + igt_plane_set_fb(data->primary, &ref_fb); + + igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0); + + for (i = 0; i < N_FLIPS; i++) { + if (i % 2 == 0) + flip_fb = &ref_fb2; + else + flip_fb = &ref_fb; + + ret = drmModePageFlip(data->fd, output->config.crtc->crtc_id, + flip_fb->fb_id, DRM_MODE_PAGE_FLIP_EVENT, NULL); + igt_require(ret == 0); + kmstest_wait_for_pageflip(data->fd); + } + + /* PSR state takes some time to settle its value on static screen */ + sleep(PSR_SETTLE_DELAY); + + psr_state = igt_amd_read_psr_state(data->fd, output->name); + igt_require(psr_state == PSR_STATE3); + + igt_remove_fb(data->fd, &ref_fb); + igt_remove_fb(data->fd, &ref_fb2); + + ret = clear_power_saving_policy(data->fd, output); + if (ret == -ENODEV) { + igt_skip("No power saving policy prop\n"); + return; + } + igt_require(ret == 0); + + } +} + static void run_check_psr_su_mpo(data_t *data, bool scaling, float scaling_ratio) { int edp_idx = check_conn_type(data, DRM_MODE_CONNECTOR_eDP); @@ -756,6 +828,8 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_describe("Test to validate PSR SU enablement with Visual Confirm " "and to validate PSR SU disable/re-enable w/ primary scaling ratio 0.75"); igt_subtest("psr_su_mpo_scaling_0_75") run_check_psr_su_mpo(&data, true, .75); + igt_describe("Test whether PSR can be forbidden"); + igt_subtest("psr_forbidden") psr_forbidden(&data); igt_fixture {