hardware/intel/intel-driver
Revisión | babb2db34a42daccbcfa26baa4ff975761ecf92c (tree) |
---|---|
Tiempo | 2014-12-14 01:42:17 |
Autor | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
HEVC: gen9_hcpd_surface_state()
Set the frame buffer pitch and the offset to the chroma component in
HCP_SURFACE_STATE. Only surface id 0 is used for HEVC decoding
v2: Fix the command payload
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 657d5999179e70b290db08ea4ca4399d26f52c2c)
@@ -196,6 +196,32 @@ gen9_hcpd_pipe_mode_select(VADriverContextP ctx, | ||
196 | 196 | ADVANCE_BCS_BATCH(batch); |
197 | 197 | } |
198 | 198 | |
199 | +static void | |
200 | +gen9_hcpd_surface_state(VADriverContextP ctx, | |
201 | + struct decode_state *decode_state, | |
202 | + struct gen9_hcpd_context *gen9_hcpd_context) | |
203 | +{ | |
204 | + struct intel_batchbuffer *batch = gen9_hcpd_context->base.batch; | |
205 | + struct object_surface *obj_surface = decode_state->render_object; | |
206 | + unsigned int y_cb_offset; | |
207 | + | |
208 | + assert(obj_surface); | |
209 | + | |
210 | + y_cb_offset = obj_surface->y_cb_offset; | |
211 | + | |
212 | + BEGIN_BCS_BATCH(batch, 3); | |
213 | + | |
214 | + OUT_BCS_BATCH(batch, HCP_SURFACE_STATE | (3 - 2)); | |
215 | + OUT_BCS_BATCH(batch, | |
216 | + (0 << 28) | /* surface id */ | |
217 | + (obj_surface->width - 1)); /* pitch - 1 */ | |
218 | + OUT_BCS_BATCH(batch, | |
219 | + (SURFACE_FORMAT_PLANAR_420_8 << 28) | | |
220 | + y_cb_offset); | |
221 | + | |
222 | + ADVANCE_BCS_BATCH(batch); | |
223 | +} | |
224 | + | |
199 | 225 | static VAStatus |
200 | 226 | gen9_hcpd_hevc_decode_picture(VADriverContextP ctx, |
201 | 227 | struct decode_state *decode_state, |
@@ -213,6 +239,7 @@ gen9_hcpd_hevc_decode_picture(VADriverContextP ctx, | ||
213 | 239 | intel_batchbuffer_emit_mi_flush(batch); |
214 | 240 | |
215 | 241 | gen9_hcpd_pipe_mode_select(ctx, decode_state, HCP_CODEC_HEVC, gen9_hcpd_context); |
242 | + gen9_hcpd_surface_state(ctx, decode_state, gen9_hcpd_context); | |
216 | 243 | |
217 | 244 | intel_batchbuffer_end_atomic(batch); |
218 | 245 | intel_batchbuffer_flush(batch); |