Commit 639c308e authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fb: namespace + nvidia gpu names (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a8c4362b
...@@ -220,5 +220,22 @@ ...@@ -220,5 +220,22 @@
#define nva3_clk_info gt215_clk_info #define nva3_clk_info gt215_clk_info
#define nva3_pll_info gt215_pll_info #define nva3_pll_info gt215_pll_info
#define nouveau_ibus nvkm_ibus #define nouveau_ibus nvkm_ibus
#define nouveau_memx nvkm_memx
#define nouveau_memx_block nvkm_memx_block
#define nouveau_memx_unblock nvkm_memx_unblock
#define nouveau_memx_train nvkm_memx_train
#define nouveau_memx_train_result nvkm_memx_train_result
#define nouveau_memx_wait_vblank nvkm_memx_wait_vblank
#define nouveau_memx_rd32 nvkm_memx_rd32
#define nouveau_memx_wr32 nvkm_memx_wr32
#define nouveau_memx_wait nvkm_memx_wait
#define nouveau_memx_init nvkm_memx_init
#define nouveau_memx_fini nvkm_memx_fini
#define nouveau_memx_nsec nvkm_memx_nsec
#define nouveau_ltc nvkm_ltc
#define nouveau_pmu nvkm_pmu
#define nouveau_fb nvkm_fb
#define nouveau_fb_tile nvkm_fb_tile
#define nvc0_pte_storage_type_map gf100_pte_storage_type_map
#endif #endif
#ifndef __NOUVEAU_FB_H__ #ifndef __NVKM_FB_H__
#define __NOUVEAU_FB_H__ #define __NVKM_FB_H__
#include <core/subdev.h> #include <core/subdev.h>
#include <core/device.h>
#include <core/mm.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
...@@ -24,14 +21,14 @@ ...@@ -24,14 +21,14 @@
#define NV_MEM_TYPE_VM 0x7f #define NV_MEM_TYPE_VM 0x7f
#define NV_MEM_COMP_VM 0x03 #define NV_MEM_COMP_VM 0x03
struct nouveau_mem { struct nvkm_mem {
struct drm_device *dev; struct drm_device *dev;
struct nouveau_vma bar_vma; struct nvkm_vma bar_vma;
struct nouveau_vma vma[2]; struct nvkm_vma vma[2];
u8 page_shift; u8 page_shift;
struct nouveau_mm_node *tag; struct nvkm_mm_node *tag;
struct list_head regions; struct list_head regions;
dma_addr_t *pages; dma_addr_t *pages;
u32 memtype; u32 memtype;
...@@ -40,85 +37,83 @@ struct nouveau_mem { ...@@ -40,85 +37,83 @@ struct nouveau_mem {
struct sg_table *sg; struct sg_table *sg;
}; };
struct nouveau_fb_tile { struct nvkm_fb_tile {
struct nouveau_mm_node *tag; struct nvkm_mm_node *tag;
u32 addr; u32 addr;
u32 limit; u32 limit;
u32 pitch; u32 pitch;
u32 zcomp; u32 zcomp;
}; };
struct nouveau_fb { struct nvkm_fb {
struct nouveau_subdev base; struct nvkm_subdev base;
bool (*memtype_valid)(struct nouveau_fb *, u32 memtype); bool (*memtype_valid)(struct nvkm_fb *, u32 memtype);
struct nouveau_ram *ram; struct nvkm_ram *ram;
struct nouveau_mm vram; struct nvkm_mm vram;
struct nouveau_mm tags; struct nvkm_mm tags;
struct { struct {
struct nouveau_fb_tile region[16]; struct nvkm_fb_tile region[16];
int regions; int regions;
void (*init)(struct nouveau_fb *, int i, u32 addr, u32 size, void (*init)(struct nvkm_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nouveau_fb_tile *); u32 pitch, u32 flags, struct nvkm_fb_tile *);
void (*comp)(struct nouveau_fb *, int i, u32 size, u32 flags, void (*comp)(struct nvkm_fb *, int i, u32 size, u32 flags,
struct nouveau_fb_tile *); struct nvkm_fb_tile *);
void (*fini)(struct nouveau_fb *, int i, void (*fini)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
struct nouveau_fb_tile *); void (*prog)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
void (*prog)(struct nouveau_fb *, int i,
struct nouveau_fb_tile *);
} tile; } tile;
}; };
static inline struct nouveau_fb * static inline struct nvkm_fb *
nouveau_fb(void *obj) nvkm_fb(void *obj)
{ {
/* fbram uses this before device subdev pointer is valid */ /* fbram uses this before device subdev pointer is valid */
if (nv_iclass(obj, NV_SUBDEV_CLASS) && if (nv_iclass(obj, NV_SUBDEV_CLASS) &&
nv_subidx(obj) == NVDEV_SUBDEV_FB) nv_subidx(obj) == NVDEV_SUBDEV_FB)
return obj; return obj;
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_FB); return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_FB);
} }
extern struct nouveau_oclass *nv04_fb_oclass; extern struct nvkm_oclass *nv04_fb_oclass;
extern struct nouveau_oclass *nv10_fb_oclass; extern struct nvkm_oclass *nv10_fb_oclass;
extern struct nouveau_oclass *nv1a_fb_oclass; extern struct nvkm_oclass *nv1a_fb_oclass;
extern struct nouveau_oclass *nv20_fb_oclass; extern struct nvkm_oclass *nv20_fb_oclass;
extern struct nouveau_oclass *nv25_fb_oclass; extern struct nvkm_oclass *nv25_fb_oclass;
extern struct nouveau_oclass *nv30_fb_oclass; extern struct nvkm_oclass *nv30_fb_oclass;
extern struct nouveau_oclass *nv35_fb_oclass; extern struct nvkm_oclass *nv35_fb_oclass;
extern struct nouveau_oclass *nv36_fb_oclass; extern struct nvkm_oclass *nv36_fb_oclass;
extern struct nouveau_oclass *nv40_fb_oclass; extern struct nvkm_oclass *nv40_fb_oclass;
extern struct nouveau_oclass *nv41_fb_oclass; extern struct nvkm_oclass *nv41_fb_oclass;
extern struct nouveau_oclass *nv44_fb_oclass; extern struct nvkm_oclass *nv44_fb_oclass;
extern struct nouveau_oclass *nv46_fb_oclass; extern struct nvkm_oclass *nv46_fb_oclass;
extern struct nouveau_oclass *nv47_fb_oclass; extern struct nvkm_oclass *nv47_fb_oclass;
extern struct nouveau_oclass *nv49_fb_oclass; extern struct nvkm_oclass *nv49_fb_oclass;
extern struct nouveau_oclass *nv4e_fb_oclass; extern struct nvkm_oclass *nv4e_fb_oclass;
extern struct nouveau_oclass *nv50_fb_oclass; extern struct nvkm_oclass *nv50_fb_oclass;
extern struct nouveau_oclass *nv84_fb_oclass; extern struct nvkm_oclass *g84_fb_oclass;
extern struct nouveau_oclass *nva3_fb_oclass; extern struct nvkm_oclass *gt215_fb_oclass;
extern struct nouveau_oclass *nvaa_fb_oclass; extern struct nvkm_oclass *mcp77_fb_oclass;
extern struct nouveau_oclass *nvaf_fb_oclass; extern struct nvkm_oclass *mcp89_fb_oclass;
extern struct nouveau_oclass *nvc0_fb_oclass; extern struct nvkm_oclass *gf100_fb_oclass;
extern struct nouveau_oclass *nve0_fb_oclass; extern struct nvkm_oclass *gk104_fb_oclass;
extern struct nouveau_oclass *gk20a_fb_oclass; extern struct nvkm_oclass *gk20a_fb_oclass;
extern struct nouveau_oclass *gm107_fb_oclass; extern struct nvkm_oclass *gm107_fb_oclass;
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/ramcfg.h> #include <subdev/bios/ramcfg.h>
struct nouveau_ram_data { struct nvkm_ram_data {
struct list_head head; struct list_head head;
struct nvbios_ramcfg bios; struct nvbios_ramcfg bios;
u32 freq; u32 freq;
}; };
struct nouveau_ram { struct nvkm_ram {
struct nouveau_object base; struct nvkm_object base;
enum { enum {
NV_MEM_TYPE_UNKNOWN = 0, NV_MEM_TYPE_UNKNOWN = 0,
NV_MEM_TYPE_STOLEN, NV_MEM_TYPE_STOLEN,
...@@ -140,21 +135,20 @@ struct nouveau_ram { ...@@ -140,21 +135,20 @@ struct nouveau_ram {
int parts; int parts;
int part_mask; int part_mask;
int (*get)(struct nouveau_fb *, u64 size, u32 align, int (*get)(struct nvkm_fb *, u64 size, u32 align, u32 size_nc,
u32 size_nc, u32 type, struct nouveau_mem **); u32 type, struct nvkm_mem **);
void (*put)(struct nouveau_fb *, struct nouveau_mem **); void (*put)(struct nvkm_fb *, struct nvkm_mem **);
int (*calc)(struct nouveau_fb *, u32 freq); int (*calc)(struct nvkm_fb *, u32 freq);
int (*prog)(struct nouveau_fb *); int (*prog)(struct nvkm_fb *);
void (*tidy)(struct nouveau_fb *); void (*tidy)(struct nvkm_fb *);
u32 freq; u32 freq;
u32 mr[16]; u32 mr[16];
u32 mr1_nuts; u32 mr1_nuts;
struct nouveau_ram_data *next; struct nvkm_ram_data *next;
struct nouveau_ram_data former; struct nvkm_ram_data former;
struct nouveau_ram_data xition; struct nvkm_ram_data xition;
struct nouveau_ram_data target; struct nvkm_ram_data target;
}; };
#endif #endif
...@@ -100,7 +100,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -100,7 +100,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -129,7 +129,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -129,7 +129,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -158,7 +158,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -158,7 +158,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -187,7 +187,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -187,7 +187,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -216,7 +216,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -216,7 +216,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -245,7 +245,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -245,7 +245,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -274,7 +274,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -274,7 +274,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -303,7 +303,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -303,7 +303,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvaa_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -332,7 +332,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -332,7 +332,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvaa_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -361,7 +361,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -361,7 +361,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nva3_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -392,7 +392,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -392,7 +392,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nva3_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -422,7 +422,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -422,7 +422,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nva3_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
...@@ -452,7 +452,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -452,7 +452,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = g94_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvaf_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp89_fb_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass; device->oclass[NVDEV_SUBDEV_MMU ] = &nv50_mmu_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass; device->oclass[NVDEV_SUBDEV_BAR ] = &nv50_bar_oclass;
......
...@@ -72,7 +72,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -72,7 +72,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -105,7 +105,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -105,7 +105,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -138,7 +138,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -138,7 +138,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -170,7 +170,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -170,7 +170,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -203,7 +203,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -203,7 +203,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -235,7 +235,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -235,7 +235,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -267,7 +267,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -267,7 +267,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc0_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -300,7 +300,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -300,7 +300,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -332,7 +332,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -332,7 +332,7 @@ nvc0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nvc0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gf100_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nvc0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
......
...@@ -72,7 +72,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -72,7 +72,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -106,7 +106,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -106,7 +106,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -140,7 +140,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -140,7 +140,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -196,7 +196,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -196,7 +196,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -230,7 +230,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -230,7 +230,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nvc3_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -264,7 +264,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -264,7 +264,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
...@@ -297,7 +297,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -297,7 +297,7 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass; device->oclass[NVDEV_SUBDEV_BUS ] = gf100_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass; device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass; device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
......
...@@ -15,12 +15,12 @@ nvkm-y += nvkm/subdev/fb/nv47.o ...@@ -15,12 +15,12 @@ nvkm-y += nvkm/subdev/fb/nv47.o
nvkm-y += nvkm/subdev/fb/nv49.o nvkm-y += nvkm/subdev/fb/nv49.o
nvkm-y += nvkm/subdev/fb/nv4e.o nvkm-y += nvkm/subdev/fb/nv4e.o
nvkm-y += nvkm/subdev/fb/nv50.o nvkm-y += nvkm/subdev/fb/nv50.o
nvkm-y += nvkm/subdev/fb/nv84.o nvkm-y += nvkm/subdev/fb/g84.o
nvkm-y += nvkm/subdev/fb/nva3.o nvkm-y += nvkm/subdev/fb/gt215.o
nvkm-y += nvkm/subdev/fb/nvaa.o nvkm-y += nvkm/subdev/fb/mcp77.o
nvkm-y += nvkm/subdev/fb/nvaf.o nvkm-y += nvkm/subdev/fb/mcp89.o
nvkm-y += nvkm/subdev/fb/nvc0.o nvkm-y += nvkm/subdev/fb/gf100.o
nvkm-y += nvkm/subdev/fb/nve0.o nvkm-y += nvkm/subdev/fb/gk104.o
nvkm-y += nvkm/subdev/fb/gk20a.o nvkm-y += nvkm/subdev/fb/gk20a.o
nvkm-y += nvkm/subdev/fb/gm107.o nvkm-y += nvkm/subdev/fb/gm107.o
nvkm-y += nvkm/subdev/fb/ramnv04.o nvkm-y += nvkm/subdev/fb/ramnv04.o
...@@ -33,10 +33,10 @@ nvkm-y += nvkm/subdev/fb/ramnv44.o ...@@ -33,10 +33,10 @@ nvkm-y += nvkm/subdev/fb/ramnv44.o
nvkm-y += nvkm/subdev/fb/ramnv49.o nvkm-y += nvkm/subdev/fb/ramnv49.o
nvkm-y += nvkm/subdev/fb/ramnv4e.o nvkm-y += nvkm/subdev/fb/ramnv4e.o
nvkm-y += nvkm/subdev/fb/ramnv50.o nvkm-y += nvkm/subdev/fb/ramnv50.o
nvkm-y += nvkm/subdev/fb/ramnva3.o nvkm-y += nvkm/subdev/fb/ramgt215.o
nvkm-y += nvkm/subdev/fb/ramnvaa.o nvkm-y += nvkm/subdev/fb/rammcp77.o
nvkm-y += nvkm/subdev/fb/ramnvc0.o nvkm-y += nvkm/subdev/fb/ramgf100.o
nvkm-y += nvkm/subdev/fb/ramnve0.o nvkm-y += nvkm/subdev/fb/ramgk104.o
nvkm-y += nvkm/subdev/fb/ramgk20a.o nvkm-y += nvkm/subdev/fb/ramgk20a.o
nvkm-y += nvkm/subdev/fb/ramgm107.o nvkm-y += nvkm/subdev/fb/ramgm107.o
nvkm-y += nvkm/subdev/fb/sddr2.o nvkm-y += nvkm/subdev/fb/sddr2.o
......
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/M0203.h> #include <subdev/bios/M0203.h>
#include "priv.h"
int int
nouveau_fb_bios_memtype(struct nouveau_bios *bios) nvkm_fb_bios_memtype(struct nvkm_bios *bios)
{ {
const u8 ramcfg = (nv_rd32(bios, 0x101000) & 0x0000003c) >> 2; const u8 ramcfg = (nv_rd32(bios, 0x101000) & 0x0000003c) >> 2;
struct nvbios_M0203E M0203E; struct nvbios_M0203E M0203E;
...@@ -51,25 +50,25 @@ nouveau_fb_bios_memtype(struct nouveau_bios *bios) ...@@ -51,25 +50,25 @@ nouveau_fb_bios_memtype(struct nouveau_bios *bios)
} }
int int
_nouveau_fb_fini(struct nouveau_object *object, bool suspend) _nvkm_fb_fini(struct nvkm_object *object, bool suspend)
{ {
struct nouveau_fb *pfb = (void *)object; struct nvkm_fb *pfb = (void *)object;
int ret; int ret;
ret = nv_ofuncs(pfb->ram)->fini(nv_object(pfb->ram), suspend); ret = nv_ofuncs(pfb->ram)->fini(nv_object(pfb->ram), suspend);
if (ret && suspend) if (ret && suspend)
return ret; return ret;
return nouveau_subdev_fini(&pfb->base, suspend); return nvkm_subdev_fini(&pfb->base, suspend);
} }
int int
_nouveau_fb_init(struct nouveau_object *object) _nvkm_fb_init(struct nvkm_object *object)
{ {
struct nouveau_fb *pfb = (void *)object; struct nvkm_fb *pfb = (void *)object;
int ret, i; int ret, i;
ret = nouveau_subdev_init(&pfb->base); ret = nvkm_subdev_init(&pfb->base);
if (ret) if (ret)
return ret; return ret;
...@@ -84,25 +83,25 @@ _nouveau_fb_init(struct nouveau_object *object) ...@@ -84,25 +83,25 @@ _nouveau_fb_init(struct nouveau_object *object)
} }
void void
_nouveau_fb_dtor(struct nouveau_object *object) _nvkm_fb_dtor(struct nvkm_object *object)
{ {
struct nouveau_fb *pfb = (void *)object; struct nvkm_fb *pfb = (void *)object;
int i; int i;
for (i = 0; i < pfb->tile.regions; i++) for (i = 0; i < pfb->tile.regions; i++)
pfb->tile.fini(pfb, i, &pfb->tile.region[i]); pfb->tile.fini(pfb, i, &pfb->tile.region[i]);
nouveau_mm_fini(&pfb->tags); nvkm_mm_fini(&pfb->tags);
nouveau_mm_fini(&pfb->vram); nvkm_mm_fini(&pfb->vram);
nouveau_object_ref(NULL, (struct nouveau_object **)&pfb->ram); nvkm_object_ref(NULL, (struct nvkm_object **)&pfb->ram);
nouveau_subdev_destroy(&pfb->base); nvkm_subdev_destroy(&pfb->base);
} }
int int
nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine, nvkm_fb_create_(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, int length, void **pobject) struct nvkm_oclass *oclass, int length, void **pobject)
{ {
struct nouveau_fb_impl *impl = (void *)oclass; struct nvkm_fb_impl *impl = (void *)oclass;
static const char *name[] = { static const char *name[] = {
[NV_MEM_TYPE_UNKNOWN] = "unknown", [NV_MEM_TYPE_UNKNOWN] = "unknown",
[NV_MEM_TYPE_STOLEN ] = "stolen system memory", [NV_MEM_TYPE_STOLEN ] = "stolen system memory",
...@@ -116,20 +115,19 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -116,20 +115,19 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine,
[NV_MEM_TYPE_GDDR4 ] = "GDDR4", [NV_MEM_TYPE_GDDR4 ] = "GDDR4",
[NV_MEM_TYPE_GDDR5 ] = "GDDR5", [NV_MEM_TYPE_GDDR5 ] = "GDDR5",
}; };
struct nouveau_object *ram; struct nvkm_object *ram;
struct nouveau_fb *pfb; struct nvkm_fb *pfb;
int ret; int ret;
ret = nouveau_subdev_create_(parent, engine, oclass, 0, "PFB", "fb", ret = nvkm_subdev_create_(parent, engine, oclass, 0, "PFB", "fb",
length, pobject); length, pobject);
pfb = *pobject; pfb = *pobject;
if (ret) if (ret)
return ret; return ret;
pfb->memtype_valid = impl->memtype; pfb->memtype_valid = impl->memtype;
ret = nouveau_object_ctor(nv_object(pfb), NULL, ret = nvkm_object_ctor(nv_object(pfb), NULL, impl->ram, NULL, 0, &ram);
impl->ram, NULL, 0, &ram);
if (ret) { if (ret) {
nv_fatal(pfb, "error detecting memory configuration!!\n"); nv_fatal(pfb, "error detecting memory configuration!!\n");
return ret; return ret;
...@@ -137,15 +135,15 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -137,15 +135,15 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine,
pfb->ram = (void *)ram; pfb->ram = (void *)ram;
if (!nouveau_mm_initialised(&pfb->vram)) { if (!nvkm_mm_initialised(&pfb->vram)) {
ret = nouveau_mm_init(&pfb->vram, 0, pfb->ram->size >> 12, 1); ret = nvkm_mm_init(&pfb->vram, 0, pfb->ram->size >> 12, 1);
if (ret) if (ret)
return ret; return ret;
} }
if (!nouveau_mm_initialised(&pfb->tags)) { if (!nvkm_mm_initialised(&pfb->tags)) {
ret = nouveau_mm_init(&pfb->tags, 0, pfb->ram->tags ? ret = nvkm_mm_init(&pfb->tags, 0, pfb->ram->tags ?
++pfb->ram->tags : 0, 1); ++pfb->ram->tags : 0, 1);
if (ret) if (ret)
return ret; return ret;
} }
......
...@@ -21,17 +21,16 @@ ...@@ -21,17 +21,16 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h" #include "nv50.h"
struct nouveau_oclass * struct nvkm_oclass *
nv84_fb_oclass = &(struct nv50_fb_impl) { g84_fb_oclass = &(struct nv50_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x84), .base.base.handle = NV_SUBDEV(FB, 0x84),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_fb_ctor, .ctor = nv50_fb_ctor,
.dtor = nv50_fb_dtor, .dtor = nv50_fb_dtor,
.init = nv50_fb_init, .init = nv50_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv50_fb_memtype_valid, .base.memtype = nv50_fb_memtype_valid,
.base.ram = &nv50_ram_oclass, .base.ram = &nv50_ram_oclass,
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
* Roy Spliet <rspliet@eclipso.eu> * Roy Spliet <rspliet@eclipso.eu>
*/ */
#include <subdev/bios.h>
#include "priv.h" #include "priv.h"
struct ramxlat { struct ramxlat {
...@@ -70,7 +68,7 @@ ramgddr3_wr_lo[] = { ...@@ -70,7 +68,7 @@ ramgddr3_wr_lo[] = {
}; };
int int
nouveau_gddr3_calc(struct nouveau_ram *ram) nvkm_gddr3_calc(struct nvkm_ram *ram)
{ {
int CL, WR, CWL, DLL = 0, ODT = 0, hi; int CL, WR, CWL, DLL = 0, ODT = 0, hi;
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h>
#include "priv.h" #include "priv.h"
/* binary driver only executes this path if the condition (a) is true /* binary driver only executes this path if the condition (a) is true
...@@ -34,7 +32,7 @@ ...@@ -34,7 +32,7 @@
#define NOTE00(a) 1 #define NOTE00(a) 1
int int
nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts) nvkm_gddr5_calc(struct nvkm_ram *ram, bool nuts)
{ {
int pd, lf, xd, vh, vr, vo, l3; int pd, lf, xd, vh, vr, vo, l3;
int WL, CL, WR, at[2], dt, ds; int WL, CL, WR, at[2], dt, ds;
......
...@@ -21,22 +21,21 @@ ...@@ -21,22 +21,21 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "gf100.h"
#include "nvc0.h" extern const u8 gf100_pte_storage_type_map[256];
extern const u8 nvc0_pte_storage_type_map[256];
bool bool
nvc0_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags) gf100_fb_memtype_valid(struct nvkm_fb *pfb, u32 tile_flags)
{ {
u8 memtype = (tile_flags & 0x0000ff00) >> 8; u8 memtype = (tile_flags & 0x0000ff00) >> 8;
return likely((nvc0_pte_storage_type_map[memtype] != 0xff)); return likely((gf100_pte_storage_type_map[memtype] != 0xff));
} }
static void static void
nvc0_fb_intr(struct nouveau_subdev *subdev) gf100_fb_intr(struct nvkm_subdev *subdev)
{ {
struct nvc0_fb_priv *priv = (void *)subdev; struct gf100_fb_priv *priv = (void *)subdev;
u32 intr = nv_rd32(priv, 0x000100); u32 intr = nv_rd32(priv, 0x000100);
if (intr & 0x08000000) { if (intr & 0x08000000) {
nv_debug(priv, "PFFB intr\n"); nv_debug(priv, "PFFB intr\n");
...@@ -49,26 +48,27 @@ nvc0_fb_intr(struct nouveau_subdev *subdev) ...@@ -49,26 +48,27 @@ nvc0_fb_intr(struct nouveau_subdev *subdev)
} }
int int
nvc0_fb_init(struct nouveau_object *object) gf100_fb_init(struct nvkm_object *object)
{ {
struct nvc0_fb_priv *priv = (void *)object; struct gf100_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
if (priv->r100c10_page) if (priv->r100c10_page)
nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
return 0; return 0;
} }
void void
nvc0_fb_dtor(struct nouveau_object *object) gf100_fb_dtor(struct nvkm_object *object)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
struct nvc0_fb_priv *priv = (void *)object; struct gf100_fb_priv *priv = (void *)object;
if (priv->r100c10_page) { if (priv->r100c10_page) {
dma_unmap_page(nv_device_base(device), priv->r100c10, PAGE_SIZE, dma_unmap_page(nv_device_base(device), priv->r100c10, PAGE_SIZE,
...@@ -76,19 +76,19 @@ nvc0_fb_dtor(struct nouveau_object *object) ...@@ -76,19 +76,19 @@ nvc0_fb_dtor(struct nouveau_object *object)
__free_page(priv->r100c10_page); __free_page(priv->r100c10_page);
} }
nouveau_fb_destroy(&priv->base); nvkm_fb_destroy(&priv->base);
} }
int int
nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, gf100_fb_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_device *device = nv_device(parent); struct nvkm_device *device = nv_device(parent);
struct nvc0_fb_priv *priv; struct gf100_fb_priv *priv;
int ret; int ret;
ret = nouveau_fb_create(parent, engine, oclass, &priv); ret = nvkm_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -102,19 +102,19 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -102,19 +102,19 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return -EFAULT; return -EFAULT;
} }
nv_subdev(priv)->intr = nvc0_fb_intr; nv_subdev(priv)->intr = gf100_fb_intr;
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nvc0_fb_oclass = &(struct nouveau_fb_impl) { gf100_fb_oclass = &(struct nvkm_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0xc0), .base.handle = NV_SUBDEV(FB, 0xc0),
.base.ofuncs = &(struct nouveau_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nvc0_fb_ctor, .ctor = gf100_fb_ctor,
.dtor = nvc0_fb_dtor, .dtor = gf100_fb_dtor,
.init = nvc0_fb_init, .init = gf100_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.memtype = nvc0_fb_memtype_valid, .memtype = gf100_fb_memtype_valid,
.ram = &nvc0_ram_oclass, .ram = &gf100_ram_oclass,
}.base; }.base;
#ifndef __NVKM_RAM_NVC0_H__
#define __NVKM_RAM_NVC0_H__
#include "priv.h"
#include "nv50.h"
struct gf100_fb_priv {
struct nvkm_fb base;
struct page *r100c10_page;
dma_addr_t r100c10;
};
int gf100_fb_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
struct nvkm_object **);
void gf100_fb_dtor(struct nvkm_object *);
int gf100_fb_init(struct nvkm_object *);
bool gf100_fb_memtype_valid(struct nvkm_fb *, u32);
#define gf100_ram_create(p,e,o,m,d) \
gf100_ram_create_((p), (e), (o), (m), sizeof(**d), (void **)d)
int gf100_ram_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, u32, int, void **);
int gf100_ram_get(struct nvkm_fb *, u64, u32, u32, u32,
struct nvkm_mem **);
void gf100_ram_put(struct nvkm_fb *, struct nvkm_mem **);
int gk104_ram_init(struct nvkm_object*);
#endif
...@@ -21,18 +21,17 @@ ...@@ -21,18 +21,17 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "gf100.h"
#include "nvc0.h" struct nvkm_oclass *
gk104_fb_oclass = &(struct nvkm_fb_impl) {
struct nouveau_oclass *
nve0_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0xe0), .base.handle = NV_SUBDEV(FB, 0xe0),
.base.ofuncs = &(struct nouveau_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nvc0_fb_ctor, .ctor = gf100_fb_ctor,
.dtor = nvc0_fb_dtor, .dtor = gf100_fb_dtor,
.init = nvc0_fb_init, .init = gf100_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.memtype = nvc0_fb_memtype_valid, .memtype = gf100_fb_memtype_valid,
.ram = &nve0_ram_oclass, .ram = &gk104_ram_oclass,
}.base; }.base;
...@@ -19,20 +19,19 @@ ...@@ -19,20 +19,19 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include "gf100.h"
#include "nvc0.h"
struct gk20a_fb_priv { struct gk20a_fb_priv {
struct nouveau_fb base; struct nvkm_fb base;
}; };
static int static int
gk20a_fb_init(struct nouveau_object *object) gk20a_fb_init(struct nvkm_object *object)
{ {
struct gk20a_fb_priv *priv = (void *)object; struct gk20a_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -41,14 +40,14 @@ gk20a_fb_init(struct nouveau_object *object) ...@@ -41,14 +40,14 @@ gk20a_fb_init(struct nouveau_object *object)
} }
static int static int
gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, gk20a_fb_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct gk20a_fb_priv *priv; struct gk20a_fb_priv *priv;
int ret; int ret;
ret = nouveau_fb_create(parent, engine, oclass, &priv); ret = nvkm_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -56,15 +55,15 @@ gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -56,15 +55,15 @@ gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
gk20a_fb_oclass = &(struct nouveau_fb_impl) { gk20a_fb_oclass = &(struct nvkm_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0xea), .base.handle = NV_SUBDEV(FB, 0xea),
.base.ofuncs = &(struct nouveau_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gk20a_fb_ctor, .ctor = gk20a_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = gk20a_fb_init, .init = gk20a_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.memtype = nvc0_fb_memtype_valid, .memtype = gf100_fb_memtype_valid,
.ram = &gk20a_ram_oclass, .ram = &gk20a_ram_oclass,
}.base; }.base;
...@@ -21,18 +21,17 @@ ...@@ -21,18 +21,17 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "gf100.h"
#include "nvc0.h" struct nvkm_oclass *
gm107_fb_oclass = &(struct nvkm_fb_impl) {
struct nouveau_oclass *
gm107_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x07), .base.handle = NV_SUBDEV(FB, 0x07),
.base.ofuncs = &(struct nouveau_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nvc0_fb_ctor, .ctor = gf100_fb_ctor,
.dtor = nvc0_fb_dtor, .dtor = gf100_fb_dtor,
.init = nvc0_fb_init, .init = gf100_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.memtype = nvc0_fb_memtype_valid, .memtype = gf100_fb_memtype_valid,
.ram = &gm107_ram_oclass, .ram = &gm107_ram_oclass,
}.base; }.base;
...@@ -21,19 +21,18 @@ ...@@ -21,19 +21,18 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h" #include "nv50.h"
struct nouveau_oclass * struct nvkm_oclass *
nva3_fb_oclass = &(struct nv50_fb_impl) { gt215_fb_oclass = &(struct nv50_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0xa3), .base.base.handle = NV_SUBDEV(FB, 0xa3),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_fb_ctor, .ctor = nv50_fb_ctor,
.dtor = nv50_fb_dtor, .dtor = nv50_fb_dtor,
.init = nv50_fb_init, .init = nv50_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv50_fb_memtype_valid, .base.memtype = nv50_fb_memtype_valid,
.base.ram = &nva3_ram_oclass, .base.ram = &gt215_ram_oclass,
.trap = 0x000d0fff, .trap = 0x000d0fff,
}.base.base; }.base.base;
...@@ -21,19 +21,18 @@ ...@@ -21,19 +21,18 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h" #include "nv50.h"
struct nouveau_oclass * struct nvkm_oclass *
nvaa_fb_oclass = &(struct nv50_fb_impl) { mcp77_fb_oclass = &(struct nv50_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0xaa), .base.base.handle = NV_SUBDEV(FB, 0xaa),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_fb_ctor, .ctor = nv50_fb_ctor,
.dtor = nv50_fb_dtor, .dtor = nv50_fb_dtor,
.init = nv50_fb_init, .init = nv50_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv50_fb_memtype_valid, .base.memtype = nv50_fb_memtype_valid,
.base.ram = &nvaa_ram_oclass, .base.ram = &mcp77_ram_oclass,
.trap = 0x001d07ff, .trap = 0x001d07ff,
}.base.base; }.base.base;
...@@ -21,19 +21,18 @@ ...@@ -21,19 +21,18 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h" #include "nv50.h"
struct nouveau_oclass * struct nvkm_oclass *
nvaf_fb_oclass = &(struct nv50_fb_impl) { mcp89_fb_oclass = &(struct nv50_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0xaf), .base.base.handle = NV_SUBDEV(FB, 0xaf),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_fb_ctor, .ctor = nv50_fb_ctor,
.dtor = nv50_fb_dtor, .dtor = nv50_fb_dtor,
.init = nv50_fb_init, .init = nv50_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv50_fb_memtype_valid, .base.memtype = nv50_fb_memtype_valid,
.base.ram = &nvaa_ram_oclass, .base.ram = &mcp77_ram_oclass,
.trap = 0x089d1fff, .trap = 0x089d1fff,
}.base.base; }.base.base;
...@@ -21,13 +21,11 @@ ...@@ -21,13 +21,11 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv04.h" #include "nv04.h"
#include "regsnv04.h"
#define NV04_PFB_CFG0 0x00100200
bool bool
nv04_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags) nv04_fb_memtype_valid(struct nvkm_fb *pfb, u32 tile_flags)
{ {
if (!(tile_flags & 0xff00)) if (!(tile_flags & 0xff00))
return true; return true;
...@@ -36,12 +34,12 @@ nv04_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags) ...@@ -36,12 +34,12 @@ nv04_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags)
} }
static int static int
nv04_fb_init(struct nouveau_object *object) nv04_fb_init(struct nvkm_object *object)
{ {
struct nv04_fb_priv *priv = (void *)object; struct nv04_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -54,15 +52,15 @@ nv04_fb_init(struct nouveau_object *object) ...@@ -54,15 +52,15 @@ nv04_fb_init(struct nouveau_object *object)
} }
int int
nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv04_fb_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv04_fb_impl *impl = (void *)oclass; struct nv04_fb_impl *impl = (void *)oclass;
struct nv04_fb_priv *priv; struct nv04_fb_priv *priv;
int ret; int ret;
ret = nouveau_fb_create(parent, engine, oclass, &priv); ret = nvkm_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -75,14 +73,14 @@ nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -75,14 +73,14 @@ nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv04_fb_oclass = &(struct nv04_fb_impl) { nv04_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x04), .base.base.handle = NV_SUBDEV(FB, 0x04),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv04_fb_init, .init = nv04_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv04_ram_oclass, .base.ram = &nv04_ram_oclass,
......
#ifndef __NVKM_FB_NV04_H__ #ifndef __NVKM_FB_NV04_H__
#define __NVKM_FB_NV04_H__ #define __NVKM_FB_NV04_H__
#include "priv.h" #include "priv.h"
struct nv04_fb_priv { struct nv04_fb_priv {
struct nouveau_fb base; struct nvkm_fb base;
}; };
int nv04_fb_ctor(struct nouveau_object *, struct nouveau_object *, int nv04_fb_ctor(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, void *, u32, struct nvkm_oclass *, void *, u32,
struct nouveau_object **); struct nvkm_object **);
struct nv04_fb_impl { struct nv04_fb_impl {
struct nouveau_fb_impl base; struct nvkm_fb_impl base;
struct { struct {
int regions; int regions;
void (*init)(struct nouveau_fb *, int i, u32 addr, u32 size, void (*init)(struct nvkm_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nouveau_fb_tile *); u32 pitch, u32 flags, struct nvkm_fb_tile *);
void (*comp)(struct nouveau_fb *, int i, u32 size, u32 flags, void (*comp)(struct nvkm_fb *, int i, u32 size, u32 flags,
struct nouveau_fb_tile *); struct nvkm_fb_tile *);
void (*fini)(struct nouveau_fb *, int i, void (*fini)(struct nvkm_fb *, int i,
struct nouveau_fb_tile *); struct nvkm_fb_tile *);
void (*prog)(struct nouveau_fb *, int i, void (*prog)(struct nvkm_fb *, int i,
struct nouveau_fb_tile *); struct nvkm_fb_tile *);
} tile; } tile;
}; };
void nv10_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size, void nv10_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nouveau_fb_tile *); u32 pitch, u32 flags, struct nvkm_fb_tile *);
void nv10_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *); void nv10_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *); void nv10_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
void nv20_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nouveau_fb_tile *);
void nv20_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
int nv30_fb_init(struct nouveau_object *); void nv20_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size, u32 pitch, u32 flags, struct nvkm_fb_tile *);
u32 pitch, u32 flags, struct nouveau_fb_tile *); void nv20_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
void nv20_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
void nv40_fb_tile_comp(struct nouveau_fb *, int i, u32 size, u32 flags, int nv30_fb_init(struct nvkm_object *);
struct nouveau_fb_tile *); void nv30_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nvkm_fb_tile *);
int nv41_fb_init(struct nouveau_object *); void nv40_fb_tile_comp(struct nvkm_fb *, int i, u32 size, u32 flags,
void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *); struct nvkm_fb_tile *);
int nv44_fb_init(struct nouveau_object *); int nv41_fb_init(struct nvkm_object *);
void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *); void nv41_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size, int nv44_fb_init(struct nvkm_object *);
u32 pitch, u32 flags, struct nouveau_fb_tile *); void nv44_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
void nv46_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
u32 pitch, u32 flags, struct nvkm_fb_tile *);
#endif #endif
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv10_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, nv10_fb_tile_init(struct nvkm_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
u32 flags, struct nouveau_fb_tile *tile) u32 flags, struct nvkm_fb_tile *tile)
{ {
tile->addr = 0x80000000 | addr; tile->addr = 0x80000000 | addr;
tile->limit = max(1u, addr + size) - 1; tile->limit = max(1u, addr + size) - 1;
...@@ -36,7 +35,7 @@ nv10_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, ...@@ -36,7 +35,7 @@ nv10_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
} }
void void
nv10_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv10_fb_tile_fini(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
tile->addr = 0; tile->addr = 0;
tile->limit = 0; tile->limit = 0;
...@@ -45,7 +44,7 @@ nv10_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) ...@@ -45,7 +44,7 @@ nv10_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
} }
void void
nv10_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv10_fb_tile_prog(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
nv_wr32(pfb, 0x100244 + (i * 0x10), tile->limit); nv_wr32(pfb, 0x100244 + (i * 0x10), tile->limit);
nv_wr32(pfb, 0x100248 + (i * 0x10), tile->pitch); nv_wr32(pfb, 0x100248 + (i * 0x10), tile->pitch);
...@@ -53,14 +52,14 @@ nv10_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) ...@@ -53,14 +52,14 @@ nv10_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
nv_rd32(pfb, 0x100240 + (i * 0x10)); nv_rd32(pfb, 0x100240 + (i * 0x10));
} }
struct nouveau_oclass * struct nvkm_oclass *
nv10_fb_oclass = &(struct nv04_fb_impl) { nv10_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x10), .base.base.handle = NV_SUBDEV(FB, 0x10),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = _nouveau_fb_init, .init = _nvkm_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv10_ram_oclass, .base.ram = &nv10_ram_oclass,
......
...@@ -23,17 +23,16 @@ ...@@ -23,17 +23,16 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
struct nouveau_oclass * struct nvkm_oclass *
nv1a_fb_oclass = &(struct nv04_fb_impl) { nv1a_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x1a), .base.base.handle = NV_SUBDEV(FB, 0x1a),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = _nouveau_fb_init, .init = _nvkm_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv1a_ram_oclass, .base.ram = &nv1a_ram_oclass,
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv20_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, nv20_fb_tile_init(struct nvkm_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
u32 flags, struct nouveau_fb_tile *tile) u32 flags, struct nvkm_fb_tile *tile)
{ {
tile->addr = 0x00000001 | addr; tile->addr = 0x00000001 | addr;
tile->limit = max(1u, addr + size) - 1; tile->limit = max(1u, addr + size) - 1;
...@@ -40,12 +39,12 @@ nv20_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, ...@@ -40,12 +39,12 @@ nv20_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
} }
static void static void
nv20_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv20_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram->parts, 0x40); u32 tags = round_up(tiles / pfb->ram->parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { if (!nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
if (!(flags & 2)) tile->zcomp = 0x00000000; /* Z16 */ if (!(flags & 2)) tile->zcomp = 0x00000000; /* Z16 */
else tile->zcomp = 0x04000000; /* Z24S8 */ else tile->zcomp = 0x04000000; /* Z24S8 */
tile->zcomp |= tile->tag->offset; tile->zcomp |= tile->tag->offset;
...@@ -57,17 +56,17 @@ nv20_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -57,17 +56,17 @@ nv20_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
} }
void void
nv20_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv20_fb_tile_fini(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
tile->addr = 0; tile->addr = 0;
tile->limit = 0; tile->limit = 0;
tile->pitch = 0; tile->pitch = 0;
tile->zcomp = 0; tile->zcomp = 0;
nouveau_mm_free(&pfb->tags, &tile->tag); nvkm_mm_free(&pfb->tags, &tile->tag);
} }
void void
nv20_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv20_fb_tile_prog(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
nv_wr32(pfb, 0x100244 + (i * 0x10), tile->limit); nv_wr32(pfb, 0x100244 + (i * 0x10), tile->limit);
nv_wr32(pfb, 0x100248 + (i * 0x10), tile->pitch); nv_wr32(pfb, 0x100248 + (i * 0x10), tile->pitch);
...@@ -76,14 +75,14 @@ nv20_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) ...@@ -76,14 +75,14 @@ nv20_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
nv_wr32(pfb, 0x100300 + (i * 0x04), tile->zcomp); nv_wr32(pfb, 0x100300 + (i * 0x04), tile->zcomp);
} }
struct nouveau_oclass * struct nvkm_oclass *
nv20_fb_oclass = &(struct nv04_fb_impl) { nv20_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x20), .base.base.handle = NV_SUBDEV(FB, 0x20),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = _nouveau_fb_init, .init = _nvkm_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv20_ram_oclass, .base.ram = &nv20_ram_oclass,
......
...@@ -23,16 +23,15 @@ ...@@ -23,16 +23,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
static void static void
nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv25_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram->parts, 0x40); u32 tags = round_up(tiles / pfb->ram->parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { if (!nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
if (!(flags & 2)) tile->zcomp = 0x00100000; /* Z16 */ if (!(flags & 2)) tile->zcomp = 0x00100000; /* Z16 */
else tile->zcomp = 0x00200000; /* Z24S8 */ else tile->zcomp = 0x00200000; /* Z24S8 */
tile->zcomp |= tile->tag->offset; tile->zcomp |= tile->tag->offset;
...@@ -42,14 +41,14 @@ nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -42,14 +41,14 @@ nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
} }
} }
struct nouveau_oclass * struct nvkm_oclass *
nv25_fb_oclass = &(struct nv04_fb_impl) { nv25_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x25), .base.base.handle = NV_SUBDEV(FB, 0x25),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = _nouveau_fb_init, .init = _nvkm_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv20_ram_oclass, .base.ram = &nv20_ram_oclass,
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, nv30_fb_tile_init(struct nvkm_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
u32 flags, struct nouveau_fb_tile *tile) u32 flags, struct nvkm_fb_tile *tile)
{ {
/* for performance, select alternate bank offset for zeta */ /* for performance, select alternate bank offset for zeta */
if (!(flags & 4)) { if (!(flags & 4)) {
...@@ -46,12 +45,12 @@ nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, ...@@ -46,12 +45,12 @@ nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
} }
static void static void
nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv30_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram->parts, 0x40); u32 tags = round_up(tiles / pfb->ram->parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { if (!nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
if (flags & 2) tile->zcomp |= 0x01000000; /* Z16 */ if (flags & 2) tile->zcomp |= 0x01000000; /* Z16 */
else tile->zcomp |= 0x02000000; /* Z24S8 */ else tile->zcomp |= 0x02000000; /* Z24S8 */
tile->zcomp |= ((tile->tag->offset ) >> 6); tile->zcomp |= ((tile->tag->offset ) >> 6);
...@@ -65,7 +64,7 @@ nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -65,7 +64,7 @@ nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
static int static int
calc_bias(struct nv04_fb_priv *priv, int k, int i, int j) calc_bias(struct nv04_fb_priv *priv, int k, int i, int j)
{ {
struct nouveau_device *device = nv_device(priv); struct nvkm_device *device = nv_device(priv);
int b = (device->chipset > 0x30 ? int b = (device->chipset > 0x30 ?
nv_rd32(priv, 0x122c + 0x10 * k + 0x4 * j) >> (4 * (i ^ 1)) : nv_rd32(priv, 0x122c + 0x10 * k + 0x4 * j) >> (4 * (i ^ 1)) :
0) & 0xf; 0) & 0xf;
...@@ -88,13 +87,13 @@ calc_ref(struct nv04_fb_priv *priv, int l, int k, int i) ...@@ -88,13 +87,13 @@ calc_ref(struct nv04_fb_priv *priv, int l, int k, int i)
} }
int int
nv30_fb_init(struct nouveau_object *object) nv30_fb_init(struct nvkm_object *object)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
struct nv04_fb_priv *priv = (void *)object; struct nv04_fb_priv *priv = (void *)object;
int ret, i, j; int ret, i, j;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -120,14 +119,14 @@ nv30_fb_init(struct nouveau_object *object) ...@@ -120,14 +119,14 @@ nv30_fb_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv30_fb_oclass = &(struct nv04_fb_impl) { nv30_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x30), .base.base.handle = NV_SUBDEV(FB, 0x30),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv30_fb_init, .init = nv30_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv20_ram_oclass, .base.ram = &nv20_ram_oclass,
......
...@@ -23,16 +23,15 @@ ...@@ -23,16 +23,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
static void static void
nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv35_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram->parts, 0x40); u32 tags = round_up(tiles / pfb->ram->parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { if (!nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
if (flags & 2) tile->zcomp |= 0x04000000; /* Z16 */ if (flags & 2) tile->zcomp |= 0x04000000; /* Z16 */
else tile->zcomp |= 0x08000000; /* Z24S8 */ else tile->zcomp |= 0x08000000; /* Z24S8 */
tile->zcomp |= ((tile->tag->offset ) >> 6); tile->zcomp |= ((tile->tag->offset ) >> 6);
...@@ -43,14 +42,14 @@ nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -43,14 +42,14 @@ nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
} }
} }
struct nouveau_oclass * struct nvkm_oclass *
nv35_fb_oclass = &(struct nv04_fb_impl) { nv35_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x35), .base.base.handle = NV_SUBDEV(FB, 0x35),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv30_fb_init, .init = nv30_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv20_ram_oclass, .base.ram = &nv20_ram_oclass,
......
...@@ -23,16 +23,15 @@ ...@@ -23,16 +23,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
static void static void
nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv36_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram->parts, 0x40); u32 tags = round_up(tiles / pfb->ram->parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { if (!nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
if (flags & 2) tile->zcomp |= 0x10000000; /* Z16 */ if (flags & 2) tile->zcomp |= 0x10000000; /* Z16 */
else tile->zcomp |= 0x20000000; /* Z24S8 */ else tile->zcomp |= 0x20000000; /* Z24S8 */
tile->zcomp |= ((tile->tag->offset ) >> 6); tile->zcomp |= ((tile->tag->offset ) >> 6);
...@@ -43,14 +42,14 @@ nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -43,14 +42,14 @@ nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
} }
} }
struct nouveau_oclass * struct nvkm_oclass *
nv36_fb_oclass = &(struct nv04_fb_impl) { nv36_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x36), .base.base.handle = NV_SUBDEV(FB, 0x36),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv30_fb_init, .init = nv30_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv20_ram_oclass, .base.ram = &nv20_ram_oclass,
......
...@@ -23,17 +23,16 @@ ...@@ -23,17 +23,16 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, nv40_fb_tile_comp(struct nvkm_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile) struct nvkm_fb_tile *tile)
{ {
u32 tiles = DIV_ROUND_UP(size, 0x80); u32 tiles = DIV_ROUND_UP(size, 0x80);
u32 tags = round_up(tiles / pfb->ram->parts, 0x100); u32 tags = round_up(tiles / pfb->ram->parts, 0x100);
if ( (flags & 2) && if ( (flags & 2) &&
!nouveau_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) { !nvkm_mm_head(&pfb->tags, 0, 1, tags, tags, 1, &tile->tag)) {
tile->zcomp = 0x28000000; /* Z24S8_SPLIT_GRAD */ tile->zcomp = 0x28000000; /* Z24S8_SPLIT_GRAD */
tile->zcomp |= ((tile->tag->offset ) >> 8); tile->zcomp |= ((tile->tag->offset ) >> 8);
tile->zcomp |= ((tile->tag->offset + tags - 1) >> 8) << 13; tile->zcomp |= ((tile->tag->offset + tags - 1) >> 8) << 13;
...@@ -44,12 +43,12 @@ nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, ...@@ -44,12 +43,12 @@ nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
} }
static int static int
nv40_fb_init(struct nouveau_object *object) nv40_fb_init(struct nvkm_object *object)
{ {
struct nv04_fb_priv *priv = (void *)object; struct nv04_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -57,14 +56,14 @@ nv40_fb_init(struct nouveau_object *object) ...@@ -57,14 +56,14 @@ nv40_fb_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv40_fb_oclass = &(struct nv04_fb_impl) { nv40_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x40), .base.base.handle = NV_SUBDEV(FB, 0x40),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv40_fb_init, .init = nv40_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv40_ram_oclass, .base.ram = &nv40_ram_oclass,
......
#ifndef __NVKM_FB_NV40_H__ #ifndef __NVKM_FB_NV40_H__
#define __NVKM_FB_NV40_H__ #define __NVKM_FB_NV40_H__
#include "priv.h" #include "priv.h"
struct nv40_ram { struct nv40_ram {
struct nouveau_ram base; struct nvkm_ram base;
u32 ctrl; u32 ctrl;
u32 coef; u32 coef;
}; };
int nv40_ram_calc(struct nvkm_fb *, u32);
int nv40_ram_calc(struct nouveau_fb *, u32); int nv40_ram_prog(struct nvkm_fb *);
int nv40_ram_prog(struct nouveau_fb *); void nv40_ram_tidy(struct nvkm_fb *);
void nv40_ram_tidy(struct nouveau_fb *);
#endif #endif
...@@ -23,11 +23,10 @@ ...@@ -23,11 +23,10 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv41_fb_tile_prog(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit); nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit);
nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch); nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch);
...@@ -37,12 +36,12 @@ nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) ...@@ -37,12 +36,12 @@ nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
} }
int int
nv41_fb_init(struct nouveau_object *object) nv41_fb_init(struct nvkm_object *object)
{ {
struct nv04_fb_priv *priv = (void *)object; struct nv04_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -50,14 +49,14 @@ nv41_fb_init(struct nouveau_object *object) ...@@ -50,14 +49,14 @@ nv41_fb_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv41_fb_oclass = &(struct nv04_fb_impl) { nv41_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x41), .base.base.handle = NV_SUBDEV(FB, 0x41),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv41_fb_init, .init = nv41_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv41_ram_oclass, .base.ram = &nv41_ram_oclass,
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
static void static void
nv44_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, nv44_fb_tile_init(struct nvkm_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
u32 flags, struct nouveau_fb_tile *tile) u32 flags, struct nvkm_fb_tile *tile)
{ {
tile->addr = 0x00000001; /* mode = vram */ tile->addr = 0x00000001; /* mode = vram */
tile->addr |= addr; tile->addr |= addr;
...@@ -37,7 +36,7 @@ nv44_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, ...@@ -37,7 +36,7 @@ nv44_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
} }
void void
nv44_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) nv44_fb_tile_prog(struct nvkm_fb *pfb, int i, struct nvkm_fb_tile *tile)
{ {
nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit); nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit);
nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch); nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch);
...@@ -46,12 +45,12 @@ nv44_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile) ...@@ -46,12 +45,12 @@ nv44_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
} }
int int
nv44_fb_init(struct nouveau_object *object) nv44_fb_init(struct nvkm_object *object)
{ {
struct nv04_fb_priv *priv = (void *)object; struct nv04_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -60,14 +59,14 @@ nv44_fb_init(struct nouveau_object *object) ...@@ -60,14 +59,14 @@ nv44_fb_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv44_fb_oclass = &(struct nv04_fb_impl) { nv44_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x44), .base.base.handle = NV_SUBDEV(FB, 0x44),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv44_fb_init, .init = nv44_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv44_ram_oclass, .base.ram = &nv44_ram_oclass,
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
void void
nv46_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, nv46_fb_tile_init(struct nvkm_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
u32 flags, struct nouveau_fb_tile *tile) u32 flags, struct nvkm_fb_tile *tile)
{ {
/* for performance, select alternate bank offset for zeta */ /* for performance, select alternate bank offset for zeta */
if (!(flags & 4)) tile->addr = (0 << 3); if (!(flags & 4)) tile->addr = (0 << 3);
...@@ -40,14 +39,14 @@ nv46_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, ...@@ -40,14 +39,14 @@ nv46_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
tile->pitch = pitch; tile->pitch = pitch;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv46_fb_oclass = &(struct nv04_fb_impl) { nv46_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x46), .base.base.handle = NV_SUBDEV(FB, 0x46),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv44_fb_init, .init = nv44_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv44_ram_oclass, .base.ram = &nv44_ram_oclass,
......
...@@ -23,17 +23,16 @@ ...@@ -23,17 +23,16 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
struct nouveau_oclass * struct nvkm_oclass *
nv47_fb_oclass = &(struct nv04_fb_impl) { nv47_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x47), .base.base.handle = NV_SUBDEV(FB, 0x47),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv41_fb_init, .init = nv41_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv41_ram_oclass, .base.ram = &nv41_ram_oclass,
......
...@@ -23,17 +23,16 @@ ...@@ -23,17 +23,16 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
struct nouveau_oclass * struct nvkm_oclass *
nv49_fb_oclass = &(struct nv04_fb_impl) { nv49_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x49), .base.base.handle = NV_SUBDEV(FB, 0x49),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv41_fb_init, .init = nv41_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv49_ram_oclass, .base.ram = &nv49_ram_oclass,
......
...@@ -23,17 +23,16 @@ ...@@ -23,17 +23,16 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "nv04.h" #include "nv04.h"
struct nouveau_oclass * struct nvkm_oclass *
nv4e_fb_oclass = &(struct nv04_fb_impl) { nv4e_fb_oclass = &(struct nv04_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x4e), .base.base.handle = NV_SUBDEV(FB, 0x4e),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_fb_ctor, .ctor = nv04_fb_ctor,
.dtor = _nouveau_fb_dtor, .dtor = _nvkm_fb_dtor,
.init = nv44_fb_init, .init = nv44_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv04_fb_memtype_valid, .base.memtype = nv04_fb_memtype_valid,
.base.ram = &nv4e_ram_oclass, .base.ram = &nv4e_ram_oclass,
......
...@@ -21,15 +21,11 @@ ...@@ -21,15 +21,11 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h"
#include <core/client.h> #include <core/client.h>
#include <core/enum.h>
#include <core/engctx.h> #include <core/engctx.h>
#include <core/object.h> #include <core/enum.h>
#include <subdev/bios.h>
#include "nv50.h"
int int
nv50_fb_memtype[0x80] = { nv50_fb_memtype[0x80] = {
...@@ -44,12 +40,12 @@ nv50_fb_memtype[0x80] = { ...@@ -44,12 +40,12 @@ nv50_fb_memtype[0x80] = {
}; };
bool bool
nv50_fb_memtype_valid(struct nouveau_fb *pfb, u32 memtype) nv50_fb_memtype_valid(struct nvkm_fb *pfb, u32 memtype)
{ {
return nv50_fb_memtype[(memtype & 0xff00) >> 8] != 0; return nv50_fb_memtype[(memtype & 0xff00) >> 8] != 0;
} }
static const struct nouveau_enum vm_dispatch_subclients[] = { static const struct nvkm_enum vm_dispatch_subclients[] = {
{ 0x00000000, "GRCTX", NULL }, { 0x00000000, "GRCTX", NULL },
{ 0x00000001, "NOTIFY", NULL }, { 0x00000001, "NOTIFY", NULL },
{ 0x00000002, "QUERY", NULL }, { 0x00000002, "QUERY", NULL },
...@@ -60,14 +56,14 @@ static const struct nouveau_enum vm_dispatch_subclients[] = { ...@@ -60,14 +56,14 @@ static const struct nouveau_enum vm_dispatch_subclients[] = {
{} {}
}; };
static const struct nouveau_enum vm_ccache_subclients[] = { static const struct nvkm_enum vm_ccache_subclients[] = {
{ 0x00000000, "CB", NULL }, { 0x00000000, "CB", NULL },
{ 0x00000001, "TIC", NULL }, { 0x00000001, "TIC", NULL },
{ 0x00000002, "TSC", NULL }, { 0x00000002, "TSC", NULL },
{} {}
}; };
static const struct nouveau_enum vm_prop_subclients[] = { static const struct nvkm_enum vm_prop_subclients[] = {
{ 0x00000000, "RT0", NULL }, { 0x00000000, "RT0", NULL },
{ 0x00000001, "RT1", NULL }, { 0x00000001, "RT1", NULL },
{ 0x00000002, "RT2", NULL }, { 0x00000002, "RT2", NULL },
...@@ -84,19 +80,19 @@ static const struct nouveau_enum vm_prop_subclients[] = { ...@@ -84,19 +80,19 @@ static const struct nouveau_enum vm_prop_subclients[] = {
{} {}
}; };
static const struct nouveau_enum vm_pfifo_subclients[] = { static const struct nvkm_enum vm_pfifo_subclients[] = {
{ 0x00000000, "PUSHBUF", NULL }, { 0x00000000, "PUSHBUF", NULL },
{ 0x00000001, "SEMAPHORE", NULL }, { 0x00000001, "SEMAPHORE", NULL },
{} {}
}; };
static const struct nouveau_enum vm_bar_subclients[] = { static const struct nvkm_enum vm_bar_subclients[] = {
{ 0x00000000, "FB", NULL }, { 0x00000000, "FB", NULL },
{ 0x00000001, "IN", NULL }, { 0x00000001, "IN", NULL },
{} {}
}; };
static const struct nouveau_enum vm_client[] = { static const struct nvkm_enum vm_client[] = {
{ 0x00000000, "STRMOUT", NULL }, { 0x00000000, "STRMOUT", NULL },
{ 0x00000003, "DISPATCH", vm_dispatch_subclients }, { 0x00000003, "DISPATCH", vm_dispatch_subclients },
{ 0x00000004, "PFIFO_WRITE", NULL }, { 0x00000004, "PFIFO_WRITE", NULL },
...@@ -115,7 +111,7 @@ static const struct nouveau_enum vm_client[] = { ...@@ -115,7 +111,7 @@ static const struct nouveau_enum vm_client[] = {
{} {}
}; };
static const struct nouveau_enum vm_engine[] = { static const struct nvkm_enum vm_engine[] = {
{ 0x00000000, "PGRAPH", NULL, NVDEV_ENGINE_GR }, { 0x00000000, "PGRAPH", NULL, NVDEV_ENGINE_GR },
{ 0x00000001, "PVP", NULL, NVDEV_ENGINE_VP }, { 0x00000001, "PVP", NULL, NVDEV_ENGINE_VP },
{ 0x00000004, "PEEPHOLE", NULL }, { 0x00000004, "PEEPHOLE", NULL },
...@@ -132,7 +128,7 @@ static const struct nouveau_enum vm_engine[] = { ...@@ -132,7 +128,7 @@ static const struct nouveau_enum vm_engine[] = {
{} {}
}; };
static const struct nouveau_enum vm_fault[] = { static const struct nvkm_enum vm_fault[] = {
{ 0x00000000, "PT_NOT_PRESENT", NULL }, { 0x00000000, "PT_NOT_PRESENT", NULL },
{ 0x00000001, "PT_TOO_SHORT", NULL }, { 0x00000001, "PT_TOO_SHORT", NULL },
{ 0x00000002, "PAGE_NOT_PRESENT", NULL }, { 0x00000002, "PAGE_NOT_PRESENT", NULL },
...@@ -146,13 +142,13 @@ static const struct nouveau_enum vm_fault[] = { ...@@ -146,13 +142,13 @@ static const struct nouveau_enum vm_fault[] = {
}; };
static void static void
nv50_fb_intr(struct nouveau_subdev *subdev) nv50_fb_intr(struct nvkm_subdev *subdev)
{ {
struct nouveau_device *device = nv_device(subdev); struct nvkm_device *device = nv_device(subdev);
struct nouveau_engine *engine; struct nvkm_engine *engine;
struct nv50_fb_priv *priv = (void *)subdev; struct nv50_fb_priv *priv = (void *)subdev;
const struct nouveau_enum *en, *cl; const struct nvkm_enum *en, *cl;
struct nouveau_object *engctx = NULL; struct nvkm_object *engctx = NULL;
u32 trap[6], idx, chan; u32 trap[6], idx, chan;
u8 st0, st1, st2, st3; u8 st0, st1, st2, st3;
int i; int i;
...@@ -183,21 +179,21 @@ nv50_fb_intr(struct nouveau_subdev *subdev) ...@@ -183,21 +179,21 @@ nv50_fb_intr(struct nouveau_subdev *subdev)
} }
chan = (trap[2] << 16) | trap[1]; chan = (trap[2] << 16) | trap[1];
en = nouveau_enum_find(vm_engine, st0); en = nvkm_enum_find(vm_engine, st0);
if (en && en->data2) { if (en && en->data2) {
const struct nouveau_enum *orig_en = en; const struct nvkm_enum *orig_en = en;
while (en->name && en->value == st0 && en->data2) { while (en->name && en->value == st0 && en->data2) {
engine = nouveau_engine(subdev, en->data2); engine = nvkm_engine(subdev, en->data2);
/*XXX: clean this up */ /*XXX: clean this up */
if (!engine && en->data2 == NVDEV_ENGINE_BSP) if (!engine && en->data2 == NVDEV_ENGINE_BSP)
engine = nouveau_engine(subdev, NVDEV_ENGINE_MSVLD); engine = nvkm_engine(subdev, NVDEV_ENGINE_MSVLD);
if (!engine && en->data2 == NVDEV_ENGINE_CIPHER) if (!engine && en->data2 == NVDEV_ENGINE_CIPHER)
engine = nouveau_engine(subdev, NVDEV_ENGINE_SEC); engine = nvkm_engine(subdev, NVDEV_ENGINE_SEC);
if (!engine && en->data2 == NVDEV_ENGINE_VP) if (!engine && en->data2 == NVDEV_ENGINE_VP)
engine = nouveau_engine(subdev, NVDEV_ENGINE_MSPDEC); engine = nvkm_engine(subdev, NVDEV_ENGINE_MSPDEC);
if (engine) { if (engine) {
engctx = nouveau_engctx_get(engine, chan); engctx = nvkm_engctx_get(engine, chan);
if (engctx) if (engctx)
break; break;
} }
...@@ -210,23 +206,23 @@ nv50_fb_intr(struct nouveau_subdev *subdev) ...@@ -210,23 +206,23 @@ nv50_fb_intr(struct nouveau_subdev *subdev)
nv_error(priv, "trapped %s at 0x%02x%04x%04x on channel 0x%08x [%s] ", nv_error(priv, "trapped %s at 0x%02x%04x%04x on channel 0x%08x [%s] ",
(trap[5] & 0x00000100) ? "read" : "write", (trap[5] & 0x00000100) ? "read" : "write",
trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff, chan, trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff, chan,
nouveau_client_name(engctx)); nvkm_client_name(engctx));
nouveau_engctx_put(engctx); nvkm_engctx_put(engctx);
if (en) if (en)
pr_cont("%s/", en->name); pr_cont("%s/", en->name);
else else
pr_cont("%02x/", st0); pr_cont("%02x/", st0);
cl = nouveau_enum_find(vm_client, st2); cl = nvkm_enum_find(vm_client, st2);
if (cl) if (cl)
pr_cont("%s/", cl->name); pr_cont("%s/", cl->name);
else else
pr_cont("%02x/", st2); pr_cont("%02x/", st2);
if (cl && cl->data) cl = nouveau_enum_find(cl->data, st3); if (cl && cl->data) cl = nvkm_enum_find(cl->data, st3);
else if (en && en->data) cl = nouveau_enum_find(en->data, st3); else if (en && en->data) cl = nvkm_enum_find(en->data, st3);
else cl = NULL; else cl = NULL;
if (cl) if (cl)
pr_cont("%s", cl->name); pr_cont("%s", cl->name);
...@@ -234,7 +230,7 @@ nv50_fb_intr(struct nouveau_subdev *subdev) ...@@ -234,7 +230,7 @@ nv50_fb_intr(struct nouveau_subdev *subdev)
pr_cont("%02x", st3); pr_cont("%02x", st3);
pr_cont(" reason: "); pr_cont(" reason: ");
en = nouveau_enum_find(vm_fault, st1); en = nvkm_enum_find(vm_fault, st1);
if (en) if (en)
pr_cont("%s\n", en->name); pr_cont("%s\n", en->name);
else else
...@@ -242,15 +238,15 @@ nv50_fb_intr(struct nouveau_subdev *subdev) ...@@ -242,15 +238,15 @@ nv50_fb_intr(struct nouveau_subdev *subdev)
} }
int int
nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv50_fb_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_device *device = nv_device(parent); struct nvkm_device *device = nv_device(parent);
struct nv50_fb_priv *priv; struct nv50_fb_priv *priv;
int ret; int ret;
ret = nouveau_fb_create(parent, engine, oclass, &priv); ret = nvkm_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -271,9 +267,9 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -271,9 +267,9 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
} }
void void
nv50_fb_dtor(struct nouveau_object *object) nv50_fb_dtor(struct nvkm_object *object)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
struct nv50_fb_priv *priv = (void *)object; struct nv50_fb_priv *priv = (void *)object;
if (priv->r100c08_page) { if (priv->r100c08_page) {
...@@ -282,17 +278,17 @@ nv50_fb_dtor(struct nouveau_object *object) ...@@ -282,17 +278,17 @@ nv50_fb_dtor(struct nouveau_object *object)
__free_page(priv->r100c08_page); __free_page(priv->r100c08_page);
} }
nouveau_fb_destroy(&priv->base); nvkm_fb_destroy(&priv->base);
} }
int int
nv50_fb_init(struct nouveau_object *object) nv50_fb_init(struct nvkm_object *object)
{ {
struct nv50_fb_impl *impl = (void *)object->oclass; struct nv50_fb_impl *impl = (void *)object->oclass;
struct nv50_fb_priv *priv = (void *)object; struct nv50_fb_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_fb_init(&priv->base); ret = nvkm_fb_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -308,14 +304,14 @@ nv50_fb_init(struct nouveau_object *object) ...@@ -308,14 +304,14 @@ nv50_fb_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass * struct nvkm_oclass *
nv50_fb_oclass = &(struct nv50_fb_impl) { nv50_fb_oclass = &(struct nv50_fb_impl) {
.base.base.handle = NV_SUBDEV(FB, 0x50), .base.base.handle = NV_SUBDEV(FB, 0x50),
.base.base.ofuncs = &(struct nouveau_ofuncs) { .base.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_fb_ctor, .ctor = nv50_fb_ctor,
.dtor = nv50_fb_dtor, .dtor = nv50_fb_dtor,
.init = nv50_fb_init, .init = nv50_fb_init,
.fini = _nouveau_fb_fini, .fini = _nvkm_fb_fini,
}, },
.base.memtype = nv50_fb_memtype_valid, .base.memtype = nv50_fb_memtype_valid,
.base.ram = &nv50_ram_oclass, .base.ram = &nv50_ram_oclass,
......
#ifndef __NVKM_FB_NV50_H__ #ifndef __NVKM_FB_NV50_H__
#define __NVKM_FB_NV50_H__ #define __NVKM_FB_NV50_H__
#include "priv.h" #include "priv.h"
struct nv50_fb_priv { struct nv50_fb_priv {
struct nouveau_fb base; struct nvkm_fb base;
struct page *r100c08_page; struct page *r100c08_page;
dma_addr_t r100c08; dma_addr_t r100c08;
}; };
int nv50_fb_ctor(struct nouveau_object *, struct nouveau_object *, int nv50_fb_ctor(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, void *, u32, struct nvkm_oclass *, void *, u32,
struct nouveau_object **); struct nvkm_object **);
void nv50_fb_dtor(struct nouveau_object *); void nv50_fb_dtor(struct nvkm_object *);
int nv50_fb_init(struct nouveau_object *); int nv50_fb_init(struct nvkm_object *);
struct nv50_fb_impl { struct nv50_fb_impl {
struct nouveau_fb_impl base; struct nvkm_fb_impl base;
u32 trap; u32 trap;
}; };
#define nv50_ram_create(p,e,o,d) \ #define nv50_ram_create(p,e,o,d) \
nv50_ram_create_((p), (e), (o), sizeof(**d), (void **)d) nv50_ram_create_((p), (e), (o), sizeof(**d), (void **)d)
int nv50_ram_create_(struct nouveau_object *, struct nouveau_object *, int nv50_ram_create_(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, int, void **); struct nvkm_oclass *, int, void **);
int nv50_ram_get(struct nouveau_fb *, u64 size, u32 align, u32 ncmin, int nv50_ram_get(struct nvkm_fb *, u64 size, u32 align, u32 ncmin,
u32 memtype, struct nouveau_mem **); u32 memtype, struct nvkm_mem **);
void nv50_ram_put(struct nouveau_fb *, struct nouveau_mem **); void nv50_ram_put(struct nvkm_fb *, struct nvkm_mem **);
void __nv50_ram_put(struct nouveau_fb *, struct nouveau_mem *); void __nv50_ram_put(struct nvkm_fb *, struct nvkm_mem *);
extern int nv50_fb_memtype[0x80]; extern int nv50_fb_memtype[0x80];
#endif #endif
#ifndef __NVKM_RAM_NVC0_H__
#define __NVKM_RAM_NVC0_H__
#include "priv.h"
#include "nv50.h"
struct nvc0_fb_priv {
struct nouveau_fb base;
struct page *r100c10_page;
dma_addr_t r100c10;
};
int nvc0_fb_ctor(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, void *, u32,
struct nouveau_object **);
void nvc0_fb_dtor(struct nouveau_object *);
int nvc0_fb_init(struct nouveau_object *);
bool nvc0_fb_memtype_valid(struct nouveau_fb *, u32);
#define nvc0_ram_create(p,e,o,m,d) \
nvc0_ram_create_((p), (e), (o), (m), sizeof(**d), (void **)d)
int nvc0_ram_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, u32, int, void **);
int nvc0_ram_get(struct nouveau_fb *, u64, u32, u32, u32,
struct nouveau_mem **);
void nvc0_ram_put(struct nouveau_fb *, struct nouveau_mem **);
int nve0_ram_init(struct nouveau_object*);
#endif
#ifndef __NVKM_FB_PRIV_H__ #ifndef __NVKM_FB_PRIV_H__
#define __NVKM_FB_PRIV_H__ #define __NVKM_FB_PRIV_H__
#include <subdev/fb.h> #include <subdev/fb.h>
struct nvkm_bios;
#define nouveau_ram_create(p,e,o,d) \ #define nvkm_ram_create(p,e,o,d) \
nouveau_object_create_((p), (e), (o), 0, sizeof(**d), (void **)d) nvkm_object_create_((p), (e), (o), 0, sizeof(**d), (void **)d)
#define nouveau_ram_destroy(p) \ #define nvkm_ram_destroy(p) \
nouveau_object_destroy(&(p)->base) nvkm_object_destroy(&(p)->base)
#define nouveau_ram_init(p) \ #define nvkm_ram_init(p) \
nouveau_object_init(&(p)->base) nvkm_object_init(&(p)->base)
#define nouveau_ram_fini(p,s) \ #define nvkm_ram_fini(p,s) \
nouveau_object_fini(&(p)->base, (s)) nvkm_object_fini(&(p)->base, (s))
#define nouveau_ram_create_(p,e,o,s,d) \ #define nvkm_ram_create_(p,e,o,s,d) \
nouveau_object_create_((p), (e), (o), 0, (s), (void **)d) nvkm_object_create_((p), (e), (o), 0, (s), (void **)d)
#define _nouveau_ram_dtor nouveau_object_destroy #define _nvkm_ram_dtor nvkm_object_destroy
#define _nouveau_ram_init nouveau_object_init #define _nvkm_ram_init nvkm_object_init
#define _nouveau_ram_fini nouveau_object_fini #define _nvkm_ram_fini nvkm_object_fini
extern struct nouveau_oclass nv04_ram_oclass; extern struct nvkm_oclass nv04_ram_oclass;
extern struct nouveau_oclass nv10_ram_oclass; extern struct nvkm_oclass nv10_ram_oclass;
extern struct nouveau_oclass nv1a_ram_oclass; extern struct nvkm_oclass nv1a_ram_oclass;
extern struct nouveau_oclass nv20_ram_oclass; extern struct nvkm_oclass nv20_ram_oclass;
extern struct nouveau_oclass nv40_ram_oclass; extern struct nvkm_oclass nv40_ram_oclass;
extern struct nouveau_oclass nv41_ram_oclass; extern struct nvkm_oclass nv41_ram_oclass;
extern struct nouveau_oclass nv44_ram_oclass; extern struct nvkm_oclass nv44_ram_oclass;
extern struct nouveau_oclass nv49_ram_oclass; extern struct nvkm_oclass nv49_ram_oclass;
extern struct nouveau_oclass nv4e_ram_oclass; extern struct nvkm_oclass nv4e_ram_oclass;
extern struct nouveau_oclass nv50_ram_oclass; extern struct nvkm_oclass nv50_ram_oclass;
extern struct nouveau_oclass nva3_ram_oclass; extern struct nvkm_oclass gt215_ram_oclass;
extern struct nouveau_oclass nvaa_ram_oclass; extern struct nvkm_oclass mcp77_ram_oclass;
extern struct nouveau_oclass nvc0_ram_oclass; extern struct nvkm_oclass gf100_ram_oclass;
extern struct nouveau_oclass nve0_ram_oclass; extern struct nvkm_oclass gk104_ram_oclass;
extern struct nouveau_oclass gk20a_ram_oclass; extern struct nvkm_oclass gk20a_ram_oclass;
extern struct nouveau_oclass gm107_ram_oclass; extern struct nvkm_oclass gm107_ram_oclass;
int nouveau_sddr2_calc(struct nouveau_ram *ram); int nvkm_sddr2_calc(struct nvkm_ram *ram);
int nouveau_sddr3_calc(struct nouveau_ram *ram); int nvkm_sddr3_calc(struct nvkm_ram *ram);
int nouveau_gddr3_calc(struct nouveau_ram *ram); int nvkm_gddr3_calc(struct nvkm_ram *ram);
int nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts); int nvkm_gddr5_calc(struct nvkm_ram *ram, bool nuts);
#define nouveau_fb_create(p,e,c,d) \ #define nvkm_fb_create(p,e,c,d) \
nouveau_fb_create_((p), (e), (c), sizeof(**d), (void **)d) nvkm_fb_create_((p), (e), (c), sizeof(**d), (void **)d)
#define nouveau_fb_destroy(p) ({ \ #define nvkm_fb_destroy(p) ({ \
struct nouveau_fb *pfb = (p); \ struct nvkm_fb *pfb = (p); \
_nouveau_fb_dtor(nv_object(pfb)); \ _nvkm_fb_dtor(nv_object(pfb)); \
}) })
#define nouveau_fb_init(p) ({ \ #define nvkm_fb_init(p) ({ \
struct nouveau_fb *pfb = (p); \ struct nvkm_fb *pfb = (p); \
_nouveau_fb_init(nv_object(pfb)); \ _nvkm_fb_init(nv_object(pfb)); \
}) })
#define nouveau_fb_fini(p,s) ({ \ #define nvkm_fb_fini(p,s) ({ \
struct nouveau_fb *pfb = (p); \ struct nvkm_fb *pfb = (p); \
_nouveau_fb_fini(nv_object(pfb), (s)); \ _nvkm_fb_fini(nv_object(pfb), (s)); \
}) })
int nouveau_fb_create_(struct nouveau_object *, struct nouveau_object *, int nvkm_fb_create_(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, int, void **); struct nvkm_oclass *, int, void **);
void _nouveau_fb_dtor(struct nouveau_object *); void _nvkm_fb_dtor(struct nvkm_object *);
int _nouveau_fb_init(struct nouveau_object *); int _nvkm_fb_init(struct nvkm_object *);
int _nouveau_fb_fini(struct nouveau_object *, bool); int _nvkm_fb_fini(struct nvkm_object *, bool);
struct nouveau_fb_impl { struct nvkm_fb_impl {
struct nouveau_oclass base; struct nvkm_oclass base;
struct nouveau_oclass *ram; struct nvkm_oclass *ram;
bool (*memtype)(struct nouveau_fb *, u32); bool (*memtype)(struct nvkm_fb *, u32);
}; };
bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype); bool nv04_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
bool nv50_fb_memtype_valid(struct nouveau_fb *, u32 memtype); bool nv50_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
struct nouveau_bios;
int nouveau_fb_bios_memtype(struct nouveau_bios *);
int nvkm_fb_bios_memtype(struct nvkm_bios *);
#endif #endif
#ifndef __NVKM_FBRAM_FUC_H__ #ifndef __NVKM_FBRAM_FUC_H__
#define __NVKM_FBRAM_FUC_H__ #define __NVKM_FBRAM_FUC_H__
#include <subdev/pmu.h> #include <subdev/pmu.h>
struct ramfuc { struct ramfuc {
struct nouveau_memx *memx; struct nvkm_memx *memx;
struct nouveau_fb *pfb; struct nvkm_fb *pfb;
int sequence; int sequence;
}; };
...@@ -55,12 +54,12 @@ ramfuc_reg(u32 addr) ...@@ -55,12 +54,12 @@ ramfuc_reg(u32 addr)
} }
static inline int static inline int
ramfuc_init(struct ramfuc *ram, struct nouveau_fb *pfb) ramfuc_init(struct ramfuc *ram, struct nvkm_fb *pfb)
{ {
struct nouveau_pmu *pmu = nouveau_pmu(pfb); struct nvkm_pmu *pmu = nvkm_pmu(pfb);
int ret; int ret;
ret = nouveau_memx_init(pmu, &ram->memx); ret = nvkm_memx_init(pmu, &ram->memx);
if (ret) if (ret)
return ret; return ret;
...@@ -74,7 +73,7 @@ ramfuc_exec(struct ramfuc *ram, bool exec) ...@@ -74,7 +73,7 @@ ramfuc_exec(struct ramfuc *ram, bool exec)
{ {
int ret = 0; int ret = 0;
if (ram->pfb) { if (ram->pfb) {
ret = nouveau_memx_fini(&ram->memx, exec); ret = nvkm_memx_fini(&ram->memx, exec);
ram->pfb = NULL; ram->pfb = NULL;
} }
return ret; return ret;
...@@ -97,10 +96,8 @@ ramfuc_wr32(struct ramfuc *ram, struct ramfuc_reg *reg, u32 data) ...@@ -97,10 +96,8 @@ ramfuc_wr32(struct ramfuc *ram, struct ramfuc_reg *reg, u32 data)
reg->data = data; reg->data = data;
for (mask = reg->mask; mask > 0; mask = (mask & ~1) >> 1) { for (mask = reg->mask; mask > 0; mask = (mask & ~1) >> 1) {
if (mask & 1) { if (mask & 1)
nouveau_memx_wr32(ram->memx, reg->addr+off, reg->data); nvkm_memx_wr32(ram->memx, reg->addr+off, reg->data);
}
off += reg->stride; off += reg->stride;
} }
} }
...@@ -125,45 +122,45 @@ ramfuc_mask(struct ramfuc *ram, struct ramfuc_reg *reg, u32 mask, u32 data) ...@@ -125,45 +122,45 @@ ramfuc_mask(struct ramfuc *ram, struct ramfuc_reg *reg, u32 mask, u32 data)
static inline void static inline void
ramfuc_wait(struct ramfuc *ram, u32 addr, u32 mask, u32 data, u32 nsec) ramfuc_wait(struct ramfuc *ram, u32 addr, u32 mask, u32 data, u32 nsec)
{ {
nouveau_memx_wait(ram->memx, addr, mask, data, nsec); nvkm_memx_wait(ram->memx, addr, mask, data, nsec);
} }
static inline void static inline void
ramfuc_nsec(struct ramfuc *ram, u32 nsec) ramfuc_nsec(struct ramfuc *ram, u32 nsec)
{ {
nouveau_memx_nsec(ram->memx, nsec); nvkm_memx_nsec(ram->memx, nsec);
} }
static inline void static inline void
ramfuc_wait_vblank(struct ramfuc *ram) ramfuc_wait_vblank(struct ramfuc *ram)
{ {
nouveau_memx_wait_vblank(ram->memx); nvkm_memx_wait_vblank(ram->memx);
} }
static inline void static inline void
ramfuc_train(struct ramfuc *ram) ramfuc_train(struct ramfuc *ram)
{ {
nouveau_memx_train(ram->memx); nvkm_memx_train(ram->memx);
} }
static inline int static inline int
ramfuc_train_result(struct nouveau_fb *pfb, u32 *result, u32 rsize) ramfuc_train_result(struct nvkm_fb *pfb, u32 *result, u32 rsize)
{ {
struct nouveau_pmu *pmu = nouveau_pmu(pfb); struct nvkm_pmu *pmu = nvkm_pmu(pfb);
return nouveau_memx_train_result(pmu, result, rsize); return nvkm_memx_train_result(pmu, result, rsize);
} }
static inline void static inline void
ramfuc_block(struct ramfuc *ram) ramfuc_block(struct ramfuc *ram)
{ {
nouveau_memx_block(ram->memx); nvkm_memx_block(ram->memx);
} }
static inline void static inline void
ramfuc_unblock(struct ramfuc *ram) ramfuc_unblock(struct ramfuc *ram)
{ {
nouveau_memx_unblock(ram->memx); nvkm_memx_unblock(ram->memx);
} }
#define ram_init(s,p) ramfuc_init(&(s)->base, (p)) #define ram_init(s,p) ramfuc_init(&(s)->base, (p))
...@@ -180,5 +177,4 @@ ramfuc_unblock(struct ramfuc *ram) ...@@ -180,5 +177,4 @@ ramfuc_unblock(struct ramfuc *ram)
#define ram_train_result(s,r,l) ramfuc_train_result((s), (r), (l)) #define ram_train_result(s,r,l) ramfuc_train_result((s), (r), (l))
#define ram_block(s) ramfuc_block(&(s)->base) #define ram_block(s) ramfuc_block(&(s)->base)
#define ram_unblock(s) ramfuc_unblock(&(s)->base) #define ram_unblock(s) ramfuc_unblock(&(s)->base)
#endif #endif
...@@ -19,20 +19,17 @@ ...@@ -19,20 +19,17 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include "priv.h" #include "priv.h"
#include <subdev/fb.h>
struct gk20a_mem { struct gk20a_mem {
struct nouveau_mem base; struct nvkm_mem base;
void *cpuaddr; void *cpuaddr;
dma_addr_t handle; dma_addr_t handle;
}; };
#define to_gk20a_mem(m) container_of(m, struct gk20a_mem, base) #define to_gk20a_mem(m) container_of(m, struct gk20a_mem, base)
static void static void
gk20a_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem) gk20a_ram_put(struct nvkm_fb *pfb, struct nvkm_mem **pmem)
{ {
struct device *dev = nv_device_base(nv_device(pfb)); struct device *dev = nv_device_base(nv_device(pfb));
struct gk20a_mem *mem = to_gk20a_mem(*pmem); struct gk20a_mem *mem = to_gk20a_mem(*pmem);
...@@ -50,8 +47,8 @@ gk20a_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem) ...@@ -50,8 +47,8 @@ gk20a_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem)
} }
static int static int
gk20a_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, gk20a_ram_get(struct nvkm_fb *pfb, u64 size, u32 align, u32 ncmin,
u32 memtype, struct nouveau_mem **pmem) u32 memtype, struct nvkm_mem **pmem)
{ {
struct device *dev = nv_device_base(nv_device(pfb)); struct device *dev = nv_device_base(nv_device(pfb));
struct gk20a_mem *mem; struct gk20a_mem *mem;
...@@ -116,19 +113,18 @@ gk20a_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, ...@@ -116,19 +113,18 @@ gk20a_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
mem->base.pages[i] = mem->handle + (PAGE_SIZE * i); mem->base.pages[i] = mem->handle + (PAGE_SIZE * i);
mem->base.offset = (u64)mem->base.pages[0]; mem->base.offset = (u64)mem->base.pages[0];
return 0; return 0;
} }
static int static int
gk20a_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, gk20a_ram_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 datasize, struct nvkm_oclass *oclass, void *data, u32 datasize,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_ram *ram; struct nvkm_ram *ram;
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -137,16 +133,15 @@ gk20a_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -137,16 +133,15 @@ gk20a_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ram->get = gk20a_ram_get; ram->get = gk20a_ram_get;
ram->put = gk20a_ram_put; ram->put = gk20a_ram_put;
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
gk20a_ram_oclass = { gk20a_ram_oclass = {
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = gk20a_ram_ctor, .ctor = gk20a_ram_ctor,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
}, },
}; };
...@@ -21,22 +21,21 @@ ...@@ -21,22 +21,21 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "gf100.h"
#include "nvc0.h"
struct gm107_ram { struct gm107_ram {
struct nouveau_ram base; struct nvkm_ram base;
}; };
static int static int
gm107_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, gm107_ram_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct gm107_ram *ram; struct gm107_ram *ram;
int ret; int ret;
ret = nvc0_ram_create(parent, engine, oclass, 0x021c14, &ram); ret = gf100_ram_create(parent, engine, oclass, 0x021c14, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -44,13 +43,13 @@ gm107_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -44,13 +43,13 @@ gm107_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
gm107_ram_oclass = { gm107_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = gm107_ram_ctor, .ctor = gm107_ram_ctor,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = nve0_ram_init, .init = gk104_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,26 +21,25 @@ ...@@ -21,26 +21,25 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h" #include "nv50.h"
struct nvaa_ram_priv { struct mcp77_ram_priv {
struct nouveau_ram base; struct nvkm_ram base;
u64 poller_base; u64 poller_base;
}; };
static int static int
nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, mcp77_ram_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 datasize, struct nvkm_oclass *oclass, void *data, u32 datasize,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
u32 rsvd_head = ( 256 * 1024); /* vga memory */ u32 rsvd_head = ( 256 * 1024); /* vga memory */
u32 rsvd_tail = (1024 * 1024); /* vbios etc */ u32 rsvd_tail = (1024 * 1024); /* vbios etc */
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nvaa_ram_priv *priv; struct mcp77_ram_priv *priv;
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &priv); ret = nvkm_ram_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -52,9 +51,9 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -52,9 +51,9 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
rsvd_tail += 0x1000; rsvd_tail += 0x1000;
priv->poller_base = priv->base.size - rsvd_tail; priv->poller_base = priv->base.size - rsvd_tail;
ret = nouveau_mm_init(&pfb->vram, rsvd_head >> 12, ret = nvkm_mm_init(&pfb->vram, rsvd_head >> 12,
(priv->base.size - (rsvd_head + rsvd_tail)) >> 12, (priv->base.size - (rsvd_head + rsvd_tail)) >> 12,
1); 1);
if (ret) if (ret)
return ret; return ret;
...@@ -64,14 +63,14 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -64,14 +63,14 @@ nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
} }
static int static int
nvaa_ram_init(struct nouveau_object *object) mcp77_ram_init(struct nvkm_object *object)
{ {
struct nouveau_fb *pfb = nouveau_fb(object); struct nvkm_fb *pfb = nvkm_fb(object);
struct nvaa_ram_priv *priv = (void *)object; struct mcp77_ram_priv *priv = (void *)object;
int ret; int ret;
u64 dniso, hostnb, flush; u64 dniso, hostnb, flush;
ret = nouveau_ram_init(&priv->base); ret = nvkm_ram_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -88,16 +87,15 @@ nvaa_ram_init(struct nouveau_object *object) ...@@ -88,16 +87,15 @@ nvaa_ram_init(struct nouveau_object *object)
nv_mask(pfb, 0x100c14, 0x00000000, 0x00000002); nv_mask(pfb, 0x100c14, 0x00000000, 0x00000002);
nv_wr32(pfb, 0x100c24, flush); nv_wr32(pfb, 0x100c24, flush);
nv_mask(pfb, 0x100c14, 0x00000000, 0x00010000); nv_mask(pfb, 0x100c14, 0x00000000, 0x00010000);
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nvaa_ram_oclass = { mcp77_ram_oclass = {
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nvaa_ram_ctor, .ctor = mcp77_ram_ctor,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = nvaa_ram_init, .init = mcp77_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
}, },
}; };
...@@ -21,22 +21,20 @@ ...@@ -21,22 +21,20 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/fb/regsnv04.h>
#include "priv.h" #include "priv.h"
#include "regsnv04.h"
static int static int
nv04_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv04_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
u32 boot0 = nv_rd32(pfb, NV04_PFB_BOOT_0); u32 boot0 = nv_rd32(pfb, NV04_PFB_BOOT_0);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -65,16 +63,17 @@ nv04_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -65,16 +63,17 @@ nv04_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
ram->type = NV_MEM_TYPE_SGRAM; ram->type = NV_MEM_TYPE_SGRAM;
else else
ram->type = NV_MEM_TYPE_SDRAM; ram->type = NV_MEM_TYPE_SDRAM;
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv04_ram_oclass = { nv04_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_ram_create, .ctor = nv04_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h" #include "priv.h"
static int static int
nv10_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv10_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
u32 cfg0 = nv_rd32(pfb, 0x100200); u32 cfg0 = nv_rd32(pfb, 0x100200);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -48,14 +47,13 @@ nv10_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -48,14 +47,13 @@ nv10_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nvkm_oclass
struct nouveau_oclass
nv10_ram_oclass = { nv10_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv10_ram_create, .ctor = nv10_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,16 +21,15 @@ ...@@ -21,16 +21,15 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h" #include "priv.h"
static int static int
nv1a_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv1a_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
struct pci_dev *bridge; struct pci_dev *bridge;
u32 mem, mib; u32 mem, mib;
int ret; int ret;
...@@ -41,7 +40,7 @@ nv1a_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -41,7 +40,7 @@ nv1a_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return -ENODEV; return -ENODEV;
} }
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -59,13 +58,13 @@ nv1a_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -59,13 +58,13 @@ nv1a_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv1a_ram_oclass = { nv1a_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv1a_ram_create, .ctor = nv1a_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h" #include "priv.h"
static int static int
nv20_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv20_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
u32 pbus1218 = nv_rd32(pfb, 0x001218); u32 pbus1218 = nv_rd32(pfb, 0x001218);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -51,13 +50,13 @@ nv20_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -51,13 +50,13 @@ nv20_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv20_ram_oclass = { nv20_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv20_ram_create, .ctor = nv20_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,23 +21,19 @@ ...@@ -21,23 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv40.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/pll.h>
#include <subdev/bios/init.h> #include <subdev/bios/init.h>
#include <subdev/clk.h> #include <subdev/bios/pll.h>
#include <subdev/clk/pll.h> #include <subdev/clk/pll.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <engine/fifo.h>
#include "nv40.h"
int int
nv40_ram_calc(struct nouveau_fb *pfb, u32 freq) nv40_ram_calc(struct nvkm_fb *pfb, u32 freq)
{ {
struct nouveau_bios *bios = nouveau_bios(pfb); struct nvkm_bios *bios = nvkm_bios(pfb);
struct nv40_ram *ram = (void *)pfb->ram; struct nv40_ram *ram = (void *)pfb->ram;
struct nvbios_pll pll; struct nvbios_pll pll;
int N1, M1, N2, M2; int N1, M1, N2, M2;
...@@ -68,9 +64,9 @@ nv40_ram_calc(struct nouveau_fb *pfb, u32 freq) ...@@ -68,9 +64,9 @@ nv40_ram_calc(struct nouveau_fb *pfb, u32 freq)
} }
int int
nv40_ram_prog(struct nouveau_fb *pfb) nv40_ram_prog(struct nvkm_fb *pfb)
{ {
struct nouveau_bios *bios = nouveau_bios(pfb); struct nvkm_bios *bios = nvkm_bios(pfb);
struct nv40_ram *ram = (void *)pfb->ram; struct nv40_ram *ram = (void *)pfb->ram;
struct bit_entry M; struct bit_entry M;
u32 crtc_mask = 0; u32 crtc_mask = 0;
...@@ -167,21 +163,21 @@ nv40_ram_prog(struct nouveau_fb *pfb) ...@@ -167,21 +163,21 @@ nv40_ram_prog(struct nouveau_fb *pfb)
} }
void void
nv40_ram_tidy(struct nouveau_fb *pfb) nv40_ram_tidy(struct nvkm_fb *pfb)
{ {
} }
static int static int
nv40_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv40_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nv40_ram *ram; struct nv40_ram *ram;
u32 pbus1218 = nv_rd32(pfb, 0x001218); u32 pbus1218 = nv_rd32(pfb, 0x001218);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -203,13 +199,13 @@ nv40_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -203,13 +199,13 @@ nv40_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
} }
struct nouveau_oclass struct nvkm_oclass
nv40_ram_oclass = { nv40_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv40_ram_create, .ctor = nv40_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv40.h" #include "nv40.h"
static int static int
nv41_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv41_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nv40_ram *ram; struct nv40_ram *ram;
u32 pfb474 = nv_rd32(pfb, 0x100474); u32 pfb474 = nv_rd32(pfb, 0x100474);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -55,13 +54,13 @@ nv41_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -55,13 +54,13 @@ nv41_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv41_ram_oclass = { nv41_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv41_ram_create, .ctor = nv41_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv40.h" #include "nv40.h"
static int static int
nv44_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv44_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nv40_ram *ram; struct nv40_ram *ram;
u32 pfb474 = nv_rd32(pfb, 0x100474); u32 pfb474 = nv_rd32(pfb, 0x100474);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -53,13 +52,13 @@ nv44_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -53,13 +52,13 @@ nv44_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv44_ram_oclass = { nv44_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv44_ram_create, .ctor = nv44_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv40.h" #include "nv40.h"
static int static int
nv49_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv49_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nv40_ram *ram; struct nv40_ram *ram;
u32 pfb914 = nv_rd32(pfb, 0x100914); u32 pfb914 = nv_rd32(pfb, 0x100914);
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -55,13 +54,13 @@ nv49_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -55,13 +54,13 @@ nv49_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv49_ram_oclass = { nv49_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv49_ram_create, .ctor = nv49_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,19 +21,18 @@ ...@@ -21,19 +21,18 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h" #include "priv.h"
static int static int
nv4e_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, nv4e_ram_create(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nvkm_ram_create(parent, engine, oclass, &ram);
*pobject = nv_object(ram); *pobject = nv_object(ram);
if (ret) if (ret)
return ret; return ret;
...@@ -43,13 +42,13 @@ nv4e_ram_create(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -43,13 +42,13 @@ nv4e_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv4e_ram_oclass = { nv4e_ram_oclass = {
.handle = 0, .handle = 0,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv4e_ram_create, .ctor = nv4e_ram_create,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
...@@ -21,21 +21,15 @@ ...@@ -21,21 +21,15 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv50.h"
#include "ramseq.h"
#include <core/option.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h>
#include <subdev/bios/pll.h>
#include <subdev/bios/perf.h> #include <subdev/bios/perf.h>
#include <subdev/bios/pll.h>
#include <subdev/bios/timing.h> #include <subdev/bios/timing.h>
#include <subdev/clk/pll.h> #include <subdev/clk/pll.h>
#include <subdev/fb.h>
#include <core/option.h>
#include <core/mm.h>
#include "ramseq.h"
#include "nv50.h"
struct nv50_ramseq { struct nv50_ramseq {
struct hwsq base; struct hwsq base;
...@@ -56,16 +50,16 @@ struct nv50_ramseq { ...@@ -56,16 +50,16 @@ struct nv50_ramseq {
}; };
struct nv50_ram { struct nv50_ram {
struct nouveau_ram base; struct nvkm_ram base;
struct nv50_ramseq hwsq; struct nv50_ramseq hwsq;
}; };
#define QFX5800NVA0 1 #define QFX5800NVA0 1
static int static int
nv50_ram_calc(struct nouveau_fb *pfb, u32 freq) nv50_ram_calc(struct nvkm_fb *pfb, u32 freq)
{ {
struct nouveau_bios *bios = nouveau_bios(pfb); struct nvkm_bios *bios = nvkm_bios(pfb);
struct nv50_ram *ram = (void *)pfb->ram; struct nv50_ram *ram = (void *)pfb->ram;
struct nv50_ramseq *hwsq = &ram->hwsq; struct nv50_ramseq *hwsq = &ram->hwsq;
struct nvbios_perfE perfE; struct nvbios_perfE perfE;
...@@ -82,7 +76,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq) ...@@ -82,7 +76,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq)
i = 0; i = 0;
do { do {
ramcfg.data = nvbios_perfEp(bios, i++, &ver, &hdr, &cnt, ramcfg.data = nvbios_perfEp(bios, i++, &ver, &hdr, &cnt,
&ramcfg.size, &perfE); &ramcfg.size, &perfE);
if (!ramcfg.data || (ver < 0x25 || ver >= 0x40) || if (!ramcfg.data || (ver < 0x25 || ver >= 0x40) ||
(ramcfg.size < 2)) { (ramcfg.size < 2)) {
nv_error(pfb, "invalid/missing perftab entry\n"); nv_error(pfb, "invalid/missing perftab entry\n");
...@@ -103,7 +97,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq) ...@@ -103,7 +97,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq)
strap = nv_ro08(bios, ramcfg.data + 0x01); strap = nv_ro08(bios, ramcfg.data + 0x01);
if (strap != 0xff) { if (strap != 0xff) {
timing.data = nvbios_timingEe(bios, strap, &ver, &hdr, timing.data = nvbios_timingEe(bios, strap, &ver, &hdr,
&cnt, &len); &cnt, &len);
if (!timing.data || ver != 0x10 || hdr < 0x12) { if (!timing.data || ver != 0x10 || hdr < 0x12) {
nv_error(pfb, "invalid/missing timing entry " nv_error(pfb, "invalid/missing timing entry "
"%02x %04x %02x %02x\n", "%02x %04x %02x %02x\n",
...@@ -136,7 +130,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq) ...@@ -136,7 +130,7 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq)
mpll.vco2.max_freq = 0; mpll.vco2.max_freq = 0;
if (ret == 0) { if (ret == 0) {
ret = nv04_pll_calc(nv_subdev(pfb), &mpll, freq, ret = nv04_pll_calc(nv_subdev(pfb), &mpll, freq,
&N1, &M1, &N2, &M2, &P); &N1, &M1, &N2, &M2, &P);
if (ret == 0) if (ret == 0)
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -205,18 +199,18 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq) ...@@ -205,18 +199,18 @@ nv50_ram_calc(struct nouveau_fb *pfb, u32 freq)
} }
static int static int
nv50_ram_prog(struct nouveau_fb *pfb) nv50_ram_prog(struct nvkm_fb *pfb)
{ {
struct nouveau_device *device = nv_device(pfb); struct nvkm_device *device = nv_device(pfb);
struct nv50_ram *ram = (void *)pfb->ram; struct nv50_ram *ram = (void *)pfb->ram;
struct nv50_ramseq *hwsq = &ram->hwsq; struct nv50_ramseq *hwsq = &ram->hwsq;
ram_exec(hwsq, nouveau_boolopt(device->cfgopt, "NvMemExec", true)); ram_exec(hwsq, nvkm_boolopt(device->cfgopt, "NvMemExec", true));
return 0; return 0;
} }
static void static void
nv50_ram_tidy(struct nouveau_fb *pfb) nv50_ram_tidy(struct nvkm_fb *pfb)
{ {
struct nv50_ram *ram = (void *)pfb->ram; struct nv50_ram *ram = (void *)pfb->ram;
struct nv50_ramseq *hwsq = &ram->hwsq; struct nv50_ramseq *hwsq = &ram->hwsq;
...@@ -224,24 +218,24 @@ nv50_ram_tidy(struct nouveau_fb *pfb) ...@@ -224,24 +218,24 @@ nv50_ram_tidy(struct nouveau_fb *pfb)
} }
void void
__nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem *mem) __nv50_ram_put(struct nvkm_fb *pfb, struct nvkm_mem *mem)
{ {
struct nouveau_mm_node *this; struct nvkm_mm_node *this;
while (!list_empty(&mem->regions)) { while (!list_empty(&mem->regions)) {
this = list_first_entry(&mem->regions, typeof(*this), rl_entry); this = list_first_entry(&mem->regions, typeof(*this), rl_entry);
list_del(&this->rl_entry); list_del(&this->rl_entry);
nouveau_mm_free(&pfb->vram, &this); nvkm_mm_free(&pfb->vram, &this);
} }
nouveau_mm_free(&pfb->tags, &mem->tag); nvkm_mm_free(&pfb->tags, &mem->tag);
} }
void void
nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem) nv50_ram_put(struct nvkm_fb *pfb, struct nvkm_mem **pmem)
{ {
struct nouveau_mem *mem = *pmem; struct nvkm_mem *mem = *pmem;
*pmem = NULL; *pmem = NULL;
if (unlikely(mem == NULL)) if (unlikely(mem == NULL))
...@@ -255,13 +249,13 @@ nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem) ...@@ -255,13 +249,13 @@ nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem)
} }
int int
nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, nv50_ram_get(struct nvkm_fb *pfb, u64 size, u32 align, u32 ncmin,
u32 memtype, struct nouveau_mem **pmem) u32 memtype, struct nvkm_mem **pmem)
{ {
struct nouveau_mm *heap = &pfb->vram; struct nvkm_mm *heap = &pfb->vram;
struct nouveau_mm *tags = &pfb->tags; struct nvkm_mm *tags = &pfb->tags;
struct nouveau_mm_node *r; struct nvkm_mm_node *r;
struct nouveau_mem *mem; struct nvkm_mem *mem;
int comp = (memtype & 0x300) >> 8; int comp = (memtype & 0x300) >> 8;
int type = (memtype & 0x07f); int type = (memtype & 0x07f);
int back = (memtype & 0x800); int back = (memtype & 0x800);
...@@ -280,7 +274,7 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, ...@@ -280,7 +274,7 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
if (align == 16) { if (align == 16) {
int n = (max >> 4) * comp; int n = (max >> 4) * comp;
ret = nouveau_mm_head(tags, 0, 1, n, n, 1, &mem->tag); ret = nvkm_mm_head(tags, 0, 1, n, n, 1, &mem->tag);
if (ret) if (ret)
mem->tag = NULL; mem->tag = NULL;
} }
...@@ -296,9 +290,9 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, ...@@ -296,9 +290,9 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
type = nv50_fb_memtype[type]; type = nv50_fb_memtype[type];
do { do {
if (back) if (back)
ret = nouveau_mm_tail(heap, 0, type, max, min, align, &r); ret = nvkm_mm_tail(heap, 0, type, max, min, align, &r);
else else
ret = nouveau_mm_head(heap, 0, type, max, min, align, &r); ret = nvkm_mm_head(heap, 0, type, max, min, align, &r);
if (ret) { if (ret) {
mutex_unlock(&pfb->base.mutex); mutex_unlock(&pfb->base.mutex);
pfb->ram->put(pfb, &mem); pfb->ram->put(pfb, &mem);
...@@ -310,14 +304,14 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin, ...@@ -310,14 +304,14 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
} while (max); } while (max);
mutex_unlock(&pfb->base.mutex); mutex_unlock(&pfb->base.mutex);
r = list_first_entry(&mem->regions, struct nouveau_mm_node, rl_entry); r = list_first_entry(&mem->regions, struct nvkm_mm_node, rl_entry);
mem->offset = (u64)r->offset << 12; mem->offset = (u64)r->offset << 12;
*pmem = mem; *pmem = mem;
return 0; return 0;
} }
static u32 static u32
nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram) nv50_fb_vram_rblock(struct nvkm_fb *pfb, struct nvkm_ram *ram)
{ {
int colbits, rowbitsa, rowbitsb, banks; int colbits, rowbitsa, rowbitsb, banks;
u64 rowsize, predicted; u64 rowsize, predicted;
...@@ -326,8 +320,8 @@ nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram) ...@@ -326,8 +320,8 @@ nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram)
r0 = nv_rd32(pfb, 0x100200); r0 = nv_rd32(pfb, 0x100200);
r4 = nv_rd32(pfb, 0x100204); r4 = nv_rd32(pfb, 0x100204);
rt = nv_rd32(pfb, 0x100250); rt = nv_rd32(pfb, 0x100250);
nv_debug(pfb, "memcfg 0x%08x 0x%08x 0x%08x 0x%08x\n", r0, r4, rt, nv_debug(pfb, "memcfg 0x%08x 0x%08x 0x%08x 0x%08x\n",
nv_rd32(pfb, 0x001540)); r0, r4, rt, nv_rd32(pfb, 0x001540));
colbits = (r4 & 0x0000f000) >> 12; colbits = (r4 & 0x0000f000) >> 12;
rowbitsa = ((r4 & 0x000f0000) >> 16) + 8; rowbitsa = ((r4 & 0x000f0000) >> 16) + 8;
...@@ -353,17 +347,17 @@ nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram) ...@@ -353,17 +347,17 @@ nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram)
} }
int int
nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine, nv50_ram_create_(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, int length, void **pobject) struct nvkm_oclass *oclass, int length, void **pobject)
{ {
const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */ const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */ const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
struct nouveau_bios *bios = nouveau_bios(parent); struct nvkm_bios *bios = nvkm_bios(parent);
struct nouveau_fb *pfb = nouveau_fb(parent); struct nvkm_fb *pfb = nvkm_fb(parent);
struct nouveau_ram *ram; struct nvkm_ram *ram;
int ret; int ret;
ret = nouveau_ram_create_(parent, engine, oclass, length, pobject); ret = nvkm_ram_create_(parent, engine, oclass, length, pobject);
ram = *pobject; ram = *pobject;
if (ret) if (ret)
return ret; return ret;
...@@ -377,7 +371,7 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -377,7 +371,7 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
switch (nv_rd32(pfb, 0x100714) & 0x00000007) { switch (nv_rd32(pfb, 0x100714) & 0x00000007) {
case 0: ram->type = NV_MEM_TYPE_DDR1; break; case 0: ram->type = NV_MEM_TYPE_DDR1; break;
case 1: case 1:
if (nouveau_fb_bios_memtype(bios) == NV_MEM_TYPE_DDR3) if (nvkm_fb_bios_memtype(bios) == NV_MEM_TYPE_DDR3)
ram->type = NV_MEM_TYPE_DDR3; ram->type = NV_MEM_TYPE_DDR3;
else else
ram->type = NV_MEM_TYPE_DDR2; ram->type = NV_MEM_TYPE_DDR2;
...@@ -389,9 +383,9 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -389,9 +383,9 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
break; break;
} }
ret = nouveau_mm_init(&pfb->vram, rsvd_head, (ram->size >> 12) - ret = nvkm_mm_init(&pfb->vram, rsvd_head, (ram->size >> 12) -
(rsvd_head + rsvd_tail), (rsvd_head + rsvd_tail),
nv50_fb_vram_rblock(pfb, ram) >> 12); nv50_fb_vram_rblock(pfb, ram) >> 12);
if (ret) if (ret)
return ret; return ret;
...@@ -403,9 +397,9 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -403,9 +397,9 @@ nv50_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
} }
static int static int
nv50_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv50_ram_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 datasize, struct nvkm_oclass *oclass, void *data, u32 datasize,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv50_ram *ram; struct nv50_ram *ram;
int ret, i; int ret, i;
...@@ -459,12 +453,12 @@ nv50_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -459,12 +453,12 @@ nv50_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv50_ram_oclass = { nv50_ram_oclass = {
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_ram_ctor, .ctor = nv50_ram_ctor,
.dtor = _nouveau_ram_dtor, .dtor = _nvkm_ram_dtor,
.init = _nouveau_ram_init, .init = _nvkm_ram_init,
.fini = _nouveau_ram_fini, .fini = _nvkm_ram_fini,
} }
}; };
#ifndef __NVKM_FBRAM_SEQ_H__ #ifndef __NVKM_FBRAM_SEQ_H__
#define __NVKM_FBRAM_SEQ_H__ #define __NVKM_FBRAM_SEQ_H__
#include <subdev/bus.h>
#include <subdev/bus/hwsq.h> #include <subdev/bus/hwsq.h>
#define ram_init(s,p) hwsq_init(&(s)->base, (p)) #define ram_init(s,p) hwsq_init(&(s)->base, (p))
...@@ -14,5 +12,4 @@ ...@@ -14,5 +12,4 @@
#define ram_setf(s,f,d) hwsq_setf(&(s)->base, (f), (d)) #define ram_setf(s,f,d) hwsq_setf(&(s)->base, (f), (d))
#define ram_wait(s,f,d) hwsq_wait(&(s)->base, (f), (d)) #define ram_wait(s,f,d) hwsq_wait(&(s)->base, (f), (d))
#define ram_nsec(s,n) hwsq_nsec(&(s)->base, (n)) #define ram_nsec(s,n) hwsq_nsec(&(s)->base, (n))
#endif #endif
#ifndef __NOUVEAU_FB_REGS_04_H__ #ifndef __NVKM_FB_REGS_04_H__
#define __NOUVEAU_FB_REGS_04_H__ #define __NVKM_FB_REGS_04_H__
#define NV04_PFB_BOOT_0 0x00100000 #define NV04_PFB_BOOT_0 0x00100000
# define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003 # define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003
...@@ -17,5 +17,6 @@ ...@@ -17,5 +17,6 @@
# define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBITX16 0x00000028 # define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBITX16 0x00000028
# define NV04_PFB_BOOT_0_UMA_ENABLE 0x00000100 # define NV04_PFB_BOOT_0_UMA_ENABLE 0x00000100
# define NV04_PFB_BOOT_0_UMA_SIZE 0x0000f000 # define NV04_PFB_BOOT_0_UMA_SIZE 0x0000f000
#define NV04_PFB_CFG0 0x00100200
#endif #endif
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Roy Spliet <rspliet@eclipso.eu> * Authors: Roy Spliet <rspliet@eclipso.eu>
* Ben Skeggs * Ben Skeggs
*/ */
#include "priv.h" #include "priv.h"
struct ramxlat { struct ramxlat {
...@@ -58,7 +57,7 @@ ramddr2_wr[] = { ...@@ -58,7 +57,7 @@ ramddr2_wr[] = {
}; };
int int
nouveau_sddr2_calc(struct nouveau_ram *ram) nvkm_sddr2_calc(struct nvkm_ram *ram)
{ {
int CL, WR, DLL = 0, ODT = 0; int CL, WR, DLL = 0, ODT = 0;
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
* Roy Spliet <rspliet@eclipso.eu> * Roy Spliet <rspliet@eclipso.eu>
*/ */
#include "priv.h" #include "priv.h"
struct ramxlat { struct ramxlat {
...@@ -67,7 +66,7 @@ ramddr3_cwl[] = { ...@@ -67,7 +66,7 @@ ramddr3_cwl[] = {
}; };
int int
nouveau_sddr3_calc(struct nouveau_ram *ram) nvkm_sddr3_calc(struct nvkm_ram *ram)
{ {
int CWL, CL, WR, DLL = 0, ODT = 0; int CWL, CL, WR, DLL = 0, ODT = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment