gpu: nvgpu: Use preallocated VPR buffer

To prevent deadlock while allocating VPR in nvgpu, allocate all the
needed VPR memory at probe time and use an internal allocator to
hand out space for VPR buffers.

Change-Id: I584b9a0f746d5d1dec021cdfbd6f26b4b92e4412
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1655324
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2018-02-09 14:42:07 -08:00
committed by mobile promotions
parent 1582bdb5ee
commit ec00a6c2db
6 changed files with 77 additions and 81 deletions

View File

@@ -32,7 +32,8 @@ struct gk20a_scale_profile;
struct secure_page_buffer {
void (*destroy)(struct gk20a *, struct secure_page_buffer *);
size_t size;
u64 iova;
dma_addr_t phys;
size_t used;
};
struct gk20a_platform {
@@ -148,6 +149,8 @@ struct gk20a_platform {
/* Powerdown platform dependencies */
void (*idle)(struct device *dev);
/* Preallocated VPR buffer for kernel */
size_t secure_buffer_size;
struct secure_page_buffer secure_buffer;
/* Device is going to be suspended */