]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0
authorBen Skeggs <bskeggs@redhat.com>
Wed, 13 Jan 2021 07:12:52 +0000 (17:12 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 10:05:38 +0000 (11:05 +0100)
[ Upstream commit caeb6ab899c3d36a74cda6e299c6e1c9c4e2a22e ]

VRAM offset 0 is a valid address, triggered on GA102.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/nouveau/dispnv50/disp.h
drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c

index 1bb0a9f6fa7307a59d7d73b40ee917c8530622ec..fbe156302ee86b60ce568efef085ee4da0949ae4 100644 (file)
@@ -131,7 +131,7 @@ nv50_dmac_destroy(struct nv50_dmac *dmac)
 
 int
 nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
-                const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
+                const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
                 struct nv50_dmac *dmac)
 {
        struct nouveau_cli *cli = (void *)device->object.client;
@@ -166,7 +166,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
        if (ret)
                return ret;
 
-       if (!syncbuf)
+       if (syncbuf < 0)
                return 0;
 
        ret = nvif_object_init(&dmac->base.user, 0xf0000000, NV_DMA_IN_MEMORY,
index 66c125a6b0b3c34221bf8a36559fbca5290addd4..55205d23360c82000083bc57967da01b5f475429 100644 (file)
@@ -68,7 +68,7 @@ struct nv50_dmac {
 
 int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
                     const s32 *oclass, u8 head, void *data, u32 size,
-                    u64 syncbuf, struct nv50_dmac *dmac);
+                    s64 syncbuf, struct nv50_dmac *dmac);
 void nv50_dmac_destroy(struct nv50_dmac *);
 
 u32 *evo_wait(struct nv50_dmac *, int nr);
index f7dbd965e4e729ccd98b4e7ed153bba6a327f893..b49a212af4d8dbba8c134c66423aa5277e5b1721 100644 (file)
@@ -68,7 +68,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
        int ret;
 
        ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
-                              &oclass, 0, &args, sizeof(args), 0,
+                              &oclass, 0, &args, sizeof(args), -1,
                               &wndw->wimm);
        if (ret) {
                NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);