mirror of
https://github.com/Relintai/rpi-fbcp.git
synced 2025-02-05 04:25:56 +01:00
Fix ioctl() warning, try full-width copy, 30 fps max
This commit is contained in:
parent
2d885fc8b2
commit
9c4b801637
12
main.c
12
main.c
@ -4,6 +4,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <linux/fb.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <bcm_host.h>
|
||||
|
||||
@ -108,6 +109,14 @@ int process() {
|
||||
int lastRow = last / vinfo.xres;
|
||||
// printf("%d %d\n", firstRow, lastRow);
|
||||
|
||||
#if 0
|
||||
// Try a full-width copy (single operation)
|
||||
memcpy(
|
||||
(uint16_t *)&fbp[(firstRow * vinfo.xres) * 2],
|
||||
&screenbuf[bufNum][firstRow * vinfo.xres],
|
||||
vinfo.xres * (lastRow - firstRow + 1) * 2);
|
||||
#else
|
||||
// Try rect bounds (multiple memcpy's)
|
||||
int firstCol = vinfo.xres - 1, lastCol = 0;
|
||||
for(int row=firstRow; row <= lastRow; row++) {
|
||||
uint16_t *s = &screenbuf[2][row * vinfo.xres];
|
||||
@ -130,9 +139,10 @@ int process() {
|
||||
dst += vinfo.xres;
|
||||
}
|
||||
// memcpy(fbp, screenbuf[2], vinfo.xres * vinfo.yres * 2);
|
||||
#endif
|
||||
bufNum = 1 - bufNum;
|
||||
}
|
||||
usleep(1000000 / 60);
|
||||
usleep(1000000 / 30);
|
||||
}
|
||||
|
||||
munmap(fbp, finfo.smem_len);
|
||||
|
Loading…
Reference in New Issue
Block a user