Does Linux on TX1 not support MS_SYNC option for msync ?
I mmap ed hardware buffer to memory and modified the contents of the memory.
I had to use sleep for about two seconds before the change is written back.
To avoid using sleep , I thought using msync with MS_SYNC is the desired effect I was looking for
But when I try to do so, msync returns EINVAL .
I’d appreciate any comments or advices.
Thanks.
VickNV
March 1, 2017, 2:31am
#2
Hi devnglee, I’ll take a look and then get back to you.
VickNV
March 1, 2017, 4:34am
#3
Hi devnglee, Could you share your sample code?
Hi vickyy,
I’m trying to capture an image via libargus and process the captured data.
int dmabuf_fd = iImageNativeBuffer->createNvBuffer(
Size {WIDTH, HEIGHT}, NvBufferColorFormat_YUV420, NvBufferLayout_Pitch);
NvBufferParams params;
NvBufferGetParams(dmabuf_fd, ¶ms);
size_t fsize = params.pitch[0] * params.height[0];
uint8_t* data_mem = (uint8_t*)mmap(
0, fsize, PROT_READ | PROT_WRITE, MAP_SHARED, dmabuf_fd, params.offset[0]);
/* ... */
/* Read and modify data at data_mem */
/* ... */
msync(data_mem, fsize, MS_SYNC); /* EINVAL */
VickNV
March 8, 2017, 6:06am
#5
The next BSP release will have below functions in nvbuf_utils.h for this.
NvBufferMemMap
NvBufferMemSyncForCpu
NvBufferMemSyncForDevice
NvBufferMemUnMap
If still have any question, please let me know.
Are there any samples demonstrating use of these functions?
DaneLLL
December 14, 2017, 8:52am
#7