All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	intel-xe@lists.freedesktop.org, "Shankar,
	Uma" <uma.shankar@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>
Subject: Re: [Intel-xe] [RFC] drm/i915: add kconfig option to enable/disable legacy platform support
Date: Tue, 14 Mar 2023 20:48:01 +0200	[thread overview]
Message-ID: <871qlr6ufy.fsf@intel.com> (raw)
In-Reply-To: <93bb2619-348d-4061-ac7c-a5f4804fc8a8@linux.intel.com>

On Tue, 14 Mar 2023, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 14/03/2023 17:22, Lucas De Marchi wrote:
>> On Tue, Mar 14, 2023 at 06:42:56PM +0200, Jani Nikula wrote:
>>> On Tue, 14 Mar 2023, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> 
>>> wrote:
>>>> On 14/03/2023 11:43, Jani Nikula wrote:
>>>>> On Thu, 09 Mar 2023, Jani Nikula <jani.nikula@intel.com> wrote:
>>>>>> Add config option DRM_I915_LEGACY to enable/disable legacy platform
>>>>>> support. This is primarily for the benefit of the drm/xe driver, and
>>>>>> legacy is defined in terms of the platforms drm/xe does not support,
>>>>>> i.e. anything before Tigerlake.
>>>>>>
>>>>>> While the kconfig option will be CONFIG_DRM_I915_LEGACY, the intention
>>>>>> is that it's not used in code. Instead, we'll pass -DI915_LEGACY=1 in
>>>>>> the i915 Makefile for CONFIG_DRM_I915_LEGACY=y, while the xe Makefile
>>>>>> does no such thing, regardless of the kconfig value.
>>>>>>
>>>>>> Initially, the knob does the bare minimum: drops the legacy platforms
>>>>>> from module PCI ID table (and the compiler in turn automagically drops
>>>>>> all the unreferenced device infos).
>>>>>>
>>>>>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>>>>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>>>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>>>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>>>>>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>>
>>>>> The discussion stalled a bit.
>>>>>
>>>>> Do we have consensus to start adding this to upstream i915?
>>>>
>>>> I always liked the idea of compiling out platform support so I could be
>>>> convinced. I view that as a "power user" use case - compiles their own
>>>> kernel for a targeted machine. It also translates to building smaller
>>>> images in production settings although that is kind of not interesting
>>>> with the storage amounts these days. So overall feels could be
>>>> justified. There is some benefit and could be done with minimal
>>>> maintenance cost.
>>>>
>>>> But to add a Kconfig calling something "legacy", by the definition of
>>>> what Xe will support feels maybe a bit premature. Sure it will become
>>>> super useful once Xe is in the tree, to allow exactly the same class
>>>> use-case as above, but until then it feels questionable under your own
>>>> criteria too.
>>>
>>> I don't disagree. Partially the idea with "legacy" was to be a bit
>>> vague, so we could tweak what it really means later.
>>>
>>>> If you could add a set of more generic options, which Xe could later tie
>>>> into that would work for me. For instance we have some more natural
>>>> cross-over points than Tigerlake. So if not per individual platform,
>>>> maybe for like ring buffer -> execlists -> GuC transitions. And naming
>>>> them without saying legacy for now, but use some descriptive names, and
>>>> listing platform code names in help text. "Select this to support
>>>> Broadwell, Skylake, etc..", "Select this to support Sandybridge..". Out
>>>> of the tree Xe build can then just not use the corresponding defines in
>>>> its own build and it would achieve what you need?
>>>
>>> I kind of wanted to avoid adding a lot of config options, because I
>>> think they'll be difficult to maintain and get all the combos right. I
>>> don't particularly want all the build bot reports about various kconfig
>>> combos failing.
>
> Hm these should not be tricky to that extent to cause any combinatorial 
> issues. Famous last words? :)

Let's say you have some feature foobar that's required on platforms foo
and bar.

At the Makefile level a single option is simple:

i915-$(CONFIG_FOO) += foo.o

But foobar.o that's needed by both CONFIG_FOO and CONFIG_BAR already
gets tedious:

ifneq ($(CONFIG_FOO)$(CONFIG_BAR),nn)
	i915-y += foobar.o
endif

Similarly in code:

#if IS_ENABLED(CONFIG_FOO) || IS_ENABLED(CONFIG_BAR)

I think it's easy to mess up the combos when you add a lot of them. And
it'll look seriously ugly too, just with the two above! And kind of
defeats the purpose of "not having those ugly #ifdef I915" in the
driver. :/

>>> One other problem is that I can't think of a way to do this by using the
>>> kconfig CONFIG_FOO macros directly; you have to add separate variables
>>> because the same files are built for two drivers. You can't force the
>>> CONFIG_FOO macros to different settings for different drivers. So we'd
>>> get a lot of proxy macros too.
>>>
>>> I wonder if there's a name we could use instead of legacy to reasonably
>>> match what Xe needs to avoid adding tons of configs at once?
>> 
>> considering TGL itself is also "xe" arch (not to be confused with xe,
>> the kernel module), maybe CONFIG_DRM_I915_PRE_XE?
>
> Makes sense as a name I think. But why is the tricky question? :) Why do 
> Xe+ users deserve the privilege of being able to compile out the old 
> cruft but users of old machines cannot compile out Xe+? In other words 
> how to make the thing attractive for not just Xe (the driver).
>
> Mind you I am not really opposed, as long as it will be made in a 
> flexible way. Just would like to explore the option of making it more 
> widely useful.

Mmh, I just always thought there was no return on the investment. Too
few people need it to take on the burden?


BR,
Jani.

>
> Regards,
>
> Tvrtko

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-03-14 18:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 19:19 [Intel-xe] [RFC] drm/i915: add kconfig option to enable/disable legacy platform support Jani Nikula
2023-03-10  9:06 ` Tvrtko Ursulin
2023-03-10 10:11   ` Jani Nikula
2023-03-10 13:14     ` Ville Syrjälä
2023-03-10 13:36       ` Jani Nikula
2023-03-10 13:47         ` Ville Syrjälä
2023-03-10 13:54           ` Jani Nikula
2023-03-10 13:57             ` Ville Syrjälä
2023-03-10 14:26               ` Jani Nikula
2023-03-13 17:03 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-03-13 17:04 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-03-13 17:08 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-03-14 11:43 ` [Intel-xe] [RFC] " Jani Nikula
2023-03-14 12:52   ` Tvrtko Ursulin
2023-03-14 16:42     ` Jani Nikula
2023-03-14 17:22       ` Lucas De Marchi
2023-03-14 18:27         ` Tvrtko Ursulin
2023-03-14 18:48           ` Jani Nikula [this message]
2023-03-14 19:16           ` Mauro Carvalho Chehab
2023-03-14 19:17             ` Mauro Carvalho Chehab

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=871qlr6ufy.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.