[PATCH v3 1/2] drm/xe: Use dynamic allocation for tile and device VRAM region structures
Jani Nikula
jani.nikula at linux.intel.com
Wed Jun 25 09:00:00 UTC 2025
On Tue, 24 Jun 2025, Michal Wajdeczko <michal.wajdeczko at intel.com> wrote:
> On 24.06.2025 11:22, Piórkowski, Piotr wrote:
>> diff --git a/drivers/gpu/drm/xe/xe_assert.h b/drivers/gpu/drm/xe/xe_assert.h
>> index 68fe70ce2be3..cd63cdd2dc78 100644
>> --- a/drivers/gpu/drm/xe/xe_assert.h
>> +++ b/drivers/gpu/drm/xe/xe_assert.h
>> @@ -145,7 +145,7 @@
>> const struct xe_tile *__tile = (tile); \
>> char __buf[10] __maybe_unused; \
>> xe_assert_msg(tile_to_xe(__tile), condition, "tile: %u VRAM %s\n" msg, \
>> - __tile->id, ({ string_get_size(__tile->mem.vram.actual_physical_size, 1, \
>> + __tile->id, ({ string_get_size(__tile->mem.vram->actual_physical_size, 1, \
>> STRING_UNITS_2, __buf, sizeof(__buf)); __buf; }), ## arg); \
>> })
>>
>
> this assert will cause NPD on !DGFX, likely you need at least this:
>
> __tile->mem.vram ? __tile->mem.vram->actual_physical_size : 0
There'd be other benefits in adding abstractions for this, such as
making vram an opaque pointer and not requiring its definition be
included absolutely everywhere via xe_assert.h.
BR,
Jani.
--
Jani Nikula, Intel
More information about the Intel-xe
mailing list