diff mbox series

drm/i915/selftests: allow misaligned_pin test work with unmappable memory

Message ID 20220825154239.52343-1-andrzej.hajda@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftests: allow misaligned_pin test work with unmappable memory | expand

Commit Message

Andrzej Hajda Aug. 25, 2022, 3:42 p.m. UTC
In case of Small BAR configurations stolen local memory can be unmappable.
Since the test does not touch the memory, passing I915_BO_ALLOC_GPU_ONLY
flag to i915_gem_object_create_region, will prevent -ENOSPC error from
_i915_gem_object_stolen_init.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Auld Aug. 25, 2022, 3:46 p.m. UTC | #1
On 25/08/2022 16:42, Andrzej Hajda wrote:
> In case of Small BAR configurations stolen local memory can be unmappable.
> Since the test does not touch the memory, passing I915_BO_ALLOC_GPU_ONLY
> flag to i915_gem_object_create_region, will prevent -ENOSPC error from
> _i915_gem_object_stolen_init.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
>   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index fb5e6196347925..e050a2de5fd1df 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -1080,7 +1080,7 @@ static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
>   	bool is_stolen = mr->type == INTEL_MEMORY_STOLEN_SYSTEM ||
>   			 mr->type == INTEL_MEMORY_STOLEN_LOCAL;
>   
> -	obj = i915_gem_object_create_region(mr, size, 0, 0);
> +	obj = i915_gem_object_create_region(mr, size, 0, I915_BO_ALLOC_GPU_ONLY);
>   	if (IS_ERR(obj)) {
>   		/* if iGVT-g or DMAR is active, stolen mem will be uninitialized */
>   		if (PTR_ERR(obj) == -ENODEV && is_stolen)
Matthew Auld Aug. 30, 2022, 12:53 p.m. UTC | #2
On 25/08/2022 16:46, Matthew Auld wrote:
> On 25/08/2022 16:42, Andrzej Hajda wrote:
>> In case of Small BAR configurations stolen local memory can be 
>> unmappable.
>> Since the test does not touch the memory, passing I915_BO_ALLOC_GPU_ONLY
>> flag to i915_gem_object_create_region, will prevent -ENOSPC error from
>> _i915_gem_object_stolen_init.
>>
>> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6565
>> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Pushed to drm-intel-gt-next. Thanks for the fix.

> 
>> ---
>>   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c 
>> b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> index fb5e6196347925..e050a2de5fd1df 100644
>> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> @@ -1080,7 +1080,7 @@ static int misaligned_case(struct 
>> i915_address_space *vm, struct intel_memory_re
>>       bool is_stolen = mr->type == INTEL_MEMORY_STOLEN_SYSTEM ||
>>                mr->type == INTEL_MEMORY_STOLEN_LOCAL;
>> -    obj = i915_gem_object_create_region(mr, size, 0, 0);
>> +    obj = i915_gem_object_create_region(mr, size, 0, 
>> I915_BO_ALLOC_GPU_ONLY);
>>       if (IS_ERR(obj)) {
>>           /* if iGVT-g or DMAR is active, stolen mem will be 
>> uninitialized */
>>           if (PTR_ERR(obj) == -ENODEV && is_stolen)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index fb5e6196347925..e050a2de5fd1df 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1080,7 +1080,7 @@  static int misaligned_case(struct i915_address_space *vm, struct intel_memory_re
 	bool is_stolen = mr->type == INTEL_MEMORY_STOLEN_SYSTEM ||
 			 mr->type == INTEL_MEMORY_STOLEN_LOCAL;
 
-	obj = i915_gem_object_create_region(mr, size, 0, 0);
+	obj = i915_gem_object_create_region(mr, size, 0, I915_BO_ALLOC_GPU_ONLY);
 	if (IS_ERR(obj)) {
 		/* if iGVT-g or DMAR is active, stolen mem will be uninitialized */
 		if (PTR_ERR(obj) == -ENODEV && is_stolen)