| 1 |
/* |
| 2 |
* Common header file for both SetHWScoreboard and SetHWScoreboard_MBAFF kernels |
| 3 |
* Copyright © <2010>, Intel Corporation. |
| 4 |
* |
| 5 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 6 |
* copy of this software and associated documentation files (the |
| 7 |
* "Software"), to deal in the Software without restriction, including |
| 8 |
* without limitation the rights to use, copy, modify, merge, publish, |
| 9 |
* distribute, sub license, and/or sell copies of the Software, and to |
| 10 |
* permit persons to whom the Software is furnished to do so, subject to |
| 11 |
* the following conditions: |
| 12 |
* |
| 13 |
* The above copyright notice and this permission notice (including the |
| 14 |
* next paragraph) shall be included in all copies or substantial portions |
| 15 |
* of the Software. |
| 16 |
* |
| 17 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 20 |
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 21 |
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 22 |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 23 |
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 |
* |
| 25 |
* This file was originally licensed under the following license |
| 26 |
* |
| 27 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 28 |
* you may not use this file except in compliance with the License. |
| 29 |
* You may obtain a copy of the License at |
| 30 |
* |
| 31 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 32 |
* |
| 33 |
* Unless required by applicable law or agreed to in writing, software |
| 34 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 35 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 36 |
* See the License for the specific language governing permissions and |
| 37 |
* limitations under the License. |
| 38 |
* |
| 39 |
*/ |
| 40 |
#if !defined(__SETHWSCOREBOARD_HEADER__) // Make sure this file is only included once |
| 41 |
#define __SETHWSCOREBOARD_HEADER__ |
| 42 |
|
| 43 |
// Module name: SetHWScoreboard_header.inc |
| 44 |
// |
| 45 |
// Common header file for both SetHWScoreboard and SetHWScoreboard_MBAFF kernels |
| 46 |
// |
| 47 |
|
| 48 |
#define BI_CMD_BUF 0 // Binding table index for command buffer |
| 49 |
|
| 50 |
// GRF r1 map |
| 51 |
// |
| 52 |
// For use by setting HW scoreboard kernel for MBAFF picture |
| 53 |
// |
| 54 |
// CURBE data |
| 55 |
#define TOP_FM_MASK1_D r1.0 // Bit mask for first half of top frame MB SB mask |
| 56 |
#define TOP_FM_MASK1_B r1.0 // Bit mask for first half of top frame MB SB mask |
| 57 |
#define TOP_FM_MASK2_D r1.1 // Bit mask for second half of top frame MB SB mask |
| 58 |
#define TOP_FM_MASK2_B r1.4 // Bit mask for second half of top frame MB SB mask |
| 59 |
#define BOT_FM_MASK1_D r1.2 // Bit mask for first half of bottom frame MB SB mask |
| 60 |
#define BOT_FM_MASK1_B r1.8 // Bit mask for first half of bottom frame MB SB mask |
| 61 |
#define BOT_FM_MASK2_D r1.3 // Bit mask for second half of bottom frame MB SB mask |
| 62 |
#define BOT_FM_MASK2_B r1.12 // Bit mask for second half of bottom frame MB SB mask |
| 63 |
#define TOP_FD_MASK1_D r1.4 // Bit mask for first half of top field MB SB mask |
| 64 |
#define TOP_FD_MASK1_B r1.16 // Bit mask for first half of top field MB SB mask |
| 65 |
#define TOP_FD_MASK2_D r1.5 // Bit mask for second half of top field MB SB mask |
| 66 |
#define TOP_FD_MASK2_B r1.20 // Bit mask for second half of top field MB SB mask |
| 67 |
#define BOT_FD_MASK1_D r1.6 // Bit mask for first half of bottom field MB SB mask |
| 68 |
#define BOT_FD_MASK1_B r1.24 // Bit mask for first half of bottom field MB SB mask |
| 69 |
#define BOT_FD_MASK2_D r1.7 // Bit mask for second half of bottom field MB SB mask |
| 70 |
#define BOT_FD_MASK2_B r1.28 // Bit mask for second half of bottom field MB SB mask |
| 71 |
|
| 72 |
// For use by setting HW scoreboard kernel for non-MBAFF picture |
| 73 |
#define MB_SHIFT_MASK_W r1.0 // :w type. Shift values for two parts of the MB SB mask |
| 74 |
#define MB_SHIFT_MASK_B r1.0 // :b type. Shift values for two parts of the MB SB mask |
| 75 |
|
| 76 |
// GRF r2 map |
| 77 |
// |
| 78 |
// In-line data |
| 79 |
// |
| 80 |
#define INLINE_REG_OFFSET 1 |
| 81 |
#define INLINE_REG r2 |
| 82 |
|
| 83 |
#define StartingMB INLINE_REG.0 // :uw type. Starting MB number |
| 84 |
#define TotalMB INLINE_REG.1 // :uw type. Total number of MB to be processed |
| 85 |
#define PicWidthMB INLINE_REG.2 // :uw type. Picture width in MB |
| 86 |
|
| 87 |
// GRF r3 map |
| 88 |
// |
| 89 |
// Temporary variables |
| 90 |
// |
| 91 |
#define RemainderMB r3.0 // :uw type. Remainder of MB (<16) to be processed |
| 92 |
|
| 93 |
#define TEMP_FD_X_W r3.2 // :w type. Temporary variable for field MB X origin in MBAFF picture |
| 94 |
#define TEMP_FD_X_B r3.4 // :b type. Temporary variable for field MB X origin in MBAFF picture |
| 95 |
#define TEMP_FD_Y_W r3.3 // :w type. Temporary variable for field MB Y origin in MBAFF picture |
| 96 |
#define TEMP_FD_Y_B r3.6 // :b type. Temporary variable for field MB Y origin in MBAFF picture |
| 97 |
|
| 98 |
#define TEMP_INTRA_FLAG_W r3.4 // :uw type. Temporary intra available flag |
| 99 |
|
| 100 |
#define MB_MASK_D r3.4 // :ud type. Bit masks for MBAFF MB |
| 101 |
#define MB_MASK_B r3.16 // :ub type. Bit masks for MBAFF MB |
| 102 |
|
| 103 |
#define MRF_READ_HEADER_SRC r63 |
| 104 |
|
| 105 |
// MEDIA_OBJECT_EX Command map |
| 106 |
// |
| 107 |
// In DW1 of each MEDIA_OBJECT_EX command (VFE DWORD) |
| 108 |
#define CUR_X 0 // Byte 0 |
| 109 |
#define CUR_Y 0 // Byte 2 |
| 110 |
|
| 111 |
// In DW2 of each MEDIA_OBJECT_EX command |
| 112 |
#define USE_SCOREBOARD BIT21 |
| 113 |
|
| 114 |
// In DW4 of each MEDIA_OBJECT_EX command |
| 115 |
#define F_FLAG BIT4 |
| 116 |
#define IS_INTRA_MB BIT13 |
| 117 |
#define IS_FIELD_MB BIT14 |
| 118 |
#define IS_INTRA8X8 BIT15 |
| 119 |
#define IS_BOT_FD BIT24 |
| 120 |
|
| 121 |
// In DW7 of each MEDIA_OBJECT_EX command |
| 122 |
#define A_FLAG BIT0 |
| 123 |
#define B_FLAG BIT1 |
| 124 |
#define C_FLAG BIT2 |
| 125 |
#define D_FLAG BIT3 |
| 126 |
#define E_FLAG BIT4 |
| 127 |
|
| 128 |
#define CMD_BUFFER_REG_OFF 4 |
| 129 |
.declare CMD_BUFFER_D Base=GRF(4) ElementSize=4 SrcRegion=REGION(8,1) Type=ud // Command buffer (32 GRF) |
| 130 |
.declare CMD_BUFFER_W Base=GRF(4) ElementSize=2 SrcRegion=REGION(16,1) Type=uw // Command buffer (32 GRF) |
| 131 |
.declare CMD_BUFFER_B Base=GRF(4) ElementSize=1 SrcRegion=REGION(16,1) Type=ub // Command buffer (32 GRF) |
| 132 |
|
| 133 |
#define MRF_READ_HEADER m1 |
| 134 |
#define MRF_READ_HEADER0 m1 |
| 135 |
#define MRF_READ_HEADER1 m2 |
| 136 |
#define MRF_READ_HEADER2 m3 |
| 137 |
#define MRF_READ_HEADER3 m4 |
| 138 |
|
| 139 |
#define MRF_INTER_WRITE_HEADER m5 |
| 140 |
#define MRF_INTER_WRITE_DATA0 m6 |
| 141 |
#define MRF_INTER_WRITE_DATA1 m7 |
| 142 |
|
| 143 |
#define MRF_WRITE_HEADER m11 |
| 144 |
#define MRF_INTRA_WRITE_HEADER m11 |
| 145 |
|
| 146 |
#define MRF_CMD_BUF_REG_OFF 12 |
| 147 |
.declare MRF_CMD_BUF_D Base=m12 ElementSize=4 SrcRegion=REGION(8,1) Type=ud // Command buffer stored in MRF |
| 148 |
.declare MRF_CMD_BUF_W Base=m12 ElementSize=2 SrcRegion=REGION(16,1) Type=uw // Command buffer stored in MRF |
| 149 |
.declare MRF_CMD_BUF_B Base=m12 ElementSize=1 SrcRegion=REGION(16,1) Type=ub // Command buffer stored in MRF |
| 150 |
|
| 151 |
#define BI_CMD_BUFFER 0 |
| 152 |
|
| 153 |
#define OWBRMSGDSC_SC 0x02088000 // OWORD Block Read Message Descriptor, reading from sampler cache = A. |
| 154 |
#define OWBWMSGDSC 0x02080000 // OWORD Block Write Message Descriptor |
| 155 |
|
| 156 |
#define OWORD_1 0x000 |
| 157 |
#define OWORD_2 0x200 |
| 158 |
#define OWORD_4 0x300 |
| 159 |
#define OWORD_8 0x400 |
| 160 |
|
| 161 |
// End of SETHWSCOREBOARD_HEADER |
| 162 |
|
| 163 |
#endif // !defined(__SETHWSCOREBOARD_HEADER__) |
| 164 |
|