From a9c66768db400a82575a82ecddec71f1d3fd4aba Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 14 Apr 2017 12:06:39 -0700 Subject: gpu: nvgpu: Add abstraction for firmware loading Add nvgpu_firmware data structure, and return it instead of Linux struct firmare from nvgpu_request_firmware. Also add abstraction for releasing firmware: nvgpu_release_firmware. JIRA NVGPU-16 Change-Id: I6dae8262957c0d4506f710289e3a43a6c1729fc7 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1463538 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c index 712359e1..3c6d8924 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c @@ -19,11 +19,10 @@ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - #include #include #include +#include #include "gk20a.h" #include "gr_ctx_gk20a.h" @@ -112,7 +111,7 @@ static bool gr_gk20a_is_firmware_defined(void) static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) { - const struct firmware *netlist_fw; + struct nvgpu_firmware *netlist_fw; struct netlist_image *netlist = NULL; char name[MAX_NETLIST_NAME]; u32 i, major_v = ~0, major_v_hw, netlist_num; @@ -392,7 +391,7 @@ static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) g->gr.ctx_vars.valid = true; g->gr.netlist = net; - release_firmware(netlist_fw); + nvgpu_release_firmware(g, netlist_fw); gk20a_dbg_fn("done"); goto done; @@ -427,7 +426,7 @@ clean_up: nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.perf_pma.l); nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_rop.l); nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_ucgpc.l); - release_firmware(netlist_fw); + nvgpu_release_firmware(g, netlist_fw); err = -ENOENT; } -- cgit v1.2.2