Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Maarten Maathuis. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining |
| 6 | * a copy of this software and associated documentation files (the |
| 7 | * "Software"), to deal in the Software without restriction, including |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, |
| 9 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 10 | * permit persons to whom the Software is furnished to do so, subject to |
| 11 | * the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice (including the |
| 14 | * next paragraph) shall be included in all copies or substantial |
| 15 | * portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 20 | * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE |
| 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #define NV50_EVO_UPDATE 0x00000080 |
| 28 | #define NV50_EVO_UNK84 0x00000084 |
| 29 | #define NV50_EVO_UNK84_NOTIFY 0x40000000 |
| 30 | #define NV50_EVO_UNK84_NOTIFY_DISABLED 0x00000000 |
| 31 | #define NV50_EVO_UNK84_NOTIFY_ENABLED 0x40000000 |
| 32 | #define NV50_EVO_DMA_NOTIFY 0x00000088 |
| 33 | #define NV50_EVO_DMA_NOTIFY_HANDLE 0xffffffff |
| 34 | #define NV50_EVO_DMA_NOTIFY_HANDLE_NONE 0x00000000 |
| 35 | #define NV50_EVO_UNK8C 0x0000008C |
| 36 | |
| 37 | #define NV50_EVO_DAC(n, r) ((n) * 0x80 + NV50_EVO_DAC_##r) |
| 38 | #define NV50_EVO_DAC_MODE_CTRL 0x00000400 |
| 39 | #define NV50_EVO_DAC_MODE_CTRL_CRTC0 0x00000001 |
| 40 | #define NV50_EVO_DAC_MODE_CTRL_CRTC1 0x00000002 |
| 41 | #define NV50_EVO_DAC_MODE_CTRL2 0x00000404 |
| 42 | #define NV50_EVO_DAC_MODE_CTRL2_NHSYNC 0x00000001 |
| 43 | #define NV50_EVO_DAC_MODE_CTRL2_NVSYNC 0x00000002 |
| 44 | |
| 45 | #define NV50_EVO_SOR(n, r) ((n) * 0x40 + NV50_EVO_SOR_##r) |
| 46 | #define NV50_EVO_SOR_MODE_CTRL 0x00000600 |
| 47 | #define NV50_EVO_SOR_MODE_CTRL_CRTC0 0x00000001 |
| 48 | #define NV50_EVO_SOR_MODE_CTRL_CRTC1 0x00000002 |
| 49 | #define NV50_EVO_SOR_MODE_CTRL_TMDS 0x00000100 |
| 50 | #define NV50_EVO_SOR_MODE_CTRL_TMDS_DUAL_LINK 0x00000400 |
| 51 | #define NV50_EVO_SOR_MODE_CTRL_NHSYNC 0x00001000 |
| 52 | #define NV50_EVO_SOR_MODE_CTRL_NVSYNC 0x00002000 |
| 53 | |
| 54 | #define NV50_EVO_CRTC(n, r) ((n) * 0x400 + NV50_EVO_CRTC_##r) |
| 55 | #define NV84_EVO_CRTC(n, r) ((n) * 0x400 + NV84_EVO_CRTC_##r) |
| 56 | #define NV50_EVO_CRTC_UNK0800 0x00000800 |
| 57 | #define NV50_EVO_CRTC_CLOCK 0x00000804 |
| 58 | #define NV50_EVO_CRTC_INTERLACE 0x00000808 |
| 59 | #define NV50_EVO_CRTC_DISPLAY_START 0x00000810 |
| 60 | #define NV50_EVO_CRTC_DISPLAY_TOTAL 0x00000814 |
| 61 | #define NV50_EVO_CRTC_SYNC_DURATION 0x00000818 |
| 62 | #define NV50_EVO_CRTC_SYNC_START_TO_BLANK_END 0x0000081c |
| 63 | #define NV50_EVO_CRTC_UNK0820 0x00000820 |
| 64 | #define NV50_EVO_CRTC_UNK0824 0x00000824 |
| 65 | #define NV50_EVO_CRTC_UNK082C 0x0000082c |
| 66 | #define NV50_EVO_CRTC_CLUT_MODE 0x00000840 |
| 67 | /* You can't have a palette in 8 bit mode (=OFF) */ |
| 68 | #define NV50_EVO_CRTC_CLUT_MODE_BLANK 0x00000000 |
| 69 | #define NV50_EVO_CRTC_CLUT_MODE_OFF 0x80000000 |
| 70 | #define NV50_EVO_CRTC_CLUT_MODE_ON 0xC0000000 |
| 71 | #define NV50_EVO_CRTC_CLUT_OFFSET 0x00000844 |
| 72 | #define NV84_EVO_CRTC_CLUT_DMA 0x0000085C |
| 73 | #define NV84_EVO_CRTC_CLUT_DMA_HANDLE 0xffffffff |
| 74 | #define NV84_EVO_CRTC_CLUT_DMA_HANDLE_NONE 0x00000000 |
| 75 | #define NV50_EVO_CRTC_FB_OFFSET 0x00000860 |
| 76 | #define NV50_EVO_CRTC_FB_SIZE 0x00000868 |
| 77 | #define NV50_EVO_CRTC_FB_CONFIG 0x0000086c |
| 78 | #define NV50_EVO_CRTC_FB_CONFIG_MODE 0x00100000 |
| 79 | #define NV50_EVO_CRTC_FB_CONFIG_MODE_TILE 0x00000000 |
| 80 | #define NV50_EVO_CRTC_FB_CONFIG_MODE_PITCH 0x00100000 |
| 81 | #define NV50_EVO_CRTC_FB_DEPTH 0x00000870 |
| 82 | #define NV50_EVO_CRTC_FB_DEPTH_8 0x00001e00 |
| 83 | #define NV50_EVO_CRTC_FB_DEPTH_15 0x0000e900 |
| 84 | #define NV50_EVO_CRTC_FB_DEPTH_16 0x0000e800 |
| 85 | #define NV50_EVO_CRTC_FB_DEPTH_24 0x0000cf00 |
| 86 | #define NV50_EVO_CRTC_FB_DEPTH_30 0x0000d100 |
| 87 | #define NV50_EVO_CRTC_FB_DMA 0x00000874 |
| 88 | #define NV50_EVO_CRTC_FB_DMA_HANDLE 0xffffffff |
| 89 | #define NV50_EVO_CRTC_FB_DMA_HANDLE_NONE 0x00000000 |
| 90 | #define NV50_EVO_CRTC_CURSOR_CTRL 0x00000880 |
| 91 | #define NV50_EVO_CRTC_CURSOR_CTRL_HIDE 0x05000000 |
| 92 | #define NV50_EVO_CRTC_CURSOR_CTRL_SHOW 0x85000000 |
| 93 | #define NV50_EVO_CRTC_CURSOR_OFFSET 0x00000884 |
| 94 | #define NV84_EVO_CRTC_CURSOR_DMA 0x0000089c |
| 95 | #define NV84_EVO_CRTC_CURSOR_DMA_HANDLE 0xffffffff |
| 96 | #define NV84_EVO_CRTC_CURSOR_DMA_HANDLE_NONE 0x00000000 |
| 97 | #define NV50_EVO_CRTC_DITHER_CTRL 0x000008a0 |
| 98 | #define NV50_EVO_CRTC_DITHER_CTRL_OFF 0x00000000 |
| 99 | #define NV50_EVO_CRTC_DITHER_CTRL_ON 0x00000011 |
| 100 | #define NV50_EVO_CRTC_SCALE_CTRL 0x000008a4 |
| 101 | #define NV50_EVO_CRTC_SCALE_CTRL_INACTIVE 0x00000000 |
| 102 | #define NV50_EVO_CRTC_SCALE_CTRL_ACTIVE 0x00000009 |
| 103 | #define NV50_EVO_CRTC_COLOR_CTRL 0x000008a8 |
| 104 | #define NV50_EVO_CRTC_COLOR_CTRL_COLOR 0x00040000 |
| 105 | #define NV50_EVO_CRTC_FB_POS 0x000008c0 |
| 106 | #define NV50_EVO_CRTC_REAL_RES 0x000008c8 |
| 107 | #define NV50_EVO_CRTC_SCALE_CENTER_OFFSET 0x000008d4 |
| 108 | #define NV50_EVO_CRTC_SCALE_CENTER_OFFSET_VAL(x, y) \ |
| 109 | ((((unsigned)y << 16) & 0xFFFF0000) | (((unsigned)x) & 0x0000FFFF)) |
| 110 | /* Both of these are needed, otherwise nothing happens. */ |
| 111 | #define NV50_EVO_CRTC_SCALE_RES1 0x000008d8 |
| 112 | #define NV50_EVO_CRTC_SCALE_RES2 0x000008dc |
| 113 | |