osd: FBIO_WAITFORVSYNC expand to 64bit caused chrome crashed
authorpengcheng chen <pengcheng.chen@amlogic.com>
Tue, 29 May 2018 06:48:17 +0000 (14:48 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 30 May 2018 07:19:25 +0000 (00:19 -0700)
PD#167080: osd: FBIO_WAITFORVSYNC expand to 64bit caused chrome crashed

1. used FBIO_WAITFORVSYNC and FBIO_WAITFORVSYNC_64

Change-Id: Ia4a457f876fad24c6d1df60f3ea1b5fdc7f6bd8a
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_fb.h

index 3f3dea4..3a2195b 100644 (file)
@@ -721,7 +721,8 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
        u32 block_mode;
        u32 hwc_enable;
        int ret;
-       s64 vsync_timestamp;
+       s32 vsync_timestamp;
+       s64 vsync_timestamp_64;
        u32 flush_rate;
        int out_fen_fd;
        int xoffset, yoffset;
@@ -749,6 +750,7 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
                                sizeof(struct fb_sync_request_s));
                break;
        case FBIO_WAITFORVSYNC:
+       case FBIO_WAITFORVSYNC_64:
        case FBIOGET_OSD_SCALE_AXIS:
        case FBIOPUT_OSD_ORDER:
        case FBIOGET_OSD_ORDER:
@@ -1029,10 +1031,13 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 #endif
 
        case FBIO_WAITFORVSYNC:
-               vsync_timestamp = osd_wait_vsync_event();
-               ret = copy_to_user(argp, &vsync_timestamp, sizeof(s64));
+               vsync_timestamp = (s32)osd_wait_vsync_event();
+               ret = copy_to_user(argp, &vsync_timestamp, sizeof(s32));
+               break;
+       case FBIO_WAITFORVSYNC_64:
+               vsync_timestamp_64 = osd_wait_vsync_event();
+               ret = copy_to_user(argp, &vsync_timestamp_64, sizeof(s64));
                break;
-
        case FBIOPUT_OSD_CURSOR:
 #ifdef CONFIG_AMLOGIC_MEDIA_FB_OSD2_CURSOR
                osd_cursor(info, &cursor);
index c3a6c53..61ddc16 100644 (file)
@@ -29,7 +29,8 @@
 
 #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)
+#define FBIO_WAITFORVSYNC          _IOW('F', 0x20, __u32)
+#define FBIO_WAITFORVSYNC_64       _IOW('F', 0x21, __u32)
 
 struct osd_fb_dev_s {
        struct mutex lock;