assert(render_state->curbe.bo->virtual);
constant_buffer = render_state->curbe.bo->virtual;
- if (obj_surface->fourcc == VA_FOURCC('N','V','1','2'))
- *constant_buffer = 1;
- else
- *constant_buffer = 0;
+ if (obj_surface->subsampling == SUBSAMPLE_YUV400) {
+ assert(obj_surface->fourcc == VA_FOURCC('I', 'M', 'C', '1') ||
+ obj_surface->fourcc == VA_FOURCC('I', 'M', 'C', '3'));
+ *constant_buffer = 2;
+ } else {
+ if (obj_surface->fourcc == VA_FOURCC('N', 'V', '1', '2'))
+ *constant_buffer = 1;
+ else
+ *constant_buffer = 0;
+ }
dri_bo_unmap(render_state->curbe.bo);
}
define(`src_msg_gen7', `g65')
define(`src_msg_ind_gen7',`65')
/* UV flag */
-define(`nv12', `g6.0<0,1,0>UW')
+define(`uv_flag', `g6.0<0,1,0>UW')
/* prepare sampler read back gX register, which would be written back to output */
/* use simd16 sampler, param 0 is u, param 1 is v. */
/* 'payload' loading, assuming tex coord start from g4 */
-cmp.g.f0.0 (1) null nv12 0x0UW {align1};
+cmp.e.f0.0 (1) null uv_flag 0x1UW {align1};
(f0.0) jmpi INTERLEAVED_UV;
+cmp.e.f0.0 (1) null uv_flag 0x2UW {align1};
+(f0.0) jmpi CONSTANT_UV;
+
/* load r */
mov (1) g0.8<1>UD 0x0000e000UD { align1 mask_disable };
mov (8) src_msg_gen7<1>UD g0<8,8,1>UD { align1 mask_disable };
jmpi SAMPLE_Y;
+CONSTANT_UV:
+mov (16) src_sample_g<1>f 0.5f { compr align1 mask_disable };
+mov (16) src_sample_b<1>f 0.5f { compr align1 mask_disable };
+
+jmpi SAMPLE_Y;
+
INTERLEAVED_UV:
mov (1) g0.8<1>UD 0x0000c000UD { align1 mask_disable };
mov (8) src_msg_gen7<1>UD g0<8,8,1>UD { align1 mask_disable };
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 4 { align1 }; /* required message len 5, readback len 8 */
+
SAMPLE_Y:
mov (1) g0.8<1>UD 0x0000e000UD { align1 mask_disable };
mov (8) src_msg_gen7<1>UD g0<8,8,1>UD { align1 mask_disable };
- { 0x03000010, 0x20002d3c, 0x000000c0, 0x00000000 },
+ { 0x01000010, 0x20002d3c, 0x000000c0, 0x00010001 },
+ { 0x00010020, 0x34001c00, 0x00001400, 0x00000018 },
+ { 0x01000010, 0x20002d3c, 0x000000c0, 0x00020002 },
{ 0x00010020, 0x34001c00, 0x00001400, 0x0000000e },
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x00600201, 0x28200021, 0x008d0000, 0x00000000 },
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x00600201, 0x28200021, 0x008d0000, 0x00000000 },
{ 0x02800031, 0x22401ca9, 0x00000820, 0x0a2c0405 },
+ { 0x00000020, 0x34001c00, 0x00001400, 0x0000000c },
+ { 0x00800201, 0x220003fd, 0x00000000, 0x3f000000 },
+ { 0x00800201, 0x224003fd, 0x00000000, 0x3f000000 },
{ 0x00000020, 0x34001c00, 0x00001400, 0x00000006 },
{ 0x00000201, 0x20080061, 0x00000000, 0x0000c000 },
{ 0x00600201, 0x28200021, 0x008d0000, 0x00000000 },