From: Daniel Vetter <daniel@ffwll.ch>
To: Brian Norris <briannorris@chromium.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
"Kristian H . Kristensen" <hoegsberg@google.com>,
linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Doug Anderson <dianders@chromium.org>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Rob Clark <robdclark@gmail.com>,
linux-input@vger.kernel.org, Rob Clark <robdclark@chromium.org>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/input_helper: Add new input-handling helper
Date: Thu, 25 Nov 2021 16:25:05 +0100 [thread overview]
Message-ID: <YZ+q0ZlIRoq4nZMl@phenom.ffwll.local> (raw)
In-Reply-To: <YZf15Ir0LDjkYNF2@google.com>
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
next prev parent reply other threads:[~2021-11-25 15:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 22:48 [PATCH v2 0/2] drm: Support input-boosted panel self-refresh exit Brian Norris
2021-11-17 22:48 ` [PATCH v2 1/2] drm/input_helper: Add new input-handling helper Brian Norris
2021-11-18 9:05 ` Daniel Vetter
2021-11-18 19:30 ` Brian Norris
2021-11-19 10:01 ` Daniel Vetter
2021-11-19 19:07 ` Brian Norris
2021-11-25 15:25 ` Daniel Vetter [this message]
2021-11-18 10:39 ` Pekka Paalanen
2021-11-18 23:30 ` Rob Clark
2021-11-19 9:54 ` Pekka Paalanen
2021-11-19 15:53 ` Daniel Vetter
2021-11-19 16:04 ` Simon Ser
2021-11-19 16:11 ` Daniel Vetter
2021-11-22 9:43 ` Pekka Paalanen
2021-11-25 15:30 ` Daniel Vetter
2021-11-19 16:44 ` Rob Clark
2021-11-19 16:50 ` Doug Anderson
2021-11-19 1:46 ` Brian Norris
2021-11-19 10:38 ` Pekka Paalanen
2021-11-19 15:56 ` Daniel Vetter
2021-11-22 9:25 ` Pekka Paalanen
2021-11-30 20:35 ` Brian Norris
2021-12-07 3:16 ` Peter Hutterer
2021-11-17 22:48 ` [PATCH v2 2/2] drm/self_refresh: Disable self-refresh on input events Brian Norris
2021-11-18 9:11 ` Daniel Vetter
2021-11-18 8:34 ` [PATCH v2 0/2] drm: Support input-boosted panel self-refresh exit Simon Ser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YZ+q0ZlIRoq4nZMl@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=andrzej.hajda@intel.com \
--cc=briannorris@chromium.org \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hoegsberg@google.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).