public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests
Date: Fri, 25 Jan 2019 23:29:35 +0200	[thread overview]
Message-ID: <20190125212935.GR20097@intel.com> (raw)
In-Reply-To: <1548344725-6323-1-git-send-email-juhapekka.heikkila@gmail.com>

On Thu, Jan 24, 2019 at 05:45:25PM +0200, Juha-Pekka Heikkila wrote:
> Make certain viewports are divisible by four due to intel
> hw workarounds for NV12.
> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
>  tests/kms_rotation_crc.c | 29 +++++++++++++++++++++++++----
>  1 file changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 8f343e0..fc995d0 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -486,10 +486,31 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
>  static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
>  			  int c)
>  {
> -	p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay)
> -			+ ((data->planepos[c].origo & p_right) ? mode->hdisplay : 0);
> -	p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay)
> -			+ ((data->planepos[c].origo & p_bottom) ? mode->vdisplay : 0);
> +	if (data->planepos[c].origo & p_right) {
> +		p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay
> +				+ mode->hdisplay);
> +		p[c].x1 &= ~3;
> +		/*
> +		 * At this point is handled surface on right side. If display
> +		 * mode is not divisible by 4 but with 2 point location is
> +		 * fixed to match requirements. Because of YUV planes here is
> +		 * intentionally ignored bit 1.
> +		 */
> +		p[c].x1 -= mode->hdisplay & 2;

Not really sure why we'd ignore the first bit. If hdisplay is odd
we'll still end up with an odd viewport width, which will fail. If we
don't ignore the bit we'll end up with an odd x1 instead, which would
still fail no?

Anwways, I think this patch should do what we want so
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +	} else {
> +		p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay);
> +		p[c].x1 &= ~3;
> +	}
> +
> +	if (data->planepos[c].origo & p_bottom) {
> +		p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay
> +				+ mode->vdisplay);
> +		p[c].y1 &= ~3;
> +		p[c].y1 -= mode->vdisplay & 2;
> +	} else {
> +		p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay);
> +		p[c].y1 &= ~3;
> +	}
>  }
>  
>  /*
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-01-25 21:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 14:38 [igt-dev] [PATCH i-g-t] tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests Juha-Pekka Heikkila
2019-01-22 15:25 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-22 18:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-23 21:07 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2019-01-24 12:29   ` Juha-Pekka Heikkila
2019-01-24 15:45 ` Juha-Pekka Heikkila
2019-01-25 21:29   ` Ville Syrjälä [this message]
2019-01-24 16:45 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests (rev2) Patchwork
2019-01-24 20:13 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190125212935.GR20097@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.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