psb_drm.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /**************************************************************************
  2. * Copyright (c) 2007-2011, Intel Corporation.
  3. * All Rights Reserved.
  4. * Copyright (c) 2008, Tungsten Graphics Inc. Cedar Park, TX., USA.
  5. * All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. **************************************************************************/
  21. #ifndef _PSB_DRM_H_
  22. #define _PSB_DRM_H_
  23. #define PSB_NUM_PIPE 3
  24. #define PSB_GPU_ACCESS_READ (1ULL << 32)
  25. #define PSB_GPU_ACCESS_WRITE (1ULL << 33)
  26. #define PSB_GPU_ACCESS_MASK (PSB_GPU_ACCESS_READ | PSB_GPU_ACCESS_WRITE)
  27. #define PSB_BO_FLAG_COMMAND (1ULL << 52)
  28. /*
  29. * Feedback components:
  30. */
  31. struct drm_psb_sizes_arg {
  32. u32 ta_mem_size;
  33. u32 mmu_size;
  34. u32 pds_size;
  35. u32 rastgeom_size;
  36. u32 tt_size;
  37. u32 vram_size;
  38. };
  39. struct drm_psb_dpst_lut_arg {
  40. uint8_t lut[256];
  41. int output_id;
  42. };
  43. #define PSB_DC_CRTC_SAVE 0x01
  44. #define PSB_DC_CRTC_RESTORE 0x02
  45. #define PSB_DC_OUTPUT_SAVE 0x04
  46. #define PSB_DC_OUTPUT_RESTORE 0x08
  47. #define PSB_DC_CRTC_MASK 0x03
  48. #define PSB_DC_OUTPUT_MASK 0x0C
  49. struct drm_psb_dc_state_arg {
  50. u32 flags;
  51. u32 obj_id;
  52. };
  53. struct drm_psb_mode_operation_arg {
  54. u32 obj_id;
  55. u16 operation;
  56. struct drm_mode_modeinfo mode;
  57. void *data;
  58. };
  59. struct drm_psb_stolen_memory_arg {
  60. u32 base;
  61. u32 size;
  62. };
  63. /*Display Register Bits*/
  64. #define REGRWBITS_PFIT_CONTROLS (1 << 0)
  65. #define REGRWBITS_PFIT_AUTOSCALE_RATIOS (1 << 1)
  66. #define REGRWBITS_PFIT_PROGRAMMED_SCALE_RATIOS (1 << 2)
  67. #define REGRWBITS_PIPEASRC (1 << 3)
  68. #define REGRWBITS_PIPEBSRC (1 << 4)
  69. #define REGRWBITS_VTOTAL_A (1 << 5)
  70. #define REGRWBITS_VTOTAL_B (1 << 6)
  71. #define REGRWBITS_DSPACNTR (1 << 8)
  72. #define REGRWBITS_DSPBCNTR (1 << 9)
  73. #define REGRWBITS_DSPCCNTR (1 << 10)
  74. /*Overlay Register Bits*/
  75. #define OV_REGRWBITS_OVADD (1 << 0)
  76. #define OV_REGRWBITS_OGAM_ALL (1 << 1)
  77. #define OVC_REGRWBITS_OVADD (1 << 2)
  78. #define OVC_REGRWBITS_OGAM_ALL (1 << 3)
  79. struct drm_psb_register_rw_arg {
  80. u32 b_force_hw_on;
  81. u32 display_read_mask;
  82. u32 display_write_mask;
  83. struct {
  84. u32 pfit_controls;
  85. u32 pfit_autoscale_ratios;
  86. u32 pfit_programmed_scale_ratios;
  87. u32 pipeasrc;
  88. u32 pipebsrc;
  89. u32 vtotal_a;
  90. u32 vtotal_b;
  91. } display;
  92. u32 overlay_read_mask;
  93. u32 overlay_write_mask;
  94. struct {
  95. u32 OVADD;
  96. u32 OGAMC0;
  97. u32 OGAMC1;
  98. u32 OGAMC2;
  99. u32 OGAMC3;
  100. u32 OGAMC4;
  101. u32 OGAMC5;
  102. u32 IEP_ENABLED;
  103. u32 IEP_BLE_MINMAX;
  104. u32 IEP_BSSCC_CONTROL;
  105. u32 b_wait_vblank;
  106. } overlay;
  107. u32 sprite_enable_mask;
  108. u32 sprite_disable_mask;
  109. struct {
  110. u32 dspa_control;
  111. u32 dspa_key_value;
  112. u32 dspa_key_mask;
  113. u32 dspc_control;
  114. u32 dspc_stride;
  115. u32 dspc_position;
  116. u32 dspc_linear_offset;
  117. u32 dspc_size;
  118. u32 dspc_surface;
  119. } sprite;
  120. u32 subpicture_enable_mask;
  121. u32 subpicture_disable_mask;
  122. };
  123. /* Controlling the kernel modesetting buffers */
  124. #define DRM_PSB_SIZES 0x07
  125. #define DRM_PSB_FUSE_REG 0x08
  126. #define DRM_PSB_DC_STATE 0x0A
  127. #define DRM_PSB_ADB 0x0B
  128. #define DRM_PSB_MODE_OPERATION 0x0C
  129. #define DRM_PSB_STOLEN_MEMORY 0x0D
  130. #define DRM_PSB_REGISTER_RW 0x0E
  131. /*
  132. * NOTE: Add new commands here, but increment
  133. * the values below and increment their
  134. * corresponding defines where they're
  135. * defined elsewhere.
  136. */
  137. #define DRM_PSB_GEM_CREATE 0x10
  138. #define DRM_PSB_2D_OP 0x11 /* Will be merged later */
  139. #define DRM_PSB_GEM_MMAP 0x12
  140. #define DRM_PSB_DPST 0x1B
  141. #define DRM_PSB_GAMMA 0x1C
  142. #define DRM_PSB_DPST_BL 0x1D
  143. #define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1F
  144. #define PSB_MODE_OPERATION_MODE_VALID 0x01
  145. #define PSB_MODE_OPERATION_SET_DC_BASE 0x02
  146. struct drm_psb_get_pipe_from_crtc_id_arg {
  147. /** ID of CRTC being requested **/
  148. u32 crtc_id;
  149. /** pipe of requested CRTC **/
  150. u32 pipe;
  151. };
  152. /* FIXME: move this into a medfield header once we are sure it isn't needed for an
  153. ioctl */
  154. struct psb_drm_dpu_rect {
  155. int x, y;
  156. int width, height;
  157. };
  158. struct drm_psb_gem_create {
  159. __u64 size;
  160. __u32 handle;
  161. __u32 flags;
  162. #define PSB_GEM_CREATE_STOLEN 1 /* Stolen memory can be used */
  163. };
  164. struct drm_psb_gem_mmap {
  165. __u32 handle;
  166. __u32 pad;
  167. /**
  168. * Fake offset to use for subsequent mmap call
  169. *
  170. * This is a fixed-size type for 32/64 compatibility.
  171. */
  172. __u64 offset;
  173. };
  174. #endif