Skip to content

Commit

Permalink
Merge branch 'linux-4.15' of git://github.com/skeggsb/linux into drm-…
Browse files Browse the repository at this point in the history
…next

- Pascal temperature sensor support
- Improved BAR2 handling, greatly reduces time required to suspend
- Rework of the MMU code
  - Allows us to properly support Pascal's new MMU layout (implemented)
  - Lays the groundwork for improved userspace APIs later
- Misc other fixes

* 'linux-4.15' of git://github.com/skeggsb/linux: (151 commits)
  drm/nouveau/gr/gf100-: don't prevent module load if firmware missing
  drm/nouveau/mmu: remove old vmm frontend
  drm/nouveau: improve selection of GPU page size
  drm/nouveau: switch over to new memory and vmm interfaces
  drm/nouveau: remove unused nouveau_fence_work()
  drm/nouveau: queue delayed unmapping of VMAs on client workqueue
  drm/nouveau: implement per-client delayed workqueue with fence support
  drm/nouveau: determine memory class for each client
  drm/nouveau: pass handle of vmm object to channel allocation ioctls
  drm/nouveau: switch to vmm limit
  drm/nouveau: allocate vmm object for every client
  drm/nouveau: replace use of cpu_coherent with memory types
  drm/nouveau: use nvif_mmu_type to determine BAR1 caching
  drm/nouveau: fetch memory type indices that we care about for ttm
  drm/nouveau: consolidate handling of dma mask
  drm/nouveau: check kind validity against mmu object
  drm/nouveau: allocate mmu object for every client
  drm/nouveau: remove trivial cases of nvxx_device() usage
  drm/nouveau/mmu: define user interfaces to mmu vmm opertaions
  drm/nouveau/mmu: define user interfaces to mmu memory allocation
  ...
  • Loading branch information
Dave Airlie committed Nov 2, 2017
2 parents 7a88cbd + 46bda4f commit 2ef7a95
Show file tree
Hide file tree
Showing 273 changed files with 10,011 additions and 3,397 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ nouveau-y += nouveau_vga.o
# DRM - memory management
nouveau-y += nouveau_bo.o
nouveau-y += nouveau_gem.o
nouveau-y += nouveau_mem.o
nouveau-y += nouveau_prime.o
nouveau-y += nouveau_sgdma.o
nouveau-y += nouveau_ttm.o
nouveau-y += nouveau_vmm.o

# DRM - modesetting
nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o
Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/nouveau/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ config NOUVEAU_DEBUG_DEFAULT
help
Selects the default debug level

config NOUVEAU_DEBUG_MMU
bool "Enable additional MMU debugging"
depends on DRM_NOUVEAU
default n
help
Say Y here if you want to enable verbose MMU debug output.

config DRM_NOUVEAU_BACKLIGHT
bool "Support for backlight control"
depends on DRM_NOUVEAU
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/dispnv04/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nv04_display_create(struct drm_device *dev)
if (!disp)
return -ENOMEM;

nvif_object_map(&drm->client.device.object);
nvif_object_map(&drm->client.device.object, NULL, 0);

