From patchwork Mon Oct 29 17:14:43 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: 10659823 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 662E813B5 for ; Mon, 29 Oct 2018 17:14:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D44029D7C for ; Mon, 29 Oct 2018 17:14:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5096729D7E; Mon, 29 Oct 2018 17:14:55 +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 0661B29D7C for ; Mon, 29 Oct 2018 17:14:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D0A26E05E; Mon, 29 Oct 2018 17:14:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BE766E05D for ; Mon, 29 Oct 2018 17:14:45 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2248.eurprd08.prod.outlook.com (10.172.227.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.19; Mon, 29 Oct 2018 17:14:43 +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; Mon, 29 Oct 2018 17:14:43 +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" , Raymond Smith , David Garbett , Lisa Wu , Matt Szczesiak , Charles Xu , "james qian wang (Arm Technology China)" Subject: [PATCH v6 8/9] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Topic: [PATCH v6 8/9] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Index: AQHUb6riw7xJUVs5pE+HF1KGk5K2og== Date: Mon, 29 Oct 2018 17:14:43 +0000 Message-ID: <20181029171419.4512-9-alexandru-cosmin.gheorghe@arm.com> References: <20181029171419.4512-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181029171419.4512-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0032.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::20) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.54] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2248; 6:lFkD1lcFW3hvGcW5cgblbjjdcKH00UXnIGwm32GNHhznzDcR83FDh2fHtBBTYAwfwZYj4EsWBpqdoRuPX9JIFqizCgw3ow/O9rWcXVqQWql+9ipmOeli07uJroH+eUB4dDV3HOwrnaPczqwpeJuiep70ucKZL9GDBIZWEBSixZwUO/zSBDMgV/QjBZLjL/o0zMsY6CuzLUQ86yYPt4uUC/lpHU5vYcSeqX0SE160gjgAtjHp7TCQuWPzVX5CMCwlYqc40i/mBB4MkSn4GVo0l4DwXtLMzhCcjZVN/P0TpMsIslS5CuwjJKTZwMskAr+XTG+5rI154w/1dWbWpPYZzsZPeeEYSEtScKPdzN70mzxUMZqvbHKL/xLWI9cObfmsBZylfqT/pMT/joSALYeCnKfZfRx58xKZaPyQKYJZJimRyQZhRQcALkjVByCrMxXCCGjlaDf42UA+94EtHesyEA==; 5:WJYcGLVaDhVcYkpsp1uXJxzZn4WjeBZbQHPi1wkUhh6Wdt7ZL7sROM2md/w/Z1gy2poMS0w0ib1kyGaOpDaPrlUOB5su/rdPpGxK+Z4MokWn2UYwf+2EZ2a1gitzNPJy2L1d3pAl1tKB2f9jB1uKZcuIptsJdaMc90fSUTcV11E=; 7:Hp4YmXh0SXDhlivzSRv3N9ishE9q9zOtCrpJWY+yp2jPafJucSB+SIt6N6ZDds3LsJY2S1ZJt6/1dOPukBgLY94dQDH+I9FCzTQe+JUxjZ4etsaiQgBqnR6cmT+h/9BlN5CheubGvYMqOl6TnWjWOQ== x-ms-office365-filtering-correlation-id: cb9afb50-632d-44d9-280a-08d63dc2045a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2248; x-ms-traffictypediagnostic: DB6PR0802MB2248: 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)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2248; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2248; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(366004)(346002)(136003)(189003)(199004)(86362001)(186003)(8676002)(81156014)(25786009)(106356001)(6512007)(6636002)(6436002)(5660300001)(81166006)(446003)(36756003)(110136005)(54906003)(71200400001)(71190400001)(105586002)(486006)(53936002)(476003)(316002)(2900100001)(2616005)(11346002)(305945005)(72206003)(4326008)(2201001)(66066001)(5250100002)(478600001)(8936002)(7736002)(68736007)(2501003)(6506007)(386003)(99286004)(256004)(26005)(102836004)(97736004)(6486002)(14454004)(3846002)(14444005)(6116002)(2906002)(52116002)(76176011)(1076002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2248; 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: CI0Eh0RkpwOGWAPvRiz5DqgcBehNd7gY5KubHohQDmCvtKxRttXSKNMKdcwsbJ3WJV2cUvCvUVV8ZDHSb/u2wPQLbIruL6SPdHwpE3aRPzfWb8hMmwyMTtVnXDqVtJBLpAWP23Va156wetFvl2SX4/SZ96uLA/CAAxj4LopXMNuYqDM3FHvkkCG/jltjnXvuQ4WRhSfioyp1n7c5vQRjA6TIOujtjJdF6C+bCtd3Q/MXa6qh0/ZANczAIgstL/ubFYe8YKh+NzLPdqVovhhJKe2DqV3RrwzESLCGK0wCnM4AlZgtg91SDCrCHbNN3xjaxP9kUYioL5RxBNPoo7fOeOPoQoJ8sU8PxMZ8jQpmLVY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb9afb50-632d-44d9-280a-08d63dc2045a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 17:14:43.0855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2248 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