gamma_drm.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef _GAMMA_DRM_H_
  2. #define _GAMMA_DRM_H_
  3. typedef struct _drm_gamma_tex_region {
  4. unsigned char next, prev; /* indices to form a circular LRU */
  5. unsigned char in_use; /* owned by a client, or free? */
  6. int age; /* tracked by clients to update local LRU's */
  7. } drm_gamma_tex_region_t;
  8. typedef struct {
  9. unsigned int GDeltaMode;
  10. unsigned int GDepthMode;
  11. unsigned int GGeometryMode;
  12. unsigned int GTransformMode;
  13. } drm_gamma_context_regs_t;
  14. typedef struct _drm_gamma_sarea {
  15. drm_gamma_context_regs_t context_state;
  16. unsigned int dirty;
  17. /* Maintain an LRU of contiguous regions of texture space. If
  18. * you think you own a region of texture memory, and it has an
  19. * age different to the one you set, then you are mistaken and
  20. * it has been stolen by another client. If global texAge
  21. * hasn't changed, there is no need to walk the list.
  22. *
  23. * These regions can be used as a proxy for the fine-grained
  24. * texture information of other clients - by maintaining them
  25. * in the same lru which is used to age their own textures,
  26. * clients have an approximate lru for the whole of global
  27. * texture space, and can make informed decisions as to which
  28. * areas to kick out. There is no need to choose whether to
  29. * kick out your own texture or someone else's - simply eject
  30. * them all in LRU order.
  31. */
  32. #define GAMMA_NR_TEX_REGIONS 64
  33. drm_gamma_tex_region_t texList[GAMMA_NR_TEX_REGIONS+1];
  34. /* Last elt is sentinal */
  35. int texAge; /* last time texture was uploaded */
  36. int last_enqueue; /* last time a buffer was enqueued */
  37. int last_dispatch; /* age of the most recently dispatched buffer */
  38. int last_quiescent; /* */
  39. int ctxOwner; /* last context to upload state */
  40. int vertex_prim;
  41. } drm_gamma_sarea_t;
  42. /* WARNING: If you change any of these defines, make sure to change the
  43. * defines in the Xserver file (xf86drmGamma.h)
  44. */
  45. /* Gamma specific ioctls
  46. * The device specific ioctl range is 0x40 to 0x79.
  47. */
  48. #define DRM_IOCTL_GAMMA_INIT DRM_IOW( 0x40, drm_gamma_init_t)
  49. #define DRM_IOCTL_GAMMA_COPY DRM_IOW( 0x41, drm_gamma_copy_t)
  50. typedef struct drm_gamma_copy {
  51. unsigned int DMAOutputAddress;
  52. unsigned int DMAOutputCount;
  53. unsigned int DMAReadGLINTSource;
  54. unsigned int DMARectangleWriteAddress;
  55. unsigned int DMARectangleWriteLinePitch;
  56. unsigned int DMARectangleWrite;
  57. unsigned int DMARectangleReadAddress;
  58. unsigned int DMARectangleReadLinePitch;
  59. unsigned int DMARectangleRead;
  60. unsigned int DMARectangleReadTarget;
  61. } drm_gamma_copy_t;
  62. typedef struct drm_gamma_init {
  63. enum {
  64. GAMMA_INIT_DMA = 0x01,
  65. GAMMA_CLEANUP_DMA = 0x02
  66. } func;
  67. int sarea_priv_offset;
  68. int pcimode;
  69. unsigned int mmio0;
  70. unsigned int mmio1;
  71. unsigned int mmio2;
  72. unsigned int mmio3;
  73. unsigned int buffers_offset;
  74. int num_rast;
  75. } drm_gamma_init_t;
  76. #endif /* _GAMMA_DRM_H_ */