From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: apoorva1.singh@intel.com
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t, v2 1/3] lib/i915: Introduce libraries i915_blt and intel_mocs
Date: Tue, 23 Nov 2021 13:34:27 +0100 [thread overview]
Message-ID: <20211123123427.GA12436@zkempczy-mobl2> (raw)
In-Reply-To: <20211122064849.785894-2-apoorva1.singh@intel.com>
On Mon, Nov 22, 2021 at 12:18:47PM +0530, apoorva1.singh@intel.com wrote:
<cut>
> +/*
> + * make_ctrl_surf_batch:
> + * @fd: open i915 drm file descriptor
> + * @batch_buf: the batch buffer to populate with the command
> + * @src: fd of the source BO
> + * @dst: fd of the destination BO
> + * @length: size of the ctrl surf in bytes
> + * @reloc: pointer to the relocation entyr for this command
> + * @src_mem_access: source memory type (denotes direct or indirect
> + * addressing)
> + * @dst_mem_acdcess: destination memory type (denotes direct or indirect
> + * addressing)
> + */
> +static int make_ctrl_surf_batch(int fd, uint32_t *batch_buf,
> + uint32_t src, uint32_t dst, uint32_t length,
> + struct drm_i915_gem_relocation_entry *reloc,
> + int src_mem_access, int dst_mem_access)
> +{
> + int num_ccs_blocks;
> + uint32_t *b = batch_buf;
> + uint8_t src_mocs = intel_get_uc_mocs(fd);
> + uint8_t dst_mocs = src_mocs;
> +
> + num_ccs_blocks = length / CCS_RATIO;
> + if (num_ccs_blocks < 1)
> + num_ccs_blocks = 1;
> + if (num_ccs_blocks > NUM_CCS_BLKS_PER_XFER)
> + return 0;
> +
> + /*
> + * We use logical AND with 1023 since the size field
> + * takes values which is in the range of 0 - 1023
> + */
> + b[0] = ((XY_CTRL_SURF_COPY_BLT) |
I've just realized myself this command is not available for gens where
relocations are enabled so all reloc stuff below can be removed.
--
Zbigniew
> + (src_mem_access << SRC_ACCESS_TYPE_SHIFT) |
> + (dst_mem_access << DST_ACCESS_TYPE_SHIFT) |
> + (((num_ccs_blocks - 1) & 1023) << CCS_SIZE_SHIFT));
> +
next prev parent reply other threads:[~2021-11-23 12:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 6:48 [igt-dev] [PATCH i-g-t,v2 0/3] Add testing for CCS apoorva1.singh
2021-11-22 6:48 ` [igt-dev] [PATCH i-g-t, v2 1/3] lib/i915: Introduce libraries i915_blt and intel_mocs apoorva1.singh
2021-11-22 9:00 ` Zbigniew Kempczyński
2021-11-22 9:03 ` Zbigniew Kempczyński
2021-11-23 12:34 ` Zbigniew Kempczyński [this message]
2021-11-23 13:23 ` Zbigniew Kempczyński
2021-11-22 6:48 ` [igt-dev] [PATCH i-g-t, v2 2/3] lib/intel_chipset.h: Add has_flat_ccs flag apoorva1.singh
2021-11-22 8:15 ` Zbigniew Kempczyński
2021-11-22 6:48 ` [igt-dev] [PATCH i-g-t,v2 3/3] i915/gem_ccs: Add testing for CCS apoorva1.singh
2021-11-25 7:55 ` [igt-dev] [PATCH i-g-t, v2 " Zbigniew Kempczyński
2021-11-22 8:36 ` [igt-dev] ✓ Fi.CI.BAT: success for Add testing for CCS (rev2) Patchwork
2021-11-22 10:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20211123123427.GA12436@zkempczy-mobl2 \
--to=zbigniew.kempczynski@intel.com \
--cc=apoorva1.singh@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