diff mbox

[xf86-video-intel,4/6] sna/video/textured: Add shaders to deal with full range yuv data

Message ID 20180704185919.30946-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä July 4, 2018, 6:59 p.m. UTC
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 mbox

Patch

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 */