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: 101910 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1609287qga; Mon, 29 Aug 2016 05:34:59 -0700 (PDT) X-Received: by 10.98.70.8 with SMTP id t8mr32257373pfa.36.1472474099394; Mon, 29 Aug 2016 05:34:59 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id af3si39020569pad.39.2016.08.29.05.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 05:34:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org 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" 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;