diff options
author | Lauri Peltonen <lpeltonen@nvidia.com> | 2014-09-10 06:29:27 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:15 -0400 |
commit | 9c17175a357e3be0f3a881f30095c961c12c196f (patch) | |
tree | 034f06dceee91d2c8972f896047e9a49ffbe4b07 /drivers | |
parent | 1d026d1f776946d516ee6764d2415b47b8ea5fa5 (diff) |
gpu: nvgpu: Defer CDE app initialization
Defer CDE app initialization to the point where we actually need to
launch the app. This allows us to use the compression state API also on
T124 where we never use the CDE app.
Also return the error code correctly from gk20a_prepare_compressible_read.
Bug 1524301
Change-Id: If79fbe161e8dc9353b9f5fa0dfcd7f30b00d29b4
Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com>
Reviewed-on: http://git-master/r/497351
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jussi Rasanen <jrasanen@nvidia.com>
Tested-by: Jussi Rasanen <jrasanen@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 24e2a778..2fad2f64 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -1002,6 +1002,12 @@ static int gk20a_buffer_convert_gpu_to_cde( | |||
1002 | const int gridw = roundup(tilepitch, wgx) / wgx; | 1002 | const int gridw = roundup(tilepitch, wgx) / wgx; |
1003 | const int gridh = roundup(ytilesaligned, wgy) / wgy; | 1003 | const int gridh = roundup(ytilesaligned, wgy) / wgy; |
1004 | 1004 | ||
1005 | if (!g->cde_app.initialised) { | ||
1006 | err = gk20a_cde_reload(g); | ||
1007 | if (err) | ||
1008 | return err; | ||
1009 | } | ||
1010 | |||
1005 | if (xtiles > 4096 / 8 || ytiles > 4096 / 8) | 1011 | if (xtiles > 4096 / 8 || ytiles > 4096 / 8) |
1006 | gk20a_warn(&g->dev->dev, "cde: surface is exceptionally large (xtiles=%d, ytiles=%d)", | 1012 | gk20a_warn(&g->dev->dev, "cde: surface is exceptionally large (xtiles=%d, ytiles=%d)", |
1007 | xtiles, ytiles); | 1013 | xtiles, ytiles); |
@@ -1070,12 +1076,6 @@ int gk20a_prepare_compressible_read( | |||
1070 | struct dma_buf *dmabuf; | 1076 | struct dma_buf *dmabuf; |
1071 | u32 missing_bits; | 1077 | u32 missing_bits; |
1072 | 1078 | ||
1073 | if (!g->cde_app.initialised) { | ||
1074 | err = gk20a_cde_reload(g); | ||
1075 | if (err) | ||
1076 | return err; | ||
1077 | } | ||
1078 | |||
1079 | dmabuf = dma_buf_get(buffer_fd); | 1079 | dmabuf = dma_buf_get(buffer_fd); |
1080 | if (IS_ERR(dmabuf)) | 1080 | if (IS_ERR(dmabuf)) |
1081 | return -EINVAL; | 1081 | return -EINVAL; |
@@ -1145,7 +1145,7 @@ int gk20a_prepare_compressible_read( | |||
1145 | out: | 1145 | out: |
1146 | mutex_unlock(&state->lock); | 1146 | mutex_unlock(&state->lock); |
1147 | dma_buf_put(dmabuf); | 1147 | dma_buf_put(dmabuf); |
1148 | return 0; | 1148 | return err; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, | 1151 | int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, |