tdm_client: add log to check vblank list validation 63/217063/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 6 Nov 2019 05:05:56 +0000 (14:05 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 6 Nov 2019 05:06:01 +0000 (14:06 +0900)
Change-Id: I27bee79bf7f5b7bd87dd0815c9fbf4b0f897439b
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
client/tdm_client.c

index bde7a1f..543805c 100644 (file)
@@ -225,6 +225,17 @@ _tdm_client_vblank_cb_stamp(void *data, struct wl_tdm_vblank *wl_tdm_vblank, uin
 }
 
 /* LCOV_EXCL_START */
+static int
+_tdm_client_vblank_wait_list_validation_check(tdm_private_client_vblank *private_vblank)
+{
+       if (private_vblank->wait_list.next == NULL || private_vblank->wait_list.prev == NULL) {
+               TDM_ERR("vblank(%p) wait_list broken. prev(%p), next(%p) pid(%d)",
+                       private_vblank, private_vblank->wait_list.prev, private_vblank->wait_list.next, getpid());
+       }
+
+       return 0;
+}
+
 static void
 _tdm_client_vblank_cb_done(void *data, struct wl_tdm_vblank *wl_tdm_vblank,
                                                   uint32_t req_id, uint32_t sequence, uint32_t tv_sec,
@@ -243,6 +254,8 @@ _tdm_client_vblank_cb_done(void *data, struct wl_tdm_vblank *wl_tdm_vblank,
        TDM_DBG("vblank(%p) req_id(%u) sequence(%u) time(%.6f)",
                        private_vblank, req_id, sequence, TDM_TIME(tv_sec, tv_usec));
 
+       _tdm_client_vblank_wait_list_validation_check(private_vblank);
+
        LIST_FOR_EACH_ENTRY(w, &private_vblank->wait_list, link) {
                if (w->req_id != req_id)
                        continue;