mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 10:42:21 +03:00
The buffer management code is currently using fd as the buffer identifier, however, fds are ambiguous as identifiers: If user closes a dmabuf fd and allocates a new one, the two buffers may share the same fd. If the new dmabuf fd is passed to kernel, kernel incorrectly uses the old memory buffer. This patch reworks buffer management code to use dmabuf pointers as identifier instead of dmabuf fds. Reduce PVA_MAX_PIN_BUFFER from 256 to 64 nvhost_buffer_pin, nvhost_buffer_unpin, nvhost_get_iova_addr, nvhost_buffer_submit_pin and nvhost_buffer_submit_unpin are modified to pass dmabuf pointer instead of fd handle. JIRA PVA-357 Change-Id: I1f736cbcf704d0872a8e97de28308649f0f1586b Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Signed-off-by: Vinod G <vinodg@nvidia.com> Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/1455918 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>