lib/igt_kms: Implement dynamic plane count support
cover lib/igt_kms: Implement dynamic plane count support
Coverletter:
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 only been tested on vc4, but testing reveals no new failures.
This series can be found here:
https://git.collabora.com/cgit/user/robertfoss/intel-gpu-tools.git/
Robert Foss (29):
lib/igt_debugfs: Prevent buffer overflow
lib/igt_kms: Fixed typo
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
lib/igt_debugfs.c | 8 +- lib/igt_kms.c | 159 +++++++++++++++++++---------- lib/igt_kms.h | 32 ++---- tests/kms_atomic_transition.c | 27 +++-- tests/kms_busy.c | 2 +- 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 | 30 +++--- tests/kms_fbc_crc.c | 4 +- tests/kms_fence_pin_leak.c | 2 +- tests/kms_flip_event_leak.c | 2 +- tests/kms_legacy_colorkey.c | 4 +- tests/kms_mmap_write_crc.c | 2 +- tests/kms_mmio_vs_cs_flip.c | 6 +- tests/kms_panel_fitting.c | 16 +-- tests/kms_pipe_color.c | 4 +- tests/kms_plane.c | 94 ++++++++++-------- tests/kms_plane_multiple.c | 203 +++++++++++++++++++++++--------------- 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 +- 29 files changed, 440 insertions(+), 340 deletions(-)
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 1/29 lib/igt_debugfs: Prevent buffer overflow
buf array may overflow with when writing '\0' ifMAX_LINE_LEN bytes are read during read().
--- lib/igt_debugfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
lib/igt_debugfs.c +5 -3
@@ -594,13 +594,15 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) read_len =MAX_LINE_LEN ;igt_set_timeout (5 ,"CRC reading" ); - bytes_read =read (pipe_crc->crc_fd, &buf, read_len); + bytes_read =read (pipe_crc->crc_fd, &buf, read_len -1 );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) { +if (bytes_read <0 && errno ==EAGAIN )igt_assert (pipe_crc->flags &O_NONBLOCK ); + +if (bytes_read <0 ) bytes_read =0 ; - } + buf[bytes_read] ='\0' ;if (bytes_read && !pipe_crc_init_from_string (pipe_crc, out, buf))
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 2/29 lib/igt_kms: Fixed typo
In reply to Robert Foss--- lib/igt_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +1 -1
@@ -308,7 +308,7 @@ const unsigned char* igt_kms_get_alt_edid(void)* kmstest_pipe_name: * @pipe: display pipe * -* Returns: String represnting @pipe, e.g. "A". +* Returns: String reprsenting @pipe, e.g. "A". */ const char *kmstest_pipe_name (enum pipe pipe) {
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 3/29 lib/igt_kms: Implement dynamic plane count support
In reply to Robert FossIn upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe.
The simple fix for this would be to simply bump hardcoded value for number of frames per pipe.
But a better solution would be to add support for dynamic number of planes per pipe to i-g-t.
--- lib/igt_kms.c | 157 +++++++++++++++++++++++++++++++++++++++------------------- lib/igt_kms.h | 32 ++++-------- 2 files changed, 115 insertions(+), 74 deletions(-)
lib/igt_kms.c +105 -52
@@ -329,24 +329,17 @@ const char *kmstest_pipe_name(enum pipe pipe)* * Returns: String represnting @pipe, e.g. "plane1". */ -const char *kmstest_plane_name (enum igt_plane plane) +const char *kmstest_plane_type_name (int plane_type) {static const char *names[] = { - [IGT_PLANE_1 ] ="plane1" , - [IGT_PLANE_2 ] ="plane2" , - [IGT_PLANE_3 ] ="plane3" , - [IGT_PLANE_4 ] ="plane4" , - [IGT_PLANE_5 ] ="plane5" , - [IGT_PLANE_6 ] ="plane6" , - [IGT_PLANE_7 ] ="plane7" , - [IGT_PLANE_8 ] ="plane8" , - [IGT_PLANE_9 ] ="plane9" , - [IGT_PLANE_CURSOR ] ="cursor" , + [DRM_PLANE_TYPE_OVERLAY ] ="overlay" , + [DRM_PLANE_TYPE_PRIMARY ] ="primary" , + [DRM_PLANE_TYPE_CURSOR ] ="cursor" , }; -igt_assert (plane <ARRAY_SIZE (names) && names[plane]); +igt_assert (plane_type <ARRAY_SIZE (names) && names[plane_type]); -return names[plane]; +return names[plane_type]; }static const char *mode_stereo_name (const drmModeModeInfo *mode)
@@ -1355,14 +1348,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",
@@ -1388,6 +1384,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 !=NULL ,"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;
@@ -1405,21 +1422,24 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane_resources->planes[j]);switch (type) {case DRM_PLANE_TYPE_PRIMARY : - plane = &pipe->planes[IGT_PLANE_PRIMARY ]; - plane->is_primary =1 ; - plane->index =IGT_PLANE_PRIMARY ; +if (pipe->plane_primary ==-1 ) { + plane = &pipe->planes[0 ]; + plane->index =0 ; + pipe->plane_primary =0 ; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + }break ;case DRM_PLANE_TYPE_CURSOR : -/* -* Cursor should be the highest index in our -* internal list, but we don't know what that -* is yet. Just stick it in the last slot -* for now and we'll move it later, if -* necessary. -*/ - plane = &pipe->planes[IGT_PLANE_CURSOR ]; - plane->is_cursor =1 ; - plane->index =IGT_PLANE_CURSOR ; +if (pipe->plane_cursor ==-1 ) { + plane = &pipe->planes[last_plane]; + plane->index = last_plane; + pipe->plane_cursor = last_plane; + }else { + plane = &pipe->planes[p]; + plane->index = p++; + } display->has_cursor_plane = true;break ;default :
@@ -1428,7 +1448,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)break ; } - n_planes++; + plane->type = type; plane->pipe = pipe; plane->drm_plane = drm_plane;
@@ -1449,7 +1469,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) {/*
@@ -1457,11 +1477,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 {
@@ -1469,7 +1489,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;
@@ -1477,9 +1497,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; }
@@ -1532,6 +1549,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)
@@ -1619,20 +1639,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)
@@ -1977,9 +2018,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 {
@@ -2196,7 +2237,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; } }
@@ -2476,14 +2519,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 +10 -22
@@ -57,24 +57,7 @@ enum pipe {I915_MAX_PIPES };const char *kmstest_pipe_name (enum pipe pipe); - -/* We namespace this enum to not conflict with the Android i915_drm.h */ -enum igt_plane { -IGT_PLANE_1 =0 , -IGT_PLANE_PRIMARY =IGT_PLANE_1 , -IGT_PLANE_2 , -IGT_PLANE_3 , -IGT_PLANE_4 , -IGT_PLANE_5 , -IGT_PLANE_6 , -IGT_PLANE_7 , -IGT_PLANE_8 , -IGT_PLANE_9 , -IGT_PLANE_CURSOR ,/* IGT_PLANE_CURSOR is always the last plane. */ -IGT_MAX_PLANES , -}; - -const char *kmstest_plane_name (enum igt_plane plane); +const char *kmstest_plane_type_name (int plane_type);enum port {PORT_A =0 ,
@@ -232,8 +215,7 @@ typedef struct {igt_pipe_t *pipe;int index;/* capabilities */ - unsigned int is_primary : 1; - unsigned int is_cursor : 1; +int type;/* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1;
@@ -268,8 +250,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 ];
@@ -329,7 +314,10 @@ 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); +int igt_pipe_get_last_out_fence (igt_pipe_t *pipe); +igt_plane_t *igt_pipe_get_plane_type (igt_pipe_t *pipe,int plane_type);bool igt_pipe_get_property (igt_pipe_t *pipe,const char *name,uint32_t *prop_id,uint64_t *value,drmModePropertyPtr *prop);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 4/29 tests/kms_atomic_transition: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_atomic_transition.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
tests/kms_atomic_transition.c +13 -14
@@ -120,7 +120,8 @@ static void set_sprite_wh(igt_display_t *display, enum pipe pipe,for_each_plane_on_pipe (display, pipe, plane) {int i = plane->index; -if (plane->is_primary || plane->is_cursor) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR )continue ; parms[i].width = w;
@@ -156,20 +157,16 @@ static void setup_parms(igt_display_t *display, enum pipe pipe,for_each_plane_on_pipe (display, pipe, plane) {int i = plane->index; -if (plane->is_primary) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) { parms[i].fb = plane->fb; -else if (plane->is_cursor) - parms[i].fb = argb_fb; -else - parms[i].fb = sprite_fb; - -if (plane->is_primary) { parms[i].width = mode->hdisplay; parms[i].height = mode->vdisplay; - }else if (plane->is_cursor) { + }else if (plane->type ==DRM_PLANE_TYPE_CURSOR ) { + parms[i].fb = argb_fb; parms[i].width = cursor_width; parms[i].height = cursor_height; - } + }else + parms[i].fb = sprite_fb; } igt_create_fb(display->drm_fd, cursor_width, cursor_height,
@@ -273,7 +270,7 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *outputdrmModeModeInfo *mode, override_mode;igt_plane_t *plane;uint32_t iter_max =1 << display->pipes[pipe].n_planes, i; -struct plane_parms parms[IGT_MAX_PLANES ]; +struct plane_parms parms[display->pipes[pipe].n_planes];bool skip_test = false;unsigned flags =DRM_MODE_PAGE_FLIP_EVENT ;
@@ -421,7 +418,8 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct iigt_output_set_pipe (output,PIPE_NONE );for_each_pipe (display, pipe) { -igt_plane_t *plane = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +igt_plane_t *plane =igt_pipe_get_plane_type (&display->pipes[pipe], +DRM_PLANE_TYPE_PRIMARY );drmModeModeInfo *mode =NULL ;if (!(mask & (1 << pipe))) {
@@ -462,7 +460,7 @@ static void refresh_primaries(igt_display_t *display)for_each_pipe (display, pipe)for_each_plane_on_pipe (display, pipe, plane) -if (plane->is_primary && plane->fb) +if (plane->type ==DRM_PLANE_TYPE_PRIMARY && plane->fb) plane->fb_changed = true; }
@@ -506,7 +504,8 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblock DRM_FORMAT_XRGB8888, 0, .5, .5, .5, &fbs[1]);for_each_pipe (display, i) { -igt_plane_t *plane = &display->pipes[i].planes[IGT_PLANE_PRIMARY ]; +igt_pipe_t *pipe = &display->pipes[i]; +igt_plane_t *plane =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY );drmModeModeInfo *mode =NULL ;if (is_i915_device (display->drm_fd))
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 5/29 tests/kms_busy: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_busy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_busy.c +1 -1
@@ -53,7 +53,7 @@ set_fb_on_crtc(igt_display_t *dpy, int pipe, struct igt_fb *fb)LOCAL_I915_FORMAT_MOD_X_TILED , fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, fb);return output;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 6/29 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 ); }
@@ -249,7 +249,7 @@ static bool 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);
@@ -286,7 +286,7 @@ static void cleanup_crtc(data_t *data)igt_remove_fb (data->drm_fd, &data->primary_fb); - primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (data->output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 7/29 tests/kms_crtc_background_color: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_crtc_background_color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_crtc_background_color.c +1 -1
@@ -136,7 +136,7 @@ static void test_crtc_background(data_t *data)igt_output_set_pipe (output, pipe); - plane =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_require (plane->pipe->background_property);prepare_crtc (data, output, pipe, plane,1 ,PURPLE ,BLACK64 );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 8/29 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 );
@@ -308,7 +308,7 @@ static bool 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);
@@ -351,7 +351,7 @@ static void cleanup_crtc(data_t *data, igt_output_t *output)igt_remove_fb (data->drm_fd, &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 9/29 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 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-)
tests/kms_cursor_legacy.c +17 -13
@@ -166,7 +166,7 @@ static igt_output_t *set_fb_on_crtc(igt_display_t *display, int pipe, struct igt mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888, I915_TILING_NONE, fb_info); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, fb_info);return output;
@@ -180,7 +180,7 @@ static void set_cursor_on_pipe(igt_display_t *display, enum pipe pipe, struct igigt_plane_t *plane, *cursor =NULL ;for_each_plane_on_pipe (display, pipe, plane) { -if (!plane->is_cursor) +if (plane->type !=DRM_PLANE_TYPE_CURSOR )continue ; cursor = plane;
@@ -250,13 +250,14 @@ static enum pipe find_connected_pipe(igt_display_t *display, bool second)return pipe; } -static void flip_nonblocking (igt_display_t *display,enum pipe pipe,bool atomic,struct igt_fb *fb) +static void flip_nonblocking (igt_display_t *display,enum pipe pipe_id,bool atomic,struct igt_fb *fb) { -igt_plane_t *primary = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; +igt_pipe_t *pipe = &display->pipes[pipe_id]; +igt_plane_t *primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY );if (!atomic) {/* Schedule a nonblocking flip for the next vblank */ -do_or_die (drmModePageFlip (display->drm_fd, display->pipes[pipe].crtc_id, fb->fb_id, +do_or_die (drmModePageFlip (display->drm_fd, pipe->crtc_id, fb->fb_id,DRM_MODE_PAGE_FLIP_EVENT , fb)); }else {igt_plane_set_fb (primary, fb);
@@ -283,12 +284,13 @@ static bool cursor_slowpath(enum flip_test mode)return true; } -static void transition_nonblocking (igt_display_t *display,enum pipe pipe, +static void transition_nonblocking (igt_display_t *display,enum pipe pipe_id,struct igt_fb *prim_fb,struct igt_fb *argb_fb,bool hide_sprite) { -igt_plane_t *primary = &display->pipes[pipe].planes[IGT_PLANE_PRIMARY ]; -igt_plane_t *sprite = &display->pipes[pipe].planes[IGT_PLANE_2 ]; +igt_pipe_t *pipe = &display->pipes[pipe_id]; +igt_plane_t *primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY ); +igt_plane_t *sprite =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_OVERLAY );if (hide_sprite) {igt_plane_set_fb (primary, prim_fb);
@@ -345,7 +347,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);
@@ -794,7 +796,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;
@@ -1240,6 +1242,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)
@@ -1271,10 +1275,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. */
@@ -1300,7 +1304,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_lte (vblank_start +1 ,get_vblank (display->drm_fd, pipe,0 )); -igt_plane_set_fb (&display->pipes[pipe].planes[IGT_PLANE_PRIMARY ], &fb_info[0 ]); +igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL );igt_assert_crc_equal (&crcs[i], &crcs[2 ]);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 10/29 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/kms_fbc_crc.c +2 -2
@@ -383,7 +383,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);
@@ -471,7 +471,7 @@ static void reset_display(data_t *data)for_each_connected_output (display, data->output) {if (data->output->valid >0 ) { - 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 ); }igt_output_set_pipe (data->output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 11/29 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
@@ -122,7 +122,7 @@ static bool run_single_test(data_t *data, enum pipe pipe, igt_output_t *output) } mode =igt_output_get_mode (output); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 12/29 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
@@ -57,7 +57,7 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output)return false; } - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); mode =igt_output_get_mode (output); igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 13/29 tests/kms_legacy_colorkey: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_legacy_colorkey.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_legacy_colorkey.c +3 -1
@@ -55,8 +55,10 @@ igt_simple_mainfor_each_pipe (&display, p) {for_each_plane_on_pipe (&display, p, plane) { +bool is_valid = (plane->type ==DRM_PLANE_TYPE_PRIMARY || + plane->type ==DRM_PLANE_TYPE_CURSOR );test_plane (plane->drm_plane->plane_id, - (plane->is_cursor || plane->is_primary) ? -ENOENT :0 ); + is_valid ? -ENOENT :0 ); max_id =max (max_id, plane->drm_plane->plane_id); }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 14/29 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
@@ -184,7 +184,7 @@ static bool prepare_crtc(data_t *data)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &data->fb[0]); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary, &data->fb[0 ]);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 15/29 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 bool -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;
@@ -208,7 +208,7 @@ test_plane(data_t *data, igt_output_t *output, enum pipe pipe, enum igt_plane plreturn false; } - 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);
@@ -473,7 +473,7 @@ static void run_plane_test(data_t *data) {igt_output_t *output; -enum igt_plane plane =1 ;/* testing with one sprite is enough */ +int plane =1 ;/* testing with one sprite is enough */ int valid_tests =0 ;enum pipe pipe;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 16/29 tests/kms_panel_fitting: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_panel_fitting.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tests/kms_panel_fitting.c +8 -8
@@ -76,10 +76,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,* there's no way (that works) to light up a pipe with only a sprite * plane enabled at the moment. */ -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->fb1); }
@@ -116,10 +116,10 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) data->fb_id3 =0 ; } -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL ); }
@@ -174,7 +174,7 @@ static void test_panel_fitting(data_t *d)/* Set up display to enable panel fitting */ mode->hdisplay =640 ; mode->vdisplay =480 ; - d->plane1 =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + d->plane1 =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );prepare_crtc (d, output, pipe, d->plane1, mode,COMMIT_LEGACY );/* disable panel fitting */
@@ -189,7 +189,7 @@ static void test_panel_fitting(data_t *d)prepare_crtc (d, output, pipe, d->plane1, &native_mode,COMMIT_LEGACY );/* Set up fb2->plane2 mapping. */ - d->plane2 =igt_output_get_plane (output,IGT_PLANE_2 ); + d->plane2 =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );igt_plane_set_fb (d->plane2, &d->fb2);/* enable sprite plane */
@@ -226,8 +226,8 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_outigt_output_override_mode (output, &mode);igt_output_set_pipe (output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - sprite =igt_output_get_plane (output,IGT_PLANE_2 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + sprite =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY ); igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay, DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 17/29 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
@@ -856,10 +856,10 @@ run_tests_for_pipe(data_t *data, enum pipe p)return ; pipe = &data->display.pipes[p]; -if (pipe->n_planes <IGT_PLANE_PRIMARY ) +if (pipe->n_planes <0 )return ; - primary = &pipe->planes[IGT_PLANE_PRIMARY ]; + primary =igt_pipe_get_plane_type (pipe,DRM_PLANE_TYPE_PRIMARY ); data->pipe_crc =igt_pipe_crc_new (primary->pipe->pipe,INTEL_PIPE_CRC_SOURCE_AUTO );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 18/29 tests/kms_plane: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane.c | 94 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 42 deletions(-)
tests/kms_plane.c +52 -42
@@ -150,7 +150,7 @@ enum {static void test_plane_position_with_output (data_t *data,enum pipe pipe, -enum igt_plane plane, +int plane,igt_output_t *output,unsigned int flags) {
@@ -170,7 +170,7 @@ test_plane_position_with_output(data_t *data,igt_output_set_pipe (output, pipe); mode =igt_output_get_mode (output); - primary =igt_output_get_plane (output,0 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); sprite =igt_output_get_plane (output, plane); create_fb_for_mode__position(data, mode, 100, 100, 64, 64,
@@ -222,7 +222,7 @@ test_plane_position_with_output(data_t *data, }static void -test_plane_position (data_t *data,enum pipe pipe,enum igt_plane plane, +test_plane_position (data_t *data,enum pipe pipe,int plane,unsigned int flags) {igt_output_t *output;
@@ -294,7 +294,7 @@ enum {static void test_plane_panning_with_output (data_t *data,enum pipe pipe, -enum igt_plane plane, +int plane,igt_output_t *output,unsigned int flags) {
@@ -348,7 +348,7 @@ test_plane_panning_with_output(data_t *data, }static void -test_plane_panning (data_t *data,enum pipe pipe,enum igt_plane plane, +test_plane_panning (data_t *data,enum pipe pipe,int plane,unsigned int flags) {igt_output_t *output;
@@ -367,47 +367,57 @@ test_plane_panning(data_t *data, enum pipe pipe, enum igt_plane plane, }static void -run_tests_for_pipe_plane (data_t *data,enum pipe pipe,enum igt_plane plane) +run_tests_for_pipe_plane (data_t *data,enum pipe pipe) { -igt_subtest_f ("plane-position-covered-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane, -TEST_POSITION_FULLY_COVERED ); - -igt_subtest_f ("plane-position-hole-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane,0 ); - -igt_subtest_f ("plane-position-hole-dpms-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_position (data, pipe, plane, -TEST_DPMS ); - -igt_subtest_f ("plane-panning-top-left-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane,TEST_PANNING_TOP_LEFT ); - -igt_subtest_f ("plane-panning-bottom-right-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane, -TEST_PANNING_BOTTOM_RIGHT ); - -igt_subtest_f ("plane-panning-bottom-right-suspend-pipe-%s-plane-%d" , - kmstest_pipe_name(pipe), plane) -test_plane_panning (data, pipe, plane, -TEST_PANNING_BOTTOM_RIGHT | -TEST_SUSPEND_RESUME ); -} +igt_subtest_f ("plane-position-covered-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane, +TEST_POSITION_FULLY_COVERED ); + } -static void -run_tests_for_pipe (data_t *data,enum pipe pipe) -{ -int plane; +igt_subtest_f ("plane-position-hole-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane,0 ); + } + +igt_subtest_f ("plane-position-hole-dpms-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_position (data, pipe, plane, +TEST_DPMS ); + } + +igt_subtest_f ("plane-panning-top-left-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane,TEST_PANNING_TOP_LEFT ); + } -for (plane =1 ; plane <IGT_MAX_PLANES ; plane++) -run_tests_for_pipe_plane (data, pipe, plane); +igt_subtest_f ("plane-panning-bottom-right-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane, +TEST_PANNING_BOTTOM_RIGHT ); + } + +igt_subtest_f ("plane-panning-bottom-right-suspend-pipe-%s-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int plane =1 ; plane < n_planes; plane++) +test_plane_panning (data, pipe, plane, +TEST_PANNING_BOTTOM_RIGHT | +TEST_SUSPEND_RESUME ); + } } +static data_t data; igt_main
@@ -425,7 +435,7 @@ igt_main }for (int pipe =0 ; pipe <I915_MAX_PIPES ; pipe++) -run_tests_for_pipe (&data, pipe); +run_tests_for_pipe_plane (&data, pipe); igt_fixture {igt_display_fini (&data.display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 19/29 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 | 203 ++++++++++++++++++++++++++++----------------- 1 file changed, 125 insertions(+), 78 deletions(-)
tests/kms_plane_multiple.c +125 -78
@@ -47,8 +47,8 @@ typedef struct {int drm_fd;igt_display_t display;igt_pipe_crc_t *pipe_crc; -igt_plane_t *plane[IGT_MAX_PLANES ]; -struct igt_fb fb[IGT_MAX_PLANES ]; +igt_plane_t **plane; +struct igt_fb *fb; } data_t; typedef struct {
@@ -92,20 +92,32 @@ static unsigned int get_vblank(int fd, int pipe, unsigned int flags)/* * Common code across all tests, acting on data_t */ -static void test_init (data_t *data,enum pipe pipe) +static void test_init (data_t *data,enum pipe pipe,int max_planes) { data->pipe_crc =igt_pipe_crc_new (pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + + data->plane =malloc (max_planes *sizeof (data->plane)); +igt_assert_f (data->plane !=NULL ,"Failed to allocate memory for planes\n" ); + + data->fb =malloc (max_planes *sizeof (struct igt_fb )); +igt_assert_f (data->fb !=NULL ,"Failed to allocate memory for FBs\n" ); }static void test_fini (data_t *data,igt_output_t *output,int max_planes) { -for (int i =IGT_PLANE_PRIMARY ; i <= max_planes; i++) -igt_plane_set_fb (data->plane[i],NULL ); +for (int i =0 ; i <= max_planes; i++) { +igt_plane_t *plane = data->plane[i]; +if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; +igt_plane_set_fb (plane,NULL ); + }/* reset the constraint on the pipe */ igt_output_set_pipe (output,PIPE_ANY );igt_pipe_crc_free (data->pipe_crc); +free (data->plane); +free (data->fb); } static void
@@ -113,11 +125,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);
@@ -125,9 +139,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 );
@@ -150,29 +164,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);
@@ -180,37 +200,49 @@ 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)); + y =malloc (pipe->n_planes *sizeof (*y)); + size =malloc (pipe->n_planes *sizeof (*size)); mode =igt_output_get_mode (output);/* planes with random positions */ - x[IGT_PLANE_PRIMARY ] =0 ; - y[IGT_PLANE_PRIMARY ] =0 ; -for (i =IGT_PLANE_2 ; i <= max_planes; i++) { -if (i ==IGT_PLANE_CURSOR ) + x[primary->index] =0 ; + y[primary->index] =0 ; +for (i =1 ; i <= max_planes; i++) { +igt_plane_t *plane =igt_output_get_plane (output, i); + +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) size[i] =SIZE_CURSOR ; +else if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) +continue ;else size[i] =SIZE_PLANE ; x[i] =rand () % (mode->hdisplay - size[i]); y[i] =rand () % (mode->vdisplay - size[i]); - data->plane[i] =igt_output_get_plane (output, i); + data->plane[i] = plane;igt_create_color_fb (data->drm_fd, size[i], size[i], - data->plane[i]->is_cursor ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , - data->plane[i]->is_cursor ?LOCAL_DRM_FORMAT_MOD_NONE : tiling, + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?DRM_FORMAT_ARGB8888 :DRM_FORMAT_XRGB8888 , + data->plane[i]->type ==DRM_PLANE_TYPE_CURSOR ?LOCAL_DRM_FORMAT_MOD_NONE : tiling, color->red, color->green, color->blue, &data->fb[i]);
@@ -219,10 +251,10 @@ prepare_planes(data_t *data, enum pipe pipe, color_t *color, }/* primary plane */ - data->plane[IGT_PLANE_PRIMARY ] =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); -create_fb_for_mode_position (data, mode, color, x, y, + data->plane[primary->index] = primary; +create_fb_for_mode_position (data, output, mode, color, x, y, size, size, tiling, max_planes); -igt_plane_set_fb (data->plane[IGT_PLANE_PRIMARY ], &data->fb[IGT_PLANE_PRIMARY ]); +igt_plane_set_fb (data->plane[primary->index], &data->fb[primary->index]); } static void
@@ -254,7 +286,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,igt_output_name (output),kmstest_pipe_name (pipe), max_planes, info, opt.seed); -test_init (data, pipe); +test_init (data, pipe, max_planes);test_grab_crc (data, output, pipe, true, &blue, tiling, &test.reference_crc);
@@ -318,7 +350,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,igt_output_name (output),kmstest_pipe_name (pipe), max_planes, info, opt.seed); -test_init (data, pipe); +test_init (data, pipe, max_planes);test_grab_crc (data, output, pipe, false, &blue, tiling, &test.reference_crc);
@@ -387,54 +419,71 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int max_planes, }static void -run_tests_for_pipe_plane (data_t *data,enum pipe pipe,int max_planes) +run_tests_for_pipe_plane (data_t *data,enum pipe pipe) { -igt_subtest_f ("legacy-pipe-%s-tiling-none-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_DRM_FORMAT_MOD_NONE ); - -igt_subtest_f ("atomic-pipe-%s-tiling-none-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-x-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("atomic-pipe-%s-tiling-x-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_X_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-y-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, -LOCAL_I915_FORMAT_MOD_Y_TILED ); - -igt_subtest_f ("atomic-pipe-%s-tiling-y-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, -LOCAL_I915_FORMAT_MOD_Y_TILED ); - -igt_subtest_f ("legacy-pipe-%s-tiling-yf-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, false, max_planes, - LOCAL_I915_FORMAT_MOD_Yf_TILED); - -igt_subtest_f ("atomic-pipe-%s-tiling-yf-planes-%d" , - kmstest_pipe_name(pipe), max_planes) -test_plane_position (data, pipe, true, max_planes, - LOCAL_I915_FORMAT_MOD_Yf_TILED); -} +igt_subtest_f ("legacy-pipe-%s-tiling-none-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_DRM_FORMAT_MOD_NONE ); + } -static void -run_tests_for_pipe (data_t *data,enum pipe pipe) -{ -for (int planes =IGT_PLANE_PRIMARY ; planes <IGT_MAX_PLANES ; planes++) -run_tests_for_pipe_plane (data, pipe, planes); +igt_subtest_f ("atomic-pipe-%s-tiling-none-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-x-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-x-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_X_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-y-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, +LOCAL_I915_FORMAT_MOD_Y_TILED ); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-y-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, +LOCAL_I915_FORMAT_MOD_Y_TILED ); + } + +igt_subtest_f ("legacy-pipe-%s-tiling-yf-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, false, planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); + } + +igt_subtest_f ("atomic-pipe-%s-tiling-yf-planes" , + kmstest_pipe_name(pipe)) { +int n_planes = data->display.pipes[pipe].n_planes; +for (int planes =0 ; planes < n_planes; planes++) +test_plane_position (data, pipe, true, planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); + } }static data_t data;
@@ -481,15 +530,13 @@ int main(int argc, char *argv[]) igt_fixture { data.drm_fd =drm_open_driver_master (DRIVER_INTEL ); -kmstest_set_vt_graphics_mode (); -igt_require_pipe_crc ();igt_display_init (&data.display, data.drm_fd); }for (int pipe =0 ; pipe <I915_MAX_PIPES ; pipe++) -run_tests_for_pipe (&data, pipe); +run_tests_for_pipe_plane (&data, pipe); igt_fixture {igt_display_fini (&data.display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 20/29 tests/kms_plane_scaling: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_plane_scaling.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/kms_plane_scaling.c +7 -7
@@ -85,10 +85,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,* there's no way (that works) to light up a pipe with only a sprite * plane enabled at the moment. */ -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data->fb1); }
@@ -128,10 +128,10 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) data->fb_id3 =0 ; } -if (!plane->is_primary) { +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary; - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL ); }
@@ -207,7 +207,7 @@ static void test_plane_scaling(data_t *d)igt_assert (d->fb_id3);/* Set up display with plane 1 */ - d->plane1 =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + d->plane1 =igt_output_get_plane (output,1 );prepare_crtc (d, output, pipe, d->plane1, mode,COMMIT_UNIVERSAL );if (primary_plane_scaling) {
@@ -227,7 +227,7 @@ static void test_plane_scaling(data_t *d) }/* Set up fb2->plane2 mapping. */ - d->plane2 =igt_output_get_plane (output,IGT_PLANE_2 ); + d->plane2 =igt_output_get_plane (output,2 );igt_plane_set_fb (d->plane2, &d->fb2);/* 2nd plane windowed */
@@ -263,7 +263,7 @@ static void test_plane_scaling(data_t *d) }/* Set up fb3->plane3 mapping. */ - d->plane3 =igt_output_get_plane (output,IGT_PLANE_3 ); + d->plane3 =igt_output_get_plane (output,3 );igt_plane_set_fb (d->plane3, &d->fb3);/* 3rd plane windowed - no scaling */
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 21/29 tests/kms_properties: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_properties.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_properties.c +3 -3
@@ -38,7 +38,7 @@ static void prepare_pipe(igt_display_t *display, enum pipe pipe, igt_output_t *oigt_output_set_pipe (output, pipe); -igt_plane_set_fb (igt_output_get_plane (output,IGT_PLANE_PRIMARY ), fb); +igt_plane_set_fb (igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ), fb);igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); }
@@ -163,8 +163,8 @@ static void run_plane_property_tests(igt_display_t *display, enum pipe pipe, igtprepare_pipe (display, pipe, output, &fb);for_each_plane_on_pipe (display, pipe, plane) { -igt_info ("Testing plane properties on %s.%s (output: %s)\n" , -kmstest_pipe_name (pipe),kmstest_plane_name (plane->index), output->name); +igt_info ("Testing plane properties on %s.#%d-%s (output: %s)\n" , +kmstest_pipe_name (pipe), plane->index,kmstest_plane_type_name (plane->type), output->name);test_properties (display->drm_fd,DRM_MODE_OBJECT_PLANE , plane->drm_plane->plane_id, atomic); }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 22/29 tests/kms_psr_sink_crc: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_psr_sink_crc.c | 52 +++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 29 deletions(-)
tests/kms_psr_sink_crc.c +23 -29
@@ -34,12 +34,6 @@ bool running_with_psr_disabled;#define CRC_BLACK "000000000000" -enum planes { -PRIMARY , -SPRITE , -CURSOR , -}; -enum operations {PAGE_FLIP ,MMAP_GTT ,
@@ -69,7 +63,7 @@ static const char *op_str(enum operations op) typedef struct { int drm_fd; - enum planes test_plane; + int test_plane; enum operations op; uint32_t devid; uint32_t crtc_id;
@@ -313,9 +307,9 @@ static void run_test(data_t *data)/* Setting a secondary fb/plane */ switch (data->test_plane) { -case PRIMARY :default : test_plane = data->primary;break ; -case SPRITE : test_plane = data->sprite;break ; -case CURSOR : test_plane = data->cursor;break ; +case DRM_PLANE_TYPE_PRIMARY :default : test_plane = data->primary;break ; +case DRM_PLANE_TYPE_OVERLAY : test_plane = data->sprite;break ; +case DRM_PLANE_TYPE_CURSOR : test_plane = data->cursor;break ; }igt_plane_set_fb (test_plane, &data->fb_white);igt_display_commit (&data->display);
@@ -323,7 +317,7 @@ static void run_test(data_t *data)/* Confirm it is not Green anymore */ igt_assert (wait_psr_entry (data));get_sink_crc (data, ref_crc); -if (data->test_plane ==PRIMARY ) +if (data->test_plane ==DRM_PLANE_TYPE_PRIMARY )assert_or_manual (!is_green (ref_crc),"screen WHITE" );else assert_or_manual (!is_green (ref_crc),"GREEN background with WHITE box" );
@@ -355,7 +349,7 @@ static void run_test(data_t *data)/* Printing white on white so the screen shouldn't change */ memset (ptr,0xff , data->mod_size);get_sink_crc (data, crc); -if (data->test_plane ==PRIMARY ) +if (data->test_plane ==DRM_PLANE_TYPE_PRIMARY )assert_or_manual (strcmp (ref_crc, crc) ==0 ,"screen WHITE" );else assert_or_manual(strcmp(ref_crc, crc) == 0,
@@ -406,9 +400,9 @@ static void run_test(data_t *data)static void test_cleanup (data_t *data) {igt_plane_set_fb (data->primary,NULL ); -if (data->test_plane ==SPRITE ) +if (data->test_plane ==DRM_PLANE_TYPE_OVERLAY )igt_plane_set_fb (data->sprite,NULL ); -if (data->test_plane ==CURSOR ) +if (data->test_plane ==DRM_PLANE_TYPE_CURSOR )igt_plane_set_fb (data->cursor,NULL );igt_display_commit (&data->display);
@@ -428,7 +422,7 @@ static void setup_test_plane(data_t *data)0.0 ,1.0 ,0.0 , &data->fb_green); - data->primary =igt_output_get_plane (data->output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary,NULL ); white_h = data->mode->hdisplay;
@@ -439,16 +433,16 @@ static void setup_test_plane(data_t *data) data->mod_stride = white_h *4 ;switch (data->test_plane) { -case SPRITE : - data->sprite =igt_output_get_plane (data->output, -IGT_PLANE_2 ); +case DRM_PLANE_TYPE_OVERLAY : + data->sprite =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_OVERLAY );igt_plane_set_fb (data->sprite,NULL );/* To make it different for human eyes let's make * sprite visible in only one quarter of the primary */ white_h = white_h/2 ; white_v = white_v/2 ; -case PRIMARY : +case DRM_PLANE_TYPE_PRIMARY : igt_create_color_fb(data->drm_fd, white_h, white_v, DRM_FORMAT_XRGB8888,
@@ -456,9 +450,9 @@ static void setup_test_plane(data_t *data)1.0 ,1.0 ,1.0 , &data->fb_white);break ; -case CURSOR : - data->cursor =igt_output_get_plane (data->output, -IGT_PLANE_CURSOR ); +case DRM_PLANE_TYPE_CURSOR : + data->cursor =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_CURSOR );igt_plane_set_fb (data->cursor,NULL );create_cursor_fb (data);igt_plane_set_position (data->cursor,0 ,0 );
@@ -535,7 +529,7 @@ int main(int argc, char *argv[])for (op =PAGE_FLIP ; op <=RENDER ; op++) { igt_subtest_f("primary_%s", op_str(op)) { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -546,7 +540,7 @@ int main(int argc, char *argv[])for (op =MMAP_GTT ; op <=PLANE_ONOFF ; op++) { igt_subtest_f("sprite_%s", op_str(op)) { - data.test_plane =SPRITE ; + data.test_plane =DRM_PLANE_TYPE_OVERLAY ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -557,7 +551,7 @@ int main(int argc, char *argv[])for (op =MMAP_GTT ; op <=PLANE_ONOFF ; op++) { igt_subtest_f("cursor_%s", op_str(op)) { - data.test_plane =CURSOR ; + data.test_plane =DRM_PLANE_TYPE_CURSOR ; data.op = op;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -567,7 +561,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("dpms_off_psr_active") { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op =RENDER ;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -579,7 +573,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("dpms_off_psr_exit") { - data.test_plane =SPRITE ; + data.test_plane =DRM_PLANE_TYPE_OVERLAY ; data.op =PLANE_ONOFF ;setup_test_plane (&data);
@@ -591,7 +585,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("suspend_psr_active") { - data.test_plane =PRIMARY ; + data.test_plane =DRM_PLANE_TYPE_PRIMARY ; data.op =PAGE_FLIP ;setup_test_plane (&data);igt_assert (wait_psr_entry (&data));
@@ -604,7 +598,7 @@ int main(int argc, char *argv[]) } igt_subtest_f("suspend_psr_exit") { - data.test_plane =CURSOR ; + data.test_plane =DRM_PLANE_TYPE_CURSOR ; data.op =PLANE_ONOFF ;setup_test_plane (&data);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 23/29 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
@@ -123,7 +123,7 @@ static bool prepare_crtc(data_t *data)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &data->fb[0]); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (data->primary, &data->fb[0 ]);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 24/29 tests/kms_rmfb: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_rmfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_rmfb.c +1 -1
@@ -83,7 +83,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo* later on. */ for_each_plane_on_pipe (&data->display, pipe, plane) { -if (plane->is_cursor) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) {igt_plane_set_fb (plane, &argb_fb);igt_fb_set_size (&argb_fb, plane, cursor_width, cursor_height);igt_plane_set_size (plane, cursor_width, cursor_height);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 26/29 tests/kms_sink_crc_basic: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_sink_crc_basic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_sink_crc_basic.c +1 -1
@@ -138,7 +138,7 @@ static void run_test(data_t *data)1.0 ,0.0 ,0.0 , &data->fb_red); - data->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + data->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );basic_sink_crc_check (data);return ;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 27/29 tests/kms_universal_plane: Add support for dynamic number of planes
In reply to Robert FossAdd changes reflecting the new support for dynamic number of planes per pipe.
--- tests/kms_universal_plane.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
tests/kms_universal_plane.c +9 -9
@@ -148,16 +148,16 @@ functional_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)* boolean and show up in userspace as the wrong type. */ for (i =0 ; i < display->pipes[pipe].n_planes; i++) -if (display->pipes[pipe].planes[i].is_primary) +if (display->pipes[pipe].planes[i].type ==DRM_PLANE_TYPE_PRIMARY ) num_primary++; -else if (display->pipes[pipe].planes[i].is_cursor) +else if (display->pipes[pipe].planes[i].type ==DRM_PLANE_TYPE_CURSOR ) num_cursor++;igt_assert_eq (num_primary,1 );igt_assert_lte (num_cursor,1 ); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - sprite =igt_output_get_plane (output,IGT_PLANE_2 ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + sprite =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );if (!sprite) {functional_test_fini (&test, output);igt_skip ("No sprite plane available\n" );
@@ -369,7 +369,7 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)sanity_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Use legacy API to set a mode with a blue FB */ igt_plane_set_fb (primary, &test.blue_fb);
@@ -480,7 +480,7 @@ pageflip_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)pageflip_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Use legacy API to set a mode with a blue FB */ igt_plane_set_fb (primary, &test.blue_fb);
@@ -602,8 +602,8 @@ cursor_leak_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output) &cursor_fb[i]); } - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); - cursor =igt_output_get_plane (output,IGT_PLANE_CURSOR ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); + cursor =igt_output_get_plane_type (output,DRM_PLANE_TYPE_CURSOR );if (!primary || !cursor) {cursor_leak_test_fini (data, output, &background_fb, cursor_fb);igt_skip ("Primary and/or cursor are unavailable\n" );
@@ -706,7 +706,7 @@ gen9_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)gen9_test_init (&test, output, pipe); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );/* Start with a full-screen primary plane */ igt_plane_set_fb (primary, &test.biggreen_fb);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 28/29 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
@@ -83,7 +83,7 @@ static bool 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);
@@ -100,7 +100,7 @@ static void cleanup_crtc(data_t *data, int fd, igt_output_t *output)igt_remove_fb (fd, &data->primary_fb); - primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary,NULL );igt_output_set_pipe (output,PIPE_ANY );
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 29/29 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
@@ -175,7 +175,7 @@ static bool prepare_crtc(gpu_process_t *gpu)DRM_FORMAT_XRGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , 1.0, 1.0, 1.0, &gpu->fb); - gpu->primary =igt_output_get_plane (output,IGT_PLANE_PRIMARY ); + gpu->primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (gpu->primary, &gpu->fb);igt_display_commit (display);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 25/29 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,16 +97,17 @@ 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);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)
@@ -153,7 +154,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 ;
@@ -205,10 +206,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 ); }
@@ -235,7 +236,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;
@@ -246,10 +247,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);
@@ -320,7 +321,7 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type)igt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); } -static void test_plane_rotation_ytiled_obj (data_t *data,enum igt_plane plane_type) +static void test_plane_rotation_ytiled_obj (data_t *data,int plane_type) {igt_display_t *display = &data->display;uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ;
@@ -337,13 +338,13 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_tyigt_require (output !=NULL && output->valid == true); - 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)
@@ -386,7 +387,7 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_tyigt_assert (ret ==0 ); } -static void test_plane_rotation_exhaust_fences (data_t *data,enum igt_plane plane_type) +static void test_plane_rotation_exhaust_fences (data_t *data,int plane_type) {igt_display_t *display = &data->display;uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ;
@@ -405,13 +406,13 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane planigt_require (output !=NULL && output->valid == true); - 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)
@@ -511,41 +512,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") {
@@ -553,7 +554,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") {
@@ -562,7 +563,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") {
@@ -570,7 +571,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") {
@@ -578,18 +579,18 @@ 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") {igt_require (gen >=9 ); data.rotation =IGT_ROTATION_90 ; -test_plane_rotation_ytiled_obj (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation_ytiled_obj (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_subtest_f("exhaust-fences") {igt_require (gen >=9 ); -test_plane_rotation_exhaust_fences (&data,IGT_PLANE_PRIMARY ); +test_plane_rotation_exhaust_fences (&data,DRM_PLANE_TYPE_PRIMARY ); } igt_fixture {
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t rfc 01/29] lib/igt_debugfs: Prevent buffer overflow
In reply to Robert FossRobert Foss schreef op wo 11-01-2017 om 15:41 [-0500]:
Quoted 2 lines
buf array may overflow with when writing '\0' if
MAX_LINE_LENbytes are read duringread().
How?
char buf[MAX_LINE_LEN + 1];
Quoted 26 lines
Signed-off-by Robert Foss <[email protected]>---
lib/igt_debugfs.c | 8 +++++---1 file changed, 5 insertions(+), 3 deletions(-)lib/igt_debugfs.c +0
-0@@ -594,13 +594,15 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) read_len = MAX_LINE_LEN;
igt_set_timeout(5, "CRC reading");lib/igt_debugfs.c +1
-1- bytes_read =read (pipe_crc->crc_fd, &buf, read_len); + bytes_read =read (pipe_crc->crc_fd, &buf, read_len -1 );
igt_reset_timeout();lib/igt_debugfs.c +1
-1-if (bytes_read <0 && errno ==EAGAIN ) { +if (bytes_read <0 && errno ==EAGAIN )
igt_assert(pipe_crc->flags & O_NONBLOCK);lib/igt_debugfs.c +2
-0+ +if (bytes_read <0 )
bytes_read= 0;lib/igt_debugfs.c +1
-1- } +
Quoted 4 lines
buf[bytes_read] = '\0';
if (bytes_read&& !pipe_crc_init_from_string(pipe_crc, out, buf))
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t rfc 01/29] lib/igt_debugfs: Prevent buffer overflow
Quoted 6 lines · Maarten
Robert Foss schreef op wo 11-01-2017 om 15:41 [-0500]:
Quoted 2 lines
buf array may overflow with when writing '\0' if
MAX_LINE_LENbytes are read duringread().How?
char buf[MAX_LINE_LEN + 1];
I actually missed the + 1, but parts of the commit are still relevant though, as the errno at least in theory could be != EAGAIN.
So I'd like to keep the below check, to prevent compiler warnings. if (bytes_read < 0)
Sounds ok?
Rob.
Quoted 29 lines
Quoted 29 lines
Signed-off-by Robert Foss <[email protected]>--- lib/igt_debugfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)lib/igt_debugfs.c +5
-3@@ -594,13 +594,15 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) read_len =MAX_LINE_LEN ;igt_set_timeout (5 ,"CRC reading" ); - bytes_read =read (pipe_crc->crc_fd, &buf, read_len); + bytes_read =read (pipe_crc->crc_fd, &buf, read_len -1 );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) { +if (bytes_read <0 && errno ==EAGAIN )igt_assert (pipe_crc->flags &O_NONBLOCK ); + +if (bytes_read <0 ) bytes_read =0 ; - } + buf[bytes_read] ='\0' ;
Quoted 2 lines
Quoted 2 lines
if (
bytes_read&& !pipe_crc_init_from_string(pipe_crc, out,
buf))
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t rfc 01/29] lib/igt_debugfs: Prevent buffer overflow
Robert Foss schreef op do 12-01-2017 om 11:30 [-0500]:
Quoted 11 lines · Maarten
Quoted 8 lines
Robert Foss schreef op wo 11-01-2017 om 15:41 [-0500]:
Quoted 3 lines
buf array may overflow with when writing '\0' if
MAX_LINE_LENbytes are read duringread().How?
char buf[MAX_LINE_LEN + 1];
Quoted 8 lines
I actually missed the + 1, but parts of the commit are still relevant
though, as the errno at least in theory could be != EAGAIN.So I'd like to keep the below check, to prevent compiler warnings. if (
bytes_read< 0)Sounds ok?
Yes. :)
Quoted 34 lines
Rob.
Quoted 32 lines
Quoted 32 lines
Signed-off-by Robert Foss <[email protected]>---
lib/igt_debugfs.c | 8 +++++---1 file changed, 5 insertions(+), 3 deletions(-)lib/igt_debugfs.c +5
-3@@ -594,13 +594,15 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) read_len = MAX_LINE_LEN; igt_set_timeout(5, "CRC reading"); - bytes_read =read (pipe_crc->crc_fd, &buf, read_len); + bytes_read =read (pipe_crc->crc_fd, &buf, read_len -1 ); igt_reset_timeout(); -if (bytes_read <0 && errno ==EAGAIN ) { +if (bytes_read <0 && errno ==EAGAIN ) igt_assert(pipe_crc->flags & O_NONBLOCK); + +if (bytes_read <0 ) bytes_read = 0; - } + buf[bytes_read] = '\0';
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
if (
bytes_read&& !pipe_crc_init_from_string(pipe_crc, out,
buf))
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx