Video playback in linaro using cedar and libhybris stutters and sometimes the
frame rate drops very low.
There may be an issue in disp_video.c as the included changes sort the issue
for me.
My possibly flawed reasoning goes something like...
Its not a good idea to update display_cnt in Hal_Set_Frame called during
blanking and BSP_disp_video_set_fb which is called from an IOCTL. The value is
incremented in Hal_Set_Frame and may have been updated (to 0) by a call to
BSP_disp_video_set_fb. The result is calls to ioctl(fd,
DISP_CMD_VIDEO_GET_FRAME_ID, args) never returning the updated frame number
(this I have observed).
Hope this is of some help.
Any thoughts appreciated.
Kind regards,
Phil
diff --git a/drivers/video/sunxi/disp/disp_video.c
b/drivers/video/sunxi/disp/disp_video.c
index aa07364..460def8 100644
--- a/drivers/video/sunxi/disp/disp_video.c
+++ b/drivers/video/sunxi/disp/disp_video.c
@@ -144,11 +144,19 @@ static inline __s32 Hal_Set_Frame(__u32 sel, __u32
tcon_index, __u32 id)
return DIS_FAIL;
}
- if (g_video[sel][id].display_cnt == 0) {
+ __u32 new_id = g_video[sel][id].video_new.id;
+ __u32 cur_id = g_video[sel][id].video_cur.id;
+
+// if (g_video[sel][id].display_cnt == 0) {
+ if (cur_id != new_id) {
g_video[sel][id].pre_frame_addr0 =
g_video[sel][id].video_cur.addr[0];
+
+ g_video[sel][id].video_new.id = cur_id;
+
memcpy(&g_video[sel][id].video_cur, &g_video[sel][id].video_new,
sizeof(__disp_video_fb_t));
+ g_video[sel][id].display_cnt = 0;
}
if (gdisp.screen[sel].layer_manage[id].para.mode ==
@@ -382,6 +390,9 @@ static inline __s32 Hal_Set_Frame(__u32 sel, __u32
tcon_index, __u32 id)
g_video[sel][id].video_cur.addr_right[1];
gdisp.screen[sel].layer_manage[id].para.fb.trd_right_addr[2] =
g_video[sel][id].video_cur.addr_right[2];
+
+ g_video[sel][id].video_cur.id = new_id;
+
return DIS_SUCCESS;
}
@@ -408,7 +419,7 @@ __s32 BSP_disp_video_set_fb(__u32 sel, __u32 hid,
__disp_video_fb_t *in_addr)
memcpy(&g_video[sel][hid].video_new, in_addr,
sizeof(__disp_video_fb_t));
g_video[sel][hid].have_got_frame = TRUE;
- g_video[sel][hid].display_cnt = 0;
+// g_video[sel][hid].display_cnt = 0;
return DIS_SUCCESS;
} else
@@ -462,6 +473,7 @@ __s32 BSP_disp_video_start(__u32 sel, __u32 hid)
if (gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) {
memset(&g_video[sel][hid], 0, sizeof(frame_para_t));
g_video[sel][hid].video_cur.id = -1;
+ g_video[sel][hid].video_new.id = -1;
g_video[sel][hid].enable = TRUE;
video_enhancement_start(sel, hid);
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.