Make use of write enable flag for mem bo map
authorZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 23 Oct 2014 07:19:22 +0000 (15:19 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 24 Oct 2014 10:12:29 +0000 (18:12 +0800)
commit8b0850587b80847056c9d798642fd8a7155fe3c3
treee2eaae3f53d84ac8d344785290f49f55ee0372d6
parente74164f951ba9003f92d14d685f184617da056eb
Make use of write enable flag for mem bo map

Use drm/intel optimization for mem bo mapping in case of read or write.
So we could be possibly waiting less.

This also adds 'map_flags' check in clEnqueueMapBuffer/clEnqueueMapImage
for actual read or write mapping.

But currently leave clMapBufferIntel untouched which might break ABI/API.

v2: Fix write_map flag in clEnqueueMapBuffer/clEnqueueMapImage.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: "Guo, Yejun" <yejun.guo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
src/cl_api.c
src/cl_command_queue.c
src/cl_enqueue.c
src/cl_enqueue.h
src/cl_mem.c
src/cl_mem.h