From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCD9BC4338F for ; Sun, 25 Jul 2021 01:58:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6DFD960E9C for ; Sun, 25 Jul 2021 01:58:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6DFD960E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DB8C6E1D5; Sun, 25 Jul 2021 01:58:10 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70CF56E0EC; Sat, 24 Jul 2021 11:56:31 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B13160E93; Sat, 24 Jul 2021 11:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627127791; bh=Or9WH1pvmZ4tR0pQ+qn4WAUGeesVrTpQna1KRhoMf9k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GqiUR56gRh7BGaa5fFrU9Rxl8M2TrB00nMB8yg+92gB0euS8Aed0u+aaA8CISahNN ldX9XAFfH7P3QVljI3NsDjd4x12IxCk6nqoWDzkr4kbJeiC3zg65f4k4eaV4mv5E0V EyxiSqXXJ2scBbb2lUBTTqk5xs7btW2uq4Tnk7us8K9t+ZwBCPm2Jla+ibbFk/YEJY L4aq6GOaM93UE2knqwhdJzGn6cwlXQdgBf3aNdaYHncu9Le3egmawIOQBo1/y9rXLf +qYpUUY76vRC2vWNwEke7kgu9AQ//0V0DY8LLZ9hk97B1dMS+mpKeWPbRbL97Kc9cr aQGpVKBa/GK4Q== Received: by mail-wm1-f45.google.com with SMTP id j34-20020a05600c1c22b029024e75084404so2226621wms.1; Sat, 24 Jul 2021 04:56:31 -0700 (PDT) X-Gm-Message-State: AOAM531ymiw1fAuCBwAD6U5BdSJ3MbwIhtIDIetLTavaoOQNH+niGEh/ OszbXHL0NUEV7MTSEVBfdNMmQOrSjvvpm4F58T0= X-Google-Smtp-Source: ABdhPJxRsxDvG5h/w15BRF87kyh1VVVKr9ninZcoTF/7r4hhnZwOsQ2QlykYbGshv3uR73Sb2/2ucgam2jgOI9/0WVI= X-Received: by 2002:a7b:c2fa:: with SMTP id e26mr18402161wmk.84.1627127789904; Sat, 24 Jul 2021 04:56:29 -0700 (PDT) MIME-Version: 1.0 References: <20210723224617.3088886-1-kherbst@redhat.com> In-Reply-To: From: Arnd Bergmann Date: Sat, 24 Jul 2021 13:56:11 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Karol Herbst X-Mailman-Approved-At: Sun, 25 Jul 2021 01:58:10 +0000 Subject: Re: [Nouveau] [PATCH] nouveau: make backlight support non optional X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ML nouveau , Randy Dunlap , Linux Kernel Mailing List , dri-devel , Ben Skeggs , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Sat, Jul 24, 2021 at 11:55 AM Karol Herbst wrote: > > On Sat, Jul 24, 2021 at 8:55 AM Arnd Bergmann wrote: > > > > On Sat, Jul 24, 2021 at 12:47 AM Karol Herbst wrote: > > > > > > In the past this only led to compilation issues. Also the small amount of > > > extra .text shouldn't really matter compared to the entire nouveau driver > > > anyway. > > > > > > > > select DRM_TTM_HELPER > > > - select BACKLIGHT_CLASS_DEVICE if DRM_NOUVEAU_BACKLIGHT > > > - select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && INPUT > > > + select BACKLIGHT_CLASS_DEVICE > > > + select ACPI_VIDEO if ACPI && X86 && INPUT > > > select X86_PLATFORM_DEVICES if ACPI && X86 > > > select ACPI_WMI if ACPI && X86 > > > > I think the logic needs to be the reverse: instead of 'select > > BACKLIGHT_CLASS_DEVICE', > > this should be 'depends on BACKLIGHT_CLASS_DEVICE', and the same for ACPI_VIDEO. > > > > We may want to add 'default DRM || FB' to BACKLIGHT_CLASS_DEVICE in the > > process so we don't lose it for users doing 'make oldconfig' or 'make defconfig' > > > > I think the problem with > "depends" is that the user needs to enable backlight support first > before even seeing nouveau and I don't know if that makes sense. But > maybe "default" is indeed helping here in this case. In general, no driver should ever 'select' a subsystem. Otherwise you end up with two problems: - enabling this one driver suddenly makes all other drivers that have a dependency on this visible, and some of those might have a 'default y', so you end up with a ton of stuff in the kernel that would otherwise not be there. - It becomes impossible to turn it off as long as some driver has that 'select'. This is the pretty much the same problem as the one you describe, just the other side of it. - You run into dependency loops that prevent a successful build when some other driver has a 'depends on'. Preventing these loops was the main reason I said we should do this change. In theory we could change the other 85 drivers that use 'depends on' today, and make BACKLIGHT_CLASS_DEVICE a hidden symbol that only ever selected by the drivers that need it. This would avoid the third problem but not the other one. Arnd _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau