Skip to content

Commit ceb3b02

Browse files
committed
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
2 parents a3f28ef + bbc6319 commit ceb3b02

File tree

8 files changed

+21
-11
lines changed

8 files changed

+21
-11
lines changed

drivers/gpu/drm/nouveau/core/core/subdev.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,8 @@ nouveau_subdev_create_(struct nouveau_object *parent,
104104

105105
if (parent) {
106106
struct nouveau_device *device = nv_device(parent);
107-
int subidx = nv_hclass(subdev) & 0xff;
108-
109107
subdev->debug = nouveau_dbgopt(device->dbgopt, subname);
110108
subdev->mmio = nv_subdev(device)->mmio;
111-
device->subdev[subidx] = *pobject;
112109
}
113110

114111
return 0;

drivers/gpu/drm/nouveau/core/engine/device/base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
268268
if (ret)
269269
return ret;
270270

271+
device->subdev[i] = devobj->subdev[i];
272+
271273
/* note: can't init *any* subdevs until devinit has been run
272274
* due to not knowing exactly what the vbios init tables will
273275
* mess with. devinit also can't be run until all of its

drivers/gpu/drm/nouveau/core/engine/device/nvc0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ nvc0_identify(struct nouveau_device *device)
161161
device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass;
162162
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
163163
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;
165165
device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
166166
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
167167
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass;

drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ nvc0_graph_mthd(struct nvc0_graph_priv *priv, struct nvc0_graph_mthd *mthds)
334334
while ((mthd = &mthds[i++]) && (init = mthd->init)) {
335335
u32 addr = 0x80000000 | mthd->oclass;
336336
for (data = 0; init->count; init++) {
337-
if (data != init->data) {
337+
if (init == mthd->init || data != init->data) {
338338
nv_wr32(priv, 0x40448c, init->data);
339339
data = init->data;
340340
}

drivers/gpu/drm/nouveau/core/include/subdev/fb.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ struct nouveau_fb {
7575
static inline struct nouveau_fb *
7676
nouveau_fb(void *obj)
7777
{
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+
7883
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
7984
}
8085

drivers/gpu/drm/nouveau/core/subdev/bios/init.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ static u16
365365
init_script(struct nouveau_bios *bios, int index)
366366
{
367367
struct nvbios_init init = { .bios = bios };
368-
u16 data;
368+
u16 bmp_ver = bmp_version(bios), data;
369369

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)
372372
return 0x0000;
373373

374-
data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18);
374+
data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18);
375375
return nv_ro16(bios, data + (index * 2));
376376
}
377377

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

12961296
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;
12981302
}
12991303

13001304
/**

drivers/gpu/drm/nouveau/nouveau_abi16.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
447447
if (ret)
448448
goto done;
449449

450+
info->offset = ntfy->node->offset;
451+
450452
done:
451453
if (ret)
452454
nouveau_abi16_ntfy_fini(chan, ntfy);

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
610610
ret = nouveau_fence_sync(fence, chan);
611611
nouveau_fence_unref(&fence);
612612
if (ret)
613-
return ret;
613+
goto fail_free;
614614

615615
if (new_bo != old_bo) {
616616
ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);

0 commit comments

Comments
 (0)