From patchwork Tue Jan 19 15:50:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aurabindo Pillai X-Patchwork-Id: 12030213 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 A63DDC433E0 for ; Tue, 19 Jan 2021 15:50:46 +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 4C2D620771 for ; Tue, 19 Jan 2021 15:50:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C2D620771 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 6ED4C6E2D7; Tue, 19 Jan 2021 15:50:45 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2040.outbound.protection.outlook.com [40.107.237.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5408C6E2D7; Tue, 19 Jan 2021 15:50:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i4bmy6Ms4idFeBQqHjHrwCZ90SF+vn9fqyW8JV/UQpgsqNH+CKIjv8AJ6ztEnDFZnQTOSHfbw6Ap1SQlqwbFMpT7ATCa5k/WSuIc3pDkDsiSA2iLMxSPZGkZ+IxGEa0Zxljr6OLnRjaHm8sepq9qi7udW3V31edB/fjtThvQceDZ/M/wq2IPAnkkjcOpd1c6tZP7ffXUrstVvNSur3soI/0FtrK6yB+vA5gV/2M1+zHX+/nCb+2rKPl0ZLvWuCtH07rix2OPSFU4M2oCY+ddNbONkIjFxCMqCHUYBFbKGADZm8zymou2kRoQpoeIfwYPA0o2ZpM71hLdUB+vkG7yIw== 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=LvRY18pXv0wKjYkKKZKb8hLotSimHDLicixLefdIhoI=; b=EV+d1aqJuq4phVAMgBdaTU2BjWuVIcKctnmsgNqtJdfQN2Hsp2Hk2T4abvf2Y+jODkvawf9rQIZvHibqo9zedOJoswPmNvAJ6xB5rIx/dDWziz7AvPwRGHYFOXRGRyJq5Qg4LJp5I0EeXosSkzShIFQnKqig/q3D1BHqaF2h03kLLtioQpjtPtpUJOvYDHCxMHWnKYso+DGVKagepEXO84CrjBHWygE1twtjoTv0VwjToiHw0hTor5HSLvmkFkA0602tkeVGLuQ2BVJ22R6sdP2/G4c24VyR9nKznpKJMPTEQ+ZCISS3RgKyN/Mg4NvH4kLOurlxrGtKJGiSHxwJnw== 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=LvRY18pXv0wKjYkKKZKb8hLotSimHDLicixLefdIhoI=; b=ArHUOTKQONYDT0nQPGvSxqi6GxiYQrebzpOHFURQ2rcOa6CPPlvrBAK8CINCHw5SK8Hd69dZEwkOcNhuxC8Xje3LUIewq2d2HJqpA9K5fCfmcGymWP4I82zI1RPM0yvsC13hBuILS0DgIo5QotSdp6R+PQflM+LK/2Her/BH4Nw= Received: from DM3PR12CA0097.namprd12.prod.outlook.com (2603:10b6:0:55::17) by BN6PR1201MB2513.namprd12.prod.outlook.com (2603:10b6:404:ae::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9; Tue, 19 Jan 2021 15:50:40 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:0:55:cafe::d1) by DM3PR12CA0097.outlook.office365.com (2603:10b6:0:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Tue, 19 Jan 2021 15:50: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 DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3763.12 via Frontend Transport; Tue, 19 Jan 2021 15:50:38 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Tue, 19 Jan 2021 09:50:36 -0600 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 19 Jan 2021 09:50:36 -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; Tue, 19 Jan 2021 09:50:35 -0600 From: Aurabindo Pillai To: , Subject: [PATCH 1/3] drm/amd/display: Add module parameter for freesync video mode Date: Tue, 19 Jan 2021 10:50:27 -0500 Message-ID: <20210119155029.18943-2-aurabindo.pillai@amd.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210119155029.18943-1-aurabindo.pillai@amd.com> References: <20210119155029.18943-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: 052c63ea-1af4-4415-2afc-08d8bc91f7f1 X-MS-TrafficTypeDiagnostic: BN6PR1201MB2513: 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: GG/GR7W+7F9HSSeXcdySlcFeIjyBYRjzkvAQnTWAUOSDVGwLKtSbrXoE+Qax/Sj0XN5CF0xQiciepJmg+QKM3RISVyDd+dhQM8FkdzgGk+5+Gsl5hYgCEUUx768kG/IAYHGujPa/sBEqROwFZ5jtPVGZ9gF6v+D1uZ1Vf+dTtuvHyMKyJ7sVfpTRvVb8cmqHzyy338YSW6ewLTn1Au3jpgZCV1DZCu+puuQ4aESP9rNM3qol/qVeK928H4fmt1WoY5+4fnDQf6QUJ+aBidSIAVltU+3k10EHotruWYsV8AYk2TxCi1q0PjTciQ0Jz5DYBAiMpBJU0K06+MmW4fpYMDIrIIpFhcGEXx9QfR5M56kP8qyTWmQaWxRO3OlN7vq8NMiZKa5Kzyk2ppMt70zO1+nD/gAQPH/g79sQ82s0femWveZOqfDIGosQCvf2Uu8C6roz6aNJM9vtYHvnQahvuw== 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)(376002)(136003)(39860400002)(346002)(396003)(46966006)(86362001)(6666004)(356005)(5660300002)(336012)(1076003)(4326008)(70586007)(36756003)(7696005)(44832011)(83380400001)(47076005)(478600001)(186003)(26005)(2906002)(2616005)(316002)(426003)(8936002)(82740400003)(66574015)(81166007)(110136005)(8676002)(70206006)(82310400003)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2021 15:50:38.7933 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 052c63ea-1af4-4415-2afc-08d8bc91f7f1 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: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2513 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, thong.thai@amd.com, christian.koenig@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. 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 100a431f0792..770e42fcaa62 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -177,6 +177,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 b48d7a3c2a11..5c6dc8362e6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -158,6 +158,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; @@ -786,6 +787,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)