Add support DN on IVB
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 29 Jun 2012 08:51:00 +0000 (16:51 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 22 Aug 2012 07:02:26 +0000 (03:02 -0400)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_post_processing.c
src/shaders/post_processing/gen7/Makefile.am
src/shaders/post_processing/gen7/nv12_dn_nv12.asm [new file with mode: 0644]
src/shaders/post_processing/gen7/nv12_dn_nv12.g7b [new file with mode: 0644]

index 5ea5dc3..6e29430 100755 (executable)
@@ -614,6 +614,7 @@ static const uint32_t pp_nv12_dndi_gen7[][4] = {
 };
 
 static const uint32_t pp_nv12_dn_gen7[][4] = {
+#include "shaders/post_processing/gen7/nv12_dn_nv12.g7b"
 };
 static const uint32_t pp_nv12_load_save_pa_gen7[][4] = {
 #include "shaders/post_processing/gen7/pl2_to_pa.g7b"
@@ -3159,7 +3160,9 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c
 static int
 gen7_pp_dn_x_steps(void *private_context)
 {
-    return 1;
+    struct pp_dn_context *pp_dn_context = private_context;
+
+    return pp_dn_context->dest_w / 16;
 }
 
 static int
@@ -3254,7 +3257,15 @@ gen7_pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_con
                                SURFACE_FORMAT_PLANAR_420_8, 1,
                                3);
 
-    /* source STMM surface index 5 */
+    /* source (temporal reference) YUV surface index 4 */
+    gen7_pp_set_surface2_state(ctx, pp_context,
+                               obj_surface->bo, 0,
+                               orig_w, orig_h, w,
+                               0, h,
+                               SURFACE_FORMAT_PLANAR_420_8, 1,
+                               4);
+
+    /* STMM / History Statistics input surface, index 5 */
     gen7_pp_set_surface_state(ctx, pp_context,
                               pp_context->stmm.bo, 0,
                               orig_w, orig_h, w, I965_SURFACEFORMAT_R8_UNORM,
@@ -3267,17 +3278,18 @@ gen7_pp_nv12_dn_initialize(VADriverContextP ctx, struct i965_post_processing_con
     w = obj_surface->width;
     h = obj_surface->height;
 
-    /* destination Y surface index 7 */
+    /* destination Y surface index 24 */
     gen7_pp_set_surface_state(ctx, pp_context,
                               obj_surface->bo, 0,
                               orig_w / 4, orig_h, w, I965_SURFACEFORMAT_R8_UNORM,
-                              7, 1);
+                              24, 1);
 
-    /* destination UV surface index 8 */
+    /* destination UV surface index 25 */
     gen7_pp_set_surface_state(ctx, pp_context,
                               obj_surface->bo, w * h,
                               orig_w / 4, orig_h / 2, w, I965_SURFACEFORMAT_R8G8_UNORM,
-                              8, 1);
+                              25, 1);
+
     /* sampler dn */
     dri_bo_map(pp_context->sampler_state_table.bo, True);
     assert(pp_context->sampler_state_table.bo->virtual);
index dbe552e..275efa5 100644 (file)
@@ -1,6 +1,7 @@
 INTEL_PP_G7B = \
        avs.g7b                 \
        dndi.g7b                \
+       nv12_dn_nv12.g7b        \
        pa_to_pl2.g7b           \
        pa_to_pl3.g7b           \
        pl2_to_pa.g7b           \
diff --git a/src/shaders/post_processing/gen7/nv12_dn_nv12.asm b/src/shaders/post_processing/gen7/nv12_dn_nv12.asm
new file mode 100644 (file)
index 0000000..94e7c6b
--- /dev/null
@@ -0,0 +1,5 @@
+// Module name: DN
+
+#include "NV12_DN_NV12.g4a"
+
+// end of DNDI
diff --git a/src/shaders/post_processing/gen7/nv12_dn_nv12.g7b b/src/shaders/post_processing/gen7/nv12_dn_nv12.g7b
new file mode 100644 (file)
index 0000000..a43e216
--- /dev/null
@@ -0,0 +1,40 @@
+   { 0x00600001, 0x22400021, 0x008d0000, 0x00000000 },
+   { 0x00000401, 0x226801ad, 0x000000e0, 0x00000000 },
+   { 0x00000801, 0x227801ad, 0x000000e2, 0x00000000 },
+   { 0x02600031, 0x25c00e21, 0x00000240, 0x045e8003 },
+   { 0x00200001, 0x20e0012d, 0x0045065c, 0x00000000 },
+   { 0x00600001, 0x23600021, 0x008d0000, 0x00000000 },
+   { 0x00200001, 0x22e00021, 0x00450640, 0x00000000 },
+   { 0x00200008, 0x23603da1, 0x004500e0, 0x00020002 },
+   { 0x00000440, 0x23602421, 0x00000360, 0x00000038 },
+   { 0x00000801, 0x23680061, 0x00000000, 0x00010003 },
+   { 0x00600001, 0x22c00021, 0x008d0360, 0x00000000 },
+   { 0x05600031, 0x20000e24, 0x000002c0, 0x040a8021 },
+   { 0x00600001, 0x23200061, 0x00000000, 0x00000000 },
+   { 0x00600001, 0x23000021, 0x008d0000, 0x00000000 },
+   { 0x00000408, 0x23003da1, 0x000000e0, 0x00010001 },
+   { 0x00000041, 0x24043da0, 0x000000e2, 0x00030003 },
+   { 0x00000c08, 0x23043c01, 0x00000404, 0x00020002 },
+   { 0x00000801, 0x23080061, 0x00000000, 0x00050003 },
+   { 0x00200040, 0x23002421, 0x00450300, 0x00450038 },
+   { 0x00000401, 0x23200231, 0x00000648, 0x00000000 },
+   { 0x00000c01, 0x23260129, 0x00000656, 0x00000000 },
+   { 0x00200c01, 0x23280129, 0x00450658, 0x00000000 },
+   { 0x00000c01, 0x23320129, 0x00000650, 0x00000000 },
+   { 0x00200801, 0x23340129, 0x00450652, 0x00000000 },
+   { 0x05600031, 0x20000e24, 0x00000300, 0x040a8021 },
+   { 0x00200040, 0x236035a5, 0x004500e0, 0x00450088 },
+   { 0x0000040c, 0x23643ca5, 0x00000364, 0x00010001 },
+   { 0x00000801, 0x23680061, 0x00000000, 0x0004000f },
+   { 0x00600001, 0x24800021, 0x008d0360, 0x00000000 },
+   { 0x04600031, 0x27400e21, 0x00000480, 0x02390001 },
+   { 0x00000001, 0x24880061, 0x00000000, 0x0003000f },
+   { 0x00600001, 0x25a00021, 0x008d0000, 0x00000000 },
+   { 0x00200401, 0x25a001a1, 0x004500e0, 0x00000000 },
+   { 0x00000801, 0x25a80061, 0x00000000, 0x0007000f },
+   { 0x05600031, 0x20000e24, 0x000005a0, 0x0a0a8018 },
+   { 0x00600001, 0x24a00021, 0x008d0740, 0x00000000 },
+   { 0x00600001, 0x24c00021, 0x008d0760, 0x00000000 },
+   { 0x05600031, 0x20000e24, 0x00000480, 0x060a8019 },
+   { 0x00600001, 0x2fe00021, 0x008d0000, 0x00000000 },
+   { 0x07000031, 0x20001e24, 0x00000fe0, 0x82000010 },