Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/4] lib/igt_fb/tgl+: Prevent CCS FB UV surface offset overalignment
Date: Wed, 27 Oct 2021 12:46:11 +0300	[thread overview]
Message-ID: <YXkf464pWE0LUrXy@intel.com> (raw)
In-Reply-To: <20211026212620.2718277-3-imre.deak@intel.com>

On Wed, Oct 27, 2021 at 12:26:18AM +0300, Imre Deak wrote:
> The offset of semiplanar UV surfaces in CCS FBs must be 64 kbyte aligned
> as required by the Vebox engine which IGT uses to convert between tiling
> formats. At the same time the display engine requires the offset to be
> tile-row aligned. So far we ensured both of these alignment requirements
> by aligning all color surface widths/heights to 4x4 tiles. This however
> wastes memory in case the number of tiles in one tile-row modulo 16 is 0
> or 8 where 1 or 2 tile-row alignment correspondingly would be enough.
> 
> The next patch removes the 4x4 tile alignment, here prepare for that by
> aligning TGL+ UV surface offsets to LCM(tile-row size, 64 kbyte)
> ensuring the minimum tile-row size and 64 kbyte alignment.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  lib/igt_fb.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index b8b2396d3..86d0ae426 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -392,6 +392,12 @@ bool igt_format_is_yuv_semiplanar(uint32_t format)
>  	return igt_format_is_yuv(format) && f->num_planes == 2;
>  }
>  
> +static bool is_yuv_semiplanar_plane(const struct igt_fb *fb, int color_plane)
> +{
> +	return igt_format_is_yuv_semiplanar(fb->drm_format) &&
> +	       color_plane == 1;
> +}
> +
>  /**
>   * igt_get_fb_tile_size:
>   * @fd: the DRM file descriptor
> @@ -843,16 +849,61 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)
>  	}
>  }
>  
> +static unsigned int gcd(unsigned int a, unsigned int b)
> +{
> +	if (b == 0)
> +		return a;
> +
> +	return gcd(b, a % b);

I would write that w/o the recursion. 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2021-10-27  9:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 21:26 [igt-dev] [PATCH i-g-t 0/4] lib/igt_fb/tgl+: Remove CCS FB layout restrictions Imre Deak
2021-10-26 21:26 ` [igt-dev] [PATCH i-g-t 1/4] lib/igt_fb/adlp: Remove CCS FB stride alignment restrictions Imre Deak
2021-10-26 21:26 ` [igt-dev] [PATCH i-g-t 2/4] lib/igt_fb/tgl+: Prevent CCS FB UV surface offset overalignment Imre Deak
2021-10-27  9:46   ` Ville Syrjälä [this message]
2021-10-27 10:54     ` Imre Deak
2021-10-27 13:14   ` [igt-dev] [PATCH v2 " Imre Deak
2021-10-26 21:26 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_fb/tgl+: Remove CCS FB 4 tile height alignment restriction Imre Deak
2021-10-26 21:26 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_fb/tgl+: Prevent CCS FB AUX surface size overalignment Imre Deak
2021-10-26 22:11 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb/tgl+: Remove CCS FB layout restrictions Patchwork
2021-10-26 23:54 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-10-27 14:02 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb/tgl+: Remove CCS FB layout restrictions (rev2) Patchwork
2021-10-27 17:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-11-02 17:16   ` Imre Deak
2021-11-02 20:06     ` Vudum, Lakshminarayana
2021-11-02 13:29 ` [igt-dev] [PATCH i-g-t 0/4] lib/igt_fb/tgl+: Remove CCS FB layout restrictions Juha-Pekka Heikkila
2021-11-02 18:09 ` [igt-dev] ✓ Fi.CI.IGT: success for lib/igt_fb/tgl+: Remove CCS FB layout restrictions (rev2) 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=YXkf464pWE0LUrXy@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=imre.deak@intel.com \
    /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