fix rendering of RGBA subpicture 92/492/1
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Wed, 18 Nov 2009 03:24:29 +0000 (11:24 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 18 Nov 2009 03:51:11 +0000 (11:51 +0800)
i965_drv_video/i965_render.c
i965_drv_video/shaders/render/Makefile.am
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b [deleted file]
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5 [deleted file]
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4a [moved from i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4a with 56% similarity]
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b [new file with mode: 0644]
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5 [new file with mode: 0644]

index f523c6a..f3e89c2 100644 (file)
@@ -70,7 +70,7 @@ static const unsigned int ps_subpic_kernel_static[][4] =
 {
 #include "shaders/render/exa_wm_xy.g4b"
 #include "shaders/render/exa_wm_src_affine.g4b"
-#include "shaders/render/exa_wm_blend_subpicture.g4b"
+#include "shaders/render/exa_wm_src_sample_argb.g4b"
 #include "shaders/render/exa_wm_write.g4b"
 };
 
@@ -92,7 +92,7 @@ static const unsigned int ps_subpic_kernel_static_gen5[][4] =
 {
 #include "shaders/render/exa_wm_xy.g4b.gen5"
 #include "shaders/render/exa_wm_src_affine.g4b.gen5"
-#include "shaders/render/exa_wm_blend_subpicture.g4b.gen5"
+#include "shaders/render/exa_wm_src_sample_argb.g4b.gen5"
 #include "shaders/render/exa_wm_write.g4b.gen5"
 };
 
index f38c234..fb9b11e 100644 (file)
@@ -7,27 +7,27 @@ INTEL_G4A =                           \
        exa_sf.g4a                      \
        exa_wm_xy.g4a                   \
        exa_wm_src_affine.g4a           \
+       exa_wm_src_sample_argb.g4a      \
        exa_wm_src_sample_planar.g4a    \
        exa_wm_yuv_rgb.g4a              \
-       exa_wm_blend_subpicture.g4a             \
        exa_wm_write.g4a
 
 INTEL_G4B =                            \
        exa_sf.g4b                      \
        exa_wm_xy.g4b                   \
        exa_wm_src_affine.g4b           \
+       exa_wm_src_sample_argb.g4b      \
        exa_wm_src_sample_planar.g4b    \
        exa_wm_yuv_rgb.g4b              \
-       exa_wm_blend_subpicture.g4b             \
        exa_wm_write.g4b
 
 INTEL_G4B_GEN5 =                               \
        exa_sf.g4b.gen5                         \
        exa_wm_xy.g4b.gen5                      \
        exa_wm_src_affine.g4b.gen5              \
+       exa_wm_src_sample_argb.g4b.gen5 \
        exa_wm_src_sample_planar.g4b.gen5       \
        exa_wm_yuv_rgb.g4b.gen5                 \
-       exa_wm_blend_subpicture.g4b.gen5        \
        exa_wm_write.g4b.gen5
 
 EXTRA_DIST = $(INTEL_G4I)      \
diff --git a/i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b b/i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b
deleted file mode 100644 (file)
index bbc75c0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-   { 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
-   { 0x01800031, 0x22001d29, 0x008d0000, 0x02520001 },
-   { 0x01800031, 0x21c01d29, 0x008d0000, 0x02520201 },
-   { 0x01800031, 0x22401d29, 0x008d0000, 0x02520401 },
-   { 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
-   { 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
-   { 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
-   { 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
-   { 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
-   { 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
-   { 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
-   { 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
diff --git a/i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5 b/i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5
deleted file mode 100644 (file)
index 0e7534f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-   { 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
-   { 0x01800031, 0x22001d29, 0x208d0000, 0x0a2a0001 },
-   { 0x01800031, 0x21c01d29, 0x208d0000, 0x0a2a0201 },
-   { 0x01800031, 0x22401d29, 0x208d0000, 0x0a2a0401 },
-   { 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
-   { 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
-   { 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
-   { 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
-   { 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
-   { 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
-   { 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
-   { 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
-   { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
@@ -25,7 +25,8 @@
  *    Keith Packard <keithp@keithp.com>
  */
 
-/* Sample the src surface in planar format */
+/* Sample the src surface */
+
 include(`exa_wm.g4i')
 
 /* prepare sampler read back gX register, which would be written back to output */
@@ -33,51 +34,14 @@ include(`exa_wm.g4i')
 /* use simd16 sampler, param 0 is u, param 1 is v. */
 /* 'payload' loading, assuming tex coord start from g4 */
 
-/* load r */
-mov (1) g0.8<1>UD      0x0000e000UD { align1 mask_disable };
+/* load argb */
+mov (1) g0.8<1>UD      0x00000000UD { align1 mask_disable };
 
 /* src_msg will be copied with g0, as it contains send desc */
 /* emit sampler 'send' cmd */
-
-
-/* sample Y */
-send (16) src_msg_ind          /* msg reg index */
-       src_sample_g<1>UW       /* readback */
-       g0<8,8,1>UW             /* copy to msg start reg*/
-       sampler (1,0,F)         /* sampler message description, (binding_table,sampler_index,datatype)*/
-       mlen 5 rlen 2 {align1};
-
-/* sample U (Cr) */
-send (16) src_msg_ind          /* msg reg index */
-       src_sample_r<1>UW       /* readback */
-       g0<8,8,1>UW             /* copy to msg start reg*/
-       sampler (1,2,F)         /* sampler message description, (binding_table,sampler_index,datatype)
-                               /* here(src->dst) we should use src_sampler and src_surface */
-       mlen 5 rlen 2 { align1 };   /* required message len 5, readback len 8 */
-       
-/* sample V (Cb) */
 send (16) src_msg_ind          /* msg reg index */
-       src_sample_b<1>UW       /* readback */
+       src_sample_base<1>UW    /* readback */
        g0<8,8,1>UW             /* copy to msg start reg*/
-       sampler (1,4,F)         /* sampler message description, (binding_table,sampler_index,datatype)
+       sampler (1,0,F)         /* sampler message description, (binding_table,sampler_index,datatype)
                                /* here(src->dst) we should use src_sampler and src_surface */
-       mlen 5 rlen 2 { align1 };   /* required message len 5, readback len 8 */
-
-/*extract alpha value, alpha value stores in one float with color value, because the color value is small,
-we can neglect it when doing alpha blend*/
-mov (8) src_sample_a<1>F g14<8,8,1>F { align1 };
-mov (8) src_sample_a_23<1>F g15<8,8,1>F { align1 };
-
-
-/*set subtitle color*/
-add (8) g14<1>F g14<8,8,1>F 0.5F { align1 };
-add (8) g15<1>F g15<8,8,1>F 0.5F { align1 };
-add (8) g16<1>F g16<8,8,1>F 0.5F { align1 };
-add (8) g17<1>F g17<8,8,1>F 0.5F { align1 };
-add (8) g18<1>F g18<8,8,1>F 0.5F { align1 };
-add (8) g19<1>F g19<8,8,1>F 0.5F { align1 };
-
-nop;
-nop;
-nop;
-
+       mlen 5 rlen 8 { align1 };   /* required message len 5, readback len 8 */
diff --git a/i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b b/i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b
new file mode 100644 (file)
index 0000000..c5b9274
--- /dev/null
@@ -0,0 +1,2 @@
+   { 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
+   { 0x01800031, 0x21c01d29, 0x008d0000, 0x02580001 },
diff --git a/i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5 b/i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5
new file mode 100644 (file)
index 0000000..f8cb41e
--- /dev/null
@@ -0,0 +1,2 @@
+   { 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
+   { 0x01800031, 0x21c01d29, 0x208d0000, 0x0a8a0001 },