u32 block_windows[8] = {0};
u32 block_mode;
u32 hwc_enable;
- unsigned long ret;
+ int ret;
+ s64 vsync_timestamp;
u32 flush_rate;
int out_fen_fd;
int xoffset, yoffset;
? -EFAULT : 0;
break;
#endif
+
case FBIO_WAITFORVSYNC:
- osd_wait_vsync_event();
- ret = copy_to_user(argp, &ret, sizeof(u32));
+ vsync_timestamp = osd_wait_vsync_event();
+ ret = copy_to_user(argp, &vsync_timestamp, sizeof(s64));
break;
+
case FBIOPUT_OSD_CURSOR:
#ifdef CONFIG_AMLOGIC_MEDIA_FB_OSD2_CURSOR
osd_cursor(info, &cursor);
#define OSD_COUNT (HW_OSD_COUNT)
#define INVALID_BPP_ITEM {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
struct osd_fb_dev_s {
struct mutex lock;
#include <linux/file.h>
#include <linux/list.h>
#include <linux/kthread.h>
+#include <linux/ktime.h>
/* Android Headers */
/* Amlogic sync headers */
static DECLARE_WAIT_QUEUE_HEAD(osd_vsync_wq);
static bool vsync_hit;
+static bool user_vsync_hit;
static bool osd_update_window_axis;
static int osd_afbc_dec_enable;
static int ext_canvas_id[HW_OSD_COUNT];
#endif
static int pxp_mode;
-
+s64 timestamp;
static unsigned int osd_h_filter_mode = 1;
#define CANVAS_ALIGNED(x) (((x) + 31) & ~31)
static inline void wait_vsync_wakeup(void)
{
- vsync_hit = true;
- wake_up_interruptible(&osd_vsync_wq);
+ user_vsync_hit = vsync_hit = true;
+ wake_up_interruptible_all(&osd_vsync_wq);
}
void osd_update_vsync_hit(void)
{
- if (!vsync_hit) {
+ ktime_t stime;
+
+ stime = ktime_get();
+ timestamp = stime.tv64;
#ifdef FIQ_VSYNC
fiq_bridge_pulse_trigger(&osd_hw.fiq_handle_item);
#else
wait_vsync_wakeup();
#endif
- }
}
/* the return stride unit is 128bit(16bytes) */
}
}
-s32 osd_wait_vsync_event(void)
+s64 osd_wait_vsync_event(void)
{
unsigned long timeout;
- vsync_hit = false;
- /* waiting for 1000ms. */
- timeout = msecs_to_jiffies(1000);
- wait_event_interruptible_timeout(osd_vsync_wq, vsync_hit, timeout);
+ user_vsync_hit = false;
- return 0;
+ if (pxp_mode)
+ timeout = msecs_to_jiffies(50);
+ else
+ timeout = msecs_to_jiffies(1000);
+
+ /* waiting for 10ms. */
+ wait_event_interruptible_timeout(osd_vsync_wq, user_vsync_hit, timeout);
+
+ return timestamp;
}
static int is_interlaced(struct vinfo_s *vinfo)
struct sync_req_render_s *request,
u32 phys_addr);
extern int osd_sync_do_hwc(u32 width, u32 height);
-extern s32 osd_wait_vsync_event(void);
+extern s64 osd_wait_vsync_event(void);
extern void osd_cursor_hw(u32 index, s16 x, s16 y, s16 xstart, s16 ystart,
u32 osd_w, u32 osd_h);
extern void osd_init_scan_mode(void);