From patchwork Wed Feb 14 00:31:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 10217839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A5EB60216 for ; Wed, 14 Feb 2018 00:34:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D10728F09 for ; Wed, 14 Feb 2018 00:34:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0062328F0C; Wed, 14 Feb 2018 00:34:56 +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=-4.2 required=2.0 tests=BAYES_00, 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 9FD7428F09 for ; Wed, 14 Feb 2018 00:34:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2098B6E337; Wed, 14 Feb 2018 00:32:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 32A9A6E335; Wed, 14 Feb 2018 00:31:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 0927F3F20EEA; Tue, 13 Feb 2018 16:31:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tIzzEj8pTMYZ; Tue, 13 Feb 2018 16:31:48 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 9B9ED3F21AB4; Tue, 13 Feb 2018 16:31:35 -0800 (PST) Received: by keithp.com (Postfix, from userid 1000) id 560C215829F3; Tue, 13 Feb 2018 16:31:35 -0800 (PST) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH 21/21] radv: Add VK_GOOGLE_display_timing extension to radv driver Date: Tue, 13 Feb 2018 16:31:34 -0800 Message-Id: <20180214003134.1552-22-keithp@keithp.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214003134.1552-1-keithp@keithp.com> References: <20180214003134.1552-1-keithp@keithp.com> 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: Keith Packard , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds support for the VK_GOOGLE_display timing extension. Signed-off-by: Keith Packard --- src/amd/vulkan/radv_extensions.py | 1 + src/amd/vulkan/radv_wsi.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 0e7b18dc104..a8d9c8410e1 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -96,6 +96,7 @@ EXTENSIONS = [ Extension('VK_AMD_rasterization_order', 1, 'device->rad_info.chip_class >= VI && device->rad_info.max_se >= 2'), Extension('VK_AMD_shader_info', 1, True), Extension('VK_MESA_query_timestamp', 1, True), + Extension('VK_GOOGLE_display_timing', 1, True), ] class VkVersion: diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index 2433390562b..fd26194f6ce 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -247,3 +247,35 @@ VkResult radv_QueuePresentKHR( queue->queue_family_index, pPresentInfo); } + +/* VK_GOOGLE_display_timing */ +VkResult +radv_GetRefreshCycleDurationGOOGLE( + VkDevice _device, + VkSwapchainKHR swapchain, + VkRefreshCycleDurationGOOGLE *pDisplayTimingProperties) +{ + RADV_FROM_HANDLE(radv_device, device, _device); + struct radv_physical_device *pdevice = device->physical_device; + + return wsi_common_get_refresh_cycle_duration(&pdevice->wsi_device, + _device, + swapchain, + pDisplayTimingProperties); +} + +VkResult +radv_GetPastPresentationTimingGOOGLE(VkDevice _device, + VkSwapchainKHR swapchain, + uint32_t *pPresentationTimingCount, + VkPastPresentationTimingGOOGLE *pPresentationTimings) +{ + RADV_FROM_HANDLE(radv_device, device, _device); + struct radv_physical_device *pdevice = device->physical_device; + + return wsi_common_get_past_presentation_timing(&pdevice->wsi_device, + _device, + swapchain, + pPresentationTimingCount, + pPresentationTimings); +}