All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/xe: Allow building as kernel built-in
@ 2025-04-25 11:52 Harry Austen
  2025-04-29 11:56 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Harry Austen @ 2025-04-25 11:52 UTC (permalink / raw)
  To: intel-xe
  Cc: intel-gfx, linux-kernel, Harry Austen, Lucas De Marchi,
	Thomas Hellström, Jani Nikula

Fix Kconfig symbol dependency on KUNIT, which isn't actually required
for XE to be built-in. However, if KUNIT is enabled, it must be built-in
too.

Also, allow DRM_XE_DISPLAY to be built-in. But only as long as DRM_I915
isn't, since that results in duplicate symbol errors.

Fixes: 08987a8b6820 ("drm/xe: Fix build with KUNIT=m")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Harry Austen <hpausten@protonmail.com>
---
v3: Simplify KUNIT dependency, as suggested by Jani Nikula
v2: Ensure DRM_XE_DISPLAY and DRM_I915 can't both be built-in

 drivers/gpu/drm/xe/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index 9bce047901b22..214f40264fa12 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -1,7 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config DRM_XE
 	tristate "Intel Xe Graphics"
-	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
+	depends on DRM && PCI && MMU
+	depends on KUNIT || KUNIT=n
 	select INTERVAL_TREE
 	# we need shmfs for the swappable backing store, and in particular
 	# the shmem_readpage() which depends upon tmpfs
@@ -51,7 +52,7 @@ config DRM_XE
 
 config DRM_XE_DISPLAY
 	bool "Enable display support"
-	depends on DRM_XE && DRM_XE=m && HAS_IOPORT
+	depends on DRM_XE && (DRM_XE=m || DRM_I915!=y) && HAS_IOPORT
 	select FB_IOMEM_HELPERS if DRM_FBDEV_EMULATION
 	select I2C
 	select I2C_ALGOBIT
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/xe: Allow building as kernel built-in
  2025-04-25 11:52 [PATCH v3] drm/xe: Allow building as kernel built-in Harry Austen
@ 2025-04-29 11:56 ` Jani Nikula
  2025-04-30 12:52   ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2025-04-29 11:56 UTC (permalink / raw)
  To: Harry Austen, intel-xe
  Cc: intel-gfx, linux-kernel, Harry Austen, Lucas De Marchi,
	Thomas Hellström

On Fri, 25 Apr 2025, Harry Austen <hpausten@protonmail.com> wrote:
> Fix Kconfig symbol dependency on KUNIT, which isn't actually required
> for XE to be built-in. However, if KUNIT is enabled, it must be built-in
> too.
>
> Also, allow DRM_XE_DISPLAY to be built-in. But only as long as DRM_I915
> isn't, since that results in duplicate symbol errors.
>
> Fixes: 08987a8b6820 ("drm/xe: Fix build with KUNIT=m")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Harry Austen <hpausten@protonmail.com>

I didn't test this, but it makes sense to me.

Acked-by: Jani Nikula <jani.nikula@intel.com>

> ---
> v3: Simplify KUNIT dependency, as suggested by Jani Nikula
> v2: Ensure DRM_XE_DISPLAY and DRM_I915 can't both be built-in
>
>  drivers/gpu/drm/xe/Kconfig | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
> index 9bce047901b22..214f40264fa12 100644
> --- a/drivers/gpu/drm/xe/Kconfig
> +++ b/drivers/gpu/drm/xe/Kconfig
> @@ -1,7 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config DRM_XE
>  	tristate "Intel Xe Graphics"
> -	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
> +	depends on DRM && PCI && MMU
> +	depends on KUNIT || KUNIT=n
>  	select INTERVAL_TREE
>  	# we need shmfs for the swappable backing store, and in particular
>  	# the shmem_readpage() which depends upon tmpfs
> @@ -51,7 +52,7 @@ config DRM_XE
>  
>  config DRM_XE_DISPLAY
>  	bool "Enable display support"
> -	depends on DRM_XE && DRM_XE=m && HAS_IOPORT
> +	depends on DRM_XE && (DRM_XE=m || DRM_I915!=y) && HAS_IOPORT
>  	select FB_IOMEM_HELPERS if DRM_FBDEV_EMULATION
>  	select I2C
>  	select I2C_ALGOBIT

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/xe: Allow building as kernel built-in
  2025-04-29 11:56 ` Jani Nikula
@ 2025-04-30 12:52   ` Lucas De Marchi
  2025-04-30 13:51     ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2025-04-30 12:52 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Harry Austen, intel-xe, intel-gfx, linux-kernel,
	Thomas Hellström

On Tue, Apr 29, 2025 at 02:56:51PM +0300, Jani Nikula wrote:
>On Fri, 25 Apr 2025, Harry Austen <hpausten@protonmail.com> wrote:
>> Fix Kconfig symbol dependency on KUNIT, which isn't actually required
>> for XE to be built-in. However, if KUNIT is enabled, it must be built-in
>> too.
>>
>> Also, allow DRM_XE_DISPLAY to be built-in. But only as long as DRM_I915
>> isn't, since that results in duplicate symbol errors.
>>
>> Fixes: 08987a8b6820 ("drm/xe: Fix build with KUNIT=m")
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Signed-off-by: Harry Austen <hpausten@protonmail.com>
>
>I didn't test this, but it makes sense to me.
>
>Acked-by: Jani Nikula <jani.nikula@intel.com>

humn... but the end result is very odd: from my current config with DRM_XE=m,
DRM_XE_DISPLAY=y, DRM_I915=m. I then select DRM_I915=y and it (silently)
set DRM_XE_DISPLAY=n. So this would now be forbidden with no warning:

	CONFIG_DRM_I915=y
	CONFIG_DRM_XE=m
	CONFIG_DRM_XE_DISPLAY=y

Considering some distros have DRM_I915 as builtin, I don't think
that is a good outcome: it would basically block using display in xe and
a "make olddefconfig" would break. I think we really need to start
spliting the module and move the conflicting symbols.

Lucas De Marchi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/xe: Allow building as kernel built-in
  2025-04-30 12:52   ` Lucas De Marchi
@ 2025-04-30 13:51     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2025-04-30 13:51 UTC (permalink / raw)
  To: Lucas De Marchi
  Cc: Harry Austen, intel-xe, intel-gfx, linux-kernel,
	Thomas Hellström

On Wed, 30 Apr 2025, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> I think we really need to start spliting the module and move the
> conflicting symbols.

Start? I've been working on it for more than a year now.

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-30 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 11:52 [PATCH v3] drm/xe: Allow building as kernel built-in Harry Austen
2025-04-29 11:56 ` Jani Nikula
2025-04-30 12:52   ` Lucas De Marchi
2025-04-30 13:51     ` Jani Nikula

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.