From patchwork Mon Oct 11 13:44:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 515615 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp4465640ime; Mon, 11 Oct 2021 06:57:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUHH63z42sZV29zngK10IS/+B944zQabmiOj57nlUv3Pzvx8pcV3i2gc6CzvRBUjM5s34M X-Received: by 2002:a17:90a:430f:: with SMTP id q15mr30963058pjg.2.1633960620976; Mon, 11 Oct 2021 06:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633960620; cv=none; d=google.com; s=arc-20160816; b=UDKML5DTj5FixliDm2a0lnbYA6jrf64n46s0eKMf8EOlXJNBbHodGRDBYJHNzuDo4W EHSnbit0jCJO3x9FrpUC2NLAD0C2qjE2w/ZgGWRuO6rfedukX0LbsYHl2Pch/XIO6LDE UMw7Antl+y+I0gH1oOBCX9knAotPCLIWcqihga0YnRP6SksaX9j88jNrgRCw92LFi+qE Ck1jO+awvuNZ62zMkWZl/w6c0xOuX75mz32xbBq/JbY8aRITeTOMEpY2LLjBXdf6mLYX E2REUi+PyJqxP5mg4HzUxDxQD4Sjh45j44pDw4P3NMi9JkmUaMmJAYsys6bS0lIue57a Vk8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:delivered-to; bh=Rk4gWy8Jh1hVUOXKnw31b36Tm23s/ZJv8QwnL9N6rZk=; b=Y42ggqmWXqNKKPqY/54mSK6BV7oX16wP982X8MiqQjZuM6ERm/D06pi1k1qdMIMaop 0QZjMF4iRPTUav/x68/5n1zmhq4H2bVbDwW2xrjSaVEE3Oguipcu0/Tfgm7IN3ZO0dlC Vmk7PoTWCMGf0T7+cUBgpYHn1A6qBUdxHPJFc5ff1/e0/h3Hjk8Xv9kCSj3GShLP2N/+ 0jT9WWwajigL/rlbrzy9C5Ip+Y4qyoyLf83Go/kBdnRCjWEaa3WXlNFXUloHlVtAIYWp ckgyUdBTS9I7aDl0PY2LP3BrPG4PhC1pW/O09f9cnJt08XYhX6DtklIbmemcbNhCXM5A F/Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PsQDz8tD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id m203si11073554pfd.256.2021.10.11.06.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 06:57:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PsQDz8tD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 372306E4C1; Mon, 11 Oct 2021 13:56:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FBF66E4C1 for ; Mon, 11 Oct 2021 13:56:55 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 6610161050; Mon, 11 Oct 2021 13:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960614; bh=8rv+dLDodlxCHV1xPtmKJextlAab2I7uYALBnhUtHyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PsQDz8tDSAIz5R945Z6n7JJly84g0EUJiEXJbtJlwlGfvOT4CyNF8G+nXsXrHIfqN R2D+R+b3yDBTFF1emLzmIAegPBxWwlKFob9gckKZDbN0EJoAiogcjaIgsWFmKSji2z /BzzbUTbwGFSd64pqUZ0lFMCS02XEjAyuHEJX9ag= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Thomas Zimmermann , Maxime Ripard , Liam Girdwood , Mark Brown , Daniel Vetter , Borislav Petkov , Javier Martinez Canillas , Randy Dunlap , Geert Uytterhoeven , Peter Collingbourne , Andy Shevchenko , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Rob Herring Subject: [PATCH 5.14 024/151] fbdev: simplefb: fix Kconfig dependencies Date: Mon, 11 Oct 2021 15:44:56 +0200 Message-Id: <20211011134518.629623285@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134517.833565002@linuxfoundation.org> References: <20211011134517.833565002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann commit ec7cc3f74b4236860ce612656aa5be7936d1c594 upstream. Configurations with both CONFIG_FB_SIMPLE=y and CONFIG_DRM_SIMPLEDRM=m are allowed by Kconfig because the 'depends on !DRM_SIMPLEDRM' dependency does not disallow FB_SIMPLE as long as SIMPLEDRM is not built-in. This can however result in a build failure when cfb_fillrect() etc are then also in loadable modules: x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x1f8): undefined reference to `cfb_fillrect' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x200): undefined reference to `cfb_copyarea' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x208): undefined reference to `cfb_imageblit' To work around this, change FB_SIMPLE to be a 'tristate' symbol, which still allows both to be =m together, but not one of them to be =y if the other one is =m. If a distro kernel picks this configuration, it can be determined by local policy which of the two modules gets loaded. The 'of_chosen' export is needed as this is the first loadable module referencing it. Alternatively, the Kconfig dependency could be changed to 'depends on DRM_SIMPLEDRM=n', which would forbid the configuration with both drivers. Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Acked-by: Rob Herring # for drivers/of/ Link: https://lore.kernel.org/all/20210721151839.2484245-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann Cc: Thomas Zimmermann Cc: Daniel Vetter # fbdev support Cc: Maxime Ripard Cc: Liam Girdwood Cc: Mark Brown Cc: Daniel Vetter Cc: Borislav Petkov Cc: Javier Martinez Canillas Cc: Randy Dunlap Cc: Geert Uytterhoeven Cc: Peter Collingbourne Cc: Andy Shevchenko Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: # v5.14+ Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210928145243.1098064-1-arnd@kernel.org Signed-off-by: Maarten Lankhorst Signed-off-by: Greg Kroah-Hartman --- drivers/of/base.c | 1 + drivers/video/fbdev/Kconfig | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -36,6 +36,7 @@ LIST_HEAD(aliases_lookup); struct device_node *of_root; EXPORT_SYMBOL(of_root); struct device_node *of_chosen; +EXPORT_SYMBOL(of_chosen); struct device_node *of_aliases; struct device_node *of_stdout; static const char *of_stdout_options; --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -2191,8 +2191,9 @@ config FB_HYPERV This framebuffer driver supports Microsoft Hyper-V Synthetic Video. config FB_SIMPLE - bool "Simple framebuffer support" - depends on (FB = y) && !DRM_SIMPLEDRM + tristate "Simple framebuffer support" + depends on FB + depends on !DRM_SIMPLEDRM select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT