nouveau_software.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __NOUVEAU_SOFTWARE_H__
  2. #define __NOUVEAU_SOFTWARE_H__
  3. #include "nouveau_fence.h"
  4. struct nouveau_software_priv {
  5. struct nouveau_exec_engine base;
  6. struct list_head vblank;
  7. spinlock_t peephole_lock;
  8. };
  9. struct nouveau_software_chan {
  10. int (*flip)(void *data);
  11. void *flip_data;
  12. struct {
  13. struct list_head list;
  14. u32 channel;
  15. u32 ctxdma;
  16. u32 offset;
  17. u32 value;
  18. u32 head;
  19. } vblank;
  20. };
  21. static inline void
  22. nouveau_software_context_new(struct nouveau_channel *chan,
  23. struct nouveau_software_chan *pch)
  24. {
  25. pch->flip = nouveau_flip_complete;
  26. pch->flip_data = chan;
  27. }
  28. static inline void
  29. nouveau_software_create(struct nouveau_software_priv *psw)
  30. {
  31. INIT_LIST_HEAD(&psw->vblank);
  32. spin_lock_init(&psw->peephole_lock);
  33. }
  34. static inline u16
  35. nouveau_software_class(struct drm_device *dev)
  36. {
  37. struct drm_nouveau_private *dev_priv = dev->dev_private;
  38. if (dev_priv->card_type <= NV_04)
  39. return 0x006e;
  40. if (dev_priv->card_type <= NV_40)
  41. return 0x016e;
  42. if (dev_priv->card_type <= NV_50)
  43. return 0x506e;
  44. if (dev_priv->card_type <= NV_E0)
  45. return 0x906e;
  46. return 0x0000;
  47. }
  48. int nv04_software_create(struct drm_device *);
  49. int nv50_software_create(struct drm_device *);
  50. int nvc0_software_create(struct drm_device *);
  51. #endif