Skip to content

Commit caeb6ab

Browse files
author
Ben Skeggs
committed
drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0
VRAM offset 0 is a valid address, triggered on GA102. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent add4278 commit caeb6ab

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size)
222222

223223
int
224224
nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
225-
const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
225+
const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
226226
struct nv50_dmac *dmac)
227227
{
228228
struct nouveau_cli *cli = (void *)device->object.client;
@@ -271,7 +271,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
271271
if (ret)
272272
return ret;
273273

274-
if (!syncbuf)
274+
if (syncbuf < 0)
275275
return 0;
276276

277277
ret = nvif_object_ctor(&dmac->base.user, "kmsSyncCtxDma", NV50_DISP_HANDLE_SYNCBUF,

drivers/gpu/drm/nouveau/dispnv50/disp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct nv50_outp_atom {
9595

9696
int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
9797
const s32 *oclass, u8 head, void *data, u32 size,
98-
u64 syncbuf, struct nv50_dmac *dmac);
98+
s64 syncbuf, struct nv50_dmac *dmac);
9999
void nv50_dmac_destroy(struct nv50_dmac *);
100100

101101
/*

drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
7676
int ret;
7777

7878
ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
79-
&oclass, 0, &args, sizeof(args), 0,
79+
&oclass, 0, &args, sizeof(args), -1,
8080
&wndw->wimm);
8181
if (ret) {
8282
NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);

0 commit comments

Comments
 (0)