nouveau_display(dev)->priv = disp;
nouveau_display(dev)->dtor = nv04_display_destroy;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cl506e.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct nv50_channel_dma_v0 {
__u8 version;
__u8 chid;
__u8 pad02[6];
__u64 vm;
__u64 vmm;
__u64 pushbuf;
__u64 offset;
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cl506f.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ struct nv50_channel_gpfifo_v0 {
__u32 ilength;
__u64 ioffset;
__u64 pushbuf;
__u64 vm;
__u64 vmm;
};
#endif
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cl826e.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct g82_channel_dma_v0 {
__u8 version;
__u8 chid;
__u8 pad02[6];
__u64 vm;
__u64 vmm;
__u64 pushbuf;
__u64 offset;
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cl826f.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct g82_channel_gpfifo_v0 {
__u32 ilength;
__u64 ioffset;
__u64 pushbuf;
__u64 vm;
__u64 vmm;
};

#define NV826F_V0_NTFY_NON_STALL_INTERRUPT 0x00
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cl906f.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct fermi_channel_gpfifo_v0 {
__u8 pad02[2];
__u32 ilength;
__u64 ioffset;
__u64 vm;
__u64 vmm;
};

#define NV906F_V0_NTFY_NON_STALL_INTERRUPT 0x00
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/include/nvif/cla06f.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct kepler_channel_gpfifo_a_v0 {
__u32 engines;
__u32 ilength;
__u64 ioffset;
__u64 vm;
__u64 vmm;
};

#define NVA06F_V0_NTFY_NON_STALL_INTERRUPT 0x00
Expand Down
17 changes: 17 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
#define NVIF_CLASS_SW_NV50 /* if0005.h */ -0x00000006
#define NVIF_CLASS_SW_GF100 /* if0005.h */ -0x00000007

#define NVIF_CLASS_MMU /* if0008.h */ 0x80000008
#define NVIF_CLASS_MMU_NV04 /* if0008.h */ 0x80000009
#define NVIF_CLASS_MMU_NV50 /* if0008.h */ 0x80005009
#define NVIF_CLASS_MMU_GF100 /* if0008.h */ 0x80009009

#define NVIF_CLASS_MEM /* if000a.h */ 0x8000000a
#define NVIF_CLASS_MEM_NV04 /* if000b.h */ 0x8000000b
#define NVIF_CLASS_MEM_NV50 /* if500b.h */ 0x8000500b
#define NVIF_CLASS_MEM_GF100 /* if900b.h */ 0x8000900b

#define NVIF_CLASS_VMM /* if000c.h */ 0x8000000c
#define NVIF_CLASS_VMM_NV04 /* if000d.h */ 0x8000000d
#define NVIF_CLASS_VMM_NV50 /* if500d.h */ 0x8000500d
#define NVIF_CLASS_VMM_GF100 /* if900d.h */ 0x8000900d
#define NVIF_CLASS_VMM_GM200 /* ifb00d.h */ 0x8000b00d
#define NVIF_CLASS_VMM_GP100 /* ifc00d.h */ 0x8000c00d

/* the below match nvidia-assigned (either in hw, or sw) class numbers */
#define NV_NULL_CLASS 0x00000030

Expand Down
5 changes: 0 additions & 5 deletions drivers/gpu/drm/nouveau/include/nvif/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ u64 nvif_device_time(struct nvif_device *);
/*XXX*/
#include <subdev/bios.h>
#include <subdev/fb.h>
#include <subdev/mmu.h>
#include <subdev/bar.h>
#include <subdev/gpio.h>
#include <subdev/clk.h>
Expand All @@ -57,19 +56,15 @@ u64 nvif_device_time(struct nvif_device *);
})
#define nvxx_bios(a) nvxx_device(a)->bios
#define nvxx_fb(a) nvxx_device(a)->fb
#define nvxx_mmu(a) nvxx_device(a)->mmu
#define nvxx_bar(a) nvxx_device(a)->bar
#define nvxx_gpio(a) nvxx_device(a)->gpio
#define nvxx_clk(a) nvxx_device(a)->clk
#define nvxx_i2c(a) nvxx_device(a)->i2c
#define nvxx_iccsense(a) nvxx_device(a)->iccsense
#define nvxx_therm(a) nvxx_device(a)->therm
#define nvxx_volt(a) nvxx_device(a)->volt

#include <core/device.h>
#include <engine/fifo.h>
#include <engine/gr.h>
#include <engine/sw.h>

#define nvxx_fifo(a) nvxx_device(a)->fifo
#define nvxx_gr(a) nvxx_device(a)->gr
Expand Down
42 changes: 42 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if0008.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef __NVIF_IF0008_H__
#define __NVIF_IF0008_H__
struct nvif_mmu_v0 {
__u8 version;
__u8 dmabits;
__u8 heap_nr;
__u8 type_nr;
__u16 kind_nr;
};

#define NVIF_MMU_V0_HEAP 0x00
#define NVIF_MMU_V0_TYPE 0x01
#define NVIF_MMU_V0_KIND 0x02

struct nvif_mmu_heap_v0 {
__u8 version;
__u8 index;
__u8 pad02[6];
__u64 size;
};

struct nvif_mmu_type_v0 {
__u8 version;
__u8 index;
__u8 heap;
__u8 vram;
__u8 host;
__u8 comp;
__u8 disp;
__u8 kind;
__u8 mappable;
__u8 coherent;
__u8 uncached;
};

struct nvif_mmu_kind_v0 {
__u8 version;
__u8 pad01[1];
__u16 count;
__u8 data[];
};
#endif
22 changes: 22 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if000a.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef __NVIF_IF000A_H__
#define __NVIF_IF000A_H__
struct nvif_mem_v0 {
__u8 version;
__u8 type;
__u8 page;
__u8 pad03[5];
__u64 size;
__u64 addr;
__u8 data[];
};

struct nvif_mem_ram_vn {
};

