Skip to content

Commit

Permalink
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/nouv…
Browse files Browse the repository at this point in the history
…eau/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
  • Loading branch information
Dave Airlie committed Jan 8, 2014
2 parents a3f28ef + bbc6319 commit ceb3b02
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 11 deletions.
3 changes: 0 additions & 3 deletions drivers/gpu/drm/nouveau/core/core/subdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ nouveau_subdev_create_(struct nouveau_object *parent,

if (parent) {
struct nouveau_device *device = nv_device(parent);
int subidx = nv_hclass(subdev) & 0xff;

subdev->debug = nouveau_dbgopt(device->dbgopt, subname);
subdev->mmio = nv_subdev(device)->mmio;
device->subdev[subidx] = *pobject;
}

return 0;
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/core/engine/device/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
if (ret)
return ret;

device->subdev[i] = devobj->subdev[i];

/* note: can't init *any* subdevs until devinit has been run
* due to not knowing exactly what the vbios init tables will
* mess with. devinit also can't be run until all of its
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_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_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ nvc0_graph_mthd(struct nvc0_graph_priv *priv, struct nvc0_graph_mthd *mthds)
while ((mthd = &mthds[i++]) && (init = mthd->init)) {
u32 addr = 0x80000000 | mthd->oclass;
for (data = 0; init->count; init++) {
if (data != init->data) {
if (init == mthd->init || data != init->data) {
nv_wr32(priv, 0x40448c, init->data);
data = init->data;
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/nouveau/core/include/subdev/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ struct nouveau_fb {
static inline struct nouveau_fb *
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];
}

Expand Down
14 changes: 9 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/bios/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ static u16
init_script(struct nouveau_bios *bios, int index)
{
struct nvbios_init init = { .bios = bios };
u16 data;
u16 bmp_ver = bmp_version(bios), data;

if (bmp_version(bios) && bmp_version(bios) < 0x0510) {
if (index > 1)
if (bmp_ver && bmp_ver < 0x0510) {
if (index > 1 || bmp_ver < 0x0100)
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));
}

Expand Down Expand Up @@ -1294,7 +1294,11 @@ init_jump(struct nvbios_init *init)
u16 offset = nv_ro16(bios, init->offset + 1);

trace("JUMP\t0x%04x\n", offset);
init->offset = offset;

if (init_exec(init))
init->offset = offset;
else
init->offset += 3;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_abi16.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
if (ret)
goto done;

info->offset = ntfy->node->offset;

done:
if (ret)
nouveau_abi16_ntfy_fini(chan, ntfy);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
ret = nouveau_fence_sync(fence, chan);
nouveau_fence_unref(&fence);
if (ret)
return ret;
goto fail_free;

if (new_bo != old_bo) {
ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);
Expand Down

0 comments on commit ceb3b02

Please sign in to comment.