Commit ceb3b021 authored by Dave Airlie's avatar Dave Airlie

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
parents a3f28efa bbc63196
...@@ -104,11 +104,8 @@ nouveau_subdev_create_(struct nouveau_object *parent, ...@@ -104,11 +104,8 @@ nouveau_subdev_create_(struct nouveau_object *parent,
if (parent) { if (parent) {
struct nouveau_device *device = nv_device(parent); struct nouveau_device *device = nv_device(parent);
int subidx = nv_hclass(subdev) & 0xff;
subdev->debug = nouveau_dbgopt(device->dbgopt, subname); subdev->debug = nouveau_dbgopt(device->dbgopt, subname);
subdev->mmio = nv_subdev(device)->mmio; subdev->mmio = nv_subdev(device)->mmio;
device->subdev[subidx] = *pobject;
} }
return 0; return 0;
......
...@@ -268,6 +268,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -268,6 +268,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
if (ret) if (ret)
return ret; return ret;
device->subdev[i] = devobj->subdev[i];
/* note: can't init *any* subdevs until devinit has been run /* note: can't init *any* subdevs until devinit has been run
* due to not knowing exactly what the vbios init tables will * due to not knowing exactly what the vbios init tables will
* mess with. devinit also can't be run until all of its * mess with. devinit also can't be run until all of its
......
...@@ -161,7 +161,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -161,7 +161,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nvc0_devinit_oclass; device->oclass[NVDEV_SUBDEV_DEVINIT] = &nvc0_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass;
......
...@@ -334,7 +334,7 @@ nvc0_graph_mthd(struct nvc0_graph_priv *priv, struct nvc0_graph_mthd *mthds) ...@@ -334,7 +334,7 @@ nvc0_graph_mthd(struct nvc0_graph_priv *priv, struct nvc0_graph_mthd *mthds)
while ((mthd = &mthds[i++]) && (init = mthd->init)) { while ((mthd = &mthds[i++]) && (init = mthd->init)) {
u32 addr = 0x80000000 | mthd->oclass; u32 addr = 0x80000000 | mthd->oclass;
for (data = 0; init->count; init++) { for (data = 0; init->count; init++) {
if (data != init->data) { if (init == mthd->init || data != init->data) {
nv_wr32(priv, 0x40448c, init->data); nv_wr32(priv, 0x40448c, init->data);
data = init->data; data = init->data;
} }
......
...@@ -75,6 +75,11 @@ struct nouveau_fb { ...@@ -75,6 +75,11 @@ struct nouveau_fb {
static inline struct nouveau_fb * static inline struct nouveau_fb *
nouveau_fb(void *obj) nouveau_fb(void *obj)
{ {
/* fbram uses this before device subdev pointer is valid */
if (nv_iclass(obj, NV_SUBDEV_CLASS) &&
nv_subidx(obj) == NVDEV_SUBDEV_FB)
return obj;
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB]; return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
} }
......
...@@ -365,13 +365,13 @@ static u16 ...@@ -365,13 +365,13 @@ static u16
init_script(struct nouveau_bios *bios, int index) init_script(struct nouveau_bios *bios, int index)
{ {
struct nvbios_init init = { .bios = bios }; struct nvbios_init init = { .bios = bios };
u16 data; u16 bmp_ver = bmp_version(bios), data;
if (bmp_version(bios) && bmp_version(bios) < 0x0510) { if (bmp_ver && bmp_ver < 0x0510) {
if (index > 1) if (index > 1 || bmp_ver < 0x0100)
return 0x0000; return 0x0000;
data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18); data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18);
return nv_ro16(bios, data + (index * 2)); return nv_ro16(bios, data + (index * 2));
} }
...@@ -1294,7 +1294,11 @@ init_jump(struct nvbios_init *init) ...@@ -1294,7 +1294,11 @@ init_jump(struct nvbios_init *init)
u16 offset = nv_ro16(bios, init->offset + 1); u16 offset = nv_ro16(bios, init->offset + 1);
trace("JUMP\t0x%04x\n", offset); trace("JUMP\t0x%04x\n", offset);
init->offset = offset;
if (init_exec(init))
init->offset = offset;
else
init->offset += 3;
} }
/** /**
......
...@@ -447,6 +447,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) ...@@ -447,6 +447,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
if (ret) if (ret)
goto done; goto done;
info->offset = ntfy->node->offset;
done: done:
if (ret) if (ret)
nouveau_abi16_ntfy_fini(chan, ntfy); nouveau_abi16_ntfy_fini(chan, ntfy);
......
...@@ -610,7 +610,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -610,7 +610,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
ret = nouveau_fence_sync(fence, chan); ret = nouveau_fence_sync(fence, chan);
nouveau_fence_unref(&fence); nouveau_fence_unref(&fence);
if (ret) if (ret)
return ret; goto fail_free;
if (new_bo != old_bo) { if (new_bo != old_bo) {
ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM); ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment