Skip to contentSkip to conversation

sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7

PATCH In review Ville Syrjala 3 participants 9 messages Jul 4, 2018 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7

From: Ville Syrjälä <[email protected]>

gen8/9 has some compile time asserts to verify the SAMPLER_OFFSET() bits don't exceed their quota of the flags. Add similar asserts for gen6/7.

---
 src/sna/gen6_render.c | 1 +
 src/sna/gen7_render.c | 1 +
 2 files changed, 2 insertions(+)
src/sna/gen6_render.c +1 -0
index 0a53ef562540..1558750325f0 100644
@@ -3725,6 +3725,7 @@ static bool gen6_render_setup(struct sna *sna, int devid)
 		}
 	}
 
+	COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
 	ss = sna_static_stream_map(&general,
 				   2 * sizeof(*ss) *
 				   (2 +
src/sna/gen7_render.c +1 -0
index 0a3bda768100..671f60e07679 100644
@@ -3958,6 +3958,7 @@ 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(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
 	ss = sna_static_stream_map(&general,
 				   2 * sizeof(*ss) *
 				   (2 +
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

A message that is not in the archive (sent off-list or not yet received): 20180704185919.30946-1-ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]

#2 lore raw

PATCH 6/6 sna/video/sprite: Add XV_COLOR_RANGE port attribute

From: Ville Syrjälä <[email protected]>

Add a new Xv port attribute XV_COLOR_RANGE to select the incoming YUV quantization range. 0 means limited range (Y: 16-235, Cb/Cr: 16-240), 1 means full range (0-255).

We'll forward the quantization range information to the kernel via the COLOR_RANGE kms property.

---
 src/sna/sna.h              |  3 +-
 src/sna/sna_display.c      | 72 ++++++++++++++++++++++++++++++++++++++++------
 src/sna/sna_video_sprite.c | 18 +++++++++---
 3 files changed, 80 insertions(+), 13 deletions(-)
src/sna/sna.h +2 -1
index 496460ca6a84..658093f3c04c 100644
@@ -633,7 +633,8 @@ static inline void sna_present_cancel_flip(struct sna *sna) { }
 
 extern unsigned sna_crtc_count_sprites(xf86CrtcPtr crtc);
 extern bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, unsigned idx, uint32_t rotation);
-extern void sna_crtc_set_sprite_colorspace(xf86CrtcPtr crtc, unsigned idx, int colorspace);
+extern void sna_crtc_set_sprite_colorspace(xf86CrtcPtr crtc, unsigned idx,
+					   int colorspace, int color_range);
 extern uint32_t sna_crtc_to_sprite(xf86CrtcPtr crtc, unsigned idx);
 extern bool sna_crtc_is_transformed(xf86CrtcPtr crtc);
 bool sna_has_sprite_format(struct sna *sna, uint32_t format);
src/sna/sna_display.c +64 -8

97 lines not on this page · raw message

src/sna/sna_video_sprite.c +14 -4
index 8b7ae8ae9e75..1f41e3f8528d 100644
@@ -70,7 +70,7 @@ struct local_mode_set_plane {
 
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true)
 
-static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank, xvColorspace;
+static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank, xvColorspace, xvColorRange;
 
 static XvFormatRec formats[] = { {15}, {16}, {24} };
 static const XvImageRec images[] = { XVIMAGE_YUY2, XVIMAGE_UYVY,
@@ -81,6 +81,7 @@ static const XvImageRec images_nv12[] = { XVIMAGE_YUY2, XVIMAGE_UYVY,
 					  XVIMAGE_NV12, XVMC_RGB888, XVMC_RGB565 };
 static const XvAttributeRec attribs[] = {
 	{ XvSettable | XvGettable, 0, 1, (char *)"XV_COLORSPACE" }, /* BT.601, BT.709 */
+	{ XvSettable | XvGettable, 0, 1, (char *)"XV_COLOR_RANGE" }, /* limited, full */
 	{ XvSettable | XvGettable, 0, 0xffffff, (char *)"XV_COLORKEY" },
 	{ XvSettable | XvGettable, 0, 1, (char *)"XV_ALWAYS_ON_TOP" },
 };
@@ -130,6 +131,10 @@ static int sna_video_sprite_set_attr(ddSetPortAttribute_ARGS)
 		video->colorspace_changed = ~0;
 		video->colorspace = value;
 		DBG(("COLORSPACE = %ld\n", (long)value));
+	} else if (attribute == xvColorRange) {
+		video->colorspace_changed = ~0;
+		video->color_range = value;
+		DBG(("COLOR_RANGE = %ld\n", (long)value));
 	} else if (attribute == xvSyncToVblank) {
 		DBG(("%s: SYNC_TO_VBLANK: %d -> %d\n", __FUNCTION__,
 		     video->SyncToVblank, !!value));
@@ -153,6 +158,8 @@ static int sna_video_sprite_get_attr(ddGetPortAttribute_ARGS)
 		*value = video->color_key;
 	else if (attribute == xvColorspace)
 		*value = video->colorspace;
+	else if (attribute == xvColorRange)
+		*value = video->color_range;
 	else if (attribute == xvAlwaysOnTop)
 		*value = video->AlwaysOnTop;
 	else if (attribute == xvSyncToVblank)
@@ -289,11 +296,12 @@ sna_video_sprite_show(struct sna *sna,
 	}
 
 	if (video->colorspace_changed & (1 << pipe)) {
-		DBG(("%s: updating colorspace: %x\n",
-		     __FUNCTION__, video->colorspace));
+		DBG(("%s: updating colorspace: %x / color_range: %x\n",
+		     __FUNCTION__, video->colorspace, video->color_range));
 
 		sna_crtc_set_sprite_colorspace(crtc, video->idx,
-					       video->colorspace);
+					       video->colorspace,
+					       video->color_range);
 
 		video->colorspace_changed &= ~(1 << pipe);
 	}
@@ -851,6 +859,7 @@ void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen)
 		video->color_key = sna_video_sprite_color_key(sna);
 		video->color_key_changed = ~0;
 		video->colorspace = 1; /* BT.709 */
+		video->color_range = 0; /* limited */
 		video->colorspace_changed = ~0;
 		video->has_color_key = true;
 		video->brightness = -19;	/* (255/219) * -16 */
@@ -873,6 +882,7 @@ void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen)
 
 	xvColorKey = MAKE_ATOM("XV_COLORKEY");
 	xvColorspace = MAKE_ATOM("XV_COLORSPACE");
+	xvColorRange = MAKE_ATOM("XV_COLOR_RANGE");
 	xvAlwaysOnTop = MAKE_ATOM("XV_ALWAYS_ON_TOP");
 	xvSyncToVblank = MAKE_ATOM("XV_SYNC_TO_VBLANK");
 
Signature · 6 lines
2.16.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel
#3 lore raw

PATCH 2/6 sna/gen6+: Split out wm_kernel from the sna_composite_op flags

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

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")
---
 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(-)
src/sna/gen6_render.c +28 -19
index 1558750325f0..99cc4b0ecb5c 100644
@@ -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) *
src/sna/gen7_render.c +22 -13
index 671f60e07679..cffe17de6d0d 100644
@@ -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) *
src/sna/gen8_render.c +22 -13
index 69617da561b6..9bac9b8bb6be 100644
@@ -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) *
src/sna/gen9_render.c +22 -13
index 505b98afa38c..eb22b642ffa1 100644
@@ -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) *
src/sna/sna_render.h +4 -0
index 6669af9d1cd8..442a6ec50191 100644
@@ -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;
 
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH xf86-video-intel 2/6] sna/gen6+: Split out wm_kernel from the sna_composite_op flags

Quoting Ville Syrjala (2018-07-04 19:59:15)

Quoted 5 lines

From: Ville Syrjälä <[email protected]>

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.

Does make one wish we had used push constants or loading them from a constant surface. Oh well, stick to the path of least resistance. Looks fine, but I should double check the asm at the end.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: [PATCH xf86-video-intel 2/6] sna/gen6+: Split out wm_kernel from the sna_composite_op flags

Quoted 10 lines · Chris Wilson

Quoting Ville Syrjala (2018-07-04 19:59:15)

Quoted 5 lines

From: Ville Syrjälä <[email protected]>

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.

Does make one wish we had used push constants or loading them from a constant surface. Oh well, stick to the path of least resistance. Looks fine, but I should double check the asm at the end.

Yeah. I should really rewrite these things to use the brw thing, at which point I imagine it would be feasible to pass in some constants as well. So far the motivation has escaped me.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 3/6 sna/vide/textured: Rename yuv shaders to indicate they handle limited range data

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Rename the current yuv->rgb shaders in anticipation of variants that will deal with full range yuv data.

---
 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%)
src/render_program/Makefile.am +22 -22
index dc58138f356e..e7592a627e11 100644
@@ -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 = 		\
src/render_program/exa_wm_yuv_rgb_bt601.g5a deleted +0 -1
deleted file mode 120000
index 8c98e82d0f02..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601.g6a deleted +0 -1
deleted file mode 120000
index 8c98e82d0f02..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601.g7a deleted +0 -1
deleted file mode 120000
index 8c98e82d0f02..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt601.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a renamed from src/render_program/exa_wm_yuv_rgb_bt601.g4a +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b renamed from src/render_program/exa_wm_yuv_rgb_bt601.g4b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g4b.gen5 renamed from src/render_program/exa_wm_yuv_rgb_bt601.g4b.gen5 +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g5a new file +1 -0
new file mode 120000
index 000000000000..536b052ccecc
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_limited.g5b renamed from src/render_program/exa_wm_yuv_rgb_bt601.g5b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g6a new file +1 -0
new file mode 120000
index 000000000000..536b052ccecc
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_limited.g6b renamed from src/render_program/exa_wm_yuv_rgb_bt601.g6b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g7a new file +1 -0
new file mode 120000
index 000000000000..536b052ccecc
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_limited.g7b renamed from src/render_program/exa_wm_yuv_rgb_bt601.g7b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g8a renamed from src/render_program/exa_wm_yuv_rgb_bt601.g8a +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt601_limited.g8b renamed from src/render_program/exa_wm_yuv_rgb_bt601.g8b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709.g5a deleted +0 -1
deleted file mode 120000
index 9b4ca31203c3..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709.g6a deleted +0 -1
deleted file mode 120000
index 9b4ca31203c3..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709.g7a deleted +0 -1
deleted file mode 120000
index 9b4ca31203c3..000000000000
@@ -1 +0,0 @@
-exa_wm_yuv_rgb_bt709.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_limited.g4a renamed from src/render_program/exa_wm_yuv_rgb_bt709.g4a +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b renamed from src/render_program/exa_wm_yuv_rgb_bt709.g4b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g4b.gen5 renamed from src/render_program/exa_wm_yuv_rgb_bt709.g4b.gen5 +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g5a new file +1 -0
new file mode 120000
index 000000000000..7ec690d6ab1f
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_limited.g5b renamed from src/render_program/exa_wm_yuv_rgb_bt709.g5b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g6a new file +1 -0
new file mode 120000
index 000000000000..7ec690d6ab1f
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_limited.g6b renamed from src/render_program/exa_wm_yuv_rgb_bt709.g6b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g7a new file +1 -0
new file mode 120000
index 000000000000..7ec690d6ab1f
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_limited.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_limited.g7b renamed from src/render_program/exa_wm_yuv_rgb_bt709.g7b +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g8a renamed from src/render_program/exa_wm_yuv_rgb_bt709.g8a +0 -0
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
src/render_program/exa_wm_yuv_rgb_bt709_limited.g8b renamed from src/render_program/exa_wm_yuv_rgb_bt709.g8b +0 -0
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
src/sna/brw/brw_test_gen4.c +2 -2
index 78ff74653b63..bf2d2e2d9916 100644
@@ -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"
 };
 
src/sna/brw/brw_test_gen5.c +2 -2
index e821ce8bb814..2a4e408efdaf 100644
@@ -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"
 };
 
src/sna/brw/brw_test_gen6.c +2 -2
index 9603b9d99ceb..dc10b1c4af92 100644
@@ -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"
 };
 
src/sna/brw/brw_test_gen7.c +2 -2
index 658b6699594a..e5af6f9909ae 100644
@@ -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"
 };
 
src/sna/gen4_render.c +24 -24

106 lines not on this page · raw message

src/sna/gen4_render.h +6 -6
index f516c316c096..645226dd81ab 100644
@@ -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;
src/sna/gen5_render.c +24 -24

106 lines not on this page · raw message

src/sna/gen5_render.h +6 -6
index 8901480a6d0f..04ff6366bb97 100644
@@ -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;
src/sna/gen6_render.c +24 -24

100 lines not on this page · raw message

src/sna/gen7_render.c +24 -24

102 lines not on this page · raw message

src/sna/gen8_render.c +24 -24

102 lines not on this page · raw message

src/sna/gen9_render.c +24 -24

102 lines not on this page · raw message

src/sna/sna_render.h +24 -24

76 lines not on this page · raw message

src/uxa/i965_video.c +8 -8
index 9b9203b66f25..1b62c835e5df 100644
@@ -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"
 };
 
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 4/6 sna/video/textured: Add shaders to deal with full range yuv data

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

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.

---
 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
src/render_program/Makefile.am +22 -0
index e7592a627e11..025ffe258773 100644
@@ -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)
 
src/render_program/exa_wm_yuv_rgb_bt601_full.g4a new file +109 -0

109 lines not on this page · raw message

src/render_program/exa_wm_yuv_rgb_bt601_full.g4b new file +11 -0
new file mode 100644
index 000000000000..dd029a127c57
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_full.g4b.gen5 new file +11 -0
new file mode 100644
index 000000000000..dd029a127c57
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_full.g5a new file +1 -0
new file mode 120000
index 000000000000..d65d75d9ccb4
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_full.g5b new file +11 -0
new file mode 100644
index 000000000000..dd029a127c57
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_full.g6a new file +1 -0
new file mode 120000
index 000000000000..d65d75d9ccb4
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_full.g6b new file +11 -0
new file mode 100644
index 000000000000..34f979718b2c
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_full.g7a new file +1 -0
new file mode 120000
index 000000000000..d65d75d9ccb4
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt601_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt601_full.g7b new file +11 -0
new file mode 100644
index 000000000000..34f979718b2c
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_full.g8a new file +116 -0

116 lines not on this page · raw message

src/render_program/exa_wm_yuv_rgb_bt601_full.g8b new file +18 -0
new file mode 100644
index 000000000000..1eb687221ab6
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt601_limited.g4a +0 -1
index 7bc8dd14d9c4..6df6134798fa 100644
@@ -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) -
src/render_program/exa_wm_yuv_rgb_bt709_full.g4a new file +109 -0

109 lines not on this page · raw message

src/render_program/exa_wm_yuv_rgb_bt709_full.g4b new file +11 -0
new file mode 100644
index 000000000000..bfd02996e33b
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt709_full.g4b.gen5 new file +11 -0
new file mode 100644
index 000000000000..bfd02996e33b
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt709_full.g5a new file +1 -0
new file mode 120000
index 000000000000..3c5034797232
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_full.g5b new file +11 -0
new file mode 100644
index 000000000000..bfd02996e33b
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt709_full.g6a new file +1 -0
new file mode 120000
index 000000000000..3c5034797232
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_full.g6b new file +11 -0
new file mode 100644
index 000000000000..389caaf3714d
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt709_full.g7a new file +1 -0
new file mode 120000
index 000000000000..3c5034797232
@@ -0,0 +1 @@
+exa_wm_yuv_rgb_bt709_full.g4a
\ No newline at end of file
src/render_program/exa_wm_yuv_rgb_bt709_full.g7b new file +11 -0
new file mode 100644
index 000000000000..389caaf3714d
@@ -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 },
src/render_program/exa_wm_yuv_rgb_bt709_full.g8a new file +116 -0

