mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-06 23:28:04 -04:00
Merge remote-tracking branch 'notaz/master'
This commit is contained in:
commit
7b58e15633
3 changed files with 13 additions and 10 deletions
|
@ -66,9 +66,9 @@ void vout_fbdev_wait_vsync(struct vout_fbdev *fbdev)
|
||||||
ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &arg);
|
ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* it is recommended to call vout_fbdev_clear() before this */
|
|
||||||
void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
||||||
int left_border, int right_border, int top_border, int bottom_border, int buffer_cnt)
|
int left_border, int right_border, int top_border, int bottom_border,
|
||||||
|
int buffer_cnt, int first_write_to_front)
|
||||||
{
|
{
|
||||||
int w_total = left_border + w + right_border;
|
int w_total = left_border + w + right_border;
|
||||||
int h_total = top_border + h + bottom_border;
|
int h_total = top_border + h + bottom_border;
|
||||||
|
@ -100,9 +100,8 @@ void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
||||||
fbdev->fbvar_new.nonstd = 0; // can set YUV here on omapfb
|
fbdev->fbvar_new.nonstd = 0; // can set YUV here on omapfb
|
||||||
fbdev->buffer_count = buffer_cnt;
|
fbdev->buffer_count = buffer_cnt;
|
||||||
fbdev->buffer_write = buffer_cnt > 1 ? 1 : 0;
|
fbdev->buffer_write = buffer_cnt > 1 ? 1 : 0;
|
||||||
|
if (first_write_to_front)
|
||||||
// seems to help a bit to avoid glitches
|
fbdev->buffer_write = 0;
|
||||||
vout_fbdev_wait_vsync(fbdev);
|
|
||||||
|
|
||||||
ret = ioctl(fbdev->fd, FBIOPUT_VSCREENINFO, &fbdev->fbvar_new);
|
ret = ioctl(fbdev->fd, FBIOPUT_VSCREENINFO, &fbdev->fbvar_new);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
@ -119,6 +118,9 @@ void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
||||||
"multibuffering disabled\n");
|
"multibuffering disabled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// omap is still using the old mode until vsync,
|
||||||
|
// if the caller starts to write now we may get garbage on screen
|
||||||
|
vout_fbdev_wait_vsync(fbdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
fbdev->fb_size = w_total * h_total * bpp / 8;
|
fbdev->fb_size = w_total * h_total * bpp / 8;
|
||||||
|
@ -155,7 +157,8 @@ out:
|
||||||
|
|
||||||
void vout_fbdev_clear(struct vout_fbdev *fbdev)
|
void vout_fbdev_clear(struct vout_fbdev *fbdev)
|
||||||
{
|
{
|
||||||
memset(fbdev->mem, 0, fbdev->mem_size);
|
if (fbdev->mem)
|
||||||
|
memset(fbdev->mem, 0, fbdev->fb_size * fbdev->buffer_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count)
|
void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count)
|
||||||
|
@ -209,7 +212,7 @@ struct vout_fbdev *vout_fbdev_init(const char *fbdev_name, int *w, int *h, int b
|
||||||
if (*h != 0)
|
if (*h != 0)
|
||||||
req_h = *h;
|
req_h = *h;
|
||||||
|
|
||||||
pret = vout_fbdev_resize(fbdev, req_w, req_h, bpp, 0, 0, 0, 0, buffer_cnt);
|
pret = vout_fbdev_resize(fbdev, req_w, req_h, bpp, 0, 0, 0, 0, buffer_cnt, 0);
|
||||||
if (pret == NULL)
|
if (pret == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ 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);
|
||||||
void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
void *vout_fbdev_resize(struct vout_fbdev *fbdev, int w, int h, int bpp,
|
||||||
int left_border, int right_border, int top_border, int bottom_border,
|
int left_border, int right_border, int top_border, int bottom_border,
|
||||||
int buffer_count);
|
int buffer_cnt, int first_write_to_front);
|
||||||
void vout_fbdev_clear(struct vout_fbdev *fbdev);
|
void vout_fbdev_clear(struct vout_fbdev *fbdev);
|
||||||
void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count);
|
void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count);
|
||||||
int vout_fbdev_get_fd(struct vout_fbdev *fbdev);
|
int vout_fbdev_get_fd(struct vout_fbdev *fbdev);
|
||||||
|
|
|
@ -106,12 +106,12 @@ int plat_sdl_change_video_mode(int w, int h, int force)
|
||||||
|| plat_target.vout_method == vout_mode_overlay2x) {
|
|| plat_target.vout_method == vout_mode_overlay2x) {
|
||||||
int W = plat_target.vout_method == vout_mode_overlay2x && w < 640 ? 2*w : w;
|
int W = plat_target.vout_method == vout_mode_overlay2x && w < 640 ? 2*w : w;
|
||||||
plat_sdl_overlay = SDL_CreateYUVOverlay(W, h, SDL_UYVY_OVERLAY, plat_sdl_screen);
|
plat_sdl_overlay = SDL_CreateYUVOverlay(W, h, SDL_UYVY_OVERLAY, plat_sdl_screen);
|
||||||
if (plat_sdl_overlay != NULL) {
|
if (plat_sdl_overlay != NULL && SDL_LockYUVOverlay(plat_sdl_overlay) == 0) {
|
||||||
SDL_LockYUVOverlay(plat_sdl_overlay);
|
|
||||||
if ((long)plat_sdl_overlay->pixels[0] & 3)
|
if ((long)plat_sdl_overlay->pixels[0] & 3)
|
||||||
fprintf(stderr, "warning: overlay pointer is unaligned\n");
|
fprintf(stderr, "warning: overlay pointer is unaligned\n");
|
||||||
|
|
||||||
plat_sdl_overlay_clear();
|
plat_sdl_overlay_clear();
|
||||||
|
|
||||||
SDL_UnlockYUVOverlay(plat_sdl_overlay);
|
SDL_UnlockYUVOverlay(plat_sdl_overlay);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue