lib/igt_kms: Implement dynamic plane count support
v3 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 the branch dyn_n_planes_$VERSION on:
https://git.collabora.com/cgit/user/robertfoss/intel-gpu-tools.git/
Changes since v2:
Rebased on upstream/master
Added "Reviewed-by: Mika Kahola <[email protected]>" to all patches
* igt_kms:
- Fixed misaligned bracket
* kms_fbc_crc:
- Harmonize variable name with the rest of series
* kms_plane:
- Fixed misaligned function argument
* kms_plane_multiple:
- Increased size of memory allocations
- Switched malloc to calloc
- test_fini() skip planes that are NULL
- test_fini() set free'd plane pointers to NULL
- test_fini() fix off-by-one in induction variable
- prepare_planes() make if-else statement more legible
Changes since v1:
Rebased on upstream/master
* igt_kms:
- Added back kmstest_pipe_to_index() declaration
- Fixed kmstest_plane_type_name() comment
- Split up dyn n_planes implementation into a an additive part and a subtractive part to make sure that all tests work at all times
- Fixed two igt_assert_f's that tested the wrong variable
- Added igt_assert_f to verify that plane->index never is >= n_planes during igt_display_init()
* kms_plane_multiple:
- Fix printf cast of size_t varibles
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 (33):
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: Remove code obsoleted by dyn n_planes implementation
lib/igt_kms.c | 215 +++++++++++++++++++++++------------ lib/igt_kms.h | 40 +++---- tests/kms_atomic_transition.c | 27 +++-- tests/kms_busy.c | 6 +- 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 | 96 +++++++++------- tests/kms_plane_lowres.c | 35 ++++-- tests/kms_plane_multiple.c | 232 ++++++++++++++++++++++++-------------- 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, 529 insertions(+), 388 deletions(-)
Signature · 6 lines
2.11.0.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/33 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
@@ -1282,21 +1282,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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 2/33 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
@@ -1265,7 +1265,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);
@@ -1278,31 +1278,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)
@@ -1342,7 +1347,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 ;
@@ -1368,7 +1378,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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 3/33 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
@@ -1348,11 +1348,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 ;
@@ -1378,14 +1380,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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 4/33 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 | 160 ++++++++++++++++++++++++++++++++++++++++++++-------------- lib/igt_kms.h | 37 ++++++++------ 2 files changed, 143 insertions(+), 54 deletions(-)
lib/igt_kms.c +121 -39
@@ -349,7 +349,7 @@ int kmstest_pipe_to_index(char pipe)* kmstest_plane_name: * @plane: display plane * -* Returns: String represnting @pipe, e.g. "plane1". +* Returns: String representing @plane, e.g. "plane1". */ const char *kmstest_plane_name (enum igt_plane plane) {
@@ -371,6 +371,25 @@ const char *kmstest_plane_name(enum igt_plane plane)return names[plane]; } +/** +* kmstest_plane_type_name: +* @plane: display plane +* +* Returns: String representing @plane, e.g. "overlay". +*/ +const char *kmstest_plane_type_name (int plane_type) +{ +static const char *names[] = { + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , + }; + +igt_assert (plane_type <ARRAY_SIZE (names) && names[plane_type]); + +return names[plane_type]; +} +static const char *mode_stereo_name (const drmModeModeInfo *mode) {switch (mode->flags &DRM_MODE_FLAG_3D_MASK ) {
@@ -1570,14 +1589,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",
@@ -1603,6 +1625,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;
@@ -1620,22 +1663,27 @@ 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 ]; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + } plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ;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; + plane->is_cursor =1 ;break ;default : plane = &pipe->planes[p];
@@ -1643,7 +1691,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)break ; } - n_planes++; +igt_assert_f (plane->index < n_planes,"n_planes < plane->index failed\n" ); + plane->type = type; plane->pipe = pipe; plane->drm_plane = drm_plane;
@@ -1664,7 +1713,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) {/*
@@ -1672,11 +1721,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 {
@@ -1684,7 +1733,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;
@@ -1692,9 +1741,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; }
@@ -1773,6 +1819,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)
@@ -1861,20 +1910,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)
@@ -2219,9 +2289,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 {
@@ -2438,7 +2508,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; } }
@@ -2717,14 +2789,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 +22 -15
@@ -61,21 +61,22 @@ 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 , +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 ,
@@ -272,6 +273,7 @@ typedef struct {igt_pipe_t *pipe;int index;/* capabilities */ +int type; unsigned int is_primary : 1; unsigned int is_cursor : 1;/* state tracking */
@@ -308,8 +310,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 ];
@@ -369,9 +374,11 @@ 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_output_t *igt_output_from_connector (igt_display_t *display, -drmModeConnector *connector); +drmModeConnector *connector); +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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 5/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 6/33 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_busy.c +3 -3
@@ -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;
@@ -106,7 +106,7 @@ static void flip_to_fb(igt_display_t *dpy, int pipe, dpy->pipes[pipe].crtc_id, fb->fb_id, DRM_MODE_PAGE_FLIP_EVENT, fb)); else { -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_output_set_pipe (output,PIPE_NONE ); igt_display_commit_atomic(dpy, DRM_MODE_ATOMIC_NONBLOCK |
@@ -232,7 +232,7 @@ static void test_hang(igt_display_t *dpy, unsigned ring,igt_require ((output =set_fb_on_crtc (dpy, pipe, &fb[0 ])));igt_display_commit2 (dpy,COMMIT_ATOMIC ); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); igt_create_pattern_fb(dpy->drm_fd, fb[0].width, fb[0].height,
Signature · 6 lines
2.11.0.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 7/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 8/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 9/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 10/33 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);
@@ -298,12 +299,13 @@ static bool mode_requires_extra_vblank(enum flip_test mode)return false; } -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);
@@ -369,7 +371,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);
@@ -868,7 +870,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;
@@ -1008,7 +1010,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 ); }
@@ -1308,6 +1310,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)
@@ -1339,10 +1343,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. */
@@ -1368,7 +1372,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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 11/33 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_id; -for_each_pipe (display, pipe) { -igt_plane_t *plane = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +for_each_pipe (display, pipe_id) { +igt_pipe_t *pipe = &display->pipes[pipe_id]; +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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 12/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 13/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 14/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 15/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 16/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 17/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 18/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 19/33 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 | 96 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 43 deletions(-)
tests/kms_plane.c +53 -43
@@ -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,8 +348,8 @@ test_plane_panning_with_output(data_t *data, }static void -test_plane_panning (data_t *data,enum pipe pipe,enum igt_plane plane, -unsigned int flags) +test_plane_panning (data_t *data,enum pipe pipe,int plane, +unsigned int flags) {igt_output_t *output;int connected_outs =0 ;
@@ -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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 20/33 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 | 232 ++++++++++++++++++++++++++++----------------- 1 file changed, 145 insertions(+), 87 deletions(-)
tests/kms_plane_multiple.c +145 -87
@@ -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,38 @@ 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 n_planes) { data->pipe_crc =igt_pipe_crc_new (pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + + data->plane =calloc (n_planes,sizeof (data->plane)); +igt_assert_f (data->plane !=NULL ,"Failed to allocate memory for planes\n" ); + + data->fb =calloc (n_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) +static void test_fini (data_t *data,igt_output_t *output,int n_planes) { -for (int i =IGT_PLANE_PRIMARY ; i <= max_planes; i++) -igt_plane_set_fb (data->plane[i],NULL ); +for (int i =0 ; i < n_planes; i++) { +igt_plane_t *plane = data->plane[i]; +if (!plane) +continue ; +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +igt_plane_set_fb (plane,NULL ); + data->plane[i] =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 +109,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 +123,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 +148,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,24 +184,39 @@ 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 %ld bytes for variable x\n" , (long int ) (pipe->n_planes *sizeof (*x))); + y =malloc (pipe->n_planes *sizeof (*y)); +igt_assert_f (y,"Failed to allocate %ld bytes for variable y\n" , (long int ) (pipe->n_planes *sizeof (*y))); + size =malloc (pipe->n_planes *sizeof (*size)); +igt_assert_f (size,"Failed to allocate %ld bytes for variable size\n" , (long int ) (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_PRIMARY ) +continue ; +else if (plane->type ==DRM_PLANE_TYPE_CURSOR ) size[i] =SIZE_CURSOR ;else size[i] =SIZE_PLANE ;
@@ -183,12 +224,12 @@ prepare_planes(data_t *data, enum pipe pipe, color_t *color, 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,16 +238,16 @@ 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 test_atomic_plane_position_with_output (data_t *data,enum pipe pipe, -igt_output_t *output,int max_planes, -uint64_t tiling) +igt_output_t *output,int n_planes, +int max_planes,uint64_t tiling) {char buf[256 ];struct drm_event *e = (void *)buf;
@@ -232,7 +273,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, n_planes);test_grab_crc (data, output, pipe, true, &blue, tiling, &test.reference_crc);
@@ -269,13 +310,13 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,igt_pipe_crc_stop (data->pipe_crc); -test_fini (data, output, max_planes); +test_fini (data, output, n_planes); }static void test_legacy_plane_position_with_output (data_t *data,enum pipe pipe, -igt_output_t *output,int max_planes, -uint64_t tiling) +igt_output_t *output,int n_planes, +int max_planes,uint64_t tiling) {test_position_t test = { .data = data };color_t blue = {0.0f ,0.0f ,1.0f };
@@ -298,7 +339,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, n_planes);test_grab_crc (data, output, pipe, false, &blue, tiling, &test.reference_crc);
@@ -320,12 +361,12 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,igt_pipe_crc_stop (data->pipe_crc); -test_fini (data, output, max_planes); +test_fini (data, output, n_planes); }static void -test_plane_position (data_t *data,enum pipe pipe,bool atomic,int max_planes, -uint64_t tiling) +test_plane_position (data_t *data,enum pipe pipe,bool atomic,int n_planes, +int max_planes,uint64_t tiling) {igt_output_t *output;int connected_outs;
@@ -351,11 +392,13 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int max_planes,if (atomic)test_atomic_plane_position_with_output (data, pipe, output, + n_planes, max_planes, tiling);else test_legacy_plane_position_with_output (data, pipe, output, + n_planes, max_planes, tiling);
@@ -367,54 +410,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, n_planes, + 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, n_planes, + 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, n_planes, + 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, n_planes, + 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, n_planes, + 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, n_planes, + 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, n_planes, + 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, n_planes, + planes, LOCAL_I915_FORMAT_MOD_Yf_TILED); + } }static data_t data;
@@ -461,15 +521,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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 21/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 22/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 23/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 24/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 25/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 26/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t v3 26/33] tests/kms_rotation_crc: Add support for dynamic number of planes
Robert,
I think this patch got committed (with a slight change) in 3e04c5197ff965a8cd050f9c3b5213abcf437a31.
Unfortunately, I think that commit inadvertently included a binary file 'tools/intel_bios_reader' as well. Can you remove this file?
Thanks,
-Jordan
Quoted 249 lines · Robert Foss
Add changes reflecting the new support for dynamic number of planes per pipe.
Signed-off-by Robert Foss <[email protected]>Reviewed-by Mika Kahola <[email protected]>--- 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.453.g787f75f05 _______________________________________________ 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
Re: [PATCH i-g-t v3 26/33] tests/kms_rotation_crc: Add support for dynamic number of planes
Hi,
Quoted 7 lines · Jordan Justen
Robert,
I think this patch got committed (with a slight change) in
3e04c5197ff965a8cd050f9c3b5213abcf437a31.Unfortunately, I think that commit inadvertently included a binary file '
tools/intel_bios_reader' as well. Can you remove this file?
That a pretty bad mistake. Would you just like to see a commit removing this binary file? Or something more clever?
Rob.
Quoted 251 lines
Thanks,
-Jordan
Quoted 245 lines · Robert Foss
Add changes reflecting the new support for dynamic number of planes per pipe.
Signed-off-by Robert Foss <[email protected]>Reviewed-by Mika Kahola <[email protected]>--- tests/kms_rotation_crc.c | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-)tests/kms_rotation_crc.c +32
-32@@ -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 ; --2.11.0.453.g787f75f05
Quoted 4 lines
Quoted 4 lines
_______________________________________________
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
Re: [PATCH i-g-t v3 26/33] tests/kms_rotation_crc: Add support for dynamic number of planes
Quoted 5 lines · Robert Foss
Hi,
Quoted 2 lines · Jordan Justen
Robert,
Quoted 9 lines
Quoted 5 lines
I think this patch got committed (with a slight change) in
3e04c5197ff965a8cd050f9c3b5213abcf437a31.Unfortunately, I think that commit inadvertently included a binary file '
tools/intel_bios_reader' as well. Can you remove this file?That a pretty bad mistake. Would you just like to see a commit removing this binary file? Or something more clever?
There has been a release tagged with the commit, and besides I think it's been far too long to consider anything except a new commit removing it.
-Jordan
Quoted 247 lines
Quoted 247 lines · Robert Foss
Quoted 245 lines
Add changes reflecting the new support for dynamic number of planes per pipe.
Signed-off-by Robert Foss <[email protected]>Reviewed-by Mika Kahola <[email protected]>--- tests/kms_rotation_crc.c | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-)tests/kms_rotation_crc.c +32
-32@@ -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 ; --2.11.0.453.g787f75f05
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
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 v3 27/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 28/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 29/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 30/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 31/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 32/33 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.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 33/33 lib/igt_kms: Remove code obsoleted by dyn n_planes implementation
In reply to Robert FossDue to the dyn n_planes implementation some attributes and functions were made obsolete and cand be removed.
However to keep all of the tests building the obsolete code is removed after all of the tests have been made compatible with the dyn n_planes changes.
--- lib/igt_kms.c | 28 ---------------------------- lib/igt_kms.h | 20 -------------------- 2 files changed, 48 deletions(-)
lib/igt_kms.c +0 -28
@@ -346,32 +346,6 @@ int kmstest_pipe_to_index(char pipe) }/** -* kmstest_plane_name: -* @plane: display plane -* -* Returns: String representing @plane, e.g. "plane1". -*/ -const char *kmstest_plane_name (enum igt_plane plane) -{ -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" , - }; - -igt_assert (plane <ARRAY_SIZE (names) && names[plane]); - -return names[plane]; -} - -/** * kmstest_plane_type_name: * @plane: display plane *
@@ -1671,7 +1645,6 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane = &pipe->planes[p]; plane->index = p++; } - plane->is_primary =1 ;break ;case DRM_PLANE_TYPE_CURSOR :if (pipe->plane_cursor ==-1 ) {
@@ -1683,7 +1656,6 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane->index = p++; } display->has_cursor_plane = true; - plane->is_cursor =1 ;break ;default : plane = &pipe->planes[p];
lib/igt_kms.h +0 -20
@@ -58,24 +58,6 @@ enum pipe { };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 {
@@ -274,8 +256,6 @@ typedef struct {int index;/* capabilities */ int type; - unsigned int is_primary : 1; - unsigned int is_cursor : 1;/* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;
Signature · 6 lines
2.11.0.453.g787f75f05 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx