summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2014-09-10 12:46:26 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:15 -0400
commit41f6befed027c21fb9cecb0a1c0a1ad257c44704 (patch)
treee284c1338237ce49e57eca871306a9616992ca8d /drivers/gpu/nvgpu
parent9c17175a357e3be0f3a881f30095c961c12c196f (diff)
gpu: nvgpu: Support ZBC color tracking
The compression state tracking user space API already accepts and returns the ZBC color used for the surface. Actually store the color in kernel so that the feature works. Bug 1536227 Bug 1524301 Change-Id: I264e1eeb90f0c4d40fe35fc2479b0ce83e19a7d7 Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Reviewed-on: http://git-master/r/497476 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit 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/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c9
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.h6
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h3
4 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 2fad2f64..ad2ee159 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -1069,7 +1069,8 @@ int gk20a_prepare_compressible_read(
1069 u64 compbits_hoffset, u64 compbits_voffset, 1069 u64 compbits_hoffset, u64 compbits_voffset,
1070 u32 width, u32 height, u32 block_height_log2, 1070 u32 width, u32 height, u32 block_height_log2,
1071 u32 submit_flags, struct nvhost_fence *fence, 1071 u32 submit_flags, struct nvhost_fence *fence,
1072 u32 *valid_compbits, struct gk20a_fence **fence_out) 1072 u32 *valid_compbits, u32 *zbc_color,
1073 struct gk20a_fence **fence_out)
1073{ 1074{
1074 int err = 0; 1075 int err = 0;
1075 struct gk20a_buffer_state *state; 1076 struct gk20a_buffer_state *state;
@@ -1142,6 +1143,9 @@ int gk20a_prepare_compressible_read(
1142 if (valid_compbits) 1143 if (valid_compbits)
1143 *valid_compbits = state->valid_compbits; 1144 *valid_compbits = state->valid_compbits;
1144 1145
1146 if (zbc_color)
1147 *zbc_color = state->zbc_color;
1148
1145out: 1149out:
1146 mutex_unlock(&state->lock); 1150 mutex_unlock(&state->lock);
1147 dma_buf_put(dmabuf); 1151 dma_buf_put(dmabuf);
@@ -1149,7 +1153,7 @@ out:
1149} 1153}
1150 1154
1151int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, 1155int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd,
1152 u32 valid_compbits, u64 offset) 1156 u32 valid_compbits, u64 offset, u32 zbc_color)
1153{ 1157{
1154 int err; 1158 int err;
1155 struct gk20a_buffer_state *state; 1159 struct gk20a_buffer_state *state;
@@ -1172,6 +1176,7 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd,
1172 1176
1173 /* Update the compbits state. */ 1177 /* Update the compbits state. */
1174 state->valid_compbits = valid_compbits; 1178 state->valid_compbits = valid_compbits;
1179 state->zbc_color = zbc_color;
1175 1180
1176 /* Discard previous compbit job fence. */ 1181 /* Discard previous compbit job fence. */
1177 gk20a_fence_put(state->fence); 1182 gk20a_fence_put(state->fence);
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
index 4e6a8ec9..49296234 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
@@ -262,8 +262,10 @@ int gk20a_prepare_compressible_read(
262 u64 compbits_hoffset, u64 compbits_voffset, 262 u64 compbits_hoffset, u64 compbits_voffset,
263 u32 width, u32 height, u32 block_height_log2, 263 u32 width, u32 height, u32 block_height_log2,
264 u32 submit_flags, struct nvhost_fence *fence, 264 u32 submit_flags, struct nvhost_fence *fence,
265 u32 *valid_compbits, struct gk20a_fence **fence_out); 265 u32 *valid_compbits, u32 *zbc_color,
266 struct gk20a_fence **fence_out);
266int gk20a_mark_compressible_write( 267int gk20a_mark_compressible_write(
267 struct gk20a *g, u32 buffer_fd, u32 valid_compbits, u64 offset); 268 struct gk20a *g, u32 buffer_fd, u32 valid_compbits, u64 offset,
269 u32 zbc_color);
268 270
269#endif 271#endif
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 7338f842..18627f3e 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -97,7 +97,7 @@ static int gk20a_ctrl_prepare_compressible_read(
97 args->compbits_hoffset, args->compbits_voffset, 97 args->compbits_hoffset, args->compbits_voffset,
98 args->width, args->height, args->block_height_log2, 98 args->width, args->height, args->block_height_log2,
99 flags, &fence, &args->valid_compbits, 99 flags, &fence, &args->valid_compbits,
100 &fence_out); 100 &args->zbc_color, &fence_out);
101 gk20a_idle(g->dev); 101 gk20a_idle(g->dev);
102 102
103 if (ret) 103 if (ret)
@@ -139,7 +139,7 @@ static int gk20a_ctrl_mark_compressible_write(
139 139
140 gk20a_busy(g->dev); 140 gk20a_busy(g->dev);
141 ret = gk20a_mark_compressible_write(g, args->handle, 141 ret = gk20a_mark_compressible_write(g, args->handle,
142 args->valid_compbits, args->offset); 142 args->valid_compbits, args->offset, args->zbc_color);
143 gk20a_idle(g->dev); 143 gk20a_idle(g->dev);
144 144
145 return ret; 145 return ret;
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index f06c465a..89a2108b 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -192,6 +192,9 @@ struct gk20a_buffer_state {
192 /* A bitmask of valid sets of compbits (0 = uncompressed). */ 192 /* A bitmask of valid sets of compbits (0 = uncompressed). */
193 u32 valid_compbits; 193 u32 valid_compbits;
194 194
195 /* The ZBC color used on this buffer. */
196 u32 zbc_color;
197
195 /* This struct reflects the state of the buffer when this 198 /* This struct reflects the state of the buffer when this
196 * fence signals. */ 199 * fence signals. */
197 struct gk20a_fence *fence; 200 struct gk20a_fence *fence;