nouveau_software.h 1.2 KB

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