From 13125a57caf8e54dcb3c81dbd07f2ad781da9e2a Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 11 Jan 2019 09:04:20 -0800 Subject: [PATCH] gpu: nvgpu: Add POSIX __nvgpu_mem_create_from_phys Add a stub POSIX version of __nvgpu_mem_create_from_phys. That allows building nvgpu code that is behind NVHOST compilation option. JIRA NVGPU-1734 Change-Id: I12d80e69e78d975141d690bc3f37220ecb5bcc89 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1993125 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/posix/nvgpu_mem.h | 4 +++- drivers/gpu/nvgpu/os/posix/posix-nvgpu_mem.c | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/posix/nvgpu_mem.h index 5ce813584..51b152a7c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/nvgpu_mem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/nvgpu_mem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -39,5 +39,7 @@ struct nvgpu_sgt *nvgpu_mem_sgt_posix_create_from_list(struct gk20a *g, u64 *total_size); int nvgpu_mem_posix_create_from_list(struct gk20a *g, struct nvgpu_mem *mem, struct nvgpu_mem_sgl *sgl_list, u32 nr_sgls); +int __nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest, + u64 src_phys, int nr_pages); #endif diff --git a/drivers/gpu/nvgpu/os/posix/posix-nvgpu_mem.c b/drivers/gpu/nvgpu/os/posix/posix-nvgpu_mem.c index b6c0a8525..a70ef7e94 100644 --- a/drivers/gpu/nvgpu/os/posix/posix-nvgpu_mem.c +++ b/drivers/gpu/nvgpu/os/posix/posix-nvgpu_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -264,3 +264,10 @@ int nvgpu_mem_create_from_mem(struct gk20a *g, return 0; } + +int __nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest, + u64 src_phys, int nr_pages) +{ + BUG(); + return 0; +}