Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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