Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A959ECA0EE4 for ; Sat, 16 Aug 2025 15:34:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FBD110E398; Sat, 16 Aug 2025 15:34:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=disroot.org header.i=@disroot.org header.b="iCV2G5ph"; dkim-atps=neutral Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7AF9E10E398 for ; Sat, 16 Aug 2025 15:34:57 +0000 (UTC) Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 4C9A920468; Sat, 16 Aug 2025 17:34:52 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id E4_sDYxaye6b; Sat, 16 Aug 2025 17:34:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755358491; bh=gUCmvxT1+6H9HHpzyrJbkBUZeZ+q2k9d8IA5OolinHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iCV2G5phaOkKAVgTRG5MZmxXi3HDdurOjrArYMFgjTUHb05pEWV4DBQwwRCXp6aSR Z0/6A8BQ3/3BeQ0tiNK/G+KuSiSdr6EoSP2/PerazNT6dsAUlUSvcvFUp43PAklYhW zIigwlbaMI4DCF0R2u28S0KfEf99fUT/d7c7I6IYfDqNWC4ZfIPbul/3e2bpudGyGF IYg28exNXh8is6y7fa8S1nurXPbQLkddSDuzWSTTSCrmYeeTHXkErmkSfBy5UcMn4R hmWgzl7yV5mKVva5U00n085xFXTTuZHStYTYeG6M+bkXsKz6q6TYGhJ0LG8aUJdzvW sutEXkeD3cpxQ== From: Yao Zi To: Thomas Zimmermann , Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yao Zi Subject: [PATCH 2/2] drm/efidrm: Match framebuffer device by id instead of driver name Date: Sat, 16 Aug 2025 15:34:30 +0000 Message-ID: <20250816153430.51235-2-ziyao@disroot.org> In-Reply-To: <20250816153430.51235-1-ziyao@disroot.org> References: <20250816153430.51235-1-ziyao@disroot.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" Currently the driver matches the platform framebuffer device registered by sysfb through driver name, "efi-framebuffer", this is a little confusing since this driver registers a DRM device, instead of a framebuffer. Moreover, we have a driver with the same name, enabled by CONFIG_FB_EFI, that acts as a consumer of efi-framebuffer as well. They cannot be both loaded into the kernel. Making these two drivers coexist is sometimes useful, e.g., a distribution may want to build fbcon into the kernel image for debugging purpose, but keep the whole DRM subsystem enabled as module. In such case efidrm could serve as a solution for running DRM-specific userspace programs on platforms with only UEFI framebuffer supplied. Let's rename the driver as "efi-display" to avoid possible confusion. A platform_device_id table is introduced to match "efi-framebuffer" devices. Signed-off-by: Yao Zi --- drivers/gpu/drm/sysfb/efidrm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sysfb/efidrm.c b/drivers/gpu/drm/sysfb/efidrm.c index 1883c4a8604c..7f76e8961788 100644 --- a/drivers/gpu/drm/sysfb/efidrm.c +++ b/drivers/gpu/drm/sysfb/efidrm.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -375,10 +376,17 @@ static void efidrm_remove(struct platform_device *pdev) drm_dev_unplug(dev); } +static const struct platform_device_id efidrm_platform_id[] = { + { "efi-framebuffer" }, + { }, +}; +MODULE_DEVICE_TABLE(platform, efidrm_platform_id); + static struct platform_driver efidrm_platform_driver = { .driver = { - .name = "efi-framebuffer", + .name = "efi-display", }, + .id_table = efidrm_platform_id, .probe = efidrm_probe, .remove = efidrm_remove, }; -- 2.50.1