From patchwork Wed Jul 21 15:17:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 483311 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6294249jao; Wed, 21 Jul 2021 08:18:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6OOC3P16tEnt2XxeiQVPZVuQKbLS99cE80h9pp9WXI+fkpuO/gvzuyn+ZKY2+MtL9/rSm X-Received: by 2002:aa7:ca1a:: with SMTP id y26mr49094809eds.231.1626880727376; Wed, 21 Jul 2021 08:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626880727; cv=none; d=google.com; s=arc-20160816; b=LG3akMaMj9ve4loNZbnzkA8r7cxatU29OgWqQds1QxOX9J6+aOkNL0wktZJghs0VcD BC72VPAZ/aA0KqQ2VvL7IurcMl/ZLoV4pX0botmI3FzYpdYtSsqGSVD3YVUTQe+qJz8x Za4boyOBeX21YHUsochwiOZbN5I2M5sL3qsdA88O0j3HVgAyhcsEJ7C2c5AxIf1iKxLu GUydgDOFqcTq9vKDFPpjFi4PXmX4RbHUIbVCB/VZ7alXy48yFRbkfJnglgOVb+cBJokW jLvtF/exWkhmXVTgayZ5MS5Ao6PhPYHEagNHf5+uvMpVNHCRpXJ/1bAOF7XC3Y01rLeW Tj2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XL92/Br8GzcREDVn8BrCivK9+VnxD4gmLyM1Ekj/HBo=; b=b0e5rqSMKpnI7qX7d9+UAPSoyn+8mAyc09Hq7vn+ksNRkGd3WhVmRb1FZrCXabDTXo V4/HLBlmt6ICt687NKEZc5We1dh2hhz9G8VB/jL/hmByPo//BJKXDbZ3RjYg9DWPcz03 HOUNzLtA13+yXA4wXZ4a2mS6jAvayrxg3rPT0pPCp54/hO3UbabTlakvH5uaIv3jbNf1 KS1WDj1wJ5pNftRdV4/ToC9JFmDxDYJJBirG3UgelTQMIuBlS2CjzPJ9eoJUDYb4ohHj snKBMqqKiicGbPFcPdrAo03CQ+EkXFE2xmCRqjLn8TBvJ3ccEdNODkjK1pFeiu6+8Jay C+kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=biu8xVWJ; spf=pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si28677830eds.247.2021.07.21.08.18.47 for ; Wed, 21 Jul 2021 08:18:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=biu8xVWJ; spf=pass (google.com: domain of linux-fbdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-fbdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239378AbhGUOiJ (ORCPT ); Wed, 21 Jul 2021 10:38:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:33338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238083AbhGUOiJ (ORCPT ); Wed, 21 Jul 2021 10:38:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB96F61246; Wed, 21 Jul 2021 15:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626880726; bh=rHewC8c5p0knxx95PKPppJx1ZIfzczey+Q7nqFGbe1g=; h=From:To:Cc:Subject:Date:From; b=biu8xVWJdFQe9hPe1MR00MmTDZLvkdzJrXLSyc44H3ao7+QlvaF2qavXQqnwvznps +ZiKWdt6IAid+59oKGhrSqbnXZCEhQA68Ujpi/zVaEF8Qe6scucrjVw2ScLSu23fDs UGuh8jHTm0tWFqOc/3bxfMQIPhhpUjIib1gms4e3WkWl5hnd9EtlMDlXfaCZDjATrC Qfi7IWDPof+2XLJT96RQhpLpr4B72j0qIJswSVNpGjsSTebX7Njj5ZS2dHJAnUOGbm DooGKftfv1YwvTCXz4iTnBhHfG2/owHkaGiG1Y6uuxJQYikPKgRkxezcVvwuInngO+ JWjlkmeAcPzOg== From: Arnd Bergmann To: Thomas Zimmermann , Daniel Vetter , Maxime Ripard Cc: Arnd Bergmann , Rob Herring , Frank Rowand , Mauro Carvalho Chehab , Lorenzo Pieralisi , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH] fbdev: simplefb: fix Kconfig dependencies Date: Wed, 21 Jul 2021 17:17:46 +0200 Message-Id: <20210721151839.2484245-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Arnd Bergmann 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") Signed-off-by: Arnd Bergmann --- drivers/of/base.c | 1 + drivers/video/fbdev/Kconfig | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.29.2 Acked-by: Rob Herring diff --git a/drivers/of/base.c b/drivers/of/base.c index 48e941f99558..073ea7cd007b 100644 --- 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; diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 8a98539ec490..5fbcb3cc2e8e 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -2207,8 +2207,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