diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 67cb5912..635dddc4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -424,6 +424,8 @@ struct gpu_ops { | |||
424 | void *pmu_alloc_ptr, u32 offset); | 424 | void *pmu_alloc_ptr, u32 offset); |
425 | void * (*pmu_allocation_get_fb_addr)( | 425 | void * (*pmu_allocation_get_fb_addr)( |
426 | struct pmu_gk20a *pmu, void *pmu_alloc_ptr); | 426 | struct pmu_gk20a *pmu, void *pmu_alloc_ptr); |
427 | u32 (*pmu_allocation_get_fb_size)( | ||
428 | struct pmu_gk20a *pmu, void *pmu_alloc_ptr); | ||
427 | void (*get_pmu_init_msg_pmu_queue_params)( | 429 | void (*get_pmu_init_msg_pmu_queue_params)( |
428 | struct pmu_queue *queue, u32 id, | 430 | struct pmu_queue *queue, u32 id, |
429 | void *pmu_init_msg); | 431 | void *pmu_init_msg); |
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index fc95b5bc..0a9a1fde 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -529,6 +529,14 @@ static void *pmu_allocation_get_fb_addr_v3( | |||
529 | return (void *)&pmu_a_ptr->alloc.fb; | 529 | return (void *)&pmu_a_ptr->alloc.fb; |
530 | } | 530 | } |
531 | 531 | ||
532 | u32 pmu_allocation_get_fb_size_v3( | ||
533 | struct pmu_gk20a *pmu, void *pmu_alloc_ptr) | ||
534 | { | ||
535 | struct pmu_allocation_v3 *pmu_a_ptr = | ||
536 | (struct pmu_allocation_v3 *)pmu_alloc_ptr; | ||
537 | return sizeof(pmu_a_ptr->alloc.fb); | ||
538 | } | ||
539 | |||
532 | static u32 *pmu_allocation_get_dmem_offset_addr_v2(struct pmu_gk20a *pmu, | 540 | static u32 *pmu_allocation_get_dmem_offset_addr_v2(struct pmu_gk20a *pmu, |
533 | void *pmu_alloc_ptr) | 541 | void *pmu_alloc_ptr) |
534 | { | 542 | { |
@@ -1526,6 +1534,8 @@ int gk20a_init_pmu(struct pmu_gk20a *pmu) | |||
1526 | pmu_allocation_set_dmem_offset_v3; | 1534 | pmu_allocation_set_dmem_offset_v3; |
1527 | g->ops.pmu_ver.pmu_allocation_get_fb_addr = | 1535 | g->ops.pmu_ver.pmu_allocation_get_fb_addr = |
1528 | pmu_allocation_get_fb_addr_v3; | 1536 | pmu_allocation_get_fb_addr_v3; |
1537 | g->ops.pmu_ver.pmu_allocation_get_fb_size = | ||
1538 | pmu_allocation_get_fb_size_v3; | ||
1529 | if(pmu->desc->app_version != APP_VERSION_NV_GPU && | 1539 | if(pmu->desc->app_version != APP_VERSION_NV_GPU && |
1530 | pmu->desc->app_version != APP_VERSION_NV_GPU_1) { | 1540 | pmu->desc->app_version != APP_VERSION_NV_GPU_1) { |
1531 | g->ops.pmu_ver.get_pmu_init_msg_pmu_queue_params = | 1541 | g->ops.pmu_ver.get_pmu_init_msg_pmu_queue_params = |
@@ -3792,7 +3802,8 @@ static int pmu_response_handle(struct pmu_gk20a *pmu, | |||
3792 | if (seq->out_mem != NULL) { | 3802 | if (seq->out_mem != NULL) { |
3793 | memset(pv->pmu_allocation_get_fb_addr(pmu, | 3803 | memset(pv->pmu_allocation_get_fb_addr(pmu, |
3794 | pv->get_pmu_seq_out_a_ptr(seq)), 0x0, | 3804 | pv->get_pmu_seq_out_a_ptr(seq)), 0x0, |
3795 | pv->get_pmu_allocation_struct_size(pmu)); | 3805 | pv->pmu_allocation_get_fb_size(pmu, |
3806 | pv->get_pmu_seq_out_a_ptr(seq))); | ||
3796 | 3807 | ||
3797 | gk20a_pmu_surface_free(g, seq->out_mem); | 3808 | gk20a_pmu_surface_free(g, seq->out_mem); |
3798 | if (seq->out_mem != seq->in_mem) | 3809 | if (seq->out_mem != seq->in_mem) |
@@ -3804,10 +3815,12 @@ static int pmu_response_handle(struct pmu_gk20a *pmu, | |||
3804 | if (seq->in_mem != NULL) { | 3815 | if (seq->in_mem != NULL) { |
3805 | memset(pv->pmu_allocation_get_fb_addr(pmu, | 3816 | memset(pv->pmu_allocation_get_fb_addr(pmu, |
3806 | pv->get_pmu_seq_in_a_ptr(seq)), 0x0, | 3817 | pv->get_pmu_seq_in_a_ptr(seq)), 0x0, |
3807 | pv->get_pmu_allocation_struct_size(pmu)); | 3818 | pv->pmu_allocation_get_fb_size(pmu, |
3819 | pv->get_pmu_seq_in_a_ptr(seq))); | ||
3808 | 3820 | ||
3809 | gk20a_pmu_surface_free(g, seq->in_mem); | 3821 | gk20a_pmu_surface_free(g, seq->in_mem); |
3810 | kfree(seq->in_mem); | 3822 | kfree(seq->in_mem); |
3823 | seq->in_mem = NULL; | ||
3811 | } | 3824 | } |
3812 | 3825 | ||
3813 | if (seq->callback) | 3826 | if (seq->callback) |