wait vblanks according to the pipe. 45/148445/2
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 8 Sep 2017 02:47:30 +0000 (11:47 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 8 Sep 2017 03:06:55 +0000 (12:06 +0900)
Change-Id: Iaafb156355145c9ed14e82b975a4875537cdd852

src/tdm_nexell_display.c

index 511dd040a02ff76f5f9d91db2a50d69d58c5b649..b70ceba4b3e09f31f3c147b695ae9cc43f4e299a 100644 (file)
@@ -146,8 +146,10 @@ _tdm_nexell_display_get_cur_msc (int fd, int pipe, uint *msc)
        drmVBlank vbl;
 
        vbl.request.type = DRM_VBLANK_RELATIVE;
-       if (pipe > 0)
+       if (pipe == 1)
                vbl.request.type |= DRM_VBLANK_SECONDARY;
+       else if (pipe > 1)
+               vbl.request.type |= pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
 
        vbl.request.sequence = 0;
        if (drmWaitVBlank(fd, &vbl)) {
@@ -167,15 +169,17 @@ _tdm_nexell_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data)
        drmVBlank vbl;
 
        vbl.request.type =  DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT;
-       if (pipe > 0)
+       if (pipe == 1)
                vbl.request.type |= DRM_VBLANK_SECONDARY;
+       else if (pipe > 1)
+               vbl.request.type |= pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
 
        vbl.request.sequence = *target_msc;
        vbl.request.signal = (unsigned long)(uintptr_t)data;
 
        if (drmWaitVBlank(fd, &vbl)) {
-               *target_msc = 0;
                TDM_ERR("wait vblank failed: %m");
+               *target_msc = 0;
                return TDM_ERROR_OPERATION_FAILED;
        }