OSDN Git Service

i965_drv_video: add support for H264 on Clarkdale/Arrandale
[android-x86/hardware-intel-common-libva.git] / i965_drv_video / shaders / h264 / mc / Scoreboard_header.inc
1 /*\r
2  * Common header file for both scoreboard and scoreboard_MBAFF kernels\r
3  * Copyright © <2010>, Intel Corporation.\r
4  *\r
5  * This program is licensed under the terms and conditions of the\r
6  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at\r
7  * http://www.opensource.org/licenses/eclipse-1.0.php.\r
8  *\r
9  */\r
10 #if !defined(__SCOREBOARD_HEADER__)     // Make sure this file is only included once\r
11 #define __SCOREBOARD_HEADER__\r
12 \r
13 // Module name: scoreboard_header.inc\r
14 //\r
15 // Common header file for both scoreboard and scoreboard_MBAFF kernels\r
16 //\r
17 \r
18 #define ONE_MB_WA                                               // Enable WA for 1-MB wide pictures. To disable WA, simply comment out this line.\r
19 \r
20 #define INLINE_REG_OFF  1\r
21 #define INLINE_REG              r1\r
22 #define INLINE_REG1             r2\r
23 \r
24 #define DONEFLAG        0x40            // Bit mask of "completed" thread flag\r
25 \r
26 // GRF r1 map\r
27 //\r
28 #define WIDTHINMB_1     INLINE_REG.0            // :uw type. Picture width in MB - 1\r
29 #define HEIGHTINMB_1    INLINE_REG.1    // :uw type. Picture height in MB - 1\r
30 #define TotalMB         INLINE_REG.2            // :uw type. Total number of macroblocks\r
31 #define WFLen_B         INLINE_REG.3            // :uw type. Bottom MB Wavefront length (Reserved for MBAFF scoreboard)\r
32 #define WFLen           INLINE_REG.4            // :uw type. Wavefront length (used as loop counter)\r
33 #define WFLenY          INLINE_REG.5            // :uw type. Wavefront length (vertical component)\r
34 #define StartX          INLINE_REG.6            // :uw type. Start X of current wavefront\r
35 #define StartY          INLINE_REG.7            // :uw type. Start Y of current wavefront\r
36 #define StartXD         INLINE_REG.3            // :ud type. Start (X,Y) of current wavefront\r
37 #define CASE00PTR       INLINE_REG.4            // :ud type. Pointer to "inter start" handler\r
38 #define WFLen_Save      INLINE_REG.10           // :uw type. Saved Wavefront length (Reserved for MBAFF scoreboard)\r
39 #define CASE10PTR       INLINE_REG.6            // :ud type. Pointer to "intra start" handler\r
40 #define CASE11PTR       INLINE_REG.7            // :ud type. Pointer to "inter complete" handler\r
41 \r
42 // GRF r2 map\r
43 //\r
44 .declare    WFStart     Base=GRF(2) ElementSize=2 SrcRegion=REGION(4,1) Type=w  // Start MB of recent 4 wavefronts, actually use 5 WORDs\r
45 .declare    WFStart_T   Base=GRF(2) ElementSize=2 SrcRegion=REGION(4,1) Type=w          // Start MB of recent 4 wavefronts\r
46 .declare    WFStart_B   Base=GRF(2).4 ElementSize=2 SrcRegion=REGION(4,1) Type=w        // Start MB of recent 4 wavefronts\r
47 \r
48 #define NewWFOffsetD    INLINE_REG1.5   // :d type. Offsets used for new wavefront = 0x01ffff00 (0, -1, -1, 1)\r
49 #define NewWFOffset     INLINE_REG1.20          // :b type. Offsets used for new wavefront = 0x01ffff00 (0, -1, -1, 1)\r
50 \r
51 #define AVAILFLAGD      INLINE_REG1.6           // :ud type. Neighbor available flags = 0x08020401 (in ACBD order)\r
52 #define AVAILFLAG       INLINE_REG1.24          // :ub type. Neighbor available flags as above\r
53 #define AVAILFLAG1D     INLINE_REG1.7           // :ud type. Top-half neighbor available flags = 0x80402010 (in A_Bxxx order)\r
54 \r
55 .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_)\r
56 #define AR_SAVE         r3.8    // :uw type. Saved Address Register information\r
57 \r
58 #define CMDPTR          a0.0    // :uw type. DWORD Pointer to the scoreboard\r
59 #define DEPPTR          a0.0    // :uw type. Pointer to the dependency scoreboard - Current MB\r
60 #define DEPPTRL         a0.1    // :uw type. Pointer to the dependency scoreboard - Left MB\r
61 #define DEPPTRTR        a0.2    // :uw type. Pointer to the dependency scoreboard - Top right MB\r
62 #define DEPPTRT         a0.3    // :uw type. Pointer to the dependency scoreboard - Top MB\r
63 #define DEPPTRTL    a0.4    // :uw type. Pointer to the dependency scoreboard - Top left MB\r
64 #define DEPPTRLB        a0.5    // :uw type. Pointer to the dependency scoreboard - Left bottom-half MB\r
65 \r
66 #define PMSGSEL         a0.7    // :uw type. Pointer to current message in message handling table\r
67 \r
68 #define CMD_SB_REG_OFF          4\r
69 .declare    CMD_SB              Base=GRF(4) ElementSize=4 SrcRegion=REGION(8,1) Type=ud // Command scoreboard (64 GRF)\r
70 \r
71 #ifdef  AS_ENABLED\r
72 //      Definitions for Advanced Scheduler support\r
73 #define AS_INT          BIT23   // "Preemption Exception Status" bit in cr0.1:ud control register\r
74 #define AS_INT_EN       BIT10   // "Preemption Exception Enable" bit in cr0.1:ud control register\r
75 #define TH_INT          BIT2    // "Thread Interrupted" bit in message descriptor\r
76 #define TH_RES          BIT0    // "Thread Restart Enable" bit in R0 header r0.2\r
77 \r
78 #define AS_SAVE         34              // Surface state for saving scoreboard contents\r
79                                                         // Ensure not to conflict with existing binding table entries\r
80 #endif  // End AS_ENABLED\r
81 \r
82 // End of scoreboard_header\r
83 \r
84 #endif  // !defined(__SCOREBOARD_HEADER__)\r
85 \r