[Intel-gfx] [PATCH] drm/i915/selftests: do not try misaligned_pin test on unmappable memory

Andrzej Hajda andrzej.hajda at intel.com
Thu Aug 25 15:21:01 UTC 2022



On 25.08.2022 17:13, Matthew Auld wrote:
> On 25/08/2022 15:52, Andrzej Hajda wrote:
>> In case of Small BAR configurations stolen local memory can be 
>> unmappable.
>> Trying to test it causes -ENOSPC error from 
>> _i915_gem_object_stolen_init.
>>
>> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565
>> Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
>
> Ah right. That failure makes perfect sense now :)
>
>> ---
>>   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c 
>> b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> index fb5e6196347925..667c4c004bdbcf 100644
>> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> @@ -1164,6 +1164,10 @@ static int misaligned_pin(struct 
>> i915_address_space *vm,
>>           if (hole_size < 3 * min_alignment)
>>               continue;
>>   +        /* avoid -ENOSPC on unmappable memory */
>> +        if (!mr->io_size)
>> +            continue;
>
> We could also pass I915_BO_ALLOC_GPU_ONLY when calling 
> i915_gem_object_create_region(), since nothing actually needs to CPU 
> access that memory, and then we still get coverage here for stolen? 
> What do you think?

I agree, I've just tested it successfully.

Regards
Andrzej


>
>> +
>>           /* we can't test < 4k alignment due to flags being encoded 
>> in lower bits */
>>           if (min_alignment != I915_GTT_PAGE_SIZE_4K) {
>>               err = misaligned_case(vm, mr, addr + (min_alignment / 
>> 2), size, flags);



More information about the Intel-gfx mailing list