lkml.org 
[lkml]   [2021]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 41/86] drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0
    Date
    From: Ben Skeggs <bskeggs@redhat.com>

    [ 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 | 4 ++--
    drivers/gpu/drm/nouveau/dispnv50/disp.h | 2 +-
    drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c | 2 +-
    3 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
    index ee2b1e1199e09..daa79d39201f9 100644
    --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
    +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
    @@ -132,7 +132,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;
    @@ -167,7 +167,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,
    diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
    index 7c41b0599d1ac..284068fa6d007 100644
    --- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
    +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
    @@ -70,7 +70,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);
    diff --git a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
    index f7dbd965e4e72..b49a212af4d8d 100644
    --- a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
    +++ b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
    @@ -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);
    --
    2.27.0


    \
     
     \ /
      Last update: 2021-01-26 18:11    [W:4.512 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site