nv40.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __NV40_GR_H__
  2. #define __NV40_GR_H__
  3. #define nv40_gr(p) container_of((p), struct nv40_gr, base)
  4. #include "priv.h"
  5. struct nv40_gr {
  6. struct nvkm_gr base;
  7. u32 size;
  8. struct list_head chan;
  9. };
  10. int nv40_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index,
  11. struct nvkm_gr **);
  12. int nv40_gr_init(struct nvkm_gr *);
  13. void nv40_gr_intr(struct nvkm_gr *);
  14. u64 nv40_gr_units(struct nvkm_gr *);
  15. #define nv40_gr_chan(p) container_of((p), struct nv40_gr_chan, object)
  16. struct nv40_gr_chan {
  17. struct nvkm_object object;
  18. struct nv40_gr *gr;
  19. struct nvkm_fifo_chan *fifo;
  20. u32 inst;
  21. struct list_head head;
  22. };
  23. int nv40_gr_chan_new(struct nvkm_gr *, struct nvkm_fifo_chan *,
  24. const struct nvkm_oclass *, struct nvkm_object **);
  25. extern const struct nvkm_object_func nv40_gr_object;
  26. /* returns 1 if device is one of the nv4x using the 0x4497 object class,
  27. * helpful to determine a number of other hardware features
  28. */
  29. static inline int
  30. nv44_gr_class(struct nvkm_device *device)
  31. {
  32. if ((device->chipset & 0xf0) == 0x60)
  33. return 1;
  34. return !(0x0aaf & (1 << (device->chipset & 0x0f)));
  35. }
  36. int nv40_grctx_init(struct nvkm_device *, u32 *size);
  37. void nv40_grctx_fill(struct nvkm_device *, struct nvkm_gpuobj *);
  38. #endif