All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Kahola, Mika" <mika.kahola@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Test if pixel format supports rotation
Date: Fri, 12 Apr 2019 14:54:07 +0000	[thread overview]
Message-ID: <3d0d06543f88e74505fab7aade9e836aedff4015.camel@intel.com> (raw)
In-Reply-To: <20190412110740.8036-1-mika.kahola@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2217 bytes --]

On Fri, 2019-04-12 at 14:07 +0300, Mika Kahola wrote:
> Before actually do the commit with plane rotation, test if the pixel
> format
> supports requested rotation. Kernel replies with -EINVAL when
> requested to do
> rotation with the pixel format that is not supported. The patch uses
> this fact
> to filter out unsupported pixel formats.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=109052
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110369
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  tests/kms_plane_scaling.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index e843bf86..57092263 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -138,6 +138,7 @@ static void check_scaling_pipe_plane_rot(data_t
> *d, igt_plane_t *plane,
>  	igt_display_t *display = &d->display;
>  	int width, height;
>  	drmModeModeInfo *mode;
> +	int errno;
>  
>  	cleanup_crtc(d);
>  
> @@ -158,7 +159,15 @@ static void check_scaling_pipe_plane_rot(data_t
> *d, igt_plane_t *plane,
>  	igt_plane_set_position(plane, 0, 0);
>  	igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
>  	igt_plane_set_rotation(plane, rot);
> -	igt_display_commit2(display, COMMIT_ATOMIC);
> +
> +	/*
> +	 * Test first, if pixel format supports rotation.
> +	 * We expect from kernel to return with -EINVAL
> +	 * if format is not supported.
> +	 */
> +	errno = igt_display_try_commit_atomic(display,
> DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> +	if (errno != -EINVAL)
> +		igt_display_commit2(display, COMMIT_ATOMIC);

This is going to cause the test to always pass, becoming useless.

It is already filtering out the know format and rotation combination
that should not work in the caller, if a combination is not covered it
should be added to those:

if (igt_fb_supported_format(format) && igt_plane_has_format_mod(plane,
format, tiling) && can_rotate(d, format))
	check_scaling_pipe_plane_rot(d, plane, format, tiling, pipe,
output, rot);


>  
>  	igt_plane_set_fb(plane, NULL);
>  	igt_plane_set_position(plane, 0, 0);

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-12 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 11:07 [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Test if pixel format supports rotation Mika Kahola
2019-04-12 13:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-12 14:54 ` Souza, Jose [this message]
2019-04-15  8:13   ` [igt-dev] [PATCH i-g-t] " Kahola, Mika
2019-04-12 16:21 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=3d0d06543f88e74505fab7aade9e836aedff4015.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=mika.kahola@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.