* [PATCH xf86-video-intel 2/6] sna/gen6+: Split out wm_kernel from the sna_composite_op flags
2018-07-04 18:59 [PATCH xf86-video-intel 1/6] sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7 Ville Syrjala
@ 2018-07-04 18:59 ` Ville Syrjala
2018-07-04 19:08 ` Chris Wilson
2018-07-04 18:59 ` [PATCH xf86-video-intel 3/6] sna/vide/textured: Rename yuv shaders to indicate they handle limited range data Ville Syrjala
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Ville Syrjala @ 2018-07-04 18:59 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
With the extra video kernels we already ran out of bits in
the flags. To tackle that let's just split out the
wm_kernel to its own thing.
Fixes: e4f2b5d5af95 ("sna/video: Add XV_COLORSPACE attribute for the textured Xv adaptor")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
src/sna/gen6_render.c | 47 ++++++++++++++++++++++++++++-------------------
src/sna/gen7_render.c | 35 ++++++++++++++++++++++-------------
src/sna/gen8_render.c | 35 ++++++++++++++++++++++-------------
src/sna/gen9_render.c | 35 ++++++++++++++++++++++-------------
src/sna/sna_render.h | 4 ++++
5 files changed, 98 insertions(+), 58 deletions(-)
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 1558750325f0..99cc4b0ecb5c 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -224,18 +224,17 @@ static const struct blendinfo {
#define COPY_SAMPLER 0
#define COPY_VERTEX VERTEX_2s2s
-#define COPY_FLAGS(a) GEN6_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, GEN6_WM_KERNEL_NOMASK, COPY_VERTEX)
+#define COPY_FLAGS(a) GEN6_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, COPY_VERTEX)
#define FILL_SAMPLER (2 * sizeof(struct gen6_sampler_state))
#define FILL_VERTEX VERTEX_2s2s
-#define FILL_FLAGS(op, format) GEN6_SET_FLAGS(FILL_SAMPLER, gen6_get_blend((op), false, (format)), GEN6_WM_KERNEL_NOMASK, FILL_VERTEX)
-#define FILL_FLAGS_NOBLEND GEN6_SET_FLAGS(FILL_SAMPLER, NO_BLEND, GEN6_WM_KERNEL_NOMASK, FILL_VERTEX)
+#define FILL_FLAGS(op, format) GEN6_SET_FLAGS(FILL_SAMPLER, gen6_get_blend((op), false, (format)), FILL_VERTEX)
+#define FILL_FLAGS_NOBLEND GEN6_SET_FLAGS(FILL_SAMPLER, NO_BLEND, FILL_VERTEX)
#define GEN6_SAMPLER(f) (((f) >> 16) & 0xfff0)
#define GEN6_BLEND(f) (((f) >> 0) & 0xfff0)
-#define GEN6_KERNEL(f) (((f) >> 16) & 0xf)
#define GEN6_VERTEX(f) (((f) >> 0) & 0xf)
-#define GEN6_SET_FLAGS(S, B, K, V) (((S) | (K)) << 16 | ((B) | (V)))
+#define GEN6_SET_FLAGS(S, B, V) ((S) << 16 | ((B) | (V)))
#define OUT_BATCH(v) batch_emit(sna, v)
#define OUT_VERTEX(x,y) vertex_emit_2s(sna, x,y)
@@ -967,7 +966,7 @@ gen6_emit_state(struct sna *sna,
gen6_emit_cc(sna, GEN6_BLEND(op->u.gen6.flags));
gen6_emit_sampler(sna, GEN6_SAMPLER(op->u.gen6.flags));
gen6_emit_sf(sna, GEN6_VERTEX(op->u.gen6.flags) >> 2);
- gen6_emit_wm(sna, GEN6_KERNEL(op->u.gen6.flags), GEN6_VERTEX(op->u.gen6.flags) >> 2);
+ gen6_emit_wm(sna, op->u.gen6.wm_kernel, GEN6_VERTEX(op->u.gen6.flags) >> 2);
gen6_emit_vertex_elements(sna, op);
gen6_emit_binding_table(sna, wm_binding_table);
@@ -1252,7 +1251,7 @@ static int gen6_get_rectangles__flush(struct sna *sna,
gen6_emit_pipe_stall(sna);
gen6_emit_cc(sna, GEN6_BLEND(op->u.gen6.flags));
gen6_emit_wm(sna,
- GEN6_KERNEL(op->u.gen6.flags),
+ op->u.gen6.wm_kernel,
GEN6_VERTEX(op->u.gen6.flags) >> 2);
}
}
@@ -1732,8 +1731,8 @@ gen6_render_video(struct sna *sna,
GEN6_SET_FLAGS(SAMPLER_OFFSET(filter, SAMPLER_EXTEND_PAD,
SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE),
NO_BLEND,
- select_video_kernel(video, frame),
2);
+ tmp.u.gen6.wm_kernel = select_video_kernel(video, frame);
tmp.priv = frame;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
@@ -2417,11 +2416,11 @@ gen6_render_composite(struct sna *sna,
gen6_get_blend(tmp->op,
tmp->has_component_alpha,
tmp->dst.format),
- gen6_choose_composite_kernel(tmp->op,
- tmp->mask.bo != NULL,
- tmp->has_component_alpha,
- tmp->is_affine),
gen4_choose_composite_emitter(sna, tmp));
+ tmp->u.gen6.wm_kernel = gen6_choose_composite_kernel(tmp->op,
+ tmp->mask.bo != NULL,
+ tmp->has_component_alpha,
+ tmp->is_affine);
tmp->blt = gen6_render_composite_blt;
tmp->box = gen6_render_composite_box;
@@ -2669,8 +2668,9 @@ gen6_render_composite_spans(struct sna *sna,
SAMPLER_FILTER_NEAREST,
SAMPLER_EXTEND_PAD),
gen6_get_blend(tmp->base.op, false, tmp->base.dst.format),
- GEN6_WM_KERNEL_OPACITY | !tmp->base.is_affine,
gen4_choose_spans_emitter(sna, tmp));
+ tmp->base.u.gen6.wm_kernel =
+ GEN6_WM_KERNEL_OPACITY | !tmp->base.is_affine;
tmp->box = gen6_render_composite_spans_box;
tmp->boxes = gen6_render_composite_spans_boxes;
@@ -2928,7 +2928,8 @@ fallback_blt:
tmp.need_magic_ca_pass = 0;
tmp.u.gen6.flags = COPY_FLAGS(alu);
- assert(GEN6_KERNEL(tmp.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ tmp.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(tmp.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(tmp.u.gen6.flags) == COPY_SAMPLER);
assert(GEN6_VERTEX(tmp.u.gen6.flags) == COPY_VERTEX);
@@ -3102,7 +3103,8 @@ fallback:
op->base.floats_per_rect = 6;
op->base.u.gen6.flags = COPY_FLAGS(alu);
- assert(GEN6_KERNEL(op->base.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ op->base.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(op->base.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(op->base.u.gen6.flags) == COPY_SAMPLER);
assert(GEN6_VERTEX(op->base.u.gen6.flags) == COPY_VERTEX);
@@ -3247,7 +3249,8 @@ gen6_render_fill_boxes(struct sna *sna,
tmp.need_magic_ca_pass = false;
tmp.u.gen6.flags = FILL_FLAGS(op, format);
- assert(GEN6_KERNEL(tmp.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ tmp.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(tmp.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(tmp.u.gen6.flags) == FILL_SAMPLER);
assert(GEN6_VERTEX(tmp.u.gen6.flags) == FILL_VERTEX);
@@ -3427,7 +3430,8 @@ gen6_render_fill(struct sna *sna, uint8_t alu,
op->base.floats_per_rect = 6;
op->base.u.gen6.flags = FILL_FLAGS_NOBLEND;
- assert(GEN6_KERNEL(op->base.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ op->base.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(op->base.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(op->base.u.gen6.flags) == FILL_SAMPLER);
assert(GEN6_VERTEX(op->base.u.gen6.flags) == FILL_VERTEX);
@@ -3509,7 +3513,8 @@ gen6_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.need_magic_ca_pass = false;
tmp.u.gen6.flags = FILL_FLAGS_NOBLEND;
- assert(GEN6_KERNEL(tmp.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ tmp.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(tmp.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(tmp.u.gen6.flags) == FILL_SAMPLER);
assert(GEN6_VERTEX(tmp.u.gen6.flags) == FILL_VERTEX);
@@ -3596,7 +3601,8 @@ gen6_render_clear(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo)
tmp.need_magic_ca_pass = false;
tmp.u.gen6.flags = FILL_FLAGS_NOBLEND;
- assert(GEN6_KERNEL(tmp.u.gen6.flags) == GEN6_WM_KERNEL_NOMASK);
+ tmp.u.gen6.wm_kernel = GEN6_WM_KERNEL_NOMASK;
+ assert(tmp.u.gen6.wm_kernel == GEN6_WM_KERNEL_NOMASK);
assert(GEN6_SAMPLER(tmp.u.gen6.flags) == FILL_SAMPLER);
assert(GEN6_VERTEX(tmp.u.gen6.flags) == FILL_VERTEX);
@@ -3725,6 +3731,9 @@ static bool gen6_render_setup(struct sna *sna, int devid)
}
}
+ COMPILE_TIME_ASSERT(GEN6_KERNEL_COUNT <=
+ 1 << (sizeof(((struct sna_composite_op *)NULL)->u.gen6.wm_kernel) * 8));
+
COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
ss = sna_static_stream_map(&general,
2 * sizeof(*ss) *
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 671f60e07679..cffe17de6d0d 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -321,19 +321,18 @@ static const struct blendinfo {
#define COPY_SAMPLER 0
#define COPY_VERTEX VERTEX_2s2s
-#define COPY_FLAGS(a) GEN7_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, GEN7_WM_KERNEL_NOMASK, COPY_VERTEX)
+#define COPY_FLAGS(a) GEN7_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, COPY_VERTEX)
#define FILL_SAMPLER (2 * sizeof(struct gen7_sampler_state))
#define FILL_VERTEX VERTEX_2s2s
-#define FILL_FLAGS(op, format) GEN7_SET_FLAGS(FILL_SAMPLER, gen7_get_blend((op), false, (format)), GEN7_WM_KERNEL_NOMASK, FILL_VERTEX)
-#define FILL_FLAGS_NOBLEND GEN7_SET_FLAGS(FILL_SAMPLER, NO_BLEND, GEN7_WM_KERNEL_NOMASK, FILL_VERTEX)
+#define FILL_FLAGS(op, format) GEN7_SET_FLAGS(FILL_SAMPLER, gen7_get_blend((op), false, (format)), FILL_VERTEX)
+#define FILL_FLAGS_NOBLEND GEN7_SET_FLAGS(FILL_SAMPLER, NO_BLEND, FILL_VERTEX)
#define GEN7_SAMPLER(f) (((f) >> 16) & 0xfff0)
#define GEN7_BLEND(f) (((f) >> 0) & 0x7ff0)
#define GEN7_READS_DST(f) (((f) >> 15) & 1)
-#define GEN7_KERNEL(f) (((f) >> 16) & 0xf)
#define GEN7_VERTEX(f) (((f) >> 0) & 0xf)
-#define GEN7_SET_FLAGS(S, B, K, V) (((S) | (K)) << 16 | ((B) | (V)))
+#define GEN7_SET_FLAGS(S, B, V) ((S) << 16 | ((B) | (V)))
#define OUT_BATCH(v) batch_emit(sna, v)
#define OUT_VERTEX(x,y) vertex_emit_2s(sna, x,y)
@@ -1188,7 +1187,7 @@ gen7_emit_state(struct sna *sna,
gen7_emit_cc(sna, GEN7_BLEND(op->u.gen7.flags));
gen7_emit_sampler(sna, GEN7_SAMPLER(op->u.gen7.flags));
gen7_emit_sf(sna, GEN7_VERTEX(op->u.gen7.flags) >> 2);
- gen7_emit_wm(sna, GEN7_KERNEL(op->u.gen7.flags));
+ gen7_emit_wm(sna, op->u.gen7.wm_kernel);
gen7_emit_vertex_elements(sna, op);
gen7_emit_binding_table(sna, wm_binding_table);
@@ -1453,7 +1452,7 @@ static int gen7_get_rectangles__flush(struct sna *sna,
if (gen7_magic_ca_pass(sna, op)) {
gen7_emit_pipe_stall(sna);
gen7_emit_cc(sna, GEN7_BLEND(op->u.gen7.flags));
- gen7_emit_wm(sna, GEN7_KERNEL(op->u.gen7.flags));
+ gen7_emit_wm(sna, op->u.gen7.wm_kernel);
}
}
@@ -1949,8 +1948,8 @@ gen7_render_video(struct sna *sna,
GEN7_SET_FLAGS(SAMPLER_OFFSET(filter, SAMPLER_EXTEND_PAD,
SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE),
NO_BLEND,
- select_video_kernel(video, frame),
2);
+ tmp.u.gen7.wm_kernel = select_video_kernel(video, frame);
tmp.priv = frame;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
@@ -2647,11 +2646,11 @@ gen7_render_composite(struct sna *sna,
gen7_get_blend(tmp->op,
tmp->has_component_alpha,
tmp->dst.format),
- gen7_choose_composite_kernel(tmp->op,
- tmp->mask.bo != NULL,
- tmp->has_component_alpha,
- tmp->is_affine),
gen4_choose_composite_emitter(sna, tmp));
+ tmp->u.gen7.wm_kernel = gen7_choose_composite_kernel(tmp->op,
+ tmp->mask.bo != NULL,
+ tmp->has_component_alpha,
+ tmp->is_affine);
tmp->blt = gen7_render_composite_blt;
tmp->box = gen7_render_composite_box;
@@ -2879,8 +2878,9 @@ gen7_render_composite_spans(struct sna *sna,
SAMPLER_FILTER_NEAREST,
SAMPLER_EXTEND_PAD),
gen7_get_blend(tmp->base.op, false, tmp->base.dst.format),
- GEN7_WM_KERNEL_OPACITY | !tmp->base.is_affine,
gen4_choose_spans_emitter(sna, tmp));
+ tmp->base.u.gen7.wm_kernel =
+ GEN7_WM_KERNEL_OPACITY | !tmp->base.is_affine;
tmp->box = gen7_render_composite_spans_box;
tmp->boxes = gen7_render_composite_spans_boxes;
@@ -3141,6 +3141,7 @@ fallback_blt:
tmp.need_magic_ca_pass = 0;
tmp.u.gen7.flags = COPY_FLAGS(alu);
+ tmp.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
@@ -3308,6 +3309,7 @@ fallback:
op->base.floats_per_rect = 6;
op->base.u.gen7.flags = COPY_FLAGS(alu);
+ op->base.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
@@ -3461,6 +3463,7 @@ gen7_render_fill_boxes(struct sna *sna,
tmp.need_magic_ca_pass = false;
tmp.u.gen7.flags = FILL_FLAGS(op, format);
+ tmp.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3642,6 +3645,7 @@ gen7_render_fill(struct sna *sna, uint8_t alu,
op->base.floats_per_rect = 6;
op->base.u.gen7.flags = FILL_FLAGS_NOBLEND;
+ op->base.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3726,6 +3730,7 @@ gen7_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.need_magic_ca_pass = false;
tmp.u.gen7.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3811,6 +3816,7 @@ gen7_render_clear(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo)
tmp.need_magic_ca_pass = false;
tmp.u.gen7.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen7.wm_kernel = GEN7_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3958,6 +3964,9 @@ static bool gen7_render_setup(struct sna *sna, int devid)
assert(state->wm_kernel[m][0]|state->wm_kernel[m][1]|state->wm_kernel[m][2]);
}
+ COMPILE_TIME_ASSERT(GEN7_WM_KERNEL_COUNT <=
+ 1 << (sizeof(((struct sna_composite_op *)NULL)->u.gen7.wm_kernel) * 8));
+
COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
ss = sna_static_stream_map(&general,
2 * sizeof(*ss) *
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 69617da561b6..9bac9b8bb6be 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -225,19 +225,18 @@ static const struct blendinfo {
#define COPY_SAMPLER 0
#define COPY_VERTEX VERTEX_2s2s
-#define COPY_FLAGS(a) GEN8_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, GEN8_WM_KERNEL_NOMASK, COPY_VERTEX)
+#define COPY_FLAGS(a) GEN8_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, COPY_VERTEX)
#define FILL_SAMPLER 1
#define FILL_VERTEX VERTEX_2s2s
-#define FILL_FLAGS(op, format) GEN8_SET_FLAGS(FILL_SAMPLER, gen8_get_blend((op), false, (format)), GEN8_WM_KERNEL_NOMASK, FILL_VERTEX)
-#define FILL_FLAGS_NOBLEND GEN8_SET_FLAGS(FILL_SAMPLER, NO_BLEND, GEN8_WM_KERNEL_NOMASK, FILL_VERTEX)
+#define FILL_FLAGS(op, format) GEN8_SET_FLAGS(FILL_SAMPLER, gen8_get_blend((op), false, (format)), FILL_VERTEX)
+#define FILL_FLAGS_NOBLEND GEN8_SET_FLAGS(FILL_SAMPLER, NO_BLEND, FILL_VERTEX)
#define GEN8_SAMPLER(f) (((f) >> 20) & 0xfff)
#define GEN8_BLEND(f) (((f) >> 4) & 0x7ff)
#define GEN8_READS_DST(f) (((f) >> 15) & 1)
-#define GEN8_KERNEL(f) (((f) >> 16) & 0xf)
#define GEN8_VERTEX(f) (((f) >> 0) & 0xf)
-#define GEN8_SET_FLAGS(S, B, K, V) ((S) << 20 | (K) << 16 | (B) | (V))
+#define GEN8_SET_FLAGS(S, B, V) ((S) << 20 | (B) | (V))
#define OUT_BATCH(v) batch_emit(sna, v)
#define OUT_BATCH64(v) batch_emit64(sna, v)
@@ -1286,7 +1285,7 @@ gen8_emit_state(struct sna *sna,
gen8_emit_cc(sna, GEN8_BLEND(op->u.gen8.flags));
gen8_emit_sampler(sna, GEN8_SAMPLER(op->u.gen8.flags));
gen8_emit_sf(sna, GEN8_VERTEX(op->u.gen8.flags) >> 2);
- gen8_emit_wm(sna, GEN8_KERNEL(op->u.gen8.flags));
+ gen8_emit_wm(sna, op->u.gen8.wm_kernel);
gen8_emit_vertex_elements(sna, op);
gen8_emit_binding_table(sna, wm_binding_table);
@@ -1557,7 +1556,7 @@ static int gen8_get_rectangles__flush(struct sna *sna,
if (gen8_magic_ca_pass(sna, op)) {
gen8_emit_pipe_invalidate(sna);
gen8_emit_cc(sna, GEN8_BLEND(op->u.gen8.flags));
- gen8_emit_wm(sna, GEN8_KERNEL(op->u.gen8.flags));
+ gen8_emit_wm(sna, op->u.gen8.wm_kernel);
}
}
@@ -2485,11 +2484,11 @@ gen8_render_composite(struct sna *sna,
gen8_get_blend(tmp->op,
tmp->has_component_alpha,
tmp->dst.format),
- gen8_choose_composite_kernel(tmp->op,
- tmp->mask.bo != NULL,
- tmp->has_component_alpha,
- tmp->is_affine),
gen4_choose_composite_emitter(sna, tmp));
+ tmp->u.gen8.wm_kernel = gen8_choose_composite_kernel(tmp->op,
+ tmp->mask.bo != NULL,
+ tmp->has_component_alpha,
+ tmp->is_affine);
tmp->blt = gen8_render_composite_blt;
tmp->box = gen8_render_composite_box;
@@ -2718,8 +2717,9 @@ gen8_render_composite_spans(struct sna *sna,
SAMPLER_FILTER_NEAREST,
SAMPLER_EXTEND_PAD),
gen8_get_blend(tmp->base.op, false, tmp->base.dst.format),
- GEN8_WM_KERNEL_OPACITY | !tmp->base.is_affine,
gen4_choose_spans_emitter(sna, tmp));
+ tmp->base.u.gen8.wm_kernel =
+ GEN8_WM_KERNEL_OPACITY | !tmp->base.is_affine;
tmp->box = gen8_render_composite_spans_box;
tmp->boxes = gen8_render_composite_spans_boxes;
@@ -2982,6 +2982,7 @@ fallback_blt:
tmp.need_magic_ca_pass = 0;
tmp.u.gen8.flags = COPY_FLAGS(alu);
+ tmp.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
@@ -3151,6 +3152,7 @@ fallback:
op->base.floats_per_rect = 6;
op->base.u.gen8.flags = COPY_FLAGS(alu);
+ op->base.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
@@ -3303,6 +3305,7 @@ gen8_render_fill_boxes(struct sna *sna,
tmp.need_magic_ca_pass = false;
tmp.u.gen8.flags = FILL_FLAGS(op, format);
+ tmp.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3489,6 +3492,7 @@ gen8_render_fill(struct sna *sna, uint8_t alu,
op->base.floats_per_rect = 6;
op->base.u.gen8.flags = FILL_FLAGS_NOBLEND;
+ op->base.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3574,6 +3578,7 @@ gen8_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.need_magic_ca_pass = false;
tmp.u.gen8.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3660,6 +3665,7 @@ gen8_render_clear(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo)
tmp.need_magic_ca_pass = false;
tmp.u.gen8.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen8.wm_kernel = GEN8_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3901,8 +3907,8 @@ gen8_render_video(struct sna *sna,
GEN8_SET_FLAGS(SAMPLER_OFFSET(filter, SAMPLER_EXTEND_PAD,
SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE),
NO_BLEND,
- select_video_kernel(video, frame),
2);
+ tmp.u.gen8.wm_kernel = select_video_kernel(video, frame);
tmp.priv = frame;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
@@ -4066,6 +4072,9 @@ static bool gen8_render_setup(struct sna *sna)
assert(state->wm_kernel[m][0]|state->wm_kernel[m][1]|state->wm_kernel[m][2]);
}
+ COMPILE_TIME_ASSERT(GEN8_WM_KERNEL_COUNT <=
+ 1 << (sizeof(((struct sna_composite_op *)NULL)->u.gen8.wm_kernel) * 8));
+
COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0x7ff);
ss = sna_static_stream_map(&general,
2 * sizeof(*ss) *
diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c
index 505b98afa38c..eb22b642ffa1 100644
--- a/src/sna/gen9_render.c
+++ b/src/sna/gen9_render.c
@@ -226,19 +226,18 @@ static const struct blendinfo {
#define COPY_SAMPLER 0
#define COPY_VERTEX VERTEX_2s2s
-#define COPY_FLAGS(a) GEN9_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, GEN9_WM_KERNEL_NOMASK, COPY_VERTEX)
+#define COPY_FLAGS(a) GEN9_SET_FLAGS(COPY_SAMPLER, (a) == GXcopy ? NO_BLEND : CLEAR, COPY_VERTEX)
#define FILL_SAMPLER 1
#define FILL_VERTEX VERTEX_2s2s
-#define FILL_FLAGS(op, format) GEN9_SET_FLAGS(FILL_SAMPLER, gen9_get_blend((op), false, (format)), GEN9_WM_KERNEL_NOMASK, FILL_VERTEX)
-#define FILL_FLAGS_NOBLEND GEN9_SET_FLAGS(FILL_SAMPLER, NO_BLEND, GEN9_WM_KERNEL_NOMASK, FILL_VERTEX)
+#define FILL_FLAGS(op, format) GEN9_SET_FLAGS(FILL_SAMPLER, gen9_get_blend((op), false, (format)), FILL_VERTEX)
+#define FILL_FLAGS_NOBLEND GEN9_SET_FLAGS(FILL_SAMPLER, NO_BLEND, FILL_VERTEX)
#define GEN9_SAMPLER(f) (((f) >> 20) & 0xfff)
#define GEN9_BLEND(f) (((f) >> 4) & 0x7ff)
#define GEN9_READS_DST(f) (((f) >> 15) & 1)
-#define GEN9_KERNEL(f) (((f) >> 16) & 0xf)
#define GEN9_VERTEX(f) (((f) >> 0) & 0xf)
-#define GEN9_SET_FLAGS(S, B, K, V) ((S) << 20 | (K) << 16 | (B) | (V))
+#define GEN9_SET_FLAGS(S, B, V) ((S) << 20 | (B) | (V))
#define OUT_BATCH(v) batch_emit(sna, v)
#define OUT_BATCH64(v) batch_emit64(sna, v)
@@ -1349,7 +1348,7 @@ gen9_emit_state(struct sna *sna,
gen9_emit_cc(sna, GEN9_BLEND(op->u.gen9.flags));
gen9_emit_sampler(sna, GEN9_SAMPLER(op->u.gen9.flags));
gen9_emit_sf(sna, GEN9_VERTEX(op->u.gen9.flags) >> 2);
- gen9_emit_wm(sna, GEN9_KERNEL(op->u.gen9.flags));
+ gen9_emit_wm(sna, op->u.gen9.wm_kernel);
gen9_emit_vertex_elements(sna, op);
gen9_emit_binding_table(sna, wm_binding_table);
@@ -1618,7 +1617,7 @@ static int gen9_get_rectangles__flush(struct sna *sna,
if (gen9_magic_ca_pass(sna, op)) {
gen9_emit_pipe_invalidate(sna);
gen9_emit_cc(sna, GEN9_BLEND(op->u.gen9.flags));
- gen9_emit_wm(sna, GEN9_KERNEL(op->u.gen9.flags));
+ gen9_emit_wm(sna, op->u.gen9.wm_kernel);
}
}
@@ -2548,11 +2547,11 @@ gen9_render_composite(struct sna *sna,
gen9_get_blend(tmp->op,
tmp->has_component_alpha,
tmp->dst.format),
- gen9_choose_composite_kernel(tmp->op,
- tmp->mask.bo != NULL,
- tmp->has_component_alpha,
- tmp->is_affine),
gen4_choose_composite_emitter(sna, tmp));
+ tmp->u.gen9.wm_kernel = gen9_choose_composite_kernel(tmp->op,
+ tmp->mask.bo != NULL,
+ tmp->has_component_alpha,
+ tmp->is_affine);
tmp->blt = gen9_render_composite_blt;
tmp->box = gen9_render_composite_box;
@@ -2781,8 +2780,9 @@ gen9_render_composite_spans(struct sna *sna,
SAMPLER_FILTER_NEAREST,
SAMPLER_EXTEND_PAD),
gen9_get_blend(tmp->base.op, false, tmp->base.dst.format),
- GEN9_WM_KERNEL_OPACITY | !tmp->base.is_affine,
gen4_choose_spans_emitter(sna, tmp));
+ tmp->base.u.gen9.wm_kernel =
+ GEN9_WM_KERNEL_OPACITY | !tmp->base.is_affine;
tmp->box = gen9_render_composite_spans_box;
tmp->boxes = gen9_render_composite_spans_boxes;
@@ -3045,6 +3045,7 @@ fallback_blt:
tmp.need_magic_ca_pass = 0;
tmp.u.gen9.flags = COPY_FLAGS(alu);
+ tmp.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
if (!kgem_check_bo(&sna->kgem, tmp.dst.bo, tmp.src.bo, NULL)) {
@@ -3214,6 +3215,7 @@ fallback:
op->base.floats_per_rect = 6;
op->base.u.gen9.flags = COPY_FLAGS(alu);
+ op->base.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
@@ -3366,6 +3368,7 @@ gen9_render_fill_boxes(struct sna *sna,
tmp.need_magic_ca_pass = false;
tmp.u.gen9.flags = FILL_FLAGS(op, format);
+ tmp.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3552,6 +3555,7 @@ gen9_render_fill(struct sna *sna, uint8_t alu,
op->base.floats_per_rect = 6;
op->base.u.gen9.flags = FILL_FLAGS_NOBLEND;
+ op->base.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, dst_bo);
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -3637,6 +3641,7 @@ gen9_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.need_magic_ca_pass = false;
tmp.u.gen9.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3723,6 +3728,7 @@ gen9_render_clear(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo)
tmp.need_magic_ca_pass = false;
tmp.u.gen9.flags = FILL_FLAGS_NOBLEND;
+ tmp.u.gen9.wm_kernel = GEN9_WM_KERNEL_NOMASK;
kgem_set_mode(&sna->kgem, KGEM_RENDER, bo);
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -3964,8 +3970,8 @@ gen9_render_video(struct sna *sna,
GEN9_SET_FLAGS(SAMPLER_OFFSET(filter, SAMPLER_EXTEND_PAD,
SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE),
NO_BLEND,
- select_video_kernel(video, frame),
2);
+ tmp.u.gen9.wm_kernel = select_video_kernel(video, frame);
tmp.priv = frame;
kgem_set_mode(&sna->kgem, KGEM_RENDER, tmp.dst.bo);
@@ -4135,6 +4141,9 @@ static bool gen9_render_setup(struct sna *sna)
assert(state->wm_kernel[m][0]|state->wm_kernel[m][1]|state->wm_kernel[m][2]);
}
+ COMPILE_TIME_ASSERT(GEN9_WM_KERNEL_COUNT <=
+ 1 << (sizeof(((struct sna_composite_op *)NULL)->u.gen9.wm_kernel) * 8));
+
COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0x7ff);
ss = sna_static_stream_map(&general,
2 * sizeof(*ss) *
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 6669af9d1cd8..442a6ec50191 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -139,18 +139,22 @@ struct sna_composite_op {
struct {
uint32_t flags;
+ uint8_t wm_kernel;
} gen6;
struct {
uint32_t flags;
+ uint8_t wm_kernel;
} gen7;
struct {
uint32_t flags;
+ uint8_t wm_kernel;
} gen8;
struct {
uint32_t flags;
+ uint8_t wm_kernel;
} gen9;
} u;
--
2.16.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH xf86-video-intel 3/6] sna/vide/textured: Rename yuv shaders to indicate they handle limited range data
2018-07-04 18:59 [PATCH xf86-video-intel 1/6] sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7 Ville Syrjala
2018-07-04 18:59 ` [PATCH xf86-video-intel 2/6] sna/gen6+: Split out wm_kernel from the sna_composite_op flags Ville Syrjala
@ 2018-07-04 18:59 ` Ville Syrjala
2018-07-04 18:59 ` [PATCH xf86-video-intel 4/6] sna/video/textured: Add shaders to deal with full range yuv data Ville Syrjala
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjala @ 2018-07-04 18:59 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Rename the current yuv->rgb shaders in anticipation of variants that
will deal with full range yuv data.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
src/render_program/Makefile.am | 44 ++++++++++----------
src/render_program/exa_wm_yuv_rgb_bt601.g5a | 1 -
src/render_program/exa_wm_yuv_rgb_bt601.g6a | 1 -
src/render_program/exa_wm_yuv_rgb_bt601.g7a | 1 -
..._bt601.g4a => exa_wm_yuv_rgb_bt601_limited.g4a} | 0
..._bt601.g4b => exa_wm_yuv_rgb_bt601_limited.g4b} | 0
....gen5 => exa_wm_yuv_rgb_bt601_limited.g4b.gen5} | 0
.../exa_wm_yuv_rgb_bt601_limited.g5a | 1 +
..._bt601.g5b => exa_wm_yuv_rgb_bt601_limited.g5b} | 0
.../exa_wm_yuv_rgb_bt601_limited.g6a | 1 +
..._bt601.g6b => exa_wm_yuv_rgb_bt601_limited.g6b} | 0
.../exa_wm_yuv_rgb_bt601_limited.g7a | 1 +
..._bt601.g7b => exa_wm_yuv_rgb_bt601_limited.g7b} | 0
..._bt601.g8a => exa_wm_yuv_rgb_bt601_limited.g8a} | 0
..._bt601.g8b => exa_wm_yuv_rgb_bt601_limited.g8b} | 0
src/render_program/exa_wm_yuv_rgb_bt709.g5a | 1 -
src/render_program/exa_wm_yuv_rgb_bt709.g6a | 1 -
src/render_program/exa_wm_yuv_rgb_bt709.g7a | 1 -
..._bt709.g4a => exa_wm_yuv_rgb_bt709_limited.g4a} | 0
..._bt709.g4b => exa_wm_yuv_rgb_bt709_limited.g4b} | 0
....gen5 => exa_wm_yuv_rgb_bt709_limited.g4b.gen5} | 0
.../exa_wm_yuv_rgb_bt709_limited.g5a | 1 +
..._bt709.g5b => exa_wm_yuv_rgb_bt709_limited.g5b} | 0
.../exa_wm_yuv_rgb_bt709_limited.g6a | 1 +
..._bt709.g6b => exa_wm_yuv_rgb_bt709_limited.g6b} | 0
.../exa_wm_yuv_rgb_bt709_limited.g7a | 1 +
..._bt709.g7b => exa_wm_yuv_rgb_bt709_limited.g7b} | 0
..._bt709.g8a => exa_wm_yuv_rgb_bt709_limited.g8a} | 0
..._bt709.g8b => exa_wm_yuv_rgb_bt709_limited.g8b} | 0
src/sna/brw/brw_test_gen4.c | 4 +-
src/sna/brw/brw_test_gen5.c | 4 +-
src/sna/brw/brw_test_gen6.c | 4 +-
src/sna/brw/brw_test_gen7.c | 4 +-
src/sna/gen4_render.c | 48 +++++++++++-----------
src/sna/gen4_render.h | 12 +++---
src/sna/gen5_render.c | 48 +++++++++++-----------
src/sna/gen5_render.h | 12 +++---
src/sna/gen6_render.c | 48 +++++++++++-----------
src/sna/gen7_render.c | 48 +++++++++++-----------
src/sna/gen8_render.c | 48 +++++++++++-----------
src/sna/gen9_render.c | 48 +++++++++++-----------
src/sna/sna_render.h | 48 +++++++++++-----------
src/uxa/i965_video.c | 16 ++++----
43 files changed, 224 insertions(+), 224 deletions(-)
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt601.g5a
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt601.g6a
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt601.g7a
rename src/render_program/{exa_wm_yuv_rgb_bt601.g4a => exa_wm_yuv_rgb_bt601_limited.g4a} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt601.g4b => exa_wm_yuv_rgb_bt601_limited.g4b} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt601.g4b.gen5 => exa_wm_yuv_rgb_bt601_limited.g4b.gen5} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_limited.g5a
rename src/render_program/{exa_wm_yuv_rgb_bt601.g5b => exa_wm_yuv_rgb_bt601_limited.g5b} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_limited.g6a
rename src/render_program/{exa_wm_yuv_rgb_bt601.g6b => exa_wm_yuv_rgb_bt601_limited.g6b} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_limited.g7a
rename src/render_program/{exa_wm_yuv_rgb_bt601.g7b => exa_wm_yuv_rgb_bt601_limited.g7b} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt601.g8a => exa_wm_yuv_rgb_bt601_limited.g8a} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt601.g8b => exa_wm_yuv_rgb_bt601_limited.g8b} (100%)
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt709.g5a
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt709.g6a
delete mode 120000 src/render_program/exa_wm_yuv_rgb_bt709.g7a
rename src/render_program/{exa_wm_yuv_rgb_bt709.g4a => exa_wm_yuv_rgb_bt709_limited.g4a} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt709.g4b => exa_wm_yuv_rgb_bt709_limited.g4b} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt709.g4b.gen5 => exa_wm_yuv_rgb_bt709_limited.g4b.gen5} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_limited.g5a
rename src/render_program/{exa_wm_yuv_rgb_bt709.g5b => exa_wm_yuv_rgb_bt709_limited.g5b} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_limited.g6a
rename src/render_program/{exa_wm_yuv_rgb_bt709.g6b => exa_wm_yuv_rgb_bt709_limited.g6b} (100%)
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_limited.g7a
rename src/render_program/{exa_wm_yuv_rgb_bt709.g7b => exa_wm_yuv_rgb_bt709_limited.g7b} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt709.g8a => exa_wm_yuv_rgb_bt709_limited.g8a} (100%)
rename src/render_program/{exa_wm_yuv_rgb_bt709.g8b => exa_wm_yuv_rgb_bt709_limited.g8b} (100%)
diff --git a/src/render_program/Makefile.am b/src/render_program/Makefile.am
index dc58138f356e..e7592a627e11 100644
--- a/src/render_program/Makefile.am
+++ b/src/render_program/Makefile.am
@@ -15,8 +15,8 @@ INTEL_G4A = \
exa_wm_ca.g4a \
exa_wm_ca_srcalpha.g4a \
exa_wm_write.g4a \
- exa_wm_yuv_rgb_bt601.g4a \
- exa_wm_yuv_rgb_bt709.g4a \
+ exa_wm_yuv_rgb_bt601_limited.g4a \
+ exa_wm_yuv_rgb_bt709_limited.g4a \
exa_wm_xy.g4a \
$(NULL)
@@ -46,8 +46,8 @@ INTEL_G4B = \
exa_wm_ca.g4b \
exa_wm_ca_srcalpha.g4b \
exa_wm_write.g4b \
- exa_wm_yuv_rgb_bt601.g4b \
- exa_wm_yuv_rgb_bt709.g4b \
+ exa_wm_yuv_rgb_bt601_limited.g4b \
+ exa_wm_yuv_rgb_bt709_limited.g4b \
exa_wm_xy.g4b \
$(NULL)
@@ -69,8 +69,8 @@ INTEL_G4B_GEN5 = \
exa_wm_ca.g4b.gen5 \
exa_wm_ca_srcalpha.g4b.gen5 \
exa_wm_write.g4b.gen5 \
- exa_wm_yuv_rgb_bt601.g4b.gen5 \
- exa_wm_yuv_rgb_bt709.g4b.gen5 \
+ exa_wm_yuv_rgb_bt601_limited.g4b.gen5 \
+ exa_wm_yuv_rgb_bt709_limited.g4b.gen5 \
exa_wm_xy.g4b.gen5 \
$(NULL)
@@ -91,8 +91,8 @@ INTEL_G5A = \
exa_wm_ca.g5a \
exa_wm_ca_srcalpha.g5a \
exa_wm_write.g5a \
- exa_wm_yuv_rgb_bt601.g5a \
- exa_wm_yuv_rgb_bt709.g5a \
+ exa_wm_yuv_rgb_bt601_limited.g5a \
+ exa_wm_yuv_rgb_bt709_limited.g5a \
exa_wm_xy.g5a \
$(NULL)
@@ -113,8 +113,8 @@ INTEL_G5B = \
exa_wm_ca.g5b \
exa_wm_ca_srcalpha.g5b \
exa_wm_write.g5b \
- exa_wm_yuv_rgb_bt601.g5b \
- exa_wm_yuv_rgb_bt709.g5b \
+ exa_wm_yuv_rgb_bt601_limited.g5b \
+ exa_wm_yuv_rgb_bt709_limited.g5b \
exa_wm_xy.g5b \
$(NULL)
@@ -138,8 +138,8 @@ INTEL_G6A = \
exa_wm_ca_srcalpha.g6a \
exa_wm_noca.g6a \
exa_wm_write.g6a \
- exa_wm_yuv_rgb_bt601.g6a \
- exa_wm_yuv_rgb_bt709.g6a \
+ exa_wm_yuv_rgb_bt601_limited.g6a \
+ exa_wm_yuv_rgb_bt709_limited.g6a \
$(NULL)
INTEL_G6B = \
@@ -157,8 +157,8 @@ INTEL_G6B = \
exa_wm_ca_srcalpha.g6b \
exa_wm_noca.g6b \
exa_wm_write.g6b \
- exa_wm_yuv_rgb_bt601.g6b \
- exa_wm_yuv_rgb_bt709.g6b \
+ exa_wm_yuv_rgb_bt601_limited.g6b \
+ exa_wm_yuv_rgb_bt709_limited.g6b \
$(NULL)
INTEL_G7A = \
@@ -173,8 +173,8 @@ INTEL_G7A = \
exa_wm_src_sample_nv12.g7a \
exa_wm_src_sample_planar.g7a \
exa_wm_write.g7a \
- exa_wm_yuv_rgb_bt601.g7a \
- exa_wm_yuv_rgb_bt709.g7a \
+ exa_wm_yuv_rgb_bt601_limited.g7a \
+ exa_wm_yuv_rgb_bt709_limited.g7a \
$(NULL)
INTEL_G7B = \
@@ -189,8 +189,8 @@ INTEL_G7B = \
exa_wm_src_sample_nv12.g7b \
exa_wm_src_sample_planar.g7b \
exa_wm_write.g7b \
- exa_wm_yuv_rgb_bt601.g7b \
- exa_wm_yuv_rgb_bt709.g7b \
+ exa_wm_yuv_rgb_bt601_limited.g7b \
+ exa_wm_yuv_rgb_bt709_limited.g7b \
$(NULL)
INTEL_G8A = \
@@ -199,8 +199,8 @@ INTEL_G8A = \
exa_wm_src_sample_nv12.g8a \
exa_wm_src_sample_planar.g8a \
exa_wm_write.g8a \
- exa_wm_yuv_rgb_bt601.g8a \
- exa_wm_yuv_rgb_bt709.g8a \
+ exa_wm_yuv_rgb_bt601_limited.g8a \
+ exa_wm_yuv_rgb_bt709_limited.g8a \
$(NULL)
INTEL_G8B = \
@@ -209,8 +209,8 @@ INTEL_G8B = \
exa_wm_src_sample_nv12.g8b \
exa_wm_src_sample_planar.g8b \
exa_wm_write.g8b \
- exa_wm_yuv_rgb_bt601.g8b \
- exa_wm_yuv_rgb_bt709.g8b \
+ exa_wm_yuv_rgb_bt601_limited.g8b \
+ exa_wm_yuv_rgb_bt709_limited.g8b \
$(NULL)
EXTRA_DIST = \
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g5a b/src/render_program/exa_wm_yuv_rgb_bt601.g5a
deleted file mode 120000
index 8c98e82d0f02..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt601.g5a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g6a b/src/render_program/exa_wm_yuv_rgb_bt601.g6a
deleted file mode 120000
index 8c98e82d0f02..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt601.g6a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g7a b/src/render_program/exa_wm_yuv_rgb_bt601.g7a
deleted file mode 120000
index 8c98e82d0f02..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt601.g7a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g4a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g4a
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g4b b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g4b
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g4b.gen5 b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b.gen5
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g4b.gen5
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b.gen5
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_limited.g5a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g5a
new file mode 120000
index 000000000000..536b052ccecc
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g5a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g5b b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g5b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g5b
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g5b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_limited.g6a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g6a
new file mode 120000
index 000000000000..536b052ccecc
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g6a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g6b b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g6b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g6b
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g6b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_limited.g7a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g7a
new file mode 120000
index 000000000000..536b052ccecc
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g7a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g7b b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g7b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g7b
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g7b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g8a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g8a
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g8a
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g8a
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601.g8b b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g8b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt601.g8b
rename to src/render_program/exa_wm_yuv_rgb_bt601_limited.g8b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g5a b/src/render_program/exa_wm_yuv_rgb_bt709.g5a
deleted file mode 120000
index 9b4ca31203c3..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt709.g5a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g6a b/src/render_program/exa_wm_yuv_rgb_bt709.g6a
deleted file mode 120000
index 9b4ca31203c3..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt709.g6a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g7a b/src/render_program/exa_wm_yuv_rgb_bt709.g7a
deleted file mode 120000
index 9b4ca31203c3..000000000000
--- a/src/render_program/exa_wm_yuv_rgb_bt709.g7a
+++ /dev/null
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g4a b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g4a
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g4a
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g4a
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g4b b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g4b
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g4b.gen5 b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b.gen5
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g4b.gen5
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b.gen5
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_limited.g5a b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g5a
new file mode 120000
index 000000000000..7ec690d6ab1f
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g5a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g5b b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g5b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g5b
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g5b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_limited.g6a b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g6a
new file mode 120000
index 000000000000..7ec690d6ab1f
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g6a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g6b b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g6b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g6b
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g6b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_limited.g7a b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g7a
new file mode 120000
index 000000000000..7ec690d6ab1f
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g7a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g7b b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g7b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g7b
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g7b
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g8a b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g8a
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g8a
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g8a
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709.g8b b/src/render_program/exa_wm_yuv_rgb_bt709_limited.g8b
similarity index 100%
rename from src/render_program/exa_wm_yuv_rgb_bt709.g8b
rename to src/render_program/exa_wm_yuv_rgb_bt709_limited.g8b
diff --git a/src/sna/brw/brw_test_gen4.c b/src/sna/brw/brw_test_gen4.c
index 78ff74653b63..bf2d2e2d9916 100644
--- a/src/sna/brw/brw_test_gen4.c
+++ b/src/sna/brw/brw_test_gen4.c
@@ -115,7 +115,7 @@ static const uint32_t ps_kernel_packed_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
@@ -123,7 +123,7 @@ static const uint32_t ps_kernel_planar_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_planar.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
diff --git a/src/sna/brw/brw_test_gen5.c b/src/sna/brw/brw_test_gen5.c
index e821ce8bb814..2a4e408efdaf 100644
--- a/src/sna/brw/brw_test_gen5.c
+++ b/src/sna/brw/brw_test_gen5.c
@@ -115,7 +115,7 @@ static const uint32_t ps_kernel_packed_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_argb.g5b"
-#include "exa_wm_yuv_rgb_bt601.g5b"
+#include "exa_wm_yuv_rgb_bt601_limited.g5b"
#include "exa_wm_write.g5b"
};
@@ -123,7 +123,7 @@ static const uint32_t ps_kernel_planar_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_planar.g5b"
-#include "exa_wm_yuv_rgb_bt601.g5b"
+#include "exa_wm_yuv_rgb_bt601_limited.g5b"
#include "exa_wm_write.g5b"
};
diff --git a/src/sna/brw/brw_test_gen6.c b/src/sna/brw/brw_test_gen6.c
index 9603b9d99ceb..dc10b1c4af92 100644
--- a/src/sna/brw/brw_test_gen6.c
+++ b/src/sna/brw/brw_test_gen6.c
@@ -98,14 +98,14 @@ static const uint32_t ps_kernel_masknoca_projective[][4] = {
static const uint32_t ps_kernel_packed[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_argb.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
static const uint32_t ps_kernel_planar[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_planar.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
diff --git a/src/sna/brw/brw_test_gen7.c b/src/sna/brw/brw_test_gen7.c
index 658b6699594a..e5af6f9909ae 100644
--- a/src/sna/brw/brw_test_gen7.c
+++ b/src/sna/brw/brw_test_gen7.c
@@ -98,14 +98,14 @@ static const uint32_t ps_kernel_masknoca_projective[][4] = {
static const uint32_t ps_kernel_packed[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
static const uint32_t ps_kernel_planar[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_planar.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index b6a496ca7825..50be5120e4e9 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -99,51 +99,51 @@
#define GEN4_MAX_WM_THREADS 32
#define G4X_MAX_WM_THREADS 50
-static const uint32_t ps_kernel_packed_bt601_static[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_planar_bt601_static[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_planar.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_nv12_bt601_static[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_nv12.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_packed_bt709_static[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
-#include "exa_wm_yuv_rgb_bt709.g4b"
+#include "exa_wm_yuv_rgb_bt709_limited.g4b"
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_planar_bt709_static[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_planar.g4b"
-#include "exa_wm_yuv_rgb_bt709.g4b"
+#include "exa_wm_yuv_rgb_bt709_limited.g4b"
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_nv12_bt709_static[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_nv12.g4b"
-#include "exa_wm_yuv_rgb_bt709.g4b"
+#include "exa_wm_yuv_rgb_bt709_limited.g4b"
#include "exa_wm_write.g4b"
};
@@ -171,13 +171,13 @@ static const struct wm_kernel_info {
NOKERNEL(WM_KERNEL_OPACITY, brw_wm_kernel__affine_opacity, true),
NOKERNEL(WM_KERNEL_OPACITY_P, brw_wm_kernel__projective_opacity, true),
- KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601, ps_kernel_planar_bt601_static, false),
- KERNEL(WM_KERNEL_VIDEO_NV12_BT601, ps_kernel_nv12_bt601_static, false),
- KERNEL(WM_KERNEL_VIDEO_PACKED_BT601, ps_kernel_packed_bt601_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited_static, false),
- KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709, ps_kernel_planar_bt709_static, false),
- KERNEL(WM_KERNEL_VIDEO_NV12_BT709, ps_kernel_nv12_bt709_static, false),
- KERNEL(WM_KERNEL_VIDEO_PACKED_BT709, ps_kernel_packed_bt709_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
};
#undef KERNEL
@@ -1440,18 +1440,18 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709 :
- WM_KERNEL_VIDEO_PLANAR_BT601;
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709 :
- WM_KERNEL_VIDEO_NV12_BT601;
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709 :
- WM_KERNEL_VIDEO_PACKED_BT601;
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen4_render.h b/src/sna/gen4_render.h
index f516c316c096..645226dd81ab 100644
--- a/src/sna/gen4_render.h
+++ b/src/sna/gen4_render.h
@@ -2685,13 +2685,13 @@ typedef enum {
WM_KERNEL_OPACITY,
WM_KERNEL_OPACITY_P,
- WM_KERNEL_VIDEO_PLANAR_BT601,
- WM_KERNEL_VIDEO_NV12_BT601,
- WM_KERNEL_VIDEO_PACKED_BT601,
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- WM_KERNEL_VIDEO_PLANAR_BT709,
- WM_KERNEL_VIDEO_NV12_BT709,
- WM_KERNEL_VIDEO_PACKED_BT709,
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
KERNEL_COUNT
} wm_kernel_t;
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 3d9d35f113aa..b131715764c4 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -89,51 +89,51 @@
#define PS_KERNEL_NUM_GRF 32
#define PS_MAX_THREADS 72
-static const uint32_t ps_kernel_packed_bt601_static[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_argb.g5b"
-#include "exa_wm_yuv_rgb_bt601.g5b"
+#include "exa_wm_yuv_rgb_bt601_limited.g5b"
#include "exa_wm_write.g5b"
};
-static const uint32_t ps_kernel_planar_bt601_static[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_planar.g5b"
-#include "exa_wm_yuv_rgb_bt601.g5b"
+#include "exa_wm_yuv_rgb_bt601_limited.g5b"
#include "exa_wm_write.g5b"
};
-static const uint32_t ps_kernel_nv12_bt601_static[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_nv12.g5b"
-#include "exa_wm_yuv_rgb_bt601.g5b"
+#include "exa_wm_yuv_rgb_bt601_limited.g5b"
#include "exa_wm_write.g5b"
};
-static const uint32_t ps_kernel_packed_bt709_static[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_argb.g5b"
-#include "exa_wm_yuv_rgb_bt709.g5b"
+#include "exa_wm_yuv_rgb_bt709_limited.g5b"
#include "exa_wm_write.g5b"
};
-static const uint32_t ps_kernel_planar_bt709_static[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_planar.g5b"
-#include "exa_wm_yuv_rgb_bt709.g5b"
+#include "exa_wm_yuv_rgb_bt709_limited.g5b"
#include "exa_wm_write.g5b"
};
-static const uint32_t ps_kernel_nv12_bt709_static[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_xy.g5b"
#include "exa_wm_src_affine.g5b"
#include "exa_wm_src_sample_nv12.g5b"
-#include "exa_wm_yuv_rgb_bt709.g5b"
+#include "exa_wm_yuv_rgb_bt709_limited.g5b"
#include "exa_wm_write.g5b"
};
@@ -161,13 +161,13 @@ static const struct wm_kernel_info {
NOKERNEL(WM_KERNEL_OPACITY, brw_wm_kernel__affine_opacity, true),
NOKERNEL(WM_KERNEL_OPACITY_P, brw_wm_kernel__projective_opacity, true),
- KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601, ps_kernel_planar_bt601_static, false),
- KERNEL(WM_KERNEL_VIDEO_NV12_BT601, ps_kernel_nv12_bt601_static, false),
- KERNEL(WM_KERNEL_VIDEO_PACKED_BT601, ps_kernel_packed_bt601_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited_static, false),
- KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709, ps_kernel_planar_bt709_static, false),
- KERNEL(WM_KERNEL_VIDEO_NV12_BT709, ps_kernel_nv12_bt709_static, false),
- KERNEL(WM_KERNEL_VIDEO_PACKED_BT709, ps_kernel_packed_bt709_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
};
#undef KERNEL
@@ -1390,18 +1390,18 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709 :
- WM_KERNEL_VIDEO_PLANAR_BT601;
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709 :
- WM_KERNEL_VIDEO_NV12_BT601;
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709 :
- WM_KERNEL_VIDEO_PACKED_BT601;
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen5_render.h b/src/sna/gen5_render.h
index 8901480a6d0f..04ff6366bb97 100644
--- a/src/sna/gen5_render.h
+++ b/src/sna/gen5_render.h
@@ -2765,13 +2765,13 @@ typedef enum {
WM_KERNEL_OPACITY,
WM_KERNEL_OPACITY_P,
- WM_KERNEL_VIDEO_PLANAR_BT601,
- WM_KERNEL_VIDEO_NV12_BT601,
- WM_KERNEL_VIDEO_PACKED_BT601,
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- WM_KERNEL_VIDEO_PLANAR_BT709,
- WM_KERNEL_VIDEO_NV12_BT709,
- WM_KERNEL_VIDEO_PACKED_BT709,
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
KERNEL_COUNT
} wm_kernel_t;
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 99cc4b0ecb5c..b9c713332e20 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -101,45 +101,45 @@ static const struct gt_info gt2_info = {
.gt = 2,
};
-static const uint32_t ps_kernel_packed_bt601[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_argb.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
-static const uint32_t ps_kernel_planar_bt601[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_planar.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
-static const uint32_t ps_kernel_nv12_bt601[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_nv12.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
-static const uint32_t ps_kernel_packed_bt709[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_argb.g6b"
-#include "exa_wm_yuv_rgb_bt709.g6b"
+#include "exa_wm_yuv_rgb_bt709_limited.g6b"
#include "exa_wm_write.g6b"
};
-static const uint32_t ps_kernel_planar_bt709[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_planar.g6b"
-#include "exa_wm_yuv_rgb_bt709.g6b"
+#include "exa_wm_yuv_rgb_bt709_limited.g6b"
#include "exa_wm_write.g6b"
};
-static const uint32_t ps_kernel_nv12_bt709[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_nv12.g6b"
-#include "exa_wm_yuv_rgb_bt709.g6b"
+#include "exa_wm_yuv_rgb_bt709_limited.g6b"
#include "exa_wm_write.g6b"
};
@@ -170,13 +170,13 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY_P, brw_wm_kernel__projective_opacity, 2),
- KERNEL(VIDEO_PLANAR_BT601, ps_kernel_planar_bt601, 7),
- KERNEL(VIDEO_NV12_BT601, ps_kernel_nv12_bt601, 7),
- KERNEL(VIDEO_PACKED_BT601, ps_kernel_packed_bt601, 2),
+ KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
+ KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
+ KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
- KERNEL(VIDEO_PLANAR_BT709, ps_kernel_planar_bt709, 7),
- KERNEL(VIDEO_NV12_BT709, ps_kernel_nv12_bt709, 7),
- KERNEL(VIDEO_PACKED_BT709, ps_kernel_packed_bt709, 2),
+ KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
+ KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
+ KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
};
#undef KERNEL
@@ -1664,18 +1664,18 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT709 :
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT601;
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_NV12_BT709 :
- GEN6_WM_KERNEL_VIDEO_NV12_BT601;
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PACKED_BT709 :
- GEN6_WM_KERNEL_VIDEO_PACKED_BT601;
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index cffe17de6d0d..a1bbe3ca888e 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -193,45 +193,45 @@ inline static bool is_hsw(struct sna *sna)
return sna->kgem.gen == 075;
}
-static const uint32_t ps_kernel_packed_bt601[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
-static const uint32_t ps_kernel_planar_bt601[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_planar.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
-static const uint32_t ps_kernel_nv12_bt601[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_nv12.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
-static const uint32_t ps_kernel_packed_bt709[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
-#include "exa_wm_yuv_rgb_bt709.g7b"
+#include "exa_wm_yuv_rgb_bt709_limited.g7b"
#include "exa_wm_write.g7b"
};
-static const uint32_t ps_kernel_planar_bt709[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_planar.g7b"
-#include "exa_wm_yuv_rgb_bt709.g7b"
+#include "exa_wm_yuv_rgb_bt709_limited.g7b"
#include "exa_wm_write.g7b"
};
-static const uint32_t ps_kernel_nv12_bt709[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_nv12.g7b"
-#include "exa_wm_yuv_rgb_bt709.g7b"
+#include "exa_wm_yuv_rgb_bt709_limited.g7b"
#include "exa_wm_write.g7b"
};
@@ -266,12 +266,12 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY, brw_wm_kernel__affine_opacity, 2),
NOKERNEL(OPACITY_P, brw_wm_kernel__projective_opacity, 2),
- KERNEL(VIDEO_PLANAR_BT601, ps_kernel_planar_bt601, 7),
- KERNEL(VIDEO_NV12_BT601, ps_kernel_nv12_bt601, 7),
- KERNEL(VIDEO_PACKED_BT601, ps_kernel_packed_bt601, 2),
- KERNEL(VIDEO_PLANAR_BT709, ps_kernel_planar_bt709, 7),
- KERNEL(VIDEO_NV12_BT709, ps_kernel_nv12_bt709, 7),
- KERNEL(VIDEO_PACKED_BT709, ps_kernel_packed_bt709, 2),
+ KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
+ KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
+ KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
+ KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
+ KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
};
#undef KERNEL
@@ -1877,13 +1877,13 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT709 :
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT601;
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_NV12_BT709 :
- GEN7_WM_KERNEL_VIDEO_NV12_BT601;
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
@@ -1891,8 +1891,8 @@ static unsigned select_video_kernel(const struct sna_video *video,
default:
return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PACKED_BT709 :
- GEN7_WM_KERNEL_VIDEO_PACKED_BT601;
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 9bac9b8bb6be..caa89d95c50c 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -93,45 +93,45 @@
*/
#if !NO_VIDEO
-static const uint32_t ps_kernel_packed_bt601[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_planar_bt601[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_planar.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_nv12_bt601[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_nv12.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_packed_bt709[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_planar_bt709[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_planar.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_nv12_bt709[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_nv12.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
@@ -170,12 +170,12 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY_P, gen8_wm_kernel__projective_opacity, 2),
#if !NO_VIDEO
- KERNEL(VIDEO_PLANAR_BT601, ps_kernel_planar_bt601, 7),
- KERNEL(VIDEO_NV12_BT601, ps_kernel_nv12_bt601, 7),
- KERNEL(VIDEO_PACKED_BT601, ps_kernel_packed_bt601, 2),
- KERNEL(VIDEO_PLANAR_BT709, ps_kernel_planar_bt709, 7),
- KERNEL(VIDEO_NV12_BT709, ps_kernel_nv12_bt709, 7),
- KERNEL(VIDEO_PACKED_BT709, ps_kernel_packed_bt709, 2),
+ KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
+ KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
+ KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
+ KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
+ KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3828,13 +3828,13 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT709 :
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT601;
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_NV12_BT709 :
- GEN8_WM_KERNEL_VIDEO_NV12_BT601;
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
@@ -3842,8 +3842,8 @@ static unsigned select_video_kernel(const struct sna_video *video,
default:
return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PACKED_BT709 :
- GEN8_WM_KERNEL_VIDEO_PACKED_BT601;
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c
index eb22b642ffa1..b7a1137ff8cb 100644
--- a/src/sna/gen9_render.c
+++ b/src/sna/gen9_render.c
@@ -94,45 +94,45 @@
*/
#if !NO_VIDEO
-static const uint32_t ps_kernel_packed_bt601[][4] = {
+static const uint32_t ps_kernel_packed_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_planar_bt601[][4] = {
+static const uint32_t ps_kernel_planar_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_planar.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_nv12_bt601[][4] = {
+static const uint32_t ps_kernel_nv12_bt601_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_nv12.g8b"
-#include "exa_wm_yuv_rgb_bt601.g8b"
+#include "exa_wm_yuv_rgb_bt601_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_packed_bt709[][4] = {
+static const uint32_t ps_kernel_packed_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_planar_bt709[][4] = {
+static const uint32_t ps_kernel_planar_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_planar.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
-static const uint32_t ps_kernel_nv12_bt709[][4] = {
+static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_nv12.g8b"
-#include "exa_wm_yuv_rgb_bt709.g8b"
+#include "exa_wm_yuv_rgb_bt709_limited.g8b"
#include "exa_wm_write.g8b"
};
@@ -171,12 +171,12 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY_P, gen8_wm_kernel__projective_opacity, 2),
#if !NO_VIDEO
- KERNEL(VIDEO_PLANAR_BT601, ps_kernel_planar_bt601, 7),
- KERNEL(VIDEO_NV12_BT601, ps_kernel_nv12_bt601, 7),
- KERNEL(VIDEO_PACKED_BT601, ps_kernel_packed_bt601, 2),
- KERNEL(VIDEO_PLANAR_BT709, ps_kernel_planar_bt709, 7),
- KERNEL(VIDEO_NV12_BT709, ps_kernel_nv12_bt709, 7),
- KERNEL(VIDEO_PACKED_BT709, ps_kernel_packed_bt709, 2),
+ KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
+ KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
+ KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
+ KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
+ KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3891,13 +3891,13 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_I420:
case FOURCC_XVMC:
return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT709 :
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT601;
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_NV12_BT709 :
- GEN9_WM_KERNEL_VIDEO_NV12_BT601;
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
@@ -3905,8 +3905,8 @@ static unsigned select_video_kernel(const struct sna_video *video,
default:
return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PACKED_BT709 :
- GEN9_WM_KERNEL_VIDEO_PACKED_BT601;
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 442a6ec50191..6013feac936d 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -440,13 +440,13 @@ enum {
GEN6_WM_KERNEL_OPACITY,
GEN6_WM_KERNEL_OPACITY_P,
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT601,
- GEN6_WM_KERNEL_VIDEO_NV12_BT601,
- GEN6_WM_KERNEL_VIDEO_PACKED_BT601,
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT709,
- GEN6_WM_KERNEL_VIDEO_NV12_BT709,
- GEN6_WM_KERNEL_VIDEO_PACKED_BT709,
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
GEN6_KERNEL_COUNT
};
@@ -496,13 +496,13 @@ enum {
GEN7_WM_KERNEL_OPACITY,
GEN7_WM_KERNEL_OPACITY_P,
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT601,
- GEN7_WM_KERNEL_VIDEO_NV12_BT601,
- GEN7_WM_KERNEL_VIDEO_PACKED_BT601,
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT709,
- GEN7_WM_KERNEL_VIDEO_NV12_BT709,
- GEN7_WM_KERNEL_VIDEO_PACKED_BT709,
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
GEN7_WM_KERNEL_VIDEO_RGB,
GEN7_WM_KERNEL_COUNT
@@ -555,13 +555,13 @@ enum {
GEN8_WM_KERNEL_OPACITY,
GEN8_WM_KERNEL_OPACITY_P,
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT601,
- GEN8_WM_KERNEL_VIDEO_NV12_BT601,
- GEN8_WM_KERNEL_VIDEO_PACKED_BT601,
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT709,
- GEN8_WM_KERNEL_VIDEO_NV12_BT709,
- GEN8_WM_KERNEL_VIDEO_PACKED_BT709,
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
GEN8_WM_KERNEL_VIDEO_RGB,
GEN8_WM_KERNEL_COUNT
@@ -612,13 +612,13 @@ enum {
GEN9_WM_KERNEL_OPACITY,
GEN9_WM_KERNEL_OPACITY_P,
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT601,
- GEN9_WM_KERNEL_VIDEO_NV12_BT601,
- GEN9_WM_KERNEL_VIDEO_PACKED_BT601,
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED,
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT709,
- GEN9_WM_KERNEL_VIDEO_NV12_BT709,
- GEN9_WM_KERNEL_VIDEO_PACKED_BT709,
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
GEN9_WM_KERNEL_VIDEO_RGB,
GEN9_WM_KERNEL_COUNT
diff --git a/src/uxa/i965_video.c b/src/uxa/i965_video.c
index 9b9203b66f25..1b62c835e5df 100644
--- a/src/uxa/i965_video.c
+++ b/src/uxa/i965_video.c
@@ -101,7 +101,7 @@ static const uint32_t ps_kernel_packed_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
@@ -109,7 +109,7 @@ static const uint32_t ps_kernel_planar_static[][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_planar.g4b"
-#include "exa_wm_yuv_rgb_bt601.g4b"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b"
#include "exa_wm_write.g4b"
};
@@ -122,7 +122,7 @@ static const uint32_t ps_kernel_packed_static_gen5[][4] = {
#include "exa_wm_xy.g4b.gen5"
#include "exa_wm_src_affine.g4b.gen5"
#include "exa_wm_src_sample_argb.g4b.gen5"
-#include "exa_wm_yuv_rgb_bt601.g4b.gen5"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b.gen5"
#include "exa_wm_write.g4b.gen5"
};
@@ -130,7 +130,7 @@ static const uint32_t ps_kernel_planar_static_gen5[][4] = {
#include "exa_wm_xy.g4b.gen5"
#include "exa_wm_src_affine.g4b.gen5"
#include "exa_wm_src_sample_planar.g4b.gen5"
-#include "exa_wm_yuv_rgb_bt601.g4b.gen5"
+#include "exa_wm_yuv_rgb_bt601_limited.g4b.gen5"
#include "exa_wm_write.g4b.gen5"
};
@@ -138,14 +138,14 @@ static const uint32_t ps_kernel_planar_static_gen5[][4] = {
static const uint32_t ps_kernel_packed_static_gen6[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_argb.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
static const uint32_t ps_kernel_planar_static_gen6[][4] = {
#include "exa_wm_src_affine.g6b"
#include "exa_wm_src_sample_planar.g6b"
-#include "exa_wm_yuv_rgb_bt601.g6b"
+#include "exa_wm_yuv_rgb_bt601_limited.g6b"
#include "exa_wm_write.g6b"
};
@@ -153,14 +153,14 @@ static const uint32_t ps_kernel_planar_static_gen6[][4] = {
static const uint32_t ps_kernel_packed_static_gen7[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
static const uint32_t ps_kernel_planar_static_gen7[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_planar.g7b"
-#include "exa_wm_yuv_rgb_bt601.g7b"
+#include "exa_wm_yuv_rgb_bt601_limited.g7b"
#include "exa_wm_write.g7b"
};
--
2.16.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH xf86-video-intel 4/6] sna/video/textured: Add shaders to deal with full range yuv data
2018-07-04 18:59 [PATCH xf86-video-intel 1/6] sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7 Ville Syrjala
2018-07-04 18:59 ` [PATCH xf86-video-intel 2/6] sna/gen6+: Split out wm_kernel from the sna_composite_op flags Ville Syrjala
2018-07-04 18:59 ` [PATCH xf86-video-intel 3/6] sna/vide/textured: Rename yuv shaders to indicate they handle limited range data Ville Syrjala
@ 2018-07-04 18:59 ` Ville Syrjala
2018-07-04 18:59 ` [PATCH xf86-video-intel 5/6] sna/video/textured: Add XV_COLOR_RANGE port attribute Ville Syrjala
[not found] ` <20180704185919.30946-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
4 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjala @ 2018-07-04 18:59 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Add new yuv->rgb shader variants that deal with full range yuv data
instead of limited range data. Until we expose the full range capability
via an Xv port attribute we'll always pick the limited range variant.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
src/render_program/Makefile.am | 22 ++++
src/render_program/exa_wm_yuv_rgb_bt601_full.g4a | 109 +++++++++++++++++++
src/render_program/exa_wm_yuv_rgb_bt601_full.g4b | 11 ++
.../exa_wm_yuv_rgb_bt601_full.g4b.gen5 | 11 ++
src/render_program/exa_wm_yuv_rgb_bt601_full.g5a | 1 +
src/render_program/exa_wm_yuv_rgb_bt601_full.g5b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt601_full.g6a | 1 +
src/render_program/exa_wm_yuv_rgb_bt601_full.g6b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt601_full.g7a | 1 +
src/render_program/exa_wm_yuv_rgb_bt601_full.g7b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt601_full.g8a | 116 +++++++++++++++++++++
src/render_program/exa_wm_yuv_rgb_bt601_full.g8b | 18 ++++
.../exa_wm_yuv_rgb_bt601_limited.g4a | 1 -
src/render_program/exa_wm_yuv_rgb_bt709_full.g4a | 109 +++++++++++++++++++
src/render_program/exa_wm_yuv_rgb_bt709_full.g4b | 11 ++
.../exa_wm_yuv_rgb_bt709_full.g4b.gen5 | 11 ++
src/render_program/exa_wm_yuv_rgb_bt709_full.g5a | 1 +
src/render_program/exa_wm_yuv_rgb_bt709_full.g5b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt709_full.g6a | 1 +
src/render_program/exa_wm_yuv_rgb_bt709_full.g6b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt709_full.g7a | 1 +
src/render_program/exa_wm_yuv_rgb_bt709_full.g7b | 11 ++
src/render_program/exa_wm_yuv_rgb_bt709_full.g8a | 116 +++++++++++++++++++++
src/render_program/exa_wm_yuv_rgb_bt709_full.g8b | 18 ++++
src/sna/gen4_render.c | 89 ++++++++++++++--
src/sna/gen4_render.h | 8 ++
src/sna/gen5_render.c | 89 ++++++++++++++--
src/sna/gen5_render.h | 8 ++
src/sna/gen6_render.c | 84 +++++++++++++--
src/sna/gen7_render.c | 81 ++++++++++++--
src/sna/gen8_render.c | 81 ++++++++++++--
src/sna/gen9_render.c | 81 ++++++++++++--
src/sna/sna_render.h | 32 ++++++
src/sna/sna_video.h | 1 +
34 files changed, 1123 insertions(+), 56 deletions(-)
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g4a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g4b
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g4b.gen5
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_full.g5a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g5b
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_full.g6a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g6b
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt601_full.g7a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g7b
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g8a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt601_full.g8b
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g4a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g4b
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g4b.gen5
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_full.g5a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g5b
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_full.g6a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g6b
create mode 120000 src/render_program/exa_wm_yuv_rgb_bt709_full.g7a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g7b
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g8a
create mode 100644 src/render_program/exa_wm_yuv_rgb_bt709_full.g8b
diff --git a/src/render_program/Makefile.am b/src/render_program/Makefile.am
index e7592a627e11..025ffe258773 100644
--- a/src/render_program/Makefile.am
+++ b/src/render_program/Makefile.am
@@ -15,7 +15,9 @@ INTEL_G4A = \
exa_wm_ca.g4a \
exa_wm_ca_srcalpha.g4a \
exa_wm_write.g4a \
+ exa_wm_yuv_rgb_bt601_full.g4a \
exa_wm_yuv_rgb_bt601_limited.g4a \
+ exa_wm_yuv_rgb_bt709_full.g4a \
exa_wm_yuv_rgb_bt709_limited.g4a \
exa_wm_xy.g4a \
$(NULL)
@@ -46,7 +48,9 @@ INTEL_G4B = \
exa_wm_ca.g4b \
exa_wm_ca_srcalpha.g4b \
exa_wm_write.g4b \
+ exa_wm_yuv_rgb_bt601_full.g4b \
exa_wm_yuv_rgb_bt601_limited.g4b \
+ exa_wm_yuv_rgb_bt709_full.g4b \
exa_wm_yuv_rgb_bt709_limited.g4b \
exa_wm_xy.g4b \
$(NULL)
@@ -69,7 +73,9 @@ INTEL_G4B_GEN5 = \
exa_wm_ca.g4b.gen5 \
exa_wm_ca_srcalpha.g4b.gen5 \
exa_wm_write.g4b.gen5 \
+ exa_wm_yuv_rgb_bt601_full.g4b.gen5 \
exa_wm_yuv_rgb_bt601_limited.g4b.gen5 \
+ exa_wm_yuv_rgb_bt709_full.g4b.gen5 \
exa_wm_yuv_rgb_bt709_limited.g4b.gen5 \
exa_wm_xy.g4b.gen5 \
$(NULL)
@@ -91,7 +97,9 @@ INTEL_G5A = \
exa_wm_ca.g5a \
exa_wm_ca_srcalpha.g5a \
exa_wm_write.g5a \
+ exa_wm_yuv_rgb_bt601_full.g5a \
exa_wm_yuv_rgb_bt601_limited.g5a \
+ exa_wm_yuv_rgb_bt709_full.g5a \
exa_wm_yuv_rgb_bt709_limited.g5a \
exa_wm_xy.g5a \
$(NULL)
@@ -113,7 +121,9 @@ INTEL_G5B = \
exa_wm_ca.g5b \
exa_wm_ca_srcalpha.g5b \
exa_wm_write.g5b \
+ exa_wm_yuv_rgb_bt601_full.g5b \
exa_wm_yuv_rgb_bt601_limited.g5b \
+ exa_wm_yuv_rgb_bt709_full.g5b \
exa_wm_yuv_rgb_bt709_limited.g5b \
exa_wm_xy.g5b \
$(NULL)
@@ -138,7 +148,9 @@ INTEL_G6A = \
exa_wm_ca_srcalpha.g6a \
exa_wm_noca.g6a \
exa_wm_write.g6a \
+ exa_wm_yuv_rgb_bt601_full.g6a \
exa_wm_yuv_rgb_bt601_limited.g6a \
+ exa_wm_yuv_rgb_bt709_full.g6a \
exa_wm_yuv_rgb_bt709_limited.g6a \
$(NULL)
@@ -157,7 +169,9 @@ INTEL_G6B = \
exa_wm_ca_srcalpha.g6b \
exa_wm_noca.g6b \
exa_wm_write.g6b \
+ exa_wm_yuv_rgb_bt601_full.g6b \
exa_wm_yuv_rgb_bt601_limited.g6b \
+ exa_wm_yuv_rgb_bt709_full.g6b \
exa_wm_yuv_rgb_bt709_limited.g6b \
$(NULL)
@@ -173,7 +187,9 @@ INTEL_G7A = \
exa_wm_src_sample_nv12.g7a \
exa_wm_src_sample_planar.g7a \
exa_wm_write.g7a \
+ exa_wm_yuv_rgb_bt601_full.g7a \
exa_wm_yuv_rgb_bt601_limited.g7a \
+ exa_wm_yuv_rgb_bt709_full.g7a \
exa_wm_yuv_rgb_bt709_limited.g7a \
$(NULL)
@@ -189,7 +205,9 @@ INTEL_G7B = \
exa_wm_src_sample_nv12.g7b \
exa_wm_src_sample_planar.g7b \
exa_wm_write.g7b \
+ exa_wm_yuv_rgb_bt601_full.g7b \
exa_wm_yuv_rgb_bt601_limited.g7b \
+ exa_wm_yuv_rgb_bt709_full.g7b \
exa_wm_yuv_rgb_bt709_limited.g7b \
$(NULL)
@@ -199,7 +217,9 @@ INTEL_G8A = \
exa_wm_src_sample_nv12.g8a \
exa_wm_src_sample_planar.g8a \
exa_wm_write.g8a \
+ exa_wm_yuv_rgb_bt601_full.g8a \
exa_wm_yuv_rgb_bt601_limited.g8a \
+ exa_wm_yuv_rgb_bt709_full.g8a \
exa_wm_yuv_rgb_bt709_limited.g8a \
$(NULL)
@@ -209,7 +229,9 @@ INTEL_G8B = \
exa_wm_src_sample_nv12.g8b \
exa_wm_src_sample_planar.g8b \
exa_wm_write.g8b \
+ exa_wm_yuv_rgb_bt601_full.g8b \
exa_wm_yuv_rgb_bt601_limited.g8b \
+ exa_wm_yuv_rgb_bt709_full.g8b \
exa_wm_yuv_rgb_bt709_limited.g8b \
$(NULL)
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g4a b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4a
new file mode 100644
index 000000000000..8271eb59756e
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4a
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.601:
+ * Kr = 0.299
+ * Kb = 0.114
+ * Kg = (1.0 - Kr - Kb) = 0.587
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_r<1>F Crn<8,8,1>F 1.397F { compr align1 };
+
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac (16) acc0<1>F Crn<8,8,1>F -0.711F { compr align1 };
+mac.sat(16) src_sample_g<1>F Cbn<8,8,1>F -0.343F { compr align1 };
+
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_b<1>F Cbn<8,8,1>F 1.765F { compr align1 };
+
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b
new file mode 100644
index 000000000000..dd029a127c57
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b.gen5 b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b.gen5
new file mode 100644
index 000000000000..dd029a127c57
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g4b.gen5
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g5a b/src/render_program/exa_wm_yuv_rgb_bt601_full.g5a
new file mode 120000
index 000000000000..d65d75d9ccb4
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g5a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g5b b/src/render_program/exa_wm_yuv_rgb_bt601_full.g5b
new file mode 100644
index 000000000000..dd029a127c57
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g5b
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g6a b/src/render_program/exa_wm_yuv_rgb_bt601_full.g6a
new file mode 120000
index 000000000000..d65d75d9ccb4
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g6a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g6b b/src/render_program/exa_wm_yuv_rgb_bt601_full.g6b
new file mode 100644
index 000000000000..34f979718b2c
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g6b
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g7a b/src/render_program/exa_wm_yuv_rgb_bt601_full.g7a
new file mode 120000
index 000000000000..d65d75d9ccb4
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g7a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g7b b/src/render_program/exa_wm_yuv_rgb_bt601_full.g7b
new file mode 100644
index 000000000000..34f979718b2c
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g7b
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fb2d0e5 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbf360419 },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbeaf9db2 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fe1eb85 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g8a b/src/render_program/exa_wm_yuv_rgb_bt601_full.g8a
new file mode 100644
index 000000000000..281adcbfc5e6
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g8a
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( 255/(235-16)(Y-16/255) +
+ * 255/112(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( 255/(235-16)(Y-16/255) -
+ * 255/112(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/112(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( 255/(235-16)(Y-16/255) +
+ * 255/112(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.601:
+ * Kr = 0.299
+ * Kb = 0.114
+ * Kg = (1.0 - Kr - Kb) = 0.587
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_01<1>F Crn_01<8,8,1>F 1.397F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_23<1>F Crn_23<8,8,1>F 1.397F { compr align1 };
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_01<8,8,1>F -0.711F { compr align1 };
+mac.sat(8) src_sample_g_01<1>F Cbn_01<8,8,1>F -0.343F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_23<8,8,1>F -0.711F { compr align1 };
+mac.sat(16) src_sample_g_23<1>F Cbn_23<8,8,1>F -0.343F { compr align1 };
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_01<1>F Cbn_01<8,8,1>F 1.765F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_23<1>F Cbn_23<8,8,1>F 1.765F { compr align1 };
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_full.g8b b/src/render_program/exa_wm_yuv_rgb_bt601_full.g8b
new file mode 100644
index 000000000000..1eb687221ab6
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_full.g8b
@@ -0,0 +1,18 @@
+ { 0x00800001, 0x23003ae8, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c03ae8, 0x3e8d01c0, 0xbf008084 },
+ { 0x00800040, 0x23403ae8, 0x3e8d0240, 0xbf008084 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x21c03ae8, 0x3e8d02c0, 0x3fb2d0e5 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x21e03ae8, 0x3e8d02e0, 0x3fb2d0e5 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02c0, 0xbf360419 },
+ { 0x80600048, 0x22003ae8, 0x3e8d0340, 0xbeaf9db2 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02e0, 0xbf360419 },
+ { 0x80800048, 0x22203ae8, 0x3e8d0360, 0xbeaf9db2 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x22403ae8, 0x3e8d0340, 0x3fe1eb85 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x22603ae8, 0x3e8d0360, 0x3fe1eb85 },
+ { 0x00800001, 0x22803ee8, 0x38000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a
index 7bc8dd14d9c4..6df6134798fa 100644
--- a/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a
+++ b/src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a
@@ -55,7 +55,6 @@ define(`Cbn_01', `mask_sample_b_01')
define(`Cbn_23', `mask_sample_b_23')
/* color space conversion function:
- * Cy = 255/(235-16)
* R = Clamp ( 255/(235-16)(Y-16/255) +
* 255/112(1.0-Kr)(Cr-128/255), 0, 1)
* G = Clamp ( 255/(235-16)(Y-16/255) -
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g4a b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4a
new file mode 100644
index 000000000000..991a988f3c46
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4a
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.709:
+ * Kr = .2126
+ * Kb = .0722
+ * Kg = (1.0 - Kr - Kb) = 0.7152
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_r<1>F Crn<8,8,1>F 1.569F { compr align1 };
+
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg -
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac (16) acc0<1>F Crn<8,8,1>F -0.466F { compr align1 };
+mac.sat(16) src_sample_g<1>F Cbn<8,8,1>F -0.187F { compr align1 };
+
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (16) acc0<1>F Yn<8,8,1>F { compr align1 };
+mac.sat(16) src_sample_b<1>F Cbn<8,8,1>F 1.848F { compr align1 };
+
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b
new file mode 100644
index 000000000000..bfd02996e33b
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b.gen5 b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b.gen5
new file mode 100644
index 000000000000..bfd02996e33b
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g4b.gen5
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g5a b/src/render_program/exa_wm_yuv_rgb_bt709_full.g5a
new file mode 120000
index 000000000000..3c5034797232
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g5a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g5b b/src/render_program/exa_wm_yuv_rgb_bt709_full.g5b
new file mode 100644
index 000000000000..bfd02996e33b
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g5b
@@ -0,0 +1,11 @@
+ { 0x00802001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00802040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00802040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00802048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80802048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00802001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80802048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00802001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g6a b/src/render_program/exa_wm_yuv_rgb_bt709_full.g6a
new file mode 120000
index 000000000000..3c5034797232
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g6a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g6b b/src/render_program/exa_wm_yuv_rgb_bt709_full.g6b
new file mode 100644
index 000000000000..389caaf3714d
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g6b
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g7a b/src/render_program/exa_wm_yuv_rgb_bt709_full.g7a
new file mode 120000
index 000000000000..3c5034797232
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g7a
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g7b b/src/render_program/exa_wm_yuv_rgb_bt709_full.g7b
new file mode 100644
index 000000000000..389caaf3714d
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g7b
@@ -0,0 +1,11 @@
+ { 0x00800001, 0x230003bd, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c07fbd, 0x008d01c0, 0xbf008084 },
+ { 0x00800040, 0x23407fbd, 0x008d0240, 0xbf008084 },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x21c07fbd, 0x008d02c0, 0x3fc8d4fe },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x00800048, 0x24007fbc, 0x008d02c0, 0xbeee978d },
+ { 0x80800048, 0x22007fbd, 0x008d0340, 0xbe3f7cee },
+ { 0x00800001, 0x240003bc, 0x008d0300, 0x00000000 },
+ { 0x80800048, 0x22407fbd, 0x008d0340, 0x3fec8b44 },
+ { 0x00800001, 0x228003fd, 0x00000000, 0x3f800000 },
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g8a b/src/render_program/exa_wm_yuv_rgb_bt709_full.g8a
new file mode 100644
index 000000000000..278f417dc084
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g8a
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Packard <keithp@keithp.com>
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+include(`exa_wm.g4i')
+
+define(`YCbCr_base', `src_sample_base')
+
+define(`Cr', `src_sample_r')
+define(`Cr_01', `src_sample_r_01')
+define(`Cr_23', `src_sample_r_23')
+
+define(`Y', `src_sample_g')
+define(`Y_01', `src_sample_g_01')
+define(`Y_23', `src_sample_g_23')
+
+define(`Cb', `src_sample_b')
+define(`Cb_01', `src_sample_b_01')
+define(`Cb_23', `src_sample_b_23')
+
+define(`Crn', `mask_sample_r')
+define(`Crn_01', `mask_sample_r_01')
+define(`Crn_23', `mask_sample_r_23')
+
+define(`Yn', `mask_sample_g')
+define(`Yn_01', `mask_sample_g_01')
+define(`Yn_23', `mask_sample_g_23')
+
+define(`Cbn', `mask_sample_b')
+define(`Cbn_01', `mask_sample_b_01')
+define(`Cbn_23', `mask_sample_b_23')
+
+ /* color space conversion function:
+ * R = Clamp ( Y +
+ * 255/128(1.0-Kr)(Cr-128/255), 0, 1)
+ * G = Clamp ( Y -
+ * 255/128(1.0-Kr)Kr/Kg(Cr-128/255) -
+ * 255/128(1.0-Kb)Kb/Kg(Cb-128/255), 0, 1)
+ * B = Clamp ( Y +
+ * 255/128(1.0-Kb)(Cb-128/255), 0, 1)
+ *
+ * BT.709:
+ * Kr = .2126
+ * Kb = .0722
+ * Kg = (1.0 - Kr - Kb) = 0.7152
+ */
+
+ /* Normalize Y, Cb and Cr:
+ *
+ * Yn = Y
+ * Crn = Cr - 128 / 255
+ * Cbn = Cb - 128 / 255
+ */
+mov (16) Yn<1>F Y<8,8,1>F { compr align1 };
+add (16) Crn<1>F Cr<8,8,1>F -0.501961F { compr align1 };
+
+add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+
+ /*
+ * R = Yn +
+ * Crn * 255/128 * (1.0 - Kr)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_01<1>F Crn_01<8,8,1>F 1.569F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_r_23<1>F Crn_23<8,8,1>F 1.569F { compr align1 };
+ /*
+ * G = Yn -
+ * Crn * 255/128 * (1.0 - Kr) * Kr / Kg
+ * Cbn * 255/128 * (1.0 - Kb) * Kb / Kg
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_01<8,8,1>F -0.466F { compr align1 };
+mac.sat(8) src_sample_g_01<1>F Cbn_01<8,8,1>F -0.187F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac (8) acc0<1>F Crn_23<8,8,1>F -0.466F { compr align1 };
+mac.sat(16) src_sample_g_23<1>F Cbn_23<8,8,1>F -0.187F { compr align1 };
+ /*
+ * B = Yn +
+ * Cbn * 255/128 * (1.0 - Kb)
+ */
+mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_01<1>F Cbn_01<8,8,1>F 1.848F { compr align1 };
+
+mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+mac.sat(8) src_sample_b_23<1>F Cbn_23<8,8,1>F 1.848F { compr align1 };
+ /*
+ * A = 1.0
+ */
+mov (16) src_sample_a<1>F 1.0F { compr align1 };
diff --git a/src/render_program/exa_wm_yuv_rgb_bt709_full.g8b b/src/render_program/exa_wm_yuv_rgb_bt709_full.g8b
new file mode 100644
index 000000000000..2af7a0b64cc2
--- /dev/null
+++ b/src/render_program/exa_wm_yuv_rgb_bt709_full.g8b
@@ -0,0 +1,18 @@
+ { 0x00800001, 0x23003ae8, 0x008d0200, 0x00000000 },
+ { 0x00800040, 0x22c03ae8, 0x3e8d01c0, 0xbf008084 },
+ { 0x00800040, 0x23403ae8, 0x3e8d0240, 0xbf008084 },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x21c03ae8, 0x3e8d02c0, 0x3fc8d4fe },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x21e03ae8, 0x3e8d02e0, 0x3fc8d4fe },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02c0, 0xbeee978d },
+ { 0x80600048, 0x22003ae8, 0x3e8d0340, 0xbe3f7cee },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02e0, 0xbeee978d },
+ { 0x80800048, 0x22203ae8, 0x3e8d0360, 0xbe3f7cee },
+ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x80600048, 0x22403ae8, 0x3e8d0340, 0x3fec8b44 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x22603ae8, 0x3e8d0360, 0x3fec8b44 },
+ { 0x00800001, 0x22803ee8, 0x38000000, 0x3f800000 },
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 50be5120e4e9..165a49c54a20 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -147,6 +147,54 @@ static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_write.g4b"
};
+static const uint32_t ps_kernel_packed_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_planar.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_nv12.g4b"
+#include "exa_wm_yuv_rgb_bt601_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_planar.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full_static[][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_affine.g4b"
+#include "exa_wm_src_sample_nv12.g4b"
+#include "exa_wm_yuv_rgb_bt709_full.g4b"
+#include "exa_wm_write.g4b"
+};
+
#define NOKERNEL(kernel_enum, func, masked) \
[kernel_enum] = {func, 0, masked}
#define KERNEL(kernel_enum, kernel, masked) \
@@ -178,6 +226,14 @@ static const struct wm_kernel_info {
KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full_static, false),
};
#undef KERNEL
@@ -1439,19 +1495,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen4_render.h b/src/sna/gen4_render.h
index 645226dd81ab..25c1dd80fa9c 100644
--- a/src/sna/gen4_render.h
+++ b/src/sna/gen4_render.h
@@ -2693,6 +2693,14 @@ typedef enum {
WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
KERNEL_COUNT
} wm_kernel_t;
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index b131715764c4..3855bb8185b3 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -137,6 +137,54 @@ static const uint32_t ps_kernel_nv12_bt709_limited_static[][4] = {
#include "exa_wm_write.g5b"
};
+static const uint32_t ps_kernel_packed_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_argb.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_planar.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_nv12.g5b"
+#include "exa_wm_yuv_rgb_bt601_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_argb.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_planar.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full_static[][4] = {
+#include "exa_wm_xy.g5b"
+#include "exa_wm_src_affine.g5b"
+#include "exa_wm_src_sample_nv12.g5b"
+#include "exa_wm_yuv_rgb_bt709_full.g5b"
+#include "exa_wm_write.g5b"
+};
+
#define NOKERNEL(kernel_enum, func, masked) \
[kernel_enum] = {func, 0, masked}
#define KERNEL(kernel_enum, kernel, masked) \
@@ -168,6 +216,14 @@ static const struct wm_kernel_info {
KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited_static, false),
KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full_static, false),
+
+ KERNEL(WM_KERNEL_VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full_static, false),
+ KERNEL(WM_KERNEL_VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full_static, false),
};
#undef KERNEL
@@ -1389,19 +1445,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen5_render.h b/src/sna/gen5_render.h
index 04ff6366bb97..934dc37b46ee 100644
--- a/src/sna/gen5_render.h
+++ b/src/sna/gen5_render.h
@@ -2773,6 +2773,14 @@ typedef enum {
WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
KERNEL_COUNT
} wm_kernel_t;
#endif
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index b9c713332e20..c00e2c358bb0 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -143,6 +143,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g6b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_argb.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_planar.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_nv12.g6b"
+#include "exa_wm_yuv_rgb_bt601_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_argb.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_planar.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g6b"
+#include "exa_wm_src_sample_nv12.g6b"
+#include "exa_wm_yuv_rgb_bt709_full.g6b"
+#include "exa_wm_write.g6b"
+};
+
#define NOKERNEL(kernel_enum, func, ns) \
[GEN6_WM_KERNEL_##kernel_enum] = {#kernel_enum, func, 0, ns}
#define KERNEL(kernel_enum, kernel, ns) \
@@ -169,7 +211,6 @@ static const struct wm_kernel_info {
NOKERNEL(OPACITY, brw_wm_kernel__affine_opacity, 2),
NOKERNEL(OPACITY_P, brw_wm_kernel__projective_opacity, 2),
-
KERNEL(VIDEO_PLANAR_BT601_LIMITED, ps_kernel_planar_bt601_limited, 7),
KERNEL(VIDEO_NV12_BT601_LIMITED, ps_kernel_nv12_bt601_limited, 7),
KERNEL(VIDEO_PACKED_BT601_LIMITED, ps_kernel_packed_bt601_limited, 2),
@@ -177,6 +218,14 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
};
#undef KERNEL
@@ -1663,19 +1712,34 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
default:
- return video->colorspace ?
- GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index a1bbe3ca888e..af9824a3f827 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -235,6 +235,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g7b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_argb.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_planar.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_nv12.g7b"
+#include "exa_wm_yuv_rgb_bt601_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_argb.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_planar.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g7b"
+#include "exa_wm_src_sample_nv12.g7b"
+#include "exa_wm_yuv_rgb_bt709_full.g7b"
+#include "exa_wm_write.g7b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g7b"
#include "exa_wm_src_sample_argb.g7b"
@@ -272,6 +314,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
};
#undef KERNEL
@@ -1876,23 +1924,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN7_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index caa89d95c50c..1689f9e5a6cf 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -135,6 +135,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g8b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
@@ -176,6 +218,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3827,23 +3875,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN8_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c
index b7a1137ff8cb..5efc7a96bdd1 100644
--- a/src/sna/gen9_render.c
+++ b/src/sna/gen9_render.c
@@ -136,6 +136,48 @@ static const uint32_t ps_kernel_nv12_bt709_limited[][4] = {
#include "exa_wm_write.g8b"
};
+static const uint32_t ps_kernel_packed_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt601_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt601_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_packed_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_argb.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_planar_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_planar.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
+static const uint32_t ps_kernel_nv12_bt709_full[][4] = {
+#include "exa_wm_src_affine.g8b"
+#include "exa_wm_src_sample_nv12.g8b"
+#include "exa_wm_yuv_rgb_bt709_full.g8b"
+#include "exa_wm_write.g8b"
+};
+
static const uint32_t ps_kernel_rgb[][4] = {
#include "exa_wm_src_affine.g8b"
#include "exa_wm_src_sample_argb.g8b"
@@ -177,6 +219,12 @@ static const struct wm_kernel_info {
KERNEL(VIDEO_PLANAR_BT709_LIMITED, ps_kernel_planar_bt709_limited, 7),
KERNEL(VIDEO_NV12_BT709_LIMITED, ps_kernel_nv12_bt709_limited, 7),
KERNEL(VIDEO_PACKED_BT709_LIMITED, ps_kernel_packed_bt709_limited, 2),
+ KERNEL(VIDEO_PLANAR_BT601_FULL, ps_kernel_planar_bt601_full, 7),
+ KERNEL(VIDEO_NV12_BT601_FULL, ps_kernel_nv12_bt601_full, 7),
+ KERNEL(VIDEO_PACKED_BT601_FULL, ps_kernel_packed_bt601_full, 2),
+ KERNEL(VIDEO_PLANAR_BT709_FULL, ps_kernel_planar_bt709_full, 7),
+ KERNEL(VIDEO_NV12_BT709_FULL, ps_kernel_nv12_bt709_full, 7),
+ KERNEL(VIDEO_PACKED_BT709_FULL, ps_kernel_packed_bt709_full, 2),
KERNEL(VIDEO_RGB, ps_kernel_rgb, 2),
#endif
};
@@ -3890,23 +3938,38 @@ static unsigned select_video_kernel(const struct sna_video *video,
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_XVMC:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_LIMITED;
case FOURCC_NV12:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_LIMITED;
case FOURCC_RGB888:
case FOURCC_RGB565:
return GEN9_WM_KERNEL_VIDEO_RGB;
default:
- return video->colorspace ?
- GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
- GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
+ if (video->color_range)
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_FULL :
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_FULL;
+ else
+ return video->colorspace ?
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED :
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_LIMITED;
}
}
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 6013feac936d..2d0f82e731eb 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -448,6 +448,14 @@ enum {
GEN6_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN6_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN6_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN6_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN6_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN6_KERNEL_COUNT
};
@@ -504,6 +512,14 @@ enum {
GEN7_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN7_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN7_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN7_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN7_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN7_WM_KERNEL_VIDEO_RGB,
GEN7_WM_KERNEL_COUNT
};
@@ -563,6 +579,14 @@ enum {
GEN8_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN8_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN8_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN8_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN8_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN8_WM_KERNEL_VIDEO_RGB,
GEN8_WM_KERNEL_COUNT
};
@@ -620,6 +644,14 @@ enum {
GEN9_WM_KERNEL_VIDEO_NV12_BT709_LIMITED,
GEN9_WM_KERNEL_VIDEO_PACKED_BT709_LIMITED,
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT601_FULL,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT601_FULL,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT601_FULL,
+
+ GEN9_WM_KERNEL_VIDEO_PLANAR_BT709_FULL,
+ GEN9_WM_KERNEL_VIDEO_NV12_BT709_FULL,
+ GEN9_WM_KERNEL_VIDEO_PACKED_BT709_FULL,
+
GEN9_WM_KERNEL_VIDEO_RGB,
GEN9_WM_KERNEL_COUNT
};
diff --git a/src/sna/sna_video.h b/src/sna/sna_video.h
index bbd3f0fd1b59..5099ded2e948 100644
--- a/src/sna/sna_video.h
+++ b/src/sna/sna_video.h
@@ -101,6 +101,7 @@ struct sna_video {
bool has_color_key;
unsigned colorspace;
+ unsigned color_range;
unsigned colorspace_changed;
/** YUV data buffers */
--
2.16.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread