You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
drm/nouveau/gr: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <core/subdev.h>
|
||||
struct nvkm_device_oclass; /*XXX: DEV!ENG */
|
||||
struct nvkm_fifo_chan;
|
||||
struct nvkm_fb_tile;
|
||||
|
||||
#define NV_ENGINE_(eng,var) (((var) << 8) | (eng))
|
||||
#define NV_ENGINE(name,var) NV_ENGINE_(NVDEV_ENGINE_##name, (var))
|
||||
@@ -20,7 +21,6 @@ struct nvkm_engine {
|
||||
spinlock_t lock;
|
||||
|
||||
void (*tile_prog)(struct nvkm_engine *, int region);
|
||||
int (*tlb_flush)(struct nvkm_engine *);
|
||||
};
|
||||
|
||||
struct nvkm_engine_func {
|
||||
@@ -29,6 +29,7 @@ struct nvkm_engine_func {
|
||||
int (*init)(struct nvkm_engine *);
|
||||
int (*fini)(struct nvkm_engine *, bool suspend);
|
||||
void (*intr)(struct nvkm_engine *);
|
||||
void (*tile)(struct nvkm_engine *, int region, struct nvkm_fb_tile *);
|
||||
|
||||
struct {
|
||||
int (*sclass)(struct nvkm_oclass *, int index,
|
||||
@@ -54,6 +55,7 @@ int nvkm_engine_new_(const struct nvkm_engine_func *, struct nvkm_device *,
|
||||
struct nvkm_engine **);
|
||||
struct nvkm_engine *nvkm_engine_ref(struct nvkm_engine *);
|
||||
void nvkm_engine_unref(struct nvkm_engine **);
|
||||
void nvkm_engine_tile(struct nvkm_engine *, int region);
|
||||
|
||||
static inline struct nvkm_engine *
|
||||
nv_engine(void *obj)
|
||||
|
||||
@@ -3,64 +3,44 @@
|
||||
#include <core/engine.h>
|
||||
|
||||
struct nvkm_gr {
|
||||
struct nvkm_engine engine;
|
||||
const struct nvkm_gr_func *func;
|
||||
|
||||
/* Returns chipset-specific counts of units packed into an u64.
|
||||
*/
|
||||
u64 (*units)(struct nvkm_gr *);
|
||||
struct nvkm_engine engine;
|
||||
};
|
||||
|
||||
#define nvkm_gr_create(p,e,c,y,d) \
|
||||
nvkm_gr_create_((p), (e), (c), (y), sizeof(**d), (void **)(d))
|
||||
int
|
||||
nvkm_gr_create_(struct nvkm_object *parent, struct nvkm_object *engine,
|
||||
struct nvkm_oclass *oclass, bool enable,
|
||||
int length, void **pobject);
|
||||
#define nvkm_gr_destroy(d) \
|
||||
nvkm_engine_destroy(&(d)->engine)
|
||||
#define nvkm_gr_init(d) \
|
||||
nvkm_engine_init_old(&(d)->engine)
|
||||
#define nvkm_gr_fini(d,s) \
|
||||
nvkm_engine_fini_old(&(d)->engine, (s))
|
||||
u64 nvkm_gr_units(struct nvkm_gr *);
|
||||
int nvkm_gr_tlb_flush(struct nvkm_gr *);
|
||||
|
||||
#define _nvkm_gr_dtor _nvkm_engine_dtor
|
||||
#define _nvkm_gr_init _nvkm_engine_init
|
||||
#define _nvkm_gr_fini _nvkm_engine_fini
|
||||
|
||||
extern struct nvkm_oclass nv04_gr_oclass;
|
||||
extern struct nvkm_oclass nv10_gr_oclass;
|
||||
extern struct nvkm_oclass nv20_gr_oclass;
|
||||
extern struct nvkm_oclass nv25_gr_oclass;
|
||||
extern struct nvkm_oclass nv2a_gr_oclass;
|
||||
extern struct nvkm_oclass nv30_gr_oclass;
|
||||
extern struct nvkm_oclass nv34_gr_oclass;
|
||||
extern struct nvkm_oclass nv35_gr_oclass;
|
||||
extern struct nvkm_oclass nv40_gr_oclass;
|
||||
extern struct nvkm_oclass nv50_gr_oclass;
|
||||
extern struct nvkm_oclass *gf100_gr_oclass;
|
||||
extern struct nvkm_oclass *gf108_gr_oclass;
|
||||
extern struct nvkm_oclass *gf104_gr_oclass;
|
||||
extern struct nvkm_oclass *gf110_gr_oclass;
|
||||
extern struct nvkm_oclass *gf117_gr_oclass;
|
||||
extern struct nvkm_oclass *gf119_gr_oclass;
|
||||
extern struct nvkm_oclass *gk104_gr_oclass;
|
||||
extern struct nvkm_oclass *gk20a_gr_oclass;
|
||||
extern struct nvkm_oclass *gk110_gr_oclass;
|
||||
extern struct nvkm_oclass *gk110b_gr_oclass;
|
||||
extern struct nvkm_oclass *gk208_gr_oclass;
|
||||
extern struct nvkm_oclass *gm107_gr_oclass;
|
||||
extern struct nvkm_oclass *gm204_gr_oclass;
|
||||
extern struct nvkm_oclass *gm206_gr_oclass;
|
||||
extern struct nvkm_oclass *gm20b_gr_oclass;
|
||||
|
||||
#include <core/enum.h>
|
||||
|
||||
extern const struct nvkm_bitfield nv04_gr_nsource[];
|
||||
bool nv04_gr_idle(struct nvkm_gr *);
|
||||
|
||||
extern const struct nvkm_bitfield nv10_gr_intr_name[];
|
||||
extern const struct nvkm_bitfield nv10_gr_nstatus[];
|
||||
|
||||
extern const struct nvkm_enum nv50_data_error_names[];
|
||||
int nv04_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv10_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv15_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv17_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv20_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv25_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv2a_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv30_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv34_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv35_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv40_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv44_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int nv50_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int g84_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gt200_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int mcp79_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gt215_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int mcp89_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf100_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf104_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf108_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf110_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf117_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gf119_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gk104_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gk110_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gk110b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gk208_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gk20a_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gm107_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gm204_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gm206_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
|
||||
#endif
|
||||
|
||||
@@ -215,7 +215,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
|
||||
getparam->value = 1;
|
||||
break;
|
||||
case NOUVEAU_GETPARAM_GRAPH_UNITS:
|
||||
getparam->value = gr->units ? gr->units(gr) : 0;
|
||||
getparam->value = nvkm_gr_units(gr);
|
||||
break;
|
||||
default:
|
||||
NV_PRINTK(dbg, cli, "unknown parameter %lld\n", getparam->param);
|
||||
|
||||
@@ -48,7 +48,8 @@ nv10_bo_update_tile_region(struct drm_device *dev, struct nouveau_drm_tile *reg,
|
||||
{
|
||||
struct nouveau_drm *drm = nouveau_drm(dev);
|
||||
int i = reg - drm->tile.reg;
|
||||
struct nvkm_fb *fb = nvxx_fb(&drm->device);
|
||||
struct nvkm_device *device = nvxx_device(&drm->device);
|
||||
struct nvkm_fb *fb = device->fb;
|
||||
struct nvkm_fb_tile *tile = &fb->tile.region[i];
|
||||
|
||||
nouveau_fence_unref(®->fence);
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <core/device.h>
|
||||
#include <core/option.h>
|
||||
|
||||
#include <subdev/fb.h>
|
||||
|
||||
void
|
||||
nvkm_engine_unref(struct nvkm_engine **pengine)
|
||||
{
|
||||
@@ -56,6 +58,14 @@ nvkm_engine_ref(struct nvkm_engine *engine)
|
||||
return engine;
|
||||
}
|
||||
|
||||
void
|
||||
nvkm_engine_tile(struct nvkm_engine *engine, int region)
|
||||
{
|
||||
struct nvkm_fb *fb = engine->subdev.device->fb;
|
||||
if (engine->func->tile)
|
||||
engine->func->tile(engine, region, &fb->tile.region[region]);
|
||||
}
|
||||
|
||||
static void
|
||||
nvkm_engine_intr(struct nvkm_subdev *obj)
|
||||
{
|
||||
@@ -80,7 +90,8 @@ nvkm_engine_init(struct nvkm_subdev *obj)
|
||||
{
|
||||
struct nvkm_engine *engine = container_of(obj, typeof(*engine), subdev);
|
||||
struct nvkm_subdev *subdev = &engine->subdev;
|
||||
int ret = 0;
|
||||
struct nvkm_fb *fb = subdev->device->fb;
|
||||
int ret = 0, i;
|
||||
s64 time;
|
||||
|
||||
if (!engine->usecount) {
|
||||
@@ -108,6 +119,8 @@ nvkm_engine_init(struct nvkm_subdev *obj)
|
||||
if (engine->func->init)
|
||||
ret = engine->func->init(engine);
|
||||
|
||||
for (i = 0; fb && i < fb->tile.regions; i++)
|
||||
nvkm_engine_tile(engine, i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,47 +29,38 @@ gf100_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0xc0:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf100_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xc4:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xc3:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xce:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xcf:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xc1:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf108_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf108_pm_oclass;
|
||||
break;
|
||||
case 0xc8:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf110_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf100_pm_oclass;
|
||||
break;
|
||||
case 0xd9:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf119_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf117_pm_oclass;
|
||||
break;
|
||||
case 0xd7:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gf117_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gf117_pm_oclass;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -29,41 +29,33 @@ gk104_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0xe4:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gk104_pm_oclass;
|
||||
break;
|
||||
case 0xe7:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gk104_pm_oclass;
|
||||
break;
|
||||
case 0xe6:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk104_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gk104_pm_oclass;
|
||||
break;
|
||||
case 0xea:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk20a_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gk104_pm_oclass;
|
||||
break;
|
||||
case 0xf0:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk110_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = &gk110_pm_oclass;
|
||||
break;
|
||||
case 0xf1:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk110b_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = &gk110_pm_oclass;
|
||||
break;
|
||||
case 0x106:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk208_gr_oclass;
|
||||
break;
|
||||
case 0x108:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gk208_gr_oclass;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -32,7 +32,6 @@ gm100_identify(struct nvkm_device *device)
|
||||
#if 0
|
||||
#endif
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gm107_gr_oclass;
|
||||
#if 0
|
||||
#endif
|
||||
#if 0
|
||||
@@ -46,7 +45,6 @@ gm100_identify(struct nvkm_device *device)
|
||||
#if 0
|
||||
#endif
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gm204_gr_oclass;
|
||||
#if 0
|
||||
#endif
|
||||
break;
|
||||
@@ -58,14 +56,12 @@ gm100_identify(struct nvkm_device *device)
|
||||
#if 0
|
||||
#endif
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gm206_gr_oclass;
|
||||
#if 0
|
||||
#endif
|
||||
break;
|
||||
case 0x12b:
|
||||
|
||||
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = gm20b_gr_oclass;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -29,11 +29,9 @@ nv04_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0x04:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv04_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv04_gr_oclass;
|
||||
break;
|
||||
case 0x05:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv04_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv04_gr_oclass;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -28,35 +28,27 @@ nv10_identify(struct nvkm_device *device)
|
||||
{
|
||||
switch (device->chipset) {
|
||||
case 0x10:
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x15:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x16:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x1a:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x11:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x17:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x1f:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
case 0x18:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv10_gr_oclass;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -29,19 +29,15 @@ nv20_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0x20:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv20_gr_oclass;
|
||||
break;
|
||||
case 0x25:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv25_gr_oclass;
|
||||
break;
|
||||
case 0x28:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv25_gr_oclass;
|
||||
break;
|
||||
case 0x2a:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv2a_gr_oclass;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -29,25 +29,20 @@ nv30_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0x30:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv30_gr_oclass;
|
||||
break;
|
||||
case 0x35:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv35_gr_oclass;
|
||||
break;
|
||||
case 0x31:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv30_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv31_mpeg_oclass;
|
||||
break;
|
||||
case 0x36:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv35_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv31_mpeg_oclass;
|
||||
break;
|
||||
case 0x34:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv34_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv31_mpeg_oclass;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -29,97 +29,81 @@ nv40_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0x40:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv40_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x41:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv40_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x42:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv40_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x43:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv40_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x45:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x47:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x49:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x4b:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x44:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x46:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x4a:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x4c:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x4e:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x63:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x67:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
case 0x68:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv10_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv40_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv44_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv40_pm_oclass;
|
||||
break;
|
||||
|
||||
@@ -29,80 +29,66 @@ nv50_identify(struct nvkm_device *device)
|
||||
switch (device->chipset) {
|
||||
case 0x50:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &nv50_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = nv50_pm_oclass;
|
||||
break;
|
||||
case 0x84:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0x86:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0x92:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0x94:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0x96:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0x98:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0xa0:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gt200_pm_oclass;
|
||||
break;
|
||||
case 0xaa:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0xac:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = g84_pm_oclass;
|
||||
break;
|
||||
case 0xa3:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gt215_pm_oclass;
|
||||
break;
|
||||
case 0xa5:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gt215_pm_oclass;
|
||||
break;
|
||||
case 0xa8:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gt215_pm_oclass;
|
||||
break;
|
||||
case 0xaf:
|
||||
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
|
||||
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
|
||||
device->oclass[NVDEV_ENGINE_PM ] = gt215_pm_oclass;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
nvkm-y += nvkm/engine/gr/base.o
|
||||
nvkm-y += nvkm/engine/gr/nv04.o
|
||||
nvkm-y += nvkm/engine/gr/nv10.o
|
||||
nvkm-y += nvkm/engine/gr/nv15.o
|
||||
nvkm-y += nvkm/engine/gr/nv17.o
|
||||
nvkm-y += nvkm/engine/gr/nv20.o
|
||||
nvkm-y += nvkm/engine/gr/nv25.o
|
||||
nvkm-y += nvkm/engine/gr/nv2a.o
|
||||
@@ -8,18 +10,24 @@ nvkm-y += nvkm/engine/gr/nv30.o
|
||||
nvkm-y += nvkm/engine/gr/nv34.o
|
||||
nvkm-y += nvkm/engine/gr/nv35.o
|
||||
nvkm-y += nvkm/engine/gr/nv40.o
|
||||
nvkm-y += nvkm/engine/gr/nv44.o
|
||||
nvkm-y += nvkm/engine/gr/nv50.o
|
||||
nvkm-y += nvkm/engine/gr/g84.o
|
||||
nvkm-y += nvkm/engine/gr/gt200.o
|
||||
nvkm-y += nvkm/engine/gr/mcp79.o
|
||||
nvkm-y += nvkm/engine/gr/gt215.o
|
||||
nvkm-y += nvkm/engine/gr/mcp89.o
|
||||
nvkm-y += nvkm/engine/gr/gf100.o
|
||||
nvkm-y += nvkm/engine/gr/gf108.o
|
||||
nvkm-y += nvkm/engine/gr/gf104.o
|
||||
nvkm-y += nvkm/engine/gr/gf108.o
|
||||
nvkm-y += nvkm/engine/gr/gf110.o
|
||||
nvkm-y += nvkm/engine/gr/gf117.o
|
||||
nvkm-y += nvkm/engine/gr/gf119.o
|
||||
nvkm-y += nvkm/engine/gr/gk104.o
|
||||
nvkm-y += nvkm/engine/gr/gk20a.o
|
||||
nvkm-y += nvkm/engine/gr/gk110.o
|
||||
nvkm-y += nvkm/engine/gr/gk110b.o
|
||||
nvkm-y += nvkm/engine/gr/gk208.o
|
||||
nvkm-y += nvkm/engine/gr/gk20a.o
|
||||
nvkm-y += nvkm/engine/gr/gm107.o
|
||||
nvkm-y += nvkm/engine/gr/gm204.o
|
||||
nvkm-y += nvkm/engine/gr/gm206.o
|
||||
@@ -28,16 +36,16 @@ nvkm-y += nvkm/engine/gr/gm20b.o
|
||||
nvkm-y += nvkm/engine/gr/ctxnv40.o
|
||||
nvkm-y += nvkm/engine/gr/ctxnv50.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf100.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf108.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf104.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf108.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf110.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf117.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgf119.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk104.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk20a.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk110.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk110b.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk208.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgk20a.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgm107.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgm204.o
|
||||
nvkm-y += nvkm/engine/gr/ctxgm206.o
|
||||
|
||||
@@ -25,6 +25,30 @@
|
||||
|
||||
#include <engine/fifo.h>
|
||||
|
||||
static void
|
||||
nvkm_gr_tile(struct nvkm_engine *engine, int region, struct nvkm_fb_tile *tile)
|
||||
{
|
||||
struct nvkm_gr *gr = nvkm_gr(engine);
|
||||
if (gr->func->tile)
|
||||
gr->func->tile(gr, region, tile);
|
||||
}
|
||||
|
||||
u64
|
||||
nvkm_gr_units(struct nvkm_gr *gr)
|
||||
{
|
||||
if (gr->func->units)
|
||||
return gr->func->units(gr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nvkm_gr_tlb_flush(struct nvkm_gr *gr)
|
||||
{
|
||||
if (gr->func->tlb_flush)
|
||||
return gr->func->tlb_flush(gr);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_gr_oclass_get(struct nvkm_oclass *oclass, int index)
|
||||
{
|
||||
@@ -59,26 +83,54 @@ nvkm_gr_cclass_new(struct nvkm_fifo_chan *chan,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct nvkm_engine_func
|
||||
static void
|
||||
nvkm_gr_intr(struct nvkm_engine *engine)
|
||||
{
|
||||
struct nvkm_gr *gr = nvkm_gr(engine);
|
||||
gr->func->intr(gr);
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_gr_oneinit(struct nvkm_engine *engine)
|
||||
{
|
||||
struct nvkm_gr *gr = nvkm_gr(engine);
|
||||
if (gr->func->oneinit)
|
||||
return gr->func->oneinit(gr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_gr_init(struct nvkm_engine *engine)
|
||||
{
|
||||
struct nvkm_gr *gr = nvkm_gr(engine);
|
||||
return gr->func->init(gr);
|
||||
}
|
||||
|
||||
static void *
|
||||
nvkm_gr_dtor(struct nvkm_engine *engine)
|
||||
{
|
||||
struct nvkm_gr *gr = nvkm_gr(engine);
|
||||
if (gr->func->dtor)
|
||||
return gr->func->dtor(gr);
|
||||
return gr;
|
||||
}
|
||||
|
||||
static const struct nvkm_engine_func
|
||||
nvkm_gr = {
|
||||
.dtor = nvkm_gr_dtor,
|
||||
.oneinit = nvkm_gr_oneinit,
|
||||
.init = nvkm_gr_init,
|
||||
.intr = nvkm_gr_intr,
|
||||
.tile = nvkm_gr_tile,
|
||||
.fifo.cclass = nvkm_gr_cclass_new,
|
||||
.fifo.sclass = nvkm_gr_oclass_get,
|
||||
};
|
||||
|
||||
int
|
||||
nvkm_gr_create_(struct nvkm_object *parent, struct nvkm_object *engine,
|
||||
struct nvkm_oclass *oclass, bool enable,
|
||||
int length, void **pobject)
|
||||
nvkm_gr_ctor(const struct nvkm_gr_func *func, struct nvkm_device *device,
|
||||
int index, u32 pmc_enable, bool enable, struct nvkm_gr *gr)
|
||||
{
|
||||
struct nvkm_gr *gr;
|
||||
int ret;
|
||||
|
||||
ret = nvkm_engine_create_(parent, engine, oclass, enable,
|
||||
"gr", "gr", length, pobject);
|
||||
gr = *pobject;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
gr->engine.func = &nvkm_gr;
|
||||
return 0;
|
||||
gr->func = func;
|
||||
return nvkm_engine_ctor(&nvkm_gr, device, index, pmc_enable,
|
||||
enable, &gr->engine);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ctxgf100.h"
|
||||
#include "gk20a.h"
|
||||
#include "gf100.h"
|
||||
|
||||
#include <subdev/mc.h>
|
||||
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* 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 "nv50.h"
|
||||
|
||||
#include <subdev/timer.h>
|
||||
|
||||
static const struct nvkm_bitfield nv50_gr_status[] = {
|
||||
{ 0x00000001, "BUSY" }, /* set when any bit is set */
|
||||
{ 0x00000002, "DISPATCH" },
|
||||
{ 0x00000004, "UNK2" },
|
||||
{ 0x00000008, "UNK3" },
|
||||
{ 0x00000010, "UNK4" },
|
||||
{ 0x00000020, "UNK5" },
|
||||
{ 0x00000040, "M2MF" },
|
||||
{ 0x00000080, "UNK7" },
|
||||
{ 0x00000100, "CTXPROG" },
|
||||
{ 0x00000200, "VFETCH" },
|
||||
{ 0x00000400, "CCACHE_PREGEOM" },
|
||||
{ 0x00000800, "STRMOUT_VATTR_POSTGEOM" },
|
||||
{ 0x00001000, "VCLIP" },
|
||||
{ 0x00002000, "RATTR_APLANE" },
|
||||
{ 0x00004000, "TRAST" },
|
||||
{ 0x00008000, "CLIPID" },
|
||||
{ 0x00010000, "ZCULL" },
|
||||
{ 0x00020000, "ENG2D" },
|
||||
{ 0x00040000, "RMASK" },
|
||||
{ 0x00080000, "TPC_RAST" },
|
||||
{ 0x00100000, "TPC_PROP" },
|
||||
{ 0x00200000, "TPC_TEX" },
|
||||
{ 0x00400000, "TPC_GEOM" },
|
||||
{ 0x00800000, "TPC_MP" },
|
||||
{ 0x01000000, "ROP" },
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct nvkm_bitfield
|
||||
nv50_gr_vstatus_0[] = {
|
||||
{ 0x01, "VFETCH" },
|
||||
{ 0x02, "CCACHE" },
|
||||
{ 0x04, "PREGEOM" },
|
||||
{ 0x08, "POSTGEOM" },
|
||||
{ 0x10, "VATTR" },
|
||||
{ 0x20, "STRMOUT" },
|
||||
{ 0x40, "VCLIP" },
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct nvkm_bitfield
|
||||
nv50_gr_vstatus_1[] = {
|
||||
{ 0x01, "TPC_RAST" },
|
||||
{ 0x02, "TPC_PROP" },
|
||||
{ 0x04, "TPC_TEX" },
|
||||
{ 0x08, "TPC_GEOM" },
|
||||
{ 0x10, "TPC_MP" },
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct nvkm_bitfield
|
||||
nv50_gr_vstatus_2[] = {
|
||||
{ 0x01, "RATTR" },
|
||||
{ 0x02, "APLANE" },
|
||||
{ 0x04, "TRAST" },
|
||||
{ 0x08, "CLIPID" },
|
||||
{ 0x10, "ZCULL" },
|
||||
{ 0x20, "ENG2D" },
|
||||
{ 0x40, "RMASK" },
|
||||
{ 0x80, "ROP" },
|
||||
{}
|
||||
};
|
||||
|
||||
static void
|
||||
nvkm_gr_vstatus_print(struct nv50_gr *gr, int r,
|
||||
const struct nvkm_bitfield *units, u32 status)
|
||||
{
|
||||
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
|
||||
u32 stat = status;
|
||||
u8 mask = 0x00;
|
||||
char msg[64];
|
||||
int i;
|
||||
|
||||
for (i = 0; units[i].name && status; i++) {
|
||||
if ((status & 7) == 1)
|
||||
mask |= (1 << i);
|
||||
status >>= 3;
|
||||
}
|
||||
|
||||
nvkm_snprintbf(msg, sizeof(msg), units, mask);
|
||||
nvkm_error(subdev, "PGRAPH_VSTATUS%d: %08x [%s]\n", r, stat, msg);
|
||||
}
|
||||
|
||||
int
|
||||
g84_gr_tlb_flush(struct nvkm_gr *base)
|
||||
{
|
||||
struct nv50_gr *gr = nv50_gr(base);
|
||||
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
|
||||
struct nvkm_device *device = subdev->device;
|
||||
struct nvkm_timer *tmr = device->timer;
|
||||
bool idle, timeout = false;
|
||||
unsigned long flags;
|
||||
char status[128];
|
||||
u64 start;
|
||||
u32 tmp;
|
||||
|
||||
spin_lock_irqsave(&gr->lock, flags);
|
||||
nvkm_mask(device, 0x400500, 0x00000001, 0x00000000);
|
||||
|
||||
start = nvkm_timer_read(tmr);
|
||||
do {
|
||||
idle = true;
|
||||
|
||||
for (tmp = nvkm_rd32(device, 0x400380); tmp && idle; tmp >>= 3) {
|
||||
if ((tmp & 7) == 1)
|
||||
idle = false;
|
||||
}
|
||||
|
||||
for (tmp = nvkm_rd32(device, 0x400384); tmp && idle; tmp >>= 3) {
|
||||
if ((tmp & 7) == 1)
|
||||
idle = false;
|
||||
}
|
||||
|
||||
for (tmp = nvkm_rd32(device, 0x400388); tmp && idle; tmp >>= 3) {
|
||||
if ((tmp & 7) == 1)
|
||||
idle = false;
|
||||
}
|
||||
} while (!idle &&
|
||||
!(timeout = nvkm_timer_read(tmr) - start > 2000000000));
|
||||
|
||||
if (timeout) {
|
||||
nvkm_error(subdev, "PGRAPH TLB flush idle timeout fail\n");
|
||||
|
||||
tmp = nvkm_rd32(device, 0x400700);
|
||||
nvkm_snprintbf(status, sizeof(status), nv50_gr_status, tmp);
|
||||
nvkm_error(subdev, "PGRAPH_STATUS %08x [%s]\n", tmp, status);
|
||||
|
||||
nvkm_gr_vstatus_print(gr, 0, nv50_gr_vstatus_0,
|
||||
nvkm_rd32(device, 0x400380));
|
||||
nvkm_gr_vstatus_print(gr, 1, nv50_gr_vstatus_1,
|
||||
nvkm_rd32(device, 0x400384));
|
||||
nvkm_gr_vstatus_print(gr, 2, nv50_gr_vstatus_2,
|
||||
nvkm_rd32(device, 0x400388));
|
||||
}
|
||||
|
||||
|
||||
nvkm_wr32(device, 0x100c80, 0x00000001);
|
||||
nvkm_msec(device, 2000,
|
||||
if (!(nvkm_rd32(device, 0x100c80) & 0x00000001))
|
||||
break;
|
||||
);
|
||||
nvkm_mask(device, 0x400500, 0x00000001, 0x00000001);
|
||||
spin_unlock_irqrestore(&gr->lock, flags);
|
||||
return timeout ? -EBUSY : 0;
|
||||
}
|
||||
|
||||
static const struct nvkm_gr_func
|
||||
g84_gr = {
|
||||
.init = nv50_gr_init,
|
||||
.intr = nv50_gr_intr,
|
||||
.chan_new = nv50_gr_chan_new,
|
||||
.tlb_flush = g84_gr_tlb_flush,
|
||||
.units = nv50_gr_units,
|
||||
.sclass = {
|
||||
{ -1, -1, 0x0030, &nv50_gr_object },
|
||||
{ -1, -1, 0x502d, &nv50_gr_object },
|
||||
{ -1, -1, 0x5039, &nv50_gr_object },
|
||||
{ -1, -1, 0x50c0, &nv50_gr_object },
|
||||
{ -1, -1, 0x8297, &nv50_gr_object },
|
||||
{}
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
g84_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
||||
{
|
||||
return nv50_gr_new_(&g84_gr, device, index, pgr);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user