mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: move gr.init_preemption_state HAL to hal.gr.init unit
Move GR HAL operation g->ops.gr.init_preemption_state() to hal.gr.init unit as g->ops.gr.init.preemption_state() Create hal.gr.init unit files for gp10b and gv11b and copy over corresponding functions to new files This API now takes gfxp_wfi_timeout_unit and gfxp_wfi_timeout_count as parameter Define gfxp_wfi_timeout_unit in struct gr_gk20a as a boolean flag named gfxp_wfi_timeout_unit_usec Remove GFXP_WFI_TIMEOUT_UNIT_SYSCLK/USEC macros Jira NVGPU-2961 Change-Id: I4347b1e30c86c231e44cf274adccd8c70addcdab Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2072549 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
09e2e8c838
commit
15d8941341
@@ -1002,13 +1002,15 @@ static ssize_t gfxp_wfi_timeout_count_store(struct device *dev,
|
||||
|
||||
gr->gfxp_wfi_timeout_count = val;
|
||||
|
||||
if (g->ops.gr.init_preemption_state && g->power_on) {
|
||||
if (g->ops.gr.init.preemption_state && g->power_on) {
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = nvgpu_pg_elpg_protected_call(g,
|
||||
g->ops.gr.init_preemption_state(g));
|
||||
g->ops.gr.init.preemption_state(g,
|
||||
gr->gfxp_wfi_timeout_count,
|
||||
gr->gfxp_wfi_timeout_unit_usec));
|
||||
|
||||
gk20a_idle(g);
|
||||
|
||||
@@ -1027,18 +1029,20 @@ static ssize_t gfxp_wfi_timeout_unit_store(struct device *dev,
|
||||
|
||||
if (count > 0 && buf[0] == 's')
|
||||
/* sysclk */
|
||||
gr->gfxp_wfi_timeout_unit = GFXP_WFI_TIMEOUT_UNIT_SYSCLK;
|
||||
gr->gfxp_wfi_timeout_unit_usec = false;
|
||||
else
|
||||
/* usec */
|
||||
gr->gfxp_wfi_timeout_unit = GFXP_WFI_TIMEOUT_UNIT_USEC;
|
||||
gr->gfxp_wfi_timeout_unit_usec = true;
|
||||
|
||||
if (g->ops.gr.init_preemption_state && g->power_on) {
|
||||
if (g->ops.gr.init.preemption_state && g->power_on) {
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = nvgpu_pg_elpg_protected_call(g,
|
||||
g->ops.gr.init_preemption_state(g));
|
||||
g->ops.gr.init.preemption_state(g,
|
||||
gr->gfxp_wfi_timeout_count,
|
||||
gr->gfxp_wfi_timeout_unit_usec));
|
||||
|
||||
gk20a_idle(g);
|
||||
|
||||
@@ -1065,7 +1069,7 @@ static ssize_t gfxp_wfi_timeout_unit_read(struct device *dev,
|
||||
struct gk20a *g = get_gk20a(dev);
|
||||
struct gr_gk20a *gr = &g->gr;
|
||||
|
||||
if (gr->gfxp_wfi_timeout_unit == GFXP_WFI_TIMEOUT_UNIT_USEC)
|
||||
if (gr->gfxp_wfi_timeout_unit_usec)
|
||||
return snprintf(buf, PAGE_SIZE, "usec\n");
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "sysclk\n");
|
||||
|
||||
Reference in New Issue
Block a user