From 0ad72863ea426d46b2786cba9430e122a40aad0b Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 10 Aug 2014 04:10:22 +1000 Subject: drm/nouveau: port to nvif client/device/objects Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_drm.h | 46 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.h') diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h index 07e9c734cc46..a29fd210e4c6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.h +++ b/drivers/gpu/drm/nouveau/nouveau_drm.h @@ -28,6 +28,9 @@ #include #include +#include +#include + #include #include @@ -53,6 +56,17 @@ struct nouveau_drm_tile { bool used; }; +enum nouveau_drm_object_route { + NVDRM_OBJECT_NVIF = 0, + NVDRM_OBJECT_USIF, + NVDRM_OBJECT_ABI16, +}; + +enum nouveau_drm_notify_route { + NVDRM_NOTIFY_NVIF = 0, + NVDRM_NOTIFY_USIF +}; + enum nouveau_drm_handle { NVDRM_CLIENT = 0xffffffff, NVDRM_DEVICE = 0xdddddddd, @@ -64,7 +78,7 @@ enum nouveau_drm_handle { }; struct nouveau_cli { - struct nouveau_client base; + struct nvif_client base; struct nouveau_vm *vm; /*XXX*/ struct list_head head; struct mutex mutex; @@ -78,31 +92,6 @@ nouveau_cli(struct drm_file *fpriv) } #include -#undef nvif_object -#undef nvif_rd08 -#undef nvif_rd16 -#undef nvif_rd32 -#undef nvif_wr08 -#undef nvif_wr16 -#undef nvif_wr32 -#undef nvif_mask -#undef nvkm_object -#undef nvif_exec - -#define nvif_object(a) ({ \ - struct nvif_object *_object = (a)->object; \ - (struct nouveau_object *)_object; \ -}) -#define nvif_rd08(a,b) nv_ro08(nvif_object(a), (b)) -#define nvif_rd16(a,b) nv_ro16(nvif_object(a), (b)) -#define nvif_rd32(a,b) nv_ro32(nvif_object(a), (b)) -#define nvif_wr08(a,b,c) nv_wo08(nvif_object(a), (b), (c)) -#define nvif_wr16(a,b,c) nv_wo16(nvif_object(a), (b), (c)) -#define nvif_wr32(a,b,c) nv_wo32(nvif_object(a), (b), (c)) -#define nvif_mask(a,b,c,d) nv_mo32(nvif_object(a), (b), (c), (d)) -#define nvkm_object(a) nvif_object(a) -#define nvif_exec(a,b,c,d) nv_exec(nvkm_object(a), (b), (c), (d)) - #include extern int nouveau_runtime_pm; @@ -134,6 +123,7 @@ struct nouveau_drm { struct ttm_buffer_object *, struct ttm_mem_reg *, struct ttm_mem_reg *); struct nouveau_channel *chan; + struct nvif_object copy; int mtrr; } ttm; @@ -151,6 +141,8 @@ struct nouveau_drm { struct nouveau_channel *channel; struct nouveau_gpuobj *notify; struct nouveau_fbdev *fbcon; + struct nvif_object nvsw; + struct nvif_object ntfy; /* nv10-nv40 tiling regions */ struct { @@ -192,7 +184,7 @@ void nouveau_drm_device_remove(struct drm_device *dev); #define NV_PRINTK(l,c,f,a...) do { \ struct nouveau_cli *_cli = (c); \ - nv_##l(_cli, f, ##a); \ + nv_##l(_cli->base.base.priv, f, ##a); \ } while(0) #define NV_FATAL(drm,f,a...) NV_PRINTK(fatal, &(drm)->client, f, ##a) #define NV_ERROR(drm,f,a...) NV_PRINTK(error, &(drm)->client, f, ##a) -- cgit v1.2.3