Skip to content

Commit c8f6364

Browse files
committed
Merge branch '04.00-ampere-lite-fixes' of git://github.com/skeggsb/linux into drm-fixes
As requested, here's a tree with the non-Ampere-specific fixes split out, as most of them are potentially relevant to already-supported GPUs. - irq handling fix - expansion ROM fix - hw init dpcd disable - aux semaphore owner field fix - vram heap sizing fix - notifier at 0 is valid fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Ben Skeggs <skeggsb@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv4P90mcF_ByAh+ghz+ZVD2N2bPbD7xHYYArE1kYrvsGcQ@mail.gmail.com
2 parents 8e10959 + caeb6ab commit c8f6364

17 files changed

Lines changed: 112 additions & 30 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);

drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ int g94_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9292
int gf117_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9393
int gf119_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9494
int gk104_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
95+
int gk110_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9596
int gm200_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9697

9798
static inline int

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ nvf0_chipset = {
18151815
.fb = gk110_fb_new,
18161816
.fuse = gf100_fuse_new,
18171817
.gpio = gk104_gpio_new,
1818-
.i2c = gk104_i2c_new,
1818+
.i2c = gk110_i2c_new,
18191819
.ibus = gk104_ibus_new,
18201820
.iccsense = gf100_iccsense_new,
18211821
.imem = nv50_instmem_new,
@@ -1853,7 +1853,7 @@ nvf1_chipset = {
18531853
.fb = gk110_fb_new,
18541854
.fuse = gf100_fuse_new,
18551855
.gpio = gk104_gpio_new,
1856-
.i2c = gk104_i2c_new,
1856+
.i2c = gk110_i2c_new,
18571857
.ibus = gk104_ibus_new,
18581858
.iccsense = gf100_iccsense_new,
18591859
.imem = nv50_instmem_new,
@@ -1891,7 +1891,7 @@ nv106_chipset = {
18911891
.fb = gk110_fb_new,
18921892
.fuse = gf100_fuse_new,
18931893
.gpio = gk104_gpio_new,
1894-
.i2c = gk104_i2c_new,
1894+
.i2c = gk110_i2c_new,
18951895
.ibus = gk104_ibus_new,
18961896
.iccsense = gf100_iccsense_new,
18971897
.imem = nv50_instmem_new,
@@ -1929,7 +1929,7 @@ nv108_chipset = {
19291929
.fb = gk110_fb_new,
19301930
.fuse = gf100_fuse_new,
19311931
.gpio = gk104_gpio_new,
1932-
.i2c = gk104_i2c_new,
1932+
.i2c = gk110_i2c_new,
19331933
.ibus = gk104_ibus_new,
19341934
.iccsense = gf100_iccsense_new,
19351935
.imem = nv50_instmem_new,
@@ -1967,7 +1967,7 @@ nv117_chipset = {
19671967
.fb = gm107_fb_new,
19681968
.fuse = gm107_fuse_new,
19691969
.gpio = gk104_gpio_new,
1970-
.i2c = gk104_i2c_new,
1970+
.i2c = gk110_i2c_new,
19711971
.ibus = gk104_ibus_new,
19721972
.iccsense = gf100_iccsense_new,
19731973
.imem = nv50_instmem_new,
@@ -2003,7 +2003,7 @@ nv118_chipset = {
20032003
.fb = gm107_fb_new,
20042004
.fuse = gm107_fuse_new,
20052005
.gpio = gk104_gpio_new,
2006-
.i2c = gk104_i2c_new,
2006+
.i2c = gk110_i2c_new,
20072007
.ibus = gk104_ibus_new,
20082008
.iccsense = gf100_iccsense_new,
20092009
.imem = nv50_instmem_new,

drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd)
7575
nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
7676
image.base, image.type, image.size);
7777

78-
if (!shadow_fetch(bios, mthd, image.size)) {
78+
if (!shadow_fetch(bios, mthd, image.base + image.size)) {
7979
nvkm_debug(subdev, "%08x: fetch failed\n", image.base);
8080
return 0;
8181
}

drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ nvkm-y += nvkm/subdev/i2c/g94.o
77
nvkm-y += nvkm/subdev/i2c/gf117.o
88
nvkm-y += nvkm/subdev/i2c/gf119.o
99
nvkm-y += nvkm/subdev/i2c/gk104.o
10+
nvkm-y += nvkm/subdev/i2c/gk110.o
1011
nvkm-y += nvkm/subdev/i2c/gm200.o
1112

1213
nvkm-y += nvkm/subdev/i2c/pad.o

drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
#define __NVKM_I2C_AUX_H__
44
#include "pad.h"
55

6+
static inline void
7+
nvkm_i2c_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
8+
{
9+
if (i2c->func->aux_autodpcd)
10+
i2c->func->aux_autodpcd(i2c, aux, false);
11+
}
12+
613
struct nvkm_i2c_aux_func {
714
bool address_only;
815
int (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,

drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
7777
u8 type, u32 addr, u8 *data, u8 *size)
7878
{
7979
struct g94_i2c_aux *aux = g94_i2c_aux(obj);
80-
struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+
struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+
struct nvkm_device *device = i2c->subdev.device;
8182
const u32 base = aux->ch * 0x50;
8283
u32 ctrl, stat, timeout, retries = 0;
8384
u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
9697
goto out;
9798
}
9899

100+
nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102
if (!(type & 1)) {
100103
memcpy(xbuf, data, *size);
101104
for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
128131
if (!timeout--) {
129132
AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133
ret = -EIO;
131-
goto out;
134+
goto out_err;
132135
}
133136
} while (ctrl & 0x00010000);
134137
ret = 0;
@@ -154,7 +157,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
154157
memcpy(data, xbuf, *size);
155158
*size = stat & 0x0000001f;
156159
}
157-
160+
out_err:
161+
nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158162
out:
159163
g94_i2c_aux_fini(aux);
160164
return ret < 0 ? ret : (stat & 0x000f0000) >> 16;

drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void
3333
gm200_i2c_aux_fini(struct gm200_i2c_aux *aux)
3434
{
3535
struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
36-
nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000);
36+
nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000);
3737
}
3838

3939
static int
@@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
5454
AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl);
5555
return -EBUSY;
5656
}
57-
} while (ctrl & 0x03010000);
57+
} while (ctrl & 0x07010000);
5858

