dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix one wrong caching mode enum usage
@ 2023-07-07 12:55 Tvrtko Ursulin
  2023-07-07 13:23 ` [Intel-gfx] " Upadhyay, Tejas
  0 siblings, 1 reply; 3+ messages in thread
From: Tvrtko Ursulin @ 2023-07-07 12:55 UTC (permalink / raw)
  To: Intel-gfx, dri-devel; +Cc: Daniele Ceraolo Spurio, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Commit a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch
buffer") mistakenly passed in uapi I915_CACHING_CACHED as argument to
i915_gem_object_set_cache_coherency(), which actually takes internal
enum i915_cache_level.

No functional issue since the value matches I915_CACHE_LLC (1 == 1), which
is the intended caching mode, but lets clean it up nevertheless.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch buffer")
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c
index 126269a0d728..065099362a98 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
@@ -676,7 +676,7 @@ __vm_create_scratch_for_read(struct i915_address_space *vm, unsigned long size)
 	if (IS_ERR(obj))
 		return ERR_CAST(obj);
 
-	i915_gem_object_set_cache_coherency(obj, I915_CACHING_CACHED);
+	i915_gem_object_set_cache_coherency(obj, I915_CACHE_LLC);
 
 	vma = i915_vma_instance(obj, vm, NULL);
 	if (IS_ERR(vma)) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [Intel-gfx] [PATCH] drm/i915: Fix one wrong caching mode enum usage
  2023-07-07 12:55 [PATCH] drm/i915: Fix one wrong caching mode enum usage Tvrtko Ursulin
@ 2023-07-07 13:23 ` Upadhyay, Tejas
  2023-07-10  9:24   ` Tvrtko Ursulin
  0 siblings, 1 reply; 3+ messages in thread
From: Upadhyay, Tejas @ 2023-07-07 13:23 UTC (permalink / raw)
  To: Tvrtko Ursulin, Intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Tvrtko Ursulin
> Sent: Friday, July 7, 2023 6:25 PM
> To: Intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH] drm/i915: Fix one wrong caching mode enum
> usage
> 
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Commit a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch
> buffer") mistakenly passed in uapi I915_CACHING_CACHED as argument to
> i915_gem_object_set_cache_coherency(), which actually takes internal enum
> i915_cache_level.
> 
> No functional issue since the value matches I915_CACHE_LLC (1 == 1), which
> is the intended caching mode, but lets clean it up nevertheless.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Fixes: a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch
> buffer")
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c
> b/drivers/gpu/drm/i915/gt/intel_gtt.c
> index 126269a0d728..065099362a98 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
> @@ -676,7 +676,7 @@ __vm_create_scratch_for_read(struct
> i915_address_space *vm, unsigned long size)
>  	if (IS_ERR(obj))
>  		return ERR_CAST(obj);
> 
> -	i915_gem_object_set_cache_coherency(obj,
> I915_CACHING_CACHED);
> +	i915_gem_object_set_cache_coherency(obj, I915_CACHE_LLC);

Yes.
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>

> 
>  	vma = i915_vma_instance(obj, vm, NULL);
>  	if (IS_ERR(vma)) {
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Fix one wrong caching mode enum usage
  2023-07-07 13:23 ` [Intel-gfx] " Upadhyay, Tejas
@ 2023-07-10  9:24   ` Tvrtko Ursulin
  0 siblings, 0 replies; 3+ messages in thread
From: Tvrtko Ursulin @ 2023-07-10  9:24 UTC (permalink / raw)
  To: Upadhyay, Tejas, Intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org


On 07/07/2023 14:23, Upadhyay, Tejas wrote:
> 
> 
>> -----Original Message-----
>> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
>> Tvrtko Ursulin
>> Sent: Friday, July 7, 2023 6:25 PM
>> To: Intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
>> Subject: [Intel-gfx] [PATCH] drm/i915: Fix one wrong caching mode enum
>> usage
>>
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Commit a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch
>> buffer") mistakenly passed in uapi I915_CACHING_CACHED as argument to
>> i915_gem_object_set_cache_coherency(), which actually takes internal enum
>> i915_cache_level.
>>
>> No functional issue since the value matches I915_CACHE_LLC (1 == 1), which
>> is the intended caching mode, but lets clean it up nevertheless.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Fixes: a4d86249c773 ("drm/i915/gt: Provide a utility to create a scratch
>> buffer")
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_gtt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c
>> b/drivers/gpu/drm/i915/gt/intel_gtt.c
>> index 126269a0d728..065099362a98 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gtt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
>> @@ -676,7 +676,7 @@ __vm_create_scratch_for_read(struct
>> i915_address_space *vm, unsigned long size)
>>   	if (IS_ERR(obj))
>>   		return ERR_CAST(obj);
>>
>> -	i915_gem_object_set_cache_coherency(obj,
>> I915_CACHING_CACHED);
>> +	i915_gem_object_set_cache_coherency(obj, I915_CACHE_LLC);
> 
> Yes.
> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>

Pushed, thanks for the review!

Regards,

Tvrtko

> 
>>
>>   	vma = i915_vma_instance(obj, vm, NULL);
>>   	if (IS_ERR(vma)) {
>> --
>> 2.39.2
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-10  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 12:55 [PATCH] drm/i915: Fix one wrong caching mode enum usage Tvrtko Ursulin
2023-07-07 13:23 ` [Intel-gfx] " Upadhyay, Tejas
2023-07-10  9:24   ` Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox