From patchwork Thu Nov 1 15:11:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10664089 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 A58A2157A for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97B6A2C000 for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BF622C026; Thu, 1 Nov 2018 15:11:43 +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 393722C047 for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1EB06E3B1; Thu, 1 Nov 2018 15:11:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC99A6E3AF for ; Thu, 1 Nov 2018 15:11:35 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:33 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:33 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 6/7] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Topic: [RESEND v7 6/7] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Index: AQHUcfUsbc4V7cVdK0eueIxoYz3Tkg== Date: Thu, 1 Nov 2018 15:11:32 +0000 Message-ID: <20181101151051.1509-7-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:OKeHkVzJt2U7kFWrDc9CzOBD1cJrtwnUJdx4THLxrKKOndxByKiP9+ELSAJNDN/VmTFfKdAOzOseCM1fjsaglj4trNXkN8ZzCs5zANeZGlqxs0RKvFjJ2+ZS2diRNfr4bHXmf7JQBfoFlafWtdiD5ajw5eItwDLaa+EHh4BuTu+pp9l5+gCFstlqxGTEVn7scoDbR6pXYKOWG+zmYxNgAfymKZMDWXFEJ807wVRhoacB3y9RnPoFt9HamEvy6pqAziXjJx/AHGLZV89SOUMsoNnbjYsKcVAskME/OycMRxLr9GcQZcY3JHMXB6MCe1+1KDT1+2Rjz2W+AMnd+/JnwSJNc+wQZzPzfFFdH8UIZHi/fzCVypkjhCXkuck0lZM0LC3Rb1x/YhUp0OVMjuhHAVvRnEq7hsk+DiTQCPUqh+KFCRyPH8/aAEWQ6cNwAKhfk8cqHXi5qN/ZJ66YazGX8g==; 5:B52FO0dRbF20nG7bDpNaEEoIc9XCcWP7KKy/Ll1IQqZi6ykAeHuytFeXwEHzaIT3m+BFL5madNS+uEZ/n2MLGPZBiC4tQrPsCruv36j5qpJ3Yw6AqDoqoUsPhwqmJYAOwPtHkujXBUKeYHDwcO/NuSkFbAdycd0wD2XK/O07wCA=; 7:sysX1Tcs5IF2Zn62kyQZzNl0VNVQjRlBpPIxE2B159jeqzH+sU04r85/dQfS2qk3JNNEM1ZbQkjTi31ilOZ+DlDgutwhcYeL4ue6Ld0oUwIQv6LbaUr0xhDFGXPFf/Hz2S35lcPkr5G8EcJNCfTj8g== x-ms-office365-filtering-correlation-id: e1350706-753b-425f-2712-08d6400c4eee x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(14444005)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LmeqD8LdA2p1VQDdr6anEEnsO/Cuv7lu2E5AG+p0l328i0cVXqzTX3GWIaWPRVHIh6ASkydi4uinjoKx2lyqeHabfR3BJ2qtqDILA55+W5igi/y+AnvVzm9iOnxfpvJ+KAjoD9u7unV1HeHspFSbexQ2ylHkipyTIelNYdyxGfo0EsUMFBxOeDjSWQZ7uO3Z56XchbeHnpn4A2NXoBye8Da0e4wUS2YwBpZH/gRA61J6T4ZXxrxpEelKA7rwqAyOsySoEQzRqf+Rt1A3RulhmqLyDvQn02WedjjSbLZzQLH2CqBt7vylZIsUxV+6BTc86s0Ot+fFSbmNrR0h9Wgdd6YcPDnLj9vv2i8K9kVLcbk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1350706-753b-425f-2712-08d6400c4eee X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:32.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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: nd , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If we want to be able to write drmselftests for non-static core functions that are not intended to be used by drivers we need this functions to be exported. This adds a macro that is tied of CONFIG_DRM_DEBUG_SELFTEST, and uses that to export drm_internal_framebuffer_create, in order for subsequent patches to be able to test it. Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_framebuffer.c | 1 + include/drm/drmP.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 167c1c4544af..fcaea8f50513 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -323,6 +323,7 @@ drm_internal_framebuffer_create(struct drm_device *dev, return fb; } +EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_internal_framebuffer_create); /** * drm_mode_addfb2 - add an FB to the graphics configuration diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 05350424a4d3..514beb2d483a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -110,4 +110,10 @@ static inline bool drm_can_sleep(void) return true; } +#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE) +#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x) +#else +#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) +#endif + #endif