Skip to content

Commit 8c14f72

Browse files
committed
Merge branch 'linux-4.4' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes
Ben Skeggs wrote: A couple of regression fixes, some more boards whitelisted for a hw bug workaround, gr/ucode fixes for hangs a user is seeing. The changes look larger than they actually are due to the ucode binaries (*.fucN.h) being regenerated. * 'linux-4.4' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/volt/pwm/gk104: fix an off-by-one resulting in the voltage not being set drm/nouveau/nvif: allow userspace access to its own client object drm/nouveau/gr/gf100-: fix oops when calling zbc methods drm/nouveau/gr/gf117-: assume no PPC if NV_PGRAPH_GPC_GPM_PD_PES_TPC_ID_MASK is zero drm/nouveau/gr/gf117-: read NV_PGRAPH_GPC_GPM_PD_PES_TPC_ID_MASK from correct GPC drm/nouveau/gr/gf100-: split out per-gpc address calculation macro drm/nouveau/bios: return actual size of the buffer retrieved via _ROM drm/nouveau/instmem: protect instobj list with a spinlock drm/nouveau/pci: enable c800 magic for some unknown Samsung laptop drm/nouveau/pci: enable c800 magic for Clevo P157SM
2 parents 2f13716 + ef0e9f5 commit 8c14f72

File tree

16 files changed

+948
-917
lines changed

16 files changed

+948
-917
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ struct nvkm_instmem {
77
const struct nvkm_instmem_func *func;
88
struct nvkm_subdev subdev;
99

10+
spinlock_t lock;
1011
struct list_head list;
1112
u32 reserved;
1213

drivers/gpu/drm/nouveau/nouveau_acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios,
367367
return -ENODEV;
368368
}
369369
obj = (union acpi_object *)buffer.pointer;
370+
len = min(len, (int)obj->buffer.length);
370371
memcpy(bios+offset, obj->buffer.pointer, len);
371372
kfree(buffer.pointer);
372373
return len;

drivers/gpu/drm/nouveau/nouveau_drm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include <nvif/client.h>
4141
#include <nvif/device.h>
42+
#include <nvif/ioctl.h>
4243

4344
#include <drmP.h>
4445

@@ -65,9 +66,10 @@ struct nouveau_drm_tile {
6566
};
6667

6768
enum nouveau_drm_object_route {
68-
NVDRM_OBJECT_NVIF = 0,
69+
NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
6970
NVDRM_OBJECT_USIF,
7071
NVDRM_OBJECT_ABI16,
72+
NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
7173
};
7274

7375
enum nouveau_drm_notify_route {

drivers/gpu/drm/nouveau/nouveau_usif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
313313
if (nvif_unpack(argv->v0, 0, 0, true)) {
314314
/* block access to objects not created via this interface */
315315
owner = argv->v0.owner;
316-
argv->v0.owner = NVDRM_OBJECT_USIF;
316+
if (argv->v0.object == 0ULL)
317+
argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
318+
else
319+
argv->v0.owner = NVDRM_OBJECT_USIF;
317320
} else
318321
goto done;
319322

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ nvkm_device_pci_10de_0fe3[] = {
278278
{}
279279
};
280280

281+
static const struct nvkm_device_pci_vendor
282+
nvkm_device_pci_10de_0fe4[] = {
283+
{ 0x144d, 0xc740, NULL, { .War00C800_0 = true } },
284+
{}
285+
};
286+
281287
static const struct nvkm_device_pci_vendor
282288
nvkm_device_pci_10de_104b[] = {
283289
{ 0x1043, 0x844c, "GeForce GT 625" },
@@ -688,6 +694,12 @@ nvkm_device_pci_10de_1199[] = {
688694
{}
689695
};
690696

697+
static const struct nvkm_device_pci_vendor
698+
nvkm_device_pci_10de_11e0[] = {
699+
{ 0x1558, 0x5106, NULL, { .War00C800_0 = true } },
700+
{}
701+
};
702+
691703
static const struct nvkm_device_pci_vendor
692704
nvkm_device_pci_10de_11e3[] = {
693705
{ 0x17aa, 0x3683, "GeForce GTX 760A" },
@@ -1370,7 +1382,7 @@ nvkm_device_pci_10de[] = {
13701382
{ 0x0fe1, "GeForce GT 730M" },
13711383
{ 0x0fe2, "GeForce GT 745M" },
13721384
{ 0x0fe3, "GeForce GT 745M", nvkm_device_pci_10de_0fe3 },
1373-
{ 0x0fe4, "GeForce GT 750M" },
1385+
{ 0x0fe4, "GeForce GT 750M", nvkm_device_pci_10de_0fe4 },
13741386
{ 0x0fe9, "GeForce GT 750M" },
13751387
{ 0x0fea, "GeForce GT 755M" },
13761388
{ 0x0fec, "GeForce 710A" },
@@ -1485,7 +1497,7 @@ nvkm_device_pci_10de[] = {
14851497
{ 0x11c6, "GeForce GTX 650 Ti" },
14861498
{ 0x11c8, "GeForce GTX 650" },
14871499
{ 0x11cb, "GeForce GT 740" },
1488-
{ 0x11e0, "GeForce GTX 770M" },
1500+
{ 0x11e0, "GeForce GTX 770M", nvkm_device_pci_10de_11e0 },
14891501
{ 0x11e1, "GeForce GTX 765M" },
14901502
{ 0x11e2, "GeForce GTX 765M" },
14911503
{ 0x11e3, "GeForce GTX 760M", nvkm_device_pci_10de_11e3 },

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ gf117_grctx_generate_attrib(struct gf100_grctx *info)
207207
const u32 b = beta * gr->ppc_tpc_nr[gpc][ppc];
208208
const u32 t = timeslice_mode;
209209
const u32 o = PPC_UNIT(gpc, ppc, 0);
210+
if (!(gr->ppc_mask[gpc] & (1 << ppc)))
211+
continue;
210212
mmio_skip(info, o + 0xc0, (t << 28) | (b << 16) | ++bo);
211213
mmio_wr32(info, o + 0xc0, (t << 28) | (b << 16) | --bo);
212214
bo += grctx->attrib_nr_max * gr->ppc_tpc_nr[gpc][ppc];

drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpc.fuc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ mmio_list_base:
5252
#endif
5353

5454
#ifdef INCLUDE_CODE
55+
#define gpc_addr(reg,addr) /*
56+
*/ imm32(reg,addr) /*
57+
*/ or reg NV_PGRAPH_GPCX_GPCCS_MMIO_CTRL_BASE_ENABLE
5558
#define gpc_wr32(addr,reg) /*
59+
*/ gpc_addr($r14,addr) /*
5660
*/ mov b32 $r15 reg /*
57-
*/ imm32($r14, addr) /*
58-
*/ or $r14 NV_PGRAPH_GPCX_GPCCS_MMIO_CTRL_BASE_ENABLE /*
5961
*/ call(nv_wr32)
6062

6163
// reports an exception to the host
@@ -161,7 +163,7 @@ init:
161163

162164
#if NV_PGRAPH_GPCX_UNK__SIZE > 0
163165
// figure out which, and how many, UNKs are actually present
164-
imm32($r14, 0x500c30)
166+
gpc_addr($r14, 0x500c30)
165167
clear b32 $r2
166168
clear b32 $r3
167169
clear b32 $r4

0 commit comments

Comments
 (0)