mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
drm/nouveau/fb: merge fb/vram and port to subdev interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
@@ -8,6 +8,7 @@ ccflags-y += -I$(src)
|
||||
|
||||
nouveau-y := core/core/client.o
|
||||
nouveau-y += core/core/engine.o
|
||||
nouveau-y += core/core/enum.o
|
||||
nouveau-y += core/core/handle.o
|
||||
nouveau-y += core/core/mm.o
|
||||
nouveau-y += core/core/namedb.o
|
||||
@@ -50,6 +51,7 @@ nouveau-y += core/subdev/devinit/nv10.o
|
||||
nouveau-y += core/subdev/devinit/nv1a.o
|
||||
nouveau-y += core/subdev/devinit/nv20.o
|
||||
nouveau-y += core/subdev/devinit/nv50.o
|
||||
nouveau-y += core/subdev/fb/base.o
|
||||
nouveau-y += core/subdev/fb/nv04.o
|
||||
nouveau-y += core/subdev/fb/nv10.o
|
||||
nouveau-y += core/subdev/fb/nv20.o
|
||||
@@ -57,8 +59,6 @@ nouveau-y += core/subdev/fb/nv30.o
|
||||
nouveau-y += core/subdev/fb/nv40.o
|
||||
nouveau-y += core/subdev/fb/nv50.o
|
||||
nouveau-y += core/subdev/fb/nvc0.o
|
||||
nouveau-y += core/subdev/fb/nv50_vram.o
|
||||
nouveau-y += core/subdev/fb/nvc0_vram.o
|
||||
nouveau-y += core/subdev/gpio/base.o
|
||||
nouveau-y += core/subdev/gpio/nv10.o
|
||||
nouveau-y += core/subdev/gpio/nv50.o
|
||||
@@ -69,6 +69,7 @@ nouveau-y += core/subdev/i2c/bit.o
|
||||
nouveau-y += core/subdev/instmem/nv04.o
|
||||
nouveau-y += core/subdev/instmem/nv50.o
|
||||
nouveau-y += core/subdev/instmem/nvc0.o
|
||||
nouveau-y += core/subdev/ltcg/nvc0.o
|
||||
nouveau-y += core/subdev/mc/base.o
|
||||
nouveau-y += core/subdev/mc/nv04.o
|
||||
nouveau-y += core/subdev/mc/nv44.o
|
||||
|
||||
@@ -163,7 +163,7 @@ nv40_fifo_init(struct drm_device *dev, int engine)
|
||||
break;
|
||||
default:
|
||||
nv_wr32(dev, 0x002230, 0x00000000);
|
||||
nv_wr32(dev, 0x002220, ((dev_priv->vram_size - 512 * 1024 +
|
||||
nv_wr32(dev, 0x002220, ((nvfb_vram_size(dev) - 512 * 1024 +
|
||||
dev_priv->ramfc->pinst) >> 16) |
|
||||
0x00030000);
|
||||
break;
|
||||
|
||||
@@ -895,9 +895,7 @@ nv10_graph_context_del(struct nouveau_channel *chan, int engine)
|
||||
static void
|
||||
nv10_graph_set_tile_region(struct drm_device *dev, int i)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
struct nouveau_fb_tile *tile = nvfb_tile(dev, i);
|
||||
nv_wr32(dev, NV10_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV10_PGRAPH_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV10_PGRAPH_TILE(i), tile->addr);
|
||||
|
||||
@@ -472,7 +472,7 @@ static void
|
||||
nv20_graph_set_tile_region(struct drm_device *dev, int i)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
struct nouveau_fb_tile *tile = nvfb_tile(dev, i);
|
||||
|
||||
nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
|
||||
|
||||
@@ -125,7 +125,7 @@ static void
|
||||
nv40_graph_set_tile_region(struct drm_device *dev, int i)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
struct nouveau_fb_tile *tile = nvfb_tile(dev, i);
|
||||
|
||||
switch (dev_priv->chipset) {
|
||||
case 0x40:
|
||||
@@ -178,7 +178,6 @@ nv40_graph_init(struct drm_device *dev, int engine)
|
||||
{
|
||||
struct nv40_graph_engine *pgraph = nv_engine(dev, engine);
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_fb_engine *pfb = &dev_priv->engine.fb;
|
||||
uint32_t vramsz;
|
||||
int i, j;
|
||||
|
||||
@@ -280,7 +279,7 @@ nv40_graph_init(struct drm_device *dev, int engine)
|
||||
}
|
||||
|
||||
/* Turn all the tiling regions off. */
|
||||
for (i = 0; i < pfb->num_tiles; i++)
|
||||
for (i = 0; i < nvfb_tile_nr(dev); i++)
|
||||
nv40_graph_set_tile_region(dev, i);
|
||||
|
||||
/* begin RAM config */
|
||||
|
||||
@@ -128,7 +128,6 @@ nv31_mpeg_object_new(struct nouveau_channel *chan, int engine,
|
||||
static int
|
||||
nv31_mpeg_init(struct drm_device *dev, int engine)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nv31_mpeg_engine *pmpeg = nv_engine(dev, engine);
|
||||
int i;
|
||||
|
||||
@@ -138,7 +137,7 @@ nv31_mpeg_init(struct drm_device *dev, int engine)
|
||||
nv_wr32(dev, 0x00b0e0, 0x00000020); /* nvidia: rd 0x01, wr 0x20 */
|
||||
nv_wr32(dev, 0x00b0e8, 0x00000020); /* nvidia: rd 0x01, wr 0x20 */
|
||||
|
||||
for (i = 0; i < dev_priv->engine.fb.num_tiles; i++)
|
||||
for (i = 0; i < nvfb_tile_nr(dev); i++)
|
||||
pmpeg->base.set_tile_region(dev, i);
|
||||
|
||||
/* PMPEG init */
|
||||
@@ -235,9 +234,7 @@ nv31_mpeg_isr_chid(struct drm_device *dev, u32 inst)
|
||||
static void
|
||||
nv31_vpe_set_tile_region(struct drm_device *dev, int i)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
struct nouveau_fb_tile *tile = nvfb_tile(dev, i);
|
||||
nv_wr32(dev, 0x00b008 + (i * 0x10), tile->pitch);
|
||||
nv_wr32(dev, 0x00b004 + (i * 0x10), tile->limit);
|
||||
nv_wr32(dev, 0x00b000 + (i * 0x10), tile->addr);
|
||||
|
||||
137
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
Normal file
137
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
Normal file
@@ -0,0 +1,137 @@
|
||||
#ifndef __NOUVEAU_FB_H__
|
||||
#define __NOUVEAU_FB_H__
|
||||
|
||||
#ifndef XXX_THIS_IS_A_HACK
|
||||
#include <core/subdev.h>
|
||||
#include <core/device.h>
|
||||
#endif
|
||||
#include <core/mm.h>
|
||||
#include <subdev/vm.h>
|
||||
|
||||
/* memory type/access flags, do not match hardware values */
|
||||
#define NV_MEM_ACCESS_RO 1
|
||||
#define NV_MEM_ACCESS_WO 2
|
||||
#define NV_MEM_ACCESS_RW (NV_MEM_ACCESS_RO | NV_MEM_ACCESS_WO)
|
||||
#define NV_MEM_ACCESS_SYS 4
|
||||
#define NV_MEM_ACCESS_VM 8
|
||||
#define NV_MEM_ACCESS_NOSNOOP 16
|
||||
|
||||
#define NV_MEM_TARGET_VRAM 0
|
||||
#define NV_MEM_TARGET_PCI 1
|
||||
#define NV_MEM_TARGET_PCI_NOSNOOP 2
|
||||
#define NV_MEM_TARGET_VM 3
|
||||
#define NV_MEM_TARGET_GART 4
|
||||
|
||||
#define NV_MEM_TYPE_VM 0x7f
|
||||
#define NV_MEM_COMP_VM 0x03
|
||||
|
||||
struct nouveau_mem {
|
||||
struct drm_device *dev;
|
||||
|
||||
struct nouveau_vma bar_vma;
|
||||
struct nouveau_vma vma[2];
|
||||
u8 page_shift;
|
||||
|
||||
struct nouveau_mm_node *tag;
|
||||
struct list_head regions;
|
||||
dma_addr_t *pages;
|
||||
u32 memtype;
|
||||
u64 offset;
|
||||
u64 size;
|
||||
struct sg_table *sg;
|
||||
};
|
||||
|
||||
struct nouveau_fb_tile {
|
||||
struct nouveau_mm_node *tag;
|
||||
u32 addr;
|
||||
u32 limit;
|
||||
u32 pitch;
|
||||
u32 zcomp;
|
||||
};
|
||||
|
||||
#ifndef XXX_THIS_IS_A_HACK
|
||||
struct nouveau_fb {
|
||||
struct nouveau_subdev base;
|
||||
|
||||
bool (*memtype_valid)(struct nouveau_fb *, u32 memtype);
|
||||
|
||||
struct {
|
||||
enum {
|
||||
NV_MEM_TYPE_UNKNOWN = 0,
|
||||
NV_MEM_TYPE_STOLEN,
|
||||
NV_MEM_TYPE_SGRAM,
|
||||
NV_MEM_TYPE_SDRAM,
|
||||
NV_MEM_TYPE_DDR1,
|
||||
NV_MEM_TYPE_DDR2,
|
||||
NV_MEM_TYPE_DDR3,
|
||||
NV_MEM_TYPE_GDDR2,
|
||||
NV_MEM_TYPE_GDDR3,
|
||||
NV_MEM_TYPE_GDDR4,
|
||||
NV_MEM_TYPE_GDDR5
|
||||
} type;
|
||||
u64 stolen;
|
||||
u64 size;
|
||||
int ranks;
|
||||
|
||||
int (*get)(struct nouveau_fb *, u64 size, u32 align,
|
||||
u32 size_nc, u32 type, struct nouveau_mem **);
|
||||
void (*put)(struct nouveau_fb *, struct nouveau_mem **);
|
||||
} ram;
|
||||
|
||||
struct nouveau_mm vram;
|
||||
struct nouveau_mm tags;
|
||||
|
||||
struct {
|
||||
struct nouveau_fb_tile region[16];
|
||||
int regions;
|
||||
void (*init)(struct nouveau_fb *, int i, u32 addr, u32 size,
|
||||
u32 pitch, u32 flags, struct nouveau_fb_tile *);
|
||||
void (*fini)(struct nouveau_fb *, int i,
|
||||
struct nouveau_fb_tile *);
|
||||
void (*prog)(struct nouveau_fb *, int i,
|
||||
struct nouveau_fb_tile *);
|
||||
} tile;
|
||||
};
|
||||
|
||||
static inline struct nouveau_fb *
|
||||
nouveau_fb(void *obj)
|
||||
{
|
||||
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
|
||||
}
|
||||
|
||||
#define nouveau_fb_create(p,e,c,d) \
|
||||
nouveau_subdev_create((p), (e), (c), 0, "PFB", "fb", (d))
|
||||
int nouveau_fb_created(struct nouveau_fb *);
|
||||
void nouveau_fb_destroy(struct nouveau_fb *);
|
||||
int nouveau_fb_init(struct nouveau_fb *);
|
||||
#define nouveau_fb_fini(p,s) \
|
||||
nouveau_subdev_fini(&(p)->base, (s))
|
||||
|
||||
void _nouveau_fb_dtor(struct nouveau_object *);
|
||||
int _nouveau_fb_init(struct nouveau_object *);
|
||||
#define _nouveau_fb_fini _nouveau_subdev_fini
|
||||
|
||||
extern struct nouveau_oclass nv04_fb_oclass;
|
||||
extern struct nouveau_oclass nv10_fb_oclass;
|
||||
extern struct nouveau_oclass nv20_fb_oclass;
|
||||
extern struct nouveau_oclass nv30_fb_oclass;
|
||||
extern struct nouveau_oclass nv40_fb_oclass;
|
||||
extern struct nouveau_oclass nv50_fb_oclass;
|
||||
extern struct nouveau_oclass nvc0_fb_oclass;
|
||||
|
||||
struct nouveau_bios;
|
||||
int nouveau_fb_bios_memtype(struct nouveau_bios *);
|
||||
|
||||
bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
|
||||
|
||||
void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
|
||||
|
||||
void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
|
||||
u32 pitch, u32 flags, struct nouveau_fb_tile *);
|
||||
void nv30_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
|
||||
|
||||
void nv50_fb_vram_del(struct nouveau_fb *, struct nouveau_mem **);
|
||||
void nv50_fb_trap(struct nouveau_fb *, int display);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
33
drivers/gpu/drm/nouveau/core/include/subdev/ltcg.h
Normal file
33
drivers/gpu/drm/nouveau/core/include/subdev/ltcg.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef __NOUVEAU_LTCG_H__
|
||||
#define __NOUVEAU_LTCG_H__
|
||||
|
||||
#include <core/subdev.h>
|
||||
#include <core/device.h>
|
||||
|
||||
struct nouveau_ltcg {
|
||||
struct nouveau_subdev base;
|
||||
};
|
||||
|
||||
static inline struct nouveau_ltcg *
|
||||
nouveau_ltcg(void *obj)
|
||||
{
|
||||
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_LTCG];
|
||||
}
|
||||
|
||||
#define nouveau_ltcg_create(p,e,o,d) \
|
||||
nouveau_subdev_create_((p), (e), (o), 0, "PLTCG", "level2", \
|
||||
sizeof(**d), (void **)d)
|
||||
#define nouveau_ltcg_destroy(p) \
|
||||
nouveau_subdev_destroy(&(p)->base)
|
||||
#define nouveau_ltcg_init(p) \
|
||||
nouveau_subdev_init(&(p)->base)
|
||||
#define nouveau_ltcg_fini(p,s) \
|
||||
nouveau_subdev_fini(&(p)->base, (s))
|
||||
|
||||
#define _nouveau_ltcg_dtor _nouveau_subdev_dtor
|
||||
#define _nouveau_ltcg_init _nouveau_subdev_init
|
||||
#define _nouveau_ltcg_fini _nouveau_subdev_fini
|
||||
|
||||
extern struct nouveau_oclass nvc0_ltcg_oclass;
|
||||
|
||||
#endif
|
||||
@@ -25,11 +25,10 @@
|
||||
#ifndef __NOUVEAU_VM_H__
|
||||
#define __NOUVEAU_VM_H__
|
||||
|
||||
#include "drmP.h"
|
||||
|
||||
#include "nouveau_drv.h"
|
||||
#include <core/mm.h>
|
||||
|
||||
struct nouveau_mem;
|
||||
|
||||
struct nouveau_vm_pgt {
|
||||
struct nouveau_gpuobj *obj[2];
|
||||
u32 refcount[2];
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv04_identify(struct nouveau_device *device)
|
||||
@@ -41,6 +42,7 @@ nv04_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv04_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv04_fb_oclass;
|
||||
break;
|
||||
case 0x05:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -49,6 +51,7 @@ nv04_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv05_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv04_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown RIVA chipset\n");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv10_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +44,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x15:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +54,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x16:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +64,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x1a:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +74,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x11:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -79,6 +84,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x17:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -88,6 +94,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x1f:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -97,6 +104,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
case 0x18:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -106,6 +114,7 @@ nv10_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv10_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Celsius chipset\n");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv20_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +44,7 @@ nv20_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv20_fb_oclass;
|
||||
break;
|
||||
case 0x25:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +54,7 @@ nv20_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv20_fb_oclass;
|
||||
break;
|
||||
case 0x28:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +64,7 @@ nv20_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv20_fb_oclass;
|
||||
break;
|
||||
case 0x2a:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +74,7 @@ nv20_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv20_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Kelvin chipset\n");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv30_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +44,7 @@ nv30_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv30_fb_oclass;
|
||||
break;
|
||||
case 0x35:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +54,7 @@ nv30_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv30_fb_oclass;
|
||||
break;
|
||||
case 0x31:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +64,7 @@ nv30_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv30_fb_oclass;
|
||||
break;
|
||||
case 0x36:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +74,7 @@ nv30_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv20_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv30_fb_oclass;
|
||||
break;
|
||||
case 0x34:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -79,6 +84,7 @@ nv30_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv10_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv30_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Rankine chipset\n");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv40_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +44,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x41:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +54,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x42:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +64,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x43:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +74,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x45:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -79,6 +84,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x47:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -88,6 +94,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x49:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -97,6 +104,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x4b:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -106,6 +114,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv04_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x44:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -115,6 +124,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x46:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -124,6 +134,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x4a:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -133,6 +144,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x4c:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -142,6 +154,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x4e:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -151,6 +164,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x63:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -160,6 +174,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x67:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -169,6 +184,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
case 0x68:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -178,6 +194,7 @@ nv40_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv1a_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv44_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv40_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Curie chipset\n");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
|
||||
int
|
||||
nv50_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +44,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x84:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +54,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x86:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +64,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x92:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +74,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x94:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -79,6 +84,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x96:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -88,6 +94,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv50_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0x98:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -97,6 +104,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xa0:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -106,6 +114,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xaa:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -115,6 +124,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xac:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -124,6 +134,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xa3:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -133,6 +144,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xa5:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -142,6 +154,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xa8:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -151,6 +164,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
case 0xaf:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -160,6 +174,7 @@ nv50_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nv98_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nv50_fb_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Tesla chipset\n");
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
#include <subdev/ltcg.h>
|
||||
|
||||
int
|
||||
nvc0_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +45,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xc4:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +56,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xc3:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -61,6 +67,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xce:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -70,6 +78,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xcf:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -79,6 +89,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xc1:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -88,6 +100,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xc8:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -97,6 +111,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xd9:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -106,6 +122,8 @@ nvc0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Fermi chipset\n");
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <subdev/devinit.h>
|
||||
#include <subdev/mc.h>
|
||||
#include <subdev/timer.h>
|
||||
#include <subdev/fb.h>
|
||||
#include <subdev/ltcg.h>
|
||||
|
||||
int
|
||||
nve0_identify(struct nouveau_device *device)
|
||||
@@ -43,6 +45,8 @@ nve0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
case 0xe7:
|
||||
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
|
||||
@@ -52,6 +56,8 @@ nve0_identify(struct nouveau_device *device)
|
||||
device->oclass[NVDEV_SUBDEV_DEVINIT] = &nv50_devinit_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
|
||||
device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
|
||||
break;
|
||||
default:
|
||||
nv_fatal(device, "unknown Kepler chipset\n");
|
||||
|
||||
130
drivers/gpu/drm/nouveau/core/subdev/fb/base.c
Normal file
130
drivers/gpu/drm/nouveau/core/subdev/fb/base.c
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright 2012 Red Hat Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Ben Skeggs
|
||||
*/
|
||||
|
||||
#include "subdev/fb.h"
|
||||
#include "subdev/bios.h"
|
||||
#include "subdev/bios/bit.h"
|
||||
|
||||
int
|
||||
nouveau_fb_bios_memtype(struct nouveau_bios *bios)
|
||||
{
|
||||
struct bit_entry M;
|
||||
u8 ramcfg;
|
||||
|
||||
ramcfg = (nv_rd32(bios, 0x101000) & 0x0000003c) >> 2;
|
||||
if (!bit_entry(bios, 'M', &M) && M.version == 2 && M.length >= 5) {
|
||||
u16 table = nv_ro16(bios, M.offset + 3);
|
||||
u8 version = nv_ro08(bios, table + 0);
|
||||
u8 header = nv_ro08(bios, table + 1);
|
||||
u8 record = nv_ro08(bios, table + 2);
|
||||
u8 entries = nv_ro08(bios, table + 3);
|
||||
if (table && version == 0x10 && ramcfg < entries) {
|
||||
u16 entry = table + header + (ramcfg * record);
|
||||
switch (nv_ro08(bios, entry) & 0x0f) {
|
||||
case 0: return NV_MEM_TYPE_DDR2;
|
||||
case 1: return NV_MEM_TYPE_DDR3;
|
||||
case 2: return NV_MEM_TYPE_GDDR3;
|
||||
case 3: return NV_MEM_TYPE_GDDR5;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return NV_MEM_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
int
|
||||
nouveau_fb_init(struct nouveau_fb *pfb)
|
||||
{
|
||||
int ret, i;
|
||||
|
||||
ret = nouveau_subdev_init(&pfb->base);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < pfb->tile.regions; i++)
|
||||
pfb->tile.prog(pfb, i, &pfb->tile.region[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_nouveau_fb_init(struct nouveau_object *object)
|
||||
{
|
||||
struct nouveau_fb *pfb = (void *)object;
|
||||
return nouveau_fb_init(pfb);
|
||||
}
|
||||
|
||||
void
|
||||
nouveau_fb_destroy(struct nouveau_fb *pfb)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < pfb->tile.regions; i++)
|
||||
pfb->tile.fini(pfb, i, &pfb->tile.region[i]);
|
||||
|
||||
if (pfb->tags.block_size)
|
||||
nouveau_mm_fini(&pfb->tags);
|
||||
|
||||
if (pfb->vram.block_size)
|
||||
nouveau_mm_fini(&pfb->vram);
|
||||
|
||||
nouveau_subdev_destroy(&pfb->base);
|
||||
}
|
||||
|
||||
void
|
||||
_nouveau_fb_dtor(struct nouveau_object *object)
|
||||
{
|
||||
struct nouveau_fb *pfb = (void *)object;
|
||||
nouveau_fb_destroy(pfb);
|
||||
}
|
||||
|
||||
int
|
||||
nouveau_fb_created(struct nouveau_fb *pfb)
|
||||
{
|
||||
static const char *name[] = {
|
||||
[NV_MEM_TYPE_UNKNOWN] = "unknown",
|
||||
[NV_MEM_TYPE_STOLEN ] = "stolen system memory",
|
||||
[NV_MEM_TYPE_SGRAM ] = "SGRAM",
|
||||
[NV_MEM_TYPE_SDRAM ] = "SDRAM",
|
||||
[NV_MEM_TYPE_DDR1 ] = "DDR1",
|
||||
[NV_MEM_TYPE_DDR2 ] = "DDR2",
|
||||
[NV_MEM_TYPE_DDR3 ] = "DDR3",
|
||||
[NV_MEM_TYPE_GDDR2 ] = "GDDR2",
|
||||
[NV_MEM_TYPE_GDDR3 ] = "GDDR3",
|
||||
[NV_MEM_TYPE_GDDR4 ] = "GDDR4",
|
||||
[NV_MEM_TYPE_GDDR5 ] = "GDDR5",
|
||||
};
|
||||
|
||||
if (pfb->ram.size == 0) {
|
||||
nv_fatal(pfb, "no vram detected!!\n");
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
nv_info(pfb, "RAM type: %s\n", name[pfb->ram.type]);
|
||||
nv_info(pfb, "RAM size: %d MiB\n", (int)(pfb->ram.size >> 20));
|
||||
return 0;
|
||||
}
|
||||
@@ -1,55 +1,130 @@
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "nouveau_drv.h"
|
||||
#include <nouveau_drm.h>
|
||||
/*
|
||||
* Copyright 2012 Red Hat Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Ben Skeggs
|
||||
*/
|
||||
|
||||
int
|
||||
nv04_fb_vram_init(struct drm_device *dev)
|
||||
#include <subdev/fb.h>
|
||||
|
||||
#define NV04_PFB_BOOT_0 0x00100000
|
||||
# define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003
|
||||
# define NV04_PFB_BOOT_0_RAM_AMOUNT_32MB 0x00000000
|
||||
# define NV04_PFB_BOOT_0_RAM_AMOUNT_4MB 0x00000001
|
||||
# define NV04_PFB_BOOT_0_RAM_AMOUNT_8MB 0x00000002
|
||||
# define NV04_PFB_BOOT_0_RAM_AMOUNT_16MB 0x00000003
|
||||
# define NV04_PFB_BOOT_0_RAM_WIDTH_128 0x00000004
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE 0x00000028
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_8MBIT 0x00000000
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT 0x00000008
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT_4BANK 0x00000010
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_16MBIT 0x00000018
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBIT 0x00000020
|
||||
# define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBITX16 0x00000028
|
||||
# define NV04_PFB_BOOT_0_UMA_ENABLE 0x00000100
|
||||
# define NV04_PFB_BOOT_0_UMA_SIZE 0x0000f000
|
||||
#define NV04_PFB_CFG0 0x00100200
|
||||
|
||||
struct nv04_fb_priv {
|
||||
struct nouveau_fb base;
|
||||
};
|
||||
|
||||
bool
|
||||
nv04_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
u32 boot0 = nv_rd32(dev, NV04_PFB_BOOT_0);
|
||||
if (!(tile_flags & 0xff00))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int
|
||||
nv04_fb_init(struct nouveau_object *object)
|
||||
{
|
||||
struct nv04_fb_priv *priv = (void *)object;
|
||||
int ret;
|
||||
|
||||
ret = nouveau_fb_init(&priv->base);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* This is what the DDX did for NV_ARCH_04, but a mmio-trace shows
|
||||
* nvidia reading PFB_CFG_0, then writing back its original value.
|
||||
* (which was 0x701114 in this case)
|
||||
*/
|
||||
nv_wr32(priv, NV04_PFB_CFG0, 0x1114);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
||||
struct nouveau_oclass *oclass, void *data, u32 size,
|
||||
struct nouveau_object **pobject)
|
||||
{
|
||||
struct nv04_fb_priv *priv;
|
||||
u32 boot0;
|
||||
int ret;
|
||||
|
||||
ret = nouveau_fb_create(parent, engine, oclass, &priv);
|
||||
*pobject = nv_object(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
boot0 = nv_rd32(priv, NV04_PFB_BOOT_0);
|
||||
if (boot0 & 0x00000100) {
|
||||
dev_priv->vram_size = ((boot0 >> 12) & 0xf) * 2 + 2;
|
||||
dev_priv->vram_size *= 1024 * 1024;
|
||||
priv->base.ram.size = ((boot0 >> 12) & 0xf) * 2 + 2;
|
||||
priv->base.ram.size *= 1024 * 1024;
|
||||
} else {
|
||||
switch (boot0 & NV04_PFB_BOOT_0_RAM_AMOUNT) {
|
||||
case NV04_PFB_BOOT_0_RAM_AMOUNT_32MB:
|
||||
dev_priv->vram_size = 32 * 1024 * 1024;
|
||||
priv->base.ram.size = 32 * 1024 * 1024;
|
||||
break;
|
||||
case NV04_PFB_BOOT_0_RAM_AMOUNT_16MB:
|
||||
dev_priv->vram_size = 16 * 1024 * 1024;
|
||||
priv->base.ram.size = 16 * 1024 * 1024;
|
||||
break;
|
||||
case NV04_PFB_BOOT_0_RAM_AMOUNT_8MB:
|
||||
dev_priv->vram_size = 8 * 1024 * 1024;
|
||||
priv->base.ram.size = 8 * 1024 * 1024;
|
||||
break;
|
||||
case NV04_PFB_BOOT_0_RAM_AMOUNT_4MB:
|
||||
dev_priv->vram_size = 4 * 1024 * 1024;
|
||||
priv->base.ram.size = 4 * 1024 * 1024;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((boot0 & 0x00000038) <= 0x10)
|
||||
dev_priv->vram_type = NV_MEM_TYPE_SGRAM;
|
||||
priv->base.ram.type = NV_MEM_TYPE_SGRAM;
|
||||
else
|
||||
dev_priv->vram_type = NV_MEM_TYPE_SDRAM;
|
||||
priv->base.ram.type = NV_MEM_TYPE_SDRAM;
|
||||
|
||||
return 0;
|
||||
|
||||
priv->base.memtype_valid = nv04_fb_memtype_valid;
|
||||
return nouveau_fb_created(&priv->base);
|
||||
}
|
||||
|
||||
int
|
||||
nv04_fb_init(struct drm_device *dev)
|
||||
{
|
||||
/* This is what the DDX did for NV_ARCH_04, but a mmio-trace shows
|
||||
* nvidia reading PFB_CFG_0, then writing back its original value.
|
||||
* (which was 0x701114 in this case)
|
||||
*/
|
||||
|
||||
nv_wr32(dev, NV04_PFB_CFG0, 0x1114);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nv04_fb_takedown(struct drm_device *dev)
|
||||
{
|
||||
}
|
||||
struct nouveau_oclass
|
||||
nv04_fb_oclass = {
|
||||
.handle = NV_SUBDEV(FB, 0x04),
|
||||
.ofuncs = &(struct nouveau_ofuncs) {
|
||||
.ctor = nv04_fb_ctor,
|
||||
.dtor = _nouveau_fb_dtor,
|
||||
.init = nv04_fb_init,
|
||||
.fini = _nouveau_fb_fini,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,104 +1,120 @@
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "nouveau_drv.h"
|
||||
#include <nouveau_drm.h>
|
||||
/*
|
||||
* Copyright (C) 2010 Francisco Jerez.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
nv10_fb_init_tile_region(struct drm_device *dev, int i, uint32_t addr,
|
||||
uint32_t size, uint32_t pitch, uint32_t flags)
|
||||
#include <subdev/fb.h>
|
||||
|
||||
struct nv10_fb_priv {
|
||||
struct nouveau_fb base;
|
||||
};
|
||||
|
||||
static void
|
||||
nv10_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
|
||||
u32 flags, struct nouveau_fb_tile *tile)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
tile->addr = 0x80000000 | addr;
|
||||
tile->limit = max(1u, addr + size) - 1;
|
||||
tile->pitch = pitch;
|
||||
}
|
||||
|
||||
void
|
||||
nv10_fb_free_tile_region(struct drm_device *dev, int i)
|
||||
static void
|
||||
nv10_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
tile->addr = tile->limit = tile->pitch = tile->zcomp = 0;
|
||||
tile->addr = 0;
|
||||
tile->limit = 0;
|
||||
tile->pitch = 0;
|
||||
tile->zcomp = 0;
|
||||
}
|
||||
|
||||
void
|
||||
nv10_fb_set_tile_region(struct drm_device *dev, int i)
|
||||
nv10_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
nv_wr32(dev, NV10_PFB_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV10_PFB_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV10_PFB_TILE(i), tile->addr);
|
||||
nv_wr32(pfb, 0x100244 + (i * 0x10), tile->limit);
|
||||
nv_wr32(pfb, 0x100248 + (i * 0x10), tile->pitch);
|
||||
nv_wr32(pfb, 0x100240 + (i * 0x10), tile->addr);
|
||||
}
|
||||
|
||||
int
|
||||
nv1a_fb_vram_init(struct drm_device *dev)
|
||||
static int
|
||||
nv10_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
||||
struct nouveau_oclass *oclass, void *data, u32 size,
|
||||
struct nouveau_object **pobject)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct pci_dev *bridge;
|
||||
uint32_t mem, mib;
|
||||
struct nouveau_device *device = nv_device(parent);
|
||||
struct nv10_fb_priv *priv;
|
||||
int ret;
|
||||
|
||||
bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
|
||||
if (!bridge) {
|
||||
NV_ERROR(dev, "no bridge device\n");
|
||||
return 0;
|
||||
}
|
||||
ret = nouveau_fb_create(parent, engine, oclass, &priv);
|
||||
*pobject = nv_object(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (dev_priv->chipset == 0x1a) {
|
||||
pci_read_config_dword(bridge, 0x7c, &mem);
|
||||
mib = ((mem >> 6) & 31) + 1;
|
||||
if (device->chipset == 0x1a || device->chipset == 0x1f) {
|
||||
struct pci_dev *bridge;
|
||||
u32 mem, mib;
|
||||
|
||||
bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
|
||||
if (!bridge) {
|
||||
nv_fatal(device, "no bridge device\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (device->chipset == 0x1a) {
|
||||
pci_read_config_dword(bridge, 0x7c, &mem);
|
||||
mib = ((mem >> 6) & 31) + 1;
|
||||
} else {
|
||||
pci_read_config_dword(bridge, 0x84, &mem);
|
||||
mib = ((mem >> 4) & 127) + 1;
|
||||
}
|
||||
|
||||
priv->base.ram.type = NV_MEM_TYPE_STOLEN;
|
||||
priv->base.ram.size = mib * 1024 * 1024;
|
||||
} else {
|
||||
pci_read_config_dword(bridge, 0x84, &mem);
|
||||
mib = ((mem >> 4) & 127) + 1;
|
||||
u32 cfg0 = nv_rd32(priv, 0x100200);
|
||||
if (cfg0 & 0x00000001)
|
||||
priv->base.ram.type = NV_MEM_TYPE_DDR1;
|
||||
else
|
||||
priv->base.ram.type = NV_MEM_TYPE_SDRAM;
|
||||
|
||||
priv->base.ram.size = nv_rd32(priv, 0x10020c) & 0xff000000;
|
||||
}
|
||||
|
||||
dev_priv->vram_size = mib * 1024 * 1024;
|
||||
return 0;
|
||||
priv->base.memtype_valid = nv04_fb_memtype_valid;
|
||||
priv->base.tile.regions = 8;
|
||||
priv->base.tile.init = nv10_fb_tile_init;
|
||||
priv->base.tile.fini = nv10_fb_tile_fini;
|
||||
priv->base.tile.prog = nv10_fb_tile_prog;
|
||||
return nouveau_fb_created(&priv->base);
|
||||
}
|
||||
|
||||
int
|
||||
nv10_fb_vram_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
u32 fifo_data = nv_rd32(dev, NV04_PFB_FIFO_DATA);
|
||||
u32 cfg0 = nv_rd32(dev, 0x100200);
|
||||
|
||||
dev_priv->vram_size = fifo_data & NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK;
|
||||
|
||||
if (cfg0 & 0x00000001)
|
||||
dev_priv->vram_type = NV_MEM_TYPE_DDR1;
|
||||
else
|
||||
dev_priv->vram_type = NV_MEM_TYPE_SDRAM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nv10_fb_init(struct drm_device *dev)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_fb_engine *pfb = &dev_priv->engine.fb;
|
||||
int i;
|
||||
|
||||
/* Turn all the tiling regions off. */
|
||||
pfb->num_tiles = NV10_PFB_TILE__SIZE;
|
||||
for (i = 0; i < pfb->num_tiles; i++)
|
||||
pfb->set_tile_region(dev, i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nv10_fb_takedown(struct drm_device *dev)
|
||||
{
|
||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||
struct nouveau_fb_engine *pfb = &dev_priv->engine.fb;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < pfb->num_tiles; i++)
|
||||
pfb->free_tile_region(dev, i);
|
||||
}
|
||||
struct nouveau_oclass
|
||||
nv10_fb_oclass = {
|
||||
.handle = NV_SUBDEV(FB, 0x10),
|
||||
.ofuncs = &(struct nouveau_ofuncs) {
|
||||
.ctor = nv10_fb_ctor,
|
||||
.dtor = _nouveau_fb_dtor,
|
||||
.init = _nouveau_fb_init,
|
||||
.fini = _nouveau_fb_fini,
|
||||
},
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user