public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Bai, Guangyao" <guangyao.bai@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Welty, Brian" <brian.welty@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 5/6] lib: Add vebox copy support
Date: Thu, 5 Dec 2019 15:49:12 +0200	[thread overview]
Message-ID: <20191205134912.GA2947@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <562BCC53BC554C42A16D802F463022A73E0E2BD1@SHSMSX101.ccr.corp.intel.com>

Hi Guangyao,

On Thu, Dec 05, 2019 at 05:30:49AM +0200, Bai, Guangyao wrote:
> > [...]
> > +
> > +static void emit_tiling_convert_cmd(struct intel_batchbuffer *batch,
> > +				    drm_intel_bo *input_bo,
> > +				    uint32_t input_tiling,
> > +				    uint32_t input_compression,
> > +				    drm_intel_bo *output_bo,
> > +				    uint32_t output_tiling,
> > +				    uint32_t output_compression)
> > +{
> > +	uint32_t reloc_delta;
> > +	struct vebox_tiling_convert *tc;
> > +	int ret;
> > +
> > +	tc = intel_batchbuffer_subdata_alloc(batch, sizeof(*tc), 8);
> > +
> > +	tc->tc0.cmd_type = 3;
> > +	tc->tc0.pipeline = 2;
> > +	tc->tc0.cmd_opcode = 4;
> > +	tc->tc0.sub_opcode_b = 1;
> > +
> > +	tc->tc0.dw_count = 3;
> > +
> > +	if (input_compression != I915_COMPRESSION_NONE) {
> > +		tc->tc1_2.input_memory_compression_enable = 1;
> > +		tc->tc1_2.input_compression_type =
> > +			input_compression == I915_COMPRESSION_RENDER;
> > +	}
> > +	tc->tc1_2.input_tiled_resource_mode = input_tiling == I915_TILING_Yf;
> > +	reloc_delta = tc->tc1_2_l;
> > +
> > +	igt_assert(input_bo->offset64 == ALIGN(input_bo->offset64, 0x1000));
> > +	tc->tc1_2.input_address = input_bo->offset64 >> 12;
> > +	igt_assert(reloc_delta <= INT32_MAX);
> > +	ret = drm_intel_bo_emit_reloc(batch->bo,
> > +				      intel_batchbuffer_subdata_offset(batch, tc)
> > +
> > +					offsetof(typeof(*tc), tc1_2),
> > +				      input_bo, reloc_delta,
> > +				      0, 0);
> > +	igt_assert(ret == 0);
> > +
> > +	if (output_compression != I915_COMPRESSION_NONE) {
> > +		tc->tc3_4.output_memory_compression_enable = 1;
> > +		tc->tc3_4.output_compression_type =
> > +			output_compression == I915_COMPRESSION_RENDER;
> > +	}
> > +	tc->tc3_4.output_tiled_resource_mode = output_tiling == I915_TILING_Yf;
> > +	reloc_delta = tc->tc3_4_l;
> > +
> > +	igt_assert(output_bo->offset64 == ALIGN(output_bo->offset64, 0x1000));
> 
> The Offset64 you gona to align with 4K?

This check here only makes sure that the main surface base address is
sufficiently aligned for the tiling convert command (which requires only
4K alignment).

The base address for main surfaces that are compressed (either render or
media) is already 64K aligned, see aux_pgtable_find_free_range().

> and for the Aux mapping stride(unit), you are using 4K also? Pls check
> the mapping unit and VA define, it should be both 4K or 64K

The main surface stride is aligned to 4 tiles. Since each tile is 32
pixels wide (for 32bpp formats), the main surface stride in bytes is
aligned to

4 tile * 32 pixel/tile * 4 byte/pixel = 512 byte

(or the tile row is aligned to 4 tile * 4kbyte/tile = 16kbyte).

This means the stride for the CCS AUX surface will be aligned to 64
bytes (as one cache line on the CCS AUX surface maps 4 tiles on the main
surface).

--Imre

> 
> > +	tc->tc3_4.output_address = output_bo->offset64 >> 12;
> > +	igt_assert(reloc_delta <= INT32_MAX);
> > +	ret = drm_intel_bo_emit_reloc(batch->bo,
> > +				      intel_batchbuffer_subdata_offset(batch, tc)
> > +
> > +					offsetof(typeof(*tc), tc3_4),
> > +				      output_bo, reloc_delta,
> > +				      0, I915_GEM_DOMAIN_RENDER);
> > +	igt_assert(ret == 0);
> > +
> > +}
> > +
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-12-05 13:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 10:38 [igt-dev] [PATCH i-g-t 0/6] lib: Add tests validating media compressed surfaces Imre Deak
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 1/6] tests/gem_render_copy: Make subtest parameters more explicit Imre Deak
2019-12-03 11:52   ` Kahola, Mika
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 2/6] tests/gem_render_copy: Separate out mixed tiled ccs subtests Imre Deak
2019-12-03 14:31   ` Kahola, Mika
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 3/6] lib: Move aux pgtable state prepare/emit to intel_aux_pgtable.c Imre Deak
2019-12-03 14:50   ` Kahola, Mika
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 4/6] lib/intel_aux_pgtable: Set MMIO remap for write the AUX pagedir reg Imre Deak
2019-12-04 12:35   ` Kahola, Mika
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 5/6] lib: Add vebox copy support Imre Deak
2019-12-04 13:09   ` Kahola, Mika
2019-12-04 13:49   ` [igt-dev] [PATCH v2 " Imre Deak
2019-12-05 10:30     ` Kahola, Mika
2019-12-05  3:30   ` [igt-dev] [PATCH i-g-t " Bai, Guangyao
2019-12-05 13:49     ` Imre Deak [this message]
2019-11-29 10:38 ` [igt-dev] [PATCH i-g-t 6/6] tests/gem_render_copy: Add media compression subtests Imre Deak
2019-12-04 13:50   ` [igt-dev] [PATCH v2 " Imre Deak
2019-12-05 11:28     ` Kahola, Mika
2019-11-29 11:19 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Add tests validating media compressed surfaces Patchwork
2019-11-30  6:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-12-04 15:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib: Add tests validating media compressed surfaces (rev3) Patchwork
2019-12-04 15:59   ` Imre Deak
2019-12-09  8:36     ` Imre Deak
2019-12-09  9:55       ` Vudum, Lakshminarayana
2019-12-09  9:40 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205134912.GA2947@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=brian.welty@intel.com \
    --cc=guangyao.bai@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox