From patchwork Tue Sep 11 16:13:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10595853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF52C14BD for ; Tue, 11 Sep 2018 16:15:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD3D129983 for ; Tue, 11 Sep 2018 16:15:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B10D9299DA; Tue, 11 Sep 2018 16:15:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5123629983 for ; Tue, 11 Sep 2018 16:15:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7C2E890C2; Tue, 11 Sep 2018 16:15:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0053.outbound.protection.outlook.com [104.47.34.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9518A890C2; Tue, 11 Sep 2018 16:15:29 +0000 (UTC) Received: from SN1PR12CA0066.namprd12.prod.outlook.com (2603:10b6:802:20::37) by DM3PR12MB0745.namprd12.prod.outlook.com (2a01:111:e400:5984::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Tue, 11 Sep 2018 16:15:27 +0000 Received: from CO1NAM03FT063.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by SN1PR12CA0066.outlook.office365.com (2603:10b6:802:20::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.18 via Frontend Transport; Tue, 11 Sep 2018 16:15:26 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT063.mail.protection.outlook.com (10.152.81.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1143.11 via Frontend Transport; Tue, 11 Sep 2018 16:15:25 +0000 Received: from kazbox.amd.com (10.180.168.240) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Tue, 11 Sep 2018 11:15:24 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH 5/9] drm/amdgpu/display: add freesync drm properties Date: Tue, 11 Sep 2018 12:13:29 -0400 Message-ID: <20180911161333.5334-6-nicholas.kazlauskas@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180911161333.5334-1-nicholas.kazlauskas@amd.com> References: <20180911161333.5334-1-nicholas.kazlauskas@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(2970300002)(428003)(189003)(199004)(47776003)(81156014)(316002)(16586007)(478600001)(105586002)(104016004)(6346003)(54906003)(2906002)(68736007)(106466001)(110136005)(476003)(2616005)(50466002)(50226002)(5024004)(48376002)(11346002)(8676002)(53416004)(426003)(86362001)(8936002)(36756003)(26005)(126002)(5660300001)(356003)(97736004)(76176011)(1076002)(186003)(486006)(81166006)(77096007)(44832011)(446003)(53936002)(336012)(7696005)(305945005)(72206003)(4326008)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0745; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:3; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT063; 1:ecXyOVcq+CwenpFq4YNPsywmiFi5U3Pr4rPIz8pIeakKt6NM+uUouZwfKunyJqfZ6nANemP16eMX3OBQaqvcrKu5oAVMqTJ6S6U8B6h24HZBnbTa/ivbHU9ukjgkP2Id X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b730e493-6291-48d5-e27c-08d61801c857 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:DM3PR12MB0745; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0745; 3:6B/Uf93z0FIrXoudsbNa/sVAaA8Ddq+pck6B9NGU7zbYP3nLyMO9eMvJTwL8axt5c/wBl0mfoPlOyLebMF4P+SxGiWlGY5ALrS3ABs5Vw3UQ/AFmnoPuahbeQT4lKzdYz4fY69fZ8ZMB4461SU3yfX1uLEg64ivs8cvp8G6PR74CkOhCXAbSXogSlqy6J5k/iIWuOehwY3DfqB40mn9JFm6bkTt/WBnu/BHTe7a39t/kWsC/+YxJL5/jCQFOJFtdvbTJGDq399bcDuq/jh+hLhQB/AEwX+NUZOMHawnnZ7bIJL936YszQJGSDSSLPjNcdSJ+IMgxFHnAM3rCrm5avzT12S90J4pq5qOfHjDGfy8=; 25:gfe2DbXzJQxhGt16ORnfEErg7OqBQS5X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Q+Mqv+OLdWNsdnfmcgRRnfrV/tC3V/ZsDdK1T/7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231344)(944501410)(52105095)(3002001)(93006095)(93003095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699050); SRVR:DM3PR12MB0745; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0745; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0745; 4:TrM195uCAF9N3j2xem7W2DcxcuNn9CLLqHVT13MVenRrPwcqNTuPQ/m8JAQn0y53f9yypIYVPEiQjHQotnbwBbOd8/mNG92Bh7dyy6JvU/fKPVviqQRPrpmOBPoU8mQ3XW2LYEM3gLdiCmN4mlBvG+S0HSFEBwhmymHQYEy9tHtD5hQAvQH9hijH4qKkOXGMGLlg/BYIVbYSUyMAu3Eo+VkvJCCbVPuhnGJm7c8EB9y8fu4j8GFOzE0kW4jHpVq0UX51WO0ltroQodP5HfHRlRjDY/TCUucWhTzAN+JOdMTcxxMTfHw4VFD8lGqnldzq X-Forefront-PRVS: 0792DBEAD0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0745; 23:N/bKbYKvJAg2v4JtPzlw61GfgCe+jsqjoXPsoDfLq?= gWvhtSFU8DkACJTa/4Rfs1XshkuvXNJKnCOpVH8sOwOmTFwxip1xArK8ccfNeBegpGIwMztdWIvmQDJIIZHvSb7DS5VSZ96myY6QhUmcoSIyjcDP391bJfmJNsQsYlRBtxFUhpSHskfFUlbqp/tOAxgUhWwTBHenpocDPkfB4rz2MS2KlsYqb6YSML9lRKDttxTNUb3P1kBCKHc3NPHPRwZqYl7hhFbtwB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gQk8eaihpM1/nuy4Rug8FX1BTNXaNdrS0b352WKJ24QhTaECkWWJ0Usqi3hgk+4HKtGjmzU62tYgI3zI+gs80gLsK2vBbbANArIB/fKbz4CY5MUElQ8xJmFc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0745; 20:JC0+UMPnZN6qU1UUtNV0kACzFZmXbzMPtZAjkxpd9Gbor7VSpBHaFsanS4+Rq8FFnqPvLRECh+FQF5QUKdjvBVAspUA+f24OS/WKM6OfkA1I8b7xLMmeJcyDUpt9/4DF47aXc+qcWvycaYbMwNzvCXDDsGko+kr8p5BLxDbmptvCPocTejTvprpg9mmKqQK19cY7PqGqzGTL3ujCWcNkx8ZvciJiZfv/wBoP/Do5N+BXaikJ7DsIwvh4SVkhNctr X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 16:15:25.1302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b730e493-6291-48d5-e27c-08d61801c857 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0745 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolai.haehnle@amd.com, michel@daenzer.net, Christian.Koenig@amd.com, manasi.d.navare@intel.com, Alex Deucher , Marek.Olsak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Harry Wentland Add connector properties for controlling freesync. Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 13 +++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 4 ++++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 6748cd7fc129..642b47c5f4b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -626,6 +626,19 @@ int amdgpu_display_modeset_create_props(struct amdgpu_device *adev) "dither", amdgpu_dither_enum_list, sz); + if (amdgpu_device_has_dc_support(adev)) { + adev->mode_info.freesync_property = + drm_property_create_bool(adev->ddev, 0, "freesync"); + if (!adev->mode_info.freesync_property) + return -ENOMEM; + adev->mode_info.freesync_capable_property = + drm_property_create_bool(adev->ddev, + 0, + "freesync_capable"); + if (!adev->mode_info.freesync_capable_property) + return -ENOMEM; + } + return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index b9e9e8b02fb7..f91a9bdcd63c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -339,6 +339,10 @@ struct amdgpu_mode_info { struct drm_property *audio_property; /* FMT dithering */ struct drm_property *dither_property; + /* it is used to allow enablement of freesync mode */ + struct drm_property *freesync_property; + /* it is used to know about display capability of freesync mode */ + struct drm_property *freesync_capable_property; /* hardcoded DFP edid from BIOS */ struct edid *bios_hardcoded_edid; int bios_hardcoded_edid_size; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index d599fbfa895b..8be3028850b6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2718,6 +2718,12 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { dm_new_state->underscan_enable = val; ret = 0; + } else if (property == adev->mode_info.freesync_property) { + dm_new_state->freesync_enable = val; + ret = 0; + } else if (property == adev->mode_info.freesync_capable_property) { + dm_new_state->freesync_capable = val; + ret = 0; } return ret; @@ -2760,6 +2766,12 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { *val = dm_state->underscan_enable; ret = 0; + } else if (property == adev->mode_info.freesync_property) { + *val = dm_state->freesync_enable; + ret = 0; + } else if (property == adev->mode_info.freesync_capable_property) { + *val = dm_state->freesync_capable; + ret = 0; } return ret; } @@ -3584,6 +3596,13 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, adev->mode_info.underscan_vborder_property, 0); + if (connector_type == DRM_MODE_CONNECTOR_HDMIA || + connector_type == DRM_MODE_CONNECTOR_DisplayPort) { + drm_object_attach_property(&aconnector->base.base, + adev->mode_info.freesync_property, 0); + drm_object_attach_property(&aconnector->base.base, + adev->mode_info.freesync_capable_property, 0); + } } static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,