From aa025c9f28c07235d7884a975de9b510dd905d29 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 22 Jan 2019 13:13:12 +0200 Subject: [PATCH] gpu: nvgpu: unset runlist_entry_size HAL for vgpu gpu_ops.runlist.runlist_entry_size is not accessed on vgpu; vgpu uses a software format when messaging the runlist contents to the server. Set the HAL op to NULL for gp10b and gv11b vgpus. Also add some documentation for the hardcoded vgpu entry size (u16). Jira NVGPU-1309 Change-Id: Iac14cabb834a13b01e98208ec3a9a60151a9c34d Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/2005561 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-misra-checker Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 6 ++++++ drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 2 +- drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index f88b12cf1..9ad758465 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c @@ -239,7 +239,13 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g) f->g = g; f->num_channels = priv->constants.num_channels; + + /* + * This is not the HW format you're looking for (see + * vgpu_fifo_update_runlist_locked(), vgpu_submit_runlist()) + */ f->runlist_entry_size = (u32)sizeof(u16); + f->num_runlist_entries = f->num_channels; f->max_engines = nvgpu_get_litter_value(g, GPU_LIT_HOST_NUM_ENGINES); diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 927b2475b..87f2606a9 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -430,7 +430,7 @@ static const struct gpu_ops vgpu_gp10b_ops = { .update_runlist = vgpu_fifo_update_runlist, .set_runlist_interleave = vgpu_fifo_set_runlist_interleave, .eng_runlist_base_size = gk20a_fifo_runlist_base_size, - .runlist_entry_size = gk20a_fifo_runlist_entry_size, + .runlist_entry_size = NULL, .get_tsg_runlist_entry = gk20a_get_tsg_runlist_entry, .get_ch_runlist_entry = gk20a_get_ch_runlist_entry, .runlist_hw_submit = NULL, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 40ac79f1e..c18ee4cf2 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -508,7 +508,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { .update_runlist = vgpu_fifo_update_runlist, .set_runlist_interleave = vgpu_fifo_set_runlist_interleave, .eng_runlist_base_size = gv11b_fifo_runlist_base_size, - .runlist_entry_size = gv11b_fifo_runlist_entry_size, + .runlist_entry_size = NULL, .get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry, .get_ch_runlist_entry = gv11b_get_ch_runlist_entry, .runlist_hw_submit = NULL,