I use dvr3.0.1 ti816x platform and I moved a test program named "saLoopBackFbdev"from EZSDk, When I run it,a problem happend for mmap.
The code as follows:
#define MAX_BUFFER 6
int mode = O_RDWR;
/* Open display driver */
fbdev.fd = open((const char *)FBDEV_DEVICE, mode);
if (fbdev.fd == -1) {
printf("failed to open fbdev device\n");
return -1;
}
.....
fbdev.buffer_addr[0] = (unsigned char *)mmap
(0,fbdev.buffersize * MAX_BUFFER, //MAX_BUFFER
(PROT_READ | PROT_WRITE), MAP_SHARED, fbdev.fd, 0);
if ((int)fbdev.buffer_addr[0] == -1) {
printf("MMap Failed.\n");
if I change the max buffer (#define) to1, the MMap Failed problem will not happen, but next code "ret = ioctl(capt.fd, VIDIOC_DQBUF, &capt.buf); " will err,because there should be more than 2 buffers to DQBuf...
I modified the bootargs "setenv bootargs 'mem=364M console=ttyO2,115200n8 noinitrd ip=192.168.2.109:192.168.2.107:192.168.2.1:255.255.255.0:talent:eth0:off eth=18:0e:99:02:b1:88 root=/dev/nfs rw nfsroot=192.168.2.107:/opt/DVR3.0/DVRRDK_03.00.00.00/target/rfs_816x vram=52M ti816xfb.vram=0:40M,1:8M,2:4M notifyk.vpssm3_sva=0xBEE00000 stdin=serial' but not usefull for this issue,and modify the kernel drive fb_dev.c , it looks not efferctive now..