116 lines not on this page · raw message

src/render_program/exa_wm_yuv_rgb_bt709_full.g8b new file +18 -0
new file mode 100644
index 000000000000..2af7a0b64cc2
@@ -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 },
src/sna/gen4_render.c +80 -9

111 lines not on this page · raw message

src/sna/gen4_render.h +8 -0
index 645226dd81ab..25c1dd80fa9c 100644
@@ -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;
 
src/sna/gen5_render.c +80 -9

111 lines not on this page · raw message

src/sna/gen5_render.h +8 -0
index 04ff6366bb97..934dc37b46ee 100644
@@ -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
src/sna/gen6_render.c +74 -10

112 lines not on this page · raw message

src/sna/gen7_render.c +72 -9

107 lines not on this page · raw message

src/sna/gen8_render.c +72 -9

107 lines not on this page · raw message

src/sna/gen9_render.c +72 -9

107 lines not on this page · raw message

src/sna/sna_render.h +32 -0
index 6013feac936d..2d0f82e731eb 100644
@@ -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
 };
src/sna/sna_video.h +1 -0
index bbd3f0fd1b59..5099ded2e948 100644
@@ -101,6 +101,7 @@ struct sna_video {
 	bool has_color_key;
 
 	unsigned colorspace;
+	unsigned color_range;
 	unsigned colorspace_changed;
 
 	/** YUV data buffers */
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 5/6 sna/video/textured: Add XV_COLOR_RANGE port attribute

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Add a new Xv port attribute XV_COLOR_RANGE to select the incoming YUV quantization range. 0 means limited range (Y: 16-235, Cb/Cr: 16-240), 1 means full range (0-255).

---
 src/sna/sna_video_textured.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
src/sna/sna_video_textured.c +11 -1
index a784fe2ec0f4..a33cbc4506cb 100644
@@ -36,7 +36,7 @@
 
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true)
 
-static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace;
+static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace, xvColorRange;
 
 static XvFormatRec Formats[] = {
 	{15}, {16}, {24}
@@ -45,6 +45,7 @@ static XvFormatRec Formats[] = {
 static const XvAttributeRec Attributes[] = {
 	{XvSettable | XvGettable, -1, 1, (char *)"XV_SYNC_TO_VBLANK"},
 	{XvSettable | XvGettable, 0, 1, (char *)"XV_COLORSPACE"}, /* BT.601, BT.709 */
+	{XvSettable | XvGettable, 0, 1, (char *)"XV_COLOR_RANGE"}, /* limited, full */
 	//{XvSettable | XvGettable, -128, 127, (char *)"XV_BRIGHTNESS"},
 	//{XvSettable | XvGettable, 0, 255, (char *)"XV_CONTRAST"},
 };
@@ -108,6 +109,11 @@ sna_video_textured_set_attribute(ddSetPortAttribute_ARGS)
 			return BadValue;
 
 		video->colorspace = value;
+	} else if (attribute == xvColorRange) {
+		if (value < 0 || value > 1)
+			return BadValue;
+
+		video->color_range = value;
 	} else
 		return BadMatch;
 
@@ -127,6 +133,8 @@ sna_video_textured_get_attribute(ddGetPortAttribute_ARGS)
 		*value = video->SyncToVblank;
 	else if (attribute == xvColorspace)
 		*value = video->colorspace;
+	else if (attribute == xvColorRange)
+		*value = video->color_range;
 	else
 		return BadMatch;
 
@@ -435,6 +443,7 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen)
 		v->textured = true;
 		v->alignment = 4;
 		v->colorspace = 1; /* BT.709 */
+		v->color_range = 0; /* limited */
 		v->SyncToVblank = (sna->flags & SNA_NO_WAIT) == 0;
 
 		RegionNull(&v->clip);
