mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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>
This commit is contained in:
committed by
Dan Willemsen
parent
1d026d1f77
commit
9c17175a35
@@ -1002,6 +1002,12 @@ static int gk20a_buffer_convert_gpu_to_cde(
|
||||
const int gridw = roundup(tilepitch, wgx) / wgx;
|
||||
const int gridh = roundup(ytilesaligned, wgy) / wgy;
|
||||
|
||||
if (!g->cde_app.initialised) {
|
||||
err = gk20a_cde_reload(g);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (xtiles > 4096 / 8 || ytiles > 4096 / 8)
|
||||
gk20a_warn(&g->dev->dev, "cde: surface is exceptionally large (xtiles=%d, ytiles=%d)",
|
||||
xtiles, ytiles);
|
||||
@@ -1070,12 +1076,6 @@ int gk20a_prepare_compressible_read(
|
||||
struct dma_buf *dmabuf;
|
||||
u32 missing_bits;
|
||||
|
||||
if (!g->cde_app.initialised) {
|
||||
err = gk20a_cde_reload(g);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
dmabuf = dma_buf_get(buffer_fd);
|
||||
if (IS_ERR(dmabuf))
|
||||
return -EINVAL;
|
||||
@@ -1145,7 +1145,7 @@ int gk20a_prepare_compressible_read(
|
||||
out:
|
||||
mutex_unlock(&state->lock);
|
||||
dma_buf_put(dmabuf);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd,
|
||||
|
||||
Reference in New Issue
Block a user