diff options
author | prspkt <prspkt@protonmail.com> | 2019-02-16 14:16:30 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-02-26 20:53:54 +0000 |
commit | 46c82059c1776343a5c670bf57640401e103f191 (patch) | |
tree | 7bd9e963f2aaf45c6722db8723abd201156c2f5c | |
parent | 59899738cfb67b1d6f3758b6fcace7c45a0e051c (diff) | |
download | alpine_aports-46c82059c1776343a5c670bf57640401e103f191.tar.bz2 alpine_aports-46c82059c1776343a5c670bf57640401e103f191.tar.xz alpine_aports-46c82059c1776343a5c670bf57640401e103f191.zip |
main/xf86-video-nouveau: upgrade to 1.0.16
-rw-r--r-- | main/xf86-video-nouveau/APKBUILD | 6 | ||||
-rw-r--r-- | main/xf86-video-nouveau/git.patch | 2137 |
2 files changed, 3 insertions, 2140 deletions
diff --git a/main/xf86-video-nouveau/APKBUILD b/main/xf86-video-nouveau/APKBUILD index 1c57cd2c9e..daea3f3640 100644 --- a/main/xf86-video-nouveau/APKBUILD +++ b/main/xf86-video-nouveau/APKBUILD | |||
@@ -1,8 +1,8 @@ | |||
1 | # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> | 1 | # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> |
2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
3 | pkgname=xf86-video-nouveau | 3 | pkgname=xf86-video-nouveau |
4 | pkgver=1.0.15 | 4 | pkgver=1.0.16 |
5 | pkgrel=3 | 5 | pkgrel=0 |
6 | pkgdesc="Open-source X.org drivers for nVidia video cards" | 6 | pkgdesc="Open-source X.org drivers for nVidia video cards" |
7 | url="https://nouveau.freedesktop.org/" | 7 | url="https://nouveau.freedesktop.org/" |
8 | arch="all" | 8 | arch="all" |
@@ -38,4 +38,4 @@ package() { | |||
38 | make DESTDIR="$pkgdir" install | 38 | make DESTDIR="$pkgdir" install |
39 | } | 39 | } |
40 | 40 | ||
41 | sha512sums="69a8f8e7920d893f17d14fd9f05e35de246d980a243f3b3b00c05deae7f6bd97e0f51e6ddfa322b4d0815233fe5f656d4e55f54461249f3f24c3bc025a682285 xf86-video-nouveau-1.0.15.tar.bz2" | 41 | sha512sums="41b7839c37372660968ab7da2bc3d9feef3cab4e994d05d4ba6e59071f0d1b1f8d7dcdbcb15a42a375a556d28dc067f9ffe45d73c1d121ad307d199107ade3e0 xf86-video-nouveau-1.0.16.tar.bz2" |
diff --git a/main/xf86-video-nouveau/git.patch b/main/xf86-video-nouveau/git.patch deleted file mode 100644 index e234ee8a00..0000000000 --- a/main/xf86-video-nouveau/git.patch +++ /dev/null | |||
@@ -1,2137 +0,0 @@ | |||
1 | diff --git a/configure.ac b/configure.ac | ||
2 | index ccf320a..9c77f94 100644 | ||
3 | --- a/configure.ac | ||
4 | +++ b/configure.ac | ||
5 | @@ -80,7 +80,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) | ||
6 | XORG_DRIVER_CHECK_EXT(DRI2, [dri2proto >= 2.6]) | ||
7 | |||
8 | # Checks for pkg-config packages | ||
9 | -PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.17]) | ||
10 | +PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.60]) | ||
11 | PKG_CHECK_MODULES(LIBDRM_NOUVEAU, [libdrm_nouveau >= 2.4.25]) | ||
12 | AC_SUBST(LIBDRM_NOUVEAU_CFLAGS) | ||
13 | AC_SUBST(LIBDRM_NOUVEAU_LIBS) | ||
14 | @@ -140,17 +140,6 @@ if test "x$have_list_h" = xyes; then | ||
15 | #include "list.h"]) | ||
16 | fi | ||
17 | |||
18 | -AC_CHECK_HEADERS([glamor.h],[found_glamor_header=yes],[found_glamor_header=no], | ||
19 | - [#include "xorg-server.h"]) | ||
20 | -AC_MSG_CHECKING([whether to include GLAMOR support]) | ||
21 | -if test "x$found_glamor_header" = xyes && pkg-config --exists "xorg-server >= 1.15.99.901" | ||
22 | -then | ||
23 | - AC_DEFINE(HAVE_GLAMOR, 1, [Build support for glamor acceleration]) | ||
24 | - AC_MSG_RESULT([yes]) | ||
25 | -else | ||
26 | - AC_MSG_RESULT([no]) | ||
27 | -fi | ||
28 | - | ||
29 | AC_CONFIG_FILES([ | ||
30 | Makefile | ||
31 | src/Makefile | ||
32 | diff --git a/man/nouveau.man b/man/nouveau.man | ||
33 | index 129bb7f..64e4144 100644 | ||
34 | --- a/man/nouveau.man | ||
35 | +++ b/man/nouveau.man | ||
36 | @@ -81,8 +81,7 @@ are supported: | ||
37 | Enable or disable the HW cursor. Default: on. | ||
38 | .TP | ||
39 | .BI "Option \*qAccelMethod\*q \*q" string \*q | ||
40 | -Specify the acceleration method. One of \*qnone\*q, \*qexa\*q, or | ||
41 | -\*qglamor\*q. Default: exa, except for GMxxx which default to glamor. | ||
42 | +Specify the acceleration method. One of \*qnone\*q, or \*qexa\*q. Default: exa. | ||
43 | .TP | ||
44 | .BI "Option \*qNoAccel\*q \*q" boolean \*q | ||
45 | Disable or enable acceleration. Default: acceleration is enabled. | ||
46 | @@ -125,6 +124,12 @@ that relies on correct presentation timing behaviour as defined in that | ||
47 | specification. | ||
48 | .br | ||
49 | Default: 1. | ||
50 | +.TP | ||
51 | +.BI "Option \*qDRI\*q \*q" integer \*q | ||
52 | +Define the maximum level of DRI to enable. Valid values are 2 or 3. | ||
53 | +exa acceleration will honor the maximum level if it is supported. | ||
54 | +Under glamor acceleration DRI3 is always enabled if supported, | ||
55 | +as glamor currently does not support DRI2. Default: 2 on exa, 3 on glamor. | ||
56 | .SH "SEE ALSO" | ||
57 | __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) | ||
58 | .SH AUTHORS | ||
59 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
60 | index 9d39a00..1e04ddf 100644 | ||
61 | --- a/src/Makefile.am | ||
62 | +++ b/src/Makefile.am | ||
63 | @@ -35,7 +35,6 @@ nouveau_drv_la_SOURCES = \ | ||
64 | nouveau_copy90b5.c \ | ||
65 | nouveau_copya0b5.c \ | ||
66 | nouveau_exa.c nouveau_xv.c nouveau_dri2.c \ | ||
67 | - nouveau_glamor.c \ | ||
68 | nouveau_present.c \ | ||
69 | nouveau_sync.c \ | ||
70 | nouveau_wfb.c \ | ||
71 | @@ -123,7 +122,6 @@ EXTRA_DIST = hwdefs/nv_3ddefs.xml.h \ | ||
72 | shader/Makefile \ | ||
73 | nouveau_local.h \ | ||
74 | nouveau_copy.h \ | ||
75 | - nouveau_glamor.h \ | ||
76 | nouveau_present.h \ | ||
77 | nouveau_sync.h \ | ||
78 | nv_const.h \ | ||
79 | diff --git a/src/drmmode_display.c b/src/drmmode_display.c | ||
80 | index 6d225cb..dc2e0ac 100644 | ||
81 | --- a/src/drmmode_display.c | ||
82 | +++ b/src/drmmode_display.c | ||
83 | @@ -42,8 +42,6 @@ | ||
84 | #include "libudev.h" | ||
85 | #endif | ||
86 | |||
87 | -#include "nouveau_glamor.h" | ||
88 | - | ||
89 | static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height); | ||
90 | typedef struct { | ||
91 | int fd; | ||
92 | @@ -106,9 +104,6 @@ drmmode_from_scrn(ScrnInfoPtr scrn) | ||
93 | static inline struct nouveau_pixmap * | ||
94 | drmmode_pixmap(PixmapPtr ppix) | ||
95 | { | ||
96 | - NVPtr pNv = NVPTR(xf86ScreenToScrn(ppix->drawable.pScreen)); | ||
97 | - if (pNv->AccelMethod == GLAMOR) | ||
98 | - return nouveau_glamor_pixmap_get(ppix); | ||
99 | return nouveau_pixmap(ppix); | ||
100 | } | ||
101 | |||
102 | @@ -332,7 +327,7 @@ drmmode_fbcon_copy(ScreenPtr pScreen) | ||
103 | ExaDriverPtr exa = pNv->EXADriverPtr; | ||
104 | xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); | ||
105 | struct nouveau_bo *bo = NULL; | ||
106 | - PixmapPtr pspix, pdpix; | ||
107 | + PixmapPtr pspix, pdpix = NULL; | ||
108 | drmModeFBPtr fb; | ||
109 | unsigned w = pScrn->virtualX, h = pScrn->virtualY; | ||
110 | int i, ret, fbcon_id = 0; | ||
111 | @@ -340,6 +335,17 @@ drmmode_fbcon_copy(ScreenPtr pScreen) | ||
112 | if (pNv->AccelMethod != EXA) | ||
113 | goto fallback; | ||
114 | |||
115 | + pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX, | ||
116 | + pScrn->virtualY, pScrn->depth, | ||
117 | + pScrn->bitsPerPixel, pScrn->displayWidth * | ||
118 | + pScrn->bitsPerPixel / 8, pNv->scanout, | ||
119 | + NULL); | ||
120 | + if (!pdpix) { | ||
121 | + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | ||
122 | + "Failed to init scanout pixmap for fbcon mirror\n"); | ||
123 | + goto fallback; | ||
124 | + } | ||
125 | + | ||
126 | for (i = 0; i < xf86_config->num_crtc; i++) { | ||
127 | drmmode_crtc_private_ptr drmmode_crtc = | ||
128 | xf86_config->crtc[i]->driver_private; | ||
129 | @@ -382,18 +388,6 @@ drmmode_fbcon_copy(ScreenPtr pScreen) | ||
130 | goto fallback; | ||
131 | } | ||
132 | |||
133 | - pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX, | ||
134 | - pScrn->virtualY, pScrn->depth, | ||
135 | - pScrn->bitsPerPixel, pScrn->displayWidth * | ||
136 | - pScrn->bitsPerPixel / 8, pNv->scanout, | ||
137 | - NULL); | ||
138 | - if (!pdpix) { | ||
139 | - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | ||
140 | - "Failed to init scanout pixmap for fbcon mirror\n"); | ||
141 | - pScreen->DestroyPixmap(pspix); | ||
142 | - goto fallback; | ||
143 | - } | ||
144 | - | ||
145 | exa->PrepareCopy(pspix, pdpix, 0, 0, GXcopy, ~0); | ||
146 | exa->Copy(pdpix, 0, 0, 0, 0, w, h); | ||
147 | exa->DoneCopy(pdpix); | ||
148 | @@ -410,6 +404,17 @@ drmmode_fbcon_copy(ScreenPtr pScreen) | ||
149 | return; | ||
150 | |||
151 | fallback: | ||
152 | + if (pdpix) { | ||
153 | + if (exa->PrepareSolid(pdpix, GXcopy, ~0, 0)) { | ||
154 | + exa->Solid(pdpix, 0, 0, w, h); | ||
155 | + exa->DoneSolid(pdpix); | ||
156 | + PUSH_KICK(pNv->pushbuf); | ||
157 | + nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client); | ||
158 | + pScreen->DestroyPixmap(pdpix); | ||
159 | + return; | ||
160 | + } | ||
161 | + pScreen->DestroyPixmap(pdpix); | ||
162 | + } | ||
163 | #endif | ||
164 | if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR, pNv->client)) | ||
165 | return; | ||
166 | @@ -719,7 +724,9 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) | ||
167 | screen->height = screenpix->drawable.height = max_height; | ||
168 | } | ||
169 | drmmode_crtc->scanout_pixmap_x = this_x; | ||
170 | -#ifdef HAS_DIRTYTRACKING2 | ||
171 | +#ifdef HAS_DIRTYTRACKING_ROTATION | ||
172 | + PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0); | ||
173 | +#elif defined(HAS_DIRTYTRACKING2) | ||
174 | PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0); | ||
175 | #else | ||
176 | PixmapStartDirtyTracking(ppix, screenpix, 0, 0); | ||
177 | @@ -897,7 +904,7 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) | ||
178 | |||
179 | for (i = 0; i < koutput->count_props; i++) { | ||
180 | props = drmModeGetProperty(drmmode->fd, koutput->props[i]); | ||
181 | - if (props && (props->flags && DRM_MODE_PROP_ENUM)) { | ||
182 | + if (props && (props->flags & DRM_MODE_PROP_ENUM)) { | ||
183 | if (!strcmp(props->name, "DPMS")) { | ||
184 | mode_id = koutput->props[i]; | ||
185 | drmModeFreeProperty(props); | ||
186 | @@ -1381,9 +1388,6 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) | ||
187 | crtc->rotation, crtc->x, crtc->y); | ||
188 | } | ||
189 | |||
190 | - if (pNv->AccelMethod == GLAMOR) | ||
191 | - nouveau_glamor_create_screen_resources(scrn->pScreen); | ||
192 | - | ||
193 | if (old_fb_id) | ||
194 | drmModeRmFB(drmmode->fd, old_fb_id); | ||
195 | nouveau_bo_ref(NULL, &old_bo); | ||
196 | diff --git a/src/nouveau_copy.c b/src/nouveau_copy.c | ||
197 | index f46f0c3..d0b868d 100644 | ||
198 | --- a/src/nouveau_copy.c | ||
199 | +++ b/src/nouveau_copy.c | ||
200 | @@ -61,6 +61,10 @@ nouveau_copy_init(ScreenPtr pScreen) | ||
201 | |||
202 | switch (pNv->Architecture) { | ||
203 | case NV_TESLA: | ||
204 | + if (pNv->dev->chipset < 0xa3 || | ||
205 | + pNv->dev->chipset == 0xaa || | ||
206 | + pNv->dev->chipset == 0xac) | ||
207 | + return FALSE; | ||
208 | data = &(struct nv04_fifo) { | ||
209 | .vram = NvDmaFB, | ||
210 | .gart = NvDmaTT, | ||
211 | @@ -87,7 +91,7 @@ nouveau_copy_init(ScreenPtr pScreen) | ||
212 | &pNv->ce_channel); | ||
213 | if (ret) { | ||
214 | xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | ||
215 | - "[COPY} error allocating channel: %d\n", ret); | ||
216 | + "[COPY] error allocating channel: %d\n", ret); | ||
217 | return FALSE; | ||
218 | } | ||
219 | |||
220 | diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c | ||
221 | index 3361869..81ee9be 100644 | ||
222 | --- a/src/nouveau_dri2.c | ||
223 | +++ b/src/nouveau_dri2.c | ||
224 | @@ -10,7 +10,9 @@ | ||
225 | #else | ||
226 | #error "This driver requires a DRI2-enabled X server" | ||
227 | #endif | ||
228 | - | ||
229 | +#ifdef DRI3 | ||
230 | +#include "dri3.h" | ||
231 | +#endif | ||
232 | #include "xf86drmMode.h" | ||
233 | |||
234 | struct nouveau_dri2_buffer { | ||
235 | @@ -168,9 +170,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio | ||
236 | } | ||
237 | |||
238 | if (translate && pDraw->type == DRAWABLE_WINDOW) { | ||
239 | +#ifdef COMPOSITE | ||
240 | PixmapPtr pPix = get_drawable_pixmap(pDraw); | ||
241 | - off_x = pDraw->x - pPix->screen_x; | ||
242 | - off_y = pDraw->y - pPix->screen_y; | ||
243 | + off_x = -pPix->screen_x; | ||
244 | + off_y = -pPix->screen_y; | ||
245 | +#endif | ||
246 | + off_x += pDraw->x; | ||
247 | + off_y += pDraw->y; | ||
248 | } | ||
249 | |||
250 | pGC = GetScratchGC(pDraw->depth, pScreen); | ||
251 | @@ -1012,3 +1018,135 @@ nouveau_dri2_fini(ScreenPtr pScreen) | ||
252 | if (pNv->AccelMethod == EXA) | ||
253 | DRI2CloseScreen(pScreen); | ||
254 | } | ||
255 | + | ||
256 | +#ifdef DRI3 | ||
257 | +static int is_render_node(int fd, struct stat *st) | ||
258 | +{ | ||
259 | + if (fstat(fd, st)) | ||
260 | + return 0; | ||
261 | + | ||
262 | + if (!S_ISCHR(st->st_mode)) | ||
263 | + return 0; | ||
264 | + | ||
265 | + return st->st_rdev & 0x80; | ||
266 | + } | ||
267 | + | ||
268 | +static int | ||
269 | +nouveau_dri3_open(ScreenPtr screen, RRProviderPtr provider, int *out) | ||
270 | +{ | ||
271 | + ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); | ||
272 | + NVPtr pNv = NVPTR(pScrn); | ||
273 | + int fd = -1; | ||
274 | + struct stat buff; | ||
275 | + | ||
276 | +#ifdef O_CLOEXEC | ||
277 | + fd = open(pNv->render_node, O_RDWR | O_CLOEXEC); | ||
278 | +#endif | ||
279 | + if (fd < 0) | ||
280 | + fd = open(pNv->render_node, O_RDWR); | ||
281 | + if (fd < 0) | ||
282 | + return -BadAlloc; | ||
283 | + | ||
284 | + if (fstat(fd, &buff)) { | ||
285 | + close(fd); | ||
286 | + return -BadMatch; | ||
287 | + } | ||
288 | + if (!is_render_node(fd, &buff)) { | ||
289 | + drm_magic_t magic; | ||
290 | + | ||
291 | + if (drmGetMagic(fd, &magic) || drmAuthMagic(pNv->dev->fd, magic)) { | ||
292 | + close(fd); | ||
293 | + return -BadMatch; | ||
294 | + } | ||
295 | + } | ||
296 | + | ||
297 | + *out = fd; | ||
298 | + return Success; | ||
299 | +} | ||
300 | + | ||
301 | +static PixmapPtr nouveau_dri3_pixmap_from_fd(ScreenPtr screen, int fd, CARD16 width, CARD16 height, CARD16 stride, CARD8 depth, CARD8 bpp) | ||
302 | +{ | ||
303 | + ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); | ||
304 | + NVPtr pNv = NVPTR(pScrn); | ||
305 | + PixmapPtr pixmap; | ||
306 | + struct nouveau_bo *bo = NULL; | ||
307 | + struct nouveau_pixmap *nvpix; | ||
308 | + | ||
309 | + if (depth < 8 || depth > 32 || depth % 8) | ||
310 | + return NULL; | ||
311 | + | ||
312 | + pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); | ||
313 | + if (!pixmap) | ||
314 | + return NULL; | ||
315 | + | ||
316 | + if (!screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL)) | ||
317 | + goto free_pixmap; | ||
318 | + | ||
319 | + if (nouveau_bo_prime_handle_ref(pNv->dev, fd, &bo)) | ||
320 | + goto free_pixmap; | ||
321 | + | ||
322 | + nvpix = nouveau_pixmap(pixmap); | ||
323 | + nouveau_bo_ref(NULL, &nvpix->bo); | ||
324 | + nvpix->bo = bo; | ||
325 | + nvpix->shared = (bo->flags & NOUVEAU_BO_APER) == NOUVEAU_BO_GART; | ||
326 | + return pixmap; | ||
327 | + | ||
328 | +free_pixmap: | ||
329 | + screen->DestroyPixmap(pixmap); | ||
330 | + return NULL; | ||
331 | +} | ||
332 | + | ||
333 | +static int nouveau_dri3_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) | ||
334 | +{ | ||
335 | + struct nouveau_bo *bo = nouveau_pixmap_bo(pixmap); | ||
336 | + int fd; | ||
337 | + | ||
338 | + if (!bo || nouveau_bo_set_prime(bo, &fd) < 0) | ||
339 | + return -EINVAL; | ||
340 | + | ||
341 | + *stride = pixmap->devKind; | ||
342 | + *size = bo->size; | ||
343 | + return fd; | ||
344 | +} | ||
345 | + | ||
346 | +static dri3_screen_info_rec nouveau_dri3_screen_info = { | ||
347 | + .version = DRI3_SCREEN_INFO_VERSION, | ||
348 | + | ||
349 | + .open = nouveau_dri3_open, | ||
350 | + .pixmap_from_fd = nouveau_dri3_pixmap_from_fd, | ||
351 | + .fd_from_pixmap = nouveau_dri3_fd_from_pixmap | ||
352 | +}; | ||
353 | +#endif | ||
354 | + | ||
355 | +Bool | ||
356 | +nouveau_dri3_screen_init(ScreenPtr screen) | ||
357 | +{ | ||
358 | +#ifdef DRI3 | ||
359 | + ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); | ||
360 | + NVPtr pNv = NVPTR(pScrn); | ||
361 | + struct stat master, render; | ||
362 | + char *buf; | ||
363 | + | ||
364 | + if (is_render_node(pNv->dev->fd, &master)) | ||
365 | + return TRUE; | ||
366 | + | ||
367 | + buf = drmGetRenderDeviceNameFromFd(pNv->dev->fd); | ||
368 | + if (buf && stat(buf, &render) == 0 && | ||
369 | + master.st_mode == render.st_mode) { | ||
370 | + pNv->render_node = buf; | ||
371 | + if (dri3_screen_init(screen, &nouveau_dri3_screen_info)) { | ||
372 | + xf86DrvMsg(pScrn->scrnIndex, X_INFO, | ||
373 | + "DRI3 on EXA enabled\n"); | ||
374 | + return TRUE; | ||
375 | + } | ||
376 | + else { | ||
377 | + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | ||
378 | + "DRI3 on EXA initialization failed\n"); | ||
379 | + return FALSE; | ||
380 | + } | ||
381 | + } else | ||
382 | + free(buf); | ||
383 | +#endif | ||
384 | + | ||
385 | + return TRUE; | ||
386 | +} | ||
387 | diff --git a/src/nouveau_glamor.c b/src/nouveau_glamor.c | ||
388 | deleted file mode 100644 | ||
389 | index ec6ebf9..0000000 | ||
390 | --- a/src/nouveau_glamor.c | ||
391 | +++ /dev/null | ||
392 | @@ -1,246 +0,0 @@ | ||
393 | -/* | ||
394 | - * Copyright 2014 Red Hat Inc. | ||
395 | - * | ||
396 | - * Permission is hereby granted, free of charge, to any person obtaining a | ||
397 | - * copy of this software and associated documentation files (the "Software"), | ||
398 | - * to deal in the Software without restriction, including without limitation | ||
399 | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
400 | - * and/or sell copies of the Software, and to permit persons to whom the | ||
401 | - * Software is furnished to do so, subject to the following conditions: | ||
402 | - * | ||
403 | - * The above copyright notice and this permission notice shall be included in | ||
404 | - * all copies or substantial portions of the Software. | ||
405 | - * | ||
406 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
407 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
408 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
409 | - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
410 | - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
411 | - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
412 | - * OTHER DEALINGS IN THE SOFTWARE. | ||
413 | - * | ||
414 | - * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
415 | - */ | ||
416 | - | ||
417 | -#include "nouveau_glamor.h" | ||
418 | -#ifdef HAVE_GLAMOR | ||
419 | - | ||
420 | -static DevPrivateKeyRec glamor_private; | ||
421 | - | ||
422 | -void | ||
423 | -nouveau_glamor_pixmap_set(PixmapPtr pixmap, struct nouveau_pixmap *priv) | ||
424 | -{ | ||
425 | - dixSetPrivate(&pixmap->devPrivates, &glamor_private, priv); | ||
426 | -} | ||
427 | - | ||
428 | -struct nouveau_pixmap * | ||
429 | -nouveau_glamor_pixmap_get(PixmapPtr pixmap) | ||
430 | -{ | ||
431 | - return dixGetPrivate(&pixmap->devPrivates, &glamor_private); | ||
432 | -} | ||
433 | - | ||
434 | -static Bool | ||
435 | -nouveau_glamor_destroy_pixmap(PixmapPtr pixmap) | ||
436 | -{ | ||
437 | - struct nouveau_pixmap *priv = nouveau_glamor_pixmap_get(pixmap); | ||
438 | - if (pixmap->refcnt == 1) { | ||
439 | - glamor_egl_destroy_textured_pixmap(pixmap); | ||
440 | - if (priv) | ||
441 | - nouveau_bo_ref(NULL, &priv->bo); | ||
442 | - } | ||
443 | - fbDestroyPixmap(pixmap); | ||
444 | - return TRUE; | ||
445 | -} | ||
446 | - | ||
447 | -static PixmapPtr | ||
448 | -nouveau_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, | ||
449 | - unsigned usage) | ||
450 | -{ | ||
451 | - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); | ||
452 | - struct nouveau_pixmap *priv; | ||
453 | - PixmapPtr pixmap; | ||
454 | - int pitch; | ||
455 | - | ||
456 | - if (usage != CREATE_PIXMAP_USAGE_SHARED) | ||
457 | - return glamor_create_pixmap(screen, w, h, depth, usage); | ||
458 | - if (depth == 1) | ||
459 | - return fbCreatePixmap(screen, w, h, depth, usage); | ||
460 | - if (w > 32767 || h > 32767) | ||
461 | - return NullPixmap; | ||
462 | - | ||
463 | - pixmap = fbCreatePixmap(screen, 0, 0, depth, usage); | ||
464 | - if (pixmap == NullPixmap || !w || !h) | ||
465 | - return pixmap; | ||
466 | - | ||
467 | - priv = calloc(1, sizeof(*priv)); | ||
468 | - if (!priv) | ||
469 | - goto fail_priv; | ||
470 | - | ||
471 | - if (!nouveau_allocate_surface(scrn, w, h, | ||
472 | - pixmap->drawable.bitsPerPixel, | ||
473 | - usage, &pitch, &priv->bo)) | ||
474 | - goto fail_bo; | ||
475 | - | ||
476 | - nouveau_glamor_pixmap_set(pixmap, priv); | ||
477 | - screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, pitch, NULL); | ||
478 | - | ||
479 | - if (!glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle, | ||
480 | - pixmap->devKind)) { | ||
481 | - xf86DrvMsg(scrn->scrnIndex, X_WARNING, | ||
482 | - "[GLAMOR] failed to create textured PRIME pixmap."); | ||
483 | - return pixmap; | ||
484 | - } | ||
485 | - | ||
486 | - return pixmap; | ||
487 | -fail_bo: | ||
488 | - free(priv); | ||
489 | -fail_priv: | ||
490 | - fbDestroyPixmap(pixmap); | ||
491 | - return fbCreatePixmap(screen, w, h, depth, usage); | ||
492 | -} | ||
493 | - | ||
494 | -static Bool | ||
495 | -nouveau_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave, | ||
496 | - void **phandle) | ||
497 | -{ | ||
498 | - struct nouveau_pixmap *priv = nouveau_glamor_pixmap_get(pixmap); | ||
499 | - int ret, handle; | ||
500 | - | ||
501 | - ret = nouveau_bo_set_prime(priv->bo, &handle); | ||
502 | - if (ret) | ||
503 | - return FALSE; | ||
504 | - | ||
505 | - priv->shared = TRUE; | ||
506 | - *phandle = (void *)(long)handle; | ||
507 | - return TRUE; | ||
508 | -} | ||
509 | - | ||
510 | -static Bool | ||
511 | -nouveau_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *_handle) | ||
512 | -{ | ||
513 | - struct nouveau_pixmap *priv = nouveau_glamor_pixmap_get(pixmap); | ||
514 | - ScreenPtr screen = pixmap->drawable.pScreen; | ||
515 | - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); | ||
516 | - NVPtr pNv = NVPTR(scrn); | ||
517 | - struct nouveau_bo *bo; | ||
518 | - int ret, handle = (int)(long)_handle; | ||
519 | - | ||
520 | - ret = nouveau_bo_prime_handle_ref(pNv->dev, handle, &bo); | ||
521 | - if (ret) | ||
522 | - return FALSE; | ||
523 | - | ||
524 | - priv->bo = bo; | ||
525 | - priv->shared = TRUE; | ||
526 | - close(handle); | ||
527 | - | ||
528 | - if (!glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle, | ||
529 | - pixmap->devKind)) { | ||
530 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, | ||
531 | - "[GLAMOR] failed to get PRIME drawable\n"); | ||
532 | - return FALSE; | ||
533 | - } | ||
534 | - | ||
535 | - return TRUE; | ||
536 | -} | ||
537 | - | ||
538 | -static void | ||
539 | -nouveau_glamor_flush(ScrnInfoPtr pScrn) | ||
540 | -{ | ||
541 | - glamor_block_handler(pScrn->pScreen); | ||
542 | -} | ||
543 | - | ||
544 | -Bool | ||
545 | -nouveau_glamor_create_screen_resources(ScreenPtr screen) | ||
546 | -{ | ||
547 | - PixmapPtr ppix = screen->GetScreenPixmap(screen); | ||
548 | - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); | ||
549 | - NVPtr pNv = NVPTR(scrn); | ||
550 | - | ||
551 | - if (!glamor_glyphs_init(screen)) | ||
552 | - return FALSE; | ||
553 | - | ||
554 | - if (!glamor_egl_create_textured_screen_ext(screen, | ||
555 | - pNv->scanout->handle, | ||
556 | - scrn->displayWidth * | ||
557 | - scrn->bitsPerPixel / 8, | ||
558 | - NULL)) | ||
559 | - return FALSE; | ||
560 | - | ||
561 | - if (!nouveau_glamor_pixmap_get(ppix)) { | ||
562 | - struct nouveau_pixmap *priv = calloc(1, sizeof(*priv)); | ||
563 | - if (priv) { | ||
564 | - nouveau_bo_ref(pNv->scanout, &priv->bo); | ||
565 | - nouveau_glamor_pixmap_set(ppix, priv); | ||
566 | - } | ||
567 | - } | ||
568 | - | ||
569 | - return TRUE; | ||
570 | -} | ||
571 | - | ||
572 | -Bool | ||
573 | -nouveau_glamor_pre_init(ScrnInfoPtr scrn) | ||
574 | -{ | ||
575 | - NVPtr pNv = NVPTR(scrn); | ||
576 | - pointer glamor_module; | ||
577 | - | ||
578 | - if (scrn->depth < 24) { | ||
579 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, | ||
580 | - "[GLAMOR] requires depth >= 24\n"); | ||
581 | - return FALSE; | ||
582 | - } | ||
583 | - | ||
584 | - if ((glamor_module = xf86LoadSubModule(scrn, GLAMOR_EGL_MODULE_NAME))) { | ||
585 | - if (!glamor_egl_init(scrn, pNv->dev->fd)) { | ||
586 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, | ||
587 | - "[GLAMOR] failed to initialise EGL\n"); | ||
588 | - return FALSE; | ||
589 | - } | ||
590 | - } else { | ||
591 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, "[GLAMOR] unavailable\n"); | ||
592 | - return FALSE; | ||
593 | - } | ||
594 | - | ||
595 | - xf86DrvMsg(scrn->scrnIndex, X_INFO, "[GLAMOR] EGL initialised\n"); | ||
596 | - return TRUE; | ||
597 | -} | ||
598 | - | ||
599 | -Bool | ||
600 | -nouveau_glamor_init(ScreenPtr screen) | ||
601 | -{ | ||
602 | - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); | ||
603 | - NVPtr pNv = NVPTR(scrn); | ||
604 | - | ||
605 | - if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | | ||
606 | - GLAMOR_USE_EGL_SCREEN | | ||
607 | - GLAMOR_USE_SCREEN | | ||
608 | - GLAMOR_USE_PICTURE_SCREEN)) { | ||
609 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, | ||
610 | - "[GLAMOR] failed to initialise\n"); | ||
611 | - return FALSE; | ||
612 | - } | ||
613 | - | ||
614 | - if (!glamor_egl_init_textured_pixmap(screen)) { | ||
615 | - xf86DrvMsg(scrn->scrnIndex, X_ERROR, | ||
616 | - "[GLAMOR] failed to initialize screen pixmap\n"); | ||
617 | - return FALSE; | ||
618 | - } | ||
619 | - | ||
620 | - if (!dixRegisterPrivateKey(&glamor_private, PRIVATE_PIXMAP, 0)) | ||
621 | - return FALSE; | ||
622 | - | ||
623 | - screen->CreatePixmap = nouveau_glamor_create_pixmap; | ||
624 | - screen->DestroyPixmap = nouveau_glamor_destroy_pixmap; | ||
625 | - screen->SharePixmapBacking = nouveau_glamor_share_pixmap_backing; | ||
626 | - screen->SetSharedPixmapBacking = nouveau_glamor_set_shared_pixmap_backing; | ||
627 | - | ||
628 | - xf86DrvMsg(scrn->scrnIndex, X_INFO, "[GLAMOR] initialised\n"); | ||
629 | - pNv->Flush = nouveau_glamor_flush; | ||
630 | - return TRUE; | ||
631 | -} | ||
632 | - | ||
633 | -XF86VideoAdaptorPtr | ||
634 | -nouveau_glamor_xv_init(ScreenPtr pScreen, int num_adapt) | ||
635 | -{ | ||
636 | - return glamor_xv_init(pScreen, num_adapt); | ||
637 | -} | ||
638 | -#endif | ||
639 | diff --git a/src/nouveau_glamor.h b/src/nouveau_glamor.h | ||
640 | deleted file mode 100644 | ||
641 | index fb6565d..0000000 | ||
642 | --- a/src/nouveau_glamor.h | ||
643 | +++ /dev/null | ||
644 | @@ -1,33 +0,0 @@ | ||
645 | -#ifndef __NOUVEAU_GLAMOR_H__ | ||
646 | -#define __NOUVEAU_GLAMOR_H__ | ||
647 | - | ||
648 | -#ifdef HAVE_CONFIG_H | ||
649 | -#include "config.h" | ||
650 | -#endif | ||
651 | -#include "xf86xv.h" | ||
652 | - | ||
653 | -#ifdef HAVE_GLAMOR | ||
654 | -#include "nv_include.h" | ||
655 | -#define GLAMOR_FOR_XORG 1 | ||
656 | -#include "glamor.h" | ||
657 | - | ||
658 | -Bool nouveau_glamor_pre_init(ScrnInfoPtr scrn); | ||
659 | -Bool nouveau_glamor_init(ScreenPtr screen); | ||
660 | -Bool nouveau_glamor_create_screen_resources(ScreenPtr screen); | ||
661 | -XF86VideoAdaptorPtr nouveau_glamor_xv_init(ScreenPtr pScreen, int num_adapt); | ||
662 | -void nouveau_glamor_pixmap_set(PixmapPtr pixmap, struct nouveau_pixmap *priv); | ||
663 | -struct nouveau_pixmap *nouveau_glamor_pixmap_get(PixmapPtr pixmap); | ||
664 | -#else | ||
665 | -static inline Bool nouveau_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; } | ||
666 | -static inline Bool nouveau_glamor_init(ScreenPtr screen) { return FALSE; } | ||
667 | -static inline Bool | ||
668 | -nouveau_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; } | ||
669 | -static inline void | ||
670 | -nouveau_glamor_pixmap_set(PixmapPtr pixmap, void *priv) { } | ||
671 | -static inline struct nouveau_pixmap * | ||
672 | -nouveau_glamor_pixmap_get(PixmapPtr pixmap) { return NULL; } | ||
673 | -static inline XF86VideoAdaptorPtr | ||
674 | -nouveau_glamor_xv_init(ScreenPtr pScreen, int num_adapt) { return NULL; } | ||
675 | -#endif | ||
676 | - | ||
677 | -#endif | ||
678 | diff --git a/src/nouveau_present.c b/src/nouveau_present.c | ||
679 | index ea1686e..482ac6e 100644 | ||
680 | --- a/src/nouveau_present.c | ||
681 | +++ b/src/nouveau_present.c | ||
682 | @@ -23,9 +23,8 @@ | ||
683 | */ | ||
684 | |||
685 | #include "nouveau_present.h" | ||
686 | -#if defined(DRI3) && defined(HAVE_GLAMOR) | ||
687 | +#if defined(DRI3) | ||
688 | #include "nv_include.h" | ||
689 | -#include "nouveau_glamor.h" | ||
690 | #include "xf86drmMode.h" | ||
691 | |||
692 | struct nouveau_present { | ||
693 | @@ -177,34 +176,12 @@ static Bool | ||
694 | nouveau_present_flip_exec(ScrnInfoPtr scrn, uint64_t event_id, int sync, | ||
695 | uint64_t target_msc, PixmapPtr pixmap, Bool vsync) | ||
696 | { | ||
697 | - ScreenPtr screen = scrn->pScreen; | ||
698 | - struct nouveau_pixmap *priv; | ||
699 | + struct nouveau_pixmap *priv = nouveau_pixmap(pixmap); | ||
700 | NVPtr pNv = NVPTR(scrn); | ||
701 | uint32_t next_fb; | ||
702 | - CARD16 stride; | ||
703 | - CARD32 size; | ||
704 | void *token; | ||
705 | int ret; | ||
706 | |||
707 | - priv = nouveau_glamor_pixmap_get(pixmap); | ||
708 | - if (priv == NULL) { | ||
709 | - int fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size); | ||
710 | - if (fd < 0) | ||
711 | - return FALSE; | ||
712 | - | ||
713 | - priv = calloc(1, sizeof(*priv)); | ||
714 | - if (!priv) | ||
715 | - return FALSE; | ||
716 | - | ||
717 | - ret = nouveau_bo_prime_handle_ref(pNv->dev, fd, &priv->bo); | ||
718 | - if (ret) { | ||
719 | - free(priv); | ||
720 | - return FALSE; | ||
721 | - } | ||
722 | - | ||
723 | - nouveau_glamor_pixmap_set(pixmap, priv); | ||
724 | - } | ||
725 | - | ||
726 | ret = drmModeAddFB(pNv->dev->fd, pixmap->drawable.width, | ||
727 | pixmap->drawable.height, pixmap->drawable.depth, | ||
728 | pixmap->drawable.bitsPerPixel, pixmap->devKind, | ||
729 | @@ -289,7 +266,7 @@ nouveau_present_fini(ScreenPtr screen) | ||
730 | } | ||
731 | } | ||
732 | |||
733 | -int | ||
734 | +Bool | ||
735 | nouveau_present_init(ScreenPtr screen) | ||
736 | { | ||
737 | ScrnInfoPtr scrn = xf86ScreenToScrn(screen); | ||
738 | @@ -298,12 +275,9 @@ nouveau_present_init(ScreenPtr screen) | ||
739 | uint64_t value; | ||
740 | int ret; | ||
741 | |||
742 | - if (pNv->AccelMethod != GLAMOR) | ||
743 | - return -ENOSYS; | ||
744 | - | ||
745 | present = pNv->present = calloc(1, sizeof(*present)); | ||
746 | if (!present) | ||
747 | - return -ENOMEM; | ||
748 | + return FALSE; | ||
749 | |||
750 | present->info.version = PRESENT_SCREEN_INFO_VERSION; | ||
751 | present->info.get_crtc = nouveau_present_crtc; | ||
752 | diff --git a/src/nouveau_present.h b/src/nouveau_present.h | ||
753 | index 958c2f7..e807b6d 100644 | ||
754 | --- a/src/nouveau_present.h | ||
755 | +++ b/src/nouveau_present.h | ||
756 | @@ -8,7 +8,7 @@ | ||
757 | #include "config.h" | ||
758 | #endif | ||
759 | |||
760 | -#if defined(DRI3) && defined(HAVE_GLAMOR) | ||
761 | +#if defined(DRI3) | ||
762 | #include "present.h" | ||
763 | Bool nouveau_present_init(ScreenPtr pScreen); | ||
764 | void nouveau_present_fini(ScreenPtr pScreen); | ||
765 | diff --git a/src/nouveau_wfb.c b/src/nouveau_wfb.c | ||
766 | index 10f0f27..a52f2fd 100644 | ||
767 | --- a/src/nouveau_wfb.c | ||
768 | +++ b/src/nouveau_wfb.c | ||
769 | @@ -26,7 +26,6 @@ | ||
770 | */ | ||
771 | |||
772 | #include "nv_include.h" | ||
773 | -#include "nouveau_glamor.h" | ||
774 | |||
775 | struct wfb_pixmap { | ||
776 | PixmapPtr ppix; | ||
777 | @@ -136,12 +135,7 @@ nouveau_wfb_setup_wrap(ReadMemoryProcPtr *pRead, WriteMemoryProcPtr *pWrite, | ||
778 | |||
779 | ppix = NVGetDrawablePixmap(pDraw); | ||
780 | if (ppix) { | ||
781 | - NVPtr pNv = NVPTR(xf86ScreenToScrn(pDraw->pScreen)); | ||
782 | - struct nouveau_pixmap *priv; | ||
783 | - if (pNv->AccelMethod == GLAMOR) | ||
784 | - priv = nouveau_glamor_pixmap_get(ppix); | ||
785 | - else | ||
786 | - priv = nouveau_pixmap(ppix); | ||
787 | + struct nouveau_pixmap *priv = nouveau_pixmap(ppix); | ||
788 | bo = priv ? priv->bo : NULL; | ||
789 | } | ||
790 | |||
791 | diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c | ||
792 | index a479d38..d514dbf 100644 | ||
793 | --- a/src/nouveau_xv.c | ||
794 | +++ b/src/nouveau_xv.c | ||
795 | @@ -38,7 +38,6 @@ | ||
796 | |||
797 | #include "nv_include.h" | ||
798 | #include "nv_dma.h" | ||
799 | -#include "nouveau_glamor.h" | ||
800 | |||
801 | #include "vl_hwmc.h" | ||
802 | |||
803 | @@ -1069,6 +1068,8 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, | ||
804 | if (pPriv->grabbedByV4L) | ||
805 | return Success; | ||
806 | |||
807 | + if (width > pPriv->max_image_dim || height > pPriv->max_image_dim) | ||
808 | + return BadMatch; | ||
809 | |||
810 | NV_set_action_flags(pScrn, pDraw, pPriv, id, drw_x, drw_y, drw_w, | ||
811 | drw_h, &action_flags); | ||
812 | @@ -1442,11 +1443,6 @@ NVQueryImageAttributes(ScrnInfoPtr pScrn, int id, | ||
813 | { | ||
814 | int size, tmp; | ||
815 | |||
816 | - if (*w > IMAGE_MAX_W) | ||
817 | - *w = IMAGE_MAX_W; | ||
818 | - if (*h > IMAGE_MAX_H) | ||
819 | - *h = IMAGE_MAX_H; | ||
820 | - | ||
821 | *w = (*w + 1) & ~1; // width rounded up to an even number | ||
822 | if (offsets) | ||
823 | offsets[0] = 0; | ||
824 | @@ -1707,6 +1703,7 @@ NVSetupBlitVideo (ScreenPtr pScreen) | ||
825 | pPriv->bicubic = FALSE; | ||
826 | pPriv->doubleBuffer = FALSE; | ||
827 | pPriv->SyncToVBlank = (pNv->dev->chipset >= 0x11); | ||
828 | + pPriv->max_image_dim = 2048; | ||
829 | |||
830 | pNv->blitAdaptor = adapt; | ||
831 | |||
832 | @@ -1767,6 +1764,7 @@ NVSetupOverlayVideoAdapter(ScreenPtr pScreen) | ||
833 | pPriv->blitter = FALSE; | ||
834 | pPriv->texture = FALSE; | ||
835 | pPriv->bicubic = FALSE; | ||
836 | + pPriv->max_image_dim = 2048; | ||
837 | |||
838 | NVSetPortDefaults (pScrn, pPriv); | ||
839 | |||
840 | @@ -1968,6 +1966,7 @@ NV30SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | ||
841 | pPriv->bicubic = bicubic; | ||
842 | pPriv->doubleBuffer = FALSE; | ||
843 | pPriv->SyncToVBlank = TRUE; | ||
844 | + pPriv->max_image_dim = 4096; | ||
845 | |||
846 | if (bicubic) | ||
847 | pNv->textureAdaptor[1] = adapt; | ||
848 | @@ -2049,6 +2048,7 @@ NV40SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | ||
849 | pPriv->bicubic = bicubic; | ||
850 | pPriv->doubleBuffer = FALSE; | ||
851 | pPriv->SyncToVBlank = TRUE; | ||
852 | + pPriv->max_image_dim = 4096; | ||
853 | |||
854 | if (bicubic) | ||
855 | pNv->textureAdaptor[1] = adapt; | ||
856 | @@ -2182,9 +2182,6 @@ NVInitVideo(ScreenPtr pScreen) | ||
857 | } | ||
858 | |||
859 | NVSetupTexturedVideo(pScreen, textureAdaptor); | ||
860 | - } else | ||
861 | - if (pNv->AccelMethod == GLAMOR) { | ||
862 | - blitAdaptor = nouveau_glamor_xv_init(pScreen, 16); | ||
863 | } | ||
864 | |||
865 | num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); | ||
866 | diff --git a/src/nv04_exa.c b/src/nv04_exa.c | ||
867 | index 7a58dd7..d5dec68 100644 | ||
868 | --- a/src/nv04_exa.c | ||
869 | +++ b/src/nv04_exa.c | ||
870 | @@ -49,7 +49,8 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask) | ||
871 | NVPtr pNv = NVPTR(pScrn); | ||
872 | struct nouveau_pushbuf *push = pNv->pushbuf; | ||
873 | |||
874 | - planemask |= ~0 << ppix->drawable.bitsPerPixel; | ||
875 | + if (ppix->drawable.bitsPerPixel < 32) | ||
876 | + planemask |= ~0 << ppix->drawable.bitsPerPixel; | ||
877 | if (planemask != ~0 || alu != GXcopy) { | ||
878 | if (ppix->drawable.bitsPerPixel == 32) | ||
879 | return FALSE; | ||
880 | diff --git a/src/nv10_exa.c b/src/nv10_exa.c | ||
881 | index 78bc739..7daa281 100644 | ||
882 | --- a/src/nv10_exa.c | ||
883 | +++ b/src/nv10_exa.c | ||
884 | @@ -697,9 +697,9 @@ NVAccelInitNV10TCL(ScrnInfoPtr pScrn) | ||
885 | PUSH_DATA (push, 0); | ||
886 | } | ||
887 | |||
888 | - BEGIN_NV04(push, SUBC_3D(0x290), 1); | ||
889 | + BEGIN_NV04(push, NV10_3D(UNK0290), 1); | ||
890 | PUSH_DATA (push, (0x10<<16)|1); | ||
891 | - BEGIN_NV04(push, SUBC_3D(0x3f4), 1); | ||
892 | + BEGIN_NV04(push, NV10_3D(UNK03F4), 1); | ||
893 | PUSH_DATA (push, 0); | ||
894 | |||
895 | BEGIN_NV04(push, NV04_GRAPH(3D, NOP), 1); | ||
896 | @@ -707,12 +707,12 @@ NVAccelInitNV10TCL(ScrnInfoPtr pScrn) | ||
897 | |||
898 | if (class != NV10_3D_CLASS) { | ||
899 | /* For nv11, nv17 */ | ||
900 | - BEGIN_NV04(push, SUBC_3D(0x120), 3); | ||
901 | + BEGIN_NV04(push, SUBC_3D(NV15_3D_FLIP_SET_READ), 3); | ||
902 | PUSH_DATA (push, 0); | ||
903 | PUSH_DATA (push, 1); | ||
904 | PUSH_DATA (push, 2); | ||
905 | |||
906 | - BEGIN_NV04(push, SUBC_BLIT(0x120), 3); | ||
907 | + BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3); | ||
908 | PUSH_DATA (push, 0); | ||
909 | PUSH_DATA (push, 1); | ||
910 | PUSH_DATA (push, 2); | ||
911 | diff --git a/src/nv30_exa.c b/src/nv30_exa.c | ||
912 | index 21586e9..9d63119 100644 | ||
913 | --- a/src/nv30_exa.c | ||
914 | +++ b/src/nv30_exa.c | ||
915 | @@ -644,16 +644,16 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) | ||
916 | PUSH_DATA (push, 0); | ||
917 | } | ||
918 | |||
919 | - BEGIN_NV04(push, SUBC_3D(0x220), 1); | ||
920 | + BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1); | ||
921 | PUSH_DATA (push, 1); | ||
922 | |||
923 | - BEGIN_NV04(push, SUBC_3D(0x03b0), 1); | ||
924 | - PUSH_DATA (push, 0x00100000); | ||
925 | - BEGIN_NV04(push, SUBC_3D(0x1454), 1); | ||
926 | + BEGIN_NV04(push, NV40_3D(MIPMAP_ROUNDING), 1); | ||
927 | + PUSH_DATA (push, NV40_3D_MIPMAP_ROUNDING_MODE_DOWN); | ||
928 | + BEGIN_NV04(push, NV30_3D(FLATSHADE_FIRST), 1); | ||
929 | PUSH_DATA (push, 0); | ||
930 | BEGIN_NV04(push, SUBC_3D(0x1d80), 1); | ||
931 | PUSH_DATA (push, 3); | ||
932 | - BEGIN_NV04(push, SUBC_3D(0x1450), 1); | ||
933 | + BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1); | ||
934 | PUSH_DATA (push, 0x00030004); | ||
935 | |||
936 | /* NEW */ | ||
937 | @@ -670,17 +670,17 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) | ||
938 | PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); | ||
939 | PUSH_DATA (push, 0); PUSH_DATA (push, 0); PUSH_DATA (push, 0); | ||
940 | |||
941 | - BEGIN_NV04(push, SUBC_3D(0x120), 3); | ||
942 | + BEGIN_NV04(push, NV30_3D(FLIP_SET_READ), 3); | ||
943 | PUSH_DATA (push, 0); | ||
944 | PUSH_DATA (push, 1); | ||
945 | PUSH_DATA (push, 2); | ||
946 | |||
947 | - BEGIN_NV04(push, SUBC_BLIT(0x120), 3); | ||
948 | + BEGIN_NV04(push, NV15_BLIT(FLIP_SET_READ), 3); | ||
949 | PUSH_DATA (push, 0); | ||
950 | PUSH_DATA (push, 1); | ||
951 | PUSH_DATA (push, 2); | ||
952 | |||
953 | - BEGIN_NV04(push, SUBC_3D(0x1d88), 1); | ||
954 | + BEGIN_NV04(push, NV30_3D(COORD_CONVENTIONS), 1); | ||
955 | PUSH_DATA (push, 0x00001200); | ||
956 | |||
957 | BEGIN_NV04(push, NV30_3D(MULTISAMPLE_CONTROL), 1); | ||
958 | @@ -742,7 +742,7 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) | ||
959 | * it's not needed between nouveau restarts - which suggests that | ||
960 | * the 3D context (wherever it's stored?) survives somehow. | ||
961 | */ | ||
962 | - //BEGIN_NV04(push, SUBC_3D(0x1d60),1); | ||
963 | + //BEGIN_NV04(push, NV30_3D(FP_CONTROL),1); | ||
964 | //PUSH_DATA (push, 0x03008000); | ||
965 | |||
966 | int w=4096; | ||
967 | @@ -756,7 +756,7 @@ NVAccelInitNV30TCL(ScrnInfoPtr pScrn) | ||
968 | PUSH_DATA (push, 0x0); | ||
969 | BEGIN_NV04(push, NV30_3D(VIEWPORT_TX_ORIGIN), 1); | ||
970 | PUSH_DATA (push, 0); | ||
971 | - BEGIN_NV04(push, SUBC_3D(0x0a00), 2); | ||
972 | + BEGIN_NV04(push, NV30_3D(VIEWPORT_HORIZ), 2); | ||
973 | PUSH_DATA (push, (w<<16) | 0); | ||
974 | PUSH_DATA (push, (h<<16) | 0); | ||
975 | BEGIN_NV04(push, NV30_3D(VIEWPORT_CLIP_HORIZ(0)), 2); | ||
976 | diff --git a/src/nv40_exa.c b/src/nv40_exa.c | ||
977 | index c9e99e0..8a1e2b5 100644 | ||
978 | --- a/src/nv40_exa.c | ||
979 | +++ b/src/nv40_exa.c | ||
980 | @@ -633,13 +633,13 @@ NVAccelInitNV40TCL(ScrnInfoPtr pScrn) | ||
981 | PUSH_DATA (push, 0x0020ffff); | ||
982 | BEGIN_NV04(push, SUBC_3D(0x1d64), 1); | ||
983 | PUSH_DATA (push, 0x00d30000); | ||
984 | - BEGIN_NV04(push, SUBC_3D(0x1e94), 1); | ||
985 | - PUSH_DATA (push, 0x00000001); | ||
986 | + BEGIN_NV04(push, NV30_3D(ENGINE), 1); | ||
987 | + PUSH_DATA (push, NV30_3D_ENGINE_FP); | ||
988 | |||
989 | /* This removes the the stair shaped tearing that i get. */ | ||
990 | /* Verified on one G70 card that it doesn't cause regressions for people without the problem. */ | ||
991 | /* The blob sets this up by default for NV43. */ | ||
992 | - BEGIN_NV04(push, SUBC_3D(0x1450), 1); | ||
993 | + BEGIN_NV04(push, NV30_3D(FP_REG_CONTROL), 1); | ||
994 | PUSH_DATA (push, 0x0000000F); | ||
995 | |||
996 | BEGIN_NV04(push, NV30_3D(VIEWPORT_TRANSLATE_X), 8); | ||
997 | @@ -690,7 +690,7 @@ NVAccelInitNV40TCL(ScrnInfoPtr pScrn) | ||
998 | PUSH_DATA (push, 0); | ||
999 | } | ||
1000 | |||
1001 | - BEGIN_NV04(push, SUBC_3D(0x1d78), 1); | ||
1002 | + BEGIN_NV04(push, NV30_3D(DEPTH_CONTROL), 1); | ||
1003 | PUSH_DATA (push, 0x110); | ||
1004 | |||
1005 | BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1); | ||
1006 | diff --git a/src/nv50_accel.c b/src/nv50_accel.c | ||
1007 | index b27f67a..bce5a81 100644 | ||
1008 | --- a/src/nv50_accel.c | ||
1009 | +++ b/src/nv50_accel.c | ||
1010 | @@ -110,13 +110,13 @@ NVAccelInit2D_NV50(ScrnInfoPtr pScrn) | ||
1011 | /* Magics from nv, no clue what they do, but at least some | ||
1012 | * of them are needed to avoid crashes. | ||
1013 | */ | ||
1014 | - BEGIN_NV04(push, SUBC_2D(0x0260), 1); | ||
1015 | + BEGIN_NV04(push, NV50_2D(UNK260), 1); | ||
1016 | PUSH_DATA (push, 1); | ||
1017 | BEGIN_NV04(push, NV50_2D(CLIP_ENABLE), 1); | ||
1018 | PUSH_DATA (push, 1); | ||
1019 | BEGIN_NV04(push, NV50_2D(COLOR_KEY_ENABLE), 1); | ||
1020 | PUSH_DATA (push, 0); | ||
1021 | - BEGIN_NV04(push, SUBC_2D(0x058c), 1); | ||
1022 | + BEGIN_NV04(push, NV50_2D(UNK58C), 1); | ||
1023 | PUSH_DATA (push, 0x111); | ||
1024 | |||
1025 | pNv->currentRop = 0xfffffffa; | ||
1026 | @@ -205,8 +205,10 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) | ||
1027 | |||
1028 | BEGIN_NV04(push, NV50_3D(VIEWPORT_TRANSFORM_EN), 1); | ||
1029 | PUSH_DATA (push, 0); | ||
1030 | - BEGIN_NV04(push, SUBC_3D(0x0f90), 1); | ||
1031 | + BEGIN_NV04(push, NV50_3D(COLOR_MASK_COMMON), 1); | ||
1032 | PUSH_DATA (push, 1); | ||
1033 | + BEGIN_NV04(push, NV50_3D(ZETA_ENABLE), 1); | ||
1034 | + PUSH_DATA (push, 0); | ||
1035 | |||
1036 | BEGIN_NV04(push, NV50_3D(TIC_ADDRESS_HIGH), 3); | ||
1037 | PUSH_DATA (push, (pNv->scratch->offset + TIC_OFFSET) >> 32); | ||
1038 | @@ -223,65 +225,65 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) | ||
1039 | |||
1040 | PUSH_DATAu(push, pNv->scratch, PVP_OFFSET, 30 * 2); | ||
1041 | PUSH_DATA (push, 0x10000001); | ||
1042 | - PUSH_DATA (push, 0x0423c788); | ||
1043 | + PUSH_DATA (push, 0x0423c788); /* mov b32 o[0x0] a[0x0] */ | ||
1044 | PUSH_DATA (push, 0x10000205); | ||
1045 | - PUSH_DATA (push, 0x0423c788); | ||
1046 | + PUSH_DATA (push, 0x0423c788); /* mov b32 o[0x4] a[0x4] */ | ||
1047 | PUSH_DATA (push, 0xc0800401); | ||
1048 | - PUSH_DATA (push, 0x00200780); | ||
1049 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r0 a[0x8] c0[0x0] */ | ||
1050 | PUSH_DATA (push, 0xc0830405); | ||
1051 | - PUSH_DATA (push, 0x00200780); | ||
1052 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r1 a[0x8] c0[0xc] */ | ||
1053 | PUSH_DATA (push, 0xc0860409); | ||
1054 | - PUSH_DATA (push, 0x00200780); | ||
1055 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r2 a[0x8] c0[0x18] */ | ||
1056 | PUSH_DATA (push, 0xe0810601); | ||
1057 | - PUSH_DATA (push, 0x00200780); | ||
1058 | + PUSH_DATA (push, 0x00200780); /* add f32 $r0 (mul a[0xc] c0[0x4]) $r0 */ | ||
1059 | PUSH_DATA (push, 0xe0840605); | ||
1060 | - PUSH_DATA (push, 0x00204780); | ||
1061 | + PUSH_DATA (push, 0x00204780); /* add f32 $r1 (mul a[0xc] c0[0x10]) $r1 */ | ||
1062 | PUSH_DATA (push, 0xe0870609); | ||
1063 | - PUSH_DATA (push, 0x00208780); | ||
1064 | + PUSH_DATA (push, 0x00208780); /* add f32 $r2 (mul a[0xc] c0[0x1c]) $r2 */ | ||
1065 | PUSH_DATA (push, 0xb1000001); | ||
1066 | - PUSH_DATA (push, 0x00008780); | ||
1067 | + PUSH_DATA (push, 0x00008780); /* add rn f32 $r0 $r0 c0[0x8] */ | ||
1068 | PUSH_DATA (push, 0xb1000205); | ||
1069 | - PUSH_DATA (push, 0x00014780); | ||
1070 | + PUSH_DATA (push, 0x00014780); /* add rn f32 $r1 $r1 c0[0x14] */ | ||
1071 | PUSH_DATA (push, 0xb1000409); | ||
1072 | - PUSH_DATA (push, 0x00020780); | ||
1073 | + PUSH_DATA (push, 0x00020780); /* add rn f32 $r2 $r2 c0[0x20] */ | ||
1074 | PUSH_DATA (push, 0x90000409); | ||
1075 | - PUSH_DATA (push, 0x00000780); | ||
1076 | + PUSH_DATA (push, 0x00000780); /* rcp f32 $r2 $r2 */ | ||
1077 | PUSH_DATA (push, 0xc0020001); | ||
1078 | - PUSH_DATA (push, 0x00000780); | ||
1079 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r0 $r0 $r2 */ | ||
1080 | PUSH_DATA (push, 0xc0020205); | ||
1081 | - PUSH_DATA (push, 0x00000780); | ||
1082 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r1 $r1 $r2 */ | ||
1083 | PUSH_DATA (push, 0xc0890009); | ||
1084 | - PUSH_DATA (push, 0x00000788); | ||
1085 | + PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0x8] $r0 c0[0x24] */ | ||
1086 | PUSH_DATA (push, 0xc08a020d); | ||
1087 | - PUSH_DATA (push, 0x00000788); | ||
1088 | + PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0xc] $r1 c0[0x28] */ | ||
1089 | PUSH_DATA (push, 0xc08b0801); | ||
1090 | - PUSH_DATA (push, 0x00200780); | ||
1091 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r0 a[0x10] c0[0x2c] */ | ||
1092 | PUSH_DATA (push, 0xc08e0805); | ||
1093 | - PUSH_DATA (push, 0x00200780); | ||
1094 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r1 a[0x10] c0[0x38] */ | ||
1095 | PUSH_DATA (push, 0xc0910809); | ||
1096 | - PUSH_DATA (push, 0x00200780); | ||
1097 | + PUSH_DATA (push, 0x00200780); /* mul rn f32 $r2 a[0x10] c0[0x44] */ | ||
1098 | PUSH_DATA (push, 0xe08c0a01); | ||
1099 | - PUSH_DATA (push, 0x00200780); | ||
1100 | + PUSH_DATA (push, 0x00200780); /* add f32 $r0 (mul a[0x14] c0[0x30]) $r0 */ | ||
1101 | PUSH_DATA (push, 0xe08f0a05); | ||
1102 | - PUSH_DATA (push, 0x00204780); | ||
1103 | + PUSH_DATA (push, 0x00204780); /* add f32 $r1 (mul a[0x14] c0[0x3c]) $r1 */ | ||
1104 | PUSH_DATA (push, 0xe0920a09); | ||
1105 | - PUSH_DATA (push, 0x00208780); | ||
1106 | + PUSH_DATA (push, 0x00208780); /* add f32 $r2 (mul a[0x14] c0[0x48]) $r2 */ | ||
1107 | PUSH_DATA (push, 0xb1000001); | ||
1108 | - PUSH_DATA (push, 0x00034780); | ||
1109 | + PUSH_DATA (push, 0x00034780); /* add rn f32 $r0 $r0 c0[0x34] */ | ||
1110 | PUSH_DATA (push, 0xb1000205); | ||
1111 | - PUSH_DATA (push, 0x00040780); | ||
1112 | + PUSH_DATA (push, 0x00040780); /* add rn f32 $r1 $r1 c0[0x40] */ | ||
1113 | PUSH_DATA (push, 0xb1000409); | ||
1114 | - PUSH_DATA (push, 0x0004c780); | ||
1115 | + PUSH_DATA (push, 0x0004c780); /* add rn f32 $r2 $r2 c0[0x4c] */ | ||
1116 | PUSH_DATA (push, 0x90000409); | ||
1117 | - PUSH_DATA (push, 0x00000780); | ||
1118 | + PUSH_DATA (push, 0x00000780); /* rcp f32 $r2 $r2 */ | ||
1119 | PUSH_DATA (push, 0xc0020001); | ||
1120 | - PUSH_DATA (push, 0x00000780); | ||
1121 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r0 $r0 $r2 */ | ||
1122 | PUSH_DATA (push, 0xc0020205); | ||
1123 | - PUSH_DATA (push, 0x00000780); | ||
1124 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r1 $r1 $r2 */ | ||
1125 | PUSH_DATA (push, 0xc0940011); | ||
1126 | - PUSH_DATA (push, 0x00000788); | ||
1127 | + PUSH_DATA (push, 0x00000788); /* mul rn f32 o[0x10] $r0 c0[0x50] */ | ||
1128 | PUSH_DATA (push, 0xc0950215); | ||
1129 | - PUSH_DATA (push, 0x00000789); | ||
1130 | + PUSH_DATA (push, 0x00000789); /* exit mul rn f32 o[0x14] $r1 c0[0x54] */ | ||
1131 | |||
1132 | /* fetch only VTX_ATTR[0,8,9].xy */ | ||
1133 | BEGIN_NV04(push, NV50_3D(VP_ATTR_EN(0)), 2); | ||
1134 | @@ -305,116 +307,116 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) | ||
1135 | PUSH_DATA (push, 0); | ||
1136 | |||
1137 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_S, 6); | ||
1138 | - PUSH_DATA (push, 0x80000000); | ||
1139 | - PUSH_DATA (push, 0x90000004); | ||
1140 | - PUSH_DATA (push, 0x82010200); | ||
1141 | - PUSH_DATA (push, 0x82020204); | ||
1142 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1143 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1144 | + PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */ | ||
1145 | + PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */ | ||
1146 | PUSH_DATA (push, 0xf6400001); | ||
1147 | - PUSH_DATA (push, 0x0000c785); | ||
1148 | + PUSH_DATA (push, 0x0000c785); /* exit texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1149 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_C, 16); | ||
1150 | - PUSH_DATA (push, 0x80000000); | ||
1151 | - PUSH_DATA (push, 0x90000004); | ||
1152 | - PUSH_DATA (push, 0x82030210); | ||
1153 | - PUSH_DATA (push, 0x82040214); | ||
1154 | - PUSH_DATA (push, 0x82010200); | ||
1155 | - PUSH_DATA (push, 0x82020204); | ||
1156 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1157 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1158 | + PUSH_DATA (push, 0x82030210); /* interp $r4 v[0xc] $r1 */ | ||
1159 | + PUSH_DATA (push, 0x82040214); /* interp $r5 v[0x10] $r1 */ | ||
1160 | + PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */ | ||
1161 | + PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */ | ||
1162 | PUSH_DATA (push, 0xf6400001); | ||
1163 | - PUSH_DATA (push, 0x0000c784); | ||
1164 | + PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1165 | PUSH_DATA (push, 0xf0400211); | ||
1166 | - PUSH_DATA (push, 0x00008784); | ||
1167 | - PUSH_DATA (push, 0xc0040000); | ||
1168 | - PUSH_DATA (push, 0xc0040204); | ||
1169 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r4 $t1 $s0 $r4:$r5 0x0 0x0 0x0 */ | ||
1170 | + PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */ | ||
1171 | + PUSH_DATA (push, 0xc0040204); /* mul f32 $r1 $r1 $r4 */ | ||
1172 | PUSH_DATA (push, 0xc0040409); | ||
1173 | - PUSH_DATA (push, 0x00000780); | ||
1174 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r4 */ | ||
1175 | PUSH_DATA (push, 0xc004060d); | ||
1176 | - PUSH_DATA (push, 0x00000781); | ||
1177 | + PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r4 */ | ||
1178 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_CCA, 16); | ||
1179 | - PUSH_DATA (push, 0x80000000); | ||
1180 | - PUSH_DATA (push, 0x90000004); | ||
1181 | - PUSH_DATA (push, 0x82030210); | ||
1182 | - PUSH_DATA (push, 0x82040214); | ||
1183 | - PUSH_DATA (push, 0x82010200); | ||
1184 | - PUSH_DATA (push, 0x82020204); | ||
1185 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1186 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1187 | + PUSH_DATA (push, 0x82030210); /* interp $r4 v[0xc] $r1 */ | ||
1188 | + PUSH_DATA (push, 0x82040214); /* interp $r5 v[0x10] $r1 */ | ||
1189 | + PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */ | ||
1190 | + PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */ | ||
1191 | PUSH_DATA (push, 0xf6400001); | ||
1192 | - PUSH_DATA (push, 0x0000c784); | ||
1193 | + PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1194 | PUSH_DATA (push, 0xf6400211); | ||
1195 | - PUSH_DATA (push, 0x0000c784); | ||
1196 | - PUSH_DATA (push, 0xc0040000); | ||
1197 | - PUSH_DATA (push, 0xc0050204); | ||
1198 | + PUSH_DATA (push, 0x0000c784); /* texauto live $r4:$r5:$r6:$r7 $t1 $s0 $r4:$r5 0x0 0x0 0x0 */ | ||
1199 | + PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */ | ||
1200 | + PUSH_DATA (push, 0xc0050204); /* mul f32 $r1 $r1 $r5 */ | ||
1201 | PUSH_DATA (push, 0xc0060409); | ||
1202 | - PUSH_DATA (push, 0x00000780); | ||
1203 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r6 */ | ||
1204 | PUSH_DATA (push, 0xc007060d); | ||
1205 | - PUSH_DATA (push, 0x00000781); | ||
1206 | + PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r7 */ | ||
1207 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_CCASA, 16); | ||
1208 | - PUSH_DATA (push, 0x80000000); | ||
1209 | - PUSH_DATA (push, 0x90000004); | ||
1210 | - PUSH_DATA (push, 0x82030200); | ||
1211 | - PUSH_DATA (push, 0x82040204); | ||
1212 | - PUSH_DATA (push, 0x82010210); | ||
1213 | - PUSH_DATA (push, 0x82020214); | ||
1214 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1215 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1216 | + PUSH_DATA (push, 0x82030200); /* interp $r0 v[0xc] $r1 */ | ||
1217 | + PUSH_DATA (push, 0x82040204); /* interp $r1 v[0x10] $r1 */ | ||
1218 | + PUSH_DATA (push, 0x82010210); /* interp $r4 v[0x4] $r1 */ | ||
1219 | + PUSH_DATA (push, 0x82020214); /* interp $r5 v[0x8] $r1 */ | ||
1220 | PUSH_DATA (push, 0xf6400201); | ||
1221 | - PUSH_DATA (push, 0x0000c784); | ||
1222 | + PUSH_DATA (push, 0x0000c784); /* texauto live $r0:$r1:$r2:$r3 $t1 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1223 | PUSH_DATA (push, 0xf0400011); | ||
1224 | - PUSH_DATA (push, 0x00008784); | ||
1225 | - PUSH_DATA (push, 0xc0040000); | ||
1226 | - PUSH_DATA (push, 0xc0040204); | ||
1227 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r4 $t0 $s0 $r4:$r5 0x0 0x0 0x0 */ | ||
1228 | + PUSH_DATA (push, 0xc0040000); /* mul f32 $r0 $r0 $r4 */ | ||
1229 | + PUSH_DATA (push, 0xc0040204); /* mul f32 $r1 $r1 $r4 */ | ||
1230 | PUSH_DATA (push, 0xc0040409); | ||
1231 | - PUSH_DATA (push, 0x00000780); | ||
1232 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r2 $r2 $r4 */ | ||
1233 | PUSH_DATA (push, 0xc004060d); | ||
1234 | - PUSH_DATA (push, 0x00000781); | ||
1235 | + PUSH_DATA (push, 0x00000781); /* exit mul rn f32 $r3 $r3 $r4 */ | ||
1236 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_S_A8, 10); | ||
1237 | - PUSH_DATA (push, 0x80000000); | ||
1238 | - PUSH_DATA (push, 0x90000004); | ||
1239 | - PUSH_DATA (push, 0x82010200); | ||
1240 | - PUSH_DATA (push, 0x82020204); | ||
1241 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1242 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1243 | + PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */ | ||
1244 | + PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */ | ||
1245 | PUSH_DATA (push, 0xf0400001); | ||
1246 | - PUSH_DATA (push, 0x00008784); | ||
1247 | - PUSH_DATA (push, 0x10008004); | ||
1248 | - PUSH_DATA (push, 0x10008008); | ||
1249 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1250 | + PUSH_DATA (push, 0x10008004); /* mov b32 $r1 $r0 */ | ||
1251 | + PUSH_DATA (push, 0x10008008); /* mov b32 $r2 $r0 */ | ||
1252 | PUSH_DATA (push, 0x1000000d); | ||
1253 | - PUSH_DATA (push, 0x0403c781); | ||
1254 | + PUSH_DATA (push, 0x0403c781); /* exit mov b32 $r3 $r0 */ | ||
1255 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_C_A8, 16); | ||
1256 | - PUSH_DATA (push, 0x80000000); | ||
1257 | - PUSH_DATA (push, 0x90000004); | ||
1258 | - PUSH_DATA (push, 0x82030208); | ||
1259 | - PUSH_DATA (push, 0x8204020c); | ||
1260 | - PUSH_DATA (push, 0x82010200); | ||
1261 | - PUSH_DATA (push, 0x82020204); | ||
1262 | + PUSH_DATA (push, 0x80000000); /* interp $r0 v[0x0] */ | ||
1263 | + PUSH_DATA (push, 0x90000004); /* rcp f32 $r1 $r0 */ | ||
1264 | + PUSH_DATA (push, 0x82030208); /* interp $r2 v[0xc] $r1 */ | ||
1265 | + PUSH_DATA (push, 0x8204020c); /* interp $r3 v[0x10] $r1 */ | ||
1266 | + PUSH_DATA (push, 0x82010200); /* interp $r0 v[0x4] $r1 */ | ||
1267 | + PUSH_DATA (push, 0x82020204); /* interp $r1 v[0x8] $r1 */ | ||
1268 | PUSH_DATA (push, 0xf0400001); | ||
1269 | - PUSH_DATA (push, 0x00008784); | ||
1270 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1271 | PUSH_DATA (push, 0xf0400209); | ||
1272 | - PUSH_DATA (push, 0x00008784); | ||
1273 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r2 $t1 $s0 $r2:$r3 0x0 0x0 0x0 */ | ||
1274 | PUSH_DATA (push, 0xc002000d); | ||
1275 | - PUSH_DATA (push, 0x00000780); | ||
1276 | - PUSH_DATA (push, 0x10008600); | ||
1277 | - PUSH_DATA (push, 0x10008604); | ||
1278 | + PUSH_DATA (push, 0x00000780); /* mul rn f32 $r3 $r0 $r2 */ | ||
1279 | + PUSH_DATA (push, 0x10008600); /* mov b32 $r0 $r3 */ | ||
1280 | + PUSH_DATA (push, 0x10008604); /* mov b32 $r1 $r3 */ | ||
1281 | PUSH_DATA (push, 0x10000609); | ||
1282 | - PUSH_DATA (push, 0x0403c781); | ||
1283 | + PUSH_DATA (push, 0x0403c781); /* exit mov b32 $r2 $r3 */ | ||
1284 | PUSH_DATAu(push, pNv->scratch, PFP_OFFSET + PFP_NV12, 24); | ||
1285 | - PUSH_DATA (push, 0x80000008); | ||
1286 | - PUSH_DATA (push, 0x90000408); | ||
1287 | - PUSH_DATA (push, 0x82010400); | ||
1288 | - PUSH_DATA (push, 0x82020404); | ||
1289 | + PUSH_DATA (push, 0x80000008); /* interp $r2 v[0x0] */ | ||
1290 | + PUSH_DATA (push, 0x90000408); /* rcp f32 $r2 $r2 */ | ||
1291 | + PUSH_DATA (push, 0x82010400); /* interp $r0 v[0x4] $r2 */ | ||
1292 | + PUSH_DATA (push, 0x82020404); /* interp $r1 v[0x8] $r2 */ | ||
1293 | PUSH_DATA (push, 0xf0400001); | ||
1294 | - PUSH_DATA (push, 0x00008784); | ||
1295 | - PUSH_DATA (push, 0xc0800014); | ||
1296 | - PUSH_DATA (push, 0xb0810a0c); | ||
1297 | - PUSH_DATA (push, 0xb0820a10); | ||
1298 | - PUSH_DATA (push, 0xb0830a14); | ||
1299 | - PUSH_DATA (push, 0x82010400); | ||
1300 | - PUSH_DATA (push, 0x82020404); | ||
1301 | + PUSH_DATA (push, 0x00008784); /* texauto live #:#:#:$r0 $t0 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1302 | + PUSH_DATA (push, 0xc0800014); /* mul f32 $r5 $r0 c0[0x0] */ | ||
1303 | + PUSH_DATA (push, 0xb0810a0c); /* add f32 $r3 $r5 c0[0x4] */ | ||
1304 | + PUSH_DATA (push, 0xb0820a10); /* add f32 $r4 $r5 c0[0x8] */ | ||
1305 | + PUSH_DATA (push, 0xb0830a14); /* add f32 $r5 $r5 c0[0xc] */ | ||
1306 | + PUSH_DATA (push, 0x82010400); /* interp $r0 v[0x4] $r2 */ | ||
1307 | + PUSH_DATA (push, 0x82020404); /* interp $r1 v[0x8] $r2 */ | ||
1308 | PUSH_DATA (push, 0xf0400201); | ||
1309 | - PUSH_DATA (push, 0x0000c784); | ||
1310 | - PUSH_DATA (push, 0xe084000c); | ||
1311 | - PUSH_DATA (push, 0xe0850010); | ||
1312 | + PUSH_DATA (push, 0x0000c784); /* texauto live #:#:$r0:$r1 $t1 $s0 $r0:$r1 0x0 0x0 0x0 */ | ||
1313 | + PUSH_DATA (push, 0xe084000c); /* add f32 $r3 (mul $r0 c0[0x10]) $r3 */ | ||
1314 | + PUSH_DATA (push, 0xe0850010); /* add f32 $r4 (mul $r0 c0[0x14]) $r4 */ | ||
1315 | PUSH_DATA (push, 0xe0860015); | ||
1316 | - PUSH_DATA (push, 0x00014780); | ||
1317 | + PUSH_DATA (push, 0x00014780); /* add f32 $r5 (mul $r0 c0[0x18]) $r5 */ | ||
1318 | PUSH_DATA (push, 0xe0870201); | ||
1319 | - PUSH_DATA (push, 0x0000c780); | ||
1320 | + PUSH_DATA (push, 0x0000c780); /* add f32 $r0 (mul $r1 c0[0x1c]) $r3 */ | ||
1321 | PUSH_DATA (push, 0xe0890209); | ||
1322 | - PUSH_DATA (push, 0x00014780); | ||
1323 | + PUSH_DATA (push, 0x00014780); /* add f32 $r2 (mul $r1 c0[0x24]) $r5 */ | ||
1324 | PUSH_DATA (push, 0xe0880205); | ||
1325 | - PUSH_DATA (push, 0x00010781); | ||
1326 | + PUSH_DATA (push, 0x00010781); /* exit add f32 $r1 (mul $r1 c0[0x20]) $r4 */ | ||
1327 | |||
1328 | /* HPOS.xy = ($o0, $o1), HPOS.zw = (0.0, 1.0), then map $o2 - $o5 */ | ||
1329 | BEGIN_NV04(push, NV50_3D(VP_RESULT_MAP(0)), 2); | ||
1330 | @@ -454,4 +456,3 @@ NVAccelInitNV50TCL(ScrnInfoPtr pScrn) | ||
1331 | |||
1332 | return TRUE; | ||
1333 | } | ||
1334 | - | ||
1335 | diff --git a/src/nv50_accel.h b/src/nv50_accel.h | ||
1336 | index 87c88a3..9b06e38 100644 | ||
1337 | --- a/src/nv50_accel.h | ||
1338 | +++ b/src/nv50_accel.h | ||
1339 | @@ -8,6 +8,7 @@ | ||
1340 | #include "hwdefs/nv50_texture.h" | ||
1341 | #include "hwdefs/nv_3ddefs.xml.h" | ||
1342 | #include "hwdefs/nv_m2mf.xml.h" | ||
1343 | +#include "hwdefs/nv_object.xml.h" | ||
1344 | |||
1345 | /* subchannel assignments - graphics channel */ | ||
1346 | #define SUBC_M2MF(mthd) 0, (mthd) | ||
1347 | diff --git a/src/nv50_exa.c b/src/nv50_exa.c | ||
1348 | index 7b12985..221160d 100644 | ||
1349 | --- a/src/nv50_exa.c | ||
1350 | +++ b/src/nv50_exa.c | ||
1351 | @@ -286,9 +286,9 @@ NV50EXACopy(PixmapPtr pdpix, int srcX , int srcY, | ||
1352 | if (!PUSH_SPACE(push, 32)) | ||
1353 | return; | ||
1354 | |||
1355 | - BEGIN_NV04(push, SUBC_2D(0x0110), 1); | ||
1356 | + BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); | ||
1357 | PUSH_DATA (push, 0); | ||
1358 | - BEGIN_NV04(push, SUBC_2D(0x088c), 1); | ||
1359 | + BEGIN_NV04(push, NV50_2D(BLIT_CONTROL), 1); | ||
1360 | PUSH_DATA (push, 0); | ||
1361 | BEGIN_NV04(push, NV50_2D(BLIT_DST_X), 12); | ||
1362 | PUSH_DATA (push, dstX); | ||
1363 | @@ -837,7 +837,7 @@ NV50EXAPrepareComposite(int op, | ||
1364 | PUSH_RESET(push); | ||
1365 | PUSH_REFN (push, pNv->scratch, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR); | ||
1366 | |||
1367 | - BEGIN_NV04(push, SUBC_2D(0x0110), 1); | ||
1368 | + BEGIN_NV04(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); | ||
1369 | PUSH_DATA (push, 0); | ||
1370 | |||
1371 | if (!NV50EXARenderTarget(pdpix, pdpict)) | ||
1372 | @@ -875,7 +875,7 @@ NV50EXAPrepareComposite(int op, | ||
1373 | PUSH_DATA (push, PFP_S); | ||
1374 | } | ||
1375 | |||
1376 | - BEGIN_NV04(push, SUBC_3D(0x1334), 1); | ||
1377 | + BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1); | ||
1378 | PUSH_DATA (push, 0); | ||
1379 | |||
1380 | BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1); | ||
1381 | diff --git a/src/nv50_xv.c b/src/nv50_xv.c | ||
1382 | index 909074a..b2541b9 100644 | ||
1383 | --- a/src/nv50_xv.c | ||
1384 | +++ b/src/nv50_xv.c | ||
1385 | @@ -206,7 +206,7 @@ nv50_xv_image_put(ScrnInfoPtr pScrn, | ||
1386 | BEGIN_NV04(push, NV50_3D(FP_START_ID), 1); | ||
1387 | PUSH_DATA (push, PFP_NV12); | ||
1388 | |||
1389 | - BEGIN_NV04(push, SUBC_3D(0x1334), 1); | ||
1390 | + BEGIN_NV04(push, NV50_3D(TIC_FLUSH), 1); | ||
1391 | PUSH_DATA (push, 0); | ||
1392 | |||
1393 | BEGIN_NV04(push, NV50_3D(BIND_TIC(2)), 1); | ||
1394 | @@ -364,6 +364,7 @@ nv50_xv_set_port_defaults(ScrnInfoPtr pScrn, NVPortPrivPtr pPriv) | ||
1395 | pPriv->saturation = 0; | ||
1396 | pPriv->hue = 0; | ||
1397 | pPriv->iturbt_709 = 0; | ||
1398 | + pPriv->max_image_dim = 8192; | ||
1399 | } | ||
1400 | |||
1401 | int | ||
1402 | diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c | ||
1403 | index 4484c1c..9361ce8 100644 | ||
1404 | --- a/src/nv_accel_common.c | ||
1405 | +++ b/src/nv_accel_common.c | ||
1406 | @@ -48,22 +48,15 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp, | ||
1407 | if (bpp >= 8) | ||
1408 | flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM; | ||
1409 | |||
1410 | + if (scanout && pNv->tiled_scanout) | ||
1411 | + tiled = TRUE; | ||
1412 | + | ||
1413 | if (pNv->Architecture >= NV_TESLA) { | ||
1414 | - if (scanout) { | ||
1415 | - if (pNv->tiled_scanout) { | ||
1416 | - tiled = TRUE; | ||
1417 | - *pitch = NOUVEAU_ALIGN(width * cpp, 64); | ||
1418 | - } else { | ||
1419 | - *pitch = NOUVEAU_ALIGN(width * cpp, 256); | ||
1420 | - } | ||
1421 | - } else { | ||
1422 | - if (bpp >= 8 && !shared) | ||
1423 | - tiled = TRUE; | ||
1424 | - *pitch = NOUVEAU_ALIGN(width * cpp, shared ? 256 : 64); | ||
1425 | - } | ||
1426 | - } else { | ||
1427 | - if (scanout && pNv->tiled_scanout) | ||
1428 | + if (!scanout && bpp >= 8 && !shared) | ||
1429 | tiled = TRUE; | ||
1430 | + | ||
1431 | + *pitch = NOUVEAU_ALIGN(width * cpp, !tiled ? 256 : 64); | ||
1432 | + } else { | ||
1433 | *pitch = NOUVEAU_ALIGN(width * cpp, 64); | ||
1434 | } | ||
1435 | |||
1436 | @@ -152,13 +145,13 @@ NV11SyncToVBlank(PixmapPtr ppix, BoxPtr box) | ||
1437 | |||
1438 | head = drmmode_head(crtc); | ||
1439 | |||
1440 | - BEGIN_NV04(push, SUBC_BLIT(0x0000012C), 1); | ||
1441 | + BEGIN_NV04(push, NV15_BLIT(FLIP_INCR_WRITE), 1); | ||
1442 | PUSH_DATA (push, 0); | ||
1443 | - BEGIN_NV04(push, SUBC_BLIT(0x00000134), 1); | ||
1444 | + BEGIN_NV04(push, NV15_BLIT(FLIP_CRTC_INCR_READ), 1); | ||
1445 | PUSH_DATA (push, head); | ||
1446 | BEGIN_NV04(push, SUBC_BLIT(0x00000100), 1); | ||
1447 | PUSH_DATA (push, 0); | ||
1448 | - BEGIN_NV04(push, SUBC_BLIT(0x00000130), 1); | ||
1449 | + BEGIN_NV04(push, NV15_BLIT(FLIP_WAIT), 1); | ||
1450 | PUSH_DATA (push, 0); | ||
1451 | } | ||
1452 | |||
1453 | diff --git a/src/nv_const.h b/src/nv_const.h | ||
1454 | index f1b4e9b..3f18d23 100644 | ||
1455 | --- a/src/nv_const.h | ||
1456 | +++ b/src/nv_const.h | ||
1457 | @@ -18,6 +18,7 @@ typedef enum { | ||
1458 | OPTION_SWAP_LIMIT, | ||
1459 | OPTION_ASYNC_COPY, | ||
1460 | OPTION_ACCELMETHOD, | ||
1461 | + OPTION_DRI, | ||
1462 | } NVOpts; | ||
1463 | |||
1464 | |||
1465 | @@ -34,6 +35,7 @@ static const OptionInfoRec NVOptions[] = { | ||
1466 | { OPTION_SWAP_LIMIT, "SwapLimit", OPTV_INTEGER, {0}, FALSE }, | ||
1467 | { OPTION_ASYNC_COPY, "AsyncUTSDFS", OPTV_BOOLEAN, {0}, FALSE }, | ||
1468 | { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE }, | ||
1469 | + { OPTION_DRI, "DRI", OPTV_INTEGER, {0}, FALSE }, | ||
1470 | { -1, NULL, OPTV_NONE, {0}, FALSE } | ||
1471 | }; | ||
1472 | |||
1473 | diff --git a/src/nv_driver.c b/src/nv_driver.c | ||
1474 | index 4bad985..4dde8e0 100644 | ||
1475 | --- a/src/nv_driver.c | ||
1476 | +++ b/src/nv_driver.c | ||
1477 | @@ -21,6 +21,7 @@ | ||
1478 | */ | ||
1479 | |||
1480 | #include <stdio.h> | ||
1481 | +#include <fcntl.h> | ||
1482 | |||
1483 | #include "nv_include.h" | ||
1484 | |||
1485 | @@ -33,7 +34,6 @@ | ||
1486 | #endif | ||
1487 | |||
1488 | #include "nouveau_copy.h" | ||
1489 | -#include "nouveau_glamor.h" | ||
1490 | #include "nouveau_present.h" | ||
1491 | #include "nouveau_sync.h" | ||
1492 | |||
1493 | @@ -299,21 +299,21 @@ NVOpenNouveauDevice(struct pci_device *pci_dev, | ||
1494 | char *busid; | ||
1495 | int ret, fd = -1; | ||
1496 | |||
1497 | +#ifdef ODEV_ATTRIB_PATH | ||
1498 | + if (platform_dev) | ||
1499 | + busid = NULL; | ||
1500 | + else | ||
1501 | +#endif | ||
1502 | + { | ||
1503 | #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0) | ||
1504 | - XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d", | ||
1505 | - pci_dev->domain, pci_dev->bus, pci_dev->dev, pci_dev->func); | ||
1506 | + XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d", | ||
1507 | + pci_dev->domain, pci_dev->bus, | ||
1508 | + pci_dev->dev, pci_dev->func); | ||
1509 | #else | ||
1510 | - busid = XNFprintf("pci:%04x:%02x:%02x.%d", | ||
1511 | - pci_dev->domain, pci_dev->bus, pci_dev->dev, pci_dev->func); | ||
1512 | + busid = XNFprintf("pci:%04x:%02x:%02x.%d", | ||
1513 | + pci_dev->domain, pci_dev->bus, | ||
1514 | + pci_dev->dev, pci_dev->func); | ||
1515 | #endif | ||
1516 | - | ||
1517 | - if (probe) { | ||
1518 | - ret = drmCheckModesettingSupported(busid); | ||
1519 | - if (ret) { | ||
1520 | - xf86DrvMsg(scrnIndex, X_ERROR, "[drm] KMS not enabled\n"); | ||
1521 | - free(busid); | ||
1522 | - return NULL; | ||
1523 | - } | ||
1524 | } | ||
1525 | |||
1526 | #if defined(ODEV_ATTRIB_FD) | ||
1527 | @@ -323,6 +323,19 @@ NVOpenNouveauDevice(struct pci_device *pci_dev, | ||
1528 | #endif | ||
1529 | if (fd != -1) | ||
1530 | ret = nouveau_device_wrap(fd, 0, &dev); | ||
1531 | +#ifdef ODEV_ATTRIB_PATH | ||
1532 | + else if (platform_dev) { | ||
1533 | + const char *path; | ||
1534 | + | ||
1535 | + path = xf86_get_platform_device_attrib(platform_dev, | ||
1536 | + ODEV_ATTRIB_PATH); | ||
1537 | + | ||
1538 | + fd = open(path, O_RDWR | O_CLOEXEC); | ||
1539 | + ret = nouveau_device_wrap(fd, 1, &dev); | ||
1540 | + if (ret) | ||
1541 | + close(fd); | ||
1542 | + } | ||
1543 | +#endif | ||
1544 | else | ||
1545 | ret = nouveau_device_open(busid, &dev); | ||
1546 | if (ret) | ||
1547 | @@ -376,10 +389,9 @@ NVHasKMS(struct pci_device *pci_dev, struct xf86_platform_device *platform_dev) | ||
1548 | case 0xe0: | ||
1549 | case 0xf0: | ||
1550 | case 0x100: | ||
1551 | - case 0x110: | ||
1552 | break; | ||
1553 | default: | ||
1554 | - xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02x\n", chipset); | ||
1555 | + xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset); | ||
1556 | return FALSE; | ||
1557 | } | ||
1558 | return TRUE; | ||
1559 | @@ -417,9 +429,6 @@ NVPlatformProbe(DriverPtr driver, | ||
1560 | ScrnInfoPtr scrn = NULL; | ||
1561 | uint32_t scr_flags = 0; | ||
1562 | |||
1563 | - if (!dev->pdev) | ||
1564 | - return FALSE; | ||
1565 | - | ||
1566 | if (!NVHasKMS(dev->pdev, dev)) | ||
1567 | return FALSE; | ||
1568 | |||
1569 | @@ -546,7 +555,11 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) | ||
1570 | PixmapRegionInit(&pixregion, dirty->slave_dst); | ||
1571 | |||
1572 | DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); | ||
1573 | +#ifdef HAS_DIRTYTRACKING_ROTATION | ||
1574 | + PixmapSyncDirtyHelper(dirty); | ||
1575 | +#else | ||
1576 | PixmapSyncDirtyHelper(dirty, &pixregion); | ||
1577 | +#endif | ||
1578 | |||
1579 | DamageRegionProcessPending(&dirty->slave_dst->drawable); | ||
1580 | RegionUninit(&pixregion); | ||
1581 | @@ -610,9 +623,6 @@ NVCreateScreenResources(ScreenPtr pScreen) | ||
1582 | if (pNv->AccelMethod == EXA) { | ||
1583 | PixmapPtr ppix = pScreen->GetScreenPixmap(pScreen); | ||
1584 | nouveau_bo_ref(pNv->scanout, &nouveau_pixmap(ppix)->bo); | ||
1585 | - } else | ||
1586 | - if (pNv->AccelMethod == GLAMOR) { | ||
1587 | - nouveau_glamor_create_screen_resources(pScreen); | ||
1588 | } | ||
1589 | |||
1590 | return TRUE; | ||
1591 | @@ -721,6 +731,7 @@ NVCloseDRM(ScrnInfoPtr pScrn) | ||
1592 | drmFree(pNv->drm_device_name); | ||
1593 | nouveau_client_del(&pNv->client); | ||
1594 | nouveau_device_del(&pNv->dev); | ||
1595 | + free(pNv->render_node); | ||
1596 | } | ||
1597 | |||
1598 | static void | ||
1599 | @@ -1033,9 +1044,6 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) | ||
1600 | if (string) { | ||
1601 | if (!strcmp(string, "none")) pNv->AccelMethod = NONE; | ||
1602 | else if (!strcmp(string, "exa")) pNv->AccelMethod = EXA; | ||
1603 | -#ifdef HAVE_GLAMOR | ||
1604 | - else if (!strcmp(string, "glamor")) pNv->AccelMethod = GLAMOR; | ||
1605 | -#endif | ||
1606 | else { | ||
1607 | xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, | ||
1608 | "Invalid AccelMethod specified\n"); | ||
1609 | @@ -1043,12 +1051,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) | ||
1610 | } | ||
1611 | |||
1612 | if (pNv->AccelMethod == UNKNOWN) { | ||
1613 | -#ifdef HAVE_GLAMOR | ||
1614 | - if (pNv->Architecture >= NV_MAXWELL) | ||
1615 | - pNv->AccelMethod = GLAMOR; | ||
1616 | - else | ||
1617 | -#endif | ||
1618 | - pNv->AccelMethod = EXA; | ||
1619 | + pNv->AccelMethod = EXA; | ||
1620 | } | ||
1621 | |||
1622 | if (xf86ReturnOptValBool(pNv->Options, OPTION_NOACCEL, FALSE)) { | ||
1623 | @@ -1071,14 +1074,27 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) | ||
1624 | pNv->tiled_scanout = TRUE; | ||
1625 | } | ||
1626 | |||
1627 | - if (pNv->AccelMethod == GLAMOR) { | ||
1628 | - if (!nouveau_glamor_pre_init(pScrn)) | ||
1629 | - pNv->AccelMethod = EXA; | ||
1630 | - } | ||
1631 | - | ||
1632 | pNv->ce_enabled = | ||
1633 | xf86ReturnOptValBool(pNv->Options, OPTION_ASYNC_COPY, FALSE); | ||
1634 | |||
1635 | + /* Define maximum allowed level of DRI implementation to use. | ||
1636 | + * We default to DRI2 on EXA for now, as DRI3 still has some | ||
1637 | + * problems. | ||
1638 | + */ | ||
1639 | + pNv->max_dri_level = 2; | ||
1640 | + from = X_DEFAULT; | ||
1641 | + | ||
1642 | + if (xf86GetOptValInteger(pNv->Options, OPTION_DRI, | ||
1643 | + &pNv->max_dri_level)) { | ||
1644 | + from = X_CONFIG; | ||
1645 | + if (pNv->max_dri_level < 2) | ||
1646 | + pNv->max_dri_level = 2; | ||
1647 | + if (pNv->max_dri_level > 3) | ||
1648 | + pNv->max_dri_level = 3; | ||
1649 | + } | ||
1650 | + xf86DrvMsg(pScrn->scrnIndex, from, "Allowed maximum DRI level %i.\n", | ||
1651 | + pNv->max_dri_level); | ||
1652 | + | ||
1653 | if (pNv->AccelMethod > NONE && pNv->dev->chipset >= 0x11) { | ||
1654 | from = X_DEFAULT; | ||
1655 | pNv->glx_vblank = TRUE; | ||
1656 | @@ -1351,9 +1367,6 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL) | ||
1657 | } | ||
1658 | |||
1659 | nouveau_copy_init(pScreen); | ||
1660 | - nouveau_sync_init(pScreen); | ||
1661 | - nouveau_dri2_init(pScreen); | ||
1662 | - nouveau_present_init(pScreen); | ||
1663 | |||
1664 | /* Allocate and map memory areas we need */ | ||
1665 | if (!NVMapMem(pScrn)) | ||
1666 | @@ -1461,11 +1474,20 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL) | ||
1667 | |||
1668 | xf86SetBlackWhitePixels(pScreen); | ||
1669 | |||
1670 | - if (pNv->AccelMethod == GLAMOR) { | ||
1671 | - if (!nouveau_glamor_init(pScreen)) | ||
1672 | - return FALSE; | ||
1673 | - } else | ||
1674 | + if (nouveau_present_init(pScreen)) | ||
1675 | + xf86DrvMsg(pScrn->scrnIndex, X_INFO, | ||
1676 | + "Hardware support for Present enabled\n"); | ||
1677 | + else | ||
1678 | + xf86DrvMsg(pScrn->scrnIndex, X_INFO, | ||
1679 | + "Hardware support for Present disabled\n"); | ||
1680 | + | ||
1681 | + nouveau_sync_init(pScreen); | ||
1682 | + nouveau_dri2_init(pScreen); | ||
1683 | if (pNv->AccelMethod == EXA) { | ||
1684 | + if (pNv->max_dri_level >= 3 && | ||
1685 | + !nouveau_dri3_screen_init(pScreen)) | ||
1686 | + return FALSE; | ||
1687 | + | ||
1688 | if (!nouveau_exa_init(pScreen)) | ||
1689 | return FALSE; | ||
1690 | } | ||
1691 | diff --git a/src/nv_proto.h b/src/nv_proto.h | ||
1692 | index cc4fd09..122ede5 100644 | ||
1693 | --- a/src/nv_proto.h | ||
1694 | +++ b/src/nv_proto.h | ||
1695 | @@ -36,6 +36,7 @@ Bool nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, | ||
1696 | /* in nouveau_dri2.c */ | ||
1697 | Bool nouveau_dri2_init(ScreenPtr pScreen); | ||
1698 | void nouveau_dri2_fini(ScreenPtr pScreen); | ||
1699 | +Bool nouveau_dri3_screen_init(ScreenPtr pScreen); | ||
1700 | |||
1701 | /* in nouveau_xv.c */ | ||
1702 | void NVInitVideo(ScreenPtr); | ||
1703 | diff --git a/src/nv_type.h b/src/nv_type.h | ||
1704 | index c0517c6..d7bb4f4 100644 | ||
1705 | --- a/src/nv_type.h | ||
1706 | +++ b/src/nv_type.h | ||
1707 | @@ -53,7 +53,6 @@ typedef struct _NVRec { | ||
1708 | UNKNOWN = 0, | ||
1709 | NONE, | ||
1710 | EXA, | ||
1711 | - GLAMOR, | ||
1712 | } AccelMethod; | ||
1713 | void (*Flush)(ScrnInfoPtr); | ||
1714 | |||
1715 | @@ -71,6 +70,7 @@ typedef struct _NVRec { | ||
1716 | Bool has_pageflip; | ||
1717 | int swap_limit; | ||
1718 | int max_swap_limit; | ||
1719 | + int max_dri_level; | ||
1720 | |||
1721 | ScreenBlockHandlerProcPtr BlockHandler; | ||
1722 | CreateScreenResourcesProcPtr CreateScreenResources; | ||
1723 | @@ -140,6 +140,8 @@ typedef struct _NVRec { | ||
1724 | PixmapPtr pspix, pmpix, pdpix; | ||
1725 | PicturePtr pspict, pmpict; | ||
1726 | Pixel fg_colour; | ||
1727 | + | ||
1728 | + char *render_node; | ||
1729 | } NVRec; | ||
1730 | |||
1731 | #define NVPTR(p) ((NVPtr)((p)->driverPrivate)) | ||
1732 | @@ -163,6 +165,7 @@ typedef struct _NVPortPrivRec { | ||
1733 | Bool texture; | ||
1734 | Bool bicubic; /* only for texture adapter */ | ||
1735 | Bool SyncToVBlank; | ||
1736 | + int max_image_dim; | ||
1737 | struct nouveau_bo *video_mem; | ||
1738 | int pitch; | ||
1739 | int offset; | ||
1740 | diff --git a/src/nvc0_accel.c b/src/nvc0_accel.c | ||
1741 | index c04e270..d2a3b93 100644 | ||
1742 | --- a/src/nvc0_accel.c | ||
1743 | +++ b/src/nvc0_accel.c | ||
1744 | @@ -180,9 +180,9 @@ NVAccelInit2D_NVC0(ScrnInfoPtr pScrn) | ||
1745 | PUSH_DATA (push, 1); | ||
1746 | BEGIN_NVC0(push, NV50_2D(COLOR_KEY_ENABLE), 1); | ||
1747 | PUSH_DATA (push, 0); | ||
1748 | - BEGIN_NVC0(push, SUBC_2D(0x0884), 1); | ||
1749 | + BEGIN_NVC0(push, NV50_2D(UNK0884), 1); | ||
1750 | PUSH_DATA (push, 0x3f); | ||
1751 | - BEGIN_NVC0(push, SUBC_2D(0x0888), 1); | ||
1752 | + BEGIN_NVC0(push, NV50_2D(UNK0888), 1); | ||
1753 | PUSH_DATA (push, 1); | ||
1754 | BEGIN_NVC0(push, NV50_2D(ROP), 1); | ||
1755 | PUSH_DATA (push, 0x55); | ||
1756 | @@ -217,8 +217,10 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn) | ||
1757 | if (pNv->Architecture < NV_KEPLER) { | ||
1758 | class = 0x9097; | ||
1759 | handle = 0x001f906e; | ||
1760 | - } else | ||
1761 | - if (pNv->dev->chipset < 0xf0) { | ||
1762 | + } else if (pNv->dev->chipset == 0xea) { | ||
1763 | + class = 0xa297; | ||
1764 | + handle = 0x0000906e; | ||
1765 | + } else if (pNv->dev->chipset < 0xf0) { | ||
1766 | class = 0xa097; | ||
1767 | handle = 0x0000906e; | ||
1768 | } else { | ||
1769 | @@ -323,7 +325,7 @@ NVAccelInit3D_NVC0(ScrnInfoPtr pScrn) | ||
1770 | BEGIN_NVC0(push, NVC0_3D(MEM_BARRIER), 1); | ||
1771 | PUSH_DATA (push, 0x1111); | ||
1772 | } else | ||
1773 | - if (pNv->dev->chipset < 0xf0) { | ||
1774 | + if (pNv->dev->chipset < 0xf0 && pNv->dev->chipset != 0xea) { | ||
1775 | NVC0PushProgram(pNv, PVP_PASS, NVE0VP_Transform2); | ||
1776 | NVC0PushProgram(pNv, PFP_S, NVE0FP_Source); | ||
1777 | NVC0PushProgram(pNv, PFP_C, NVE0FP_Composite); | ||
1778 | diff --git a/src/nvc0_exa.c b/src/nvc0_exa.c | ||
1779 | index 1f33353..7aa98cf 100644 | ||
1780 | --- a/src/nvc0_exa.c | ||
1781 | +++ b/src/nvc0_exa.c | ||
1782 | @@ -290,7 +290,7 @@ NVC0EXACopy(PixmapPtr pdpix, int srcX , int srcY, | ||
1783 | |||
1784 | BEGIN_NVC0(push, SUBC_2D(NV50_GRAPH_SERIALIZE), 1); | ||
1785 | PUSH_DATA (push, 0); | ||
1786 | - BEGIN_NVC0(push, SUBC_2D(0x088c), 1); | ||
1787 | + BEGIN_NVC0(push, NV50_2D(BLIT_CONTROL), 1); | ||
1788 | PUSH_DATA (push, 0); | ||
1789 | BEGIN_NVC0(push, NV50_2D(BLIT_DST_X), 12); | ||
1790 | PUSH_DATA (push, dstX); | ||
1791 | diff --git a/src/shader/Makefile b/src/shader/Makefile | ||
1792 | index 46658e9..2d789be 100644 | ||
1793 | --- a/src/shader/Makefile | ||
1794 | +++ b/src/shader/Makefile | ||
1795 | @@ -24,20 +24,21 @@ NVF0_SHADERS = xfrm2nvf0.vpc \ | ||
1796 | videonvf0.fpc | ||
1797 | |||
1798 | SHADERS = $(NVC0_SHADERS) $(NVE0_SHADERS) $(NVF0_SHADERS) | ||
1799 | +ENVYAS ?= envyas | ||
1800 | |||
1801 | all: $(SHADERS) | ||
1802 | |||
1803 | $(filter %nvc0.vpc,$(SHADERS)): %.vpc: %.vp | ||
1804 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m nvc0 -o $@ | ||
1805 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@ | ||
1806 | $(filter %nvc0.fpc,$(SHADERS)): %.fpc: %.fp | ||
1807 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m nvc0 -o $@ | ||
1808 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@ | ||
1809 | |||
1810 | $(filter %nve0.vpc,$(SHADERS)): %.vpc: %.vp | ||
1811 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m nvc0 -V nve4 -o $@ | ||
1812 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@ | ||
1813 | $(filter %nve0.fpc,$(SHADERS)): %.fpc: %.fp | ||
1814 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m nvc0 -V nve4 -o $@ | ||
1815 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o $@ | ||
1816 | |||
1817 | $(filter %nvf0.vpc,$(SHADERS)): %.vpc: %.vp | ||
1818 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m gk110 -o $@ | ||
1819 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@ | ||
1820 | $(filter %nvf0.fpc,$(SHADERS)): %.fpc: %.fp | ||
1821 | - cpp -DENVYAS $< | sed -e '/^#/d' | envyas -w -m gk110 -o $@ | ||
1822 | + cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@ | ||
1823 | diff --git a/src/shader/exac8nvf0.fp b/src/shader/exac8nvf0.fp | ||
1824 | index e4a7b04..f1c7fed 100644 | ||
1825 | --- a/src/shader/exac8nvf0.fp | ||
1826 | +++ b/src/shader/exac8nvf0.fp | ||
1827 | @@ -29,10 +29,10 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
1828 | rcp f32 $r0 $r0 | ||
1829 | interp mul f32 $r3 a[0x94] $r0 0x0 0x0 | ||
1830 | interp mul f32 $r2 a[0x90] $r0 0x0 0x0 | ||
1831 | -tex t lauto #:#:#:$r1 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1832 | +tex t lauto live dfp #:#:#:$r1 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1833 | interp mul f32 $r3 a[0x84] $r0 0x0 0x0 | ||
1834 | interp mul f32 $r2 a[0x80] $r0 0x0 0x0 | ||
1835 | -tex t lauto #:#:#:$r0 t2d c[0x0] xy__ $r2:$r3 0x0 | ||
1836 | +tex t lauto live dfp #:#:#:$r0 t2d c[0x0] xy__ $r2:$r3 0x0 | ||
1837 | texbar 0x0 | ||
1838 | mul ftz rn f32 $r3 $r0 $r1 | ||
1839 | mov b32 $r2 $r3 | ||
1840 | diff --git a/src/shader/exac8nvf0.fpc b/src/shader/exac8nvf0.fpc | ||
1841 | index 465cabf..7cfecb5 100644 | ||
1842 | --- a/src/shader/exac8nvf0.fpc | ||
1843 | +++ b/src/shader/exac8nvf0.fpc | ||
1844 | @@ -6,13 +6,13 @@ | ||
1845 | 0x74a3fc4a, | ||
1846 | 0x001ffc0a, | ||
1847 | 0x74a3fc48, | ||
1848 | -0x7f9c0805, | ||
1849 | +0xff9c0805, | ||
1850 | 0x600080a1, | ||
1851 | 0x001ffc0e, | ||
1852 | 0x74a3fc42, | ||
1853 | 0x001ffc0a, | ||
1854 | 0x74a3fc40, | ||
1855 | -0x7f9c0801, | ||
1856 | +0xff9c0801, | ||
1857 | 0x600000a1, | ||
1858 | 0x001c0002, | ||
1859 | 0x77000000, | ||
1860 | diff --git a/src/shader/exacanve0.fp b/src/shader/exacanve0.fp | ||
1861 | index edeb717..3928b6d 100644 | ||
1862 | --- a/src/shader/exacanve0.fp | ||
1863 | +++ b/src/shader/exacanve0.fp | ||
1864 | @@ -30,7 +30,6 @@ rcp f32 $r0 $r0 | ||
1865 | interp mul f32 $r3 a[0x94] $r0 0x0 | ||
1866 | interp mul f32 $r2 a[0x90] $r0 0x0 | ||
1867 | tex t lauto live dfp $r4:$r5:$r6:$r7 t2d $t1 $s0 $r2:$r3 () | ||
1868 | -texbar 0x0 | ||
1869 | interp mul f32 $r1 a[0x84] $r0 0x0 | ||
1870 | interp mul f32 $r0 a[0x80] $r0 0x0 | ||
1871 | tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 () | ||
1872 | diff --git a/src/shader/exacanve0.fpc b/src/shader/exacanve0.fpc | ||
1873 | index a8320f0..fa96dae 100644 | ||
1874 | --- a/src/shader/exacanve0.fpc | ||
1875 | +++ b/src/shader/exacanve0.fpc | ||
1876 | @@ -8,8 +8,6 @@ | ||
1877 | 0xc07e0090, | ||
1878 | 0x00211e86, | ||
1879 | 0x8013c001, | ||
1880 | -0x00001de6, | ||
1881 | -0xf0000000, | ||
1882 | 0x03f05c40, | ||
1883 | 0xc07e0084, | ||
1884 | 0x03f01c40, | ||
1885 | diff --git a/src/shader/exacanvf0.fp b/src/shader/exacanvf0.fp | ||
1886 | index 338a1e1..dddc22e 100644 | ||
1887 | --- a/src/shader/exacanvf0.fp | ||
1888 | +++ b/src/shader/exacanvf0.fp | ||
1889 | @@ -29,11 +29,10 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
1890 | rcp f32 $r0 $r0 | ||
1891 | interp mul f32 $r3 a[0x94] $r0 0x0 0x0 | ||
1892 | interp mul f32 $r2 a[0x90] $r0 0x0 0x0 | ||
1893 | -tex t lauto $r4:$r5:$r6:$r7 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1894 | -texbar 0x0 | ||
1895 | +tex t lauto live dfp $r4:$r5:$r6:$r7 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1896 | interp mul f32 $r1 a[0x84] $r0 0x0 0x0 | ||
1897 | interp mul f32 $r0 a[0x80] $r0 0x0 0x0 | ||
1898 | -tex t lauto $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
1899 | +tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
1900 | texbar 0x0 | ||
1901 | mul ftz rn f32 $r3 $r3 $r7 | ||
1902 | mul ftz rn f32 $r2 $r2 $r6 | ||
1903 | diff --git a/src/shader/exacanvf0.fpc b/src/shader/exacanvf0.fpc | ||
1904 | index 70dd4b1..793f15c 100644 | ||
1905 | --- a/src/shader/exacanvf0.fpc | ||
1906 | +++ b/src/shader/exacanvf0.fpc | ||
1907 | @@ -6,15 +6,13 @@ | ||
1908 | 0x74a3fc4a, | ||
1909 | 0x001ffc0a, | ||
1910 | 0x74a3fc48, | ||
1911 | -0x7f9c0811, | ||
1912 | +0xff9c0811, | ||
1913 | 0x600080bd, | ||
1914 | -0x001c0002, | ||
1915 | -0x77000000, | ||
1916 | 0x001ffc06, | ||
1917 | 0x74a3fc42, | ||
1918 | 0x001ffc02, | ||
1919 | 0x74a3fc40, | ||
1920 | -0x7f9c0001, | ||
1921 | +0xff9c0001, | ||
1922 | 0x600000bd, | ||
1923 | 0x001c0002, | ||
1924 | 0x77000000, | ||
1925 | diff --git a/src/shader/exacmnve0.fp b/src/shader/exacmnve0.fp | ||
1926 | index 09d22c1..71895f4 100644 | ||
1927 | --- a/src/shader/exacmnve0.fp | ||
1928 | +++ b/src/shader/exacmnve0.fp | ||
1929 | @@ -30,7 +30,6 @@ rcp f32 $r0 $r0 | ||
1930 | interp mul f32 $r3 a[0x94] $r0 0x0 | ||
1931 | interp mul f32 $r2 a[0x90] $r0 0x0 | ||
1932 | tex t lauto live dfp #:#:#:$r4 t2d $t1 $s0 $r2:$r3 () | ||
1933 | -texbar 0x0 | ||
1934 | interp mul f32 $r1 a[0x84] $r0 0x0 | ||
1935 | interp mul f32 $r0 a[0x80] $r0 0x0 | ||
1936 | tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t0 $s0 $r0:$r1 () | ||
1937 | diff --git a/src/shader/exacmnve0.fpc b/src/shader/exacmnve0.fpc | ||
1938 | index 5c2d4bf..2c256b1 100644 | ||
1939 | --- a/src/shader/exacmnve0.fpc | ||
1940 | +++ b/src/shader/exacmnve0.fpc | ||
1941 | @@ -8,8 +8,6 @@ | ||
1942 | 0xc07e0090, | ||
1943 | 0x00211e86, | ||
1944 | 0x80120001, | ||
1945 | -0x00001de6, | ||
1946 | -0xf0000000, | ||
1947 | 0x03f05c40, | ||
1948 | 0xc07e0084, | ||
1949 | 0x03f01c40, | ||
1950 | diff --git a/src/shader/exacmnvf0.fp b/src/shader/exacmnvf0.fp | ||
1951 | index 787b4f5..e52b7bd 100644 | ||
1952 | --- a/src/shader/exacmnvf0.fp | ||
1953 | +++ b/src/shader/exacmnvf0.fp | ||
1954 | @@ -29,11 +29,10 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
1955 | rcp f32 $r0 $r0 | ||
1956 | interp mul f32 $r3 a[0x94] $r0 0x0 0x0 | ||
1957 | interp mul f32 $r2 a[0x90] $r0 0x0 0x0 | ||
1958 | -tex t lauto #:#:#:$r4 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1959 | -texbar 0x0 | ||
1960 | +tex t lauto live dfp #:#:#:$r4 t2d c[0x4] xy__ $r2:$r3 0x0 | ||
1961 | interp mul f32 $r1 a[0x84] $r0 0x0 0x0 | ||
1962 | interp mul f32 $r0 a[0x80] $r0 0x0 0x0 | ||
1963 | -tex t lauto $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
1964 | +tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
1965 | texbar 0x0 | ||
1966 | mul ftz rn f32 $r3 $r3 $r4 | ||
1967 | mul ftz rn f32 $r2 $r2 $r4 | ||
1968 | diff --git a/src/shader/exacmnvf0.fpc b/src/shader/exacmnvf0.fpc | ||
1969 | index b2acf6f..4ec8a33 100644 | ||
1970 | --- a/src/shader/exacmnvf0.fpc | ||
1971 | +++ b/src/shader/exacmnvf0.fpc | ||
1972 | @@ -6,15 +6,13 @@ | ||
1973 | 0x74a3fc4a, | ||
1974 | 0x001ffc0a, | ||
1975 | 0x74a3fc48, | ||
1976 | -0x7f9c0811, | ||
1977 | +0xff9c0811, | ||
1978 | 0x600080a1, | ||
1979 | -0x001c0002, | ||
1980 | -0x77000000, | ||
1981 | 0x001ffc06, | ||
1982 | 0x74a3fc42, | ||
1983 | 0x001ffc02, | ||
1984 | 0x74a3fc40, | ||
1985 | -0x7f9c0001, | ||
1986 | +0xff9c0001, | ||
1987 | 0x600000bd, | ||
1988 | 0x001c0002, | ||
1989 | 0x77000000, | ||
1990 | diff --git a/src/shader/exas8nvf0.fp b/src/shader/exas8nvf0.fp | ||
1991 | index 3804b27..245262c 100644 | ||
1992 | --- a/src/shader/exas8nvf0.fp | ||
1993 | +++ b/src/shader/exas8nvf0.fp | ||
1994 | @@ -29,7 +29,7 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
1995 | rcp f32 $r0 $r0 | ||
1996 | interp mul f32 $r1 a[0x84] $r0 0x0 0x0 | ||
1997 | interp mul f32 $r0 a[0x80] $r0 0x0 0x0 | ||
1998 | -tex t lauto #:#:#:$r0 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
1999 | +tex t lauto live dfp #:#:#:$r0 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
2000 | texbar 0x0 | ||
2001 | mov b32 $r3 $r0 | ||
2002 | mov b32 $r2 $r0 | ||
2003 | diff --git a/src/shader/exas8nvf0.fpc b/src/shader/exas8nvf0.fpc | ||
2004 | index 4ec3bb7..a59ffe6 100644 | ||
2005 | --- a/src/shader/exas8nvf0.fpc | ||
2006 | +++ b/src/shader/exas8nvf0.fpc | ||
2007 | @@ -6,7 +6,7 @@ | ||
2008 | 0x74a3fc42, | ||
2009 | 0x001ffc02, | ||
2010 | 0x74a3fc40, | ||
2011 | -0x7f9c0001, | ||
2012 | +0xff9c0001, | ||
2013 | 0x600000a1, | ||
2014 | 0x001c0002, | ||
2015 | 0x77000000, | ||
2016 | diff --git a/src/shader/exasanve0.fp b/src/shader/exasanve0.fp | ||
2017 | index dea8eab..8ddcc4a 100644 | ||
2018 | --- a/src/shader/exasanve0.fp | ||
2019 | +++ b/src/shader/exasanve0.fp | ||
2020 | @@ -30,7 +30,6 @@ rcp f32 $r0 $r0 | ||
2021 | interp mul f32 $r3 a[0x84] $r0 0x0 | ||
2022 | interp mul f32 $r2 a[0x80] $r0 0x0 | ||
2023 | tex t lauto live dfp #:#:#:$r4 t2d $t0 $s0 $r2:$r3 () | ||
2024 | -texbar 0x0 | ||
2025 | interp mul f32 $r1 a[0x94] $r0 0x0 | ||
2026 | interp mul f32 $r0 a[0x90] $r0 0x0 | ||
2027 | tex t lauto live dfp $r0:$r1:$r2:$r3 t2d $t1 $s0 $r0:$r1 () | ||
2028 | diff --git a/src/shader/exasanve0.fpc b/src/shader/exasanve0.fpc | ||
2029 | index efc701e..170c5df 100644 | ||
2030 | --- a/src/shader/exasanve0.fpc | ||
2031 | +++ b/src/shader/exasanve0.fpc | ||
2032 | @@ -8,8 +8,6 @@ | ||
2033 | 0xc07e0080, | ||
2034 | 0x00211e86, | ||
2035 | 0x80120000, | ||
2036 | -0x00001de6, | ||
2037 | -0xf0000000, | ||
2038 | 0x03f05c40, | ||
2039 | 0xc07e0094, | ||
2040 | 0x03f01c40, | ||
2041 | diff --git a/src/shader/exasanvf0.fp b/src/shader/exasanvf0.fp | ||
2042 | index 8175f9b..c5c60a3 100644 | ||
2043 | --- a/src/shader/exasanvf0.fp | ||
2044 | +++ b/src/shader/exasanvf0.fp | ||
2045 | @@ -29,11 +29,10 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
2046 | rcp f32 $r0 $r0 | ||
2047 | interp mul f32 $r3 a[0x84] $r0 0x0 0x0 | ||
2048 | interp mul f32 $r2 a[0x80] $r0 0x0 0x0 | ||
2049 | -tex t lauto #:#:#:$r4 t2d c[0x0] xy__ $r2:$r3 0x0 | ||
2050 | -texbar 0x0 | ||
2051 | +tex t lauto live dfp #:#:#:$r4 t2d c[0x0] xy__ $r2:$r3 0x0 | ||
2052 | interp mul f32 $r1 a[0x94] $r0 0x0 0x0 | ||
2053 | interp mul f32 $r0 a[0x90] $r0 0x0 0x0 | ||
2054 | -tex t lauto $r0:$r1:$r2:$r3 t2d c[0x4] xy__ $r0:$r1 0x0 | ||
2055 | +tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x4] xy__ $r0:$r1 0x0 | ||
2056 | texbar 0x0 | ||
2057 | mul ftz rn f32 $r3 $r3 $r4 | ||
2058 | mul ftz rn f32 $r2 $r2 $r4 | ||
2059 | diff --git a/src/shader/exasanvf0.fpc b/src/shader/exasanvf0.fpc | ||
2060 | index 6e68d98..afddc84 100644 | ||
2061 | --- a/src/shader/exasanvf0.fpc | ||
2062 | +++ b/src/shader/exasanvf0.fpc | ||
2063 | @@ -6,15 +6,13 @@ | ||
2064 | 0x74a3fc42, | ||
2065 | 0x001ffc0a, | ||
2066 | 0x74a3fc40, | ||
2067 | -0x7f9c0811, | ||
2068 | +0xff9c0811, | ||
2069 | 0x600000a1, | ||
2070 | -0x001c0002, | ||
2071 | -0x77000000, | ||
2072 | 0x001ffc06, | ||
2073 | 0x74a3fc4a, | ||
2074 | 0x001ffc02, | ||
2075 | 0x74a3fc48, | ||
2076 | -0x7f9c0001, | ||
2077 | +0xff9c0001, | ||
2078 | 0x600080bd, | ||
2079 | 0x001c0002, | ||
2080 | 0x77000000, | ||
2081 | diff --git a/src/shader/exascnvf0.fp b/src/shader/exascnvf0.fp | ||
2082 | index e56c27f..447c67d 100644 | ||
2083 | --- a/src/shader/exascnvf0.fp | ||
2084 | +++ b/src/shader/exascnvf0.fp | ||
2085 | @@ -29,7 +29,7 @@ interp pass f32 $r0 a[0x7c] 0x0 0x0 0x0 | ||
2086 | rcp f32 $r0 $r0 | ||
2087 | interp mul f32 $r1 a[0x84] $r0 0x0 0x0 | ||
2088 | interp mul f32 $r0 a[0x80] $r0 0x0 0x0 | ||
2089 | -tex t lauto $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
2090 | +tex t lauto live dfp $r0:$r1:$r2:$r3 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
2091 | texbar 0x0 | ||
2092 | exit | ||
2093 | #endif | ||
2094 | diff --git a/src/shader/exascnvf0.fpc b/src/shader/exascnvf0.fpc | ||
2095 | index 53af859..5d2dce6 100644 | ||
2096 | --- a/src/shader/exascnvf0.fpc | ||
2097 | +++ b/src/shader/exascnvf0.fpc | ||
2098 | @@ -6,7 +6,7 @@ | ||
2099 | 0x74a3fc42, | ||
2100 | 0x001ffc02, | ||
2101 | 0x74a3fc40, | ||
2102 | -0x7f9c0001, | ||
2103 | +0xff9c0001, | ||
2104 | 0x600000bd, | ||
2105 | 0x001c0002, | ||
2106 | 0x77000000, | ||
2107 | diff --git a/src/shader/videonvf0.fp b/src/shader/videonvf0.fp | ||
2108 | index a684203..3612dcd 100644 | ||
2109 | --- a/src/shader/videonvf0.fp | ||
2110 | +++ b/src/shader/videonvf0.fp | ||
2111 | @@ -29,8 +29,8 @@ interp pass f32 $r2 a[0x7c] 0x0 0x0 0x0 | ||
2112 | rcp f32 $r2 $r2 | ||
2113 | interp mul f32 $r0 a[0x80] $r2 0x0 0x0 | ||
2114 | interp mul f32 $r1 a[0x84] $r2 0x0 0x0 | ||
2115 | -tex t lauto #:#:#:$r4 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
2116 | -tex p lauto #:#:$r0:$r1 t2d c[0x4] xy__ $r0:$r1 0x0 | ||
2117 | +tex t lauto live dfp #:#:#:$r4 t2d c[0x0] xy__ $r0:$r1 0x0 | ||
2118 | +tex p lauto live dfp #:#:$r0:$r1 t2d c[0x4] xy__ $r0:$r1 0x0 | ||
2119 | texbar 0x1 | ||
2120 | mul ftz rn f32 $r5 $r4 c0[0x0] | ||
2121 | add ftz rn f32 $r3 $r5 c0[0x4] | ||
2122 | diff --git a/src/shader/videonvf0.fpc b/src/shader/videonvf0.fpc | ||
2123 | index c545967..a7e5e98 100644 | ||
2124 | --- a/src/shader/videonvf0.fpc | ||
2125 | +++ b/src/shader/videonvf0.fpc | ||
2126 | @@ -6,9 +6,9 @@ | ||
2127 | 0x74a3fc40, | ||
2128 | 0x011ffc06, | ||
2129 | 0x74a3fc42, | ||
2130 | -0x7f9c0011, | ||
2131 | +0xff9c0011, | ||
2132 | 0x600000a1, | ||
2133 | -0x7f9c0001, | ||
2134 | +0xff9c0001, | ||
2135 | 0x600080b2, | ||
2136 | 0x009c0002, | ||
2137 | 0x77000000, | ||