From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2371810E03A for ; Thu, 17 Mar 2022 16:45:50 +0000 (UTC) Date: Thu, 17 Mar 2022 17:45:46 +0100 From: Zbigniew =?utf-8?Q?Kempczy=C5=84ski?= To: igt-dev@lists.freedesktop.org Message-ID: References: <20220317102002.35243-1-zbigniew.kempczynski@intel.com> <20220317102002.35243-2-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220317102002.35243-2-zbigniew.kempczynski@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t 1/2] tests/i915/gem_ccs: Check ctrl-surf-copy in new context List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, Mar 17, 2022 at 11:20:01AM +0100, Zbigniew Kempczyński wrote: > From: Apoorva Singh > > Verify ccs data is binded to physical memory by using > XY_CTRL_SURF_COPY_BLT command in separate context. > > Signed-off-by: Apoorva Singh > Cc: Zbigniew Kempczyński > --- > tests/i915/gem_ccs.c | 36 +++++++++++++++++++++++++----------- > 1 file changed, 25 insertions(+), 11 deletions(-) > > diff --git a/tests/i915/gem_ccs.c b/tests/i915/gem_ccs.c > index fdf1fe75f5..1a21e24597 100644 > --- a/tests/i915/gem_ccs.c > +++ b/tests/i915/gem_ccs.c > @@ -39,6 +39,7 @@ struct test_config { > bool compression; > bool inplace; > bool surfcopy; > + bool new_ctx; > }; > > static void set_object(struct blt_copy_object *obj, > @@ -234,9 +235,8 @@ static void block_copy(int i915, > const intel_ctx_t *ctx, > const struct intel_execution_engine2 *e, > uint32_t region1, uint32_t region2, > - enum blt_tiling mid_tiling, bool compression, > - bool inplace, > - bool surfcopy) > + enum blt_tiling mid_tiling, > + const struct test_config *config) > { > struct blt_copy_data blt = {}; > struct blt_block_copy_data_ext ext = {}, *pext = &ext; > @@ -249,7 +249,7 @@ static void block_copy(int i915, > uint32_t run_id = mid_tiling; > uint32_t mid_region = region2, bb; > uint32_t width = param.width, height = param.height; > - enum blt_compression mid_compression = compression; > + enum blt_compression mid_compression = config->compression; > int mid_compression_format = param.compression_format; > enum blt_compression_type comp_type = COMPRESSION_TYPE_3D; > uint8_t uc_mocs = intel_get_uc_mocs(i915); > @@ -293,8 +293,17 @@ static void block_copy(int i915, > WRITE_PNG(i915, run_id, "src", &blt.src, width, height); > WRITE_PNG(i915, run_id, "mid", &blt.dst, width, height); > > - if (surfcopy && pext) > - surf_copy(i915, ctx, e, ahnd, src, mid, dst, run_id); > + if (config->surfcopy && pext) { > + const intel_ctx_t *surf_ctx = ctx; > + > + if (config->new_ctx) > + surf_ctx = intel_ctx_create(i915, &ctx->cfg); > + > + surf_copy(i915, surf_ctx, e, ahnd, src, mid, dst, run_id); There's one thing I would fix. Newly created context doesn't share vm so separate ahnd should be used here. -- Zbigniew > + > + if (surf_ctx != ctx) > + intel_ctx_destroy(i915, surf_ctx); > + } > > memset(&blt, 0, sizeof(blt)); > blt.color_depth = CD_32bit; > @@ -303,7 +312,7 @@ static void block_copy(int i915, > set_blt_object(&blt.dst, dst); > set_object_ext(&ext.src, mid_compression_format, width, height, SURFACE_TYPE_2D); > set_object_ext(&ext.dst, 0, width, height, SURFACE_TYPE_2D); > - if (inplace) { > + if (config->inplace) { > set_object(&blt.dst, mid->handle, dst->size, mid->region, 0, > T_LINEAR, COMPRESSION_DISABLED, comp_type); > blt.dst.ptr = mid->ptr; > @@ -367,10 +376,7 @@ static void block_copy_test(int i915, > param.compression_format, regtxt) { > block_copy(i915, ctx, e, > region1, region2, > - tiling, > - config->compression, > - config->inplace, > - config->surfcopy); > + tiling, config); > } > free(regtxt); > } > @@ -480,6 +486,14 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL) > block_copy_test(i915, &config, ctx, set); > } > > + igt_subtest_with_dynamic("ctrl-surf-copy-new-ctx") { > + struct test_config config = { .compression = true, > + .surfcopy = true, > + .new_ctx = true }; > + > + block_copy_test(i915, &config, ctx, set); > + } > + > igt_fixture { > igt_disallow_hang(i915, hang); > close(i915); > -- > 2.32.0 >