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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8EBDC74A44 for ; Tue, 14 Mar 2023 19:16:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A67B710E89C; Tue, 14 Mar 2023 19:16:56 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1E4A10E89A for ; Tue, 14 Mar 2023 19:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678821414; x=1710357414; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xjEHgTnXWVl0xFoV+z4v3gv0EAP3EhU9ESoUPH3IU8g=; b=j/QHY8NhWA8RVzbMpoDx5HO4h7GQCKhvIsh03BMQppaqovfRh64Jcrqu 3SJbqGoSoXdE4tntgIhYeKtrSpxpPtQc/FndySvNRKVFIvtUzG4Q9UV+V YFvSE3NrDYLgNFdVveJ5Fg4FMFHIomGsl7LEQyE4v2JmAnsUzZTY9o3mv a3CdI0p75RC67xSxg7eXQ3Wpbr2v+6pY9zIaDY9m58V7bfN2jmsIFR9tN aeRobSb2t8gB1JL0JS3XHctUNqn0w9ssKQLTe7k24IOm/V8UNBqFF4miL Kxbx/g4nWy8A7F9U6uaYSB0UL2LqCrKZsw4L7KfY02U4H4cCdrP6RQN9B w==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="339885331" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="339885331" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 12:16:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="709401790" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="709401790" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 14 Mar 2023 12:16:53 -0700 Received: from maurocar-mobl2 (maurocar-mobl2.ger.corp.intel.com [10.252.14.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 78A1858047E; Tue, 14 Mar 2023 12:16:51 -0700 (PDT) Date: Tue, 14 Mar 2023 20:16:48 +0100 From: Mauro Carvalho Chehab To: Tvrtko Ursulin Message-ID: <20230314201648.6b823d17@maurocar-mobl2> In-Reply-To: <93bb2619-348d-4061-ac7c-a5f4804fc8a8@linux.intel.com> References: <20230309191923.670451-1-jani.nikula@intel.com> <877cvj7e39.fsf@intel.com> <36d68f73-d344-92b1-171e-5e39ed1af651@linux.intel.com> <874jqn708f.fsf@intel.com> <20230314172237.424zwdox7mnod5s4@ldmartin-desk2.lan> <93bb2619-348d-4061-ac7c-a5f4804fc8a8@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Intel-xe] [RFC] drm/i915: add kconfig option to enable/disable legacy platform support X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Joonas Lahtinen , Lucas De Marchi , "Shankar, Uma" , Rodrigo Vivi , intel-xe@lists.freedesktop.org, Ville =?UTF-8?B?U3lyasOkbMOk?= Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, 14 Mar 2023 18:27:33 +0000 Tvrtko Ursulin wrote: > On 14/03/2023 17:22, Lucas De Marchi wrote: > > On Tue, Mar 14, 2023 at 06:42:56PM +0200, Jani Nikula wrote: =20 > >> On Tue, 14 Mar 2023, Tvrtko Ursulin =20 > >> wrote: =20 > >>> On 14/03/2023 11:43, Jani Nikula wrote: =20 > >>>> On Thu, 09 Mar 2023, Jani Nikula wrote: =20 > >>>>> 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 intent= ion > >>>>> is that it's not used in code. Instead, we'll pass -DI915_LEGACY=3D= 1 in > >>>>> the i915 Makefile for CONFIG_DRM_I915_LEGACY=3Dy, while the xe Make= file > >>>>> does no such thing, regardless of the kconfig value. > >>>>> > >>>>> Initially, the knob does the bare minimum: drops the legacy platfor= ms > >>>>> from module PCI ID table (and the compiler in turn automagically dr= ops > >>>>> all the unreferenced device infos). > >>>>> > >>>>> Cc: Rodrigo Vivi > >>>>> Cc: Joonas Lahtinen > >>>>> Cc: Tvrtko Ursulin > >>>>> Cc: Maarten Lankhorst > >>>>> Cc: Lucas De Marchi > >>>>> Cc: Ville Syrj=C3=A4l=C3=A4 =20 > >>>> > >>>> The discussion stalled a bit. > >>>> > >>>> Do we have consensus to start adding this to upstream i915? =20 > >>> > >>> 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. =20 > >> > >> I don't disagree. Partially the idea with "legacy" was to be a bit > >> vague, so we could tweak what it really means later. > >> =20 > >>> 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, a= nd > >>> listing platform code names in help text. "Select this to support > >>> Broadwell, Skylake, etc..", "Select this to support Sandybridge..". O= ut > >>> of the tree Xe build can then just not use the corresponding defines = in > >>> its own build and it would achieve what you need? =20 > >> > >> 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. =20 >=20 > Hm these should not be tricky to that extent to cause any combinatorial=20 > issues. Famous last words? :) >=20 > >> One other problem is that I can't think of a way to do this by using t= he > >> 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? =20 > >=20 > > considering TGL itself is also "xe" arch (not to be confused with xe, > > the kernel module), maybe CONFIG_DRM_I915_PRE_XE? =20 >=20 > Makes sense as a name I think. Agreed. This is a way better than LEGACY, but, assuming that such patch is not for internal-only consumption, this needs to be translated into a Kconfig option like "enable support for pre-Tiger Lake integrated graphic= s", e. g. translating into something understandable for the customers. > But why is the tricky question? :) Why do=20 > Xe+ users deserve the privilege of being able to compile out the old=20 > cruft but users of old machines cannot compile out Xe+? In other words=20 > how to make the thing attractive for not just Xe (the driver). Yeah, for me, it makes a lot more sense to disable i915 support for the platforms that Xe driver also support, e. g. we would need also a CONFIG_DRM_I915_XE to allow disabling i915 support for GPUs=20 supported by Xe. When enabled, this can be used to let Xe-supported PCI IDs to be probed by Xe driver, instead of i915. Yet, it sounds a little bit premature to have this, at least while not all GPU Xe models features supported by i915 driver for TGL+ are implemented. So, maybe we need to describe this as experimental, having a default to "N". Regards, Mauro