Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/nouveau/linux-2.6 into drm-fixes

misc fixes for nouveau, one more msi rearm, regression fix for old bioses
crash and leak fixes.

* 'drm-nouveau-next' of git://anongit.freedesktop.org/nouveau/linux-2.6:
drm/nouveau/nouveau: fix memory leak in nouveau_crtc_page_flip()
drm/nouveau/bios: fix offset calculation for BMPv1 bioses
drm/nouveau: return offset of allocated notifier
drm/nouveau/bios: make jump conditional
drm/nvce/mc: fix msi rearm on GF114
drm/nvc0/gr: fix mthd data submission
drm/nouveau: populate master subdev pointer only when fully constructed

+21 -11
-3
drivers/gpu/drm/nouveau/core/core/subdev.c
··· 104 104 105 105 if (parent) { 106 106 struct nouveau_device *device = nv_device(parent); 107 - int subidx = nv_hclass(subdev) & 0xff; 108 - 109 107 subdev->debug = nouveau_dbgopt(device->dbgopt, subname); 110 108 subdev->mmio = nv_subdev(device)->mmio; 111 - device->subdev[subidx] = *pobject; 112 109 } 113 110 114 111 return 0;
+2
drivers/gpu/drm/nouveau/core/engine/device/base.c
··· 268 268 if (ret) 269 269 return ret; 270 270 271 + device->subdev[i] = devobj->subdev[i]; 272 + 271 273 /* note: can't init *any* subdevs until devinit has been run 272 274 * due to not knowing exactly what the vbios init tables will 273 275 * mess with. devinit also can't be run until all of its
+1 -1
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
··· 161 161 device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass; 162 162 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; 163 163 device->oclass[NVDEV_SUBDEV_DEVINIT] = &nvc0_devinit_oclass; 164 - device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; 164 + device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass; 165 165 device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass; 166 166 device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; 167 167 device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass;
+1 -1
drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
··· 334 334 while ((mthd = &mthds[i++]) && (init = mthd->init)) { 335 335 u32 addr = 0x80000000 | mthd->oclass; 336 336 for (data = 0; init->count; init++) { 337 - if (data != init->data) { 337 + if (init == mthd->init || data != init->data) { 338 338 nv_wr32(priv, 0x40448c, init->data); 339 339 data = init->data; 340 340 }
+5
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
··· 75 75 static inline struct nouveau_fb * 76 76 nouveau_fb(void *obj) 77 77 { 78 + /* fbram uses this before device subdev pointer is valid */ 79 + if (nv_iclass(obj, NV_SUBDEV_CLASS) && 80 + nv_subidx(obj) == NVDEV_SUBDEV_FB) 81 + return obj; 82 + 78 83 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB]; 79 84 } 80 85
+9 -5
drivers/gpu/drm/nouveau/core/subdev/bios/init.c
··· 365 365 init_script(struct nouveau_bios *bios, int index) 366 366 { 367 367 struct nvbios_init init = { .bios = bios }; 368 - u16 data; 368 + u16 bmp_ver = bmp_version(bios), data; 369 369 370 - if (bmp_version(bios) && bmp_version(bios) < 0x0510) { 371 - if (index > 1) 370 + if (bmp_ver && bmp_ver < 0x0510) { 371 + if (index > 1 || bmp_ver < 0x0100) 372 372 return 0x0000; 373 373 374 - data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18); 374 + data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18); 375 375 return nv_ro16(bios, data + (index * 2)); 376 376 } 377 377 ··· 1294 1294 u16 offset = nv_ro16(bios, init->offset + 1); 1295 1295 1296 1296 trace("JUMP\t0x%04x\n", offset); 1297 - init->offset = offset; 1297 + 1298 + if (init_exec(init)) 1299 + init->offset = offset; 1300 + else 1301 + init->offset += 3; 1298 1302 } 1299 1303 1300 1304 /**
+2
drivers/gpu/drm/nouveau/nouveau_abi16.c
··· 447 447 if (ret) 448 448 goto done; 449 449 450 + info->offset = ntfy->node->offset; 451 + 450 452 done: 451 453 if (ret) 452 454 nouveau_abi16_ntfy_fini(chan, ntfy);
+1 -1
drivers/gpu/drm/nouveau/nouveau_display.c
··· 610 610 ret = nouveau_fence_sync(fence, chan); 611 611 nouveau_fence_unref(&fence); 612 612 if (ret) 613 - return ret; 613 + goto fail_free; 614 614 615 615 if (new_bo != old_bo) { 616 616 ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);