[igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use COMPUTE instead of RENDER engine for Xe if missing

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Dec 7 07:24:35 UTC 2023


On Wed, Dec 06, 2023 at 08:45:12PM +0100, Dominik Grzegorzek wrote:
> Make engine fallback in intel_batchbuffer more generic. Up to this
> point, we were replacing render with compute only on PVC.
> Replace it whenever there is no compute engine. As was stated in
> 989920cfc4 this still remains only a workaround, more rework
> in intel-bb is necessary to better support both - i915 and xe.

Agree, this solution is more generic:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew

> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> ---
>  lib/intel_batchbuffer.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index 472c88129..1268ac8f0 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -2366,10 +2366,10 @@ __xe_bb_exec(struct intel_bb *ibb, uint64_t flags, bool sync)
>  			inst.engine_class = DRM_XE_ENGINE_CLASS_VIDEO_DECODE;
>  			break;
>  		case I915_EXEC_RENDER:
> -			if (IS_PONTEVECCHIO(xe_dev_id(ibb->fd)))
> -				inst.engine_class = DRM_XE_ENGINE_CLASS_COMPUTE;
> -			else
> +			if (xe_has_engine_class(ibb->fd, DRM_XE_ENGINE_CLASS_RENDER))
>  				inst.engine_class = DRM_XE_ENGINE_CLASS_RENDER;
> +			else
> +				inst.engine_class = DRM_XE_ENGINE_CLASS_COMPUTE;
>  			break;
>  		case I915_EXEC_VEBOX:
>  			inst.engine_class = DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE;
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list