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 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests
Date: Fri, 11 Jan 2019 16:35:28 +0200 [thread overview]
Message-ID: <20190111143528.GB20097@intel.com> (raw)
In-Reply-To: <1545989391-17050-2-git-send-email-juhapekka.heikkila@gmail.com>
On Fri, Dec 28, 2018 at 11:29:51AM +0200, Juha-Pekka Heikkila wrote:
> Add NV12 support for testing where available.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> tests/kms_rotation_crc.c | 35 ++++++++++++++++++++---------------
> 1 file changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 796115a..7a75db8 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -426,7 +426,7 @@ typedef struct {
> igt_rotation_t rotation_sw, rotation_hw;
> } planeinfos;
>
> -static void get_multiplane_crc(data_t *data, igt_output_t *output,
> +static bool get_multiplane_crc(data_t *data, igt_output_t *output,
> igt_crc_t *crc_output, planeinfos *planeinfo,
> int numplanes)
> {
> @@ -436,22 +436,27 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
> int c, ret;
>
> oldplanes = data->multiplaneoldview;
> - planes = malloc(sizeof(*planes) * numplanes);
> + planes = calloc(sizeof(*planes), numplanes);
>
> for (c = 0; c < numplanes; c++) {
> planes[c].plane = igt_output_get_plane_type(output,
> planeinfo[c].planetype);
>
> /*
> - * make plane and fb width and height always even due to
> - * test image rendering
> + * make plane and fb width and height always divisible by 4
> + * due to NV12 support
Because of the skl nv12 rotation workaround or some other reason?
Looks all right otherwise.
> */
> - w = planeinfo[c].width & ~1;
> - h = planeinfo[c].height & ~1;
> + w = planeinfo[c].width & ~3;
> + h = planeinfo[c].height & ~3;
>
> if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
> igt_swap(w, h);
>
> + if (!igt_plane_has_format_mod(planes[c].plane,
> + planeinfo[c].format,
> + planeinfo[c].tiling))
> + return false;
> +
> igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
> planeinfo[c].tiling, &planes[c].fb);
>
> @@ -475,6 +480,7 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
>
> free(oldplanes);
> data->multiplaneoldview = (void*)planes;
> + return true;
> }
>
> static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
> @@ -523,13 +529,10 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>
> /*
> * These are those modes which are tested. For testing feel interesting
> - * case with tiling are 2 byte wide and 4 byte wide.
> - *
> - * TODO:
> - * Built support for NV12 here.
> + * case with tiling are 2 bpp, 4 bpp and NV12.
> */
> static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
> - DRM_FORMAT_XRGB8888};
> + DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
>
> for_each_valid_output_on_pipe(display, pipe, output) {
> int i, j, k, l;
> @@ -581,13 +584,15 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
> p[0].rotation_hw = IGT_ROTATION_0;
> p[1].rotation_sw = planeconfigs[j].rotation;
> p[1].rotation_hw = IGT_ROTATION_0;
> - get_multiplane_crc(data, output, &retcrc_sw,
> - (planeinfos *)&p, MAXMULTIPLANESAMOUNT);
> + if (!get_multiplane_crc(data, output, &retcrc_sw,
> + (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
> + continue;
>
> igt_swap(p[0].rotation_sw, p[0].rotation_hw);
> igt_swap(p[1].rotation_sw, p[1].rotation_hw);
> - get_multiplane_crc(data, output, &retcrc_hw,
> - (planeinfos *)&p, MAXMULTIPLANESAMOUNT);
> + if (!get_multiplane_crc(data, output, &retcrc_hw,
> + (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
> + continue;
>
> igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
> }
> --
> 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
next prev parent reply other threads:[~2019-01-11 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 9:29 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation Juha-Pekka Heikkila
2018-12-28 9:29 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests Juha-Pekka Heikkila
2019-01-11 14:35 ` Ville Syrjälä [this message]
2019-01-15 16:28 ` Ville Syrjälä
2018-12-28 10:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation: align rendered image correctly for rotation Patchwork
2018-12-28 11:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-11 14:31 ` [igt-dev] [PATCH i-g-t 1/2] " Ville Syrjälä
-- strict thread matches above, loose matches on Subject: below --
2018-12-21 14:05 Juha-Pekka Heikkila
2018-12-21 14:05 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests Juha-Pekka Heikkila
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=20190111143528.GB20097@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