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 A4155C4338F for ; Sat, 24 Jul 2021 12:52:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7548760E8B for ; Sat, 24 Jul 2021 12:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234250AbhGXMLc (ORCPT ); Sat, 24 Jul 2021 08:11:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26079 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbhGXMLa (ORCPT ); Sat, 24 Jul 2021 08:11:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627131121; 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=SqP8PeLUX+bkAijbG1F91uxgBzPDOmlyO/TzLjQPs+k=; b=b6BBdr+0vrCwFxFoQWA0j0U21Fn4f8HOsHUhzq11fqIvZdHMg5V0Y9iWBAOKUqh5XW49RQ OrkvfFSVf171SJeWdTKQW2M0Wz5IWBXvIKDKjk0oHIQDy/jm1HESbyiSRkc4zOF02haMkx v1rD7/bdOslLKLIS6ZchpgGg28kcJk0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63--UrE3wI_MNqHpi-Trm6IBw-1; Sat, 24 Jul 2021 08:52:00 -0400 X-MC-Unique: -UrE3wI_MNqHpi-Trm6IBw-1 Received: by mail-wm1-f70.google.com with SMTP id f25-20020a1c6a190000b029024fa863f6b0so144166wmc.1 for ; Sat, 24 Jul 2021 05:52:00 -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=SqP8PeLUX+bkAijbG1F91uxgBzPDOmlyO/TzLjQPs+k=; b=f8rdI+wRxEPCvtXblJdtt04I43kaM7LoXB/sfLsUT8JGnQU0QJyHQqPiM19P8EKQUr 12sm3iNG08n1yelIzUq6uH36qmHogh9O6Ufnf8F+zKVaQVrSyejB3PxVIwwMkjRZprTw b8FidlX5DxVa3cJCrc3OZRHhJ9+HqHMuzxwnG3skUz6Q5YZzeuS4LuP1mgns83XQRwXO KYuh5q8+uYG0YQX+YVrq0S224RqnlNApPIt6GKegeBFlW3FeuijfMEXEtfyZjIHmbRfP zqYFovif/462pZibZeJjr1OoVrB+/CWsnTObil602EV6CWi8hkzSHx5XjOxlrOsR+GlD jmLQ== X-Gm-Message-State: AOAM531zCNg1v4KIB+fSv4pEUSzlp/FmjuGgRgM8n4gMKWsTmuJkiBWV 86/JaC0qwu7PdbkIU4U5+UZRgip740kqOyo8DmS6TaxdtApDB7XmwiQSCihjrny8ZdSDL57ZPhm R8IFr2UWgVvX+u3DJX4SgJsQcHw3bnZ5JUjoN+tb+ X-Received: by 2002:a05:600c:354a:: with SMTP id i10mr1809638wmq.171.1627131118701; Sat, 24 Jul 2021 05:51:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkscYT672ybkBRK9AVIA/U5x33XrDVYao8PYSEV9N4uRmE4HwCi033ERdfHRxKag3E+wklUBG0a0zMSGLw8pg= X-Received: by 2002:a05:600c:354a:: with SMTP id i10mr1809620wmq.171.1627131118511; Sat, 24 Jul 2021 05:51:58 -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:51:47 +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 2:10 PM Karol Herbst wrote: > > 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. yeah... that doesn't work. So the issue is, that X86_PLATFORM_DEVICES is a little bit in the way. If I remove the select X86_PLATFORM_DEVICES then I guess problems once ACPI is enabled, but if I keep it, I get cyclic dep errors :/