notaz.gp2x.de
/
sdl_omap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
79b5de0
)
use the pandora's vsync ioctl when available
author
notaz
<notasas@gmail.com>
Sun, 28 Feb 2016 01:38:39 +0000
(
03:38
+0200)
committer
notaz
<notasas@gmail.com>
Sun, 28 Feb 2016 01:38:39 +0000
(
03:38
+0200)
src/video/omapdss/linux/fbdev.c
patch
|
blob
|
blame
|
history
diff --git
a/src/video/omapdss/linux/fbdev.c
b/src/video/omapdss/linux/fbdev.c
index
7e8a962
..
d39263c
100644
(file)
--- a/
src/video/omapdss/linux/fbdev.c
+++ b/
src/video/omapdss/linux/fbdev.c
@@
-24,6
+24,10
@@
#define PFX "fbdev: "
#define PFX "fbdev: "
+#ifndef OMAPFB_WAITFORVSYNC_FRAME
+#define OMAPFB_WAITFORVSYNC_FRAME _IOWR('O', 70, int)
+#endif
+
struct vout_fbdev {
int fd;
void *mem;
struct vout_fbdev {
int fd;
void *mem;
@@
-36,6
+40,8
@@
struct vout_fbdev {
int top_border, bottom_border;
void *mem_saved;
size_t mem_saved_size;
int top_border, bottom_border;
void *mem_saved;
size_t mem_saved_size;
+ unsigned long vsync_ioctl;
+ int vsync_arg;
};
void *vout_fbdev_flip(struct vout_fbdev *fbdev)
};
void *vout_fbdev_flip(struct vout_fbdev *fbdev)
@@
-61,8
+67,8
@@
void *vout_fbdev_flip(struct vout_fbdev *fbdev)
void vout_fbdev_wait_vsync(struct vout_fbdev *fbdev)
{
void vout_fbdev_wait_vsync(struct vout_fbdev *fbdev)
{
- i
nt arg = 0;
-
ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &
arg);
+ i
f (fbdev->vsync_ioctl != 0)
+
ioctl(fbdev->fd, fbdev->vsync_ioctl, &fbdev->vsync_
arg);
}
/* it is recommended to call vout_fbdev_clear() before this */
}
/* it is recommended to call vout_fbdev_clear() before this */
@@
-231,8
+237,18
@@
struct vout_fbdev *vout_fbdev_init(const char *fbdev_name, int *w, int *h, int b
memset(fbdev->mem, 0, fbdev->mem_size);
// some checks
memset(fbdev->mem, 0, fbdev->mem_size);
// some checks
+ // screen was unblanked by vout_fbdev_resize(), so vsync should work
+ // first try pandora's adaptive vsync hack, then the default one
ret = 0;
ret = 0;
- ret = ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &ret);
+ ret = ioctl(fbdev->fd, OMAPFB_WAITFORVSYNC_FRAME, &ret);
+ if (ret == 0)
+ fbdev->vsync_ioctl = OMAPFB_WAITFORVSYNC_FRAME;
+ if (ret != 0) {
+ ret = 0;
+ ret = ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &ret);
+ if (ret == 0)
+ fbdev->vsync_ioctl = FBIO_WAITFORVSYNC;
+ }
if (ret != 0)
fprintf(stderr, PFX "Warning: vsync doesn't seem to be supported\n");
if (ret != 0)
fprintf(stderr, PFX "Warning: vsync doesn't seem to be supported\n");