From patchwork Mon Aug 29 12:34:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9303905 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 700B9607F0 for ; Mon, 29 Aug 2016 12:35:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 613D02886D for ; Mon, 29 Aug 2016 12:35:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557B328872; Mon, 29 Aug 2016 12:35:00 +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 E9BCC2886D for ; Mon, 29 Aug 2016 12:34:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 856256E53D; Mon, 29 Aug 2016 12:34:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D1F46E53D for ; Mon, 29 Aug 2016 12:34:55 +0000 (UTC) Received: from wuerfel.lan. ([176.5.99.91]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0M3JVg-1anl7E3PpQ-00r4Py; Mon, 29 Aug 2016 14:34:29 +0200 From: Arnd Bergmann To: Chris Wilson , Daniel Vetter , David Airlie Subject: [PATCH] drm/fb-helper: don't call remove_conflicting_framebuffers for FB=m && DRM=y Date: Mon, 29 Aug 2016 14:34:07 +0200 Message-Id: <20160829123428.3260105-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:trxl1WEySuuNhQkQj+vCUbN0d9MkaX3n3Bj2hCS15ykjZPO/Iwf S0ZkKcI/W415dBiqog2PRQZY7/SR5FtdLC6HOHxXWinTubfb8xrQMpWWOndmddV8NVL35W5 2FDovHoRcXgSmvciweMOaP9v8QcCdqddw6iMnfW7oweXyKKIC7m8+iuXkD1at+A+SU2G1DJ B3KTOJ2OkhvilNGiHiYfA== X-UI-Out-Filterresults: notjunk:1; V01:K0:6KvFx48b7cA=:ARI5SqTk5bxBg2C1T+1/Pt MRjjwZQOcwIHbgMxRfp9Oh/cNJIspRsDv1GlIrv1nBXdJARdKIjiFWJMdnydWMf/kFzzGqSFC PJr8friH2jKnUAwL7HLo/GWnap5QZNhdbDcr2f2ocT4u2B4Ck0JTpVMhH07DmBsNou6q4irx2 fFf//vVlTvc6Lbshic3pdH2xf7Hjrghnyb2Nf8Fhe4bU2EMGA72eqQz+4OR0QDN5ifhfbXlB2 CkCebwowovEdIEADEUUH3kzS+mg1QeKswgixRYxiYifuspobM747JouTqcZCxOgbYTVZcykOM 7Imz4R7DkCrZwiE6tKorJuNJPcYEWupB1O6FEklq9UP+4DoX20YKUuHFmDsY/y9j75sGQBvrK lU+hWmCsTrR0Yeix20nw8rKkt1DhftE+iCOcgN28mX9XLti1U6w1q8vlNp4VK6DDcR27nFsgK b3lMpMhLfwT208kkfHx2VsxtkaBYyWPK3XSLoeb4pdJyaUbuUc0MZrdu7PG3tvfU5bUUITF9w 5ekBU1+ybXg6kzOvfoZfHICqXBrDtlOm6tMS/ZayXb7DvH2vKMYlF52/Qs4eW5DQRhF2K0IDD 3PXyZoEhc/tYdoZ+RnZU/21j7P0mJv1FdtKgRKqd+j6zAqpkMEq8YDG8P8nRcRJwnvbzuPoTX ESly6d+vRd7Rmo9iuNLP95FiQcAMAcya5kYlVfFv3BaeCOjF6MmOA4cQp7IBvT199ywo= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_DRM_KMS_FB_HELPER is disabled, we can have a configuration in which some DRM drivers are built-in, but the framebuffer core is a loadable module. This results in a link error, such as: drivers/gpu/drm/radeon/radeon.o: In function `radeon_pci_probe': radeon_kfd.c:(.text.radeon_pci_probe+0xbc): undefined reference to `remove_conflicting_framebuffers' drivers/gpu/drm/amd/amdgpu/amdgpu.o: In function `amdgpu_pci_probe': amdgpu_mn.c:(.text.amdgpu_pci_probe+0xa8): undefined reference to `remove_conflicting_framebuffers' drivers/gpu/drm/mgag200/mgag200.o: In function `mga_vram_init': mgag200_ttm.c:(.text.mga_vram_init+0xa8): undefined reference to `remove_conflicting_framebuffers' drivers/gpu/drm/mgag200/mgag200.o: In function `mga_pci_probe': mgag200_ttm.c:(.text.mga_pci_probe+0x88): undefined reference to `remove_conflicting_framebuffers' Makefile:969: recipe for target 'vmlinux' failed This changes the compile-time check to IS_REACHABLE, which means we end up not calling remove_conflicting_framebuffers() in the configuration, which seems good enough, as we know that no framebuffer driver is loaded by the time that the built-in DRM driver calls remove_conflicting_framebuffers. We could alternatively avoid the link error by forcing CONFIG_FB to not be a module in this case, but that wouldn't change anything at runtime, and just make the already convoluted set of dependencies worse here. I could not find out what happens if the fbdev driver gets loaded as a module after the DRM driver is already initialized, but that is a case that can happen with or without this patch. Signed-off-by: Arnd Bergmann Fixes: 0a3bfe29f816 ("drm/fb-helper: Fix the dummy remove_conflicting_framebuffers") --- include/drm/drm_fb_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index edc6cfd3aa34..797fb5f80c45 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -491,7 +491,7 @@ static inline int drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { -#if IS_ENABLED(CONFIG_FB) +#if IS_REACHABLE(CONFIG_FB) return remove_conflicting_framebuffers(a, name, primary); #else return 0;