Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2091512pxv; Sat, 24 Jul 2021 05:12:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRL7Q3iYQfiTb/VpsWA9G2vnCP3OV6miV4Pyxr5LvMiyKY1wJTS8SyfZVWR7SYDJHdsW1H X-Received: by 2002:a92:b741:: with SMTP id c1mr6708440ilm.220.1627128774279; Sat, 24 Jul 2021 05:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627128774; cv=none; d=google.com; s=arc-20160816; b=SBMmrsJ43nv9ji0CTGMf1a6rNV8WM+HEXZUeJ54gxjzgTe1Q/qbGlrJyUYiVJOmwnR pbSTzw+f8oBQfCo0b0aG+5WSCZ09KTC34vdIxRQpihjcDy6LNu8se/jcTmcdHGag1CmJ AqXXqOHyqY9urowMbpxx718ua56c9URUhoCDMy/iANW4fzfTjlg1z4gCyMMPqL9WW56a vCWldO9n2g6IcRnK7PeeggLAo/jNp2x6ERGA0Dv/uM5UEK0nWcctRtvf5D526VTV22ov C4qWCwaQbrwQiV0m1akZAbx7xdY15YnGol6VoNCQ5DByBafwWscWDN6KZMey+ddARgRq n2dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6AcUZFHd8G5i76Vd2O5qx5HOAivGVNtt24z6TdHQF1o=; b=JRBFE35BFjROyJymnb0TCAUqQFt3cFmcY0nC3Xo1BFdIYqc0X4iCXHE40izWMyrdcD EmxylRYUlGIbUhhFMDISrATV5UV9ONs/IeM6tLua0U1oE141/YkUjX+fzlzOxRhr34E6 ebO54bmoiATww56FW20dbjaJpFcT22A/+YLf5cXp5BnIeJIn32CMVNHZ8+wK2dq+uZaG HTt6EfgZEO3ggybZNpuo6u1mPmTkwpf5nu0sSiNQKfVf8Lzd/wtDpHMUSD1VkQ+DYtUC TzQilXImmDVJuTBUxsPC6mo3+/oqt7gXIzD4c8zxJdUplQWwU/iI9MQEHt05/b3E5DSI BksQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=epNu0UjS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si32397272iow.6.2021.07.24.05.12.29; Sat, 24 Jul 2021 05:12:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@redhat.com header.s=mimecast20190719 header.b=epNu0UjS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231993AbhGXLai (ORCPT + 99 others); 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-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.