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=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 6B1DAC432BE for ; Sat, 24 Jul 2021 12:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E36660E96 for ; Sat, 24 Jul 2021 12:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbhGXLai (ORCPT ); Sat, 24 Jul 2021 07:30:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25241 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhGXLag (ORCPT ); Sat, 24 Jul 2021 07:30:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627128667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6AcUZFHd8G5i76Vd2O5qx5HOAivGVNtt24z6TdHQF1o=; b=epNu0UjSa2Naa7AER7Zbs1JPjnA77O/hYw5Lf1a0C22rm/SOvU+fW9HVdjm7MfmS4a9FTJ zNGvewInVYrtc/M8ZpMSI8FOEbvlFuMYzDCHRbAqSAP3zwVkLhudCzSBEfe6RNWLOtHQS7 b94DBLfx7hig+5M9VJiHMYyWwrVyhBM= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-84-dNw8lvy3OVK0F4gs-7lfdg-1; Sat, 24 Jul 2021 08:11:06 -0400 X-MC-Unique: dNw8lvy3OVK0F4gs-7lfdg-1 Received: by mail-wr1-f72.google.com with SMTP id p2-20020a5d48c20000b0290150e4a5e7e0so2025756wrs.13 for ; Sat, 24 Jul 2021 05:11:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6AcUZFHd8G5i76Vd2O5qx5HOAivGVNtt24z6TdHQF1o=; b=Ro6V+J2qt3s7CP4sihFvDxvsUaHlMViRHuCnzDjDKp1DbK01Nz5cduRFDYhvrId6pU dXeDBY9VgA79+56qycxAVPYWM2QmgJcTEPuLzpzZKR6GSfU2ZQioM5ji2HYEOkHjDxKf QtxbxA1JMDk+fwc6T95k9lKDwYzgIKMIZEqxkLnndDX0ToBD/41EttAgPZkGq1iN+axA V/dSpvAEOcoCfCghtZXzrK5mynnDKbW7L1SDieDR02qLBx9xEpc+otAIhyuCFtBIkV74 OVl5JdsbYeXTieONRgNeyEZPgQnSQjvrzDjMqEUcC7zf1j6vUP8OleF/Ih/ljk+7XLgi scqg== X-Gm-Message-State: AOAM532bK/qhsU6ENOn67r9ZLvGiEUW2qfK7PeKtrJBtlymEvherHBMI 7wMw14AIrp5P+RLIFn2oVVPD35J15wKIQCKBxUgalnvAbzV6TflQ5f15c7KWTZ2GYnV/XCM2tO2 /4yOsLoEj31a+OOPAykJqbWcZP/Nl//KjcBt6snec X-Received: by 2002:a5d:6644:: with SMTP id f4mr9516228wrw.177.1627128665077; Sat, 24 Jul 2021 05:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1U/Pv5yVb884gxpjWlzIwo4rESJ/20Yl1+UEyfV86RbeZzOoyylb1wUn4yvDX+I0fEFDwDPAH06HqLqn5dkc= X-Received: by 2002:a5d:6644:: with SMTP id f4mr9516213wrw.177.1627128664906; Sat, 24 Jul 2021 05:11:04 -0700 (PDT) MIME-Version: 1.0 References: <20210723224617.3088886-1-kherbst@redhat.com> In-Reply-To: From: Karol Herbst Date: Sat, 24 Jul 2021 14:10:53 +0200 Message-ID: Subject: Re: [PATCH] nouveau: make backlight support non optional To: Arnd Bergmann Cc: Linux Kernel Mailing List , Lyude Paul , Ben Skeggs , Randy Dunlap , Daniel Vetter , ML nouveau , dri-devel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 24, 2021 at 1:56 PM Arnd Bergmann wrote: > > 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 > I see. Yeah, I guess we can do it this way then. I just wasn't aware of the bigger picture here. Thanks for explaining.