From 717d99fcfab99e478499880d5742091d031fc76b Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 15 Mar 2018 16:20:34 -0700 Subject: gpu: nvgpu: vgpu: add event TEGRA_VGPU_EVENT_SEMAPHORE_WAKEUP RM Server will implement callback for semaphore wakeup and broadcast event TEGRA_VGPU_EVENT_SEMAPHORE_WAKEUP. The patch adds handling of the event in vgpu code. Jira VQRM-3058 Change-Id: Ife38eff8252f5b4036e6df71f1c64c99cb58c1b5 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1676240 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h | 6 ++++++ drivers/gpu/nvgpu/vgpu/vgpu.c | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h index c269dc24..3bcabadf 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h @@ -706,6 +706,10 @@ struct tegra_vgpu_sm_esr_info { u32 hww_warp_esr_report_mask; }; +struct tegra_vgpu_semaphore_wakeup { + u32 post_events; +}; + enum { TEGRA_VGPU_INTR_GR = 0, @@ -722,6 +726,7 @@ enum { TEGRA_VGPU_EVENT_FECS_TRACE = 2, TEGRA_VGPU_EVENT_CHANNEL = 3, TEGRA_VGPU_EVENT_SM_ESR = 4, + TEGRA_VGPU_EVENT_SEMAPHORE_WAKEUP = 5, }; struct tegra_vgpu_intr_msg { @@ -736,6 +741,7 @@ struct tegra_vgpu_intr_msg { struct tegra_vgpu_fecs_trace_event_info fecs_trace; struct tegra_vgpu_channel_event_info channel_event; struct tegra_vgpu_sm_esr_info sm_esr; + struct tegra_vgpu_semaphore_wakeup sem_wakeup; char padding[32]; } info; }; diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index eb56d4f9..3b53474d 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -165,6 +165,10 @@ int vgpu_intr_thread(void *dev_id) case TEGRA_VGPU_EVENT_SM_ESR: vgpu_gr_handle_sm_esr_event(g, &msg->info.sm_esr); break; + case TEGRA_VGPU_EVENT_SEMAPHORE_WAKEUP: + g->ops.semaphore_wakeup(g, + !!msg->info.sem_wakeup.post_events); + break; default: nvgpu_err(g, "unknown event %u", msg->event); break; -- cgit v1.2.2