Skip to content

Commit

Permalink
hwc: dont return from vsync thread when read fails.
Browse files Browse the repository at this point in the history
Read can return fail when the panel is off.
When read fails do not exit from the vsync thread,
continue with the vsync signal, as later there will
be correct vsync event from the driver

Change-Id: I0f145b93fe5d365eafb6b9e7661160f00f84db40
CRs-Fixed: 417529
  • Loading branch information
Arun Kumar K.R authored and arco committed Mar 23, 2013
1 parent d913a95 commit ea9ba60
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libhwcomposer/hwc_vsync.cpp
Expand Up @@ -47,7 +47,7 @@ static void *vsync_loop(void *param)
ctx->mFbDev->common.module);
char thread_name[64] = "hwcVsyncThread";
prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0);
setpriority(PRIO_PROCESS, 0,
setpriority(PRIO_PROCESS, 0,
HAL_PRIORITY_URGENT_DISPLAY + ANDROID_PRIORITY_MORE_FAVORABLE);

const int MAX_DATA = 64;
Expand Down Expand Up @@ -121,7 +121,7 @@ static void *vsync_loop(void *param)
ALOGE ("FATAL:%s:not able to open file:%s, %s", __FUNCTION__,
(fb1_vsync) ? vsync_timestamp_fb1 : vsync_timestamp_fb0,
strerror(errno));
return NULL;
continue;
}
for(int i = 0; i < MAX_RETRY_COUNT; i++) {
len = pread(fd_timestamp, vdata, MAX_DATA, 0);
Expand All @@ -138,9 +138,11 @@ static void *vsync_loop(void *param)
ALOGE ("FATAL:%s:not able to read file:%s, %s", __FUNCTION__,
(fb1_vsync) ? vsync_timestamp_fb1 : vsync_timestamp_fb0,
strerror(errno));
close (fd_timestamp);
fd_timestamp = -1;
return NULL;
// TODO
// continue;
// we need to continue from here as we dont have a valid vsync
// string, but in the current implementation, the SF needs a
// vsync signal to compose
}

// extract timestamp
Expand Down

0 comments on commit ea9ba60

Please sign in to comment.