Debian Codegraph @

src/shaders/h264/mc/Scoreboard_header.inc

raw
1 /*
2 * Common header file for both scoreboard and scoreboard_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(__SCOREBOARD_HEADER__) // Make sure this file is only included once
41 #define __SCOREBOARD_HEADER__
42
43 // Module name: scoreboard_header.inc
44 //
45 // Common header file for both scoreboard and scoreboard_MBAFF kernels
46 //
47
48 #define ONE_MB_WA // Enable WA for 1-MB wide pictures. To disable WA, simply comment out this line.
49
50 #define INLINE_REG_OFF 1
51 #define INLINE_REG r1
52 #define INLINE_REG1 r2
53
54 #define DONEFLAG 0x40 // Bit mask of "completed" thread flag
55
56 // GRF r1 map
57 //
58 #define WIDTHINMB_1 INLINE_REG.0 // :uw type. Picture width in MB - 1
59 #define HEIGHTINMB_1 INLINE_REG.1 // :uw type. Picture height in MB - 1
60 #define TotalMB INLINE_REG.2 // :uw type. Total number of macroblocks
61 #define WFLen_B INLINE_REG.3 // :uw type. Bottom MB Wavefront length (Reserved for MBAFF scoreboard)
62 #define WFLen INLINE_REG.4 // :uw type. Wavefront length (used as loop counter)
63 #define WFLenY INLINE_REG.5 // :uw type. Wavefront length (vertical component)
64 #define StartX INLINE_REG.6 // :uw type. Start X of current wavefront
65 #define StartY INLINE_REG.7 // :uw type. Start Y of current wavefront
66 #define StartXD INLINE_REG.3 // :ud type. Start (X,Y) of current wavefront
67 #define CASE00PTR INLINE_REG.4 // :ud type. Pointer to "inter start" handler
68 #define WFLen_Save INLINE_REG.10 // :uw type. Saved Wavefront length (Reserved for MBAFF scoreboard)
69 #define CASE10PTR INLINE_REG.6 // :ud type. Pointer to "intra start" handler
70 #define CASE11PTR INLINE_REG.7 // :ud type. Pointer to "inter complete" handler
71
72 // GRF r2 map
73 //
74 .declare WFStart Base=GRF(2) ElementSize=2 SrcRegion=REGION(4,1) Type=w // Start MB of recent 4 wavefronts, actually use 5 WORDs
75 .declare WFStart_T Base=GRF(2) ElementSize=2 SrcRegion=REGION(4,1) Type=w // Start MB of recent 4 wavefronts
76 .declare WFStart_B Base=GRF(2).4 ElementSize=2 SrcRegion=REGION(4,1) Type=w // Start MB of recent 4 wavefronts
77
78 #define NewWFOffsetD INLINE_REG1.5 // :d type. Offsets used for new wavefront = 0x01ffff00 (0, -1, -1, 1)
79 #define NewWFOffset INLINE_REG1.20 // :b type. Offsets used for new wavefront = 0x01ffff00 (0, -1, -1, 1)
80
81 #define AVAILFLAGD INLINE_REG1.6 // :ud type. Neighbor available flags = 0x08020401 (in ACBD order)
82 #define AVAILFLAG INLINE_REG1.24 // :ub type. Neighbor available flags as above
83 #define AVAILFLAG1D INLINE_REG1.7 // :ud type. Top-half neighbor available flags = 0x80402010 (in A_Bxxx order)
84
85 .declare MBINDEX Base=GRF(3) ElementSize=2 SrcRegion=REGION(16,1) Type=w // MB order # of current MB group (Cur, ACBD and AC_B_D_)
86 #define AR_SAVE r3.8 // :uw type. Saved Address Register information
87
88 #define CMDPTR a0.0 // :uw type. DWORD Pointer to the scoreboard
89 #define DEPPTR a0.0 // :uw type. Pointer to the dependency scoreboard - Current MB
90 #define DEPPTRL a0.1 // :uw type. Pointer to the dependency scoreboard - Left MB
91 #define DEPPTRTR a0.2 // :uw type. Pointer to the dependency scoreboard - Top right MB
92 #define DEPPTRT a0.3 // :uw type. Pointer to the dependency scoreboard - Top MB
93 #define DEPPTRTL a0.4 // :uw type. Pointer to the dependency scoreboard - Top left MB
94 #define DEPPTRLB a0.5 // :uw type. Pointer to the dependency scoreboard - Left bottom-half MB
95
96 #define PMSGSEL a0.7 // :uw type. Pointer to current message in message handling table
97
98 #define CMD_SB_REG_OFF 4
99 .declare CMD_SB Base=GRF(4) ElementSize=4 SrcRegion=REGION(8,1) Type=ud // Command scoreboard (64 GRF)
100
101 #ifdef AS_ENABLED
102 // Definitions for Advanced Scheduler support
103 #define AS_INT BIT23 // "Preemption Exception Status" bit in cr0.1:ud control register
104 #define AS_INT_EN BIT10 // "Preemption Exception Enable" bit in cr0.1:ud control register
105 #define TH_INT BIT2 // "Thread Interrupted" bit in message descriptor
106 #define TH_RES BIT0 // "Thread Restart Enable" bit in R0 header r0.2
107
108 #define AS_SAVE 34 // Surface state for saving scoreboard contents
109 // Ensure not to conflict with existing binding table entries
110 #endif // End AS_ENABLED
111
112 // End of scoreboard_header
113
114 #endif // !defined(__SCOREBOARD_HEADER__)
115