On (20/06/08 13:14), Hans Verkuil wrote: > >> Currently it sets reqbufs.flags/crbufs.flags to 0, but you can just set it to > >> V4L2_FLAG_MEMORY_NON_CONSISTENT instead and add the relevant tests. > > > > Ah, OK, so no test for ->flags = 0 case. > > Right. > > I don't think explicitly testing for flags = 0 is useful (famous last words, I > may have to eat them in the future :-) ). OK, I should be doing something else for a living. That computer programming thing is entirely too difficult for me. I see some test failures after I integrated testCacheHints() into testReqBufs(). What does testCacheHints() do: q.init(node->g_type(), m); reqbufs.memory = q.g_memory(); doioctl(node, VIDIOC_REQBUFS, &reqbufs); q.reqbufs(node); crbufs.memory = q.g_memory(); doioctl(node, VIDIOC_CREATE_BUFS, &crbufs); q.reqbufs(node); q.create_bufs(node, 2, &fmt, 0); q.reqbufs(node); One thing to notice here is that q.reqbufs() and q.create_bufs() use q.g_memory() for ioctl() requests, the same function we use to set reqbufs.memory and crbufs.memory. In other words, all ioctl() requests always the same memory type. Now, what does testReqBufs() is completely different. q.init(i, V4L2_MEMORY_DMABUF); for (m = V4L2_MEMORY_MMAP; m <= V4L2_MEMORY_DMABUF; m++) { reqbufs.memory = m; doioctl(node, VIDIOC_REQBUFS, &reqbufs); q.reqbufs(node); crbufs.memory = m; doioctl(node, VIDIOC_CREATE_BUFS, &crbufs); q.reqbufs(node); q.create_bufs(node, 2, &fmt, 0); q.reqbufs(node); } Notice that we use `m' for reqbufs.memory and crbufs.memory, and q.g_memory() for q.reqbufs() and q.create_bufs(). And the issue here is that `m' and q.g_memory() are not the same. So we use different memory types all the time (except when m == V4L2_MEMORY_DMABUF). I sent a kernel patch which explains why does this cause problems on the kernel side, this email should explain why we haven't seen any of them before. -ss