Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63444C433EF for ; Thu, 25 Nov 2021 15:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241660AbhKYPgm (ORCPT ); Thu, 25 Nov 2021 10:36:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235524AbhKYPel (ORCPT ); Thu, 25 Nov 2021 10:34:41 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE3D4C061746 for ; Thu, 25 Nov 2021 07:25:09 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id d24so12502118wra.0 for ; Thu, 25 Nov 2021 07:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=bgokrwfXdRB9SClU9n/nKdZVyUcKPx1fDzLulUzJIPU=; b=BktAf1OS+eudDpfgrdZDTSFFMA7Yx1oBn5NMzdoU7qIo8aNQ9mok4e2egctvZU1mko URk5CsZF+wfaS2PBAqP0GONNNyChiLkL+Cn3nlkbJubQzzbvN+ZxhxMH6RQhCRyrTmWO zzBIJ4Mhg0tjItLDamKowUeOk7aREzY9Rg5Nw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=bgokrwfXdRB9SClU9n/nKdZVyUcKPx1fDzLulUzJIPU=; b=wVJAIzwZmJ3KUlKj3FWzds+Pf90/Ks6j9VyYdlVs28Y19RyJvVsXztj1gh/2Z4YKTg rgFCI0BSLzaMgk33+LIb3tElfQ+auEKrPj1H6OVTwwHrBHAtM8NGeW+bE5hxsjBau2n7 LihZEj9UjYUWyhgyGQ3M2jYnarO2H24cV24gGxIDfcoMiC5cFUBxq8bAvz1yc9O1f7Ln JGLU10TiizjL/9wuTaBUU69zL2y+2dY0bJGWppABoJQ8fWJFF3GB2cBPLRRtCEE1lOaN /HODhsC9N+WM5qsb6oFe125/EwlCs/x5LW2zWhPrQmtceoLTsfRq7nk/rq8VPzPbz1gJ 6IvQ== X-Gm-Message-State: AOAM533aWUO/ULycVP3U/tHm/UGEz8XEzd3nv3zCGV9omYsf4zn9FHIN zugKyxh4BbnFpKCzqRaPZCkiIQ== X-Google-Smtp-Source: ABdhPJwe8pptmsJdDF9M6JUSyrscCdaDaxsY8JQgVcoGOgo8XjGLEdr1e+oL4tgyhJgNNAWjvV0HCw== X-Received: by 2002:a5d:6111:: with SMTP id v17mr7637482wrt.512.1637853908242; Thu, 25 Nov 2021 07:25:08 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id bg12sm4220870wmb.5.2021.11.25.07.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 07:25:07 -0800 (PST) Date: Thu, 25 Nov 2021 16:25:05 +0100 From: Daniel Vetter To: Brian Norris Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , "Kristian H . Kristensen" , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Dmitry Torokhov , Doug Anderson , Andrzej Hajda , Rob Clark , linux-input@vger.kernel.org, Rob Clark , David Airlie , dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 1/2] drm/input_helper: Add new input-handling helper Message-ID: Mail-Followup-To: Brian Norris , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , "Kristian H . Kristensen" , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Dmitry Torokhov , Doug Anderson , Andrzej Hajda , Rob Clark , linux-input@vger.kernel.org, Rob Clark , David Airlie , dri-devel@lists.freedesktop.org References: <20211117224841.3442482-1-briannorris@chromium.org> <20211117144807.v2.1.I09b516eff75ead160a6582dd557e7e7e900c9e8e@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 19, 2021 at 11:07:16AM -0800, Brian Norris wrote: > Hi Daniel, > > On Fri, Nov 19, 2021 at 11:01:18AM +0100, Daniel Vetter wrote: > > On Thu, Nov 18, 2021 at 11:30:43AM -0800, Brian Norris wrote: > > > On Thu, Nov 18, 2021 at 10:05:11AM +0100, Daniel Vetter wrote: > > > > On Wed, Nov 17, 2021 at 02:48:40PM -0800, Brian Norris wrote: > > > > > --- a/drivers/gpu/drm/Kconfig > > > > > +++ b/drivers/gpu/drm/Kconfig > > > > > @@ -79,9 +79,15 @@ config DRM_DEBUG_SELFTEST > > > > > > > > > > If in doubt, say "N". > > > > > > > > > > +config DRM_INPUT_HELPER > > > > > + def_bool y > > > > > + depends on DRM_KMS_HELPER > > > > > + depends on INPUT > > > > > > > > Uh please no configs for each thing, it just makes everything more > > > > complex. Do we _really_ need this? > > > > > > First, it's not a configurable option (a user will never see this nor > > > have to answer Y/N to it); it only serves as an intermediary to express > > > the CONFIG_INPUT dependency (which is necessary) without making > > > DRM_KMS_HELPER fully depend on CONFIG_INPUT. (We should be able to run > > > display stacks without the input subsystem.) > > > > I'm not so much worried about the user cost, but the maintenance cost. > > Kbuild config complexity is ridiculous, anything that adds even a bit is > > really silly. > > > > > The closest alternative I can think of with fewer Kconfig symbols is to > > > just use CONFIG_INPUT directly in the code, to decide whether to provide > > > the helpers or else just stub them out. But that has a problem of not > > > properly expressing the =m vs. =y necessity: if, for example, > > > CONFIG_DRM_KMS_HELPER=y and CONFIG_INPUT=m, then we'll have linker > > > issues. > > > > Usually this is done by providing static inline dummy implementations in > > the headers. That avoids having to sprinkle new Kconfig symbols all over. > > Right, I already did that, and I'm not sprinkling > CONFIG_DRM_INPUT_HELPER much. (I do include one around the module > parameter, because it doesn't make much sense to have the module > parameter even exist, if the underlying feature is stubbed out.) > > But that doesn't solve the problem in my last sentence, involving > tristates. The "stub inline" approach only works well for boolean > features -- either built-in, or disabled. Once your feature is in a > module, you need to ensure that no built-in code depends on it. > > Do you want DRM_KMS_HELPER to unconditionally depend on CONFIG_INPUT? If > so, I can just add a 'select' or 'depend' and drop this intermediate > symbol. > If not, then what do you expect to happen with DRM_KMS_HELPER=y and > CONFIG_INPUT=m? Yeah just add the dependency. If you still want to keep it optional the way to do it is to add depends on FOO || FOO=n And then just have #if IS_ENABLED(FOO) around your inline wrappers. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch