gpu: nvgpu: posix: improve nvgpu_vm_find_mapping for testing

The nvgpu_vm_find_mapping API was always returning NULL. For test
purposes, this new implementation is similar to the one in use for
Linux.

JIRA NVGPU-909

Change-Id: Id311fe367ddfb1539fecd86fae4bb3a8f2d91491
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2217678
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2019-10-14 12:04:01 -04:00
committed by Alex Waterman
parent 6c5f67792c
commit 563955aead

View File

@@ -38,10 +38,18 @@ struct nvgpu_mapped_buf *nvgpu_vm_find_mapping(struct vm_gk20a *vm,
u32 flags,
s16 kind)
{
/*
* No map caching for now.
*/
return NULL;
struct nvgpu_mapped_buf *mapped_buffer = NULL;
mapped_buffer = nvgpu_vm_find_mapped_buf(vm, map_addr);
if (mapped_buffer == NULL) {
return NULL;
}
if (mapped_buffer->flags != flags) {
return NULL;
}
return mapped_buffer;
}
void nvgpu_vm_unmap_system(struct nvgpu_mapped_buf *mapped_buffer)