nv50,nvc0: fix 2d engine stencil-only copies
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 25 Oct 2012 12:11:17 +0000 (14:11 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sun, 28 Oct 2012 13:25:56 +0000 (14:25 +0100)
src/gallium/drivers/nv50/nv50_2d.xml.h
src/gallium/drivers/nv50/nv50_surface.c
src/gallium/drivers/nvc0/nvc0_2d.xml.h
src/gallium/drivers/nvc0/nvc0_surface.c

index bc9bcf7839ed26fe68fddaf7c99fc52698fa9259..dfbef2c6a304ac166163ee7147b510923f551ea3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef NV50_2D_XML
-#define NV50_2D_XML
+#ifndef RNNDB_NV50_2D_XML
+#define RNNDB_NV50_2D_XML
 
 /* Autogenerated file, DO NOT EDIT manually!
 
@@ -8,14 +8,14 @@ http://0x04.net/cgit/index.cgi/rules-ng-ng
 git clone git://0x04.net/rules-ng-ng
 
 The rules-ng-ng source files this header was generated from are:
-- nv50_2d.xml    (   9799 bytes, from 2010-12-28 17:17:11)
-- copyright.xml  (   6452 bytes, from 2010-12-15 23:45:18)
-- nv_object.xml  (  11898 bytes, from 2010-12-28 17:17:11)
-- nvchipsets.xml (   3074 bytes, from 2010-12-15 23:45:18)
-- nv_defs.xml    (   4437 bytes, from 2010-12-15 23:45:18)
-- nv50_defs.xml  (   4487 bytes, from 2010-12-15 23:45:18)
-
-Copyright (C) 2006-2010 by the following authors:
+- rnndb/nv50_2d.xml      (  11113 bytes, from 2011-07-09 13:43:58)
+- ./rnndb/copyright.xml  (   6452 bytes, from 2011-07-09 13:43:58)
+- ./rnndb/nv_object.xml  (  12912 bytes, from 2012-07-12 09:41:09)
+- ./rnndb/nvchipsets.xml (   3736 bytes, from 2012-07-12 09:41:09)
+- ./rnndb/nv_defs.xml    (   4437 bytes, from 2011-07-09 13:43:58)
+- ./rnndb/nv50_defs.xml  (   5468 bytes, from 2011-07-09 13:43:58)
+
+Copyright (C) 2006-2011 by the following authors:
 - Artur Huillet <arthur.huillet@free.fr> (ahuillet)
 - Ben Skeggs (darktama, darktama_)
 - B. R. <koala_br@users.sourceforge.net> (koala_br)
@@ -106,6 +106,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define NV50_2D_UNK228                                         0x00000228
 
+#define NVC0_2D_UNK228                                         0x00000228
+
 #define NV50_2D_SRC_FORMAT                                     0x00000230
 
 #define NV50_2D_SRC_LINEAR                                     0x00000234
@@ -116,6 +118,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define NV50_2D_SRC_LAYER                                      0x00000240
 
+#define NVC0_2D_UNK0240                                                0x00000240
+
 #define NV50_2D_SRC_PITCH                                      0x00000244
 #define NV50_2D_SRC_PITCH__MAX                                 0x00040000
 
@@ -170,23 +174,33 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NV50_2D_ROP                                            0x000002a0
 
 #define NV50_2D_BETA1                                          0x000002a4
+#define NV50_2D_BETA1_BETA1__MASK                              0x7f800000
+#define NV50_2D_BETA1_BETA1__SHIFT                             23
 
 #define NV50_2D_BETA4                                          0x000002a8
+#define NV50_2D_BETA4_B__MASK                                  0x000000ff
+#define NV50_2D_BETA4_B__SHIFT                                 0
+#define NV50_2D_BETA4_G__MASK                                  0x0000ff00
+#define NV50_2D_BETA4_G__SHIFT                                 8
+#define NV50_2D_BETA4_R__MASK                                  0x00ff0000
+#define NV50_2D_BETA4_R__SHIFT                                 16
+#define NV50_2D_BETA4_A__MASK                                  0xff000000
+#define NV50_2D_BETA4_A__SHIFT                                 24
 
 #define NV50_2D_OPERATION                                      0x000002ac
 #define NV50_2D_OPERATION_SRCCOPY_AND                          0x00000000
 #define NV50_2D_OPERATION_ROP_AND                              0x00000001
-#define NV50_2D_OPERATION_BLEND_AND                            0x00000002
+#define NV50_2D_OPERATION_BLEND                                        0x00000002
 #define NV50_2D_OPERATION_SRCCOPY                              0x00000003
-#define NV50_2D_OPERATION_UNK4                                 0x00000004
+#define NV50_2D_OPERATION_ROP                                  0x00000004
 #define NV50_2D_OPERATION_SRCCOPY_PREMULT                      0x00000005
 #define NV50_2D_OPERATION_BLEND_PREMULT                                0x00000006
 
-#define NV50_2D_UNK2B0                                         0x000002b0
-#define NV50_2D_UNK2B0_UNK0__MASK                              0x0000003f
-#define NV50_2D_UNK2B0_UNK0__SHIFT                             0
-#define NV50_2D_UNK2B0_UNK1__MASK                              0x00003f00
-#define NV50_2D_UNK2B0_UNK1__SHIFT                             8
+#define NV50_2D_PATTERN_OFFSET                                 0x000002b0
+#define NV50_2D_PATTERN_OFFSET_X__MASK                         0x0000003f
+#define NV50_2D_PATTERN_OFFSET_X__SHIFT                                0
+#define NV50_2D_PATTERN_OFFSET_Y__MASK                         0x00003f00
+#define NV50_2D_PATTERN_OFFSET_Y__SHIFT                                8
 
 #define NV50_2D_PATTERN_SELECT                                 0x000002b4
 #define NV50_2D_PATTERN_SELECT_MONO_8X8                                0x00000000
@@ -194,6 +208,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NV50_2D_PATTERN_SELECT_MONO_1X64                       0x00000002
 #define NV50_2D_PATTERN_SELECT_COLOR                           0x00000003
 
+#define NVC0_2D_UNK2DC                                         0x000002dc
+
+#define NVC0_2D_UNK2E0                                         0x000002e0
+
 #define NV50_2D_PATTERN_COLOR_FORMAT                           0x000002e8
 #define NV50_2D_PATTERN_COLOR_FORMAT_16BPP                     0x00000000
 #define NV50_2D_PATTERN_COLOR_FORMAT_15BPP                     0x00000001
@@ -201,6 +219,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NV50_2D_PATTERN_COLOR_FORMAT_8BPP                      0x00000003
 #define NV50_2D_PATTERN_COLOR_FORMAT_UNK4                      0x00000004
 #define NV50_2D_PATTERN_COLOR_FORMAT_UNK5                      0x00000005
+#define NV50_2D_PATTERN_COLOR_FORMAT_UNK6                      0x00000006
 
 #define NV50_2D_PATTERN_MONO_FORMAT                            0x000002ec
 #define NV50_2D_PATTERN_MONO_FORMAT_CGA6                       0x00000000
@@ -268,6 +287,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NV50_2D_PATTERN_Y8_Y3__MASK                            0xff000000
 #define NV50_2D_PATTERN_Y8_Y3__SHIFT                           24
 
+#define NVC0_2D_DRAW_COLOR_LONG(i0)                           (0x00000540 + 0x4*(i0))
+#define NVC0_2D_DRAW_COLOR_LONG__ESIZE                         0x00000004
+#define NVC0_2D_DRAW_COLOR_LONG__LEN                           0x00000004
+
 #define NV50_2D_DRAW_SHAPE                                     0x00000580
 #define NV50_2D_DRAW_SHAPE_POINTS                              0x00000000
 #define NV50_2D_DRAW_SHAPE_LINES                               0x00000001
@@ -390,4 +413,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NVC0_2D_FIRMWARE__LEN                                  0x00000020
 
 
-#endif /* NV50_2D_XML */
+#endif /* RNNDB_NV50_2D_XML */
index f315a235aef0bb9a09c0df707da4509b70bffd3b..511ee8fdbec66d56542d6ffaceeca482d8f81649 100644 (file)
@@ -1072,6 +1072,8 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
    }
 
    if (mask != 0xffffffff) {
+      BEGIN_NV04(push, NV50_2D(ROP), 1);
+      PUSH_DATA (push, 0xca); /* DPSDxax */
       BEGIN_NV04(push, NV50_2D(PATTERN_COLOR_FORMAT), 1);
       PUSH_DATA (push, NV50_2D_PATTERN_COLOR_FORMAT_32BPP);
       BEGIN_NV04(push, NV50_2D(PATTERN_COLOR(0)), 4);
@@ -1080,7 +1082,7 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
       PUSH_DATA (push, 0xffffffff);
       PUSH_DATA (push, 0xffffffff);
       BEGIN_NV04(push, NV50_2D(OPERATION), 1);
-      PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY_PREMULT);
+      PUSH_DATA (push, NV50_2D_OPERATION_ROP);
    }
 
    if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) {
index aebcd510e8e96af008a19583d18e5817d775a89d..93dba340899fe52ecdf2f8efc16a6189f59a68a7 100644 (file)
@@ -167,9 +167,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NVC0_2D_OPERATION                                      0x000002ac
 #define NVC0_2D_OPERATION_SRCCOPY_AND                          0x00000000
 #define NVC0_2D_OPERATION_ROP_AND                              0x00000001
-#define NVC0_2D_OPERATION_BLEND_AND                            0x00000002
+#define NVC0_2D_OPERATION_BLEND                                        0x00000002
 #define NVC0_2D_OPERATION_SRCCOPY                              0x00000003
-#define NVC0_2D_OPERATION_UNK4                                 0x00000004
+#define NVC0_2D_OPERATION_ROP                                  0x00000004
 #define NVC0_2D_OPERATION_SRCCOPY_PREMULT                      0x00000005
 #define NVC0_2D_OPERATION_BLEND_PREMULT                                0x00000006
 
index 4f79020518e3567c018b51c0c220da12aac7c7e1..dbd4fa3b7942dbca6ae3e320e5af76cd7980fda2 100644 (file)
@@ -964,6 +964,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
    }
 
    if (mask != 0xffffffff) {
+      IMMED_NVC0(push, NVC0_2D(ROP), 0xca); /* DPSDxax */
       IMMED_NVC0(push, NVC0_2D(PATTERN_COLOR_FORMAT),
                        NVC0_2D_PATTERN_COLOR_FORMAT_32BPP);
       BEGIN_NVC0(push, NVC0_2D(PATTERN_COLOR(0)), 4);
@@ -971,7 +972,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
       PUSH_DATA (push, mask);
       PUSH_DATA (push, 0xffffffff);
       PUSH_DATA (push, 0xffffffff);
-      IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_SRCCOPY_PREMULT);
+      IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_ROP);
    }
 
    if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) {