Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2009 Ben Skeggs |
| 3 | * Copyright 2008 Stuart Bennett |
| 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | * copy of this software and associated documentation files (the "Software"), |
| 7 | * to deal in the Software without restriction, including without limitation |
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | * and/or sell copies of the Software, and to permit persons to whom the |
| 10 | * Software is furnished to do so, subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice (including the next |
| 13 | * paragraph) shall be included in all copies or substantial portions of the |
| 14 | * Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 25 | #include "nouveau_drm.h" |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 26 | #include "nouveau_dma.h" |
| 27 | #include "nouveau_fbcon.h" |
| 28 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 29 | int |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 30 | nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region) |
| 31 | { |
Dave Airlie | 8be48d9 | 2010-03-30 05:34:14 +0000 | [diff] [blame] | 32 | struct nouveau_fbdev *nfbdev = info->par; |
Ben Skeggs | 77145f1 | 2012-07-31 16:16:21 +1000 | [diff] [blame] | 33 | struct nouveau_drm *drm = nouveau_drm(nfbdev->dev); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 34 | struct nouveau_channel *chan = drm->channel; |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 35 | int ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 36 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 37 | ret = RING_SPACE(chan, 4); |
| 38 | if (ret) |
| 39 | return ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 40 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 41 | BEGIN_NV04(chan, NvSubImageBlit, 0x0300, 3); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 42 | OUT_RING(chan, (region->sy << 16) | region->sx); |
| 43 | OUT_RING(chan, (region->dy << 16) | region->dx); |
| 44 | OUT_RING(chan, (region->height << 16) | region->width); |
| 45 | FIRE_RING(chan); |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 46 | return 0; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 47 | } |
| 48 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 49 | int |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 50 | nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect) |
| 51 | { |
Dave Airlie | 8be48d9 | 2010-03-30 05:34:14 +0000 | [diff] [blame] | 52 | struct nouveau_fbdev *nfbdev = info->par; |
Ben Skeggs | 77145f1 | 2012-07-31 16:16:21 +1000 | [diff] [blame] | 53 | struct nouveau_drm *drm = nouveau_drm(nfbdev->dev); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 54 | struct nouveau_channel *chan = drm->channel; |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 55 | int ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 56 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 57 | ret = RING_SPACE(chan, 7); |
| 58 | if (ret) |
| 59 | return ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 60 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 61 | BEGIN_NV04(chan, NvSubGdiRect, 0x02fc, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 62 | OUT_RING(chan, (rect->rop != ROP_COPY) ? 1 : 3); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 63 | BEGIN_NV04(chan, NvSubGdiRect, 0x03fc, 1); |
Ben Skeggs | bf5302b | 2010-01-04 09:10:55 +1000 | [diff] [blame] | 64 | if (info->fix.visual == FB_VISUAL_TRUECOLOR || |
| 65 | info->fix.visual == FB_VISUAL_DIRECTCOLOR) |
| 66 | OUT_RING(chan, ((uint32_t *)info->pseudo_palette)[rect->color]); |
| 67 | else |
| 68 | OUT_RING(chan, rect->color); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 69 | BEGIN_NV04(chan, NvSubGdiRect, 0x0400, 2); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 70 | OUT_RING(chan, (rect->dx << 16) | rect->dy); |
| 71 | OUT_RING(chan, (rect->width << 16) | rect->height); |
| 72 | FIRE_RING(chan); |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 73 | return 0; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 74 | } |
| 75 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 76 | int |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 77 | nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) |
| 78 | { |
Dave Airlie | 8be48d9 | 2010-03-30 05:34:14 +0000 | [diff] [blame] | 79 | struct nouveau_fbdev *nfbdev = info->par; |
Ben Skeggs | 77145f1 | 2012-07-31 16:16:21 +1000 | [diff] [blame] | 80 | struct nouveau_drm *drm = nouveau_drm(nfbdev->dev); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 81 | struct nouveau_channel *chan = drm->channel; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 82 | uint32_t fg; |
| 83 | uint32_t bg; |
| 84 | uint32_t dsize; |
| 85 | uint32_t width; |
| 86 | uint32_t *data = (uint32_t *)image->data; |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 87 | int ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 88 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 89 | if (image->depth != 1) |
| 90 | return -ENODEV; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 91 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 92 | ret = RING_SPACE(chan, 8); |
| 93 | if (ret) |
| 94 | return ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 95 | |
Marcin KoĆcielnicki | c82b88d | 2010-02-27 18:13:35 +0000 | [diff] [blame] | 96 | width = ALIGN(image->width, 8); |
| 97 | dsize = ALIGN(width * image->height, 32) >> 5; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 98 | |
| 99 | if (info->fix.visual == FB_VISUAL_TRUECOLOR || |
| 100 | info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
| 101 | fg = ((uint32_t *) info->pseudo_palette)[image->fg_color]; |
| 102 | bg = ((uint32_t *) info->pseudo_palette)[image->bg_color]; |
| 103 | } else { |
| 104 | fg = image->fg_color; |
| 105 | bg = image->bg_color; |
| 106 | } |
| 107 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 108 | BEGIN_NV04(chan, NvSubGdiRect, 0x0be4, 7); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 109 | OUT_RING(chan, (image->dy << 16) | (image->dx & 0xffff)); |
| 110 | OUT_RING(chan, ((image->dy + image->height) << 16) | |
| 111 | ((image->dx + image->width) & 0xffff)); |
| 112 | OUT_RING(chan, bg); |
| 113 | OUT_RING(chan, fg); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 114 | OUT_RING(chan, (image->height << 16) | width); |
Marcin KoĆcielnicki | c82b88d | 2010-02-27 18:13:35 +0000 | [diff] [blame] | 115 | OUT_RING(chan, (image->height << 16) | image->width); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 116 | OUT_RING(chan, (image->dy << 16) | (image->dx & 0xffff)); |
| 117 | |
| 118 | while (dsize) { |
| 119 | int iter_len = dsize > 128 ? 128 : dsize; |
| 120 | |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 121 | ret = RING_SPACE(chan, iter_len + 1); |
| 122 | if (ret) |
| 123 | return ret; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 124 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 125 | BEGIN_NV04(chan, NvSubGdiRect, 0x0c00, iter_len); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 126 | OUT_RINGp(chan, data, iter_len); |
| 127 | data += iter_len; |
| 128 | dsize -= iter_len; |
| 129 | } |
| 130 | |
| 131 | FIRE_RING(chan); |
Ben Skeggs | ceed5f3 | 2010-10-05 16:41:29 +1000 | [diff] [blame] | 132 | return 0; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 133 | } |
| 134 | |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 135 | int |
| 136 | nv04_fbcon_accel_init(struct fb_info *info) |
| 137 | { |
Dave Airlie | 8be48d9 | 2010-03-30 05:34:14 +0000 | [diff] [blame] | 138 | struct nouveau_fbdev *nfbdev = info->par; |
| 139 | struct drm_device *dev = nfbdev->dev; |
Ben Skeggs | 77145f1 | 2012-07-31 16:16:21 +1000 | [diff] [blame] | 140 | struct nouveau_drm *drm = nouveau_drm(dev); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 141 | struct nouveau_channel *chan = drm->channel; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 142 | struct nvif_device *device = &drm->device; |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 143 | int surface_fmt, pattern_fmt, rect_fmt; |
| 144 | int ret; |
| 145 | |
| 146 | switch (info->var.bits_per_pixel) { |
| 147 | case 8: |
| 148 | surface_fmt = 1; |
| 149 | pattern_fmt = 3; |
| 150 | rect_fmt = 3; |
| 151 | break; |
| 152 | case 16: |
| 153 | surface_fmt = 4; |
| 154 | pattern_fmt = 1; |
| 155 | rect_fmt = 1; |
| 156 | break; |
| 157 | case 32: |
| 158 | switch (info->var.transp.length) { |
| 159 | case 0: /* depth 24 */ |
| 160 | case 8: /* depth 32 */ |
| 161 | break; |
| 162 | default: |
| 163 | return -EINVAL; |
| 164 | } |
| 165 | |
| 166 | surface_fmt = 6; |
| 167 | pattern_fmt = 3; |
| 168 | rect_fmt = 3; |
| 169 | break; |
| 170 | default: |
| 171 | return -EINVAL; |
| 172 | } |
| 173 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 174 | ret = nvif_object_init(&chan->user, 0x0062, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 175 | device->info.family >= NV_DEVICE_INFO_V0_CELSIUS ? |
| 176 | 0x0062 : 0x0042, NULL, 0, &nfbdev->surf2d); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 177 | if (ret) |
| 178 | return ret; |
| 179 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 180 | ret = nvif_object_init(&chan->user, 0x0019, 0x0019, NULL, 0, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 181 | &nfbdev->clip); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 182 | if (ret) |
| 183 | return ret; |
| 184 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 185 | ret = nvif_object_init(&chan->user, 0x0043, 0x0043, NULL, 0, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 186 | &nfbdev->rop); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 187 | if (ret) |
| 188 | return ret; |
| 189 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 190 | ret = nvif_object_init(&chan->user, 0x0044, 0x0044, NULL, 0, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 191 | &nfbdev->patt); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 192 | if (ret) |
| 193 | return ret; |
| 194 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 195 | ret = nvif_object_init(&chan->user, 0x004a, 0x004a, NULL, 0, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 196 | &nfbdev->gdi); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 197 | if (ret) |
| 198 | return ret; |
| 199 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 200 | ret = nvif_object_init(&chan->user, 0x005f, |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 201 | device->info.chipset >= 0x11 ? 0x009f : 0x005f, |
| 202 | NULL, 0, &nfbdev->blit); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 203 | if (ret) |
| 204 | return ret; |
| 205 | |
Ilia Mirkin | d108142 | 2015-06-29 04:07:20 -0400 | [diff] [blame] | 206 | if (RING_SPACE(chan, 49 + (device->info.chipset >= 0x11 ? 4 : 0))) { |
Marcin Slusarz | 846975a | 2010-01-04 19:25:09 +0100 | [diff] [blame] | 207 | nouveau_fbcon_gpu_lockup(info); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 208 | return 0; |
| 209 | } |
| 210 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 211 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 212 | OUT_RING(chan, nfbdev->surf2d.handle); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 213 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0184, 2); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 214 | OUT_RING(chan, chan->vram.handle); |
| 215 | OUT_RING(chan, chan->vram.handle); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 216 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0300, 4); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 217 | OUT_RING(chan, surface_fmt); |
| 218 | OUT_RING(chan, info->fix.line_length | (info->fix.line_length << 16)); |
| 219 | OUT_RING(chan, info->fix.smem_start - dev->mode_config.fb_base); |
| 220 | OUT_RING(chan, info->fix.smem_start - dev->mode_config.fb_base); |
| 221 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 222 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 223 | OUT_RING(chan, nfbdev->rop.handle); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 224 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0300, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 225 | OUT_RING(chan, 0x55); |
| 226 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 227 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 228 | OUT_RING(chan, nfbdev->patt.handle); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 229 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0300, 8); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 230 | OUT_RING(chan, pattern_fmt); |
| 231 | #ifdef __BIG_ENDIAN |
| 232 | OUT_RING(chan, 2); |
| 233 | #else |
| 234 | OUT_RING(chan, 1); |
| 235 | #endif |
| 236 | OUT_RING(chan, 0); |
| 237 | OUT_RING(chan, 1); |
| 238 | OUT_RING(chan, ~0); |
| 239 | OUT_RING(chan, ~0); |
| 240 | OUT_RING(chan, ~0); |
| 241 | OUT_RING(chan, ~0); |
| 242 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 243 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 244 | OUT_RING(chan, nfbdev->clip.handle); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 245 | BEGIN_NV04(chan, NvSubCtxSurf2D, 0x0300, 2); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 246 | OUT_RING(chan, 0); |
| 247 | OUT_RING(chan, (info->var.yres_virtual << 16) | info->var.xres_virtual); |
| 248 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 249 | BEGIN_NV04(chan, NvSubImageBlit, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 250 | OUT_RING(chan, nfbdev->blit.handle); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 251 | BEGIN_NV04(chan, NvSubImageBlit, 0x019c, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 252 | OUT_RING(chan, nfbdev->surf2d.handle); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 253 | BEGIN_NV04(chan, NvSubImageBlit, 0x02fc, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 254 | OUT_RING(chan, 3); |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 255 | if (device->info.chipset >= 0x11 /*XXX: oclass == 0x009f*/) { |
Ben Skeggs | b9d9dcd | 2013-11-11 13:59:40 +1000 | [diff] [blame] | 256 | BEGIN_NV04(chan, NvSubImageBlit, 0x0120, 3); |
| 257 | OUT_RING(chan, 0); |
| 258 | OUT_RING(chan, 1); |
| 259 | OUT_RING(chan, 2); |
| 260 | } |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 261 | |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 262 | BEGIN_NV04(chan, NvSubGdiRect, 0x0000, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 263 | OUT_RING(chan, nfbdev->gdi.handle); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 264 | BEGIN_NV04(chan, NvSubGdiRect, 0x0198, 1); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 265 | OUT_RING(chan, nfbdev->surf2d.handle); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 266 | BEGIN_NV04(chan, NvSubGdiRect, 0x0188, 2); |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 267 | OUT_RING(chan, nfbdev->patt.handle); |
| 268 | OUT_RING(chan, nfbdev->rop.handle); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 269 | BEGIN_NV04(chan, NvSubGdiRect, 0x0304, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 270 | OUT_RING(chan, 1); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 271 | BEGIN_NV04(chan, NvSubGdiRect, 0x0300, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 272 | OUT_RING(chan, rect_fmt); |
Ben Skeggs | 6d59702 | 2012-04-01 21:09:13 +1000 | [diff] [blame] | 273 | BEGIN_NV04(chan, NvSubGdiRect, 0x02fc, 1); |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 274 | OUT_RING(chan, 3); |
| 275 | |
| 276 | FIRE_RING(chan); |
| 277 | |
Ben Skeggs | 6ee7386 | 2009-12-11 19:24:15 +1000 | [diff] [blame] | 278 | return 0; |
| 279 | } |
| 280 | |