@@ -456,6 +465,7 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen)
 	xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
 	xvContrast = MAKE_ATOM("XV_CONTRAST");
 	xvColorspace = MAKE_ATOM("XV_COLORSPACE");
+	xvColorRange = MAKE_ATOM("XV_COLOR_RANGE");
 	xvSyncToVblank = MAKE_ATOM("XV_SYNC_TO_VBLANK");
 
 	DBG(("%s: '%s' initialized %d ports\n", __FUNCTION__, adaptor->name, adaptor->nPorts));
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

A message that is not in the archive (sent off-list or not yet received): 20180704185919.30946-5-ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]

#10 lore raw

Re: [PATCH xf86-video-intel 5/6] sna/video/textured: Add XV_COLOR_RANGE port attribute

Quoted 26 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Add a new Xv port attribute XV_COLOR_RANGE to select the incoming YUV quantization range. 0 means limited range (Y: 16-235, Cb/Cr: 16-240), 1 means full range (0-255).

---
 src/sna/sna_video_textured.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
src/sna/sna_video_textured.c +1 -1
index a784fe2ec0f4..a33cbc4506cb 100644
@@ -36,7 +36,7 @@
 
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true)
 
-static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace;
+static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace, xvColorRange;
 
 static XvFormatRec Formats[] = {
 	{15}, {16}, {24}

src/sna/sna_video_textured.c static XvFormatRec Formats[] = { · line 48

Quoted 4 lines
src/sna/sna_video_textured.c +1 -0
@@ -45,6 +45,7 @@ static XvFormatRec Formats[] = {
 static const XvAttributeRec Attributes[] = {
 	{XvSettable | XvGettable, -1, 1, (char *)"XV_SYNC_TO_VBLANK"},
 	{XvSettable | XvGettable, 0, 1, (char *)"XV_COLORSPACE"}, /* BT.601, BT.709 */
+	{XvSettable | XvGettable, 0, 1, (char *)"XV_COLOR_RANGE"}, /* limited, full */

Oh, and I forgot to mention in the commit message that I tried to look for a pre-existing attribute for this stuff in a bunch other drivers but couldn't find anything. If I missed something please let me know.

Quoted 42 lines
src/sna/sna_video_textured.c +9 -0
 	//{XvSettable | XvGettable, -128, 127, (char *)"XV_BRIGHTNESS"},
 	//{XvSettable | XvGettable, 0, 255, (char *)"XV_CONTRAST"},
 };
@@ -108,6 +109,11 @@ sna_video_textured_set_attribute(ddSetPortAttribute_ARGS)
 			return BadValue;
 
 		video->colorspace = value;
+	} else if (attribute == xvColorRange) {
+		if (value < 0 || value > 1)
+			return BadValue;
+
+		video->color_range = value;
 	} else
 		return BadMatch;
 
@@ -127,6 +133,8 @@ sna_video_textured_get_attribute(ddGetPortAttribute_ARGS)
 		*value = video->SyncToVblank;
 	else if (attribute == xvColorspace)
 		*value = video->colorspace;
+	else if (attribute == xvColorRange)
+		*value = video->color_range;
 	else
 		return BadMatch;
 
@@ -435,6 +443,7 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen)
 		v->textured = true;
 		v->alignment = 4;
 		v->colorspace = 1; /* BT.709 */
+		v->color_range = 0; /* limited */
 		v->SyncToVblank = (sna->flags & SNA_NO_WAIT) == 0;
 
 		RegionNull(&v->clip);
@@ -456,6 +465,7 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen)
 	xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
 	xvContrast = MAKE_ATOM("XV_CONTRAST");
 	xvColorspace = MAKE_ATOM("XV_COLORSPACE");
+	xvColorRange = MAKE_ATOM("XV_COLOR_RANGE");
 	xvSyncToVblank = MAKE_ATOM("XV_SYNC_TO_VBLANK");
 
 	DBG(("%s: '%s' initialized %d ports\n", __FUNCTION__, adaptor->name, adaptor->nPorts));
Signature · 1 line
2.16.4
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel