Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
Cc: igt-dev@lists.freedesktop.org, ayaz.siddiqui@intel.com
Subject: Re: [PATCH i-g-t v5 2/6] lib/intel_blt: Update calculation of ccs_size and size_of_ctrl_copy
Date: Tue, 12 Dec 2023 09:28:46 +0000	[thread overview]
Message-ID: <de68644e-def3-443a-b3df-6414d60a41cd@intel.com> (raw)
In-Reply-To: <ee74ba991e506182a7f89eb4fda6197e26e58413.1702402592.git.akshata.jahagirdar@intel.com>

On 12/12/2023 17:39, Akshata Jahagirdar wrote:
> The Main-to-CCS Ratio for XE2 has been changed to 512:1.
> Update the CCS_RATIO macro to select relevant ratio based on platform.
> 
> Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
> ---
>   lib/intel_blt.c | 15 +++++++++------
>   lib/intel_blt.h |  2 +-
>   2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/intel_blt.c b/lib/intel_blt.c
> index 1116c978e..5399be20a 100644
> --- a/lib/intel_blt.c
> +++ b/lib/intel_blt.c
> @@ -948,15 +948,16 @@ int blt_block_copy(int fd,
>   	return ret;
>   }
>   
> -static uint16_t __ccs_size(const struct blt_ctrl_surf_copy_data *surf)
> +static uint16_t __ccs_size(int fd, const struct blt_ctrl_surf_copy_data *surf)
>   {
>   	uint32_t src_size, dst_size;
> +	uint16_t ccsratio = CCS_RATIO(fd);
>   
>   	src_size = surf->src.access_type == DIRECT_ACCESS ?
> -				surf->src.size : surf->src.size / CCS_RATIO;
> +				surf->src.size : surf->src.size / ccsratio;
>   
>   	dst_size = surf->dst.access_type == DIRECT_ACCESS ?
> -				surf->dst.size : surf->dst.size / CCS_RATIO;
> +				surf->dst.size : surf->dst.size / ccsratio;
>   
>   	igt_assert_f(src_size <= dst_size, "dst size must be >= src size for CCS copy\n");
>   
> @@ -1118,6 +1119,8 @@ uint64_t emit_blt_ctrl_surf_copy(int fd,
>   	uint64_t dst_offset, src_offset, bb_offset, alignment;
>   	uint32_t bbe = MI_BATCH_BUFFER_END;
>   	uint32_t *bb;
> +	uint16_t num_ccs_blocks = (ip_ver >= IP_VER(20, 0)) ?
> +				(xe_get_default_alignment(fd) / CCS_RATIO(fd)) : CCS_RATIO(fd);
>   
>   	igt_assert_f(ahnd, "ctrl-surf-copy supports softpin only\n");
>   	igt_assert_f(surf, "ctrl-surf-copy requires data to do ctrl-surf-copy blit\n");
> @@ -1136,7 +1139,7 @@ uint64_t emit_blt_ctrl_surf_copy(int fd,
>   		data.xe2.dw00.dst_access_type = surf->dst.access_type;
>   
>   		/* Ensure dst has size capable to keep src ccs aux */
> -		data.xe2.dw00.size_of_ctrl_copy = __ccs_size(surf) / CCS_RATIO - 1;
> +		data.xe2.dw00.size_of_ctrl_copy = __ccs_size(fd, surf) / num_ccs_blocks - 1;
>   		data.xe2.dw00.length = 0x3;
>   
>   		data.xe2.dw01.src_address_lo = src_offset;
> @@ -1155,7 +1158,7 @@ uint64_t emit_blt_ctrl_surf_copy(int fd,
>   		data.gen12.dw00.dst_access_type = surf->dst.access_type;
>   
>   		/* Ensure dst has size capable to keep src ccs aux */
> -		data.gen12.dw00.size_of_ctrl_copy = __ccs_size(surf) / CCS_RATIO - 1;
> +		data.gen12.dw00.size_of_ctrl_copy = __ccs_size(fd, surf) / num_ccs_blocks - 1;
>   		data.gen12.dw00.length = 0x3;
>   
>   		data.gen12.dw01.src_address_lo = src_offset;
> @@ -1808,7 +1811,7 @@ blt_create_object(const struct blt_copy_data *blt, uint32_t region,
>   			flags |= DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM;
>   
>   		size = ALIGN(size, xe_get_default_alignment(blt->fd));
> -		handle = xe_bo_create(blt->fd, 0, size, region, flags);
> +		handle = xe_bo_create_flags(blt->fd, 0, size, region);

create_flags() looks have been removed?

>   	} else {
>   		igt_assert(__gem_create_in_memory_regions(blt->fd, &handle,
>   							  &size, region) == 0);
> diff --git a/lib/intel_blt.h b/lib/intel_blt.h
> index 5934ccd67..69eb2195f 100644
> --- a/lib/intel_blt.h
> +++ b/lib/intel_blt.h
> @@ -52,7 +52,7 @@
>   #include "igt.h"
>   #include "intel_cmds_info.h"
>   
> -#define CCS_RATIO 256
> +#define CCS_RATIO(xe) (AT_LEAST_GEN(intel_get_drm_devid(xe), 20) ? 512 : 256)

Probably s/xe/intel/ or just fd, since this is not specific to xe, but 
is also used for i915.

>   
>   enum blt_color_depth {
>   	CD_8bit,

  reply	other threads:[~2023-12-12  9:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 17:39 [PATCH i-g-t v5 0/6] Compression support for Lunarlake Akshata Jahagirdar
2023-12-12  6:48 ` ✓ Fi.CI.BAT: success for " Patchwork
2023-12-12  7:44 ` ✗ Fi.CI.IGT: failure " Patchwork
2023-12-12  8:13 ` ✓ CI.xeBAT: success " Patchwork
2023-12-12 17:39 ` [PATCH i-g-t v5 1/6] lib: Add blt command properties for lunarlake Akshata Jahagirdar
2023-12-12 17:39 ` [PATCH i-g-t v5 2/6] lib/intel_blt: Update calculation of ccs_size and size_of_ctrl_copy Akshata Jahagirdar
2023-12-12  9:28   ` Matthew Auld [this message]
2023-12-13  7:12     ` Jahagirdar, Akshata
2023-12-12 17:39 ` [PATCH i-g-t v5 3/6] lib/intel_pat: Add uc_comp pat_index Akshata Jahagirdar
2023-12-12  9:19   ` Matthew Auld
2023-12-13  7:08     ` Jahagirdar, Akshata
2023-12-12 17:39 ` [PATCH i-g-t v5 4/6] lib/intel_blt: Update caching mode and pat_index Akshata Jahagirdar
2023-12-12  9:24   ` Matthew Auld
2023-12-13  7:09     ` Jahagirdar, Akshata
2023-12-12 17:39 ` [PATCH i-g-t v5 5/6] tests/intel/gem_ccs: Add compression support for Lunarlake Akshata Jahagirdar
2023-12-12  9:31   ` Matthew Auld
2023-12-13  7:16     ` Jahagirdar, Akshata
2023-12-12 17:39 ` [PATCH i-g-t v5 6/6] tests/intel/xe_ccs: " Akshata Jahagirdar
     [not found] <cover.1702386259.git.akshata.jahagirdar@intel.com>
2023-12-12 13:13 ` [PATCH i-g-t v5 2/6] lib/intel_blt: Update calculation of ccs_size and size_of_ctrl_copy Akshata Jahagirdar

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=de68644e-def3-443a-b3df-6414d60a41cd@intel.com \
    --to=matthew.auld@intel.com \
    --cc=akshata.jahagirdar@intel.com \
    --cc=ayaz.siddiqui@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