lib/igt_kms: Implement dynamic plane count support
cover lib/igt_kms: Implement dynamic plane count support
This series implements dynamic plane count support in lib/igt_kms and modifies all of the tests that rely on a static plane count.
Currently it has has gone through incomplete testing on vc4 (many tests are intel only) and intel (on intel-ci).
This series can be found in branch dyn_n_planes_$VERSION:
https://git.collabora.com/cgit/user/robertfoss/intel-gpu-tools.git/
Currently known issues:
* kms_plane_multiple: Currently fails
Changes since rfc:
Rebased on upstream/master
* igt_debugfs:
- Change read to read at most MAX_LINE_LEN
* igt_kms:
- Actually fix typo
- Removed unused function declaration
- Set free'd pointer to NULL after free
- Check allocations for failures
- Rework kmstest_crtc and kmstest_plane to support dyn n_planes
* kms_cursor_legacy:
- Added support for dyn n_planes
* kms_cursor_legacy:
- Switch to using for_each_pipe construct
* kms_plane_lowres:
- Added support for dyn n_planes
* kms_plane_multiple:
- Set free'd pointer to NULL after free
- Check allocations for failures
Robert Foss (32):
lib/igt_kms: Add index property to kmstest_plane struct lib/igt_kms: Avoid depencency on static plane count lib/igt_kms: Rename kmstest properties nplanes and plane lib/igt_kms: Implement dynamic plane count support tests/kms_atomic_transition: Add support for dynamic number of planes tests/kms_busy: Add support for dynamic number of planes tests/kms_chv_cursor_fail: Add support for dynamic number of planes tests/kms_crtc_background_color: Add support for dynamic number of
planes
tests/kms_cursor_crc: Add support for dynamic number of planes tests/kms_cursor_legacy: Add support for dynamic number of planes tests/kms_fbc_crc: Add support for dynamic number of planes tests/kms_fence_pin_leak: Add support for dynamic number of planes tests/kms_flip_event_leak: Add support for dynamic number of planes tests/kms_legacy_colorkey: Add support for dynamic number of planes tests/kms_mmap_write_crc: Add support for dynamic number of planes tests/kms_mmio_vs_cs_flip: Add support for dynamic number of planes tests/kms_panel_fitting: Add support for dynamic number of planes tests/kms_pipe_color: Add support for dynamic number of planes tests/kms_plane: Add support for dynamic number of planes tests/kms_plane_multiple: Add support for dynamic number of planes tests/kms_plane_scaling: Add support for dynamic number of planes tests/kms_properties: Add support for dynamic number of planes tests/kms_psr_sink_crc: Add support for dynamic number of planes tests/kms_pwrite_crc: Add support for dynamic number of planes tests/kms_rmfb: Add support for dynamic number of planes tests/kms_rotation_crc: Add support for dynamic number of planes tests/kms_sink_crc_basic: Add support for dynamic number of planes tests/kms_universal_plane: Add support for dynamic number of planes tests/kms_vblank: Add support for dynamic number of planes tests/prime_mmap_kms: Add support for dynamic number of planes tests/kms_ccs: Add support for dynamic number of planes tests/kms_plane_lowres: Add support for dynamic number of planes
lib/igt_kms.c | 210 +++++++++++++++++++++++++------------- lib/igt_kms.h | 39 +++---- tests/kms_atomic_transition.c | 27 +++-- tests/kms_busy.c | 2 +- tests/kms_ccs.c | 4 +- tests/kms_chv_cursor_fail.c | 6 +- tests/kms_crtc_background_color.c | 2 +- tests/kms_cursor_crc.c | 12 +-- tests/kms_cursor_legacy.c | 32 +++--- tests/kms_fbc_crc.c | 9 +- tests/kms_fence_pin_leak.c | 2 +- tests/kms_flip_event_leak.c | 2 +- tests/kms_legacy_colorkey.c | 4 +- tests/kms_mmap_write_crc.c | 2 +- tests/kms_mmio_vs_cs_flip.c | 6 +- tests/kms_panel_fitting.c | 16 +-- tests/kms_pipe_color.c | 4 +- tests/kms_plane.c | 94 +++++++++-------- tests/kms_plane_lowres.c | 35 +++++-- tests/kms_plane_multiple.c | 209 +++++++++++++++++++++++-------------- tests/kms_plane_scaling.c | 14 +-- tests/kms_properties.c | 6 +- tests/kms_psr_sink_crc.c | 52 +++++----- tests/kms_pwrite_crc.c | 2 +- tests/kms_rmfb.c | 2 +- tests/kms_rotation_crc.c | 63 ++++++------ tests/kms_sink_crc_basic.c | 2 +- tests/kms_universal_plane.c | 18 ++-- tests/kms_vblank.c | 4 +- tests/prime_mmap_kms.c | 2 +- 30 files changed, 508 insertions(+), 374 deletions(-)
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/32 lib/igt_kms: Add index property to kmstest_plane struct
Add an index property which helps accessing the corresponding igt_plane_t structure through the igt_*_get_plane() functions.
--- lib/igt_kms.c | 12 ++++++------ lib/igt_kms.h | 1 + tests/kms_plane_lowres.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-)
lib/igt_kms.c +6 -6
@@ -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 ; }
lib/igt_kms.h +1 -0
@@ -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;
tests/kms_plane_lowres.c +1 -1
@@ -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);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t v1 01/32] lib/igt_kms: Add index property to kmstest_plane struct
Quoted 77 lines · Robert Foss
Add an index property which helps accessing the corresponding
igt_plane_tstructure through the igt_*_get_plane() functions.Signed-off-by Robert Foss <[email protected]>---
lib/igt_kms.c | 12 ++++++------
lib/igt_kms.h | 1 +
tests/kms_plane_lowres.c | 2 +-3 files changed, 8 insertions(+), 7 deletions(-)lib/igt_kms.c +0
-1@@ -1244,21 +1244,21 @@ static int parse_planes(FILE *fid, struct kmstest_plane *plane) { char tmp[256]; int nplanes; -int ovl;lib/igt_kms.c +0
-1- ovl =0 ;nplanes = 0;
while (fgets(tmp, 256, fid)!= NULL) {igt_assert_neq(nplanes, IGT_MAX_PLANES); if (strstr(tmp, "type=PRI")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, IGT_PLANE_PRIMARY,&plane[nplanes]);
lib/igt_kms.c +1
-0+ get_plane(tmp, DRM_PLANE_TYPE_PRIMARY,&plane[nplanes]);
lib/igt_kms.c +1
-0+ plane[nplanes].index = nplanes;nplanes++;
} else if (strstr(tmp, "type=OVL")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, IGT_PLANE_2 + ovl,&plane[nplanes]);
lib/igt_kms.c +1
-1- ovl++; + get_plane(tmp, DRM_PLANE_TYPE_OVERLAY,&plane[nplanes]);
lib/igt_kms.c +1
-0+ plane[nplanes].index = nplanes;nplanes++;
} else if (strstr(tmp, "type=CUR")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, IGT_PLANE_CURSOR,&plane[nplanes]);
lib/igt_kms.c +1
-0+ get_plane(tmp, DRM_PLANE_TYPE_CURSOR,&plane[nplanes]);
lib/igt_kms.c +1
-0+ plane[nplanes].index = nplanes;nplanes++;
break;
}lib/igt_kms.h +1
-0@@ -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;tests/kms_plane_lowres.c +0
-0@@ -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++)tests/kms_plane_lowres.c +0
-1- data->plane[i] = igt_output_get_plane(output,crtc.plane[i].plane);
tests/kms_plane_lowres.c +1
-0+ data->plane[i] = igt_output_get_plane(output,crtc.plane[i].index);
mode =igt_output_get_mode(output);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/32 lib/igt_kms: Avoid depencency on static plane count
In reply to Robert FossRework kmstest_crtc and kmstest_plane structs and their usage to not depend on a static plane count.
--- lib/igt_kms.c | 47 ++++++++++++++++++++++++++++++----------------- lib/igt_kms.h | 4 ++-- 2 files changed, 32 insertions(+), 19 deletions(-)
lib/igt_kms.c +30 -17
@@ -1227,7 +1227,7 @@ static void get_plane(char *str, int type, struct kmstest_plane *plane)int ret;char buf[256 ]; - plane->plane = type; + plane->type = type; ret =sscanf (str +12 ,"%d%*c %*s %[^n]s" , &plane->id, buf);
@@ -1240,31 +1240,36 @@ static void get_plane(char *str, int type, struct kmstest_plane *plane)igt_assert_eq (ret,2 ); } -static int parse_planes (FILE *fid,struct kmstest_plane *plane) +static int parse_planes (FILE *fid,struct kmstest_plane *planes) {char tmp[256 ]; -int nplanes; +int n_planes; - nplanes =0 ; + n_planes =0 ;while (fgets (tmp,256 , fid) !=NULL ) { -igt_assert_neq (nplanes,IGT_MAX_PLANES );if (strstr (tmp,"type=PRI" ) !=NULL ) { -get_plane (tmp,DRM_PLANE_TYPE_PRIMARY , &plane[nplanes]); - plane[nplanes].index = nplanes; - nplanes++; +if (planes) { +get_plane (tmp,DRM_PLANE_TYPE_PRIMARY , &planes[n_planes]); + planes[n_planes].index = n_planes; + } + n_planes++; }else if (strstr (tmp,"type=OVL" ) !=NULL ) { -get_plane (tmp,DRM_PLANE_TYPE_OVERLAY , &plane[nplanes]); - plane[nplanes].index = nplanes; - nplanes++; +if (planes) { +get_plane (tmp,DRM_PLANE_TYPE_OVERLAY , &planes[n_planes]); + planes[n_planes].index = n_planes; + } + n_planes++; }else if (strstr (tmp,"type=CUR" ) !=NULL ) { -get_plane (tmp,DRM_PLANE_TYPE_CURSOR , &plane[nplanes]); - plane[nplanes].index = nplanes; - nplanes++; +if (planes) { +get_plane (tmp,DRM_PLANE_TYPE_CURSOR , &planes[n_planes]); + planes[n_planes].index = n_planes; + } + n_planes++;break ; } } -return nplanes; +return n_planes; }static void parse_crtc (char *info,struct kmstest_crtc *crtc)
@@ -1304,7 +1309,12 @@ void kmstest_get_crtc(enum pipe pipe, struct kmstest_crtc *crtc)if (strstr (tmp,"active=yes" ) !=NULL ) { crtc->active = true;parse_crtc (tmp, crtc); - crtc->nplanes =parse_planes (fid, crtc->plane); + + crtc->nplanes =parse_planes (fid,NULL ); + crtc->plane =calloc (crtc->nplanes,sizeof (*crtc->plane)); +fseek (fid,0 ,SEEK_END ); +fseek (fid,0 ,SEEK_SET ); +parse_planes (fid, crtc->plane);if (crtc->pipe != pipe) crtc =NULL ;
@@ -1330,7 +1340,10 @@ void igt_assert_plane_visible(enum pipe pipe, bool visibility)kmstest_get_crtc (pipe, &crtc); visible = true; -for (i =IGT_PLANE_2 ; i < crtc.nplanes; i++) { +for (i =0 ; i < crtc.nplanes; i++) { +if (crtc.plane[i].type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +if (crtc.plane[i].pos_x > crtc.width) { visible = false;break ;
lib/igt_kms.h +2 -2
@@ -135,8 +135,8 @@ struct kmstest_connector_config {struct kmstest_plane {int id; -int plane;int index; +int type;int pos_x;int pos_y;int width;
@@ -150,7 +150,7 @@ struct kmstest_crtc {int width;int height;int nplanes; -struct kmstest_plane plane[IGT_MAX_PLANES ]; +struct kmstest_plane *plane; };/**
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t v1 02/32] lib/igt_kms: Avoid depencency on static plane count
Quoted 135 lines · Robert Foss
Rework
kmstest_crtcandkmstest_planestructs and their usage to not depend on a static plane count.Signed-off-by Robert Foss <[email protected]>---
lib/igt_kms.c | 47 ++++++++++++++++++++++++++++++-----------------lib/igt_kms.h| 4 ++--2 files changed, 32 insertions(+), 19 deletions(-)lib/igt_kms.c +0
-0@@ -1227,7 +1227,7 @@ static void get_plane(char *str, int type, struct kmstest_plane *plane) int ret; char buf[256];lib/igt_kms.c +1
-1- plane->plane = type; + plane->type = type;ret = sscanf(str + 12, "%d%*c %*s %[^n]s",
&plane->id,
buf);lib/igt_kms.c +0
-0@@ -1240,31 +1240,36 @@ static void get_plane(char *str, int type, struct kmstest_plane *plane) igt_assert_eq(ret, 2); }lib/igt_kms.c +1
-1-static int parse_planes (FILE *fid,struct kmstest_plane *plane) +static int parse_planes (FILE *fid,struct kmstest_plane *planes){
char tmp[256];lib/igt_kms.c +1
-1-int nplanes; +int n_planes;lib/igt_kms.c +1
-1- nplanes =0 ; + n_planes =0 ;while (
fgets(tmp, 256, fid)!= NULL) {lib/igt_kms.c +0
-1-igt_assert_neq (nplanes,IGT_MAX_PLANES );if (
strstr(tmp, "type=PRI")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, DRM_PLANE_TYPE_PRIMARY,&plane[nplanes]);
lib/igt_kms.c +2
-2- plane[nplanes].index = nplanes; - nplanes++; +if (planes) { + get_plane(tmp,
DRM_PLANE_TYPE_PRIMARY, &planes[n_planes]);lib/igt_kms.c +3
-0+ planes[n_planes].index = n_planes; + } + n_planes++;} else if (
strstr(tmp, "type=OVL")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, DRM_PLANE_TYPE_OVERLAY,&plane[nplanes]);
lib/igt_kms.c +2
-2- plane[nplanes].index = nplanes; - nplanes++; +if (planes) { + get_plane(tmp,
DRM_PLANE_TYPE_OVERLAY, &planes[n_planes]);lib/igt_kms.c +3
-0+ planes[n_planes].index = n_planes; + } + n_planes++;} else if (
strstr(tmp, "type=CUR")!= NULL) {lib/igt_kms.c +0
-1- get_plane(tmp, DRM_PLANE_TYPE_CURSOR,&plane[nplanes]);
lib/igt_kms.c +2
-2- plane[nplanes].index = nplanes; - nplanes++; +if (planes) { + get_plane(tmp,
DRM_PLANE_TYPE_CURSOR, &planes[n_planes]);lib/igt_kms.c +3
-0+ planes[n_planes].index = n_planes; + } + n_planes++;break;
}
}lib/igt_kms.c +1
-1-return nplanes; +return n_planes;}
static voidparse_crtc(char *info, struct kmstest_crtc *crtc)lib/igt_kms.c +3
-1@@ -1304,7 +1309,12 @@ void kmstest_get_crtc(enum pipe pipe, struct kmstest_crtc *crtc) if (strstr(tmp, "active=yes") != NULL) { crtc->active = true; parse_crtc(tmp, crtc); - crtc->nplanes =parse_planes (fid, crtc->plane); + + crtc->nplanes =parse_planes (fid,NULL ); + crtc->plane = calloc(crtc->nplanes,
sizeof(*crtc->plane));lib/igt_kms.c +3
-0+fseek (fid,0 ,SEEK_END ); +fseek (fid,0 ,SEEK_SET ); +parse_planes (fid, crtc->plane);
if (crtc->pipe!= pipe) crtc = NULL;lib/igt_kms.c +0
-0@@ -1330,7 +1340,10 @@ void igt_assert_plane_visible(enum pipe pipe, bool visibility) kmstest_get_crtc(pipe, &crtc);
visible = true;lib/igt_kms.c +4
-1-for (i =IGT_PLANE_2 ; i < crtc.nplanes; i++) { +for (i =0 ; i < crtc.nplanes; i++) { +if (crtc.plane[i].type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +if (crtc.plane[i].pos_x > crtc.width) { visible = false; break;
lib/igt_kms.h +0
-0@@ -135,8 +135,8 @@ struct kmstest_connector_config {
structkmstest_plane{
int id;lib/igt_kms.h +0
-1-int plane;int index;
lib/igt_kms.h +1
-0+int type;int
pos_x;
intpos_y;
int width;lib/igt_kms.h +1
-1@@ -150,7 +150,7 @@ struct kmstest_crtc { int width; int height; int nplanes; -struct kmstest_plane plane[IGT_MAX_PLANES ]; +struct kmstest_plane *plane; };
/**
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/32 lib/igt_kms: Rename kmstest properties nplanes and plane
In reply to Robert FossRename these properties to have them use the same naming convention as the igt_*_t structs.
--- lib/igt_kms.c | 16 +++++++++------- lib/igt_kms.h | 4 ++-- tests/kms_plane_lowres.c | 10 +++++----- 3 files changed, 16 insertions(+), 14 deletions(-)
lib/igt_kms.c +9 -7
@@ -1310,11 +1310,13 @@ void kmstest_get_crtc(enum pipe pipe, struct kmstest_crtc *crtc) crtc->active = true;parse_crtc (tmp, crtc); - crtc->nplanes =parse_planes (fid,NULL ); - crtc->plane =calloc (crtc->nplanes,sizeof (*crtc->plane)); + crtc->n_planes =parse_planes (fid,NULL ); + crtc->planes =calloc (crtc->n_planes,sizeof (*crtc->planes)); +igt_assert_f (crtc->planes,"Failed to allocate memory for %d planes\n" , crtc->n_planes); +fseek (fid,0 ,SEEK_END );fseek (fid,0 ,SEEK_SET ); -parse_planes (fid, crtc->plane); +parse_planes (fid, crtc->planes);if (crtc->pipe != pipe) crtc =NULL ;
@@ -1340,14 +1342,14 @@ void igt_assert_plane_visible(enum pipe pipe, bool visibility)kmstest_get_crtc (pipe, &crtc); visible = true; -for (i =0 ; i < crtc.nplanes; i++) { -if (crtc.plane[i].type ==DRM_PLANE_TYPE_PRIMARY ) +for (i =0 ; i < crtc.n_planes; i++) { +if (crtc.planes[i].type ==DRM_PLANE_TYPE_PRIMARY )continue ; -if (crtc.plane[i].pos_x > crtc.width) { +if (crtc.planes[i].pos_x > crtc.width) { visible = false;break ; - }else if (crtc.plane[i].pos_y > crtc.height) { + }else if (crtc.planes[i].pos_y > crtc.height) { visible = false;break ; }
lib/igt_kms.h +2 -2
@@ -149,8 +149,8 @@ struct kmstest_crtc {bool active;int width;int height; -int nplanes; -struct kmstest_plane *plane; +int n_planes; +struct kmstest_plane *planes; };/**
tests/kms_plane_lowres.c +5 -5
@@ -181,11 +181,11 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,igt_output_set_pipe (output, pipe);kmstest_get_crtc (pipe, &crtc); -igt_skip_on (crtc.nplanes > data->display.pipes[pipe].n_planes); -igt_skip_on (crtc.nplanes ==0 ); +igt_skip_on (crtc.n_planes > data->display.pipes[pipe].n_planes); +igt_skip_on (crtc.n_planes ==0 ); -for (i =0 ; i < crtc.nplanes; i++) - data->plane[i] =igt_output_get_plane (output, crtc.plane[i].index); +for (i =0 ; i < crtc.n_planes; i++) + data->plane[i] =igt_output_get_plane (output, crtc.planes[i].index); mode =igt_output_get_mode (output);
@@ -198,7 +198,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,igt_plane_set_fb (data->plane[0 ], &data->fb[0 ]);/* yellow sprite plane in lower left corner */ -for (i =IGT_PLANE_2 ; i < crtc.nplanes; i++) { +for (i =IGT_PLANE_2 ; i < crtc.n_planes; i++) {if (data->plane[i]->is_cursor) size =64 ;else
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t v1 03/32] lib/igt_kms: Rename kmstest properties nplanes and plane
Quoted 107 lines · Robert Foss
Rename these properties to have them use the same naming convention as the igt_*_t structs.
Signed-off-by Robert Foss <[email protected]>---
lib/igt_kms.c | 16 +++++++++-------
lib/igt_kms.h | 4 ++--
tests/kms_plane_lowres.c | 10 +++++-----3 files changed, 16 insertions(+), 14 deletions(-)lib/igt_kms.c +0
-0@@ -1310,11 +1310,13 @@ void kmstest_get_crtc(enum pipe pipe, struct kmstest_crtc *crtc) crtc->active = true; parse_crtc(tmp, crtc);lib/igt_kms.c +0
-1- crtc->nplanes = parse_planes(fid,NULL);
lib/igt_kms.c +0
-1- crtc->plane = calloc(crtc->nplanes,
sizeof(*crtc->plane));lib/igt_kms.c +1
-0+ crtc->n_planes = parse_planes(fid,NULL);
lib/igt_kms.c +1
-0+ crtc->planes = calloc(crtc-Quoted 1 line
n_planes,sizeof(*crtc->planes));lib/igt_kms.c +1
-0+ igt_assert_f(crtc->planes, "Failedto allocate memory for %d planes\n",
crtc->n_planes); +
fseek(fid, 0, SEEK_END);fseek(fid, 0, SEEK_SET);lib/igt_kms.c +1
-1-parse_planes (fid, crtc->plane); +parse_planes (fid, crtc->planes);
if (crtc->pipe!= pipe) crtc = NULL;lib/igt_kms.c +0
-0@@ -1340,14 +1342,14 @@ void igt_assert_plane_visible(enum pipe pipe, bool visibility) kmstest_get_crtc(pipe, &crtc);
visible = true;lib/igt_kms.c +2
-2-for (i =0 ; i < crtc.nplanes; i++) { -if (crtc.plane[i].type ==DRM_PLANE_TYPE_PRIMARY ) +for (i =0 ; i < crtc.n_planes; i++) { +if (crtc.planes[i].type ==DRM_PLANE_TYPE_PRIMARY )continue;
lib/igt_kms.c +1
-1-if (crtc.plane[i].pos_x > crtc.width) { +if (crtc.planes[i].pos_x > crtc.width) {visible = false;
break;lib/igt_kms.c +1
-1- }else if (crtc.plane[i].pos_y > crtc.height) { + }else if (crtc.planes[i].pos_y > crtc.height) {visible = false;
break;
}lib/igt_kms.h +2
-2@@ -149,8 +149,8 @@ struct kmstest_crtc { bool active; int width; int height; -int nplanes; -struct kmstest_plane *plane; +int n_planes; +struct kmstest_plane *planes; };
/**tests/kms_plane_lowres.c +0
-0@@ -181,11 +181,11 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_output_set_pipe(output, pipe);
kmstest_get_crtc(pipe, &crtc);tests/kms_plane_lowres.c +0
-1- igt_skip_on(crtc.nplanes > data-Quoted 1 line
display.pipes[pipe].n_planes);
tests/kms_plane_lowres.c +1
-1-igt_skip_on (crtc.nplanes ==0 ); + igt_skip_on(crtc.n_planes > data-Quoted 1 line
display.pipes[pipe].n_planes);
tests/kms_plane_lowres.c +1
-0+igt_skip_on (crtc.n_planes ==0 );tests/kms_plane_lowres.c +0
-2-for (i =0 ; i < crtc.nplanes; i++) - data->plane[i] = igt_output_get_plane(output,crtc.plane[i].index);
tests/kms_plane_lowres.c +2
-0+for (i =0 ; i < crtc.n_planes; i++) + data->plane[i] = igt_output_get_plane(output,crtc.planes[i].index);
mode =igt_output_get_mode(output);tests/kms_plane_lowres.c +0
-0@@ -198,7 +198,7 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, igt_plane_set_fb(data->plane[0], &data->fb[0]);
/* yellow sprite plane in lower left corner */tests/kms_plane_lowres.c +1
-1-for (i =IGT_PLANE_2 ; i < crtc.nplanes; i++) { +for (i =IGT_PLANE_2 ; i < crtc.n_planes; i++) {if (data->plane[i]->is_cursor)
size = 64;
else
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/32 lib/igt_kms: Implement dynamic plane count support
In reply to Robert FossIn upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe.
The simple fix for this would be to simply bump hardcoded value for number of frames per pipe.
But a better solution would be to add support for dynamic number of planes per pipe to i-g-t.
--- lib/igt_kms.c | 157 +++++++++++++++++++++++++++++++++++++++------------------- lib/igt_kms.h | 32 ++++-------- 2 files changed, 114 insertions(+), 75 deletions(-)
lib/igt_kms.c +105 -52
@@ -347,24 +347,17 @@ int kmstest_pipe_to_index(char pipe)* * Returns: String represnting @pipe, e.g. "plane1". */ -const char *kmstest_plane_name (enum igt_plane plane) +const char *kmstest_plane_type_name (int plane_type) {static const char *names[] = { - [IGT_PLANE_1 ] ="plane1" , - [IGT_PLANE_2 ] ="plane2" , - [IGT_PLANE_3 ] ="plane3" , - [IGT_PLANE_4 ] ="plane4" , - [IGT_PLANE_5 ] ="plane5" , - [IGT_PLANE_6 ] ="plane6" , - [IGT_PLANE_7 ] ="plane7" , - [IGT_PLANE_8 ] ="plane8" , - [IGT_PLANE_9 ] ="plane9" , - [IGT_PLANE_CURSOR ] ="cursor" , + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , }; -igt_assert (plane <ARRAY_SIZE (names) && names[plane]); +igt_assert (plane_type <ARRAY_SIZE (names) && names[plane_type]); -return names[plane]; +return names[plane_type]; }static const char *mode_stereo_name (const drmModeModeInfo *mode)
@@ -1532,14 +1525,17 @@ void igt_display_init(igt_display_t *display, int drm_fd)for (i =0 ; i < display->n_pipes; i++) {igt_pipe_t *pipe = &display->pipes[i];igt_plane_t *plane; -int p =IGT_PLANE_2 ; +int p =1 ;int j, type; -uint8_t n_planes =0 ; +uint8_t last_plane =0 , n_planes =0 ;uint64_t prop_value; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; pipe->pipe = i; + pipe->plane_cursor =-1 ; + pipe->plane_primary =-1 ; + pipe->planes =NULL ; get_crtc_property(display->drm_fd, pipe->crtc_id, "background_color",
@@ -1565,6 +1561,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)igt_atomic_fill_pipe_props (display, pipe,IGT_NUM_CRTC_PROPS , igt_crtc_prop_names); +/* count number of valid planes */ +for (j =0 ; j < plane_resources->count_planes; j++) { +drmModePlane *drm_plane; + + drm_plane =drmModeGetPlane (display->drm_fd, + plane_resources->planes[j]); +igt_assert (drm_plane); + +if (!(drm_plane->possible_crtcs & (1 << i))) { +drmModeFreePlane (drm_plane); +continue ; + } + + n_planes++; + } + +igt_assert_lte (0 , n_planes); + pipe->planes =calloc (sizeof (igt_plane_t), n_planes); +igt_assert_f (pipe->planes,"Failed to allocate memory for %d planes\n" , n_planes); + last_plane = n_planes -1 ; +/* add the planes that can be used with that pipe */ for (j =0 ; j < plane_resources->count_planes; j++) {drmModePlane *drm_plane;
@@ -1582,21 +1599,24 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane_resources->planes[j]);switch (type) {case DRM_PLANE_TYPE_PRIMARY : - plane = &pipe->planes[IGT_PLANE_PRIMARY ]; - plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + }break ;case DRM_PLANE_TYPE_CURSOR : -/* -* Cursor should be the highest index in our -* internal list, but we don't know what that -* is yet. Just stick it in the last slot -* for now and we'll move it later, if -* necessary. -*/ - plane = &pipe->planes[IGT_PLANE_CURSOR ]; - plane->is_cursor =1 ; - plane->index =IGT_PLANE_CURSOR ; +if (pipe->plane_cursor ==-1 ) { + plane = &pipe->planes[last_plane]; + plane->index = last_plane; + pipe->plane_cursor = last_plane; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + } display->has_cursor_plane = true;break ;default :
@@ -1605,7 +1625,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)break ; } - n_planes++; + plane->type = type; plane->pipe = pipe; plane->drm_plane = drm_plane;
@@ -1626,7 +1646,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)* At the bare minimum, we should expect to have a primary * plane */ -igt_assert (pipe->planes[IGT_PLANE_PRIMARY ].drm_plane); +igt_assert (pipe->planes[pipe->plane_primary].drm_plane);if (display->has_cursor_plane) {/*
@@ -1634,11 +1654,11 @@ void igt_display_init(igt_display_t *display, int drm_fd)* only 1 sprite, that's the wrong slot and we need to * move it down. */ -if (p !=IGT_PLANE_CURSOR ) { +if (p != last_plane) { pipe->planes[p] = - pipe->planes[IGT_PLANE_CURSOR ]; + pipe->planes[last_plane]; pipe->planes[p].index = p; -memset (&pipe->planes[IGT_PLANE_CURSOR ],0 , +memset (&pipe->planes[last_plane],0 ,sizeof *plane); } }else {
@@ -1646,7 +1666,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane = &pipe->planes[p]; plane->pipe = pipe; plane->index = p; - plane->is_cursor = true; + plane->type =DRM_PLANE_TYPE_CURSOR ; } pipe->n_planes = n_planes;
@@ -1654,9 +1674,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)for_each_plane_on_pipe (display, i, plane) plane->fb_changed = true; -/* make sure we don't overflow the plane array */ -igt_assert_lte (pipe->n_planes,IGT_MAX_PLANES ); - pipe->mode_changed = true; }
@@ -1709,6 +1726,9 @@ static void igt_pipe_fini(igt_pipe_t *pipe) plane->drm_plane =NULL ; } } + +free (pipe->planes); + pipe->planes =NULL ; }static void igt_output_fini (igt_output_t *output)
@@ -1797,20 +1817,41 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)return &display->pipes[pipe]; } -static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,enum igt_plane plane) +static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,int plane_idx) { -int idx; +igt_assert_f (plane_idx >=0 && plane_idx < pipe->n_planes, +"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d" , + plane_idx, pipe->n_planes); -/* Cursor plane is always the highest index */ -if (plane ==IGT_PLANE_CURSOR ) - idx = pipe->n_planes -1 ; -else { -igt_assert_f (plane >=0 && plane < (pipe->n_planes), -"plane=%d\n" , plane); - idx = plane; +return &pipe->planes[plane_idx]; +} + + +igt_plane_t *igt_pipe_get_plane_type (igt_pipe_t *pipe,int plane_type) +{ +int i, plane_idx =-1 ; + +switch (plane_type) { +case DRM_PLANE_TYPE_CURSOR : + plane_idx = pipe->plane_cursor; +break ; +case DRM_PLANE_TYPE_PRIMARY : + plane_idx = pipe->plane_primary; +break ; +case DRM_PLANE_TYPE_OVERLAY : +for (i =0 ; i < pipe->n_planes; i++) +if (pipe->planes[i].type ==DRM_PLANE_TYPE_OVERLAY ) + plane_idx = i; +break ; +default : +break ; } -return &pipe->planes[idx]; +igt_assert_f (plane_idx >=0 && plane_idx < pipe->n_planes, +"Valid pipe->planes idx not found. plane_idx=%d plane_type=%d n_planes=%d\n" , + plane_idx, plane_type, pipe->n_planes); + +return &pipe->planes[plane_idx]; }static igt_output_t *igt_pipe_get_output (igt_pipe_t *pipe)
@@ -2155,9 +2196,9 @@ static int igt_plane_commit(igt_plane_t *plane, enum igt_commit_style s, bool fail_on_error) { -if (plane->is_cursor && s ==COMMIT_LEGACY ) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR && s ==COMMIT_LEGACY ) {return igt_cursor_commit_legacy (plane, pipe, fail_on_error); - }else if (plane->is_primary && s ==COMMIT_LEGACY ) { + }else if (plane->type ==DRM_PLANE_TYPE_PRIMARY && s ==COMMIT_LEGACY ) {return igt_primary_plane_commit_legacy (plane, pipe, fail_on_error); }else {
@@ -2374,7 +2415,9 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s) plane->position_changed = false; plane->size_changed = false; -if (s !=COMMIT_LEGACY || !(plane->is_primary || plane->is_cursor)) +if (s !=COMMIT_LEGACY || + !(plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR )) plane->rotation_changed = false; } }
@@ -2654,14 +2697,24 @@ void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)igt_require (output->config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE ]); } -igt_plane_t *igt_output_get_plane (igt_output_t *output,enum igt_plane plane) +igt_plane_t *igt_output_get_plane (igt_output_t *output,int plane_idx) +{ +igt_pipe_t *pipe; + + pipe =igt_output_get_driving_pipe (output); +igt_assert (pipe); + +return igt_pipe_get_plane (pipe, plane_idx); +} + +igt_plane_t *igt_output_get_plane_type (igt_output_t *output,int plane_type) {igt_pipe_t *pipe; pipe =igt_output_get_driving_pipe (output);igt_assert (pipe); -return igt_pipe_get_plane (pipe, plane); +return igt_pipe_get_plane_type (pipe, plane_type); }void igt_plane_set_fb (igt_plane_t *plane,struct igt_fb *fb)
lib/igt_kms.h +9 -23
@@ -57,25 +57,7 @@ enum pipe {I915_MAX_PIPES };const char *kmstest_pipe_name (enum pipe pipe); -int kmstest_pipe_to_index (char pipe); - -/* We namespace this enum to not conflict with the Android i915_drm.h */ -enum igt_plane { -IGT_PLANE_1 =0 , -IGT_PLANE_PRIMARY =IGT_PLANE_1 , -IGT_PLANE_2 , -IGT_PLANE_3 , -IGT_PLANE_4 , -IGT_PLANE_5 , -IGT_PLANE_6 , -IGT_PLANE_7 , -IGT_PLANE_8 , -IGT_PLANE_9 , -IGT_PLANE_CURSOR ,/* IGT_PLANE_CURSOR is always the last plane. */ -IGT_MAX_PLANES , -}; - -const char *kmstest_plane_name (enum igt_plane plane); +const char *kmstest_plane_type_name (int plane_type);enum port {PORT_A =0 ,
@@ -257,8 +239,7 @@ typedef struct {igt_pipe_t *pipe;int index;/* capabilities */ - unsigned int is_primary : 1; - unsigned int is_cursor : 1; +int type;/* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;
@@ -293,8 +274,11 @@ struct igt_pipe {igt_display_t *display;enum pipe pipe;bool enabled; +int n_planes; -igt_plane_t planes[IGT_MAX_PLANES ]; +int plane_cursor; +int plane_primary; +igt_plane_t *planes;uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS ];
@@ -354,7 +338,9 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);void igt_output_override_mode (igt_output_t *output,drmModeModeInfo *mode);void igt_output_set_pipe (igt_output_t *output,enum pipe pipe);void igt_output_set_scaling_mode (igt_output_t *output,uint64_t scaling_mode); -igt_plane_t *igt_output_get_plane (igt_output_t *output,enum igt_plane plane); +igt_plane_t *igt_output_get_plane (igt_output_t *output,int plane_idx); +igt_plane_t *igt_output_get_plane_type (igt_output_t *output,int plane_type); +igt_plane_t *igt_pipe_get_plane_type (igt_pipe_t *pipe,int plane_type);bool igt_pipe_get_property (igt_pipe_t *pipe,const char *name,uint32_t *prop_id,uint64_t *value,drmModePropertyPtr *prop);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
With this patch applied, I received couple of issues during the compilation
igt_kms.c:332:5: warning: no previous prototype for ‘kmstest_pipe_to_index’ [-Wmissing-prototypes] int kmstest_pipe_to_index(char pipe)
and
kms_fence_pin_leak.c:118:41: error: ‘IGT_PLANE_PRIMARY’ undeclared (first use in this function)
primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
This would require that we move all IGT_PLANE_PRIMARY references to DRM_PLANE_TYPE_PRIMARY
Quoted 425 lines · Robert Foss
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe.
The simple fix for this would be to simply bump hardcoded value for number of frames per pipe.
But a better solution would be to add support for dynamic number of planes per pipe to i-g-t.Signed-off-by Robert Foss <[email protected]>---
lib/igt_kms.c | 157 +++++++++++++++++++++++++++++++++++++++---------
----------
lib/igt_kms.h | 32 ++++--------2 files changed, 114 insertions(+), 75 deletions(-)lib/igt_kms.c +4
-11@@ -347,24 +347,17 @@ int kmstest_pipe_to_index(char pipe)* * Returns: String represnting @pipe, e.g. "plane1". */ -const char *kmstest_plane_name (enum igt_plane plane) +const char *kmstest_plane_type_name (int plane_type) { static const char *names[] = { - [IGT_PLANE_1 ] ="plane1" , - [IGT_PLANE_2 ] ="plane2" , - [IGT_PLANE_3 ] ="plane3" , - [IGT_PLANE_4 ] ="plane4" , - [IGT_PLANE_5 ] ="plane5" , - [IGT_PLANE_6 ] ="plane6" , - [IGT_PLANE_7 ] ="plane7" , - [IGT_PLANE_8 ] ="plane8" , - [IGT_PLANE_9 ] ="plane9" , - [IGT_PLANE_CURSOR ] ="cursor" , + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , };lib/igt_kms.c +1
-1-igt_assert (plane <ARRAY_SIZE (names) && names[plane]); + igt_assert(plane_type < ARRAY_SIZE(names) &&names[plane_type]);
lib/igt_kms.c +1
-1-return names[plane]; +return names[plane_type];}
static const char *mode_stereo_name(const drmModeModeInfo *mode)lib/igt_kms.c +2
-2@@ -1532,14 +1525,17 @@ void igt_display_init(igt_display_t *display, int drm_fd) for (i = 0; i < display->n_pipes; i++) { igt_pipe_t *pipe = &display->pipes[i]; igt_plane_t *plane; -int p =IGT_PLANE_2 ; +int p =1 ; int j, type; -uint8_t n_planes =0 ; +uint8_t last_plane =0 , n_planes =0 ; uint64_t prop_value;
pipe->crtc_id= resources->crtcs[i];pipe->display= display;pipe->pipe= i;lib/igt_kms.c +3
-0+ pipe->plane_cursor =-1 ; + pipe->plane_primary =-1 ; + pipe->planes =NULL ;
get_crtc_property(display->drm_fd,pipe->crtc_id, "background_color",lib/igt_kms.c +0
-0@@ -1565,6 +1561,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)
igt_atomic_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);lib/igt_kms.c +2
-0+/* count number of valid planes */ +for (j =0 ; j < plane_resources->count_planes; j++){
lib/igt_kms.c +4
-0+drmModePlane *drm_plane; + + drm_plane = drmModeGetPlane(display->drm_fd, + plane_resources-Quoted 1 line
planes[j]);
lib/igt_kms.c +3
-0+igt_assert (drm_plane); + +if (!(drm_plane->possible_crtcs & (1 << i))){
lib/igt_kms.c +9
-0+drmModeFreePlane (drm_plane); +continue ; + } + + n_planes++; + } + +igt_assert_lte (0 , n_planes); + pipe->planes = calloc(sizeof(igt_plane_t),
n_planes);lib/igt_kms.c +1
-0+ igt_assert_f(pipe->planes, "Failed to allocatememory for %d planes\n",
n_planes);lib/igt_kms.c +2
-0+ last_plane = n_planes -1 ; +/* add the planes that can be used with that pipe */ for (j = 0; j <
plane_resources->count_planes; j++) {
drmModePlane*drm_plane;lib/igt_kms.c +0
-0@@ -1582,21 +1599,24 @@ void igt_display_init(igt_display_t *display, int drm_fd)plane_resources-
Quoted 1 line
planes[j]);
switch (type) {
caseDRM_PLANE_TYPE_PRIMARY:lib/igt_kms.c +0
-1- plane = &pipe-Quoted 1 line
planes[IGT_PLANE_PRIMARY];
lib/igt_kms.c +8
-2- plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + }break;
caseDRM_PLANE_TYPE_CURSOR:lib/igt_kms.c +0
-2-/* -* Cursor should be the highest index in our
lib/igt_kms.c +0
-1- * internal list, but we don't knowwhat that
lib/igt_kms.c +0
-1- * is yet. Just stick it in thelast slot
lib/igt_kms.c +0
-1- * for now and we'll move it later,if
lib/igt_kms.c +0
-3-* necessary. -*/ - plane = &pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +2
-2- plane->is_cursor =1 ; - plane->index =IGT_PLANE_CURSOR ; +if (pipe->plane_cursor ==-1 ) { + plane = &pipe-Quoted 1 line
planes[last_plane];
lib/igt_kms.c +2
-0+ plane->index = last_plane; + pipe->plane_cursor =
last_plane;lib/igt_kms.c +4
-0+ }else { + plane = &pipe->planes[p]; + plane->index = p++; + }
display->has_cursor_plane= true; break;
default:lib/igt_kms.c +0
-0@@ -1605,7 +1625,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; }lib/igt_kms.c +1
-1- n_planes++; + plane->type = type;
plane->pipe= pipe;plane->drm_plane=drm_plane;lib/igt_kms.c +0
-0@@ -1626,7 +1646,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) * At the bare minimum, we should expect to have aprimary
* plane
*/lib/igt_kms.c +0
-1- igt_assert(pipe-Quoted 1 line
planes[IGT_PLANE_PRIMARY].drm_plane);
lib/igt_kms.c +1
-0+ igt_assert(pipe->planes[pipe-Quoted 1 line
plane_primary].drm_plane);
if (display->has_cursor_plane) {
/*lib/igt_kms.c +0
-0@@ -1634,11 +1654,11 @@ void igt_display_init(igt_display_t *display, int drm_fd) * only 1 sprite, that's the wrong slot andwe need to
* move it down.
*/lib/igt_kms.c +1
-1-if (p !=IGT_PLANE_CURSOR ) { +if (p != last_plane) {pipe->planes[p] =
lib/igt_kms.c +0
-1- pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +1
-0+ pipe->planes[last_plane];pipe->planes[p].index = p;
lib/igt_kms.c +0
-1- memset(&pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR], 0,
lib/igt_kms.c +1
-0+ memset(&pipe->planes[last_plane], 0,sizeof *plane); }
} else {lib/igt_kms.c +1
-1@@ -1646,7 +1666,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane = &pipe->planes[p]; plane->pipe = pipe; plane->index = p; - plane->is_cursor = true; + plane->type =DRM_PLANE_TYPE_CURSOR ; }
pipe->n_planes=n_planes;lib/igt_kms.c +0
-0@@ -1654,9 +1674,6 @@ void igt_display_init(igt_display_t *display, int drm_fd) for_each_plane_on_pipe(display, i, plane) plane->fb_changed = true;lib/igt_kms.c +0
-3-/* make sure we don't overflow the plane array */ -igt_assert_lte (pipe->n_planes,IGT_MAX_PLANES ); -
pipe->mode_changed= true;
}lib/igt_kms.c +3
-0@@ -1709,6 +1726,9 @@ static void igt_pipe_fini(igt_pipe_t *pipe) plane->drm_plane = NULL; } } + +free (pipe->planes); + pipe->planes =NULL ; }
static voidigt_output_fini(igt_output_t *output)lib/igt_kms.c +0
-0@@ -1797,20 +1817,41 @@ static igt_pipe_t *igt_output_get_driving_pipe (igt_output_t *output) return &display->pipes[pipe]; }
-staticigt_plane_t*igt_pipe_get_plane(igt_pipe_t *pipe, enumigt_planeplane)
+staticigt_plane_t*igt_pipe_get_plane(igt_pipe_t *pipe, intplane_idx)
{lib/igt_kms.c +2
-1-int idx; + igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes, + "Valid pipe->planes plane_idx not found,plane_idx=%d n_planes=%d",
lib/igt_kms.c +1
-0+ plane_idx, pipe->n_planes);lib/igt_kms.c +5
-7-/* Cursor plane is always the highest index */ -if (plane ==IGT_PLANE_CURSOR ) - idx = pipe->n_planes -1 ; -else { -igt_assert_f (plane >=0 && plane < (pipe->n_planes), - "plane=%d\n", plane); - idx = plane; +return &pipe->planes[plane_idx]; +} + + +igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int
plane_type)lib/igt_kms.c +13
-0+{ +int i, plane_idx =-1 ; + +switch (plane_type) { +case DRM_PLANE_TYPE_CURSOR : + plane_idx = pipe->plane_cursor; +break ; +case DRM_PLANE_TYPE_PRIMARY : + plane_idx = pipe->plane_primary; +break ; +case DRM_PLANE_TYPE_OVERLAY : +for (i =0 ; i < pipe->n_planes; i++) + if (pipe->planes[i].type ==
DRM_PLANE_TYPE_OVERLAY)lib/igt_kms.c +4
-0+ plane_idx = i; +break ; +default : +break ;}
lib/igt_kms.c +2
-1-return &pipe->planes[idx]; + igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes, + "Valid pipe->planes idx not found. plane_idx=%dplane_type=%d n_planes=%d\n",
lib/igt_kms.c +3
-0+ plane_idx, plane_type, pipe->n_planes); + +return &pipe->planes[plane_idx];}
staticigt_output_t*igt_pipe_get_output(igt_pipe_t *pipe)lib/igt_kms.c +2
-2@@ -2155,9 +2196,9 @@ static int igt_plane_commit(igt_plane_t *plane, enum igt_commit_style s, bool fail_on_error) { -if (plane->is_cursor && s ==COMMIT_LEGACY ) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR && s ==COMMIT_LEGACY ) { return igt_cursor_commit_legacy(plane, pipe, fail_on_error); - }else if (plane->is_primary && s ==COMMIT_LEGACY ) { + }else if (plane->type ==DRM_PLANE_TYPE_PRIMARY && s ==COMMIT_LEGACY ) {return
igt_primary_plane_commit_legacy(plane, pipe, fail_on_error );
} else {lib/igt_kms.c +0
-0@@ -2374,7 +2415,9 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s) plane->position_changed = false; plane->size_changed = false;lib/igt_kms.c +0
-1- if (s != COMMIT_LEGACY || !(plane-Quoted 1 line
is_primary||plane->is_cursor))lib/igt_kms.c +2
-0+ if (s != COMMIT_LEGACY || + !(plane->type == DRM_PLANE_TYPE_PRIMARY||
lib/igt_kms.c +1
-0+ plane->type == DRM_PLANE_TYPE_CURSOR))
plane->rotation_changed= false; }
}lib/igt_kms.c +0
-0@@ -2654,14 +2697,24 @@ void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)igt_require(output-
Quoted 1 line
config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE]);
}
-igt_plane_t *igt_output_get_plane(igt_output_t *output, enumigt_planeplane)
+igt_plane_t *igt_output_get_plane(igt_output_t *output, intplane_idx)lib/igt_kms.c +10
-0+{ +igt_pipe_t *pipe; + + pipe =igt_output_get_driving_pipe (output); +igt_assert (pipe); + +return igt_pipe_get_plane (pipe, plane_idx); +} + +igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int
plane_type)
{
igt_pipe_t*pipe;
pipe =igt_output_get_driving_pipe(output);igt_assert(pipe);lib/igt_kms.c +1
-1-return igt_pipe_get_plane (pipe, plane); +return igt_pipe_get_plane_type (pipe, plane_type);}
voidigt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)lib/igt_kms.h +0
-0@@ -57,25 +57,7 @@ enum pipe {I915_MAX_PIPES
};
const char *kmstest_pipe_name(enum pipe pipe);lib/igt_kms.h +0
-3-int kmstest_pipe_to_index (char pipe); - -/* We namespace this enum to not conflict with the Android
i915_drm.h*/lib/igt_kms.h +0
-12-enum igt_plane { -IGT_PLANE_1 =0 , -IGT_PLANE_PRIMARY =IGT_PLANE_1 , -IGT_PLANE_2 , -IGT_PLANE_3 , -IGT_PLANE_4 , -IGT_PLANE_5 , -IGT_PLANE_6 , -IGT_PLANE_7 , -IGT_PLANE_8 , -IGT_PLANE_9 , -IGT_PLANE_CURSOR ,/* IGT_PLANE_CURSOR is always the last plane. */
lib/igt_kms.h +1
-4- IGT_MAX_PLANES, -}; - -const char *kmstest_plane_name (enum igt_plane plane); +const char *kmstest_plane_type_name (int plane_type);
enum port {
PORT_A = 0,lib/igt_kms.h +5
-3@@ -257,8 +239,7 @@ typedef struct { igt_pipe_t *pipe; int index; /* capabilities */ - unsigned int is_primary : 1; - unsigned int is_cursor : 1; +int type; /* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;@@ -293,8 +274,11 @@ struct igt_pipe { igt_display_t *display; enum pipe pipe; bool enabled; + int n_planes; -igt_plane_t planes[IGT_MAX_PLANES ]; +int plane_cursor; +int plane_primary; +igt_plane_t *planes;
uint32_tatomic_props_crtc[IGT_NUM_CRTC_PROPS];lib/igt_kms.h +0
-0@@ -354,7 +338,9 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);void
igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
voidigt_output_set_pipe(igt_output_t *output, enum pipe pipe); voidigt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode);
-igt_plane_t *igt_output_get_plane(igt_output_t *output, enumigt_planeplane);
+igt_plane_t *igt_output_get_plane(igt_output_t *output, intplane_idx);
+igt_plane_t *igt_output_get_plane_type(igt_output_t *output, intplane_type);
+igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, intplane_type);
booligt_pipe_get_property(igt_pipe_t *pipe, const char *name, uint32_t *prop_id, uint64_t *value, drmModePropertyPtr *prop);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Mika Kahola
With this patch applied, I received couple of issues during the compilation
igt_kms.c:332:5: warning: no previous prototype for ‘kmstest_pipe_to_index’ [-Wmissing-prototypes]
intkmstest_pipe_to_index(char pipe)
Quoted 8 lines
and
kms_fence_pin_leak.c:118:41: error: ‘IGT_PLANE_PRIMARY’ undeclared (first use in this function)
primary =igt_output_get_plane(output, IGT_PLANE_PRIMARY);This would require that we move all
IGT_PLANE_PRIMARYreferences toDRM_PLANE_TYPE_PRIMARY
In the subsequent patches I clear up all of the IGT_PLANE_* being missing issues (which does mean that trunk does not build between the enum being removed and that the individual test being fixed).
I could fix this by moving the removal of the enum until after all of the tests have had their dependency on the enum fixed.
Another solution is just to collapse all of the test fixes into this patch. Which does sound like the worse option to me.
Rob.
Quoted 419 lines · Robert Foss
Quoted 417 lines
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe.
The simple fix for this would be to simply bump hardcoded value for number of frames per pipe.
But a better solution would be to add support for dynamic number of planes per pipe to i-g-t.Signed-off-by Robert Foss <[email protected]>--- lib/igt_kms.c | 157 +++++++++++++++++++++++++++++++++++++++--------- ---------- lib/igt_kms.h | 32 ++++-------- 2 files changed, 114 insertions(+), 75 deletions(-)lib/igt_kms.c +6
-13@@ -347,24 +347,17 @@ int kmstest_pipe_to_index(char pipe)* * Returns: String represnting @pipe, e.g. "plane1". */ -const char *kmstest_plane_name (enum igt_plane plane) +const char *kmstest_plane_type_name (int plane_type) {static const char *names[] = { - [IGT_PLANE_1 ] ="plane1" , - [IGT_PLANE_2 ] ="plane2" , - [IGT_PLANE_3 ] ="plane3" , - [IGT_PLANE_4 ] ="plane4" , - [IGT_PLANE_5 ] ="plane5" , - [IGT_PLANE_6 ] ="plane6" , - [IGT_PLANE_7 ] ="plane7" , - [IGT_PLANE_8 ] ="plane8" , - [IGT_PLANE_9 ] ="plane9" , - [IGT_PLANE_CURSOR ] ="cursor" , + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , }; -igt_assert (plane <ARRAY_SIZE (names) && names[plane]); +igt_assert (plane_type <ARRAY_SIZE (names) && names[plane_type]); -return names[plane]; +return names[plane_type]; }static const char *mode_stereo_name(const drmModeModeInfo *mode)
lib/igt_kms.c +5
-2@@ -1532,14 +1525,17 @@ void igt_display_init(igt_display_t *display, int drm_fd)for (i =0 ; i < display->n_pipes; i++) {igt_pipe_t *pipe = &display->pipes[i];igt_plane_t *plane; -int p =IGT_PLANE_2 ; +int p =1 ;int j, type; -uint8_t n_planes =0 ; +uint8_t last_plane =0 , n_planes =0 ;uint64_t prop_value; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; pipe->pipe = i; + pipe->plane_cursor =-1 ; + pipe->plane_primary =-1 ; + pipe->planes =NULL ; get_crtc_property(display->drm_fd, pipe->crtc_id,lib/igt_kms.c +6
-0"background_color",@@ -1565,6 +1561,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)igt_atomic_fill_pipe_props (display ,pipe ,IGT_NUM_CRTC_PROPS ,igt_crtc_prop_names ); +/* count number of valid planes */ +for (j =0 ; j < plane_resources->count_planes; j++) { +drmModePlane *drm_plane; + + drm_plane = drmModeGetPlane(display->drm_fd, + plane_resources-Quoted 1 line
planes[j]);
lib/igt_kms.c +3
-0+igt_assert (drm_plane); + +if (!(drm_plane->possible_crtcs & (1 << i))){
lib/igt_kms.c +9
-0+drmModeFreePlane (drm_plane); +continue ; + } + + n_planes++; + } + +igt_assert_lte (0 , n_planes); + pipe->planes = calloc(sizeof(igt_plane_t),
n_planes);lib/igt_kms.c +1
-0+ igt_assert_f(pipe->planes, "Failed to allocatememory for %d planes\n",
n_planes);lib/igt_kms.c +2
-0+ last_plane = n_planes -1 ; +/* add the planes that can be used with that pipe */ for (j =0 ; j < plane_resources->count_planes; j++){
lib/igt_kms.c +8
-5drmModePlane *drm_plane;@@ -1582,21 +1599,24 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane_resources- > planes[j]);switch (type) {case DRM_PLANE_TYPE_PRIMARY : - plane = &pipe- > planes[IGT_PLANE_PRIMARY]; - plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + }break ;case DRM_PLANE_TYPE_CURSOR : -/* -* Cursor should be the highest index in our
lib/igt_kms.c +0
-1-* internal list, but we don't know what that
lib/igt_kms.c +0
-1-* is yet. Just stick it in the last slot
lib/igt_kms.c +0
-1-* for now and we'll move it later, if
lib/igt_kms.c +0
-3-* necessary. -*/ - plane = &pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +2
-2- plane->is_cursor =1 ; - plane->index =IGT_PLANE_CURSOR ; +if (pipe->plane_cursor ==-1 ) { + plane = &pipe-Quoted 1 line
planes[last_plane];
lib/igt_kms.c +2
-0+ plane->index = last_plane; + pipe->plane_cursor =
last_plane;lib/igt_kms.c +5
-1+ }else { + plane = &pipe->planes[p]; + plane->index = p++; + } display->has_cursor_plane = true;break ;default :@@ -1605,7 +1625,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; } - n_planes++; + plane->type = type; plane->pipe = pipe; plane->drm_plane = drm_plane;@@ -1626,7 +1646,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) * At the bare minimum, we should expect to have aprimary
lib/igt_kms.c +0
-1* plane */ - igt_assert(pipe-Quoted 1 line
planes[IGT_PLANE_PRIMARY].drm_plane);
lib/igt_kms.c +1
-0+ igt_assert(pipe->planes[pipe-Quoted 1 line
plane_primary].drm_plane);
lib/igt_kms.c +0
-0if (display->has_cursor_plane) {/* @@ -1634,11 +1654,11 @@ void igt_display_init(igt_display_t *display, int drm_fd) * only 1 sprite, that's the wrong slot andwe need to
lib/igt_kms.c +1
-2* move it down. */ -if (p !=IGT_PLANE_CURSOR ) { +if (p != last_plane) { pipe->planes[p] = - pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +1
-1+ pipe->planes[last_plane]; pipe->planes[p].index = p; - memset(&pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR], 0,
lib/igt_kms.c +2
-1+memset (&pipe->planes[last_plane],0 ,sizeof *plane); } }else {@@ -1646,7 +1666,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane = &pipe->planes[p]; plane->pipe = pipe; plane->index = p; - plane->is_cursor = true; + plane->type =DRM_PLANE_TYPE_CURSOR ; }lib/igt_kms.c +31
-13pipe->n_planes = n_planes;@@ -1654,9 +1674,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)for_each_plane_on_pipe (display, i, plane) plane->fb_changed = true; -/* make sure we don't overflow the plane array */ -igt_assert_lte (pipe->n_planes,IGT_MAX_PLANES ); - pipe->mode_changed = true; }@@ -1709,6 +1726,9 @@ static void igt_pipe_fini(igt_pipe_t *pipe) plane->drm_plane =NULL ; } } + +free (pipe->planes); + pipe->planes =NULL ; }static void igt_output_fini (igt_output_t *output)@@ -1797,20 +1817,41 @@ static igt_pipe_t *igt_output_get_driving_pipe (igt_output_t *output) return &display->pipes[pipe]; } -static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,enum igt_plane plane) +static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,int plane_idx) { -int idx; +igt_assert_f (plane_idx >=0 && plane_idx < pipe->n_planes, +"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d", + plane_idx, pipe->n_planes); - /* Cursor plane is always the highest index */ - if (plane == IGT_PLANE_CURSOR) - idx = pipe->n_planes -1 ; - else { -igt_assert_f (plane >=0 && plane < (pipe->n_planes), -"plane=%d\n" , plane); - idx = plane; +return &pipe->planes[plane_idx]; +} + + +igt_plane_t *igt_pipe_get_plane_type (igt_pipe_t *pipe,int plane_type) +{ +int i, plane_idx =-1 ; + +switch (plane_type) { +case DRM_PLANE_TYPE_CURSOR : + plane_idx = pipe->plane_cursor; +break ; +case DRM_PLANE_TYPE_PRIMARY : + plane_idx = pipe->plane_primary; +break ; +case DRM_PLANE_TYPE_OVERLAY : +for (i =0 ; i < pipe->n_planes; i++) +if (pipe->planes[i].type ==DRM_PLANE_TYPE_OVERLAY ) + plane_idx = i; +break ; +default : +break ; } -return &pipe->planes[idx]; + igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes, + "Valid pipe->planes idx not found. plane_idx=%dplane_type=%d n_planes=%d\n",
lib/igt_kms.c +5
-2+ plane_idx, plane_type, pipe->n_planes); + +return &pipe->planes[plane_idx]; }static igt_output_t *igt_pipe_get_output (igt_pipe_t *pipe)@@ -2155,9 +2196,9 @@ static int igt_plane_commit(igt_plane_t *plane, enum igt_commit_style s, bool fail_on_error) { -if (plane->is_cursor && s ==COMMIT_LEGACY ) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR && s ==COMMIT_LEGACY ) {return igt_cursor_commit_legacy (plane, pipe, fail_on_error); - } else if (plane->is_primary && s == COMMIT_LEGACY) { + }else if (plane->type ==DRM_PLANE_TYPE_PRIMARY && s ==COMMIT_LEGACY ) {lib/igt_kms.c +0
-0return igt_primary_plane_commit_legacy (plane, pipe, fail_on_error);
lib/igt_kms.c +2
-1}else {@@ -2374,7 +2415,9 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s) plane->position_changed = false; plane->size_changed = false; -if (s !=COMMIT_LEGACY || !(plane- > is_primary || plane->is_cursor)) + if (s != COMMIT_LEGACY || + !(plane->type == DRM_PLANE_TYPE_PRIMARY||
lib/igt_kms.c +13
-2+ plane->type == DRM_PLANE_TYPE_CURSOR)) plane->rotation_changed = false; } }@@ -2654,14 +2697,24 @@ void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)igt_require (output- > config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE]); } -igt_plane_t *igt_output_get_plane (igt_output_t *output,enum igt_plane plane) +igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx) +{ +igt_pipe_t *pipe; + + pipe =igt_output_get_driving_pipe (output); +igt_assert (pipe); + +return igt_pipe_get_plane (pipe, plane_idx); +} + +igt_plane_t *igt_output_get_plane_type (igt_output_t *output,int plane_type) {igt_pipe_t *pipe; pipe =igt_output_get_driving_pipe (output);igt_assert (pipe); -return igt_pipe_get_plane (pipe, plane); +return igt_pipe_get_plane_type (pipe, plane_type); }void igt_plane_set_fb (igt_plane_t *plane,struct igt_fb *fb)lib/igt_kms.h +0
-3@@ -57,25 +57,7 @@ enum pipe { I915_MAX_PIPES };const char *kmstest_pipe_name (enum pipe pipe); -int kmstest_pipe_to_index (char pipe); - -/* We namespace this enum to not conflict with the Android
i915_drm.h*/lib/igt_kms.h +0
-12-enum igt_plane { -IGT_PLANE_1 =0 , -IGT_PLANE_PRIMARY =IGT_PLANE_1 , -IGT_PLANE_2 , -IGT_PLANE_3 , -IGT_PLANE_4 , -IGT_PLANE_5 , -IGT_PLANE_6 , -IGT_PLANE_7 , -IGT_PLANE_8 , -IGT_PLANE_9 , -IGT_PLANE_CURSOR ,/* IGT_PLANE_CURSOR is always the last plane. */
lib/igt_kms.h +6
-8- IGT_MAX_PLANES, -}; - -const char *kmstest_plane_name (enum igt_plane plane); +const char *kmstest_plane_type_name (int plane_type);enum port {PORT_A =0 ,@@ -257,8 +239,7 @@ typedef struct {igt_pipe_t *pipe;int index;/* capabilities */ - unsigned int is_primary : 1; - unsigned int is_cursor : 1; +int type;/* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;@@ -293,8 +274,11 @@ struct igt_pipe {igt_display_t *display;enum pipe pipe;bool enabled; +int n_planes; -igt_plane_t planes[IGT_MAX_PLANES ]; +int plane_cursor; +int plane_primary; +igt_plane_t *planes;uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS ];@@ -354,7 +338,9 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);void igt_output_override_mode (igt_output_t *output,drmModeModeInfo *mode);void igt_output_set_pipe (igt_output_t *output,enum pipe pipe);void igt_output_set_scaling_mode (igt_output_t *output,uint64_t scaling_mode); -igt_plane_t *igt_output_get_plane(igt_output_t *output, enum
igt_planeplane);
+igt_plane_t *igt_output_get_plane(igt_output_t *output, int
Quoted 8 lines
lib/igt_kms.h drmModeModeInfo *igt_output_get_mode(igt_output_t *output); · line 346
Quoted 8 lines
plane_idx);
+igt_plane_t *igt_output_get_plane_type(igt_output_t *output, intplane_type);
+igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, intplane_type);
bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,lib/igt_kms.h +0
-0uint32_t *prop_id, uint64_t *value, drmModePropertyPtr *prop);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Robert Foss
In the subsequent patches I clear up all of the IGT_PLANE_* being missing issues (which does mean that trunk does not build between the enum being removed and that the individual test being fixed).
I could fix this by moving the removal of the enum until after all of the tests have had their dependency on the enum fixed.
This is how it's done. No deliberately broken commits please.
--
Petri Latvala
Quoted 428 lines
Another solution is just to collapse all of the test fixes into this patch. Which does sound like the worse option to me.
Rob.
Quoted 423 lines · Robert Foss
Quoted 421 lines
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe.
The simple fix for this would be to simply bump hardcoded value for number of frames per pipe.
But a better solution would be to add support for dynamic number of planes per pipe to i-g-t.Signed-off-by Robert Foss <[email protected]>--- lib/igt_kms.c | 157 +++++++++++++++++++++++++++++++++++++++--------- ---------- lib/igt_kms.h | 32 ++++-------- 2 files changed, 114 insertions(+), 75 deletions(-)lib/igt_kms.c +6
-13@@ -347,24 +347,17 @@ int kmstest_pipe_to_index(char pipe)* * Returns: String represnting @pipe, e.g. "plane1". */ -const char *kmstest_plane_name (enum igt_plane plane) +const char *kmstest_plane_type_name (int plane_type) {static const char *names[] = { - [IGT_PLANE_1 ] ="plane1" , - [IGT_PLANE_2 ] ="plane2" , - [IGT_PLANE_3 ] ="plane3" , - [IGT_PLANE_4 ] ="plane4" , - [IGT_PLANE_5 ] ="plane5" , - [IGT_PLANE_6 ] ="plane6" , - [IGT_PLANE_7 ] ="plane7" , - [IGT_PLANE_8 ] ="plane8" , - [IGT_PLANE_9 ] ="plane9" , - [IGT_PLANE_CURSOR ] ="cursor" , + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , }; -igt_assert (plane <ARRAY_SIZE (names) && names[plane]); +igt_assert (plane_type <ARRAY_SIZE (names) && names[plane_type]); -return names[plane]; +return names[plane_type]; }static const char *mode_stereo_name(const drmModeModeInfo *mode)
lib/igt_kms.c +5
-2@@ -1532,14 +1525,17 @@ void igt_display_init(igt_display_t *display, int drm_fd)for (i =0 ; i < display->n_pipes; i++) {igt_pipe_t *pipe = &display->pipes[i];igt_plane_t *plane; -int p =IGT_PLANE_2 ; +int p =1 ;int j, type; -uint8_t n_planes =0 ; +uint8_t last_plane =0 , n_planes =0 ;uint64_t prop_value; pipe->crtc_id = resources->crtcs[i]; pipe->display = display; pipe->pipe = i; + pipe->plane_cursor =-1 ; + pipe->plane_primary =-1 ; + pipe->planes =NULL ; get_crtc_property(display->drm_fd, pipe->crtc_id,lib/igt_kms.c +6
-0"background_color",@@ -1565,6 +1561,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)igt_atomic_fill_pipe_props (display ,pipe ,IGT_NUM_CRTC_PROPS ,igt_crtc_prop_names ); +/* count number of valid planes */ +for (j =0 ; j < plane_resources->count_planes; j++) { +drmModePlane *drm_plane; + + drm_plane = drmModeGetPlane(display->drm_fd, + plane_resources-Quoted 1 line
planes[j]);
lib/igt_kms.c +3
-0+igt_assert (drm_plane); + +if (!(drm_plane->possible_crtcs & (1 << i))){
lib/igt_kms.c +9
-0+drmModeFreePlane (drm_plane); +continue ; + } + + n_planes++; + } + +igt_assert_lte (0 , n_planes); + pipe->planes = calloc(sizeof(igt_plane_t),
n_planes);lib/igt_kms.c +1
-0+ igt_assert_f(pipe->planes, "Failed to allocatememory for %d planes\n",
n_planes);lib/igt_kms.c +2
-0+ last_plane = n_planes -1 ; +/* add the planes that can be used with that pipe */ for (j =0 ; j < plane_resources->count_planes; j++){
lib/igt_kms.c +8
-5drmModePlane *drm_plane;@@ -1582,21 +1599,24 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane_resources- > planes[j]);switch (type) {case DRM_PLANE_TYPE_PRIMARY : - plane = &pipe- > planes[IGT_PLANE_PRIMARY]; - plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + }break ;case DRM_PLANE_TYPE_CURSOR : -/* -* Cursor should be the highest index in our
lib/igt_kms.c +0
-1-* internal list, but we don't know what that
lib/igt_kms.c +0
-1-* is yet. Just stick it in the last slot
lib/igt_kms.c +0
-1-* for now and we'll move it later, if
lib/igt_kms.c +0
-3-* necessary. -*/ - plane = &pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +2
-2- plane->is_cursor =1 ; - plane->index =IGT_PLANE_CURSOR ; +if (pipe->plane_cursor ==-1 ) { + plane = &pipe-Quoted 1 line
planes[last_plane];
lib/igt_kms.c +2
-0+ plane->index = last_plane; + pipe->plane_cursor =
last_plane;lib/igt_kms.c +5
-1+ }else { + plane = &pipe->planes[p]; + plane->index = p++; + } display->has_cursor_plane = true;break ;default :@@ -1605,7 +1625,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) break; } - n_planes++; + plane->type = type; plane->pipe = pipe; plane->drm_plane = drm_plane;@@ -1626,7 +1646,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) * At the bare minimum, we should expect to have aprimary
lib/igt_kms.c +0
-1* plane */ - igt_assert(pipe-Quoted 1 line
planes[IGT_PLANE_PRIMARY].drm_plane);
lib/igt_kms.c +1
-0+ igt_assert(pipe->planes[pipe-Quoted 1 line
plane_primary].drm_plane);
lib/igt_kms.c +0
-0if (display->has_cursor_plane) {/* @@ -1634,11 +1654,11 @@ void igt_display_init(igt_display_t *display, int drm_fd) * only 1 sprite, that's the wrong slot andwe need to
lib/igt_kms.c +1
-2* move it down. */ -if (p !=IGT_PLANE_CURSOR ) { +if (p != last_plane) { pipe->planes[p] = - pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR];
lib/igt_kms.c +1
-1+ pipe->planes[last_plane]; pipe->planes[p].index = p; - memset(&pipe-Quoted 1 line
planes[IGT_PLANE_CURSOR], 0,
lib/igt_kms.c +2
-1+memset (&pipe->planes[last_plane],0 ,sizeof *plane); } }else {@@ -1646,7 +1666,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane = &pipe->planes[p]; plane->pipe = pipe; plane->index = p; - plane->is_cursor = true; + plane->type =DRM_PLANE_TYPE_CURSOR ; }lib/igt_kms.c +31
-13pipe->n_planes = n_planes;@@ -1654,9 +1674,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)for_each_plane_on_pipe (display, i, plane) plane->fb_changed = true; -/* make sure we don't overflow the plane array */ -igt_assert_lte (pipe->n_planes,IGT_MAX_PLANES ); - pipe->mode_changed = true; }@@ -1709,6 +1726,9 @@ static void igt_pipe_fini(igt_pipe_t *pipe) plane->drm_plane =NULL ; } } + +free (pipe->planes); + pipe->planes =NULL ; }static void igt_output_fini (igt_output_t *output)@@ -1797,20 +1817,41 @@ static igt_pipe_t *igt_output_get_driving_pipe (igt_output_t *output) return &display->pipes[pipe]; } -static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,enum igt_plane plane) +static igt_plane_t *igt_pipe_get_plane (igt_pipe_t *pipe,int plane_idx) { -int idx; +igt_assert_f (plane_idx >=0 && plane_idx < pipe->n_planes, +"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d", + plane_idx, pipe->n_planes); - /* Cursor plane is always the highest index */ - if (plane == IGT_PLANE_CURSOR) - idx = pipe->n_planes -1 ; - else { -igt_assert_f (plane >=0 && plane < (pipe->n_planes), -"plane=%d\n" , plane); - idx = plane; +return &pipe->planes[plane_idx]; +} + + +igt_plane_t *igt_pipe_get_plane_type (igt_pipe_t *pipe,int plane_type) +{ +int i, plane_idx =-1 ; + +switch (plane_type) { +case DRM_PLANE_TYPE_CURSOR : + plane_idx = pipe->plane_cursor; +break ; +case DRM_PLANE_TYPE_PRIMARY : + plane_idx = pipe->plane_primary; +break ; +case DRM_PLANE_TYPE_OVERLAY : +for (i =0 ; i < pipe->n_planes; i++) +if (pipe->planes[i].type ==DRM_PLANE_TYPE_OVERLAY ) + plane_idx = i; +break ; +default : +break ; } -return &pipe->planes[idx]; + igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes, + "Valid pipe->planes idx not found. plane_idx=%dplane_type=%d n_planes=%d\n",
lib/igt_kms.c +5
-2+ plane_idx, plane_type, pipe->n_planes); + +return &pipe->planes[plane_idx]; }static igt_output_t *igt_pipe_get_output (igt_pipe_t *pipe)@@ -2155,9 +2196,9 @@ static int igt_plane_commit(igt_plane_t *plane, enum igt_commit_style s, bool fail_on_error) { -if (plane->is_cursor && s ==COMMIT_LEGACY ) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR && s ==COMMIT_LEGACY ) {return igt_cursor_commit_legacy (plane, pipe, fail_on_error); - } else if (plane->is_primary && s == COMMIT_LEGACY) { + }else if (plane->type ==DRM_PLANE_TYPE_PRIMARY && s ==COMMIT_LEGACY ) {lib/igt_kms.c +0
-0return igt_primary_plane_commit_legacy (plane, pipe, fail_on_error);
lib/igt_kms.c +2
-1}else {@@ -2374,7 +2415,9 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s) plane->position_changed = false; plane->size_changed = false; -if (s !=COMMIT_LEGACY || !(plane- > is_primary || plane->is_cursor)) + if (s != COMMIT_LEGACY || + !(plane->type == DRM_PLANE_TYPE_PRIMARY||
lib/igt_kms.c +13
-2+ plane->type == DRM_PLANE_TYPE_CURSOR)) plane->rotation_changed = false; } }@@ -2654,14 +2697,24 @@ void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)igt_require (output- > config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE]); } -igt_plane_t *igt_output_get_plane (igt_output_t *output,enum igt_plane plane) +igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx) +{ +igt_pipe_t *pipe; + + pipe =igt_output_get_driving_pipe (output); +igt_assert (pipe); + +return igt_pipe_get_plane (pipe, plane_idx); +} + +igt_plane_t *igt_output_get_plane_type (igt_output_t *output,int plane_type) {igt_pipe_t *pipe; pipe =igt_output_get_driving_pipe (output);igt_assert (pipe); -return igt_pipe_get_plane (pipe, plane); +return igt_pipe_get_plane_type (pipe, plane_type); }void igt_plane_set_fb (igt_plane_t *plane,struct igt_fb *fb)lib/igt_kms.h +0
-3@@ -57,25 +57,7 @@ enum pipe { I915_MAX_PIPES };const char *kmstest_pipe_name (enum pipe pipe); -int kmstest_pipe_to_index (char pipe); - -/* We namespace this enum to not conflict with the Android
i915_drm.h*/lib/igt_kms.h +0
-12-enum igt_plane { -IGT_PLANE_1 =0 , -IGT_PLANE_PRIMARY =IGT_PLANE_1 , -IGT_PLANE_2 , -IGT_PLANE_3 , -IGT_PLANE_4 , -IGT_PLANE_5 , -IGT_PLANE_6 , -IGT_PLANE_7 , -IGT_PLANE_8 , -IGT_PLANE_9 , -IGT_PLANE_CURSOR ,/* IGT_PLANE_CURSOR is always the last plane. */
lib/igt_kms.h +6
-8- IGT_MAX_PLANES, -}; - -const char *kmstest_plane_name (enum igt_plane plane); +const char *kmstest_plane_type_name (int plane_type);enum port {PORT_A =0 ,@@ -257,8 +239,7 @@ typedef struct {igt_pipe_t *pipe;int index;/* capabilities */ - unsigned int is_primary : 1; - unsigned int is_cursor : 1; +int type;/* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;@@ -293,8 +274,11 @@ struct igt_pipe {igt_display_t *display;enum pipe pipe;bool enabled; +int n_planes; -igt_plane_t planes[IGT_MAX_PLANES ]; +int plane_cursor; +int plane_primary; +igt_plane_t *planes;uint32_t atomic_props_crtc[IGT_NUM_CRTC_PROPS ];@@ -354,7 +338,9 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);void igt_output_override_mode (igt_output_t *output,drmModeModeInfo *mode);void igt_output_set_pipe (igt_output_t *output,enum pipe pipe);void igt_output_set_scaling_mode (igt_output_t *output,uint64_t scaling_mode); -igt_plane_t *igt_output_get_plane(igt_output_t *output, enum
igt_planeplane);
+igt_plane_t *igt_output_get_plane(igt_output_t *output, intplane_idx);
+igt_plane_t *igt_output_get_plane_type(igt_output_t *output, intplane_type);
+igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int
Quoted 8 lines
Quoted 4 lines
lib/igt_kms.h drmModeModeInfo *igt_output_get_mode(igt_output_t *output); · line 346
Quoted 4 lines
plane_type);
bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,lib/igt_kms.h +0
-0uint32_t *prop_id, uint64_t *value, drmModePropertyPtr *prop);_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/32 tests/kms_atomic_transition: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_atomic_transition.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
tests/kms_atomic_transition.c +13 -14
@@ -120,7 +120,8 @@ static void set_sprite_wh(igt_display_t *display, enum pipe pipe,for_each_plane_on_pipe (display, pipe, plane) {int i = plane->index; -if (plane->is_primary || plane->is_cursor) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR )continue ; parms[i].width = w;
@@ -156,20 +157,16 @@ static void setup_parms(igt_display_t *display, enum pipe pipe,for_each_plane_on_pipe (display, pipe, plane) {int i = plane->index; -if (plane->is_primary) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) { parms[i].fb = plane->fb; -else if (plane->is_cursor) - parms[i].fb = argb_fb; -else - parms[i].fb = sprite_fb; - -if (plane->is_primary) { parms[i].width = mode->hdisplay; parms[i].height = mode->vdisplay; - }else if (plane->is_cursor) { + }else if (plane->type ==DRM_PLANE_TYPE_CURSOR ) { + parms[i].fb = argb_fb; parms[i].width = cursor_width; parms[i].height = cursor_height; - } + }else + parms[i].fb = sprite_fb; } igt_create_fb(display->drm_fd, cursor_width, cursor_height,
@@ -273,7 +270,7 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *outputdrmModeModeInfo *mode, override_mode;igt_plane_t *plane;uint32_t iter_max =1 << display->pipes[pipe].n_planes, i; -struct plane_parms parms[IGT_MAX_PLANES ]; +struct plane_parms parms[display->pipes[pipe].n_planes];bool skip_test = false;unsigned flags =DRM_MODE_PAGE_FLIP_EVENT ;
@@ -421,7 +418,8 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct iigt_output_set_pipe (output,PIPE_NONE );for_each_pipe (display, pipe) { -igt_plane_t *plane = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +igt_plane_t *plane =igt_pipe_get_plane_type (&display->pipes[pipe], +DRM_PLANE_TYPE_PRIMARY );drmModeModeInfo *mode =NULL ;if (!(mask & (1 << pipe))) {
@@ -462,7 +460,7 @@ static void refresh_primaries(igt_display_t *display)for_each_pipe (display, pipe)for_each_plane_on_pipe (display, pipe, plane) -if (plane->is_primary && plane->fb) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY && plane->fb) plane->fb_changed = true; }
@@ -506,7 +504,8 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblock DRM_FORMAT_XRGB8888, 0, .5, .5, .5, &fbs[1]);for_each_pipe (display, i) { -igt_plane_t *plane = &display->pipes[i].planes[IGT_PLANE_PRIMARY ]; +igt_pipe_t *pipe = &display->pipes[i]; +igt_plane_t *plane =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY );drmModeModeInfo *mode =NULL ;if (is_i915_device (display->drm_fd))
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/32 tests/kms_busy: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_busy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_busy.c +1 -1
@@ -53,7 +53,7 @@ set_fb_on_crtc(igt_display_t *dpy, int pipe, struct igt_fb *fb)LOCAL_I915_FORMAT_MOD_X_TILED , fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, fb);return output;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/32 tests/kms_chv_cursor_fail: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_chv_cursor_fail.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_chv_cursor_fail.c +3 -3
@@ -65,7 +65,7 @@ static void cursor_disable(data_t *data)igt_output_t *output = data->output;igt_plane_t *cursor; - cursor =igt_output_get_plane (output,IGT_PLANE_CURSOR ); + cursor =igt_output_get_plane_type (output,DRM_PLANE_TYPE_CURSOR );igt_plane_set_fb (cursor,NULL ); }
@@ -242,7 +242,7 @@ static void prepare_crtc(data_t *data)LOCAL_DRM_FORMAT_MOD_NONE , &data->primary_fb); - primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->primary_fb);igt_display_commit (display);
@@ -277,7 +277,7 @@ static void cleanup_crtc(data_t *data)igt_remove_fb (data->drm_fd, &data->primary_fb); - primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (data->output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/32 tests/kms_crtc_background_color: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_crtc_background_color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_crtc_background_color.c +1 -1
@@ -136,7 +136,7 @@ static void test_crtc_background(data_t *data)igt_output_set_pipe (output, pipe); - plane =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_require (plane->pipe->background_property);prepare_crtc (data, output, pipe, plane,1 ,PURPLE ,BLACK64 );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/32 tests/kms_cursor_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_cursor_crc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
tests/kms_cursor_crc.c +6 -6
@@ -92,7 +92,7 @@ static void cursor_enable(data_t *data)igt_output_t *output = data->output;igt_plane_t *cursor; - cursor =igt_output_get_plane (output,IGT_PLANE_CURSOR ); + cursor =igt_output_get_plane_type (output,DRM_PLANE_TYPE_CURSOR );igt_plane_set_fb (cursor, &data->fb);igt_plane_set_size (cursor, data->curw, data->curh); }
@@ -102,7 +102,7 @@ static void cursor_disable(data_t *data)igt_output_t *output = data->output;igt_plane_t *cursor; - cursor =igt_output_get_plane (output,IGT_PLANE_CURSOR ); + cursor =igt_output_get_plane_type (output,DRM_PLANE_TYPE_CURSOR );igt_plane_set_fb (cursor,NULL ); }
@@ -120,7 +120,7 @@ static void do_single_test(data_t *data, int x, int y)/* Hardware test */ igt_paint_test_pattern (cr, data->screenw, data->screenh);cursor_enable (data); - cursor =igt_output_get_plane (data->output,IGT_PLANE_CURSOR ); + cursor =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_CURSOR );igt_plane_set_position (cursor, x, y);igt_display_commit (display);igt_wait_for_vblank (data->drm_fd, data->pipe);
@@ -174,7 +174,7 @@ static void do_fail_test(data_t *data, int x, int y, int expect)/* Hardware test */ igt_paint_test_pattern (cr, data->screenw, data->screenh);cursor_enable (data); - cursor =igt_output_get_plane (data->output,IGT_PLANE_CURSOR ); + cursor =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_CURSOR );igt_plane_set_position (cursor, x, y); ret =igt_display_try_commit2 (display,COMMIT_LEGACY );
@@ -301,7 +301,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output,0.0 ,0.0 ,0.0 , &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->primary_fb);igt_display_commit (display);
@@ -342,7 +342,7 @@ static void cleanup_crtc(data_t *data, igt_output_t *output)igt_remove_fb (data->drm_fd, &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/32 tests/kms_cursor_legacy: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_cursor_legacy.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-)
tests/kms_cursor_legacy.c +18 -14
@@ -166,7 +166,7 @@ static igt_output_t *set_fb_on_crtc(igt_display_t *display, int pipe, struct igt mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, I915_TILING_NONE, fb_info); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, fb_info);return output;
@@ -180,7 +180,7 @@ static void set_cursor_on_pipe(igt_display_t *display, enum pipe pipe, struct igigt_plane_t *plane, *cursor =NULL ;for_each_plane_on_pipe (display, pipe, plane) { -if (!plane->is_cursor) +if (plane->type !=DRM_PLANE_TYPE_CURSOR )continue ; cursor = plane;
@@ -250,13 +250,14 @@ static enum pipe find_connected_pipe(igt_display_t *display, bool second)return pipe; } -static void flip_nonblocking (igt_display_t *display,enum pipe pipe,bool atomic,struct igt_fb *fb) +static void flip_nonblocking (igt_display_t *display,enum pipe pipe_id,bool atomic,struct igt_fb *fb) { -igt_plane_t *primary = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +igt_pipe_t *pipe = &display->pipes[pipe_id]; +igt_plane_t *primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY );if (!atomic) {/* Schedule a nonblocking flip for the next vblank */ -do_or_die (drmModePageFlip (display->drm_fd, display->pipes[pipe].crtc_id, fb->fb_id, +do_or_die (drmModePageFlip (display->drm_fd, pipe->crtc_id, fb->fb_id,DRM_MODE_PAGE_FLIP_EVENT , fb)); }else {igt_plane_set_fb (primary, fb);
@@ -283,12 +284,13 @@ static bool cursor_slowpath(enum flip_test mode)return true; } -static void transition_nonblocking (igt_display_t *display,enum pipe pipe, +static void transition_nonblocking (igt_display_t *display,enum pipe pipe_id,struct igt_fb *prim_fb,struct igt_fb *argb_fb,bool hide_sprite) { -igt_plane_t *primary = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; -igt_plane_t *sprite = &display->pipes[pipe].planes[IGT_PLANE_2 ]; +igt_pipe_t *pipe = &display->pipes[pipe_id]; +igt_plane_t *primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY ); +igt_plane_t *sprite =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_OVERLAY );if (hide_sprite) {igt_plane_set_fb (primary, prim_fb);
@@ -354,7 +356,7 @@ static void prepare_flip_test(igt_display_t *display,if (mode == flip_test_atomic_transitions || mode == flip_test_atomic_transitions_varying_size) {igt_require (display->pipes[flip_pipe].n_planes >1 && - !display->pipes[flip_pipe].planes[IGT_PLANE_2 ].is_cursor); + display->pipes[flip_pipe].planes[1 ].type !=DRM_PLANE_TYPE_CURSOR );igt_create_color_pattern_fb (display->drm_fd, prim_fb->width, prim_fb->height,DRM_FORMAT_ARGB8888 ,0 ,.1 ,.1 ,.1 , argb_fb);
@@ -843,7 +845,7 @@ static void nonblocking_modeset_vs_cursor(igt_display_t *display, int loops) arg[0 ].flags |=DRM_MODE_CURSOR_BO ;for_each_plane_on_pipe (display, pipe, plane) { -if (!plane->is_cursor) +if (plane->type !=DRM_PLANE_TYPE_CURSOR )continue ; cursor = plane;
@@ -983,7 +985,7 @@ static void two_screens_flip_vs_cursor(igt_display_t *display, int nloops, bool* in the same commit. */ -igt_plane_set_fb (igt_output_get_plane (output,IGT_PLANE_PRIMARY ), &fb_info); +igt_plane_set_fb (igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ), &fb_info);igt_output_set_pipe (output2, (nloops &1 ) ?PIPE_NONE : pipe2);igt_display_commit_atomic (display,DRM_MODE_ATOMIC_ALLOW_MODESET |DRM_MODE_ATOMIC_NONBLOCK ,NULL ); }
@@ -1283,6 +1285,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)unsigned vblank_start;enum pipe pipe =find_connected_pipe (display, false);igt_pipe_crc_t *pipe_crc; +igt_pipe_t *pipe_connected = &display->pipes[pipe]; +igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY );igt_crc_t crcs[3 ];if (atomic)
@@ -1314,10 +1318,10 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)* setting the correct cache level, else we get a stall in the * page flip handler. */ -igt_plane_set_fb (&display->pipes[pipe].planes[IGT_PLANE_PRIMARY ], &fb_info[1 ]); +igt_plane_set_fb (plane_primary, &fb_info[1 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -igt_plane_set_fb (&display->pipes[pipe].planes[IGT_PLANE_PRIMARY ], &fb_info[0 ]); +igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL );/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */
@@ -1343,7 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_lte (vblank_start +1 ,get_vblank (display->drm_fd, pipe,0 )); -igt_plane_set_fb (&display->pipes[pipe].planes[IGT_PLANE_PRIMARY ], &fb_info[0 ]); +igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL );igt_assert_crc_equal (&crcs[i], &crcs[2 ]);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/32 tests/kms_fbc_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_fbc_crc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
tests/kms_fbc_crc.c +5 -4
@@ -372,7 +372,7 @@ static bool prepare_test(data_t *data, enum test_mode test_mode)igt_output_t *output = data->output;igt_pipe_crc_t *pipe_crc; - data->primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );create_fbs (data, true, data->fb);
@@ -457,10 +457,11 @@ static void finish_crtc(data_t *data, enum test_mode mode)static void reset_display (data_t *data) {igt_display_t *display = &data->display; -enum pipe pipe; +enum pipe pipe_type; -for_each_pipe (display, pipe) { -igt_plane_t *plane = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +for_each_pipe (display, pipe_type) { +igt_pipe_t *pipe = &display->pipes[pipe_type]; +igt_plane_t *plane =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY );if (plane->fb)igt_plane_set_fb (plane,NULL );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/32 tests/kms_fence_pin_leak: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_fence_pin_leak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_fence_pin_leak.c +1 -1
@@ -115,7 +115,7 @@ static void run_single_test(data_t *data, enum pipe pipe, igt_output_t *output)igt_output_set_pipe (output, pipe); mode =igt_output_get_mode (output); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/32 tests/kms_flip_event_leak: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_flip_event_leak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_flip_event_leak.c +1 -1
@@ -50,7 +50,7 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)/* select the pipe we want to use */ igt_output_set_pipe (output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); mode =igt_output_get_mode (output); igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/32 tests/kms_legacy_colorkey: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_legacy_colorkey.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_legacy_colorkey.c +3 -1
@@ -55,8 +55,10 @@ igt_simple_mainfor_each_pipe (&display, p) {for_each_plane_on_pipe (&display, p, plane) { +bool is_valid = (plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR );test_plane (plane->drm_plane->plane_id, - (plane->is_cursor || plane->is_primary) ? -ENOENT :0 ); + is_valid ? -ENOENT :0 ); max_id =max (max_id, plane->drm_plane->plane_id); }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/32 tests/kms_mmap_write_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_mmap_write_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_mmap_write_crc.c +1 -1
@@ -177,7 +177,7 @@ static void prepare_crtc(data_t *data)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &data->fb[0]); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary, &data->fb[0 ]);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/32 tests/kms_mmio_vs_cs_flip: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_mmio_vs_cs_flip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_mmio_vs_cs_flip.c +3 -3
@@ -191,7 +191,7 @@ static void make_gpu_busy(data_t *data, uint32_t flip_handle)* supposed to be. */ static void -test_plane (data_t *data,igt_output_t *output,enum pipe pipe,enum igt_plane plane) +test_plane (data_t *data,igt_output_t *output,enum pipe pipe,int plane) {struct igt_fb red_fb, green_fb, blue_fb;drmModeModeInfo *mode;
@@ -201,7 +201,7 @@ test_plane(data_t *data, igt_output_t *output, enum pipe pipe, enum igt_plane pligt_output_set_pipe (output, pipe); - primary =igt_output_get_plane (output,0 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); sprite =igt_output_get_plane (output, plane); mode =igt_output_get_mode (output);
@@ -455,7 +455,7 @@ static void run_plane_test(data_t *data) {igt_output_t *output; -enum igt_plane plane =1 ;/* testing with one sprite is enough */ +int plane =1 ;/* testing with one sprite is enough */ int valid_tests =0 ;enum pipe pipe;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 17/32 tests/kms_panel_fitting: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_panel_fitting.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tests/kms_panel_fitting.c +8 -8
@@ -76,10 +76,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,* there's no way (that works) to light up a pipe with only a sprite * plane enabled at the moment. */ -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->fb1); }
@@ -116,10 +116,10 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) data->fb_id3 =0 ; } -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL ); }
@@ -174,7 +174,7 @@ static void test_panel_fitting(data_t *d)/* Set up display to enable panel fitting */ mode->hdisplay =640 ; mode->vdisplay =480 ; - d->plane1 =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + d->plane1 =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );prepare_crtc (d, output, pipe, d->plane1, mode,COMMIT_LEGACY );/* disable panel fitting */
@@ -189,7 +189,7 @@ static void test_panel_fitting(data_t *d)prepare_crtc (d, output, pipe, d->plane1, &native_mode,COMMIT_LEGACY );/* Set up fb2->plane2 mapping. */ - d->plane2 =igt_output_get_plane (output,IGT_PLANE_2 ); + d->plane2 =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );igt_plane_set_fb (d->plane2, &d->fb2);/* enable sprite plane */
@@ -226,8 +226,8 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_outigt_output_override_mode (output, &mode);igt_output_set_pipe (output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - sprite =igt_output_get_plane (output,IGT_PLANE_2 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + sprite =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY ); igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay, DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 18/32 tests/kms_pipe_color: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_pipe_color.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/kms_pipe_color.c +2 -2
@@ -857,9 +857,9 @@ run_tests_for_pipe(data_t *data, enum pipe p)igt_require (p < data->display.n_pipes); pipe = &data->display.pipes[p]; -igt_require (pipe->n_planes >=IGT_PLANE_PRIMARY ); +igt_require (pipe->n_planes >=0 ); - primary = &pipe->planes[IGT_PLANE_PRIMARY ]; + primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY ); data->pipe_crc =igt_pipe_crc_new (primary->pipe->pipe,INTEL_PIPE_CRC_SOURCE_AUTO );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 19/32 tests/kms_plane: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane.c | 94 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 42 deletions(-)
tests/kms_plane.c +52 -42
@@ -150,7 +150,7 @@ enum {static void test_plane_position_with_output (data_t *data,enum pipe pipe, -enum igt_plane plane, +int plane,igt_output_t *output,unsigned int flags) {
@@ -170,7 +170,7 @@ test_plane_position_with_output(data_t *data,igt_output_set_pipe (output, pipe); mode =igt_output_get_mode (output); - primary =igt_output_get_plane (output,0 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); sprite =igt_output_get_plane (output, plane); create_fb_for_mode__position(data, mode, 100, 100, 64, 64,
@@ -222,7 +222,7 @@ test_plane_position_with_output(data_t *data, }static void -test_plane_position (data_t *data,enum pipe pipe,enum igt_plane plane, +test_plane_position (data_t *data,enum pipe pipe,int plane,unsigned int flags) {igt_output_t *output;
@@ -294,7 +294,7 @@ enum {static void test_plane_panning_with_output (data_t *data,enum pipe pipe, -enum igt_plane plane, +int plane,igt_output_t *output,unsigned int flags) {
@@ -348,7 +348,7 @@ test_plane_panning_with_output(data_t *data, }static void -test_plane_panning (data_t *data,enum pipe pipe,enum igt_plane plane, +test_plane_panning (data_t *data,enum pipe pipe,int plane,unsigned int flags) {igt_output_t *output;
@@ -367,47 +367,57 @@ test_plane_panning(data_t *data, enum pipe pipe, enum igt_plane plane, }static void -run_tests_for_pipe_plane (data_t *data,enum pipe pipe,enum igt_plane plane) +run_tests_for_pipe_plane (data_t *data,enum pipe pipe) { -igt_subtest_f ("plane-position-covered-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane, -TEST_POSITION_FULLY_COVERED ); - -igt_subtest_f ("plane-position-hole-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane,0 ); - -igt_subtest_f ("plane-position-hole-dpms-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane, -TEST_DPMS ); - -igt_subtest_f ("plane-panning-top-left-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane,TEST_PANNING_TOP_LEFT ); - -igt_subtest_f ("plane-panning-bottom-right-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane, -TEST_PANNING_BOTTOM_RIGHT ); - -igt_subtest_f ("plane-panning-bottom-right-suspend-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane, -TEST_PANNING_BOTTOM_RIGHT | -TEST_SUSPEND_RESUME ); -} +igt_subtest_f ("plane-position-covered-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane, +TEST_POSITION_FULLY_COVERED ); + } -static void -run_tests_for_pipe (data_t *data,enum pipe pipe) -{ -int plane; +igt_subtest_f ("plane-position-hole-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane,0 ); + } + +igt_subtest_f ("plane-position-hole-dpms-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane, +TEST_DPMS ); + } + +igt_subtest_f ("plane-panning-top-left-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane,TEST_PANNING_TOP_LEFT ); + } -for (plane =1 ; plane <IGT_MAX_PLANES ; plane++) -run_tests_for_pipe_plane (data, pipe, plane); +igt_subtest_f ("plane-panning-bottom-right-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane, +TEST_PANNING_BOTTOM_RIGHT ); + } + +igt_subtest_f ("plane-panning-bottom-right-suspend-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane, +TEST_PANNING_BOTTOM_RIGHT | +TEST_SUSPEND_RESUME ); + } } +static data_t data; igt_main
@@ -425,7 +435,7 @@ igt_main }for (int pipe =0 ; pipe <I915_MAX_PIPES ; pipe++) -run_tests_for_pipe (&data, pipe); +run_tests_for_pipe_plane (&data, pipe); igt_fixture {igt_display_fini (&data.display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 20/32 tests/kms_plane_multiple: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane_multiple.c | 209 ++++++++++++++++++++++++++++----------------- 1 file changed, 131 insertions(+), 78 deletions(-)
tests/kms_plane_multiple.c +131 -78
@@ -47,8 +47,8 @@ typedef struct {int drm_fd;igt_display_t display;igt_pipe_crc_t *pipe_crc; -igt_plane_t *plane[IGT_MAX_PLANES ]; -struct igt_fb fb[IGT_MAX_PLANES ]; +igt_plane_t **plane; +struct igt_fb *fb; } data_t; typedef struct {
@@ -70,20 +70,35 @@ struct {/* * Common code across all tests, acting on data_t */ -static void test_init (data_t *data,enum pipe pipe) +static void test_init (data_t *data,enum pipe pipe,int max_planes) { data->pipe_crc =igt_pipe_crc_new (pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + + data->plane =malloc (max_planes *sizeof (data->plane)); +igt_assert_f (data->plane !=NULL ,"Failed to allocate memory for planes\n" ); + + data->fb =malloc (max_planes *sizeof (struct igt_fb )); +igt_assert_f (data->fb !=NULL ,"Failed to allocate memory for FBs\n" ); }static void test_fini (data_t *data,igt_output_t *output,int max_planes) { -for (int i =IGT_PLANE_PRIMARY ; i <= max_planes; i++) -igt_plane_set_fb (data->plane[i],NULL ); +for (int i =0 ; i <= max_planes; i++) { +igt_plane_t *plane = data->plane[i]; +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +igt_plane_set_fb (plane,NULL ); + }/* reset the constraint on the pipe */ igt_output_set_pipe (output,PIPE_ANY );igt_pipe_crc_free (data->pipe_crc); + +free (data->plane); + data->plane =NULL ; +free (data->fb); + data->fb =NULL ; } static void
@@ -91,11 +106,13 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic, color_t *color, uint64_t tiling, igt_crc_t *crc /* out */) { drmModeModeInfo *mode; +igt_plane_t *primary;int ret, n;igt_output_set_pipe (output, pipe); - data->plane[IGT_PLANE_PRIMARY ] =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + data->plane[primary->index] = primary; mode =igt_output_get_mode (output);
@@ -103,9 +120,9 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic,DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , color->red, color->green, color->blue, - &data->fb[IGT_PLANE_PRIMARY]); + &data->fb[primary->index]); -igt_plane_set_fb (data->plane[IGT_PLANE_PRIMARY ], &data->fb[IGT_PLANE_PRIMARY ]); +igt_plane_set_fb (data->plane[primary->index], &data->fb[primary->index]); ret =igt_display_try_commit2 (&data->display, atomic ?COMMIT_ATOMIC :COMMIT_LEGACY );
@@ -128,29 +145,35 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic,*/ static void -create_fb_for_mode_position (data_t *data,drmModeModeInfo *mode, +create_fb_for_mode_position (data_t *data,igt_output_t *output,drmModeModeInfo *mode,color_t *color,int *rect_x,int *rect_y,int *rect_w,int *rect_h,uint64_t tiling,int max_planes) {unsigned int fb_id;cairo_t *cr; +igt_plane_t *primary; + + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); fb_id =igt_create_fb (data->drm_fd, mode->hdisplay, mode->vdisplay,DRM_FORMAT_XRGB8888 , tiling, - &data->fb[IGT_PLANE_PRIMARY ]); + &data->fb[primary->index]);igt_assert (fb_id); - cr =igt_get_cairo_ctx (data->drm_fd, &data->fb[IGT_PLANE_PRIMARY ]); + cr =igt_get_cairo_ctx (data->drm_fd, &data->fb[primary->index]);igt_paint_color (cr, rect_x[0 ], rect_y[0 ], mode->hdisplay, mode->vdisplay, color->red, color->green, color->blue); -for (int i =IGT_PLANE_2 ; i <= max_planes; i++) +for (int i =0 ; i <= max_planes; i++) { +if (data->plane[i]->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ;igt_paint_color (cr, rect_x[i], rect_y[i], rect_w[i], rect_h[i],0.0 ,0.0 ,0.0 ); + }igt_assert (cairo_status (cr) ==0 );cairo_destroy (cr);
@@ -158,37 +181,52 @@ create_fb_for_mode_position(data_t *data, drmModeModeInfo *mode,static void -prepare_planes (data_t *data,enum pipe pipe,color_t *color, +prepare_planes (data_t *data,enum pipe pipe_id,color_t *color,uint64_t tiling,int max_planes,igt_output_t *output) {drmModeModeInfo *mode; -int x[IGT_MAX_PLANES ]; -int y[IGT_MAX_PLANES ]; -int size[IGT_MAX_PLANES ]; +igt_pipe_t *pipe; +igt_plane_t *primary; +int *x; +int *y; +int *size;int i; -igt_output_set_pipe (output, pipe); +igt_output_set_pipe (output, pipe_id); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + pipe = primary->pipe; + + x =malloc (pipe->n_planes *sizeof (*x)); +igt_assert_f (x,"Failed to allocate %d bytes for variable x\n" , pipe->n_planes *sizeof (*x)); + y =malloc (pipe->n_planes *sizeof (*y)); +igt_assert_f (x,"Failed to allocate %d bytes for variable y\n" , pipe->n_planes *sizeof (*y)); + size =malloc (pipe->n_planes *sizeof (*size)); +igt_assert_f (x,"Failed to allocate %d bytes for variable size\n" , pipe->n_planes *sizeof (*size)); mode =igt_output_get_mode (output);/* planes with random positions */ - x[IGT_PLANE_PRIMARY ] =0 ; - y[IGT_PLANE_PRIMARY ] =0 ; -for (i =IGT_PLANE_2 ; i <= max_planes; i++) { -if (i ==IGT_PLANE_CURSOR ) + x[primary->index] =0 ; + y[primary->index] =0 ; +for (i =1 ; i <= max_planes; i++) { +igt_plane_t *plane =igt_output_get_plane (output, i); + +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) size[i] =SIZE_CURSOR ; +else if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ;else size[i] =SIZE_PLANE ; x[i] =rand () % (mode->hdisplay - size[i]); y[i] =rand () % (mode->vdisplay - size[i]); - data->plane[i] =igt_output_get_plane (output, i); + data->plane[i] = plane;igt_create_color_fb (data->drm_fd, size[i], size[i], - data->plane[i]->is_cursor ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , - data->plane[i]->is_cursor ?LOCAL_DRM_FORMAT_MOD_NONE : tiling, + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?LOCAL_DRM_FORMAT_MOD_NONE : tiling, color->red, color->green, color->blue, &data->fb[i]);
@@ -197,10 +235,10 @@ prepare_planes(data_t *data, enum pipe pipe, color_t *color, }/* primary plane */ - data->plane[IGT_PLANE_PRIMARY ] =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); -create_fb_for_mode_position (data, mode, color, x, y, + data->plane[primary->index] = primary; +create_fb_for_mode_position (data, output, mode, color, x, y, size, size, tiling, max_planes); -igt_plane_set_fb (data->plane[IGT_PLANE_PRIMARY ], &data->fb[IGT_PLANE_PRIMARY ]); +igt_plane_set_fb (data->plane[primary->index], &data->fb[primary->index]); } static void
@@ -232,7 +270,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,igt_output_name (output),kmstest_pipe_name (pipe), max_planes, info, opt.seed); -test_init (data, pipe); +test_init (data, pipe, max_planes);test_grab_crc (data, output, pipe, true, &blue, tiling, &test.reference_crc);
@@ -298,7 +336,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,igt_output_name (output),kmstest_pipe_name (pipe), max_planes, info, opt.seed); -test_init (data, pipe); +test_init (data, pipe, max_planes);test_grab_crc (data, output, pipe, false, &blue, tiling, &test.reference_crc);
@@ -367,54 +405,71 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int max_planes, }static void -run_tests_for_pipe_plane (data_t *data,enum pipe pipe,int max_planes) +run_tests_for_pipe_plane (data_t *data,enum pipe pipe) { -igt_subtest_f ("legacy-pipe-%s-tiling-none-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_DRM_FORMAT_MOD_NONE ); - -igt_subtest_f ("atomic-pipe-%s-tiling-none-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-x-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("atomic-pipe-%s-tiling-x-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-y-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_I915_FORMAT_MOD_Y_TILED ); - -igt_subtest_f ("atomic-pipe-%s-tiling-y-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_Y_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-yf-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, - LOCAL_I915_FORMAT_MOD_Yf_TILED); - -igt_subtest_f ("atomic-pipe-%s-tiling-yf-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, - LOCAL_I915_FORMAT_MOD_Yf_TILED); -} +igt_subtest_f ("legacy-pipe-%s-tiling-none-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_DRM_FORMAT_MOD_NONE ); + } -static void -run_tests_for_pipe (data_t *data,enum pipe pipe) -{ -for (int planes =IGT_PLANE_PRIMARY ; planes <IGT_MAX_PLANES ; planes++) -run_tests_for_pipe_plane (data, pipe, planes); +igt_subtest_f ("atomic-pipe-%s-tiling-none-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-x-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-x-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-y-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_I915_FORMAT_MOD_Y_TILED ); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-y-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_Y_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-yf-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-yf-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); + } }static data_t data;
@@ -461,15 +516,13 @@ int main(int argc, char *argv[]) igt_fixture { data.drm_fd =drm_open_driver_master (DRIVER_INTEL ); -kmstest_set_vt_graphics_mode (); -igt_require_pipe_crc ();igt_display_init (&data.display, data.drm_fd); }for (int pipe =0 ; pipe <I915_MAX_PIPES ; pipe++) -run_tests_for_pipe (&data, pipe); +run_tests_for_pipe_plane (&data, pipe); igt_fixture {igt_display_fini (&data.display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 21/32 tests/kms_plane_scaling: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane_scaling.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/kms_plane_scaling.c +7 -7
@@ -85,10 +85,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,* there's no way (that works) to light up a pipe with only a sprite * plane enabled at the moment. */ -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->fb1); }
@@ -128,10 +128,10 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) data->fb_id3 =0 ; } -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL ); }
@@ -207,7 +207,7 @@ static void test_plane_scaling(data_t *d)igt_assert (d->fb_id3);/* Set up display with plane 1 */ - d->plane1 =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + d->plane1 =igt_output_get_plane (output,1 );prepare_crtc (d, output, pipe, d->plane1, mode,COMMIT_UNIVERSAL );if (primary_plane_scaling) {
@@ -227,7 +227,7 @@ static void test_plane_scaling(data_t *d) }/* Set up fb2->plane2 mapping. */ - d->plane2 =igt_output_get_plane (output,IGT_PLANE_2 ); + d->plane2 =igt_output_get_plane (output,2 );igt_plane_set_fb (d->plane2, &d->fb2);/* 2nd plane windowed */
@@ -263,7 +263,7 @@ static void test_plane_scaling(data_t *d) }/* Set up fb3->plane3 mapping. */ - d->plane3 =igt_output_get_plane (output,IGT_PLANE_3 ); + d->plane3 =igt_output_get_plane (output,3 );igt_plane_set_fb (d->plane3, &d->fb3);/* 3rd plane windowed - no scaling */
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 22/32 tests/kms_properties: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_properties.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_properties.c +3 -3
@@ -38,7 +38,7 @@ static void prepare_pipe(igt_display_t *display, enum pipe pipe, igt_output_t *oigt_output_set_pipe (output, pipe); -igt_plane_set_fb (igt_output_get_plane (output,IGT_PLANE_PRIMARY ), fb); +igt_plane_set_fb (igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ), fb);igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); }
@@ -163,8 +163,8 @@ static void run_plane_property_tests(igt_display_t *display, enum pipe pipe, igtprepare_pipe (display, pipe, output, &fb);for_each_plane_on_pipe (display, pipe, plane) { -igt_info ("Testing plane properties on %s.%s (output: %s)\n" , -kmstest_pipe_name (pipe),kmstest_plane_name (plane->index), output->name); +igt_info ("Testing plane properties on %s.#%d-%s (output: %s)\n" , +kmstest_pipe_name (pipe), plane->index,kmstest_plane_type_name (plane->type), output->name);test_properties (display->drm_fd,DRM_MODE_OBJECT_PLANE , plane->drm_plane->plane_id, atomic); }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 23/32 tests/kms_psr_sink_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_psr_sink_crc.c | 52 +++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 29 deletions(-)
tests/kms_psr_sink_crc.c +23 -29
@@ -34,12 +34,6 @@ bool running_with_psr_disabled;#define CRC_BLACK "000000000000" -enum planes { -PRIMARY , -SPRITE , -CURSOR , -}; -enum operations {PAGE_FLIP ,MMAP_GTT ,
@@ -69,7 +63,7 @@ static const char *op_str(enum operations op) typedef struct { int drm_fd; - enum planes test_plane; + int test_plane; enum operations op; uint32_t devid; uint32_t crtc_id;
@@ -313,9 +307,9 @@ static void run_test(data_t *data)/* Setting a secondary fb/plane */ switch (data->test_plane) { -case PRIMARY :default : test_plane = data->primary;break ; -case SPRITE : test_plane = data->sprite;break ; -case CURSOR : test_plane = data->cursor;break ; +case DRM_PLANE_TYPE_PRIMARY :default : test_plane = data->primary;break ; +case DRM_PLANE_TYPE_OVERLAY : test_plane = data->sprite;break ; +case DRM_PLANE_TYPE_CURSOR : test_plane = data->cursor;break ; }igt_plane_set_fb (test_plane, &data->fb_white);igt_display_commit (&data->display);
@@ -323,7 +317,7 @@ static void run_test(data_t *data)/* Confirm it is not Green anymore */ igt_assert (wait_psr_entry (data));get_sink_crc (data, ref_crc); -if (data->test_plane ==PRIMARY ) +if (data->test_plane ==DRM_PLANE_TYPE_PRIMARY )assert_or_manual (!is_green (ref_crc),"screen WHITE" );else assert_or_manual (!is_green (ref_crc),"GREEN background with WHITE box" );
@@ -355,7 +349,7 @@ static void run_test(data_t *data)/* Printing white on white so the screen shouldn't change */ memset (ptr,0xff , data->mod_size);get_sink_crc (data, crc); -if (data->test_plane ==PRIMARY ) +if (data->test_plane ==DRM_PLANE_TYPE_PRIMARY )assert_or_manual (strcmp (ref_crc, crc) ==0 ,"screen WHITE" );else assert_or_manual(strcmp(ref_crc, crc) == 0,
@@ -406,9 +400,9 @@ static void run_test(data_t *data)static void test_cleanup (data_t *data) {igt_plane_set_fb (data->primary,NULL ); -if (data->test_plane ==SPRITE ) +if (data->test_plane ==DRM_PLANE_TYPE_OVERLAY )igt_plane_set_fb (data->sprite,NULL ); -if (data->test_plane ==CURSOR ) +if (data->test_plane ==DRM_PLANE_TYPE_CURSOR )igt_plane_set_fb (data->cursor,NULL );igt_display_commit (&data->display);
@@ -428,7 +422,7 @@ static void setup_test_plane(data_t *data)0.0 ,1.0 ,0.0 , &data->fb_green); - data->primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary,NULL ); white_h = data->mode->hdisplay;
@@ -439,16 +433,16 @@ static void setup_test_plane(data_t *data) data->mod_stride = white_h *4 ;switch (data->test_plane) { -case SPRITE : - data->sprite =igt_output_get_plane (data->output, -IGT_PLANE_2 ); +case DRM_PLANE_TYPE_OVERLAY : + data->sprite =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_OVERLAY );igt_plane_set_fb (data->sprite,NULL );/* To make it different for human eyes let's make * sprite visible in only one quarter of the primary */ white_h = white_h/2 ; white_v = white_v/2 ; -case PRIMARY : +case DRM_PLANE_TYPE_PRIMARY : igt_create_color_fb(data->drm_fd, white_h, white_v, DRM_FORMAT_XRGB8888,
@@ -456,9 +450,9 @@ static void setup_test_plane(data_t *data)1.0 ,1.0 ,1.0 , &data->fb_white);break ; -case CURSOR : - data->cursor =igt_output_get_plane (data->output, -IGT_PLANE_CURSOR ); +case DRM_PLANE_TYPE_CURSOR : + data->cursor =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_CURSOR );igt_plane_set_fb (data->cursor,NULL );create_cursor_fb (data);igt_plane_set_position (data->cursor,0 ,0 );
@@ -535,7 +529,7 @@ int main(int argc, char *argv[])for (op =PAGE_FLIP ; op <=RENDER ; op++) { igt_subtest_f("primary_%s", op_str(op)) { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -546,7 +540,7 @@ int main(int argc, char *argv[])for (op =MMAP_GTT ; op <=PLANE_ONOFF ; op++) { igt_subtest_f("sprite_%s", op_str(op)) { - data.test_plane =SPRITE ; + data.test_plane =DRM_PLANE_TYPE_OVERLAY ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -557,7 +551,7 @@ int main(int argc, char *argv[])for (op =MMAP_GTT ; op <=PLANE_ONOFF ; op++) { igt_subtest_f("cursor_%s", op_str(op)) { - data.test_plane =CURSOR ; + data.test_plane =DRM_PLANE_TYPE_CURSOR ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -567,7 +561,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("dpms_off_psr_active") { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op =RENDER ;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -579,7 +573,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("dpms_off_psr_exit") { - data.test_plane =SPRITE ; + data.test_plane =DRM_PLANE_TYPE_OVERLAY ; data.op =PLANE_ONOFF ;setup_test_plane (&data);
@@ -591,7 +585,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("suspend_psr_active") { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op =PAGE_FLIP ;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -604,7 +598,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("suspend_psr_exit") { - data.test_plane =CURSOR ; + data.test_plane =DRM_PLANE_TYPE_CURSOR ; data.op =PLANE_ONOFF ;setup_test_plane (&data);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 24/32 tests/kms_pwrite_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_pwrite_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_pwrite_crc.c +1 -1
@@ -116,7 +116,7 @@ static void prepare_crtc(data_t *data)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &data->fb[0]); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary, &data->fb[0 ]);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 25/32 tests/kms_rmfb: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_rmfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_rmfb.c +1 -1
@@ -83,7 +83,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo* later on. */ for_each_plane_on_pipe (&data->display, pipe, plane) { -if (plane->is_cursor) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) {igt_plane_set_fb (plane, &argb_fb);igt_fb_set_size (&argb_fb, plane, cursor_width, cursor_height);igt_plane_set_size (plane, cursor_width, cursor_height);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 26/32 tests/kms_rotation_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_rotation_crc.c | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-)
tests/kms_rotation_crc.c +32 -31
@@ -97,17 +97,18 @@ static void commit_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)* we create an fb covering the crtc and call commit */ - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->fb_modeset); primary->rotation_changed = false;igt_display_commit (display);igt_plane_set_fb (plane, &data->fb); -if (!plane->is_cursor) +if (plane->type !=DRM_PLANE_TYPE_CURSOR )igt_plane_set_position (plane, data->pos_x, data->pos_y); -if (plane->is_primary || plane->is_cursor) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR ) commit =COMMIT_UNIVERSAL ;if (data->display.is_atomic)
@@ -154,7 +155,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, tiling = data->override_tiling ? data->override_tiling :LOCAL_I915_FORMAT_MOD_Y_TILED ; w = h = mode->vdisplay; - }else if (plane->is_cursor) { + }else if (plane->type ==DRM_PLANE_TYPE_CURSOR ) { pixel_format = data->override_fmt ? data->override_fmt :DRM_FORMAT_ARGB8888 ; w = h =128 ;
@@ -206,10 +207,10 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)igt_remove_fb (data->gfx_fd, &data->fb_flip);/* XXX: see the note in prepare_crtc() */ -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL ); }
@@ -236,7 +237,7 @@ static void wait_for_pageflip(int fd)igt_assert (drmHandleEvent (fd, &evctx) ==0 ); } -static void test_plane_rotation (data_t *data,enum igt_plane plane_type) +static void test_plane_rotation (data_t *data,int plane_type) {igt_display_t *display = &data->display;igt_output_t *output;
@@ -247,10 +248,10 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type)unsigned int flip_count;int ret; -if (plane_type ==IGT_PLANE_PRIMARY || plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) commit =COMMIT_UNIVERSAL ; -if (plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane);if (data->display.is_atomic)
@@ -261,7 +262,7 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type)igt_output_set_pipe (output, pipe); - plane =igt_output_get_plane (output, plane_type); + plane =igt_output_get_plane_type (output, plane_type);igt_require (igt_plane_supports_rotation (plane));prepare_crtc (data, output, pipe, plane);
@@ -321,7 +322,7 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type)static void test_plane_rotation_ytiled_obj (data_t *data,igt_output_t *output, -enum igt_plane plane_type) +int plane_type) {igt_display_t *display = &data->display;uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ;
@@ -335,13 +336,13 @@ static void test_plane_rotation_ytiled_obj(data_t *data,uint32_t gem_handle;int ret; - plane =igt_output_get_plane (output, plane_type); + plane =igt_output_get_plane_type (output, plane_type);igt_require (igt_plane_supports_rotation (plane)); -if (plane_type ==IGT_PLANE_PRIMARY || plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) commit =COMMIT_UNIVERSAL ; -if (plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane);if (data->display.is_atomic)
@@ -388,7 +389,7 @@ static void test_plane_rotation_ytiled_obj(data_t *data,static void test_plane_rotation_exhaust_fences (data_t *data,igt_output_t *output, -enum igt_plane plane_type) +int plane_type) {igt_display_t *display = &data->display;uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ;
@@ -404,13 +405,13 @@ static void test_plane_rotation_exhaust_fences(data_t *data,uint64_t total_aperture_size, total_fbs_size;int i, ret; - plane =igt_output_get_plane (output, plane_type); + plane =igt_output_get_plane_type (output, plane_type);igt_require (igt_plane_supports_rotation (plane)); -if (plane_type ==IGT_PLANE_PRIMARY || plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) commit =COMMIT_UNIVERSAL ; -if (plane_type ==IGT_PLANE_CURSOR ) +if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane);if (data->display.is_atomic)
@@ -519,41 +520,41 @@ igt_main } igt_subtest_f("primary-rotation-180") { data.rotation =IGT_ROTATION_180 ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("sprite-rotation-180") { data.rotation =IGT_ROTATION_180 ; -test_plane_rotation (&data,IGT_PLANE_2 ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); } igt_subtest_f("cursor-rotation-180") { data.rotation =IGT_ROTATION_180 ; -test_plane_rotation (&data,IGT_PLANE_CURSOR ); +test_plane_rotation (&data,DRM_PLANE_TYPE_CURSOR ); } igt_subtest_f("primary-rotation-90") {igt_require (gen >=9 ); data.rotation =IGT_ROTATION_90 ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("primary-rotation-270") {igt_require (gen >=9 ); data.rotation =IGT_ROTATION_270 ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("sprite-rotation-90") {igt_require (gen >=9 ); data.rotation =IGT_ROTATION_90 ; -test_plane_rotation (&data,IGT_PLANE_2 ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); } igt_subtest_f("sprite-rotation-270") {igt_require (gen >=9 ); data.rotation =IGT_ROTATION_270 ; -test_plane_rotation (&data,IGT_PLANE_2 ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); } igt_subtest_f("sprite-rotation-90-pos-100-0") {
@@ -561,7 +562,7 @@ igt_main data.rotation =IGT_ROTATION_90 ; data.pos_x =100 , data.pos_y =0 ; -test_plane_rotation (&data,IGT_PLANE_2 ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); } igt_subtest_f("bad-pixel-format") {
@@ -570,7 +571,7 @@ igt_main data.pos_y =0 ; data.rotation =IGT_ROTATION_90 ; data.override_fmt =DRM_FORMAT_RGB565 ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("bad-tiling") {
@@ -578,7 +579,7 @@ igt_main data.override_fmt =0 ; data.rotation =IGT_ROTATION_90 ; data.override_tiling =LOCAL_DRM_FORMAT_MOD_NONE ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("primary-rotation-90-flip-stress") {
@@ -586,7 +587,7 @@ igt_main data.override_tiling =0 ; data.flip_stress =60 ; data.rotation =IGT_ROTATION_90 ; -test_plane_rotation (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("primary-rotation-90-Y-tiled") {
@@ -600,7 +601,7 @@ igt_mainfor_each_pipe_with_valid_output (&data.display, pipe, output) {igt_output_set_pipe (output, pipe); -test_plane_rotation_ytiled_obj (&data, output,IGT_PLANE_PRIMARY ); +test_plane_rotation_ytiled_obj (&data, output,DRM_PLANE_TYPE_PRIMARY ); valid_tests++;break ;
@@ -619,7 +620,7 @@ igt_mainfor_each_pipe_with_valid_output (&data.display, pipe, output) {igt_output_set_pipe (output, pipe); -test_plane_rotation_exhaust_fences (&data, output,IGT_PLANE_PRIMARY ); +test_plane_rotation_exhaust_fences (&data, output,DRM_PLANE_TYPE_PRIMARY ); valid_tests++;break ;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 27/32 tests/kms_sink_crc_basic: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_sink_crc_basic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_sink_crc_basic.c +1 -1
@@ -138,7 +138,7 @@ static void run_test(data_t *data)1.0 ,0.0 ,0.0 , &data->fb_red); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );basic_sink_crc_check (data);return ;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 28/32 tests/kms_universal_plane: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_universal_plane.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
tests/kms_universal_plane.c +9 -9
@@ -148,16 +148,16 @@ functional_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)* boolean and show up in userspace as the wrong type. */ for (i =0 ; i < display->pipes[pipe].n_planes; i++) -if (display->pipes[pipe].planes[i].is_primary) +if (display->pipes[pipe].planes[i].type ==DRM_PLANE_TYPE_PRIMARY ) num_primary++; -else if (display->pipes[pipe].planes[i].is_cursor) +else if (display->pipes[pipe].planes[i].type ==DRM_PLANE_TYPE_CURSOR ) num_cursor++;igt_assert_eq (num_primary,1 );igt_assert_lte (num_cursor,1 ); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - sprite =igt_output_get_plane (output,IGT_PLANE_2 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + sprite =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );if (!sprite) {functional_test_fini (&test, output);igt_skip ("No sprite plane available\n" );
@@ -369,7 +369,7 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)sanity_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Use legacy API to set a mode with a blue FB */ igt_plane_set_fb (primary, &test.blue_fb);
@@ -480,7 +480,7 @@ pageflip_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)pageflip_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Use legacy API to set a mode with a blue FB */ igt_plane_set_fb (primary, &test.blue_fb);
@@ -602,8 +602,8 @@ cursor_leak_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output) &cursor_fb[i]); } - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - cursor =igt_output_get_plane (output,IGT_PLANE_CURSOR ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + cursor =igt_output_get_plane_type (output,DRM_PLANE_TYPE_CURSOR );if (!primary || !cursor) {cursor_leak_test_fini (data, output, &background_fb, cursor_fb);igt_skip ("Primary and/or cursor are unavailable\n" );
@@ -706,7 +706,7 @@ gen9_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)gen9_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Start with a full-screen primary plane */ igt_plane_set_fb (primary, &test.biggreen_fb);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 29/32 tests/kms_vblank: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_vblank.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/kms_vblank.c +2 -2
@@ -76,7 +76,7 @@ static void prepare_crtc(data_t *data, int fd, igt_output_t *output)0.0 ,0.0 ,0.0 , &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->primary_fb);igt_display_commit (display);
@@ -91,7 +91,7 @@ static void cleanup_crtc(data_t *data, int fd, igt_output_t *output)igt_remove_fb (fd, &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 30/32 tests/prime_mmap_kms: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/prime_mmap_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/prime_mmap_kms.c +1 -1
@@ -168,7 +168,7 @@ static void prepare_crtc(gpu_process_t *gpu)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &gpu->fb); - gpu->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + gpu->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (gpu->primary, &gpu->fb);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 31/32 tests/kms_ccs: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_ccs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/kms_ccs.c +2 -2
@@ -182,7 +182,7 @@ static void display_fb(data_t *data, int compressed)render_ccs (data, f.handles[0 ], f.offsets[1 ], size[1 ], f.width/16 , f.height/8 , f.pitches[1 ]); - primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, fb);if (data->flags &TEST_ROTATE_180 )
@@ -231,7 +231,7 @@ static void test_output(data_t *data)display_fb (data,TEST_COMPRESSED ); } - primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_plane_set_rotation (primary,IGT_ROTATION_0 );if (!display->is_atomic)
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 32/32 tests/kms_plane_lowres: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane_lowres.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-)
tests/kms_plane_lowres.c +21 -6
@@ -40,8 +40,8 @@ typedef struct {int drm_fd;igt_display_t display;igt_pipe_crc_t *pipe_crc; -igt_plane_t *plane[IGT_MAX_PLANES ]; -struct igt_fb fb[IGT_MAX_PLANES ]; +igt_plane_t **plane; +struct igt_fb *fb; } data_t; static drmModeModeInfo
@@ -113,6 +113,12 @@ static void test_init(data_t *data, enum pipe pipe) { data->pipe_crc =igt_pipe_crc_new (pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + data->plane =calloc (data->display.pipes[pipe].n_planes,sizeof (data->plane));\ +igt_assert_f (data->plane,"Failed to allocate memory for %d planes\n" , + data->display.pipes[pipe].n_planes); + data->fb =calloc (data->display.pipes[pipe].n_planes,sizeof (struct igt_fb )); +igt_assert_f (data->fb,"Failed to allocate memory for %d FBs\n" , + data->display.pipes[pipe].n_planes); } static void
@@ -128,6 +134,11 @@ test_fini(data_t *data, igt_output_t *output)igt_output_set_pipe (output,PIPE_ANY );igt_pipe_crc_free (data->pipe_crc); + +free (data->plane); + data->plane =NULL ; +free (data->fb); + data->fb =NULL ; } static int
@@ -178,6 +189,8 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,int size;int i, x, y; + crtc.planes =calloc (sizeof (struct kmstest_plane ), data->display.pipes[pipe].n_planes); +igt_assert_f (crtc.planes,"Failed to allocate memory for %d planes\n" , data->display.pipes[pipe].n_planes);igt_output_set_pipe (output, pipe);kmstest_get_crtc (pipe, &crtc);
@@ -198,8 +211,10 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,igt_plane_set_fb (data->plane[0 ], &data->fb[0 ]);/* yellow sprite plane in lower left corner */ -for (i =IGT_PLANE_2 ; i < crtc.n_planes; i++) { -if (data->plane[i]->is_cursor) +for (i =0 ; i < crtc.n_planes; i++) { +if (data->plane[i]->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +if (data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ) size =64 ;else size =SIZE ;
@@ -209,8 +224,8 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,igt_create_color_fb (data->drm_fd, size, size, - data->plane[i]->is_cursor ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , - data->plane[i]->is_cursor ?LOCAL_DRM_FORMAT_MOD_NONE : modifier, + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?LOCAL_DRM_FORMAT_MOD_NONE : modifier,1.0 ,1.0 ,0.0 , &data->fb[i]);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx