[PATCH] drm/i915/selftests: Pick correct caching mode.

Cavitt, Jonathan jonathan.cavitt at intel.com
Tue Mar 12 13:53:57 UTC 2024


-----Original Message-----
From: Das, Nirmoy <nirmoy.das at intel.com> 
Sent: Tuesday, March 12, 2024 4:18 AM
To: intel-gfx at lists.freedesktop.org
Cc: dri-devel at lists.freedesktop.org; Das, Nirmoy <nirmoy.das at intel.com>; Andi Shyti <andi.shyti at linux.intel.com>; Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>; Cavitt, Jonathan <jonathan.cavitt at intel.com>
Subject: [PATCH] drm/i915/selftests: Pick correct caching mode.
> 
> Caching mode is HW dependent so pick a correct one using
> intel_gt_coherent_map_type().
> 
> Cc: Andi Shyti <andi.shyti at linux.intel.com>
> Cc: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> Cc: Jonathan Cavitt <jonathan.cavitt at intel.com>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10249
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>

LGTM
Acked-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
> index d684a70f2c04..65a931ea80e9 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
> @@ -7,6 +7,7 @@
>  #include "i915_drv.h"
>  #include "i915_selftest.h"
>  #include "gem/i915_gem_context.h"
> +#include "gt/intel_gt.h"
>  
>  #include "mock_context.h"
>  #include "mock_dmabuf.h"
> @@ -155,6 +156,7 @@ static int verify_access(struct drm_i915_private *i915,
>  	struct file *file;
>  	u32 *vaddr;
>  	int err = 0, i;
> +	unsigned int mode;
>  
>  	file = mock_file(i915);
>  	if (IS_ERR(file))
> @@ -194,7 +196,8 @@ static int verify_access(struct drm_i915_private *i915,
>  	if (err)
>  		goto out_file;
>  
> -	vaddr = i915_gem_object_pin_map_unlocked(native_obj, I915_MAP_WB);
> +	mode = intel_gt_coherent_map_type(to_gt(i915), native_obj, true);
> +	vaddr = i915_gem_object_pin_map_unlocked(native_obj, mode);
>  	if (IS_ERR(vaddr)) {
>  		err = PTR_ERR(vaddr);
>  		goto out_file;
> -- 
> 2.42.0
> 
> 


More information about the Intel-gfx mailing list