From patchwork Sat Feb 13 01:08:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aurabindo Pillai X-Patchwork-Id: 12086485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 066AEC433E0 for ; Sat, 13 Feb 2021 01:08:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BC35764DF2 for ; Sat, 13 Feb 2021 01:08:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC35764DF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41D8D6F3E2; Sat, 13 Feb 2021 01:08:45 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A19E6F3D8; Sat, 13 Feb 2021 01:08:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzPg+NaL8Bv5mXIZrDyYKaxpgrFZC2dN5Nzwu56DJ2xQcyQM4q3dapUt/cwVKb9MpRwkTm/4yQFZxzLimZEvVdYtN92B3nHucWC0Um6ia9iYtJDroE2W/+IPQgyaCeOK3srM87a9uciGawM9RBSUfOwYKebuYCLuTJiAPsjTt5dNFNMTx5S6PlqIdCLgjrfmUqa2hgsRi6pyLstI5TPKGf48EshjWbNI1IvN4r+s4JNaKOp6jD/u7D30YWbOM5SGHmH0A+oSW2t1yhEC2UWv8igUrQX+22WFr2ZvV4cPATK49RsPsEngqqd3ol5tYogAGUJNe1Y6jZ7fKmyAZzQugw== 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-SenderADCheck; bh=m4k4Sep0rG3+wmMRLqnKzlRFC0GiucToCiNrIB639l8=; b=RKPxAg7ihjFK+cVYKLf4AzyA9T4eM1l473yt1NkF6dtH/QX+VKEppw0qSi0dFtDEFtDTrSxLOsGi03iUzdov6Xcfg1oQur031vY7OTNZGKBP+FKKrg351lRscKlBq/QcGnfGdPIOob3USvoN8LCjWygTM2ptZ03ZK8M1Jql7osdlbv6kdV5hS5Gk/Ro62NEL30SMtIYWyNg55GgAdkCXbVCcgoHBFjQ1LxB0E4wp0DfYoDWwGQGLL0yIiAccQh4vUmtTg5xX2rxf5llCzCfRuWXFabpob4zrMlDyM72PfrvWxUzzbU0kFVQye/oc5RaCm540J1PI/zLTREV9StmimA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none 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=m4k4Sep0rG3+wmMRLqnKzlRFC0GiucToCiNrIB639l8=; b=fD1Jemaw0jgEiG+HP+/6HgmvkHJZuFyi+zgzwg173tVv1CnToILtnFmHyuetsX1H3BPaYyDyQOAFBBcPRr5lPr05mx536cYb95vpiSgU672P/qAhqXJNB1YRUf4dqqRcqOzflzfVdooFNOaYG6OE4FokX/f3LNTbO7wAptpa9DM= Received: from DM5PR13CA0016.namprd13.prod.outlook.com (2603:10b6:3:23::26) by BN7PR12MB2691.namprd12.prod.outlook.com (2603:10b6:408:26::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Sat, 13 Feb 2021 01:08:40 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:3:23:cafe::75) by DM5PR13CA0016.outlook.office365.com (2603:10b6:3:23::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.12 via Frontend Transport; Sat, 13 Feb 2021 01:08:40 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=fail action=none header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 165.204.84.17 as permitted sender) Received: from SATLEXMB01.amd.com (165.204.84.17) by DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3846.25 via Frontend Transport; Sat, 13 Feb 2021 01:08:38 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 12 Feb 2021 19:08:37 -0600 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 12 Feb 2021 19:08:37 -0600 Received: from elite-desk-aura.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 12 Feb 2021 19:08:36 -0600 From: Aurabindo Pillai To: , Subject: [PATCH v6 1/3] drm/amd/display: Add module parameter for freesync video mode Date: Fri, 12 Feb 2021 20:08:25 -0500 Message-ID: <20210213010827.261272-2-aurabindo.pillai@amd.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210213010827.261272-1-aurabindo.pillai@amd.com> References: <20210213010827.261272-1-aurabindo.pillai@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e87c4b23-2cb0-4715-b978-08d8cfbbe54c X-MS-TrafficTypeDiagnostic: BN7PR12MB2691: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 79df3jQRX5BjWGlv15uRhX449Prn/WDAiQUrbStlptx84mQLLZwVEZsPmD+beDlEG//tuH2ELSROZDrlyVKzN1mCcQ2OTvCTk5AY9ikuJmasrbgSaQsBRqPViF5n8VeswgQ18C2hSoXU1za8/HZtv46BtRufPtpdlLIcV7XdeVnmHeXFYRb0OzVJkbVV2a/Xa+GEkC0gDDXYLhDWo/JB9Yn6EjD5tq/PoqkDnUwiwmUljABa3DA01uHEe5C7spmO7QTGJ6Ozr1O8YauJYyK/9LH5E6MIAVtm1BBaz+G1fg1G0oO1dw7jyfOfFbfAY71GLTlM2f9HQSebfLX0FuNL2r+dISuqCAEdejrAmTSyrwppxuIjcg3H6cjNyGwqsNPbEBNU15j1+n9rS+8j5bM4fSJ04XmNsAGhYtXnxnIzz8AxNtGOu1xLQKjBfSCnE5MEprUK+JDMdX+2/Z/JZRLpDhHQlAIq2DHhBG8Q2zrgJIQityaWcq6EmsIATSDCaJnE5vrAXEmzE/LvTB46jtbjmJ4jwNvx3WrDvmGqJJTBl8CdCatjRnfP86MKCRzkaZ/Rt2+nLcppNQ7UUyxaW1h4L2Qo930ae2DFtH+t0Vttt7jhEs5hMWRM3DHAy4C3fxnnGuAGgmLi+VPK8b5EKd+hxBYBZiaceOmM3aewzhuSJ55s1WQch4o2uRaaJk26+vlg X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:ErrorRetry; CAT:NONE; SFS:(4636009)(39860400002)(346002)(136003)(376002)(396003)(36840700001)(46966006)(1076003)(426003)(82310400003)(81166007)(86362001)(26005)(356005)(66574015)(2906002)(478600001)(36756003)(36860700001)(54906003)(186003)(44832011)(83380400001)(4326008)(450100002)(82740400003)(316002)(5660300002)(6666004)(70206006)(8676002)(47076005)(7696005)(8936002)(2616005)(110136005)(336012)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2021 01:08:38.4730 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e87c4b23-2cb0-4715-b978-08d8cfbbe54c 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2691 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: , Cc: stylon.wang@amd.com, shashank.sharma@amd.com, aurabindo.pillai@amd.com, wayne.lin@amd.com, alexander.deucher@amd.com, nicholas.kazlauskas@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [Why] This option shall be opt-in by default since it is a temporary solution until long term solution is agreed upon which may require userspace interface changes. This feature give the user a seamless experience when freesync aware programs (media players for instance) switches to a compatible freesync mode when playing videos. Enabling this feature also have the potential side effect of causing higher power consumption due to running a mode with lower resolution and base clock frequency with the highest base clock supported on the monitor as per its advertised modes. There has been precedent of manufacturing modes in the kernel. In AMDGPU, the existing usage are for common modes and scaling modes. Other driver have a similar approach as well. [How] Adds a module parameter to enable freesync video mode modeset optimization. Enabling this mode allows the driver to skip a full modeset when a freesync compatible mode is requested by the userspace. This parameter will also add some additional modes that are within the connected monitor's VRR range corresponding to common video modes, which media players can use for a seamless experience while making use of freesync. Signed-off-by: Aurabindo Pillai Acked-by: Christian König Reviewed-by: Shashank Sharma --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index e3d4d2dcb3a0..e242b7607dca 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -179,6 +179,7 @@ extern int amdgpu_gpu_recovery; extern int amdgpu_emu_mode; extern uint amdgpu_smu_memory_pool_size; extern uint amdgpu_dc_feature_mask; +extern uint amdgpu_freesync_vid_mode; extern uint amdgpu_dc_debug_mask; extern uint amdgpu_dm_abm_level; extern struct amdgpu_mgpu_info mgpu_info; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b7ee587484b2..aefbe14c30fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -162,6 +162,7 @@ int amdgpu_mes; int amdgpu_noretry = -1; int amdgpu_force_asic_type = -1; int amdgpu_tmz; +uint amdgpu_freesync_vid_mode; int amdgpu_reset_method = -1; /* auto */ int amdgpu_num_kcq = -1; @@ -790,6 +791,17 @@ module_param_named(abmlevel, amdgpu_dm_abm_level, uint, 0444); MODULE_PARM_DESC(tmz, "Enable TMZ feature (-1 = auto, 0 = off (default), 1 = on)"); module_param_named(tmz, amdgpu_tmz, int, 0444); +/** + * DOC: freesync_video (uint) + * Enabled the optimization to adjust front porch timing to achieve seamless mode change experience + * when setting a freesync supported mode for which full modeset is not needed. + * The default value: 0 (off). + */ +MODULE_PARM_DESC( + freesync_video, + "Enable freesync modesetting optimization feature (0 = off (default), 1 = on)"); +module_param_named(freesync_video, amdgpu_freesync_vid_mode, uint, 0444); + /** * DOC: reset_method (int) * GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco, 5 = pci)