[PATCH v6 8/9] drm/xe/xe2: Modify xe_bo_test for system memory

Thomas Hellström thomas.hellstrom at linux.intel.com
Thu Dec 7 13:00:00 UTC 2023


On 12/7/23 10:19, Himal Prasad Ghimiray wrote:
> Modify test to valid ccs clear and copy during evict/restore on
> igfx.
>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>


> ---
>   drivers/gpu/drm/xe/tests/xe_bo.c | 23 ++++++++++++++++-------
>   1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c
> index 549ab343de80..5e4e19a246dc 100644
> --- a/drivers/gpu/drm/xe/tests/xe_bo.c
> +++ b/drivers/gpu/drm/xe/tests/xe_bo.c
> @@ -112,16 +112,21 @@ static void ccs_test_run_gt(struct xe_device *xe, struct xe_gt *gt,
>   			    struct kunit *test)
>   {
>   	struct xe_bo *bo;
> -	u32 vram_bit;
> +	u32 mem_bit;
>   	int ret;
>   
>   	/* TODO: Sanity check */
> -	vram_bit = XE_BO_CREATE_VRAM0_BIT << gt_to_tile(gt)->id;
> -	kunit_info(test, "Testing gt id %u vram id %u\n", gt->info.id,
> -		   gt_to_tile(gt)->id);
>   
> -	bo = xe_bo_create_locked(xe, NULL, NULL, SZ_1M, ttm_bo_type_device,
> -				 vram_bit);
> +	mem_bit = IS_DGFX(xe) ? XE_BO_CREATE_VRAM0_BIT << gt_to_tile(gt)->id :
> +				XE_BO_CREATE_SYSTEM_BIT;
> +
> +	if (IS_DGFX(xe))
> +		kunit_info(test, "Testing gt id %u vram id %u\n", gt->info.id, gt_to_tile(gt)->id);
> +	else
> +		kunit_info(test, "Testing system memory\n");
> +
> +	bo = xe_bo_create_user(xe, NULL, NULL, SZ_1M, DRM_XE_GEM_CPU_CACHING_WC,
> +			       ttm_bo_type_device, mem_bit);
>   	if (IS_ERR(bo)) {
>   		KUNIT_FAIL(test, "Failed to create bo.\n");
>   		return;
> @@ -160,8 +165,12 @@ static int ccs_test_run_device(struct xe_device *xe)
>   
>   	xe_device_mem_access_get(xe);
>   
> -	for_each_gt(gt, xe, id)
> +	for_each_gt(gt, xe, id) {
> +		/* For igfx run only for primary gt */
> +		if (!IS_DGFX(xe) && id > 0)
> +			continue;
>   		ccs_test_run_gt(xe, gt, test);
> +	}
>   
>   	xe_device_mem_access_put(xe);
>   


More information about the Intel-xe mailing list