Files
linux-nvgpu/drivers/gpu/nvgpu/common/pmu/perf/pmu_perf.c
rmylavarapu 8f154fb6eb gpu: nvgpu: Refactor PERF VFE unit
-Created ucode_perf_vfe_inf.h and moved all VFE
 interface structs and MACROs into this header
-Created nvgpu_clk_fll_get_fmargin_idx to get
 freq margin index
-Created nvgpu_vfe_var_get_s_param to read s_param
-Removed MACROs and header includes which are
 not needed

NVGPU-4448

Change-Id: I89f946d555bcbc7823665d2a5a761049f7a5e963
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2260150
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00

61 lines
2.0 KiB
C

/*
* Copyright (c) 2016-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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <nvgpu/bug.h>
#include <nvgpu/pmu.h>
#include <nvgpu/clk_arb.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/pmu/perf.h>
int nvgpu_perf_pmu_init_pmupstate(struct gk20a *g)
{
/* If already allocated, do not re-allocate */
if (g->perf_pmu != NULL) {
return 0;
}
g->perf_pmu = nvgpu_kzalloc(g, sizeof(*g->perf_pmu));
if (g->perf_pmu == NULL) {
return -ENOMEM;
}
return 0;
}
static void vfe_thread_stop_cb(void *data)
{
struct nvgpu_cond *cond = (struct nvgpu_cond *)data;
nvgpu_cond_signal(cond);
}
void nvgpu_perf_pmu_free_pmupstate(struct gk20a *g)
{
if (nvgpu_thread_is_running(&g->perf_pmu->vfe_init.state_task)) {
nvgpu_thread_stop_graceful(&g->perf_pmu->vfe_init.state_task,
vfe_thread_stop_cb, &g->perf_pmu->vfe_init.wq);
}
nvgpu_cond_destroy(&g->perf_pmu->vfe_init.wq);
nvgpu_kfree(g, g->perf_pmu);
g->perf_pmu = NULL;
}