Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Common header file for both SetHWScoreboard and SetHWScoreboard_MBAFF kernels
  3.  * Copyright © <2010>, Intel Corporation.
  4.  *
  5.  * This program is licensed under the terms and conditions of the
  6.  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
  7.  * http://www.opensource.org/licenses/eclipse-1.0.php.
  8.  *
  9.  */
  10. #if !defined(__SETHWSCOREBOARD_HEADER__)        // Make sure this file is only included once
  11. #define __SETHWSCOREBOARD_HEADER__
  12.  
  13. // Module name: SetHWScoreboard_header.inc
  14. //
  15. // Common header file for both SetHWScoreboard and SetHWScoreboard_MBAFF kernels
  16. //
  17.  
  18. #define BI_CMD_BUF                      0       // Binding table index for command buffer
  19.  
  20. // GRF r1 map
  21. //
  22. // For use by setting HW scoreboard kernel for MBAFF picture
  23. //
  24. // CURBE data
  25. #define TOP_FM_MASK1_D  r1.0            // Bit mask for first half of top frame MB SB mask
  26. #define TOP_FM_MASK1_B  r1.0            // Bit mask for first half of top frame MB SB mask
  27. #define TOP_FM_MASK2_D  r1.1            // Bit mask for second half of top frame MB SB mask
  28. #define TOP_FM_MASK2_B  r1.4            // Bit mask for second half of top frame MB SB mask
  29. #define BOT_FM_MASK1_D  r1.2            // Bit mask for first half of bottom frame MB SB mask
  30. #define BOT_FM_MASK1_B  r1.8            // Bit mask for first half of bottom frame MB SB mask
  31. #define BOT_FM_MASK2_D  r1.3            // Bit mask for second half of bottom frame MB SB mask
  32. #define BOT_FM_MASK2_B  r1.12           // Bit mask for second half of bottom frame MB SB mask
  33. #define TOP_FD_MASK1_D  r1.4            // Bit mask for first half of top field MB SB mask
  34. #define TOP_FD_MASK1_B  r1.16           // Bit mask for first half of top field MB SB mask
  35. #define TOP_FD_MASK2_D  r1.5            // Bit mask for second half of top field MB SB mask
  36. #define TOP_FD_MASK2_B  r1.20           // Bit mask for second half of top field MB SB mask
  37. #define BOT_FD_MASK1_D  r1.6            // Bit mask for first half of bottom field MB SB mask
  38. #define BOT_FD_MASK1_B  r1.24           // Bit mask for first half of bottom field MB SB mask
  39. #define BOT_FD_MASK2_D  r1.7            // Bit mask for second half of bottom field MB SB mask
  40. #define BOT_FD_MASK2_B  r1.28           // Bit mask for second half of bottom field MB SB mask
  41.  
  42. // For use by setting HW scoreboard kernel for non-MBAFF picture
  43. #define MB_SHIFT_MASK_W         r1.0    // :w type. Shift values for two parts of the MB SB mask
  44. #define MB_SHIFT_MASK_B         r1.0    // :b type. Shift values for two parts of the MB SB mask
  45.  
  46. // GRF r2 map
  47. //
  48. // In-line data
  49. //
  50. #define INLINE_REG_OFFSET       1
  51. #define INLINE_REG                      r2
  52.  
  53. #define StartingMB      INLINE_REG.0    // :uw type. Starting MB number
  54. #define TotalMB         INLINE_REG.1    // :uw type. Total number of MB to be processed
  55. #define PicWidthMB      INLINE_REG.2    // :uw type. Picture width in MB
  56.  
  57. // GRF r3 map
  58. //
  59. // Temporary variables
  60. //
  61. #define RemainderMB     r3.0                    // :uw type. Remainder of MB (<16) to be processed
  62.  
  63. #define TEMP_FD_X_W     r3.2                    // :w type. Temporary variable for field MB X origin in MBAFF picture
  64. #define TEMP_FD_X_B     r3.4                    // :b type. Temporary variable for field MB X origin in MBAFF picture
  65. #define TEMP_FD_Y_W     r3.3                    // :w type. Temporary variable for field MB Y origin in MBAFF picture
  66. #define TEMP_FD_Y_B     r3.6                    // :b type. Temporary variable for field MB Y origin in MBAFF picture
  67.  
  68. #define TEMP_INTRA_FLAG_W       r3.4    // :uw type. Temporary intra available flag
  69.  
  70. #define MB_MASK_D       r3.4                    // :ud type. Bit masks for MBAFF MB
  71. #define MB_MASK_B       r3.16                   // :ub type. Bit masks for MBAFF MB
  72.  
  73. #define MRF_READ_HEADER_SRC     r63
  74.  
  75. // MEDIA_OBJECT_EX Command map
  76. //
  77. // In DW1 of each MEDIA_OBJECT_EX command (VFE DWORD)
  78. #define CUR_X   0       // Byte 0
  79. #define CUR_Y   0       // Byte 2
  80.  
  81. // In DW2 of each MEDIA_OBJECT_EX command
  82. #define USE_SCOREBOARD  BIT21
  83.  
  84. // In DW4 of each MEDIA_OBJECT_EX command
  85. #define F_FLAG          BIT4
  86. #define IS_INTRA_MB     BIT13
  87. #define IS_FIELD_MB     BIT14
  88. #define IS_INTRA8X8     BIT15
  89. #define IS_BOT_FD       BIT24
  90.  
  91. // In DW7 of each MEDIA_OBJECT_EX command
  92. #define A_FLAG          BIT0
  93. #define B_FLAG          BIT1
  94. #define C_FLAG          BIT2
  95. #define D_FLAG          BIT3
  96. #define E_FLAG          BIT4
  97.  
  98. #define CMD_BUFFER_REG_OFF              4
  99. .declare    CMD_BUFFER_D                Base=GRF(4) ElementSize=4 SrcRegion=REGION(8,1) Type=ud         // Command buffer (32 GRF)
  100. .declare    CMD_BUFFER_W                Base=GRF(4) ElementSize=2 SrcRegion=REGION(16,1) Type=uw        // Command buffer (32 GRF)
  101. .declare    CMD_BUFFER_B                Base=GRF(4) ElementSize=1 SrcRegion=REGION(16,1) Type=ub        // Command buffer (32 GRF)
  102.  
  103. #define MRF_READ_HEADER         m1
  104. #define MRF_READ_HEADER0        m1
  105. #define MRF_READ_HEADER1        m2
  106. #define MRF_READ_HEADER2        m3
  107. #define MRF_READ_HEADER3        m4
  108.  
  109. #define MRF_INTER_WRITE_HEADER  m5
  110. #define MRF_INTER_WRITE_DATA0   m6
  111. #define MRF_INTER_WRITE_DATA1   m7
  112.  
  113. #define MRF_WRITE_HEADER                m11
  114. #define MRF_INTRA_WRITE_HEADER  m11
  115.  
  116. #define MRF_CMD_BUF_REG_OFF             12
  117. .declare        MRF_CMD_BUF_D           Base=m12 ElementSize=4 SrcRegion=REGION(8,1) Type=ud            // Command buffer stored in MRF
  118. .declare        MRF_CMD_BUF_W           Base=m12 ElementSize=2 SrcRegion=REGION(16,1) Type=uw           // Command buffer stored in MRF
  119. .declare        MRF_CMD_BUF_B           Base=m12 ElementSize=1 SrcRegion=REGION(16,1) Type=ub           // Command buffer stored in MRF
  120.  
  121. #define BI_CMD_BUFFER   0
  122.  
  123. #define OWBRMSGDSC_SC    0x02088000     // OWORD Block Read Message Descriptor, reading from sampler cache = A.
  124. #define OWBWMSGDSC               0x02080000     // OWORD Block Write Message Descriptor
  125.  
  126. #define OWORD_1 0x000
  127. #define OWORD_2 0x200
  128. #define OWORD_4 0x300
  129. #define OWORD_8 0x400
  130.  
  131. // End of SETHWSCOREBOARD_HEADER
  132.  
  133. #endif  // !defined(__SETHWSCOREBOARD_HEADER__)
  134.  
  135.