Message ID | 20170124233400.5053-2-robert.foss@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Reviewed-by: Mika Kahola <mika.kahola@intel.com> On Tue, 2017-01-24 at 18:33 -0500, Robert Foss wrote: > Add an index property which helps accessing the corresponding > igt_plane_t structure through the igt_*_get_plane() functions. > > Signed-off-by: Robert Foss <robert.foss@collabora.com> > --- > lib/igt_kms.c | 12 ++++++------ > lib/igt_kms.h | 1 + > tests/kms_plane_lowres.c | 2 +- > 3 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c > index d104734a..e1abcf0d 100644 > --- a/lib/igt_kms.c > +++ b/lib/igt_kms.c > @@ -1244,21 +1244,21 @@ static int parse_planes(FILE *fid, struct > kmstest_plane *plane) > { > char tmp[256]; > int nplanes; > - int ovl; > > - ovl = 0; > nplanes = 0; > while (fgets(tmp, 256, fid) != NULL) { > igt_assert_neq(nplanes, IGT_MAX_PLANES); > if (strstr(tmp, "type=PRI") != NULL) { > - get_plane(tmp, IGT_PLANE_PRIMARY, > &plane[nplanes]); > + get_plane(tmp, DRM_PLANE_TYPE_PRIMARY, > &plane[nplanes]); > + plane[nplanes].index = nplanes; > nplanes++; > } else if (strstr(tmp, "type=OVL") != NULL) { > - get_plane(tmp, IGT_PLANE_2 + ovl, > &plane[nplanes]); > - ovl++; > + get_plane(tmp, DRM_PLANE_TYPE_OVERLAY, > &plane[nplanes]); > + plane[nplanes].index = nplanes; > nplanes++; > } else if (strstr(tmp, "type=CUR") != NULL) { > - get_plane(tmp, IGT_PLANE_CURSOR, > &plane[nplanes]); > + get_plane(tmp, DRM_PLANE_TYPE_CURSOR, > &plane[nplanes]); > + plane[nplanes].index = nplanes; > nplanes++; > break; > } > diff --git a/lib/igt_kms.h b/lib/igt_kms.h > index 81be77f5..198174c2 100644 > --- a/lib/igt_kms.h > +++ b/lib/igt_kms.h > @@ -136,6 +136,7 @@ struct kmstest_connector_config { > struct kmstest_plane { > int id; > int plane; > + int index; > int pos_x; > int pos_y; > int width; > diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c > index 93aefdaa..858cc482 100644 > --- a/tests/kms_plane_lowres.c > +++ b/tests/kms_plane_lowres.c > @@ -185,7 +185,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t > modifier, int flags, > igt_skip_on(crtc.nplanes == 0); > > for (i = 0; i < crtc.nplanes; i++) > - data->plane[i] = igt_output_get_plane(output, > crtc.plane[i].plane); > + data->plane[i] = igt_output_get_plane(output, > crtc.plane[i].index); > > mode = igt_output_get_mode(output); >
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index d104734a..e1abcf0d 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1244,21 +1244,21 @@ static int parse_planes(FILE *fid, struct kmstest_plane *plane) { char tmp[256]; int nplanes; - int ovl; - ovl = 0; nplanes = 0; while (fgets(tmp, 256, fid) != NULL) { igt_assert_neq(nplanes, IGT_MAX_PLANES); if (strstr(tmp, "type=PRI") != NULL) { - get_plane(tmp, IGT_PLANE_PRIMARY, &plane[nplanes]); + get_plane(tmp, DRM_PLANE_TYPE_PRIMARY, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; } else if (strstr(tmp, "type=OVL") != NULL) { - get_plane(tmp, IGT_PLANE_2 + ovl, &plane[nplanes]); - ovl++; + get_plane(tmp, DRM_PLANE_TYPE_OVERLAY, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; } else if (strstr(tmp, "type=CUR") != NULL) { - get_plane(tmp, IGT_PLANE_CURSOR, &plane[nplanes]); + get_plane(tmp, DRM_PLANE_TYPE_CURSOR, &plane[nplanes]); + plane[nplanes].index = nplanes; nplanes++; break; } diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 81be77f5..198174c2 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -136,6 +136,7 @@ struct kmstest_connector_config { struct kmstest_plane { int id; int plane; + int index; int pos_x; int pos_y; int width; diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c index 93aefdaa..858cc482 100644 --- a/tests/kms_plane_lowres.c +++ b/tests/kms_plane_lowres.c @@ -185,7 +185,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_skip_on(crtc.nplanes == 0); for (i = 0; i < crtc.nplanes; i++) - data->plane[i] = igt_output_get_plane(output, crtc.plane[i].plane); + data->plane[i] = igt_output_get_plane(output, crtc.plane[i].index); mode = igt_output_get_mode(output);
Add an index property which helps accessing the corresponding igt_plane_t structure through the igt_*_get_plane() functions. Signed-off-by: Robert Foss <robert.foss@collabora.com> --- lib/igt_kms.c | 12 ++++++------ lib/igt_kms.h | 1 + tests/kms_plane_lowres.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-)