diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 22:10:22 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 23:13:14 +0400 |
commit | 0ad72863ea426d46b2786cba9430e122a40aad0b (patch) | |
tree | bbb9346e53a5e0c16674f4e43807cad013c6cc25 /drivers/gpu/drm/nouveau/nouveau_drm.h | |
parent | 967e7bde8739fe3b215f7537e8f1f39c044902af (diff) | |
download | linux-0ad72863ea426d46b2786cba9430e122a40aad0b.tar.xz |
drm/nouveau: port to nvif client/device/objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.h | 46 |
1 files changed, 19 insertions, 27 deletions
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 <core/client.h> #include <core/event.h> +#include <nvif/client.h> +#include <nvif/device.h> + #include <subdev/vm.h> #include <drmP.h> @@ -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 <nvif/object.h> -#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 <nvif/device.h> 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) |