diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-14 15:06:39 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-19 15:16:02 -0400 |
commit | a9c66768db400a82575a82ecddec71f1d3fd4aba (patch) | |
tree | 3b83db70149515fc21c9d700f68bbcf0fb4e58b4 /drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | |
parent | 7eb59ff8d334e9980e21bac50b4680855bd8237f (diff) |
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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1463538
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 @@ | |||
19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | 19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/firmware.h> | ||
23 | |||
24 | #include <nvgpu/nvgpu_common.h> | 22 | #include <nvgpu/nvgpu_common.h> |
25 | #include <nvgpu/kmem.h> | 23 | #include <nvgpu/kmem.h> |
26 | #include <nvgpu/log.h> | 24 | #include <nvgpu/log.h> |
25 | #include <nvgpu/firmware.h> | ||
27 | 26 | ||
28 | #include "gk20a.h" | 27 | #include "gk20a.h" |
29 | #include "gr_ctx_gk20a.h" | 28 | #include "gr_ctx_gk20a.h" |
@@ -112,7 +111,7 @@ static bool gr_gk20a_is_firmware_defined(void) | |||
112 | 111 | ||
113 | static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) | 112 | static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) |
114 | { | 113 | { |
115 | const struct firmware *netlist_fw; | 114 | struct nvgpu_firmware *netlist_fw; |
116 | struct netlist_image *netlist = NULL; | 115 | struct netlist_image *netlist = NULL; |
117 | char name[MAX_NETLIST_NAME]; | 116 | char name[MAX_NETLIST_NAME]; |
118 | u32 i, major_v = ~0, major_v_hw, netlist_num; | 117 | 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) | |||
392 | g->gr.ctx_vars.valid = true; | 391 | g->gr.ctx_vars.valid = true; |
393 | g->gr.netlist = net; | 392 | g->gr.netlist = net; |
394 | 393 | ||
395 | release_firmware(netlist_fw); | 394 | nvgpu_release_firmware(g, netlist_fw); |
396 | gk20a_dbg_fn("done"); | 395 | gk20a_dbg_fn("done"); |
397 | goto done; | 396 | goto done; |
398 | 397 | ||
@@ -427,7 +426,7 @@ clean_up: | |||
427 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.perf_pma.l); | 426 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.perf_pma.l); |
428 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_rop.l); | 427 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_rop.l); |
429 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_ucgpc.l); | 428 | nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_ucgpc.l); |
430 | release_firmware(netlist_fw); | 429 | nvgpu_release_firmware(g, netlist_fw); |
431 | err = -ENOENT; | 430 | err = -ENOENT; |
432 | } | 431 | } |
433 | 432 | ||