Home | History | Annotate | Line # | Download | only in pci
gffbreg.h revision 1.5
      1  1.4       rin /*	$NetBSD: gffbreg.h,v 1.5 2020/04/16 23:29:53 rin Exp $	*/
      2  1.1  macallan 
      3  1.1  macallan /*
      4  1.3  macallan  * Copyright (c) 2013 Michael Lorenz
      5  1.1  macallan  * All rights reserved.
      6  1.1  macallan  *
      7  1.1  macallan  * Redistribution and use in source and binary forms, with or without
      8  1.1  macallan  * modification, are permitted provided that the following conditions
      9  1.1  macallan  * are met:
     10  1.1  macallan  * 1. Redistributions of source code must retain the above copyright
     11  1.1  macallan  *    notice, this list of conditions and the following disclaimer.
     12  1.1  macallan  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  macallan  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  macallan  *    documentation and/or other materials provided with the distribution.
     15  1.1  macallan  *
     16  1.1  macallan  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.1  macallan  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  1.1  macallan  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  1.1  macallan  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  1.1  macallan  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21  1.1  macallan  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22  1.1  macallan  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23  1.1  macallan  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  1.1  macallan  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25  1.1  macallan  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  1.1  macallan  */
     27  1.1  macallan 
     28  1.1  macallan /*
     29  1.1  macallan  * A console driver for nvidia geforce graphics controllers
     30  1.1  macallan  * tested on macppc only so far
     31  1.1  macallan  * register definitions are mostly from the xf86-video-nv driver
     32  1.1  macallan  */
     33  1.1  macallan 
     34  1.5       rin #include <sys/cdefs.h>
     35  1.5       rin __KERNEL_RCSID(0, "$NetBSD: gffbreg.h,v 1.5 2020/04/16 23:29:53 rin Exp $");
     36  1.5       rin 
     37  1.1  macallan #ifndef GFFBREG_H
     38  1.1  macallan #define GFFBREG_H
     39  1.1  macallan 
     40  1.1  macallan #define GFFB_RAMDAC0	0x00680000
     41  1.1  macallan #define GFFB_RAMDAC1	0x00682000
     42  1.1  macallan 
     43  1.1  macallan #define GFFB_PCIO0	0x00601000
     44  1.1  macallan #define GFFB_PCIO1	0x00603000
     45  1.1  macallan 
     46  1.1  macallan /* VGA registers live here, one set for each head */
     47  1.1  macallan #define GFFB_PDIO0	0x00681000
     48  1.1  macallan #define GFFB_PDIO1	0x00683000
     49  1.1  macallan 
     50  1.1  macallan #define GFFB_CRTC0	0x00600000
     51  1.1  macallan #define GFFB_CRTC1	0x00602000
     52  1.1  macallan 
     53  1.2  macallan #define GFFB_FIFO	0x00800000
     54  1.2  macallan #define GFFB_FIFO_PUT	0x00800040	/* command list stop */
     55  1.2  macallan #define GFFB_FIFO_GET	0x00800044	/* command list pointer */
     56  1.2  macallan 
     57  1.2  macallan #define GFFB_PGRAPH	0x00400000
     58  1.2  macallan #define GFFB_BUSY	0x00400700
     59  1.2  macallan 
     60  1.2  macallan #define GFFB_PFB	0x00100000
     61  1.2  macallan #define GFFB_VRAM	0x0010020c	/* vram size in 0xfff00000 */
     62  1.2  macallan 
     63  1.2  macallan #define GFFB_PRAMIN	0x00710000
     64  1.2  macallan #define GFFB_CMDSTART	0x00712098	/* ??? */
     65  1.2  macallan 
     66  1.2  macallan #define GFFB_PMC	0x00000000
     67  1.2  macallan #define GFFB_PFIFO	0x00002000
     68  1.2  macallan #define GFFB_PEXTDEV	0x00101000
     69  1.2  macallan #define GFFB_PTIMER	0x00009000
     70  1.2  macallan 
     71  1.1  macallan /* CRTC registers */
     72  1.1  macallan #define GFFB_DISPLAYSTART	0x800
     73  1.1  macallan 
     74  1.1  macallan /* VGA registers */
     75  1.1  macallan #define GFFB_PEL_MASK	0x3c6
     76  1.1  macallan #define GFFB_PEL_IR	0x3c7
     77  1.1  macallan #define GFFB_PEL_IW	0x3c8
     78  1.1  macallan #define GFFB_PEL_D	0x3c9
     79  1.1  macallan 
     80  1.2  macallan /* engine command definitions from xf86_video_nv/nv_dma.h */
     81  1.2  macallan 
     82  1.2  macallan /*
     83  1.2  macallan  * Copyright (c) 2003 NVIDIA, Corporation
     84  1.2  macallan  *
     85  1.2  macallan  * Permission is hereby granted, free of charge, to any person obtaining a
     86  1.2  macallan  * copy of this software and associated documentation files (the
     87  1.2  macallan  * "Software"), to deal in the Software without restriction, including
     88  1.2  macallan  * without limitation the rights to use, copy, modify, merge, publish,
     89  1.2  macallan  * distribute, sublicense, and/or sell copies of the Software, and to
     90  1.2  macallan  * permit persons to whom the Software is furnished to do so, subject to
     91  1.2  macallan  * the following conditions:
     92  1.2  macallan  *
     93  1.2  macallan  * The above copyright notice and this permission notice shall be included
     94  1.2  macallan  * in all copies or substantial portions of the Software.
     95  1.2  macallan  *
     96  1.2  macallan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     97  1.2  macallan  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     98  1.2  macallan  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     99  1.2  macallan  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    100  1.2  macallan  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    101  1.2  macallan  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    102  1.2  macallan  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    103  1.2  macallan  */
    104  1.2  macallan 
    105  1.2  macallan #define SURFACE_FORMAT                                              0x00000300
    106  1.2  macallan #define SURFACE_FORMAT_DEPTH8                                       0x00000001
    107  1.2  macallan #define SURFACE_FORMAT_DEPTH15                                      0x00000002
    108  1.2  macallan #define SURFACE_FORMAT_DEPTH16                                      0x00000004
    109  1.2  macallan #define SURFACE_FORMAT_DEPTH24                                      0x00000006
    110  1.2  macallan #define SURFACE_PITCH                                               0x00000304
    111  1.2  macallan #define SURFACE_PITCH_SRC                                           15:0
    112  1.2  macallan #define SURFACE_PITCH_DST                                           31:16
    113  1.2  macallan #define SURFACE_OFFSET_SRC                                          0x00000308
    114  1.2  macallan #define SURFACE_OFFSET_DST                                          0x0000030C
    115  1.2  macallan 
    116  1.2  macallan #define ROP_SET                                                     0x00002300
    117  1.2  macallan 
    118  1.2  macallan #define PATTERN_FORMAT                                              0x00004300
    119  1.2  macallan #define PATTERN_FORMAT_DEPTH8                                       0x00000003
    120  1.2  macallan #define PATTERN_FORMAT_DEPTH16                                      0x00000001
    121  1.2  macallan #define PATTERN_FORMAT_DEPTH24                                      0x00000003
    122  1.2  macallan #define PATTERN_COLOR_0                                             0x00004310
    123  1.2  macallan #define PATTERN_COLOR_1                                             0x00004314
    124  1.2  macallan #define PATTERN_PATTERN_0                                           0x00004318
    125  1.2  macallan #define PATTERN_PATTERN_1                                           0x0000431C
    126  1.2  macallan 
    127  1.2  macallan #define CLIP_POINT                                                  0x00006300
    128  1.2  macallan #define CLIP_POINT_X                                                15:0
    129  1.2  macallan #define CLIP_POINT_Y                                                31:16
    130  1.2  macallan #define CLIP_SIZE                                                   0x00006304
    131  1.2  macallan #define CLIP_SIZE_WIDTH                                             15:0
    132  1.2  macallan #define CLIP_SIZE_HEIGHT                                            31:16
    133  1.2  macallan 
    134  1.2  macallan #define LINE_FORMAT                                                 0x00008300
    135  1.2  macallan #define LINE_FORMAT_DEPTH8                                          0x00000003
    136  1.2  macallan #define LINE_FORMAT_DEPTH16                                         0x00000001
    137  1.2  macallan #define LINE_FORMAT_DEPTH24                                         0x00000003
    138  1.2  macallan #define LINE_COLOR                                                  0x00008304
    139  1.2  macallan #define LINE_MAX_LINES                                              16
    140  1.2  macallan #define LINE_LINES(i)                                               0x00008400\
    141  1.2  macallan                                                                     +(i)*8
    142  1.2  macallan #define LINE_LINES_POINT0_X                                         15:0
    143  1.2  macallan #define LINE_LINES_POINT0_Y                                         31:16
    144  1.2  macallan #define LINE_LINES_POINT1_X                                         47:32
    145  1.2  macallan #define LINE_LINES_POINT1_Y                                         63:48
    146  1.2  macallan 
    147  1.2  macallan #define BLIT_POINT_SRC                                              0x0000A300
    148  1.2  macallan #define BLIT_POINT_SRC_X                                            15:0
    149  1.2  macallan #define BLIT_POINT_SRC_Y                                            31:16
    150  1.2  macallan #define BLIT_POINT_DST                                              0x0000A304
    151  1.2  macallan #define BLIT_POINT_DST_X                                            15:0
    152  1.2  macallan #define BLIT_POINT_DST_Y                                            31:16
    153  1.2  macallan #define BLIT_SIZE                                                   0x0000A308
    154  1.2  macallan #define BLIT_SIZE_WIDTH                                             15:0
    155  1.2  macallan #define BLIT_SIZE_HEIGHT                                            31:16
    156  1.2  macallan 
    157  1.2  macallan #define RECT_FORMAT                                                 0x0000C300
    158  1.2  macallan #define RECT_FORMAT_DEPTH8                                          0x00000003
    159  1.2  macallan #define RECT_FORMAT_DEPTH16                                         0x00000001
    160  1.2  macallan #define RECT_FORMAT_DEPTH24                                         0x00000003
    161  1.2  macallan #define RECT_SOLID_COLOR                                            0x0000C3FC
    162  1.2  macallan #define RECT_SOLID_RECTS_MAX_RECTS                                  32
    163  1.2  macallan #define RECT_SOLID_RECTS(i)                                         0x0000C400\
    164  1.2  macallan                                                                     +(i)*8
    165  1.2  macallan #define RECT_SOLID_RECTS_Y                                          15:0
    166  1.2  macallan #define RECT_SOLID_RECTS_X                                          31:16
    167  1.2  macallan #define RECT_SOLID_RECTS_HEIGHT                                     47:32
    168  1.2  macallan #define RECT_SOLID_RECTS_WIDTH                                      63:48
    169  1.2  macallan 
    170  1.2  macallan #define RECT_EXPAND_ONE_COLOR_CLIP                                  0x0000C7EC
    171  1.2  macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT0_X                         15:0
    172  1.2  macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT0_Y                         31:16
    173  1.2  macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT1_X                         47:32
    174  1.2  macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT1_Y                         63:48
    175  1.2  macallan #define RECT_EXPAND_ONE_COLOR_COLOR                                 0x0000C7F4
    176  1.2  macallan #define RECT_EXPAND_ONE_COLOR_SIZE                                  0x0000C7F8
    177  1.2  macallan #define RECT_EXPAND_ONE_COLOR_SIZE_WIDTH                            15:0
    178  1.2  macallan #define RECT_EXPAND_ONE_COLOR_SIZE_HEIGHT                           31:16
    179  1.2  macallan #define RECT_EXPAND_ONE_COLOR_POINT                                 0x0000C7FC
    180  1.2  macallan #define RECT_EXPAND_ONE_COLOR_POINT_X                               15:0
    181  1.2  macallan #define RECT_EXPAND_ONE_COLOR_POINT_Y                               31:16
    182  1.2  macallan #define RECT_EXPAND_ONE_COLOR_DATA_MAX_DWORDS                       128
    183  1.2  macallan #define RECT_EXPAND_ONE_COLOR_DATA(i)                               0x0000C800\
    184  1.2  macallan                                                                     +(i)*4
    185  1.2  macallan 
    186  1.2  macallan #define RECT_EXPAND_TWO_COLOR_CLIP                                  0x0000CBE4
    187  1.2  macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT0_X                         15:0
    188  1.2  macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT0_Y                         31:16
    189  1.2  macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT1_X                         47:32
    190  1.2  macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT1_Y                         63:48
    191  1.2  macallan #define RECT_EXPAND_TWO_COLOR_COLOR_0                               0x0000CBEC
    192  1.2  macallan #define RECT_EXPAND_TWO_COLOR_COLOR_1                               0x0000CBF0
    193  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN                               0x0000CBF4
    194  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN_WIDTH                         15:0
    195  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN_HEIGHT                        31:16
    196  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT                              0x0000CBF8
    197  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT_WIDTH                        15:0
    198  1.2  macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT_HEIGHT                       31:16
    199  1.2  macallan #define RECT_EXPAND_TWO_COLOR_POINT                                 0x0000CBFC
    200  1.2  macallan #define RECT_EXPAND_TWO_COLOR_POINT_X                               15:0
    201  1.2  macallan #define RECT_EXPAND_TWO_COLOR_POINT_Y                               31:16
    202  1.2  macallan #define RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS                       128
    203  1.2  macallan #define RECT_EXPAND_TWO_COLOR_DATA(i)                               0x0000CC00\
    204  1.2  macallan                                                                     +(i)*4
    205  1.2  macallan 
    206  1.2  macallan #define STRETCH_BLIT_FORMAT                                         0x0000E300
    207  1.2  macallan #define STRETCH_BLIT_FORMAT_DEPTH8                                  0x00000004
    208  1.2  macallan #define STRETCH_BLIT_FORMAT_DEPTH16                                 0x00000007
    209  1.2  macallan #define STRETCH_BLIT_FORMAT_DEPTH24                                 0x00000004
    210  1.2  macallan #define STRETCH_BLIT_FORMAT_A8R8G8B8                                0x00000003
    211  1.2  macallan #define STRETCH_BLIT_FORMAT_X8R8G8B8                                0x00000004
    212  1.2  macallan #define STRETCH_BLIT_FORMAT_YUYV                                    0x00000005
    213  1.2  macallan #define STRETCH_BLIT_FORMAT_UYVY                                    0x00000006
    214  1.2  macallan /* STRETCH_BLIT_OPERATION is only supported on TNT2 and newer */
    215  1.2  macallan #define STRETCH_BLIT_OPERATION                                      0x0000E304
    216  1.2  macallan #define STRETCH_BLIT_OPERATION_ROP                                  0x00000001
    217  1.2  macallan #define STRETCH_BLIT_OPERATION_COPY                                 0x00000003
    218  1.2  macallan #define STRETCH_BLIT_OPERATION_BLEND                                0x00000002
    219  1.2  macallan #define STRETCH_BLIT_CLIP_POINT                                     0x0000E308
    220  1.2  macallan #define STRETCH_BLIT_CLIP_POINT_X                                   15:0
    221  1.2  macallan #define STRETCH_BLIT_CLIP_POINT_Y                                   31:16
    222  1.2  macallan #define STRETCH_BLIT_CLIP_POINT                                     0x0000E308
    223  1.2  macallan #define STRETCH_BLIT_CLIP_SIZE                                      0x0000E30C
    224  1.2  macallan #define STRETCH_BLIT_CLIP_SIZE_WIDTH                                15:0
    225  1.2  macallan #define STRETCH_BLIT_CLIP_SIZE_HEIGHT                               31:16
    226  1.2  macallan #define STRETCH_BLIT_DST_POINT                                      0x0000E310
    227  1.2  macallan #define STRETCH_BLIT_DST_POINT_X                                    15:0
    228  1.2  macallan #define STRETCH_BLIT_DST_POINT_Y                                    31:16
    229  1.2  macallan #define STRETCH_BLIT_DST_SIZE                                       0x0000E314
    230  1.2  macallan #define STRETCH_BLIT_DST_SIZE_WIDTH                                 15:0
    231  1.2  macallan #define STRETCH_BLIT_DST_SIZE_HEIGHT                                31:16
    232  1.2  macallan #define STRETCH_BLIT_DU_DX                                          0x0000E318
    233  1.2  macallan #define STRETCH_BLIT_DV_DY                                          0x0000E31C
    234  1.2  macallan #define STRETCH_BLIT_SRC_SIZE                                       0x0000E400
    235  1.2  macallan #define STRETCH_BLIT_SRC_SIZE_WIDTH                                 15:0
    236  1.2  macallan #define STRETCH_BLIT_SRC_SIZE_HEIGHT                                31:16
    237  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT                                     0x0000E404
    238  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_PITCH                               15:0
    239  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN                              23:16
    240  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN_CENTER                       0x00000001
    241  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN_CORNER                       0x00000002
    242  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER                              31:24
    243  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER_POINT_SAMPLE                 0x00000000
    244  1.2  macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER_BILINEAR                     0x00000001
    245  1.2  macallan #define STRETCH_BLIT_SRC_OFFSET                                     0x0000E408
    246  1.2  macallan #define STRETCH_BLIT_SRC_POINT                                      0x0000E40C
    247  1.2  macallan #define STRETCH_BLIT_SRC_POINT_U                                    15:0
    248  1.2  macallan #define STRETCH_BLIT_SRC_POINT_V                                    31:16
    249  1.2  macallan 
    250  1.2  macallan 
    251  1.3  macallan #endif /* GFFBREG_H */
    252