Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2112530pxv; Sat, 24 Jul 2021 05:54:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGcVsnDSr/Q+nI6HQzcnQ5DSUKw3Yt4CspipODi0OT/2EajTuymGXr4n4YqxZpQPog/Chl X-Received: by 2002:a92:d305:: with SMTP id x5mr6805648ila.150.1627131274466; Sat, 24 Jul 2021 05:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627131274; cv=none; d=google.com; s=arc-20160816; b=SZzFGzkzsncNAXTgQ60//pIFze/4KQC129ArE3seH1JUw8//6OerVRxa5ZblfpXoED Jl70EhjEzzNhkiDnWVAVbZPDEv2EKrMo+da20/SbLFca5wx/VQuWwMIKeWKhGKNGqaGk lpd/Sck5nLT/uT2nD4kEri7JbQAYzNoCLFhrRqNSyFqQwaD4ZV4am++O86nzihjcZ1ll 9kXDDlDzYKAbalcPuM3fRNv/ia3NGnL5aLJK65BsVpNr306qsCw/JEQrPqjIwDyzX9+3 b+/zE5YZkqymyLEihct1Nif/RENnssqNkSR7YB+nseP8afElr6HFl/o/Ocq9ujOyOy1z xgXg== 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=SqP8PeLUX+bkAijbG1F91uxgBzPDOmlyO/TzLjQPs+k=; b=y8PRaCVGv3IQTLzLGga5rdhkc4Da7M0D2ENT8Ih948370ZXvQraotEEKxXrl+6VlRC VoDMa2Jt5t3uv6RFm1RLoeQsefYqUVX5EAcIT0sxpEUNuePhd5+C0tILPJuMNcbQi+rb VPZqP04jyE5YVg9ShOfuW824idBZ8SEhbKrkYZoS7Tu7OjCqzF/hqCZk41azwniUlY4/ LCeIj28uaOqbA36Gxh0aafCai/zZ6ra8zjUjvKbKgXEGhFL3iASHMlsrCwHAqGeSFU2L r36fMPA0KbXNPqqqWbi6azjq5D0j75Eamix/mvo1yd2feQ/+u48Hc9p7IWLMCO+w0eWK 5zqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b6BBdr+0; 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 g5si24844419ilk.74.2021.07.24.05.54.10; Sat, 24 Jul 2021 05:54:34 -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=b6BBdr+0; 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 S233824AbhGXMLb (ORCPT + 99 others); Sat, 24 Jul 2021 08:11:31 -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-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 :/