From patchwork Thu May 16 10:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10946365 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 2E4711395 for ; Thu, 16 May 2019 10:46:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A86728803 for ; Thu, 16 May 2019 10:46:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0919128A8E; Thu, 16 May 2019 10:46:52 +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=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 AE5E228803 for ; Thu, 16 May 2019 10:46:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A15238932A; Thu, 16 May 2019 10:46:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0625.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::625]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD4868932A for ; Thu, 16 May 2019 10:46:49 +0000 (UTC) Received: from MWHPR12CA0058.namprd12.prod.outlook.com (2603:10b6:300:103::20) by BYAPR12MB2664.namprd12.prod.outlook.com (2603:10b6:a03:69::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.25; Thu, 16 May 2019 10:46:48 +0000 Received: from CO1NAM03FT042.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by MWHPR12CA0058.outlook.office365.com (2603:10b6:300:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 10:46:47 +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 CO1NAM03FT042.mail.protection.outlook.com (10.152.81.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Thu, 16 May 2019 10:46:47 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Thu, 16 May 2019 05:46:46 -0500 From: Chunming Zhou To: , Subject: [PATCH libdrm] enable syncobj test depending on capability Date: Thu, 16 May 2019 18:46:42 +0800 Message-ID: <20190516104642.21450-1-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 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)(346002)(136003)(396003)(376002)(2980300002)(428003)(199004)(189003)(336012)(126002)(476003)(2616005)(486006)(316002)(86362001)(8676002)(70586007)(8936002)(70206006)(72206003)(478600001)(81166006)(50226002)(81156014)(36756003)(186003)(16586007)(53416004)(26005)(68736007)(305945005)(77096007)(5660300002)(426003)(110136005)(2906002)(1076003)(4326008)(53936002)(47776003)(356004)(7696005)(48376002)(51416003)(6666004)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2664; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af39ad06-3122-4021-9633-08d6d9ebcba3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BYAPR12MB2664; X-MS-TrafficTypeDiagnostic: BYAPR12MB2664: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:207; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: RfMA+1IfMOq1vb0oeI1+OIxKxRz7tm4vkUSvQr8tQzMR7a4H+obT0IInaRojkt3kziH2kESmsiTafRRi9VVApnURtrrFZqW8GSe4sf8q0LcStCFgMV2nJgraU7Lt7dy+HEEwswxqjrNozntcsn3gV+nO9zljOhnjAD5zpZ0r/8WvDXtorvpfu+GQIkhWBCoK+aV/fOVeK50+I7Wll1j7yJNCt3D6k9bOtAtuZL7fdwvDcn7UkTQXxjj8DLanv+79DexjNiVssgi2jQZ8HIFsbJS/qeUJt5KWrQDUqDXGjpbkeo75+ULdWa0q0SC/n3kELvzPhRd5TsTkQat+5bfWKiDXhCxDYL5HO8EOjZ6LBryfJWMkglkj9fINtv2V3LltZ1KAZ3VwfzKlCZ0PNKvmMmB+ciFznoFhUvyYBQw6gbM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 10:46:47.4539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af39ad06-3122-4021-9633-08d6d9ebcba3 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: BYAPR12MB2664 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MTgBAFso4z+zaqkBN1Rfq8vI9B7S+LmfHa/l1ZRzlwI=; b=iP8MxGJHE8TG5hnbiYY51DIpm97/jYJnxvtMUUYuIfzdpQz/XX3mJ2St08s8+LsUuWmK7jv0KljKz89cZ/Of95PFa5b3wWbv3yIoA/T+j4eLcVSX8qKxJhffCuCkigMUJnxyiVqrWxRhq6CuM3+9sIOBY5QltCNb44OGwQBhh/k= X-Mailman-Original-Authentication-Results: spf=none (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=permerror action=none header.from=amd.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Feature is controlled by DRM_CAP_SYNCOBJ_TIMELINE drm capability. Signed-off-by: Chunming Zhou Reviewed-by: Christian König Reviewed-by: Christian König Reviewed-by: Christian König <christian.koenig@amd.com>
--- include/drm/drm.h | 1 + tests/amdgpu/syncobj_tests.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/drm/drm.h b/include/drm/drm.h index c893f3b4..532787bf 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -643,6 +643,7 @@ struct drm_gem_open { #define DRM_CAP_PAGE_FLIP_TARGET 0x11 #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 #define DRM_CAP_SYNCOBJ 0x13 +#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 /** DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap { diff --git a/tests/amdgpu/syncobj_tests.c b/tests/amdgpu/syncobj_tests.c index a0c627d7..869ed88e 100644 --- a/tests/amdgpu/syncobj_tests.c +++ b/tests/amdgpu/syncobj_tests.c @@ -22,6 +22,7 @@ */ #include "CUnit/Basic.h" +#include "xf86drm.h" #include "amdgpu_test.h" #include "amdgpu_drm.h" @@ -36,6 +37,13 @@ static void amdgpu_syncobj_timeline_test(void); CU_BOOL suite_syncobj_timeline_tests_enable(void) { + int r; + uint64_t cap = 0; + + r = drmGetCap(drm_amdgpu[0], DRM_CAP_SYNCOBJ_TIMELINE, &cap); + if (r || cap == 0) + return CU_FALSE; + return CU_TRUE; }