struct nvif_mem_ram_v0 {
__u8 version;
__u8 pad01[7];
dma_addr_t *dma;
struct scatterlist *sgl;
};
#endif
11 changes: 11 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if000b.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef __NVIF_IF000B_H__
#define __NVIF_IF000B_H__
#include "if000a.h"

struct nv04_mem_vn {
/* nvkm_mem_vX ... */
};

struct nv04_mem_map_vn {
};
#endif
64 changes: 64 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if000c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#ifndef __NVIF_IF000C_H__
#define __NVIF_IF000C_H__
struct nvif_vmm_v0 {
__u8 version;
__u8 page_nr;
__u8 pad02[6];
__u64 addr;
__u64 size;
__u8 data[];
};

#define NVIF_VMM_V0_PAGE 0x00
#define NVIF_VMM_V0_GET 0x01
#define NVIF_VMM_V0_PUT 0x02
#define NVIF_VMM_V0_MAP 0x03
#define NVIF_VMM_V0_UNMAP 0x04

struct nvif_vmm_page_v0 {
__u8 version;
__u8 index;
__u8 shift;
__u8 sparse;
__u8 vram;
__u8 host;
__u8 comp;
__u8 pad07[1];
};

struct nvif_vmm_get_v0 {
__u8 version;
#define NVIF_VMM_GET_V0_ADDR 0x00
#define NVIF_VMM_GET_V0_PTES 0x01
#define NVIF_VMM_GET_V0_LAZY 0x02
__u8 type;
__u8 sparse;
__u8 page;
__u8 align;
__u8 pad05[3];
__u64 size;
__u64 addr;
};

struct nvif_vmm_put_v0 {
__u8 version;
__u8 pad01[7];
__u64 addr;
};

struct nvif_vmm_map_v0 {
__u8 version;
__u8 pad01[7];
__u64 addr;
__u64 size;
__u64 memory;
__u64 offset;
__u8 data[];
};

struct nvif_vmm_unmap_v0 {
__u8 version;
__u8 pad01[7];
__u64 addr;
};
#endif
12 changes: 12 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if000d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef __NVIF_IF000D_H__
#define __NVIF_IF000D_H__
#include "if000c.h"

struct nv04_vmm_vn {
/* nvif_vmm_vX ... */
};

struct nv04_vmm_map_vn {
/* nvif_vmm_map_vX ... */
};
#endif
25 changes: 25 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if500b.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef __NVIF_IF500B_H__
#define __NVIF_IF500B_H__
#include "if000a.h"

struct nv50_mem_vn {
/* nvif_mem_vX ... */
};

struct nv50_mem_v0 {
/* nvif_mem_vX ... */
__u8 version;
__u8 bankswz;
__u8 contig;
};

struct nv50_mem_map_vn {
};

struct nv50_mem_map_v0 {
__u8 version;
__u8 ro;
__u8 kind;
__u8 comp;
};
#endif
21 changes: 21 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if500d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef __NVIF_IF500D_H__
#define __NVIF_IF500D_H__
#include "if000c.h"

struct nv50_vmm_vn {
/* nvif_vmm_vX ... */
};

struct nv50_vmm_map_vn {
/* nvif_vmm_map_vX ... */
};

struct nv50_vmm_map_v0 {
/* nvif_vmm_map_vX ... */
__u8 version;
__u8 ro;
__u8 priv;
__u8 kind;
__u8 comp;
};
#endif
23 changes: 23 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if900b.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef __NVIF_IF900B_H__
#define __NVIF_IF900B_H__
#include "if000a.h"

struct gf100_mem_vn {
/* nvif_mem_vX ... */
};

struct gf100_mem_v0 {
/* nvif_mem_vX ... */
__u8 version;
__u8 contig;
};

struct gf100_mem_map_vn {
};

struct gf100_mem_map_v0 {
__u8 version;
__u8 ro;
__u8 kind;
};
#endif
21 changes: 21 additions & 0 deletions drivers/gpu/drm/nouveau/include/nvif/if900d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef __NVIF_IF900D_H__
#define __NVIF_IF900D_H__
#include "if000c.h"

struct gf100_vmm_vn {
/* nvif_vmm_vX ... */
};

struct gf100_vmm_map_vn {
/* nvif_vmm_map_vX ... */
};

struct gf100_vmm_map_v0 {
/* nvif_vmm_map_vX ... */
__u8 version;
__u8 vol;
__u8 ro;
__u8 priv;
__u8 kind;
};
#endif
Loading

0 comments on commit 2ef7a95

Please sign in to comment.