From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932950AbcH2MfA (ORCPT ); Mon, 29 Aug 2016 08:35:00 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52996 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932863AbcH2Me6 (ORCPT ); Mon, 29 Aug 2016 08:34:58 -0400 From: Arnd Bergmann To: Chris Wilson , Daniel Vetter , David Airlie Cc: Arnd Bergmann , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Rob Clark , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.9.0