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) 2019-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-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"),
@@ -90,3 +90,33 @@ void vgpu_perfbuffer_deinit_inst_block(struct gk20a *g)
vgpu_sendrecv_perfbuf_inst_block_cmd(g,
TEGRA_VGPU_PROF_PERFBUF_INST_BLOCK_DEINIT);
}
int vgpu_perf_update_get_put(struct gk20a *g, u64 bytes_consumed,
bool update_available_bytes, u64 *put_ptr,
bool *overflowed)
{
struct tegra_vgpu_cmd_msg msg = {};
struct tegra_vgpu_perf_update_get_put_params *p =
&msg.params.perf_updat_get_put;
int err;
msg.cmd = TEGRA_VGPU_CMD_PERF_UPDATE_GET_PUT;
msg.handle = vgpu_get_handle(g);
p->bytes_consumed = bytes_consumed;
p->update_available_bytes = (u8)update_available_bytes;
err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
err = err ? err : msg.ret;
if (err == 0) {
if (put_ptr != NULL) {
*put_ptr = p->put_ptr;
}
if (overflowed != NULL) {
*overflowed = (bool)p->overflowed;
}
}
return err;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-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"),
@@ -20,6 +20,9 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef NVGPU_PERF_VGPU_H
#define NVGPU_PERF_VGPU_H
struct gk20a;
int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size);
@@ -27,3 +30,9 @@ int vgpu_perfbuffer_disable(struct gk20a *g);
int vgpu_perfbuffer_init_inst_block(struct gk20a *g);
void vgpu_perfbuffer_deinit_inst_block(struct gk20a *g);
int vgpu_perf_update_get_put(struct gk20a *g, u64 bytes_consumed,
bool update_available_bytes, u64 *put_ptr,
bool *overflowed);
#endif