* [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test
@ 2017-02-07 13:33 Mika Kahola
2017-03-08 12:38 ` Maarten Lankhorst
0 siblings, 1 reply; 4+ messages in thread
From: Mika Kahola @ 2017-02-07 13:33 UTC (permalink / raw)
To: intel-gfx
When doing a full atomic modeset, kernel should fail if the flag
DRM_MODE_ATOMIC_ALLOW_MODESET is not set. Let's add this test as part of
'kms_plane_lowres' testset. The testcases are 'pipe-x-allow-modeset' where
x stands for pipe in question.
For: VIZ-6955
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
tests/kms_plane_lowres.c | 51 +++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 14 deletions(-)
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 689c248..a127124 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -142,12 +142,16 @@ test_fini(data_t *data, igt_output_t *output)
}
static int
-display_commit_mode(data_t *data, enum pipe pipe, int flags, igt_crc_t *crc)
+display_commit_mode(data_t *data, enum pipe pipe, bool test_modeset, igt_crc_t *crc)
{
char buf[256];
struct drm_event *e = (void *)buf;
unsigned int vblank_start, vblank_stop;
int n, ret;
+ int flags = DRM_MODE_PAGE_FLIP_EVENT;
+
+ if (!test_modeset)
+ flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
vblank_start = kmstest_get_vblank(data->display.drm_fd, pipe,
DRM_VBLANK_NEXTONMISS);
@@ -155,6 +159,9 @@ display_commit_mode(data_t *data, enum pipe pipe, int flags, igt_crc_t *crc)
ret = igt_display_try_commit_atomic(&data->display,
flags,
NULL);
+ if (test_modeset)
+ return ret;
+
igt_skip_on(ret != 0);
igt_set_timeout(1, "Stuck on page flip");
@@ -181,8 +188,7 @@ check_mode(drmModeModeInfo *mode1, drmModeModeInfo *mode2)
}
static drmModeModeInfo *
-test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,
- igt_output_t *output)
+test_setup(data_t *data, enum pipe pipe, uint64_t modifier, igt_output_t *output)
{
struct kmstest_crtc crtc;
drmModeModeInfo *mode;
@@ -238,21 +244,21 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,
static void
test_plane_position_with_output(data_t *data, enum pipe pipe,
- igt_output_t *output, uint64_t modifier)
+ igt_output_t *output, uint64_t modifier,
+ bool test_modeset)
{
igt_crc_t *crc_hires1, *crc_hires2;
igt_crc_t *crc_lowres;
drmModeModeInfo mode_lowres;
drmModeModeInfo *mode1, *mode2, *mode3;
int ret, n;
- int flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_ALLOW_MODESET;
igt_info("Testing connector %s using pipe %s\n",
igt_output_name(output), kmstest_pipe_name(pipe));
test_init(data, pipe);
- mode1 = test_setup(data, pipe, modifier, flags, output);
+ mode1 = test_setup(data, pipe, modifier, output);
mode_lowres = get_lowres_mode(data->drm_fd, mode1);
@@ -273,7 +279,12 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
check_mode(&mode_lowres, mode2);
- display_commit_mode(data, pipe, flags, crc_lowres);
+ ret = display_commit_mode(data, pipe, test_modeset, crc_lowres);
+
+ if (test_modeset) {
+ igt_assert(ret != 0);
+ goto out;
+ }
igt_assert_plane_visible(pipe, false);
@@ -285,17 +296,24 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
check_mode(mode1, mode3);
- display_commit_mode(data, pipe, flags, crc_hires2);
+ ret = display_commit_mode(data, pipe, test_modeset, crc_hires2);
+
+ if (test_modeset) {
+ igt_assert(ret != 0);
+ goto out;
+ }
igt_assert_plane_visible(pipe, true);
+out:
igt_pipe_crc_stop(data->pipe_crc);
test_fini(data, output);
}
static void
-test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier)
+test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier,
+ bool test_modeset)
{
igt_output_t *output;
int connected_outs;
@@ -310,7 +328,8 @@ test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier)
connected_outs = 0;
for_each_valid_output_on_pipe(&data->display, pipe, output) {
- test_plane_position_with_output(data, pipe, output, modifier);
+ test_plane_position_with_output(data, pipe, output, modifier,
+ test_modeset);
connected_outs++;
}
@@ -322,19 +341,23 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
{
igt_subtest_f("pipe-%s-tiling-none",
kmstest_pipe_name(pipe))
- test_plane_position(data, pipe, LOCAL_DRM_FORMAT_MOD_NONE);
+ test_plane_position(data, pipe, LOCAL_DRM_FORMAT_MOD_NONE, false);
igt_subtest_f("pipe-%s-tiling-x",
kmstest_pipe_name(pipe))
- test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_X_TILED);
+ test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_X_TILED, false);
igt_subtest_f("pipe-%s-tiling-y",
kmstest_pipe_name(pipe))
- test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Y_TILED);
+ test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Y_TILED, false);
igt_subtest_f("pipe-%s-tiling-yf",
kmstest_pipe_name(pipe))
- test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Yf_TILED);
+ test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Yf_TILED, false);
+
+ igt_subtest_f("pipe-%s-allow-modeset",
+ kmstest_pipe_name(pipe))
+ test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_X_TILED, true);
}
static data_t data;
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test
2017-02-07 13:33 [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test Mika Kahola
@ 2017-03-08 12:38 ` Maarten Lankhorst
2017-03-08 13:45 ` Mika Kahola
0 siblings, 1 reply; 4+ messages in thread
From: Maarten Lankhorst @ 2017-03-08 12:38 UTC (permalink / raw)
To: Mika Kahola, intel-gfx
Hey,
Op 07-02-17 om 14:33 schreef Mika Kahola:
> When doing a full atomic modeset, kernel should fail if the flag
> DRM_MODE_ATOMIC_ALLOW_MODESET is not set. Let's add this test as part of
> 'kms_plane_lowres' testset. The testcases are 'pipe-x-allow-modeset' where
> x stands for pipe in question.
>
> For: VIZ-6955
I think it makes sense for this to be a standalone test, kms_atomic_allow_modeset.
igt_display
It should be trying the following:
0. Add a way to control the active property to lib/igt_kms.c either auto (backwards compatible), off or on.
1. Toggling the active property only, with and without mode set. (Testing active_changed vs modeset flag)
2. With the active property set to disabled (dpms off), try to set and unset the mode. (Testing mode_changed vs modeset flag)
3. Try swapping connectors on a crtc. (Testing connectors_changed vs modeset flag)
With and without TEST_ONLY. :)
I think that makes more sense than changing a unrelated test.
Cheers,
~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test
2017-03-08 12:38 ` Maarten Lankhorst
@ 2017-03-08 13:45 ` Mika Kahola
2017-03-08 14:01 ` Maarten Lankhorst
0 siblings, 1 reply; 4+ messages in thread
From: Mika Kahola @ 2017-03-08 13:45 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
On Wed, 2017-03-08 at 13:38 +0100, Maarten Lankhorst wrote:
> Hey,
>
> Op 07-02-17 om 14:33 schreef Mika Kahola:
> >
> > When doing a full atomic modeset, kernel should fail if the flag
> > DRM_MODE_ATOMIC_ALLOW_MODESET is not set. Let's add this test as
> > part of
> > 'kms_plane_lowres' testset. The testcases are 'pipe-x-allow-
> > modeset' where
> > x stands for pipe in question.
> >
> > For: VIZ-6955
> I think it makes sense for this to be a standalone test,
> kms_atomic_allow_modeset.
> igt_display
>
> It should be trying the following:
>
> 0. Add a way to control the active property to lib/igt_kms.c either
> auto (backwards compatible), off or on.
> 1. Toggling the active property only, with and without mode set.
> (Testing active_changed vs modeset flag)
> 2. With the active property set to disabled (dpms off), try to set
> and unset the mode. (Testing mode_changed vs modeset flag)
> 3. Try swapping connectors on a crtc. (Testing connectors_changed vs
> modeset flag)
>
> With and without TEST_ONLY. :)
Thanks Maarten for review. I guess it's back to the drawing board then
:)
I could change the test as a standalone one that tests
DRM_MODE_ATOMIC_ALLOW_MODESET flag with dpms on/off.
>
> I think that makes more sense than changing a unrelated test.
>
> Cheers,
> ~Maarten
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test
2017-03-08 13:45 ` Mika Kahola
@ 2017-03-08 14:01 ` Maarten Lankhorst
0 siblings, 0 replies; 4+ messages in thread
From: Maarten Lankhorst @ 2017-03-08 14:01 UTC (permalink / raw)
To: mika.kahola, intel-gfx
Op 08-03-17 om 14:45 schreef Mika Kahola:
> On Wed, 2017-03-08 at 13:38 +0100, Maarten Lankhorst wrote:
>> Hey,
>>
>> Op 07-02-17 om 14:33 schreef Mika Kahola:
>>> When doing a full atomic modeset, kernel should fail if the flag
>>> DRM_MODE_ATOMIC_ALLOW_MODESET is not set. Let's add this test as
>>> part of
>>> 'kms_plane_lowres' testset. The testcases are 'pipe-x-allow-
>>> modeset' where
>>> x stands for pipe in question.
>>>
>>> For: VIZ-6955
>> I think it makes sense for this to be a standalone test,
>> kms_atomic_allow_modeset.
>> igt_display
>>
>> It should be trying the following:
>>
>> 0. Add a way to control the active property to lib/igt_kms.c either
>> auto (backwards compatible), off or on.
>> 1. Toggling the active property only, with and without mode set.
>> (Testing active_changed vs modeset flag)
>> 2. With the active property set to disabled (dpms off), try to set
>> and unset the mode. (Testing mode_changed vs modeset flag)
>> 3. Try swapping connectors on a crtc. (Testing connectors_changed vs
>> modeset flag)
>>
>> With and without TEST_ONLY. :)
> Thanks Maarten for review. I guess it's back to the drawing board then
> :)
>
> I could change the test as a standalone one that tests
> DRM_MODE_ATOMIC_ALLOW_MODESET flag with dpms on/off.
No problem, fortunately adding standalone atomic tests is easy with the igt_display framework! :)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-08 14:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 13:33 [PATCH i-g-t] tests/kms_plane_lowres: Add DRM_MODE_ATOMIC_ALLOW_MODESET test Mika Kahola
2017-03-08 12:38 ` Maarten Lankhorst
2017-03-08 13:45 ` Mika Kahola
2017-03-08 14:01 ` Maarten Lankhorst
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.