All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Vidya Srinivas <vidya.srinivas@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@intel.com
Subject: Re: [PATCH i-g-t 3/6] i-g-t: lib/igt_kms: Run kms_plane for all supported pixel formats
Date: Tue, 9 Jan 2018 13:24:51 +0100	[thread overview]
Message-ID: <50f58dab-acb3-3af9-b214-fc19b9320cd8@linux.intel.com> (raw)
In-Reply-To: <1513158652-8912-4-git-send-email-vidya.srinivas@intel.com>

Op 13-12-17 om 10:50 schreef Vidya Srinivas:
> From: Mahesh Kumar <mahesh1.kumar@intel.com>
>
> This patch adds a subtest related to pixel format testing. The test
> create framebuffer with all supported pixel formats for primary and
> sprite planes which can be drawn using cairo and commits the same on display.
>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
>  tests/kms_plane.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 123 insertions(+)
>
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 92bf67f..5f25177 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -368,6 +368,125 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags)
>  	igt_skip_on(connected_outs == 0);
>  }
>  
> +static void test_format_primary(data_t *data,
> +			enum pipe pipe, igt_output_t *output)
> +{
> +	igt_plane_t *primary;
> +	struct igt_fb primary_fb;
> +	drmModeModeInfo *mode;
> +	cairo_t *cr;
> +	int primary_id;
> +	uint32_t format;
> +
> +	igt_info("Testing connector %s using pipe %s on primary plane\n",
> +		 igt_output_name(output), kmstest_pipe_name(pipe));
> +
> +	igt_output_set_pipe(output, pipe);
> +	mode = igt_output_get_mode(output);
> +
> +	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +
> +	for_each_format_in_plane(primary, format) {
> +		if (igt_is_cairo_supported_format(format)) {
> +			igt_info("Testing format %s on primary now\n",
> +					 igt_get_format_name(format));
> +			primary_id = igt_create_fb(data->drm_fd,
> +					  mode->hdisplay, mode->vdisplay,
> +					  format,
> +					  LOCAL_DRM_FORMAT_MOD_NONE,
> +					  &primary_fb);
> +			igt_assert(primary_id);
> +			cr = igt_get_cairo_ctx(data->drm_fd, &primary_fb);
> +			igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
> +						    0.0, 1.0, 0.0);
> +			igt_paint_color(cr, 100, 100, 64, 64, 0.0, 0.0, 0.0);
> +			igt_assert(cairo_status(cr) == 0);
> +			cairo_destroy(cr);
> +
> +			igt_plane_set_fb(primary, &primary_fb);
> +			igt_display_commit(&data->display);
> +		}
> +	}
> +
> +	igt_remove_fb(data->drm_fd, &primary_fb);
> +	igt_plane_set_fb(primary, NULL);
> +}
> +
> +static void test_format_overlay(data_t *data,
> +			enum pipe pipe, igt_output_t *output,
> +			int plane_id)
> +{
> +	igt_plane_t *primary, *overlay;
> +	struct igt_fb primary_fb, overlay_fb;
> +	drmModeModeInfo *mode;
> +	cairo_t *cr;
> +	int primary_id, overlay_id;
> +	uint32_t format;
> +
> +	igt_info("Testing connector %s using pipe %s on overlay plane %d\n",
> +		 igt_output_name(output), kmstest_pipe_name(pipe), plane_id);
> +
> +	igt_output_set_pipe(output, pipe);
> +	mode = igt_output_get_mode(output);
> +
> +	overlay = igt_output_get_plane(output, plane_id);
> +	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +	primary_id = igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
> +							   DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
> +							   &primary_fb);
> +	igt_assert(primary_id);
> +	igt_plane_set_fb(primary, &primary_fb);
> +	cr = igt_get_cairo_ctx(data->drm_fd, &primary_fb);
> +	igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 0.0, 0.0, 1.0);
> +	igt_assert(cairo_status(cr) == 0);
> +	cairo_destroy(cr);
> +
> +	for_each_format_in_plane(overlay, format) {
> +		if (igt_is_cairo_supported_format(format)) {
> +			igt_info("Testing format %s on plane id %d\n",
> +					  igt_get_format_name(format), plane_id);
> +			overlay_id = igt_create_fb(data->drm_fd, 300, 300, format,
> +									   LOCAL_DRM_FORMAT_MOD_NONE, &overlay_fb);
> +			igt_assert(overlay_id);
> +
> +			igt_plane_set_fb(overlay, &overlay_fb);
> +			cr = igt_get_cairo_ctx(data->drm_fd, &overlay_fb);
> +			igt_paint_color(cr, 0, 0, 300, 300, 1.0, 0.0, 0.0);
> +			igt_assert(cairo_status(cr) == 0);
> +			cairo_destroy(cr);
> +			igt_display_commit(&data->display);
Why does this test distinguish between primary and sprite? It should test all planes in the same way, including cursor.

In fact, we should also test formats not supported by cairo, and only skip the painting in that case.

~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-01-09 12:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  9:50 [PATCH i-g-t 0/6] kms_plane_scaling fixes and enhancement Vidya Srinivas
2017-12-13  9:50 ` [PATCH i-g-t 1/6] i-g-t: kms_plane_scaling: Fix basic scaling test Vidya Srinivas
2018-01-04 14:56   ` Maarten Lankhorst
2018-01-05  3:45     ` Srinivas, Vidya
2017-12-13  9:50 ` [PATCH i-g-t 2/6] i-g-t: lib: Add plane pixel format support Vidya Srinivas
2018-01-09 12:10   ` Maarten Lankhorst
2018-01-09 12:32     ` Maarten Lankhorst
2017-12-13  9:50 ` [PATCH i-g-t 3/6] i-g-t: lib/igt_kms: Run kms_plane for all supported pixel formats Vidya Srinivas
2018-01-09 12:24   ` Maarten Lankhorst [this message]
2017-12-13  9:50 ` [PATCH i-g-t 4/6] i-g-t kms_plane_scaling: test scaling with tiling rotation and " Vidya Srinivas
2017-12-14 10:55   ` Daniel Vetter
2017-12-14 17:41     ` Srinivas, Vidya
2018-01-09 12:33     ` Maarten Lankhorst
2017-12-13  9:50 ` [PATCH i-g-t 5/6] i-g-t: kms_plane_scaling: test scaler with clipping clamping Vidya Srinivas
2017-12-13  9:50 ` [PATCH i-g-t 6/6] i-g-t: kms_plane_scaling: test for multi pipe with scaling Vidya Srinivas
2018-01-09 14:00   ` Maarten Lankhorst

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=50f58dab-acb3-3af9-b214-fc19b9320cd8@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vidya.srinivas@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.