[PATCH i-g-t v1 1/3] lib/igt_vc4: Fix musl libc compilation
Maíra Canal
mcanal at igalia.com
Fri Jul 11 14:45:27 UTC 2025
Hi Kamil,
On 11/07/25 08:32, Kamil Konieczny wrote:
> Hi ,
> On 2025-07-10 at 21:00:14 +0200, Kamil Konieczny wrote:
>> Fix gcc compilation on Void Linux with musl C libs, where
>> PAGE_SIZE is already defined.
>>
>
> Sorry, I forgot adding vc4 developers to Cc:
>
> Cc: "Maíra Canal" <mcanal at igalia.com>
> Cc: Melissa Wen <mwen at igalia.com>
> Cc: Louis Chauvet <louis.chauvet at bootlin.com>
> Cc: Vignesh Raman <vignesh.raman at collabora.com>
>
> Also +cc Andrzej Hajda <andrzej.hajda at intel.com>
>
>> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
>> ---
>> lib/igt_vc4.h | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
>> index fe7173c50..165872ba2 100644
>> --- a/lib/igt_vc4.h
>> +++ b/lib/igt_vc4.h
>> @@ -31,7 +31,13 @@
>> #include "igt_fb.h"
>> #include "vc4_drm.h"
>>
>> -#define PAGE_SIZE 4096
>> +#ifndef PAGE_SIZE
>> +# define PAGE_SIZE 4096
>> +#else
>> +# if PAGE_SIZE != 4096
>> +# error "Unexpected PAGE_SIZE"
>> +# endif
>> +#endif
>
> I am not sure if vc4 needs exactly 4KB as bo, or is it good
> to have whatever comes from compilation environment?
The GPU uses 4KB pages, so, that's the reason we define PAGE_SIZE to
4096. It would be ideal to keep using the size of 4096 in vc4 tests.
Hence, I'd suggest you to just rename PAGE_SIZE to something like
GPU_PAGE_SIZE or VC4_PAGE_SIZE.
Thanks for CCing me!
Best Regards,
- Maíra
> Other proposed change was smaller:
>
> #ifndef PAGE_SIZE
> #define PAGE_SIZE 4096
> #endif
>
> Regards,
> Kamil
>
>>
>> uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
>> int igt_vc4_create_bo(int fd, size_t size);
>> --
>> 2.50.1
>>
More information about the igt-dev
mailing list