From: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: daniel.vetter@intel.com, Ben Widawsky <ben@bwidawsk.net>,
intel-gfx@lists.freedesktop.org, tomeu.vizoso@collabora.com
Subject: Re: [PATCH i-g-t v4 4/6] tests/kms_ccs: Test case where the CCS buffer was not provided
Date: Mon, 30 Oct 2017 23:33:10 -0200 [thread overview]
Message-ID: <87wp3cf6eh.fsf@dilma.collabora.co.uk> (raw)
In-Reply-To: <20171030160235.GR10981@intel.com> ("Ville Syrjälä"'s message of "Mon, 30 Oct 2017 18:02:35 +0200")
Ville Syrjälä <ville.syrjala@linux.intel.com> writes:
> On Tue, Oct 03, 2017 at 09:35:33AM -0700, Ben Widawsky wrote:
>> On 17-09-27 15:34:17, Gabriel Krisman Bertazi wrote:
>> >Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>> >---
>> > tests/kms_ccs.c | 37 +++++++++++++++++++++++++++----------
>> > 1 file changed, 27 insertions(+), 10 deletions(-)
>> >
>> >diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
>> >index 73025a1e019f..35dfcca6be14 100644
>> >--- a/tests/kms_ccs.c
>> >+++ b/tests/kms_ccs.c
>> >@@ -33,8 +33,12 @@ enum test_flags {
>> > TEST_ROTATE_180 = 1 << 2,
>> > TEST_BAD_PIXEL_FORMAT = 1 << 3,
>> > TEST_BAD_ROTATION_90 = 1 << 4,
>> >+ TEST_NO_AUX_BUFFER = 1 << 5,
>> > };
>> >
>> >+#define TEST_FAIL_ON_ADDFB2 \
>> >+ (TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER)
>> >+
>>
>> Adding the define confuses things more than it helps IMO.
>>
>> > enum test_fb_flags {
>> > FB_COMPRESSED = 1 << 0,
>> > FB_HAS_PLANE = 1 << 1,
>> >@@ -315,22 +319,29 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
>> > */
>> > int ccs_width = ALIGN(width * 4, 32) / 32;
>> > int ccs_height = ALIGN(height, 16) / 16;
>> >- f.pitches[1] = ALIGN(ccs_width * 1, 128);
>> >- f.modifier[1] = modifier;
>>
>> I think the case you're trying to test should have the modifier set for plane1,
>> just no handle, size or whatever. If you don't do this, I'm not sure what you're
>> actually testing.
>
> Hmm. I suppose we migth end up testing bad stride here. I can't
> recall exactly in which order the kernel checks these. So just
> setting 'handle[1] = 0' might be what we want to test here.
My test makes the kernel error out with:
[23303.475286] [drm:drm_internal_framebuffer_create] no buffer object
handle for plane 1
Which I think is the right one.
> And then we may want a 'pitches[1] = 0' test as well in the bad stride
> tests.
Sure, I can add that.
>
>>
>> >- f.offsets[1] = size[0];
>> >- size[1] = f.pitches[1] * ALIGN(ccs_height, 32);
>> >+ int ccs_pitches = ALIGN(ccs_width * 1, 128);
>> >+ int ccs_offsets = size[0];
>> >+
>> >+ size[1] = ccs_pitches * ALIGN(ccs_height, 32);
>> >
>> > f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
>> >- f.handles[1] = f.handles[0];
>> >- render_ccs(data, f.handles[1], f.offsets[1], size[1],
>> >- height, f.pitches[1]);
>> >+
>> >+ if (!(data->flags & TEST_NO_AUX_BUFFER)) {
>> >+ f.modifier[1] = modifier;
>> >+ f.handles[1] = f.handles[0];
>> >+ f.pitches[1] = ccs_pitches;
>> >+ f.offsets[1] = ccs_offsets;
>> >+
>> >+ render_ccs(data, f.handles[1], f.offsets[1], size[1],
>> >+ height, f.pitches[1]);
>> >+ }
>> > } else
>> > f.handles[0] = gem_create(data->drm_fd, size[0]);
>> >
>> > render_fb(data, f.handles[0], size[0], fb_flags, height, f.pitches[0]);
>> >
>> > ret = drmIoctl(data->drm_fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f);
>> >- if (data->flags & TEST_BAD_PIXEL_FORMAT) {
>> >+ if (data->flags & TEST_FAIL_ON_ADDFB2) {
>> > igt_assert_eq(ret, -1);
>> > igt_assert_eq(errno, EINVAL);
>> > return;
>> >@@ -379,7 +390,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags)
>> > drm_mode->vdisplay, fb_flags);
>> > }
>> >
>> >- if (data->flags & TEST_BAD_PIXEL_FORMAT)
>> >+ if (data->flags & TEST_FAIL_ON_ADDFB2)
>> > return;
>> >
>> > igt_plane_set_position(primary, 0, 0);
>> >@@ -446,7 +457,8 @@ static void test_output(data_t *data)
>> > }
>> >
>> > if (data->flags & TEST_BAD_PIXEL_FORMAT ||
>> >- data->flags & TEST_BAD_ROTATION_90) {
>> >+ data->flags & TEST_BAD_ROTATION_90 ||
>> >+ data->flags & TEST_NO_AUX_BUFFER) {
>> > try_config(data, fb_flags | FB_COMPRESSED);
>> > }
>> >
>> >@@ -515,6 +527,11 @@ igt_main
>> > }
>> >
>> > data.plane = NULL;
>> >+
>> >+ data.flags = TEST_NO_AUX_BUFFER;
>> >+ igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
>> >+ test_output(&data);
>> >+
>> > }
>> >
>> > igt_fixture
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Gabriel Krisman Bertazi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-31 1:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 18:34 [PATCH i-g-t v4 1/6] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
2017-09-27 18:34 ` [PATCH i-g-t v4 2/6] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
2017-09-28 8:33 ` Petri Latvala
2017-09-27 18:34 ` [PATCH i-g-t v4 3/6] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
2017-10-03 10:49 ` Arkadiusz Hiler
2017-10-03 16:07 ` Ben Widawsky
2017-09-27 18:34 ` [PATCH i-g-t v4 4/6] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
2017-10-03 11:32 ` Arkadiusz Hiler
2017-10-03 16:35 ` Ben Widawsky
2017-10-09 6:14 ` Gabriel Krisman Bertazi
2017-10-30 16:02 ` Ville Syrjälä
2017-10-31 1:33 ` Gabriel Krisman Bertazi [this message]
2017-09-27 18:34 ` [PATCH i-g-t v4 5/6] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
2017-10-03 11:00 ` Arkadiusz Hiler
2017-10-03 16:38 ` Ben Widawsky
2017-10-09 6:18 ` Gabriel Krisman Bertazi
2017-09-27 18:34 ` [PATCH i-g-t v4 6/6] tests/kms_ccs: Test case for wrong aux buffer stride size Gabriel Krisman Bertazi
2017-10-03 10:57 ` Arkadiusz Hiler
2017-10-30 15:59 ` Ville Syrjälä
2017-10-03 16:40 ` Ben Widawsky
2017-10-09 6:03 ` Gabriel Krisman Bertazi
2017-10-30 16:04 ` Ville Syrjälä
2017-09-27 18:58 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/6] tests/kms_ccs: Test pipes other than pipe A Patchwork
2017-09-27 23:42 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-09-28 16:06 ` Patchwork
2017-10-03 10:44 ` [PATCH i-g-t v4 1/6] " Arkadiusz Hiler
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=87wp3cf6eh.fsf@dilma.collabora.co.uk \
--to=krisman@collabora.co.uk \
--cc=ben@bwidawsk.net \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tomeu.vizoso@collabora.com \
--cc=ville.syrjala@linux.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.