[Intel-xe] [RFC PATCH 14/20] drm/xe: Add function to clear scanout flag

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri May 5 08:43:41 UTC 2023


Hey,

We don't clear scanout on Xe, it should be set only once by userspace as 
a flag to determine caching mode

for VM_BIND, it shouldn't ever be cleared in xe display code.

~Maarten

On 2023-05-05 10:29, Jouni Högander wrote:
> Add function to clear scanout flag. This will be called by frontbuffer
> tracking code.
>
> Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
> ---
>   drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
> index c40bb27ac72a..dec11721ef6a 100644
> --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
> +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
> @@ -4,11 +4,22 @@
>   #include <uapi/drm/i915_drm.h>
>   #include <drm/drm_mm.h>
>   
> -struct xe_bo;
> +#include <xe_bo.h>
> +#include <xe_bo_types.h>
>   
>   struct i915_vma {
>   	struct xe_bo *bo, *dpt;
>   	struct drm_mm_node node;
>   };
>   
> +static inline void i915_ggtt_clear_scanout(struct xe_bo *bo)
> +{
> +	int ret;
> +
> +	ret = ttm_bo_reserve(&bo->ttm, true, false, NULL);
> +	XE_WARN_ON(ret);
> +	bo->flags &= ~XE_BO_SCANOUT_BIT;
> +	ttm_bo_unreserve(&bo->ttm);
> +}
> +
>   #endif


More information about the Intel-xe mailing list