[Intel-xe] [PATCH 2/2] drm/xe: Fix build with KUNIT=m

Lucas De Marchi lucas.demarchi at intel.com
Mon Nov 13 13:47:03 UTC 2023


On Mon, Nov 13, 2023 at 12:04:32PM +0200, Jani Nikula wrote:
>On Thu, 09 Nov 2023, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
>> Due to the current integration between "live" xe kunit tests and kunit,
>> it's not possible to have a build with the following combination:
>>
>> 	CONFIG_DRM_XE=y
>> 	CONFIG_KUNIT=m
>>
>> ... even if kconfig doesn't block it. The reason for the failure is that
>> some compilation units are pulled in xe.ko:
>>
>> 	drivers/gpu/drm/xe/xe_bo.c:#include "tests/xe_bo.c"
>> 	drivers/gpu/drm/xe/xe_dma_buf.c:#include "tests/xe_dma_buf.c"
>> 	drivers/gpu/drm/xe/xe_migrate.c:#include "tests/xe_migrate.c"
>> 	drivers/gpu/drm/xe/xe_pci.c:#include "tests/xe_pci.c"
>>
>> Those files shouldn't use symbols from kunit, which should be reserved
>> to the tests/*_test.c files. Detangling this dependency doesn't seem
>> very straightforward, so fix the immediate issue instructing kconfig to
>> block the problematic configuration.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> ---
>>  drivers/gpu/drm/xe/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
>> index 2fa2d6dacb96..5b3da06e7ba3 100644
>> --- a/drivers/gpu/drm/xe/Kconfig
>> +++ b/drivers/gpu/drm/xe/Kconfig
>> @@ -1,7 +1,7 @@
>>  # SPDX-License-Identifier: GPL-2.0-only
>>  config DRM_XE
>>  	tristate "Intel Xe Graphics"
>> -	depends on DRM && PCI && MMU
>> +	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
>
>What do plain m and y mean here?

m == this config set to m
y == this config set to y

Lucas De Marchi

>
>BR,
>Jani.
>
>>  	select INTERVAL_TREE
>>  	# we need shmfs for the swappable backing store, and in particular
>>  	# the shmem_readpage() which depends upon tmpfs
>
>-- 
>Jani Nikula, Intel


More information about the Intel-xe mailing list