tests/kms_*: Use correct DRM context version
PATCH 1/1 tests/kms_*: Use correct DRM context version
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. igt was blindly asserting it supported whatever version that may be, even if it actually didn't.
With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the page_flip_handler2 vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.
Set the version as 2, which should be bumped only with the appropriate version checks.
--- tests/kms_atomic_transition.c | 2 +- tests/kms_flip.c | 2 +- tests/kms_flip_tiling.c | 2 +- tests/kms_frontbuffer_tracking.c | 2 +- tests/kms_mmio_vs_cs_flip.c | 2 +- tests/kms_rotation_crc.c | 2 +- tests/kms_universal_plane.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
tests/kms_atomic_transition.c +1 -1
@@ -146,7 +146,7 @@ static void ev_page_flip(int fd, unsigned seq, unsigned tv_sec, unsigned tv_usec }static drmEventContext drm_events = { - .version =DRM_EVENT_CONTEXT_VERSION , + .version =2 , .page_flip_handler = ev_page_flip };
tests/kms_flip.c +1 -1
@@ -1072,7 +1072,7 @@ static unsigned int wait_for_events(struct test_output *o)igt_assert (event_mask);memset (&evctx,0 ,sizeof evctx); - evctx.version =DRM_EVENT_CONTEXT_VERSION ; + evctx.version =2 ; evctx.vblank_handler = vblank_handler; evctx.page_flip_handler = page_flip_handler;
tests/kms_flip_tiling.c +1 -1
@@ -64,7 +64,7 @@ static void pipe_crc_free(void)static void wait_for_pageflip (int fd) { -drmEventContext evctx = { .version =DRM_EVENT_CONTEXT_VERSION }; +drmEventContext evctx = { .version =2 };struct timeval timeout = { .tv_sec =0 , .tv_usec =50000 };fd_set fds;int ret;
tests/kms_frontbuffer_tracking.c +1 -1
@@ -2278,7 +2278,7 @@ static void wait_flip_event(void)drmEventContext evctx;struct pollfd pfd; - evctx.version =DRM_EVENT_CONTEXT_VERSION ; + evctx.version =2 ; evctx.vblank_handler =NULL ; evctx.page_flip_handler = flip_handler;
tests/kms_mmio_vs_cs_flip.c +1 -1
@@ -109,7 +109,7 @@ static void wait_for_flip(data_t *data, uint32_t flip_handle) .tv_usec = 0, };drmEventContext evctx = { - .version =DRM_EVENT_CONTEXT_VERSION , + .version =2 , .page_flip_handler = page_flip_handler, };fd_set fds;
tests/kms_rotation_crc.c +1 -1
@@ -233,7 +233,7 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)static void wait_for_pageflip (int fd) { -drmEventContext evctx = { .version =DRM_EVENT_CONTEXT_VERSION }; +drmEventContext evctx = { .version =2 };struct timeval timeout = { .tv_sec =0 , .tv_usec =50000 };fd_set fds;int ret;
tests/kms_universal_plane.c +1 -1
@@ -470,7 +470,7 @@ pageflip_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)pageflip_test_t test = { .data = data };igt_plane_t *primary;struct timeval timeout = { .tv_sec =0 , .tv_usec =500 }; -drmEventContext evctx = { .version =DRM_EVENT_CONTEXT_VERSION }; +drmEventContext evctx = { .version =2 };fd_set fds;int ret =0 ;
Signature · 6 lines
2.12.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Daniel Stone
DRM_EVENT_CONTEXT_VERSIONis the latest context version supported by whatever version of libdrm is present. igt was blindly asserting it supported whatever version that may be, even if it actually didn't.With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the
page_flip_handler2vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been.Set the version as 2, which should be bumped only with the appropriate version checks.
Thanks, pushed.
--
Petri Latvala
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx