gpu: nvgpu: vgpu: add b0cc profiler support

- added new commands to bind/unbind hwpm/hwpm_streamout/smpc
- added new command to updat get/put for PMA buffer
- tune function nvgpu_perfbuf_update_get_put so it could be reused on
server side.
- enable profiler v2 device for gv11b

Jira GVSCI-10351

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I4226c89ec3040e53dee5381ac8a30c9fd598e5ef
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2537683
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Richard Zhao
2021-05-27 10:44:52 -07:00
committed by mobile promotions
parent a3c4236574
commit 1685a2404f
11 changed files with 392 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2021, 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"),
@@ -152,7 +152,7 @@ int nvgpu_perfbuf_update_get_put(struct gk20a *g, u64 bytes_consumed,
bool update_available_bytes = (bytes_available == NULL) ? false : true;
volatile u32 *available_bytes_va = (u32 *)cpuva;
if (update_available_bytes) {
if (update_available_bytes && available_bytes_va != NULL) {
*available_bytes_va = 0xffffffff;
}
@@ -162,7 +162,7 @@ int nvgpu_perfbuf_update_get_put(struct gk20a *g, u64 bytes_consumed,
return err;
}
if (update_available_bytes && wait) {
if (update_available_bytes && wait && available_bytes_va != NULL) {
err = nvgpu_timeout_init(g, &timeout, 10000, NVGPU_TIMER_CPU_TIMER);
if (err != 0) {
nvgpu_err(g, "nvgpu_timeout_init() failed err=%d", err);
@@ -178,6 +178,7 @@ int nvgpu_perfbuf_update_get_put(struct gk20a *g, u64 bytes_consumed,
} while (nvgpu_timeout_expired(&timeout) == 0);
if (*available_bytes_va == 0xffffffff) {
nvgpu_err(g, "perfbuf update get put timed out");
return -ETIMEDOUT;
}