On 07/03/2020 12:28, Sergey Senozhatsky wrote: > On (20/03/07 11:10), Hans Verkuil wrote: > [..] >>>>> @@ -564,6 +573,7 @@ struct vb2_queue { >>>>> unsigned requires_requests:1; >>>>> unsigned uses_qbuf:1; >>>>> unsigned uses_requests:1; >>>>> + unsigned allow_cache_hints:1; >>> >>> Shall I use "unsigned int" here instead of "unsigned"? >> >> The vb2_queue bitfields are the only places in that header were 'unsigned' is >> used. I think that that should be fixed in a separate patch. It's nice to have >> it consistent. >> >> Put that patch in the beginning of the series, that way I can pick it up in the >> next pull request. > > OK, done. > > For the time being the series has moved to github public repo [0], > I'll try to run more 'twisty' cases and re-submit once it survives > beating. Create those tests in v4l2-compliance: that's where they belong. You need these tests: For non-MMAP modes: 1) test that V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS is never set. If V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS is not set, then: 1) attempting to use V4L2_FLAG_MEMORY_NON_CONSISTENT will clear the flag upon return (test with both reqbufs and create_bufs). 2) attempting to use V4L2_BUF_FLAG_NO_CACHE_INVALIDATE or V4L2_BUF_FLAG_NO_CACHE_CLEAN will clear those flags upon return (do we actually do that in the patch series?). If V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS is set, then: 1) set V4L2_FLAG_MEMORY_NON_CONSISTENT in reqbufs, but clear in create_bufs: this should fail. 2) clear V4L2_FLAG_MEMORY_NON_CONSISTENT in reqbufs, but set in create_bufs: this should fail. 3) set V4L2_FLAG_MEMORY_NON_CONSISTENT in both reqbufs and create_bufs: this should work. 4) clear V4L2_FLAG_MEMORY_NON_CONSISTENT in both reqbufs and create_bufs: this should work. 5) you can use V4L2_BUF_FLAG_NO_CACHE_INVALIDATE or V4L2_BUF_FLAG_NO_CACHE_CLEAN without these flags being cleared in v4l2_buffer. All these tests can be done in testReqBufs(). Regards, Hans > > [0] https://github.com/sergey-senozhatsky/v4l2-mmap-cache-flags > > -ss >