5959
/* set some magic, and wait up to 1ms for it to appear */
60-
nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq);
60+
nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq);
6161
timeout = 1000;
6262
do {
6363
ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50));
@@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
6767
gm200_i2c_aux_fini(aux);
6868
return -EBUSY;
6969
}
70-
} while ((ctrl & 0x03000000) != urep);
70+
} while ((ctrl & 0x07000000) != urep);
7171

7272
return 0;
7373
}
@@ -77,7 +77,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
7777
u8 type, u32 addr, u8 *data, u8 *size)
7878
{
7979
struct gm200_i2c_aux *aux = gm200_i2c_aux(obj);
80-
struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+
struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+
struct nvkm_device *device = i2c->subdev.device;
8182
const u32 base = aux->ch * 0x50;
8283
u32 ctrl, stat, timeout, retries = 0;
8384
u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
9697
goto out;
9798
}
9899

100+
nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102
if (!(type & 1)) {
100103
memcpy(xbuf, data, *size);
101104
for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
128131
if (!timeout--) {
129132
AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133
ret = -EIO;
131-
goto out;
134+
goto out_err;
132135
}
133136
} while (ctrl & 0x00010000);
134137
ret = 0;
@@ -155,6 +158,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
155158
*size = stat & 0x0000001f;
156159
}
157160

161+
out_err:
162+
nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158163
out:
159164
gm200_i2c_aux_fini(aux);
160165
return ret < 0 ? ret : (stat & 0x000f0000) >> 16;

0 commit comments

Comments
 (0)