| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2010-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bgrc_packet_priv.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/173 $ |
|---|
| 12 | * $brcm_Date: 4/5/12 4:35p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: GRC Packet Private API |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/grc/7405/bgrc_packet_priv.c $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/173 4/5/12 4:35p nissen |
|---|
| 21 | * SW7425-1413: Added fix to make sure last output stripe is less pixels |
|---|
| 22 | * than the others. |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/172 3/16/12 4:09p nissen |
|---|
| 25 | * SW7425-2480: Added rop reset to sync blit. |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/171 3/9/12 5:39p nissen |
|---|
| 28 | * SW7038-3520: Temporarily removing veritcal phase fix when the |
|---|
| 29 | * horizontal fixed scale factor is 0 for 7038. |
|---|
| 30 | * |
|---|
| 31 | * Hydra_Software_Devel/170 3/7/12 5:51p nissen |
|---|
| 32 | * SW7038-3520: Added another condition to prevent possible divide by |
|---|
| 33 | * zero. |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/169 3/7/12 12:35p nissen |
|---|
| 36 | * SW7038-3520: Fixed condition to prevent output stripe width from |
|---|
| 37 | * becoming zero. |
|---|
| 38 | * |
|---|
| 39 | * Hydra_Software_Devel/168 3/2/12 12:42p nissen |
|---|
| 40 | * SW7435-13 : Added fix to 7435 A0 for null src and dst feeders. |
|---|
| 41 | * |
|---|
| 42 | * Hydra_Software_Devel/167 3/1/12 3:31p nissen |
|---|
| 43 | * SW7420-2097: Removed vertical initial phase fix for greater than 4x |
|---|
| 44 | * down scales. |
|---|
| 45 | * |
|---|
| 46 | * Hydra_Software_Devel/166 2/17/12 1:30p nissen |
|---|
| 47 | * SW7425-1413: Fixing problem with last output stripe size for M2MCs with |
|---|
| 48 | * split fifo. |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/165 2/15/12 8:15p nissen |
|---|
| 51 | * SW7038-3520: Fixed condition for ver phase fix. |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/164 2/15/12 1:15p nissen |
|---|
| 54 | * SW7038-3520: Added veritcal phase fix when the horizontal fixed scale |
|---|
| 55 | * factor is 0 for 7038. |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/163 2/10/12 3:47p nissen |
|---|
| 58 | * SW7420-1150: Fixed build error. |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/162 2/10/12 1:37p nissen |
|---|
| 61 | * SW7420-1150: Fixed look up bit for palette bilts. |
|---|
| 62 | * |
|---|
| 63 | * Hydra_Software_Devel/161 2/9/12 2:37p nissen |
|---|
| 64 | * SW7038-3520: Added more conditions to prevent mod with zero. |
|---|
| 65 | * |
|---|
| 66 | * Hydra_Software_Devel/160 1/9/12 5:19p nissen |
|---|
| 67 | * SW7425-1207: Fixed UpdateScale packet. |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/159 1/6/12 1:40p nissen |
|---|
| 70 | * SW7435-13 : Fixed support for 7435 A0. |
|---|
| 71 | * |
|---|
| 72 | * Hydra_Software_Devel/158 1/5/12 1:54p nissen |
|---|
| 73 | * SW7038-3520: Fixed build warning. |
|---|
| 74 | * |
|---|
| 75 | * Hydra_Software_Devel/157 1/5/12 11:51a nissen |
|---|
| 76 | * SW7038-3520: Fixed condition to prevent mod with zero when fixed scale |
|---|
| 77 | * is zero. |
|---|
| 78 | * |
|---|
| 79 | * Hydra_Software_Devel/156 1/3/12 4:37p nissen |
|---|
| 80 | * SW7425-1921: Changed support for dest colorkeying. |
|---|
| 81 | * |
|---|
| 82 | * Hydra_Software_Devel/155 12/21/11 5:15p nissen |
|---|
| 83 | * SW7360-5: Added support for the 7360 A0. |
|---|
| 84 | * |
|---|
| 85 | * Hydra_Software_Devel/154 12/21/11 1:42p nissen |
|---|
| 86 | * SW7425-1915: Added code to prevent down scale from exceeding the max. |
|---|
| 87 | * |
|---|
| 88 | * Hydra_Software_Devel/153 12/20/11 5:35p nissen |
|---|
| 89 | * SW7231-540: Fixed sync and scaling problems with mirroring. |
|---|
| 90 | * |
|---|
| 91 | * Hydra_Software_Devel/152 12/20/11 3:18p nissen |
|---|
| 92 | * SW7435-13: Fixed build error. |
|---|
| 93 | * |
|---|
| 94 | * Hydra_Software_Devel/151 12/20/11 12:37p nissen |
|---|
| 95 | * SW7435-13: Fixing another build error |
|---|
| 96 | * |
|---|
| 97 | * Hydra_Software_Devel/150 12/19/11 7:21p nissen |
|---|
| 98 | * SW7435-13: Fixing build error |
|---|
| 99 | * |
|---|
| 100 | * Hydra_Software_Devel/149 12/19/11 5:17p nissen |
|---|
| 101 | * SW7435-13: Fixing build error |
|---|
| 102 | * |
|---|
| 103 | * Hydra_Software_Devel/148 12/19/11 4:47p nissen |
|---|
| 104 | * SW7038-3520: Added condition to prevent mod with zero when fixed scale |
|---|
| 105 | * is zero. |
|---|
| 106 | * |
|---|
| 107 | * Hydra_Software_Devel/147 12/19/11 4:34p nissen |
|---|
| 108 | * SW7435-13 : Fixing build |
|---|
| 109 | * |
|---|
| 110 | * Hydra_Software_Devel/146 12/16/11 6:48p nissen |
|---|
| 111 | * SW7038-3520: Added flag to force fixed scale factor of 0. |
|---|
| 112 | * |
|---|
| 113 | * Hydra_Software_Devel/145 12/15/11 6:58p nissen |
|---|
| 114 | * SW7435-13 : Added support for 7435 A0. |
|---|
| 115 | * |
|---|
| 116 | * Hydra_Software_Devel/144 12/13/11 3:41p nissen |
|---|
| 117 | * SW7231-535: Fixed surface rectangle verification after sync blit. |
|---|
| 118 | * |
|---|
| 119 | * Hydra_Software_Devel/143 12/9/11 7:38p nissen |
|---|
| 120 | * SW7425-1207: Fixed phase with UpdateScalePacket. |
|---|
| 121 | * |
|---|
| 122 | * Hydra_Software_Devel/142 12/8/11 5:11p nissen |
|---|
| 123 | * SW7038-3520: Added fix so that a scaler step of 0 can be used when the |
|---|
| 124 | * source size is equal to 1. |
|---|
| 125 | * |
|---|
| 126 | * Hydra_Software_Devel/141 12/1/11 5:10p nissen |
|---|
| 127 | * SW7429-4: Added SourceNone fix for 7429. |
|---|
| 128 | * |
|---|
| 129 | * Hydra_Software_Devel/140 11/30/11 4:29p nissen |
|---|
| 130 | * SW7425-1830: Fixed warning in non debug build. |
|---|
| 131 | * |
|---|
| 132 | * Hydra_Software_Devel/139 11/25/11 5:21p nissen |
|---|
| 133 | * SW7231-477 : Fixed minimum vertical initial phase for sources that are |
|---|
| 134 | * 4096 pixels or greater. |
|---|
| 135 | * |
|---|
| 136 | * Hydra_Software_Devel/138 11/23/11 5:49p nissen |
|---|
| 137 | * SW7425-1830: Fixed rectangle verification. |
|---|
| 138 | * |
|---|
| 139 | * Hydra_Software_Devel/137 11/22/11 5:40p nissen |
|---|
| 140 | * SW7425-1830: Added code to verify rectangle sizes don't exceed the max |
|---|
| 141 | * of 8191. |
|---|
| 142 | * |
|---|
| 143 | * Hydra_Software_Devel/136 11/10/11 6:03p nissen |
|---|
| 144 | * SW7425-1413: Disabled split fifo for 7425 B0. |
|---|
| 145 | * |
|---|
| 146 | * Hydra_Software_Devel/135 11/10/11 2:05p nissen |
|---|
| 147 | * SW7405-5534: Added code to verify down scale factor. |
|---|
| 148 | * |
|---|
| 149 | * Hydra_Software_Devel/134 11/8/11 11:35a nissen |
|---|
| 150 | * SW7425-1413: Fixed build error. |
|---|
| 151 | * |
|---|
| 152 | * Hydra_Software_Devel/133 11/7/11 8:09p nissen |
|---|
| 153 | * SW7425-1413: Fixed build errors. |
|---|
| 154 | * |
|---|
| 155 | * Hydra_Software_Devel/132 11/7/11 6:45p nissen |
|---|
| 156 | * SW7425-1413: Fixed problem with last output stripe size for 7425 B0. |
|---|
| 157 | * |
|---|
| 158 | * Hydra_Software_Devel/131 11/3/11 4:42p nissen |
|---|
| 159 | * SWBLURAY-27238: Added support for 2nd M2MC for 7640 B0. |
|---|
| 160 | * |
|---|
| 161 | * Hydra_Software_Devel/130 10/24/11 6:57p nissen |
|---|
| 162 | * SW7420-2097: Adjusted minimum vertical initial phase for greater than |
|---|
| 163 | * 4x down scales. |
|---|
| 164 | * |
|---|
| 165 | * Hydra_Software_Devel/129 10/21/11 5:25p nissen |
|---|
| 166 | * SW7038-3518: Removed odd source x 422 pixel fix for the 7038. |
|---|
| 167 | * |
|---|
| 168 | * Hydra_Software_Devel/128 10/21/11 5:09p nissen |
|---|
| 169 | * SW7420-2097: Setting a minimum vertical initial phase when vertically |
|---|
| 170 | * down scaling more than 4x to prevent a hang. |
|---|
| 171 | * |
|---|
| 172 | * Hydra_Software_Devel/127 10/18/11 4:36p nissen |
|---|
| 173 | * SW7038-3518: Added condition to fix odd source x when source format is |
|---|
| 174 | * 422. |
|---|
| 175 | * |
|---|
| 176 | * Hydra_Software_Devel/126 10/12/11 2:25p nissen |
|---|
| 177 | * SW7425-1413: Disabled the split fifo for the 7425 B0. |
|---|
| 178 | * |
|---|
| 179 | * Hydra_Software_Devel/125 10/6/11 12:08p nissen |
|---|
| 180 | * SW7420-2082: Added debug prints for FixedScale |
|---|
| 181 | * |
|---|
| 182 | * Hydra_Software_Devel/124 10/5/11 1:01p nissen |
|---|
| 183 | * SW7405-3671: Fixed width adjustment for odd x value. |
|---|
| 184 | * |
|---|
| 185 | * Hydra_Software_Devel/123 10/3/11 6:43p nissen |
|---|
| 186 | * SW7405-3671: Fixed odd x value for single stripes. |
|---|
| 187 | * |
|---|
| 188 | * Hydra_Software_Devel/122 10/3/11 12:05p nissen |
|---|
| 189 | * SW7420-2079: Fixed problem with writing non-blit packets. |
|---|
| 190 | * |
|---|
| 191 | * Hydra_Software_Devel/121 9/30/11 9:43p nissen |
|---|
| 192 | * SW7405-3671: Fixed first stripe when it's x value is odd for 422 |
|---|
| 193 | * formats. |
|---|
| 194 | * |
|---|
| 195 | * Hydra_Software_Devel/120 9/29/11 6:13p nissen |
|---|
| 196 | * SW7405-3671: Fixed scale order for SW striped scales. |
|---|
| 197 | * |
|---|
| 198 | * Hydra_Software_Devel/119 9/29/11 12:21p nissen |
|---|
| 199 | * SW7401-4480: Changed 7400 to use SW assisted 420 destriping. |
|---|
| 200 | * |
|---|
| 201 | * Hydra_Software_Devel/118 9/24/11 1:34p nissen |
|---|
| 202 | * SW7405-3671: Fixed scale order when 420 destriping. |
|---|
| 203 | * |
|---|
| 204 | * Hydra_Software_Devel/117 9/16/11 1:04p nissen |
|---|
| 205 | * SW7425-1207: Added support for UpdateScaleBlit packet. |
|---|
| 206 | * |
|---|
| 207 | * Hydra_Software_Devel/116 9/13/11 4:35p nissen |
|---|
| 208 | * SW7420-1575: Fixed surface rectangle verification, and added support |
|---|
| 209 | * for surface format verification. |
|---|
| 210 | * |
|---|
| 211 | * Hydra_Software_Devel/115 9/13/11 3:35p nissen |
|---|
| 212 | * SW7038-3512: Removed print statements. |
|---|
| 213 | * |
|---|
| 214 | * Hydra_Software_Devel/114 9/13/11 1:24p nissen |
|---|
| 215 | * SW7038-3512: Fixed bilinear filter table for 7038. |
|---|
| 216 | * |
|---|
| 217 | * Hydra_Software_Devel/113 9/9/11 12:49p nissen |
|---|
| 218 | * SW7038-3513: Reduced padding between stripes by one pixel for the 7038. |
|---|
| 219 | * |
|---|
| 220 | * Hydra_Software_Devel/112 9/7/11 5:01p nissen |
|---|
| 221 | * SW7405-3671: Changed 420 fixed scale destriping. |
|---|
| 222 | * |
|---|
| 223 | * Hydra_Software_Devel/111 9/7/11 2:38p nissen |
|---|
| 224 | * SW7405-3671: Added another fix for chroma width when destriping 420. |
|---|
| 225 | * |
|---|
| 226 | * Hydra_Software_Devel/110 9/6/11 8:59p nissen |
|---|
| 227 | * SW7038-3513: Fixed problem with forced striping 422 formats. |
|---|
| 228 | * |
|---|
| 229 | * Hydra_Software_Devel/109 9/5/11 5:28p nissen |
|---|
| 230 | * SW7405-3671: Added fix for chroma width when destriping 420. |
|---|
| 231 | * |
|---|
| 232 | * Hydra_Software_Devel/108 8/30/11 2:30p nissen |
|---|
| 233 | * SW7401-4509: Fixed setting scaling order when using fixed scaling. |
|---|
| 234 | * |
|---|
| 235 | * Hydra_Software_Devel/107 8/8/11 12:44p nissen |
|---|
| 236 | * SW7405-3671: Added initial support for fixed scaling with 420 |
|---|
| 237 | * destriping on the 7401. |
|---|
| 238 | * |
|---|
| 239 | * Hydra_Software_Devel/106 7/28/11 4:12p nissen |
|---|
| 240 | * SW7405-3671: Another further fix for final 420 stripe. |
|---|
| 241 | * |
|---|
| 242 | * Hydra_Software_Devel/105 7/28/11 3:33p nissen |
|---|
| 243 | * SW7405-3671: Further fix for final 420 stripe. |
|---|
| 244 | * |
|---|
| 245 | * Hydra_Software_Devel/104 7/27/11 5:47p nissen |
|---|
| 246 | * SW7405-3671: Added support for fixed scaling with 420 destriping. |
|---|
| 247 | * |
|---|
| 248 | * Hydra_Software_Devel/103 7/21/11 2:18p nissen |
|---|
| 249 | * SW7405-3671: Fixed problem with final 420 stripe. |
|---|
| 250 | * |
|---|
| 251 | * Hydra_Software_Devel/102 7/20/11 3:36p nissen |
|---|
| 252 | * SW7405-3671: Fixed problem with final 420 stripe being less than 2 |
|---|
| 253 | * pixels. |
|---|
| 254 | * |
|---|
| 255 | * Hydra_Software_Devel/101 7/14/11 3:15p nissen |
|---|
| 256 | * SW7420-1974: Writing dest addr and format registers in DestinationColor |
|---|
| 257 | * packet to prevent hang. |
|---|
| 258 | * |
|---|
| 259 | * Hydra_Software_Devel/100 6/29/11 3:02p nissen |
|---|
| 260 | * SW7405-3671: Removed default initial phase adjustment when using fixed |
|---|
| 261 | * scaling. |
|---|
| 262 | * |
|---|
| 263 | * Hydra_Software_Devel/99 6/28/11 2:29p nissen |
|---|
| 264 | * SW7420-1893: Changed Sync so that it continues to try it's blit instead |
|---|
| 265 | * of reporting out of memory. |
|---|
| 266 | * |
|---|
| 267 | * Hydra_Software_Devel/98 6/28/11 11:58a nissen |
|---|
| 268 | * SW7405-3671: Fixed hang when using odd x position for 422 sources. |
|---|
| 269 | * |
|---|
| 270 | * Hydra_Software_Devel/97 6/23/11 10:23a nissen |
|---|
| 271 | * SW7420-1893: Prevented sync blit frin over writting packet memory. |
|---|
| 272 | * |
|---|
| 273 | * Hydra_Software_Devel/96 6/9/11 6:19p nissen |
|---|
| 274 | * SW7405-3671: Fixed forced striping while scaling. |
|---|
| 275 | * |
|---|
| 276 | * Hydra_Software_Devel/95 6/7/11 1:15p nissen |
|---|
| 277 | * SW7405-3671: Added code to store group header when running out of |
|---|
| 278 | * memory. |
|---|
| 279 | * |
|---|
| 280 | * Hydra_Software_Devel/94 5/27/11 12:35p nissen |
|---|
| 281 | * SW7405-3671: Fixed problem with rectangle registers after doing a |
|---|
| 282 | * striped scale blit. |
|---|
| 283 | * |
|---|
| 284 | * Hydra_Software_Devel/93 5/26/11 6:14p nissen |
|---|
| 285 | * SW7335-916: Fixed linear destripe for SourceControl packet. |
|---|
| 286 | * |
|---|
| 287 | * Hydra_Software_Devel/92 5/20/11 7:09p nissen |
|---|
| 288 | * SW7335-1213: Fixing sync blit. |
|---|
| 289 | * |
|---|
| 290 | * Hydra_Software_Devel/91 5/20/11 5:13p nissen |
|---|
| 291 | * SW7335-1213: Fixing sync blit. |
|---|
| 292 | * |
|---|
| 293 | * Hydra_Software_Devel/90 5/19/11 5:09p nissen |
|---|
| 294 | * SW7038-3509: Fixed setting filter table for 7038. |
|---|
| 295 | * |
|---|
| 296 | * Hydra_Software_Devel/89 5/11/11 1:22p nissen |
|---|
| 297 | * SW7401-4501: Added L8 pixel format. |
|---|
| 298 | * |
|---|
| 299 | * Hydra_Software_Devel/88 5/6/11 1:05p nissen |
|---|
| 300 | * SW7038-3500: Fixed color matrix add shift. |
|---|
| 301 | * |
|---|
| 302 | * Hydra_Software_Devel/87 5/6/11 11:55a nissen |
|---|
| 303 | * SW7425-19: Fixing SourceNone for new cores. |
|---|
| 304 | * |
|---|
| 305 | * Hydra_Software_Devel/86 5/2/11 4:55p nissen |
|---|
| 306 | * SW7425-19: Fixing SourceNone for 7552 |
|---|
| 307 | * |
|---|
| 308 | * Hydra_Software_Devel/85 5/2/11 4:23p nissen |
|---|
| 309 | * SW7425-19: Fixed build error. |
|---|
| 310 | * |
|---|
| 311 | * Hydra_Software_Devel/84 5/2/11 2:38p nissen |
|---|
| 312 | * SW7425-19: Fixing SourceNone for 7358. |
|---|
| 313 | * |
|---|
| 314 | * Hydra_Software_Devel/83 5/1/11 4:38p nissen |
|---|
| 315 | * SW7038-3500: Fixed filter tables. |
|---|
| 316 | * |
|---|
| 317 | * Hydra_Software_Devel/82 4/27/11 2:27p nissen |
|---|
| 318 | * SW7425-19: Using SourceNone fix for 7358. |
|---|
| 319 | * |
|---|
| 320 | * Hydra_Software_Devel/81 4/25/11 5:08p nissen |
|---|
| 321 | * SW7630-104: Added more support for Cb8 and Cr8 formats. |
|---|
| 322 | * |
|---|
| 323 | * Hydra_Software_Devel/80 4/25/11 3:54p nissen |
|---|
| 324 | * SW7630-104: Added support for A8_Y8, Cb8 and Cr8 formats. |
|---|
| 325 | * |
|---|
| 326 | * Hydra_Software_Devel/79 3/18/11 7:41p nissen |
|---|
| 327 | * SW7038-3500: Fixing header size. |
|---|
| 328 | * |
|---|
| 329 | * Hydra_Software_Devel/78 3/18/11 1:26p nissen |
|---|
| 330 | * SW7420-1575: Added new width and height fields for surface planes. |
|---|
| 331 | * |
|---|
| 332 | * Hydra_Software_Devel/77 3/17/11 4:47p nissen |
|---|
| 333 | * SW7405-3671: Fixed new luma pixel formats. |
|---|
| 334 | * |
|---|
| 335 | * Hydra_Software_Devel/76 3/17/11 4:39p nissen |
|---|
| 336 | * SW7344-32: Fixed changes to reset state. |
|---|
| 337 | * |
|---|
| 338 | * Hydra_Software_Devel/75 3/16/11 5:20p nissen |
|---|
| 339 | * SW7344-32: Fixed reset state to use default output feeder and |
|---|
| 340 | * rectangle. |
|---|
| 341 | * |
|---|
| 342 | * Hydra_Software_Devel/74 3/15/11 3:33p nissen |
|---|
| 343 | * SW7405-5183: Fixed SourceColor packet. |
|---|
| 344 | * |
|---|
| 345 | * Hydra_Software_Devel/73 3/10/11 4:44p nissen |
|---|
| 346 | * SW7420-1575: Fixed surface rectangle verification. |
|---|
| 347 | * |
|---|
| 348 | * Hydra_Software_Devel/72 3/8/11 1:21p nissen |
|---|
| 349 | * SW7422-256: Switched to SW strip setup when vertical scale down max |
|---|
| 350 | * exceeded. |
|---|
| 351 | * |
|---|
| 352 | * Hydra_Software_Devel/71 3/7/11 3:51p nissen |
|---|
| 353 | * SW7420-1575: Added support for surface rectangle verification. |
|---|
| 354 | * |
|---|
| 355 | * Hydra_Software_Devel/70 3/7/11 2:07p nissen |
|---|
| 356 | * SW7038-3500: Switched header size back. |
|---|
| 357 | * |
|---|
| 358 | * Hydra_Software_Devel/69 3/5/11 4:55p nissen |
|---|
| 359 | * SW7038-3500: Changed header size to fit filter table. |
|---|
| 360 | * |
|---|
| 361 | * Hydra_Software_Devel/68 3/5/11 4:21p nissen |
|---|
| 362 | * SW7401-4480: Set 7401 so that SW sets up destripe blits. |
|---|
| 363 | * |
|---|
| 364 | * Hydra_Software_Devel/67 3/4/11 5:18p nissen |
|---|
| 365 | * SW7422-256: Fixed surface scaling for large surfaces. |
|---|
| 366 | * |
|---|
| 367 | * Hydra_Software_Devel/66 3/4/11 1:43p nissen |
|---|
| 368 | * SW7038-3500: Fixed header size. |
|---|
| 369 | * |
|---|
| 370 | * Hydra_Software_Devel/65 3/3/11 6:15p nissen |
|---|
| 371 | * SW7401-4480: Forcing even destripe source rectangle values. |
|---|
| 372 | * |
|---|
| 373 | * Hydra_Software_Devel/64 3/3/11 4:51p nissen |
|---|
| 374 | * SW7038-3500: Fixed build error for 7038. |
|---|
| 375 | * |
|---|
| 376 | * Hydra_Software_Devel/63 3/3/11 3:01p nissen |
|---|
| 377 | * SW7038-3500: Fixed more build errors. |
|---|
| 378 | * |
|---|
| 379 | * Hydra_Software_Devel/62 3/2/11 7:47p nissen |
|---|
| 380 | * SW7038-3500: Fixed more build errors. |
|---|
| 381 | * |
|---|
| 382 | * Hydra_Software_Devel/61 3/2/11 7:12p nissen |
|---|
| 383 | * SW7038-3500: Fixed build errors on 7038. |
|---|
| 384 | * |
|---|
| 385 | * Hydra_Software_Devel/60 3/2/11 5:01p nissen |
|---|
| 386 | * SW7405-3671: Added new luma pixel formats. |
|---|
| 387 | * |
|---|
| 388 | * Hydra_Software_Devel/59 2/27/11 1:38p nissen |
|---|
| 389 | * SW7422-287: Fixed memory read violation at address 0 when doing a fill. |
|---|
| 390 | * |
|---|
| 391 | * Hydra_Software_Devel/58 2/25/11 4:56p nissen |
|---|
| 392 | * SW7038-3500: Added initial support for 7038. |
|---|
| 393 | * |
|---|
| 394 | * Hydra_Software_Devel/57 12/15/10 1:18p nissen |
|---|
| 395 | * SW7425-19: Fixed problem with SourceNone packet. |
|---|
| 396 | * |
|---|
| 397 | * Hydra_Software_Devel/56 12/10/10 1:18p nissen |
|---|
| 398 | * SW7425-19: Changed format to 1-bit when using SourceColor or SourceNone |
|---|
| 399 | * packets. |
|---|
| 400 | * |
|---|
| 401 | * Hydra_Software_Devel/55 12/10/10 12:35p nissen |
|---|
| 402 | * SW7425-19: Changed format to 4-bit when using SourceColor or SourceNone |
|---|
| 403 | * packets. |
|---|
| 404 | * |
|---|
| 405 | * Hydra_Software_Devel/54 12/9/10 3:32p nissen |
|---|
| 406 | * SW7425-19: Enabling source feeder in SourceNone packet to prevent hang |
|---|
| 407 | * on 7422. |
|---|
| 408 | * |
|---|
| 409 | * Hydra_Software_Devel/53 12/6/10 12:29p nissen |
|---|
| 410 | * SW7420-1138: Added support for validating memory bounds used by blits. |
|---|
| 411 | * |
|---|
| 412 | * Hydra_Software_Devel/52 12/3/10 1:15a nissen |
|---|
| 413 | * SW7420-1150: Fixed bug in palette blits. |
|---|
| 414 | * |
|---|
| 415 | * Hydra_Software_Devel/51 11/30/10 3:38p nissen |
|---|
| 416 | * SW7335-916: Fixed macro warnings. |
|---|
| 417 | * |
|---|
| 418 | * Hydra_Software_Devel/50 11/30/10 3:05p nissen |
|---|
| 419 | * SW7420-1236: Fixed source and destination colorkey. |
|---|
| 420 | * |
|---|
| 421 | * Hydra_Software_Devel/49 11/30/10 2:21p nissen |
|---|
| 422 | * SW7420-1236: Fixed destination colorkey. |
|---|
| 423 | * |
|---|
| 424 | * Hydra_Software_Devel/48 11/25/10 2:36p nissen |
|---|
| 425 | * SW7335-916: Added more debug print parameters to FixedScale packet. |
|---|
| 426 | * |
|---|
| 427 | * Hydra_Software_Devel/47 11/25/10 1:15p nissen |
|---|
| 428 | * SW7420-1150: Added fix for palette blits. |
|---|
| 429 | * |
|---|
| 430 | * Hydra_Software_Devel/46 11/24/10 5:59p nissen |
|---|
| 431 | * SW7425-19: Enabled source feeder and set format for SourceNone packet |
|---|
| 432 | * to prevent hangs on 7422. |
|---|
| 433 | * |
|---|
| 434 | * Hydra_Software_Devel/44 11/22/10 12:51p nissen |
|---|
| 435 | * SW7425-19: Disabled feeders for none packets. |
|---|
| 436 | * |
|---|
| 437 | * Hydra_Software_Devel/43 11/18/10 7:52p nissen |
|---|
| 438 | * SW7425-19: Fixed None packets. |
|---|
| 439 | * |
|---|
| 440 | * Hydra_Software_Devel/42 11/18/10 5:56p nissen |
|---|
| 441 | * SW7425-19: Fixed destination format registers for null dest on the |
|---|
| 442 | * 7422. |
|---|
| 443 | * |
|---|
| 444 | * Hydra_Software_Devel/41 11/18/10 5:45p nissen |
|---|
| 445 | * SW7425-19: Fixed source format registers for null source on the 7422. |
|---|
| 446 | * |
|---|
| 447 | * Hydra_Software_Devel/40 11/16/10 2:38p nissen |
|---|
| 448 | * SW7335-916: Fixed support for FixedScale packet. |
|---|
| 449 | * |
|---|
| 450 | * Hydra_Software_Devel/39 11/15/10 3:08p nissen |
|---|
| 451 | * SW7420-1150: Fixed palette to palette blits. |
|---|
| 452 | * |
|---|
| 453 | * Hydra_Software_Devel/38 11/11/10 1:34p nissen |
|---|
| 454 | * SW7335-916: Added support for FixedScale packet. |
|---|
| 455 | * |
|---|
| 456 | * Hydra_Software_Devel/37 11/1/10 10:32a nissen |
|---|
| 457 | * SW7420-1200: Fixed problem with checking for available M2MC FIFO |
|---|
| 458 | * memory. |
|---|
| 459 | * |
|---|
| 460 | * Hydra_Software_Devel/36 10/27/10 12:20p nissen |
|---|
| 461 | * SW7420-1150: Fixed support for palette to palatte blits. |
|---|
| 462 | * |
|---|
| 463 | * Hydra_Software_Devel/35 10/20/10 7:17p nissen |
|---|
| 464 | * SW7420-1193: Fixed blend equation when using subtraction. |
|---|
| 465 | * |
|---|
| 466 | * Hydra_Software_Devel/34 10/6/10 2:29p nissen |
|---|
| 467 | * SW7405-3671: Added DestinationColor packet. |
|---|
| 468 | * |
|---|
| 469 | * Hydra_Software_Devel/33 9/27/10 5:51p nissen |
|---|
| 470 | * SW7405-3671: Fixed problem destriping odd width surfaces. |
|---|
| 471 | * |
|---|
| 472 | * Hydra_Software_Devel/32 9/23/10 2:01p nissen |
|---|
| 473 | * SW7405-4892: Fixed BGRC_PACKET_P_ConvertFilterCoeffs when a size |
|---|
| 474 | * parameter is 0. |
|---|
| 475 | * |
|---|
| 476 | * Hydra_Software_Devel/31 9/20/10 3:38p nissen |
|---|
| 477 | * SW7405-4869: Fixed Rop selection. |
|---|
| 478 | * |
|---|
| 479 | * Hydra_Software_Devel/30 9/20/10 2:04p nissen |
|---|
| 480 | * SW7405-3671: Added support for Source, Destination, and Output Control |
|---|
| 481 | * packets. |
|---|
| 482 | * |
|---|
| 483 | * Hydra_Software_Devel/29 8/19/10 12:11p nissen |
|---|
| 484 | * SW7405-3671: Fixed x/y position of destripe blit. |
|---|
| 485 | * |
|---|
| 486 | * Hydra_Software_Devel/28 8/18/10 3:27p nissen |
|---|
| 487 | * SW7405-3671: Checking if user overwrote submited packet memory. |
|---|
| 488 | * |
|---|
| 489 | * Hydra_Software_Devel/27 8/11/10 2:33p nissen |
|---|
| 490 | * SW7405-3671: Fixed anisotropic and sharp filter tables. |
|---|
| 491 | * |
|---|
| 492 | * Hydra_Software_Devel/26 8/9/10 10:33p nissen |
|---|
| 493 | * SW7405-3671: Forcing SW striping for YCbCr422 source blits. |
|---|
| 494 | * |
|---|
| 495 | * Hydra_Software_Devel/25 8/9/10 6:44p nissen |
|---|
| 496 | * SW7405-3671: Added fix for odd stripe width for YCbCr422 surfaces. |
|---|
| 497 | * |
|---|
| 498 | * Hydra_Software_Devel/24 8/9/10 5:09p nissen |
|---|
| 499 | * SW7405-3671: Removed pixel formats that are not in PXL. |
|---|
| 500 | * |
|---|
| 501 | * Hydra_Software_Devel/23 8/9/10 11:30a nissen |
|---|
| 502 | * SW7405-3671: Fixed YUV420 one pixel wide blit, and added code for SW |
|---|
| 503 | * destriping. |
|---|
| 504 | * |
|---|
| 505 | * Hydra_Software_Devel/22 8/4/10 8:36p nissen |
|---|
| 506 | * SW7405-3671: Fixed problem with over allocating hw fifo when dealing |
|---|
| 507 | * with advance interrupts. |
|---|
| 508 | * |
|---|
| 509 | * Hydra_Software_Devel/21 8/4/10 7:13p nissen |
|---|
| 510 | * SW7405-3671: Changed dither default to false. |
|---|
| 511 | * |
|---|
| 512 | * Hydra_Software_Devel/20 8/4/10 6:16p nissen |
|---|
| 513 | * SW7405-3671: Fixed problem with missing advanced interrupt. |
|---|
| 514 | * |
|---|
| 515 | * Hydra_Software_Devel/19 8/3/10 5:17p nissen |
|---|
| 516 | * SW7405-3671: Forced palette address to be non-null. |
|---|
| 517 | * |
|---|
| 518 | * Hydra_Software_Devel/18 8/3/10 5:03p nissen |
|---|
| 519 | * SW7405-3671: Fixed reset state and palette packets. |
|---|
| 520 | * |
|---|
| 521 | * Hydra_Software_Devel/17 8/2/10 3:00p nissen |
|---|
| 522 | * SW7405-3671: Removed reset state packet from sync blit. |
|---|
| 523 | * |
|---|
| 524 | * Hydra_Software_Devel/16 8/1/10 3:37p nissen |
|---|
| 525 | * SW7405-3671: Added support for horizontal mirroring for destination and |
|---|
| 526 | * output. |
|---|
| 527 | * |
|---|
| 528 | * Hydra_Software_Devel/15 7/31/10 5:13p nissen |
|---|
| 529 | * SW7405-3671: Fixed HW fifo wrapping and sync interrupt. |
|---|
| 530 | * |
|---|
| 531 | * Hydra_Software_Devel/14 7/30/10 11:20a nissen |
|---|
| 532 | * SW7405-3671: Fixed advance interrupt on context. |
|---|
| 533 | * |
|---|
| 534 | * Hydra_Software_Devel/13 7/29/10 2:01p nissen |
|---|
| 535 | * SW7405-3671: Fixed advance interrupt. |
|---|
| 536 | * |
|---|
| 537 | * Hydra_Software_Devel/12 7/28/10 5:53p nissen |
|---|
| 538 | * SW7405-3671: Fixed Ax pixel formats. |
|---|
| 539 | * |
|---|
| 540 | * Hydra_Software_Devel/11 7/28/10 4:01p nissen |
|---|
| 541 | * SW7405-3671: Fixed group header problem with packets that don't include |
|---|
| 542 | * an execute. |
|---|
| 543 | * |
|---|
| 544 | * Hydra_Software_Devel/10 7/27/10 2:36p nissen |
|---|
| 545 | * SW7405-3671: Fixed advance interrupt. |
|---|
| 546 | * |
|---|
| 547 | * Hydra_Software_Devel/9 7/23/10 8:06p nissen |
|---|
| 548 | * SW7405-3671: Fixed problem with main interrupt handling. |
|---|
| 549 | * |
|---|
| 550 | * Hydra_Software_Devel/8 7/23/10 4:40p nissen |
|---|
| 551 | * SW7405-3671: Fixed converting filter tables, and blend blit packet. |
|---|
| 552 | * |
|---|
| 553 | * Hydra_Software_Devel/7 7/23/10 3:59p nissen |
|---|
| 554 | * SW7405-3671: Added control entries to group mask array. |
|---|
| 555 | * |
|---|
| 556 | * Hydra_Software_Devel/6 7/21/10 3:09p nissen |
|---|
| 557 | * SW7405-3671: Added fields to device group header mask array. |
|---|
| 558 | * |
|---|
| 559 | * Hydra_Software_Devel/5 7/21/10 11:35a nissen |
|---|
| 560 | * SW7405-3671: Fixed define in device group sizes. |
|---|
| 561 | * |
|---|
| 562 | * Hydra_Software_Devel/4 7/18/10 4:11p nissen |
|---|
| 563 | * SW7405-3671: Fixed reset state and sync. |
|---|
| 564 | * |
|---|
| 565 | * Hydra_Software_Devel/3 7/17/10 3:32p nissen |
|---|
| 566 | * SW7405-3671: Fixed memory alignment for sync packet. |
|---|
| 567 | * |
|---|
| 568 | * Hydra_Software_Devel/2 7/15/10 9:10p nissen |
|---|
| 569 | * SW7405-3671: Added more interrupt support. |
|---|
| 570 | * |
|---|
| 571 | * Hydra_Software_Devel/1 7/12/10 1:25p nissen |
|---|
| 572 | * SW7405-3671: Initial version. |
|---|
| 573 | * |
|---|
| 574 | ***************************************************************************/ |
|---|
| 575 | |
|---|
| 576 | #if (BCHP_CHIP==7435) |
|---|
| 577 | #include "bchp_m2mc.h" |
|---|
| 578 | #include "bchp_m2mc1.h" |
|---|
| 579 | #else |
|---|
| 580 | #include "bchp_m2mc.h" |
|---|
| 581 | #endif |
|---|
| 582 | |
|---|
| 583 | #include "bchp_common.h" |
|---|
| 584 | |
|---|
| 585 | #include "bgrc.h" |
|---|
| 586 | #include "bgrc_packet.h" |
|---|
| 587 | #include "bgrc_packet_priv.h" |
|---|
| 588 | #include "bgrc_private.h" |
|---|
| 589 | |
|---|
| 590 | BDBG_MODULE(BGRC); |
|---|
| 591 | |
|---|
| 592 | /***************************************************************************/ |
|---|
| 593 | void BGRC_PACKET_P_PrintRegisters( BGRC_Handle hGrc ) |
|---|
| 594 | { |
|---|
| 595 | BSTD_UNUSED(hGrc); |
|---|
| 596 | BDBG_ERR(( "LIST_CTRL %08x", BGRC_P_ReadReg32( hGrc->hRegister, LIST_CTRL ) )); |
|---|
| 597 | BDBG_ERR(( "LIST_STATUS %08x", BGRC_P_ReadReg32( hGrc->hRegister, LIST_STATUS ) )); |
|---|
| 598 | BDBG_ERR(( "LIST_FIRST_PKT_ADDR %08x", BGRC_P_ReadReg32( hGrc->hRegister, LIST_FIRST_PKT_ADDR ) )); |
|---|
| 599 | BDBG_ERR(( "LIST_CURR_PKT_ADDR %08x", BGRC_P_ReadReg32( hGrc->hRegister, LIST_CURR_PKT_ADDR ) )); |
|---|
| 600 | BDBG_ERR(( "BLIT_STATUS %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_STATUS ) )); |
|---|
| 601 | BDBG_ERR(( "BLIT_SRC_ADDRESS %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_ADDRESS ) )); |
|---|
| 602 | BDBG_ERR(( "BLIT_DEST_ADDRESS %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_DEST_ADDRESS ) )); |
|---|
| 603 | BDBG_ERR(( "BLIT_OUTPUT_ADDRESS %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_OUTPUT_ADDRESS ) )); |
|---|
| 604 | BDBG_ERR(( "BLIT_MEM_HI %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_MEM_HI ) )); |
|---|
| 605 | BDBG_ERR(( "BLIT_MEM_LO %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_MEM_LO ) )); |
|---|
| 606 | BDBG_ERR(( "SRC_FEEDER_ENABLE %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_FEEDER_ENABLE ) )); |
|---|
| 607 | BDBG_ERR(( "SRC_SURFACE_ADDR_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_ADDR_0 ) )); |
|---|
| 608 | BDBG_ERR(( "SRC_SURFACE_STRIDE_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_STRIDE_0 ) )); |
|---|
| 609 | BDBG_ERR(( "SRC_SURFACE_ADDR_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_ADDR_1 ) )); |
|---|
| 610 | BDBG_ERR(( "SRC_SURFACE_STRIDE_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_STRIDE_1 ) )); |
|---|
| 611 | BDBG_ERR(( "SRC_SURFACE_FORMAT_DEF_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_FORMAT_DEF_1 ) )); |
|---|
| 612 | BDBG_ERR(( "SRC_SURFACE_FORMAT_DEF_2 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_FORMAT_DEF_2 ) )); |
|---|
| 613 | BDBG_ERR(( "SRC_SURFACE_FORMAT_DEF_3 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_FORMAT_DEF_3 ) )); |
|---|
| 614 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 615 | BDBG_ERR(( "SRC_SURFACE_1_FORMAT_DEF_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_1_FORMAT_DEF_1 ) )); |
|---|
| 616 | BDBG_ERR(( "SRC_SURFACE_1_FORMAT_DEF_2 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_1_FORMAT_DEF_2 ) )); |
|---|
| 617 | BDBG_ERR(( "SRC_SURFACE_1_FORMAT_DEF_3 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_SURFACE_1_FORMAT_DEF_3 ) )); |
|---|
| 618 | #endif |
|---|
| 619 | BDBG_ERR(( "SRC_W_ALPHA %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_W_ALPHA ) )); |
|---|
| 620 | BDBG_ERR(( "SRC_CONSTANT_COLOR %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CONSTANT_COLOR ) )); |
|---|
| 621 | BDBG_ERR(( "DEST_FEEDER_ENABLE %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_FEEDER_ENABLE ) )); |
|---|
| 622 | BDBG_ERR(( "DEST_SURFACE_ADDR_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_ADDR_0 ) )); |
|---|
| 623 | BDBG_ERR(( "DEST_SURFACE_STRIDE_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_STRIDE_0 ) )); |
|---|
| 624 | BDBG_ERR(( "DEST_SURFACE_ADDR_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_ADDR_1 ) )); |
|---|
| 625 | BDBG_ERR(( "DEST_SURFACE_STRIDE_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_STRIDE_1 ) )); |
|---|
| 626 | BDBG_ERR(( "DEST_SURFACE_FORMAT_DEF_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_FORMAT_DEF_1 ) )); |
|---|
| 627 | BDBG_ERR(( "DEST_SURFACE_FORMAT_DEF_2 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_FORMAT_DEF_2 ) )); |
|---|
| 628 | BDBG_ERR(( "DEST_SURFACE_FORMAT_DEF_3 %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_SURFACE_FORMAT_DEF_3 ) )); |
|---|
| 629 | BDBG_ERR(( "DEST_W_ALPHA %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_W_ALPHA ) )); |
|---|
| 630 | BDBG_ERR(( "DEST_CONSTANT_COLOR %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_CONSTANT_COLOR ) )); |
|---|
| 631 | BDBG_ERR(( "OUTPUT_FEEDER_ENABLE %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_FEEDER_ENABLE ) )); |
|---|
| 632 | BDBG_ERR(( "OUTPUT_SURFACE_ADDR_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_ADDR_0 ) )); |
|---|
| 633 | BDBG_ERR(( "OUTPUT_SURFACE_STRIDE_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_STRIDE_0 ) )); |
|---|
| 634 | BDBG_ERR(( "OUTPUT_SURFACE_ADDR_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_ADDR_1 ) )); |
|---|
| 635 | BDBG_ERR(( "OUTPUT_SURFACE_STRIDE_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_STRIDE_1 ) )); |
|---|
| 636 | BDBG_ERR(( "OUTPUT_SURFACE_FORMAT_DEF_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_FORMAT_DEF_1 ) )); |
|---|
| 637 | BDBG_ERR(( "OUTPUT_SURFACE_FORMAT_DEF_2 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_FORMAT_DEF_2 ) )); |
|---|
| 638 | BDBG_ERR(( "OUTPUT_SURFACE_FORMAT_DEF_3 %08x", BGRC_P_ReadReg32( hGrc->hRegister, OUTPUT_SURFACE_FORMAT_DEF_3 ) )); |
|---|
| 639 | BDBG_ERR(( "BLIT_HEADER %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_HEADER ) )); |
|---|
| 640 | BDBG_ERR(( "BLIT_SRC_TOP_LEFT %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_TOP_LEFT ) )); |
|---|
| 641 | BDBG_ERR(( "BLIT_SRC_SIZE %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_SIZE ) )); |
|---|
| 642 | #if defined(BCHP_M2MC_BLIT_SRC_TOP_LEFT_1) |
|---|
| 643 | BDBG_ERR(( "BLIT_SRC_TOP_LEFT_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_TOP_LEFT_1 ) )); |
|---|
| 644 | BDBG_ERR(( "BLIT_SRC_SIZE_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_SIZE_1 ) )); |
|---|
| 645 | #endif |
|---|
| 646 | #if defined(BCHP_M2MC_BLIT_SRC_STRIPE_HEIGHT_WIDTH_0) |
|---|
| 647 | BDBG_ERR(( "BLIT_SRC_STRIPE_HEIGHT_WIDTH_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_STRIPE_HEIGHT_WIDTH_0 ) )); |
|---|
| 648 | BDBG_ERR(( "BLIT_SRC_STRIPE_HEIGHT_WIDTH_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_SRC_STRIPE_HEIGHT_WIDTH_1 ) )); |
|---|
| 649 | #endif |
|---|
| 650 | BDBG_ERR(( "BLIT_DEST_TOP_LEFT %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_DEST_TOP_LEFT ) )); |
|---|
| 651 | BDBG_ERR(( "BLIT_DEST_SIZE %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_DEST_SIZE ) )); |
|---|
| 652 | BDBG_ERR(( "BLIT_OUTPUT_TOP_LEFT %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_OUTPUT_TOP_LEFT ) )); |
|---|
| 653 | BDBG_ERR(( "BLIT_OUTPUT_SIZE %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_OUTPUT_SIZE ) )); |
|---|
| 654 | BDBG_ERR(( "BLIT_INPUT_STRIPE_WIDTH %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_INPUT_STRIPE_WIDTH ) )); |
|---|
| 655 | #if defined(BCHP_M2MC_BLIT_INPUT_STRIPE_WIDTH_1) |
|---|
| 656 | BDBG_ERR(( "BLIT_INPUT_STRIPE_WIDTH_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_INPUT_STRIPE_WIDTH_1 ) )); |
|---|
| 657 | #endif |
|---|
| 658 | BDBG_ERR(( "BLIT_OUTPUT_STRIPE_WIDTH %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_OUTPUT_STRIPE_WIDTH ) )); |
|---|
| 659 | BDBG_ERR(( "BLIT_STRIPE_OVERLAP %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_STRIPE_OVERLAP ) )); |
|---|
| 660 | #if defined(BCHP_M2MC_BLIT_STRIPE_OVERLAP_1) |
|---|
| 661 | BDBG_ERR(( "BLIT_STRIPE_OVERLAP_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_STRIPE_OVERLAP_1 ) )); |
|---|
| 662 | #endif |
|---|
| 663 | BDBG_ERR(( "BLIT_CTRL %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLIT_CTRL ) )); |
|---|
| 664 | BDBG_ERR(( "SCALER_CTRL %08x", BGRC_P_ReadReg32( hGrc->hRegister, SCALER_CTRL ) )); |
|---|
| 665 | BDBG_ERR(( "HORIZ_AVERAGER_COUNT %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_AVERAGER_COUNT ) )); |
|---|
| 666 | BDBG_ERR(( "HORIZ_AVERAGER_COEFF %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_AVERAGER_COEFF ) )); |
|---|
| 667 | BDBG_ERR(( "VERT_AVERAGER_COUNT %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_AVERAGER_COUNT ) )); |
|---|
| 668 | BDBG_ERR(( "VERT_AVERAGER_COEFF %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_AVERAGER_COEFF ) )); |
|---|
| 669 | BDBG_ERR(( "HORIZ_SCALER_INITIAL_PHASE %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_SCALER_INITIAL_PHASE ) )); |
|---|
| 670 | BDBG_ERR(( "HORIZ_SCALER_STEP %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_SCALER_STEP ) )); |
|---|
| 671 | #if defined(BCHP_M2MC_HORIZ_SCALER_1_INITIAL_PHASE) |
|---|
| 672 | BDBG_ERR(( "HORIZ_SCALER_1_INITIAL_PHASE %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_SCALER_1_INITIAL_PHASE ) )); |
|---|
| 673 | BDBG_ERR(( "HORIZ_SCALER_1_STEP %08x", BGRC_P_ReadReg32( hGrc->hRegister, HORIZ_SCALER_1_STEP ) )); |
|---|
| 674 | #endif |
|---|
| 675 | BDBG_ERR(( "VERT_SCALER_INITIAL_PHASE %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_SCALER_INITIAL_PHASE ) )); |
|---|
| 676 | BDBG_ERR(( "VERT_SCALER_STEP %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_SCALER_STEP ) )); |
|---|
| 677 | #if defined(BCHP_M2MC_VERT_SCALER_1_INITIAL_PHASE) |
|---|
| 678 | BDBG_ERR(( "VERT_SCALER_1_INITIAL_PHASE %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_SCALER_1_INITIAL_PHASE ) )); |
|---|
| 679 | BDBG_ERR(( "VERT_SCALER_1_STEP %08x", BGRC_P_ReadReg32( hGrc->hRegister, VERT_SCALER_1_STEP ) )); |
|---|
| 680 | #endif |
|---|
| 681 | BDBG_ERR(( "BLEND_COLOR_OP %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLEND_COLOR_OP ) )); |
|---|
| 682 | BDBG_ERR(( "BLEND_ALPHA_OP %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLEND_ALPHA_OP ) )); |
|---|
| 683 | BDBG_ERR(( "BLEND_CONSTANT_COLOR %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLEND_CONSTANT_COLOR ) )); |
|---|
| 684 | BDBG_ERR(( "BLEND_COLOR_KEY_ACTION %08x", BGRC_P_ReadReg32( hGrc->hRegister, BLEND_COLOR_KEY_ACTION ) )); |
|---|
| 685 | BDBG_ERR(( "ROP_OPERATION %08x", BGRC_P_ReadReg32( hGrc->hRegister, ROP_OPERATION ) )); |
|---|
| 686 | BDBG_ERR(( "ROP_PATTERN_TOP %08x", BGRC_P_ReadReg32( hGrc->hRegister, ROP_PATTERN_TOP ) )); |
|---|
| 687 | BDBG_ERR(( "ROP_PATTERN_BOTTOM %08x", BGRC_P_ReadReg32( hGrc->hRegister, ROP_PATTERN_BOTTOM ) )); |
|---|
| 688 | BDBG_ERR(( "ROP_PATTERN_COLOR_0 %08x", BGRC_P_ReadReg32( hGrc->hRegister, ROP_PATTERN_COLOR_0 ) )); |
|---|
| 689 | BDBG_ERR(( "ROP_PATTERN_COLOR_1 %08x", BGRC_P_ReadReg32( hGrc->hRegister, ROP_PATTERN_COLOR_1 ) )); |
|---|
| 690 | BDBG_ERR(( "SRC_COLOR_KEY_HIGH %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_COLOR_KEY_HIGH ) )); |
|---|
| 691 | BDBG_ERR(( "SRC_COLOR_KEY_LOW %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_COLOR_KEY_LOW ) )); |
|---|
| 692 | BDBG_ERR(( "SRC_COLOR_KEY_MASK %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_COLOR_KEY_MASK ) )); |
|---|
| 693 | BDBG_ERR(( "SRC_COLOR_KEY_REPLACEMENT %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_COLOR_KEY_REPLACEMENT ) )); |
|---|
| 694 | BDBG_ERR(( "SRC_COLOR_KEY_REPLACEMENT_MASK %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_COLOR_KEY_REPLACEMENT_MASK ) )); |
|---|
| 695 | BDBG_ERR(( "DEST_COLOR_KEY_HIGH %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_COLOR_KEY_HIGH ) )); |
|---|
| 696 | BDBG_ERR(( "DEST_COLOR_KEY_LOW %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_COLOR_KEY_LOW ) )); |
|---|
| 697 | BDBG_ERR(( "DEST_COLOR_KEY_MASK %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_COLOR_KEY_MASK ) )); |
|---|
| 698 | BDBG_ERR(( "DEST_COLOR_KEY_REPLACEMENT %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_COLOR_KEY_REPLACEMENT ) )); |
|---|
| 699 | BDBG_ERR(( "DEST_COLOR_KEY_REPLACEMENT_MASK %08x", BGRC_P_ReadReg32( hGrc->hRegister, DEST_COLOR_KEY_REPLACEMENT_MASK ) )); |
|---|
| 700 | BDBG_ERR(( "SRC_CM_C00_C01 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C00_C01 ) )); |
|---|
| 701 | BDBG_ERR(( "SRC_CM_C02_C03 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C02_C03 ) )); |
|---|
| 702 | BDBG_ERR(( "SRC_CM_C04 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C04 ) )); |
|---|
| 703 | BDBG_ERR(( "SRC_CM_C10_C11 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C10_C11 ) )); |
|---|
| 704 | BDBG_ERR(( "SRC_CM_C12_C13 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C12_C13 ) )); |
|---|
| 705 | BDBG_ERR(( "SRC_CM_C14 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C14 ) )); |
|---|
| 706 | BDBG_ERR(( "SRC_CM_C20_C21 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C20_C21 ) )); |
|---|
| 707 | BDBG_ERR(( "SRC_CM_C22_C23 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C22_C23 ) )); |
|---|
| 708 | BDBG_ERR(( "SRC_CM_C24 %08x", BGRC_P_ReadReg32( hGrc->hRegister, SRC_CM_C24 ) )); |
|---|
| 709 | BDBG_ERR(( "" )); |
|---|
| 710 | } |
|---|
| 711 | |
|---|
| 712 | /***************************************************************************/ |
|---|
| 713 | #define M2MC_FT_Default (0L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 714 | #define M2MC_FT_WRGB1555 (1L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 715 | #define M2MC_FT_WRGB1565 (2L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 716 | #define M2MC_FT_Palette (3L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 717 | #define M2MC_FT_YCbCr422 (4L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 718 | #define M2MC_FT_Alpha (5L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 719 | #define M2MC_FT_YCbCr422_10 (6L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 720 | #define M2MC_FT_YCbCr444_10 (8L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) |
|---|
| 721 | |
|---|
| 722 | #ifdef BCHP_M2MC_SRC_SURFACE_0_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK |
|---|
| 723 | #define M2MC_FT_YCbCr420 (BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_1_FORMAT_TYPE_MASK) | BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK)) |
|---|
| 724 | #else |
|---|
| 725 | #define M2MC_FT_YCbCr420 BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_MASK) |
|---|
| 726 | #endif |
|---|
| 727 | |
|---|
| 728 | #define M2MC_DISABLE_SHIFT BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_3_CH0_DISABLE_SHIFT) |
|---|
| 729 | #define M2MC_CHANNEL_MASK ((1L << BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_SHIFT)) - 1) |
|---|
| 730 | |
|---|
| 731 | /***************************************************************************/ |
|---|
| 732 | static uint32_t s_BGRC_PACKET_P_DevicePixelFormats[][3] = |
|---|
| 733 | { |
|---|
| 734 | { 0x00000000, 0x00000000, 0x00000000 }, /* Unknown */ |
|---|
| 735 | { 0x00000565 | M2MC_FT_Default, 0x000B0500, 0x00000008 << M2MC_DISABLE_SHIFT }, /* R5_G6_B5 */ |
|---|
| 736 | { 0x00000565 | M2MC_FT_Default, 0x0000050B, 0x00000008 << M2MC_DISABLE_SHIFT }, /* B5_G6_R5 */ |
|---|
| 737 | { 0x00001555 | M2MC_FT_Default, 0x0F0A0500, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A1_R5_G5_B5 */ |
|---|
| 738 | { 0x00001555 | M2MC_FT_Default, 0x0F0A0500, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X1_R5_G5_B5 */ |
|---|
| 739 | { 0x00001555 | M2MC_FT_Default, 0x0F00050A, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A1_B5_G5_R5 */ |
|---|
| 740 | { 0x00001555 | M2MC_FT_Default, 0x0F00050A, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X1_B5_G5_R5 */ |
|---|
| 741 | { 0x00001555 | M2MC_FT_Default, 0x000B0601, 0x00000000 << M2MC_DISABLE_SHIFT }, /* R5_G5_B5_A1 */ |
|---|
| 742 | { 0x00001555 | M2MC_FT_Default, 0x000B0601, 0x00000008 << M2MC_DISABLE_SHIFT }, /* R5_G5_B5_X1 */ |
|---|
| 743 | { 0x00001555 | M2MC_FT_Default, 0x0001060B, 0x00000000 << M2MC_DISABLE_SHIFT }, /* B5_G5_R5_A1 */ |
|---|
| 744 | { 0x00001555 | M2MC_FT_Default, 0x0001060B, 0x00000008 << M2MC_DISABLE_SHIFT }, /* B5_G5_R5_X1 */ |
|---|
| 745 | { 0x00004444 | M2MC_FT_Default, 0x0C080400, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A4_R4_G4_B4 */ |
|---|
| 746 | { 0x00004444 | M2MC_FT_Default, 0x0C080400, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X4_R4_G4_B4 */ |
|---|
| 747 | { 0x00004444 | M2MC_FT_Default, 0x0C000408, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A4_B4_G4_R4 */ |
|---|
| 748 | { 0x00004444 | M2MC_FT_Default, 0x0C000408, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X4_B4_G4_R4 */ |
|---|
| 749 | { 0x00004444 | M2MC_FT_Default, 0x000C0804, 0x00000000 << M2MC_DISABLE_SHIFT }, /* R4_G4_B4_A4 */ |
|---|
| 750 | { 0x00004444 | M2MC_FT_Default, 0x000C0804, 0x00000008 << M2MC_DISABLE_SHIFT }, /* R4_G4_B4_X4 */ |
|---|
| 751 | { 0x00004444 | M2MC_FT_Default, 0x0004080C, 0x00000000 << M2MC_DISABLE_SHIFT }, /* B4_G4_R4_A4 */ |
|---|
| 752 | { 0x00004444 | M2MC_FT_Default, 0x0004080C, 0x00000008 << M2MC_DISABLE_SHIFT }, /* B4_G4_R4_X4 */ |
|---|
| 753 | { 0x00008888 | M2MC_FT_Default, 0x18100800, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A8_R8_G8_B8 */ |
|---|
| 754 | { 0x00008888 | M2MC_FT_Default, 0x18100800, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X8_R8_G8_B8 */ |
|---|
| 755 | { 0x00008888 | M2MC_FT_Default, 0x18000810, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A8_B8_G8_R8 */ |
|---|
| 756 | { 0x00008888 | M2MC_FT_Default, 0x18000810, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X8_B8_G8_R8 */ |
|---|
| 757 | { 0x00008888 | M2MC_FT_Default, 0x00181008, 0x00000000 << M2MC_DISABLE_SHIFT }, /* R8_G8_B8_A8 */ |
|---|
| 758 | { 0x00008888 | M2MC_FT_Default, 0x00181008, 0x00000008 << M2MC_DISABLE_SHIFT }, /* R8_G8_B8_X8 */ |
|---|
| 759 | { 0x00008888 | M2MC_FT_Default, 0x00081018, 0x00000000 << M2MC_DISABLE_SHIFT }, /* B8_G8_R8_A8 */ |
|---|
| 760 | { 0x00008888 | M2MC_FT_Default, 0x00081018, 0x00000008 << M2MC_DISABLE_SHIFT }, /* B8_G8_R8_X8 */ |
|---|
| 761 | { 0x00008000 | M2MC_FT_Alpha, 0x00000000, 0x00000007 << M2MC_DISABLE_SHIFT }, /* A8 */ |
|---|
| 762 | { 0x00004000 | M2MC_FT_Alpha, 0x00000000, 0x00000007 << M2MC_DISABLE_SHIFT }, /* A4 */ |
|---|
| 763 | { 0x00002000 | M2MC_FT_Alpha, 0x00000000, 0x00000007 << M2MC_DISABLE_SHIFT }, /* A2 */ |
|---|
| 764 | { 0x00001000 | M2MC_FT_Alpha, 0x00000000, 0x00000007 << M2MC_DISABLE_SHIFT }, /* A1 */ |
|---|
| 765 | { 0x00001000 | M2MC_FT_WRGB1565, 0x00000000, 0x00000007 << M2MC_DISABLE_SHIFT }, /* W1 */ |
|---|
| 766 | { 0x00008008 | M2MC_FT_Palette, 0x08000000, 0x00000006 << M2MC_DISABLE_SHIFT }, /* A8_P8 */ |
|---|
| 767 | { 0x00000008 | M2MC_FT_Palette, 0x00000000, 0x0000000E << M2MC_DISABLE_SHIFT }, /* P8 */ |
|---|
| 768 | { 0x00000004 | M2MC_FT_Palette, 0x00000000, 0x0000000E << M2MC_DISABLE_SHIFT }, /* P4 */ |
|---|
| 769 | { 0x00000002 | M2MC_FT_Palette, 0x00000000, 0x0000000E << M2MC_DISABLE_SHIFT }, /* P2 */ |
|---|
| 770 | { 0x00000001 | M2MC_FT_Palette, 0x00000000, 0x0000000E << M2MC_DISABLE_SHIFT }, /* P1 */ |
|---|
| 771 | { 0x00000808 | M2MC_FT_Palette, 0x00080000, 0x0000000A << M2MC_DISABLE_SHIFT }, /* Y8_P8 */ |
|---|
| 772 | { 0x00000800 | M2MC_FT_YCbCr420, 0x00000000, 0x0000000B << M2MC_DISABLE_SHIFT }, /* Y8 */ |
|---|
| 773 | { 0x00008800 | M2MC_FT_YCbCr420, 0x08000000, 0x00000003 << M2MC_DISABLE_SHIFT }, /* A8_Y8 */ |
|---|
| 774 | { 0x00000088 | M2MC_FT_YCbCr420, 0x00000800, 0x0000000C << M2MC_DISABLE_SHIFT }, /* Cb8_Cr8 */ |
|---|
| 775 | { 0x00000088 | M2MC_FT_YCbCr420, 0x00000008, 0x0000000C << M2MC_DISABLE_SHIFT }, /* Cr8_Cb8 */ |
|---|
| 776 | { 0x00000080 | M2MC_FT_Default, 0x00000000, 0x0000000D << M2MC_DISABLE_SHIFT }, /* Cb8 */ |
|---|
| 777 | { 0x00000008 | M2MC_FT_Default, 0x00000000, 0x0000000E << M2MC_DISABLE_SHIFT }, /* Cr8 */ |
|---|
| 778 | { 0x00008888 | M2MC_FT_YCbCr422, 0x18081000, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y08_Cb8_Y18_Cr8 */ |
|---|
| 779 | { 0x00008888 | M2MC_FT_YCbCr422, 0x18080010, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y08_Cr8_Y18_Cb8 */ |
|---|
| 780 | { 0x00008888 | M2MC_FT_YCbCr422, 0x08181000, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y18_Cb8_Y08_Cr8 */ |
|---|
| 781 | { 0x00008888 | M2MC_FT_YCbCr422, 0x08180010, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y18_Cr8_Y08_Cb8 */ |
|---|
| 782 | { 0x00008888 | M2MC_FT_YCbCr422, 0x10001808, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cb8_Y08_Cr8_Y18 */ |
|---|
| 783 | { 0x00008888 | M2MC_FT_YCbCr422, 0x00101808, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cb8_Y18_Cr8_Y08 */ |
|---|
| 784 | { 0x00008888 | M2MC_FT_YCbCr422, 0x00100818, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cr8_Y18_Cb8_Y08 */ |
|---|
| 785 | { 0x00008888 | M2MC_FT_YCbCr422, 0x10000818, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cr8_Y08_Cb8_Y18 */ |
|---|
| 786 | { 0x00002AAA | M2MC_FT_YCbCr444_10, 0x1E0A0014, 0x00000008 << M2MC_DISABLE_SHIFT }, /* X2_Cr10_Y10_Cb10 */ |
|---|
| 787 | { 0x00008888 | M2MC_FT_Default, 0x18100800, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A8_Y8_Cb8_Cr8 */ |
|---|
| 788 | { 0x00008888 | M2MC_FT_Default, 0x18000810, 0x00000000 << M2MC_DISABLE_SHIFT }, /* A8_Cr8_Cb8_Y8 */ |
|---|
| 789 | { 0x00008888 | M2MC_FT_Default, 0x00081018, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cr8_Cb8_Y8_A8 */ |
|---|
| 790 | { 0x00008888 | M2MC_FT_Default, 0x00181008, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y8_Cb8_Cr8_A8 */ |
|---|
| 791 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x1E0A1400, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y010_Cb10_Y110_Cr10 */ |
|---|
| 792 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x1E0A0014, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y010_Cr10_Y110_Cb10 */ |
|---|
| 793 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x0A1E1400, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y110_Cb10_Y010_Cr10 */ |
|---|
| 794 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x0A1E0014, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Y110_Cr10_Y010_Cb10 */ |
|---|
| 795 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x14001E0A, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cb10_Y010_Cr10_Y110 */ |
|---|
| 796 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x00141E0A, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cb10_Y110_Cr10_Y010 */ |
|---|
| 797 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x00140A1E, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cr10_Y110_Cb10_Y010 */ |
|---|
| 798 | { 0x0000AAAA | M2MC_FT_YCbCr422_10, 0x14000A1E, 0x00000000 << M2MC_DISABLE_SHIFT }, /* Cr10_Y010_Cb10_Y110 */ |
|---|
| 799 | { 0x00000008 | M2MC_FT_Default, 0x00000000, 0x00000000 << M2MC_DISABLE_SHIFT }, /* L8 */ |
|---|
| 800 | { 0x00004004 | M2MC_FT_Default, 0x00000004, 0x00000000 << M2MC_DISABLE_SHIFT }, /* L4_A4 */ |
|---|
| 801 | { 0x00008008 | M2MC_FT_Default, 0x00000008, 0x00000000 << M2MC_DISABLE_SHIFT }, /* L8_A8 */ |
|---|
| 802 | { 0x00006055 | M2MC_FT_Default, 0x00000B06, 0x00000000 << M2MC_DISABLE_SHIFT }, /* L15_L05_A6 */ |
|---|
| 803 | { 0x00000000, 0x00000000, 0x00000000 }, /* Max */ |
|---|
| 804 | }; |
|---|
| 805 | |
|---|
| 806 | /***************************************************************************/ |
|---|
| 807 | #define BGRC_PACKET_P_DEVICE_GROUP_HEADER_FULL ( \ |
|---|
| 808 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK | \ |
|---|
| 809 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_FEEDER_GRP_CNTRL_MASK | \ |
|---|
| 810 | BCHP_M2MC_LIST_PACKET_HEADER_1_OUTPUT_FEEDER_GRP_CNTRL_MASK | \ |
|---|
| 811 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | \ |
|---|
| 812 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK | \ |
|---|
| 813 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLEND_PARAM_GRP_CNTRL_MASK | \ |
|---|
| 814 | BCHP_M2MC_LIST_PACKET_HEADER_1_ROP_GRP_CNTRL_MASK | \ |
|---|
| 815 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_COLOR_KEY_GRP_CNTRL_MASK | \ |
|---|
| 816 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_COLOR_KEY_GRP_CNTRL_MASK | \ |
|---|
| 817 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_COEF_GRP_CNTRL_MASK | \ |
|---|
| 818 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_COLOR_MATRIX_GRP_CNTRL_MASK | \ |
|---|
| 819 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_CLUT_GRP_CNTRL_MASK) |
|---|
| 820 | |
|---|
| 821 | /***************************************************************************/ |
|---|
| 822 | static uint32_t s_BGRC_PACKET_P_DeviceGroupHeaderMasks[] = |
|---|
| 823 | { |
|---|
| 824 | 0, /* EndOfBuffer */ |
|---|
| 825 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK, /* SourceFeeder */ |
|---|
| 826 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK, /* SourceFeeders */ |
|---|
| 827 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK, /* SourceColor */ |
|---|
| 828 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK, /* SourceNone */ |
|---|
| 829 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK, /* SourceControl */ |
|---|
| 830 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_FEEDER_GRP_CNTRL_MASK, /* DestinationFeeder */ |
|---|
| 831 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_FEEDER_GRP_CNTRL_MASK, /* DestinationColor */ |
|---|
| 832 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_FEEDER_GRP_CNTRL_MASK, /* DestinationNone */ |
|---|
| 833 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_FEEDER_GRP_CNTRL_MASK, /* DestinationControl */ |
|---|
| 834 | BCHP_M2MC_LIST_PACKET_HEADER_1_OUTPUT_FEEDER_GRP_CNTRL_MASK, /* OutputFeeder */ |
|---|
| 835 | BCHP_M2MC_LIST_PACKET_HEADER_1_OUTPUT_FEEDER_GRP_CNTRL_MASK, /* OutputControl */ |
|---|
| 836 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLEND_PARAM_GRP_CNTRL_MASK, /* Blend */ |
|---|
| 837 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLEND_PARAM_GRP_CNTRL_MASK, /* BlendColor */ |
|---|
| 838 | BCHP_M2MC_LIST_PACKET_HEADER_1_ROP_GRP_CNTRL_MASK, /* Rop */ |
|---|
| 839 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_COLOR_KEY_GRP_CNTRL_MASK, /* SourceColorkey */ |
|---|
| 840 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* SourceColorkeyEnable */ |
|---|
| 841 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLEND_PARAM_GRP_CNTRL_MASK, |
|---|
| 842 | BCHP_M2MC_LIST_PACKET_HEADER_1_DST_COLOR_KEY_GRP_CNTRL_MASK, /* DestinationColorkey */ |
|---|
| 843 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* DestinationColorkeyEnable */ |
|---|
| 844 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLEND_PARAM_GRP_CNTRL_MASK, |
|---|
| 845 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_COEF_GRP_CNTRL_MASK, /* Filter */ |
|---|
| 846 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, /* FilterEnable */ |
|---|
| 847 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, /* FilterControl */ |
|---|
| 848 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_COLOR_MATRIX_GRP_CNTRL_MASK, /* SourceColorMatrix */ |
|---|
| 849 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK, /* SourceColorMatrixEnable */ |
|---|
| 850 | BCHP_M2MC_LIST_PACKET_HEADER_1_SRC_CLUT_GRP_CNTRL_MASK, /* SourcePalette */ |
|---|
| 851 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, /* AlphaPremultiply */ |
|---|
| 852 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK, /* Mirror */ |
|---|
| 853 | 0, /* FixedScale */ |
|---|
| 854 | 0, /* DestripeFixedScale */ |
|---|
| 855 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK, /* FillBlit */ |
|---|
| 856 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK, /* CopyBlit */ |
|---|
| 857 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK, /* BlendBlit */ |
|---|
| 858 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* ScaleBlit */ |
|---|
| 859 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, |
|---|
| 860 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* ScaleBlendBlit */ |
|---|
| 861 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, |
|---|
| 862 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* UpdateScaleBlit */ |
|---|
| 863 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, |
|---|
| 864 | BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK | /* DestripeBlit */ |
|---|
| 865 | BCHP_M2MC_LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK, |
|---|
| 866 | BGRC_PACKET_P_DEVICE_GROUP_HEADER_FULL, /* Reset */ |
|---|
| 867 | 0, /* Save */ |
|---|
| 868 | 0 /* Restore */ |
|---|
| 869 | }; |
|---|
| 870 | |
|---|
| 871 | /***************************************************************************/ |
|---|
| 872 | #if defined(BCHP_M2MC_HORIZ_FIR_0_COEFF_PHASE0_01) |
|---|
| 873 | #else |
|---|
| 874 | #define BCHP_M2MC_HORIZ_FIR_0_COEFF_PHASE0_01 BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_01 |
|---|
| 875 | #endif |
|---|
| 876 | |
|---|
| 877 | /***************************************************************************/ |
|---|
| 878 | static uint32_t s_BGRC_PACKET_P_DeviceGroupSizes[] = |
|---|
| 879 | { |
|---|
| 880 | 0, |
|---|
| 881 | sizeof (uint32_t), |
|---|
| 882 | 0, |
|---|
| 883 | 0, |
|---|
| 884 | BGRC_M2MC(SRC_CM_C34) - BGRC_M2MC(SRC_CM_C00_C01) + sizeof (uint32_t), |
|---|
| 885 | BGRC_M2MC(SRC_CM_C00_C01) - BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01), |
|---|
| 886 | BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01) - BGRC_M2MC(DEST_COLOR_KEY_HIGH), |
|---|
| 887 | BGRC_M2MC(DEST_COLOR_KEY_HIGH) - BGRC_M2MC(SRC_COLOR_KEY_HIGH), |
|---|
| 888 | BGRC_M2MC(SRC_COLOR_KEY_HIGH) - BGRC_M2MC(ROP_OPERATION), |
|---|
| 889 | BGRC_M2MC(ROP_OPERATION) - BGRC_M2MC(BLEND_COLOR_OP), |
|---|
| 890 | BGRC_M2MC(BLEND_COLOR_OP) - BGRC_M2MC(SCALER_CTRL), |
|---|
| 891 | BGRC_M2MC(SCALER_CTRL) - BGRC_M2MC(BLIT_HEADER), |
|---|
| 892 | BGRC_M2MC(BLIT_HEADER) - BGRC_M2MC(OUTPUT_FEEDER_ENABLE), |
|---|
| 893 | BGRC_M2MC(OUTPUT_FEEDER_ENABLE) - BGRC_M2MC(DEST_FEEDER_ENABLE), |
|---|
| 894 | BGRC_M2MC(DEST_FEEDER_ENABLE) - BGRC_M2MC(SRC_FEEDER_ENABLE) |
|---|
| 895 | }; |
|---|
| 896 | |
|---|
| 897 | /***************************************************************************/ |
|---|
| 898 | static uint32_t s_BGRC_PACKET_P_DeviceRegisterOffsets[] = |
|---|
| 899 | { |
|---|
| 900 | 0, |
|---|
| 901 | BGRC_M2MC(SRC_CLUT_ENTRY_i_ARRAY_BASE) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 902 | 0, |
|---|
| 903 | 0, |
|---|
| 904 | BGRC_M2MC(SRC_CM_C00_C01) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 905 | BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 906 | BGRC_M2MC(DEST_COLOR_KEY_HIGH) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 907 | BGRC_M2MC(SRC_COLOR_KEY_HIGH) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 908 | BGRC_M2MC(ROP_OPERATION) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 909 | BGRC_M2MC(BLEND_COLOR_OP) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 910 | BGRC_M2MC(SCALER_CTRL) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 911 | BGRC_M2MC(BLIT_HEADER) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 912 | BGRC_M2MC(OUTPUT_FEEDER_ENABLE) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 913 | BGRC_M2MC(DEST_FEEDER_ENABLE) - BGRC_M2MC(SRC_FEEDER_ENABLE), |
|---|
| 914 | BGRC_M2MC(SRC_FEEDER_ENABLE) - BGRC_M2MC(SRC_FEEDER_ENABLE) |
|---|
| 915 | }; |
|---|
| 916 | |
|---|
| 917 | /***************************************************************************/ |
|---|
| 918 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_PointSample = |
|---|
| 919 | { |
|---|
| 920 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 921 | { { 0x0000, 0x0000, 0x0100 }, { 0x0000, 0x0000, 0x0100 } } |
|---|
| 922 | #else |
|---|
| 923 | { |
|---|
| 924 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 925 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 926 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 927 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 928 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 929 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 930 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 }, |
|---|
| 931 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x000, 0x00000 } |
|---|
| 932 | } |
|---|
| 933 | #endif |
|---|
| 934 | }; |
|---|
| 935 | |
|---|
| 936 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_Bilinear = |
|---|
| 937 | { |
|---|
| 938 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 939 | { { 0x0000, 0x0000, 0x0100 }, { 0x0000, 0x0000, 0x0080 } } |
|---|
| 940 | #else |
|---|
| 941 | { |
|---|
| 942 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000 }, |
|---|
| 943 | { 0x0000, 0x0000, 0x0000, 0x0200, 0x0E00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 944 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0C00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 945 | { 0x0000, 0x0000, 0x0000, 0x0600, 0x0A00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 946 | { 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0000, 0x0000, 0x0000 }, |
|---|
| 947 | { 0x0000, 0x0000, 0x0000, 0x0A00, 0x0600, 0x0000, 0x0000, 0x0000 }, |
|---|
| 948 | { 0x0000, 0x0000, 0x0000, 0x0C00, 0x0400, 0x0000, 0x0000, 0x0000 }, |
|---|
| 949 | { 0x0000, 0x0000, 0x0000, 0x0E00, 0x0200, 0x0000, 0x0000, 0x0000 } |
|---|
| 950 | } |
|---|
| 951 | #endif |
|---|
| 952 | }; |
|---|
| 953 | |
|---|
| 954 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_Anisotropic[] = |
|---|
| 955 | { |
|---|
| 956 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 957 | { { { 0x0000, 0x0000, 0x0100 }, { 0x0000, 0x0000, 0x0080 } } }, /* 1 to 1 */ |
|---|
| 958 | { { { 0x0000, 0x0000, 0x0100 }, { 0x0000, 0x0000, 0x0080 } } }, /* 2 to 1 */ |
|---|
| 959 | { { { 0x0000, 0x0055, 0x0056 }, { 0x0000, 0x002b, 0x0055 } } }, /* 3 to 1 */ |
|---|
| 960 | { { { 0x0000, 0x0055, 0x0056 }, { 0x0000, 0x002b, 0x0055 } } }, /* 4 to 1 */ |
|---|
| 961 | { { { 0x0033, 0x0033, 0x0034 }, { 0x001a, 0x0033, 0x0033 } } }, /* 5 to 1 */ |
|---|
| 962 | { { { 0x0033, 0x0033, 0x0034 }, { 0x002a, 0x002b, 0x002b } } }, /* 6 to 1 */ |
|---|
| 963 | { { { 0x0033, 0x0033, 0x0034 }, { 0x002a, 0x002b, 0x002b } } }, /* 7 to 1 */ |
|---|
| 964 | { { { 0x0033, 0x0033, 0x0034 }, { 0x002a, 0x002b, 0x002b } } } /* 8 to 1 */ |
|---|
| 965 | #else |
|---|
| 966 | { { |
|---|
| 967 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000 }, /* 1 to 1 */ |
|---|
| 968 | { 0x0000, 0x0000, 0x0000, 0x0200, 0x0E00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 969 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0C00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 970 | { 0x0000, 0x0000, 0x0000, 0x0600, 0x0A00, 0x0000, 0x0000, 0x0000 }, |
|---|
| 971 | { 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0000, 0x0000, 0x0000 }, |
|---|
| 972 | { 0x0000, 0x0000, 0x0000, 0x0A00, 0x0600, 0x0000, 0x0000, 0x0000 }, |
|---|
| 973 | { 0x0000, 0x0000, 0x0000, 0x0C00, 0x0400, 0x0000, 0x0000, 0x0000 }, |
|---|
| 974 | { 0x0000, 0x0000, 0x0000, 0x0E00, 0x0200, 0x0000, 0x0000, 0x0000 } |
|---|
| 975 | } },{ { |
|---|
| 976 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0000, 0x0000 }, /* 2 to 1 */ |
|---|
| 977 | { 0x0000, 0x0000, 0x0000, 0x0100, 0x0800, 0x0700, 0x0000, 0x0000 }, |
|---|
| 978 | { 0x0000, 0x0000, 0x0000, 0x0200, 0x0800, 0x0600, 0x0000, 0x0000 }, |
|---|
| 979 | { 0x0000, 0x0000, 0x0000, 0x0300, 0x0800, 0x0500, 0x0000, 0x0000 }, |
|---|
| 980 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 981 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0800, 0x0300, 0x0000, 0x0000 }, |
|---|
| 982 | { 0x0000, 0x0000, 0x0000, 0x0600, 0x0800, 0x0200, 0x0000, 0x0000 }, |
|---|
| 983 | { 0x0000, 0x0000, 0x0000, 0x0700, 0x0800, 0x0100, 0x0000, 0x0000 } |
|---|
| 984 | } },{ { |
|---|
| 985 | { 0x0000, 0x0000, 0x0000, 0x0554, 0x0558, 0x0554, 0x0000, 0x0000 }, /* 3 to 1 */ |
|---|
| 986 | { 0x0000, 0x0000, 0x00AC, 0x0554, 0x0554, 0x04AC, 0x0000, 0x0000 }, |
|---|
| 987 | { 0x0000, 0x0000, 0x0154, 0x0554, 0x0558, 0x0400, 0x0000, 0x0000 }, |
|---|
| 988 | { 0x0000, 0x0000, 0x0200, 0x0554, 0x0558, 0x0354, 0x0000, 0x0000 }, |
|---|
| 989 | { 0x0000, 0x0000, 0x02AC, 0x0554, 0x0554, 0x02AC, 0x0000, 0x0000 }, |
|---|
| 990 | { 0x0000, 0x0000, 0x0354, 0x0554, 0x0558, 0x0200, 0x0000, 0x0000 }, |
|---|
| 991 | { 0x0000, 0x0000, 0x0400, 0x0554, 0x0558, 0x0154, 0x0000, 0x0000 }, |
|---|
| 992 | { 0x0000, 0x0000, 0x04AC, 0x0554, 0x0554, 0x00AC, 0x0000, 0x0000 } |
|---|
| 993 | } },{ { |
|---|
| 994 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0400, 0x0400, 0x0400, 0x0000 }, /* 4 to 1 */ |
|---|
| 995 | { 0x0000, 0x0000, 0x0080, 0x0400, 0x0400, 0x0400, 0x0380, 0x0000 }, |
|---|
| 996 | { 0x0000, 0x0000, 0x0100, 0x0400, 0x0400, 0x0400, 0x0300, 0x0000 }, |
|---|
| 997 | { 0x0000, 0x0000, 0x0180, 0x0400, 0x0400, 0x0400, 0x0280, 0x0000 }, |
|---|
| 998 | { 0x0000, 0x0000, 0x0200, 0x0400, 0x0400, 0x0400, 0x0200, 0x0000 }, |
|---|
| 999 | { 0x0000, 0x0000, 0x0280, 0x0400, 0x0400, 0x0400, 0x0180, 0x0000 }, |
|---|
| 1000 | { 0x0000, 0x0000, 0x0300, 0x0400, 0x0400, 0x0400, 0x0100, 0x0000 }, |
|---|
| 1001 | { 0x0000, 0x0000, 0x0380, 0x0400, 0x0400, 0x0400, 0x0080, 0x0000 } |
|---|
| 1002 | } },{ { |
|---|
| 1003 | { 0x0000, 0x0000, 0x0334, 0x0334, 0x0334, 0x0334, 0x0330, 0x0000 }, /* 5 to 1 */ |
|---|
| 1004 | { 0x0000, 0x0068, 0x0334, 0x0334, 0x0334, 0x0334, 0x02C8, 0x0000 }, |
|---|
| 1005 | { 0x0000, 0x00CC, 0x0334, 0x0334, 0x0334, 0x0334, 0x0264, 0x0000 }, |
|---|
| 1006 | { 0x0000, 0x0134, 0x0334, 0x0334, 0x0334, 0x0334, 0x01FC, 0x0000 }, |
|---|
| 1007 | { 0x0000, 0x0198, 0x0334, 0x0334, 0x0334, 0x0334, 0x0198, 0x0000 }, |
|---|
| 1008 | { 0x0000, 0x0200, 0x0334, 0x0334, 0x0334, 0x0334, 0x0134, 0x0000 }, |
|---|
| 1009 | { 0x0000, 0x0264, 0x0334, 0x0334, 0x0334, 0x0334, 0x00CC, 0x0000 }, |
|---|
| 1010 | { 0x0000, 0x02C8, 0x0334, 0x0334, 0x0334, 0x0334, 0x0068, 0x0000 } |
|---|
| 1011 | } },{ { |
|---|
| 1012 | { 0x0000, 0x0000, 0x02A8, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02A8 }, /* 6 to 1 */ |
|---|
| 1013 | { 0x0000, 0x0054, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x0250 }, |
|---|
| 1014 | { 0x0000, 0x00A8, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x01FC }, |
|---|
| 1015 | { 0x0000, 0x00FC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x01A8 }, |
|---|
| 1016 | { 0x0000, 0x0154, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x0150 }, |
|---|
| 1017 | { 0x0000, 0x01A8, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x00FC }, |
|---|
| 1018 | { 0x0000, 0x01FC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x00A8 }, |
|---|
| 1019 | { 0x0000, 0x0250, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x02AC, 0x0054 } |
|---|
| 1020 | } },{ { |
|---|
| 1021 | { 0x0000, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x0248 }, /* 7 to 1 */ |
|---|
| 1022 | { 0x0048, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x0200 }, |
|---|
| 1023 | { 0x0094, 0x0248, 0x0248, 0x0248, 0x024C, 0x0248, 0x0248, 0x01B8 }, |
|---|
| 1024 | { 0x00DC, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x016C }, |
|---|
| 1025 | { 0x0124, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x0124 }, |
|---|
| 1026 | { 0x016C, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x00DC }, |
|---|
| 1027 | { 0x01B8, 0x0248, 0x0248, 0x0248, 0x024C, 0x0248, 0x0248, 0x0094 }, |
|---|
| 1028 | { 0x0200, 0x0248, 0x0248, 0x024C, 0x024C, 0x0248, 0x0248, 0x0048 } |
|---|
| 1029 | } },{ { |
|---|
| 1030 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, /* 8 to 1 */ |
|---|
| 1031 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1032 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1033 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1034 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1035 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1036 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 }, |
|---|
| 1037 | { 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200 } |
|---|
| 1038 | } } |
|---|
| 1039 | #endif |
|---|
| 1040 | }; |
|---|
| 1041 | |
|---|
| 1042 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_Sharp[] = |
|---|
| 1043 | { |
|---|
| 1044 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1045 | { { { 0x000f, 0x0041, 0x0060 }, { 0x0006, 0x0024, 0x0056 } } }, /* 8 to 1 */ |
|---|
| 1046 | { { { 0x000b, 0x0040, 0x006a }, { 0x0004, 0x0020, 0x005c } } }, /* 8 to 2 */ |
|---|
| 1047 | { { { 0x0006, 0x003f, 0x0076 }, { 0x0000, 0x001a, 0x0066 } } }, /* 8 to 3 */ |
|---|
| 1048 | { { { 0x0000, 0x003b, 0x008a }, {-0x0002, 0x0010, 0x0072 } } }, /* 8 to 4 */ |
|---|
| 1049 | { { {-0x0005, 0x0033, 0x00a4 }, {-0x0003, 0x0003, 0x0080 } } }, /* 8 to 5 */ |
|---|
| 1050 | { { {-0x0007, 0x0026, 0x00c2 }, {-0x0001,-0x0009, 0x008a } } }, /* 8 to 6 */ |
|---|
| 1051 | { { {-0x0004, 0x0014, 0x00e0 }, { 0x0002,-0x0012, 0x0090 } } }, /* 8 to 7 */ |
|---|
| 1052 | { { {-0x0001, 0x0000, 0x0100 }, { 0x0002,-0x0015, 0x0093 } } }, /* 8 to 8 */ |
|---|
| 1053 | { { { 0x0000,-0x0001, 0x0102 }, { 0x0002,-0x0015, 0x0093 } } }, /* 8 to 9 */ |
|---|
| 1054 | { { {-0x0006, 0x001f, 0x00ce }, { 0x0000,-0x000d, 0x008d } } } /* 1 to N */ |
|---|
| 1055 | #else |
|---|
| 1056 | { { |
|---|
| 1057 | { 0x0000, 0x009C, 0x01E8, 0x036C, 0x041C, 0x036C, 0x01E8, 0x009C }, /* 8 to 1 */ |
|---|
| 1058 | { 0x0038, 0x00B8, 0x0214, 0x0388, 0x0408, 0x0338, 0x01B0, 0x0080 }, |
|---|
| 1059 | { 0x0038, 0x00DC, 0x0248, 0x03A8, 0x0400, 0x030C, 0x0180, 0x006C }, |
|---|
| 1060 | { 0x0040, 0x0100, 0x027C, 0x03C8, 0x03F4, 0x02DC, 0x0154, 0x0058 }, |
|---|
| 1061 | { 0x004C, 0x0128, 0x02AC, 0x03E0, 0x03E0, 0x02AC, 0x0128, 0x004C }, |
|---|
| 1062 | { 0x0058, 0x0154, 0x02DC, 0x03F4, 0x03C8, 0x027C, 0x0100, 0x0040 }, |
|---|
| 1063 | { 0x006C, 0x0180, 0x030C, 0x0400, 0x03A8, 0x0248, 0x00DC, 0x0038 }, |
|---|
| 1064 | { 0x0080, 0x01B0, 0x0338, 0x0408, 0x0388, 0x0214, 0x00B8, 0x0038 } |
|---|
| 1065 | } },{ { |
|---|
| 1066 | { 0x0000, 0x0048, 0x0198, 0x03B8, 0x04D4, 0x03B8, 0x0198, 0x0048 }, /* 8 to 2 */ |
|---|
| 1067 | { 0x0004, 0x0060, 0x01D4, 0x03F4, 0x04CC, 0x0378, 0x015C, 0x0034 }, |
|---|
| 1068 | { 0x0008, 0x007C, 0x0218, 0x042C, 0x04C0, 0x0334, 0x0124, 0x0024 }, |
|---|
| 1069 | { 0x000C, 0x009C, 0x0260, 0x045C, 0x04A8, 0x02EC, 0x00F0, 0x0018 }, |
|---|
| 1070 | { 0x0010, 0x00C4, 0x02A4, 0x0488, 0x0488, 0x02A4, 0x00C4, 0x0010 }, |
|---|
| 1071 | { 0x0018, 0x00F0, 0x02EC, 0x04A8, 0x045C, 0x0260, 0x009C, 0x000C }, |
|---|
| 1072 | { 0x0024, 0x0124, 0x0334, 0x04C0, 0x042C, 0x0218, 0x007C, 0x0008 }, |
|---|
| 1073 | { 0x0034, 0x015C, 0x0378, 0x04CC, 0x03F4, 0x01D4, 0x0060, 0x0004 } |
|---|
| 1074 | } },{ { |
|---|
| 1075 | { 0x0000, 0x3FE4, 0x00F0, 0x041C, 0x0620, 0x041C, 0x00F0, 0x3FE4 }, /* 8 to 3 */ |
|---|
| 1076 | { 0x3FE8, 0x3FE8, 0x0140, 0x048C, 0x0620, 0x03B4, 0x00B0, 0x3FE0 }, |
|---|
| 1077 | { 0x3FE8, 0x3FF8, 0x0198, 0x04F0, 0x0604, 0x0340, 0x0074, 0x3FE0 }, |
|---|
| 1078 | { 0x3FE4, 0x0004, 0x01FC, 0x054C, 0x05D4, 0x02D0, 0x0048, 0x3FE0 }, |
|---|
| 1079 | { 0x3FE4, 0x0020, 0x0264, 0x0598, 0x0598, 0x0264, 0x0020, 0x3FE4 }, |
|---|
| 1080 | { 0x3FE0, 0x0048, 0x02D0, 0x05D4, 0x054C, 0x01FC, 0x0004, 0x3FE4 }, |
|---|
| 1081 | { 0x3FE0, 0x0074, 0x0340, 0x0604, 0x04F0, 0x0198, 0x3FF8, 0x3FE8 }, |
|---|
| 1082 | { 0x3FE0, 0x00B0, 0x03B4, 0x0620, 0x048C, 0x0140, 0x3FE8, 0x3FE8 } |
|---|
| 1083 | } },{ { |
|---|
| 1084 | { 0x0000, 0x3FB0, 0x0000, 0x0454, 0x07F4, 0x0454, 0x0000, 0x3FB0 }, /* 8 to 4 */ |
|---|
| 1085 | { 0x3FFC, 0x3FA0, 0x004C, 0x050C, 0x07E4, 0x03A0, 0x3FC8, 0x3FC0 }, |
|---|
| 1086 | { 0x3FF8, 0x3F90, 0x00AC, 0x05BC, 0x07B0, 0x02F0, 0x3FA4, 0x3FD0 }, |
|---|
| 1087 | { 0x3FF0, 0x3F88, 0x0120, 0x065C, 0x075C, 0x0244, 0x3F90, 0x3FDC }, |
|---|
| 1088 | { 0x3FE8, 0x3F84, 0x01AC, 0x06E8, 0x06E8, 0x01AC, 0x3F84, 0x3FE8 }, |
|---|
| 1089 | { 0x3FDC, 0x3F90, 0x0244, 0x075C, 0x065C, 0x0120, 0x3F88, 0x3FF0 }, |
|---|
| 1090 | { 0x3FD0, 0x3FA4, 0x02F0, 0x07B0, 0x05BC, 0x00AC, 0x3F90, 0x3FF8 }, |
|---|
| 1091 | { 0x3FC0, 0x3FC8, 0x03A0, 0x07E4, 0x050C, 0x004C, 0x3FA0, 0x3FFC } |
|---|
| 1092 | } },{ { |
|---|
| 1093 | { 0x0000, 0x3FE4, 0x3F14, 0x0408, 0x0A04, 0x0408, 0x3F14, 0x3FE4 }, /* 8 to 5 */ |
|---|
| 1094 | { 0x0018, 0x3FC8, 0x3F38, 0x0518, 0x09D4, 0x02F8, 0x3F0C, 0x3FF8 }, |
|---|
| 1095 | { 0x0018, 0x3FA4, 0x3F80, 0x062C, 0x0978, 0x0204, 0x3F18, 0x0004 }, |
|---|
| 1096 | { 0x0018, 0x3F7C, 0x3FE8, 0x0734, 0x08E4, 0x012C, 0x3F34, 0x000C }, |
|---|
| 1097 | { 0x0014, 0x3F58, 0x0074, 0x0820, 0x0820, 0x0074, 0x3F58, 0x0014 }, |
|---|
| 1098 | { 0x000C, 0x3F34, 0x012C, 0x08E4, 0x0734, 0x3FE8, 0x3F7C, 0x0018 }, |
|---|
| 1099 | { 0x0004, 0x3F18, 0x0204, 0x0978, 0x062C, 0x3F80, 0x3FA4, 0x0018 }, |
|---|
| 1100 | { 0x3FF8, 0x3F0C, 0x02F8, 0x09D4, 0x0518, 0x3F38, 0x3FC8, 0x0018 } |
|---|
| 1101 | } },{ { |
|---|
| 1102 | { 0x0000, 0x0038, 0x3EB4, 0x0314, 0x0C00, 0x0314, 0x3EB4, 0x0038 }, /* 8 to 6 */ |
|---|
| 1103 | { 0x0008, 0x002C, 0x3E8C, 0x048C, 0x0BC8, 0x01C0, 0x3EF0, 0x0038 }, |
|---|
| 1104 | { 0x0010, 0x0018, 0x3E88, 0x0618, 0x0B2C, 0x009C, 0x3F38, 0x0034 }, |
|---|
| 1105 | { 0x0018, 0x3FF4, 0x3EB4, 0x079C, 0x0A3C, 0x3FBC, 0x3F80, 0x002C }, |
|---|
| 1106 | { 0x0020, 0x3FC0, 0x3F18, 0x0908, 0x0908, 0x3F18, 0x3FC0, 0x0020 }, |
|---|
| 1107 | { 0x002C, 0x3F80, 0x3FBC, 0x0A3C, 0x079C, 0x3EB4, 0x3FF4, 0x0018 }, |
|---|
| 1108 | { 0x0034, 0x3F38, 0x009C, 0x0B2C, 0x0618, 0x3E88, 0x0018, 0x0010 }, |
|---|
| 1109 | { 0x0038, 0x3EF0, 0x01C0, 0x0BC8, 0x048C, 0x3E8C, 0x002C, 0x0008 } |
|---|
| 1110 | } },{ { |
|---|
| 1111 | { 0x0000, 0x004C, 0x3F14, 0x01A8, 0x0DEC, 0x01A8, 0x3F14, 0x004C }, /* 8 to 7 */ |
|---|
| 1112 | { 0x3FE8, 0x0064, 0x3EA0, 0x0378, 0x0DB4, 0x002C, 0x3F88, 0x0030 }, |
|---|
| 1113 | { 0x3FEC, 0x0074, 0x3E3C, 0x0580, 0x0CD0, 0x3F14, 0x3FE8, 0x0018 }, |
|---|
| 1114 | { 0x3FF0, 0x0074, 0x3E04, 0x0798, 0x0B68, 0x3E60, 0x0030, 0x0004 }, |
|---|
| 1115 | { 0x3FFC, 0x0060, 0x3E08, 0x099C, 0x099C, 0x3E08, 0x0060, 0x3FFC }, |
|---|
| 1116 | { 0x0004, 0x0030, 0x3E60, 0x0B68, 0x0798, 0x3E04, 0x0074, 0x3FF0 }, |
|---|
| 1117 | { 0x0018, 0x3FE8, 0x3F14, 0x0CD0, 0x0580, 0x3E3C, 0x0074, 0x3FEC }, |
|---|
| 1118 | { 0x0030, 0x3F88, 0x002C, 0x0DB4, 0x0378, 0x3EA0, 0x0064, 0x3FE8 } |
|---|
| 1119 | } },{ { |
|---|
| 1120 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000 }, /* 8 to 8 */ |
|---|
| 1121 | { 0x3FF8, 0x0024, 0x3F6C, 0x01F8, 0x0F94, 0x3E94, 0x006C, 0x3FE8 }, |
|---|
| 1122 | { 0x3FEC, 0x0054, 0x3EC0, 0x0468, 0x0E50, 0x3DC0, 0x00AC, 0x3FDC }, |
|---|
| 1123 | { 0x3FE4, 0x0088, 0x3E1C, 0x071C, 0x0C50, 0x3D74, 0x00C0, 0x3FD8 }, |
|---|
| 1124 | { 0x3FDC, 0x00B0, 0x3DA0, 0x09D4, 0x09D4, 0x3DA0, 0x00B0, 0x3FDC }, |
|---|
| 1125 | { 0x3FD8, 0x00C0, 0x3D74, 0x0C50, 0x071C, 0x3E1C, 0x0088, 0x3FE4 }, |
|---|
| 1126 | { 0x3FDC, 0x00AC, 0x3DC0, 0x0E50, 0x0468, 0x3EC0, 0x0054, 0x3FEC }, |
|---|
| 1127 | { 0x3FE8, 0x006C, 0x3E94, 0x0F94, 0x01F8, 0x3F6C, 0x0024, 0x3FF8 } |
|---|
| 1128 | } },{ { |
|---|
| 1129 | { 0x0000, 0x3FB4, 0x00EC, 0x3E54, 0x1214, 0x3E54, 0x00EC, 0x3FB4 }, /* 8 to 9 */ |
|---|
| 1130 | { 0x0018, 0x3FC0, 0x0084, 0x0040, 0x1158, 0x3D40, 0x010C, 0x3FC0 }, |
|---|
| 1131 | { 0x0010, 0x3FE0, 0x3FD4, 0x02EC, 0x0F98, 0x3CF4, 0x00F4, 0x3FD0 }, |
|---|
| 1132 | { 0x0008, 0x0014, 0x3EF4, 0x0628, 0x0CE4, 0x3D48, 0x00B0, 0x3FE8 }, |
|---|
| 1133 | { 0x3FFC, 0x0060, 0x3E08, 0x099C, 0x099C, 0x3E08, 0x0060, 0x3FFC }, |
|---|
| 1134 | { 0x3FE8, 0x00B0, 0x3D48, 0x0CE4, 0x0628, 0x3EF4, 0x0014, 0x0008 }, |
|---|
| 1135 | { 0x3FD0, 0x00F4, 0x3CF4, 0x0F98, 0x02EC, 0x3FD4, 0x3FE0, 0x0010 }, |
|---|
| 1136 | { 0x3FC0, 0x010C, 0x3D40, 0x1158, 0x0040, 0x0084, 0x3FC0, 0x0018 } |
|---|
| 1137 | } },{ { |
|---|
| 1138 | { 0x0000, 0x0030, 0x3EE0, 0x0320, 0x0CE0, 0x01A0, 0x3F20, 0x0030 }, /* 1 to N */ |
|---|
| 1139 | { 0x0000, 0x0030, 0x3EA0, 0x04D0, 0x0C60, 0x0070, 0x3F70, 0x0020 }, |
|---|
| 1140 | { 0x0000, 0x0030, 0x3E80, 0x06A0, 0x0B60, 0x3F80, 0x3FB0, 0x0020 }, |
|---|
| 1141 | { 0x0010, 0x0010, 0x3E90, 0x0860, 0x0A10, 0x3EE0, 0x3FF0, 0x0010 }, |
|---|
| 1142 | { 0x0010, 0x3FF0, 0x3EE0, 0x0A10, 0x0860, 0x3E90, 0x0010, 0x0010 }, |
|---|
| 1143 | { 0x0020, 0x3FB0, 0x3F80, 0x0B60, 0x06A0, 0x3E80, 0x0030, 0x0000 }, |
|---|
| 1144 | { 0x0020, 0x3F70, 0x0070, 0x0C60, 0x04D0, 0x3EA0, 0x0030, 0x0000 }, |
|---|
| 1145 | { 0x0030, 0x3F20, 0x01A0, 0x0CE0, 0x0320, 0x3EE0, 0x0030, 0x0000 } |
|---|
| 1146 | } } |
|---|
| 1147 | #endif |
|---|
| 1148 | }; |
|---|
| 1149 | |
|---|
| 1150 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_Sharper = |
|---|
| 1151 | { |
|---|
| 1152 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1153 | { { 0x0000, 0x0000, 0x0100 }, { 0x0003,-0x0015, 0x0092 } } |
|---|
| 1154 | #else |
|---|
| 1155 | { |
|---|
| 1156 | { 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000 }, |
|---|
| 1157 | { 0x3FD0, 0x0060, 0x3F30, 0x0220, 0x0FC0, 0x3E60, 0x00B0, 0x3FB0 }, |
|---|
| 1158 | { 0x3FA0, 0x00D0, 0x3E50, 0x04B0, 0x0EA0, 0x3D50, 0x0130, 0x3F70 }, |
|---|
| 1159 | { 0x3F70, 0x0130, 0x3D80, 0x0780, 0x0CC0, 0x3CE0, 0x0170, 0x3F50 }, |
|---|
| 1160 | { 0x3F60, 0x0170, 0x3CF0, 0x0A40, 0x0A40, 0x3CF0, 0x0170, 0x3F60 }, |
|---|
| 1161 | { 0x3F50, 0x0170, 0x3CE0, 0x0CC0, 0x0780, 0x3D80, 0x0130, 0x3F70 }, |
|---|
| 1162 | { 0x3F70, 0x0130, 0x3D50, 0x0EA0, 0x04B0, 0x3E50, 0x00D0, 0x3FA0 }, |
|---|
| 1163 | { 0x3FB0, 0x00B0, 0x3E60, 0x0FC0, 0x0220, 0x3F30, 0x0060, 0x3FD0 } |
|---|
| 1164 | } |
|---|
| 1165 | #endif |
|---|
| 1166 | }; |
|---|
| 1167 | |
|---|
| 1168 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_Blurry = |
|---|
| 1169 | { |
|---|
| 1170 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1171 | { { 0x0000, 0x0055, 0x0056 }, { 0x0000, 0x002b, 0x0055 } } |
|---|
| 1172 | #else |
|---|
| 1173 | { |
|---|
| 1174 | { 0x0000, 0x0000, 0x0000, 0x0554, 0x0558, 0x0554, 0x0000, 0x0000 }, |
|---|
| 1175 | { 0x0000, 0x0000, 0x00AC, 0x0554, 0x0554, 0x04AC, 0x0000, 0x0000 }, |
|---|
| 1176 | { 0x0000, 0x0000, 0x0154, 0x0554, 0x0558, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1177 | { 0x0000, 0x0000, 0x0200, 0x0554, 0x0558, 0x0354, 0x0000, 0x0000 }, |
|---|
| 1178 | { 0x0000, 0x0000, 0x02AC, 0x0554, 0x0554, 0x02AC, 0x0000, 0x0000 }, |
|---|
| 1179 | { 0x0000, 0x0000, 0x0354, 0x0554, 0x0558, 0x0200, 0x0000, 0x0000 }, |
|---|
| 1180 | { 0x0000, 0x0000, 0x0400, 0x0554, 0x0558, 0x0154, 0x0000, 0x0000 }, |
|---|
| 1181 | { 0x0000, 0x0000, 0x04AC, 0x0554, 0x0554, 0x00AC, 0x0000, 0x0000 } |
|---|
| 1182 | } |
|---|
| 1183 | #endif |
|---|
| 1184 | }; |
|---|
| 1185 | |
|---|
| 1186 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_AntiFlutter = |
|---|
| 1187 | { |
|---|
| 1188 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1189 | { { 0x0000, 0x0040, 0x0080 }, { 0x0000, 0x0000, 0x0080 } } |
|---|
| 1190 | #else |
|---|
| 1191 | { |
|---|
| 1192 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1193 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1194 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1195 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1196 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1197 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1198 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 }, |
|---|
| 1199 | { 0x0000, 0x0000, 0x0000, 0x0400, 0x0800, 0x0400, 0x0000, 0x0000 } |
|---|
| 1200 | } |
|---|
| 1201 | #endif |
|---|
| 1202 | }; |
|---|
| 1203 | |
|---|
| 1204 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_AntiFlutterScale = |
|---|
| 1205 | { |
|---|
| 1206 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1207 | { { 0x0000, 0x0040, 0x0080 }, { 0x0000, 0x0018, 0x0068 } } |
|---|
| 1208 | #else |
|---|
| 1209 | { |
|---|
| 1210 | { 0x0000, 0x0000, 0x0030, 0x04C0, 0x07B0, 0x0360, 0x0000, 0x0000 }, |
|---|
| 1211 | { 0x0000, 0x0000, 0x0090, 0x0560, 0x0760, 0x02B0, 0x0000, 0x0000 }, |
|---|
| 1212 | { 0x0000, 0x0000, 0x00F0, 0x0600, 0x0710, 0x0200, 0x0000, 0x0000 }, |
|---|
| 1213 | { 0x0000, 0x0000, 0x0178, 0x0688, 0x0688, 0x0170, 0x0000, 0x0000 }, |
|---|
| 1214 | { 0x0000, 0x0000, 0x0200, 0x0710, 0x0600, 0x00F0, 0x0000, 0x0000 }, |
|---|
| 1215 | { 0x0000, 0x0000, 0x02B0, 0x0760, 0x0560, 0x0090, 0x0000, 0x0000 }, |
|---|
| 1216 | { 0x0000, 0x0000, 0x0360, 0x07B0, 0x04C0, 0x0030, 0x0000, 0x0000 }, |
|---|
| 1217 | { 0x0000, 0x0000, 0x01C8, 0x0638, 0x0638, 0x01C8, 0x0000, 0x0000 } |
|---|
| 1218 | } |
|---|
| 1219 | #endif |
|---|
| 1220 | }; |
|---|
| 1221 | |
|---|
| 1222 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_AntiFlutterBlurry = |
|---|
| 1223 | { |
|---|
| 1224 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1225 | { { 0x0000, 0x0050, 0x0060 }, { 0x0000, 0x0020, 0x0060 } } |
|---|
| 1226 | #else |
|---|
| 1227 | { |
|---|
| 1228 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1229 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1230 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1231 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1232 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1233 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1234 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 }, |
|---|
| 1235 | { 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0000, 0x0000 } |
|---|
| 1236 | } |
|---|
| 1237 | #endif |
|---|
| 1238 | }; |
|---|
| 1239 | |
|---|
| 1240 | static BM2MC_PACKET_FilterCoeffs s_BGRC_PACKET_P_DeviceFilter_AntiFlutterSharp = |
|---|
| 1241 | { |
|---|
| 1242 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 1243 | { { 0x0000, 0x0028, 0x00b0 }, { 0x0000, 0x0000, 0x0080 } } |
|---|
| 1244 | #else |
|---|
| 1245 | { |
|---|
| 1246 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1247 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1248 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1249 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1250 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1251 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1252 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 }, |
|---|
| 1253 | { 0x0000, 0x0000, 0x0000, 0x0280, 0x0B00, 0x0280, 0x0000, 0x0000 } |
|---|
| 1254 | } |
|---|
| 1255 | #endif |
|---|
| 1256 | }; |
|---|
| 1257 | |
|---|
| 1258 | /***************************************************************************/ |
|---|
| 1259 | void BGRC_PACKET_P_Isr( |
|---|
| 1260 | void *pvParam1, |
|---|
| 1261 | int iParam2 ) |
|---|
| 1262 | { |
|---|
| 1263 | BGRC_Handle hGrc = (BGRC_Handle) pvParam1; |
|---|
| 1264 | BGRC_PacketContext_Handle hContext = (BGRC_PacketContext_Handle) iParam2; |
|---|
| 1265 | |
|---|
| 1266 | if( hGrc == 0 ) |
|---|
| 1267 | return; |
|---|
| 1268 | |
|---|
| 1269 | /* handle main grc interrupt */ |
|---|
| 1270 | if( hContext == 0 ) |
|---|
| 1271 | { |
|---|
| 1272 | hGrc->advance_interrupt = false; |
|---|
| 1273 | if( hGrc->callback_isr ) |
|---|
| 1274 | (*hGrc->callback_isr)( hGrc, hGrc->callback_data ); |
|---|
| 1275 | return; |
|---|
| 1276 | } |
|---|
| 1277 | else if( hGrc->callback_isr ) |
|---|
| 1278 | { |
|---|
| 1279 | return; |
|---|
| 1280 | } |
|---|
| 1281 | |
|---|
| 1282 | /* handle context advance interrupt */ |
|---|
| 1283 | if( hGrc->advance_interrupt || hContext->advance_interrupt ) |
|---|
| 1284 | { |
|---|
| 1285 | hGrc->advance_interrupt = false; |
|---|
| 1286 | if( hContext->advance_interrupt ) |
|---|
| 1287 | { |
|---|
| 1288 | hContext->advance_interrupt = false; |
|---|
| 1289 | if( hContext->advance_wait ) |
|---|
| 1290 | { |
|---|
| 1291 | BKNI_SetEvent( hContext->advance_event ); |
|---|
| 1292 | } |
|---|
| 1293 | else if( hContext->buffer_submit_size ) |
|---|
| 1294 | { |
|---|
| 1295 | if( hContext->advance_callback_isr ) |
|---|
| 1296 | (*hContext->advance_callback_isr)( hGrc, hContext->advance_callback_data ); |
|---|
| 1297 | } |
|---|
| 1298 | } |
|---|
| 1299 | } |
|---|
| 1300 | |
|---|
| 1301 | /* handle context sync interrupt */ |
|---|
| 1302 | if( hContext->sync_interrupt ) |
|---|
| 1303 | { |
|---|
| 1304 | if( hContext->sync_output_addr[0] ) |
|---|
| 1305 | { |
|---|
| 1306 | hContext->sync_interrupt = false; |
|---|
| 1307 | if( hContext->sync_wait ) |
|---|
| 1308 | { |
|---|
| 1309 | BKNI_SetEvent( hContext->sync_event ); |
|---|
| 1310 | } |
|---|
| 1311 | else |
|---|
| 1312 | { |
|---|
| 1313 | if( hContext->sync_callback_isr ) |
|---|
| 1314 | (*hContext->sync_callback_isr)( hGrc, hContext->sync_callback_data ); |
|---|
| 1315 | } |
|---|
| 1316 | } |
|---|
| 1317 | } |
|---|
| 1318 | } |
|---|
| 1319 | |
|---|
| 1320 | /***************************************************************************/ |
|---|
| 1321 | #define BGRC_PACKET_P_OUT_OF_FIFO_MEMORY( alloc_offset, m2mc_offset ) \ |
|---|
| 1322 | (((alloc_offset) <= (m2mc_offset)) && ((alloc_offset) + BGRC_PACKET_P_BLIT_GROUP_SIZE_MAX > (m2mc_offset))) |
|---|
| 1323 | |
|---|
| 1324 | #define BGRC_PACKET_P_ALIGN_MEMORY( addr ) \ |
|---|
| 1325 | (((uint32_t) (addr) + BGRC_PACKET_P_MEMORY_ALIGN_MASK) & (~BGRC_PACKET_P_MEMORY_ALIGN_MASK)) |
|---|
| 1326 | |
|---|
| 1327 | /***************************************************************************/ |
|---|
| 1328 | static bool BGRC_PACKET_P_AvailableFifoMemory( |
|---|
| 1329 | BGRC_Handle hGrc, |
|---|
| 1330 | BGRC_PacketContext_Handle hContext ) |
|---|
| 1331 | { |
|---|
| 1332 | /* align memory */ |
|---|
| 1333 | hGrc->curr_fifo_addr = (uint32_t *) BGRC_PACKET_P_ALIGN_MEMORY(hGrc->curr_fifo_addr); |
|---|
| 1334 | hGrc->curr_fifo_offset = BGRC_PACKET_P_ALIGN_MEMORY(hGrc->curr_fifo_offset); |
|---|
| 1335 | |
|---|
| 1336 | /* check if memory is available */ |
|---|
| 1337 | if( BGRC_PACKET_P_OUT_OF_FIFO_MEMORY(hGrc->curr_fifo_offset, hContext->m2mc_offset) ) |
|---|
| 1338 | { |
|---|
| 1339 | hContext->m2mc_offset = BGRC_P_ReadReg32( hGrc->hRegister, LIST_CURR_PKT_ADDR ); |
|---|
| 1340 | if( BGRC_PACKET_P_OUT_OF_FIFO_MEMORY(hGrc->curr_fifo_offset, hContext->m2mc_offset) ) |
|---|
| 1341 | return false; |
|---|
| 1342 | } |
|---|
| 1343 | |
|---|
| 1344 | /* check if fifo memory is reaching the end */ |
|---|
| 1345 | if( hGrc->curr_fifo_offset + BGRC_PACKET_P_BLIT_GROUP_SIZE_MAX > hGrc->fifo_base_offset + hGrc->fifo_total_size ) |
|---|
| 1346 | { |
|---|
| 1347 | /* check if m2mc has been done a blit before */ |
|---|
| 1348 | if( hContext->m2mc_offset == 0 ) |
|---|
| 1349 | return false; |
|---|
| 1350 | |
|---|
| 1351 | /* check again if memory can be wrapped */ |
|---|
| 1352 | if( BGRC_PACKET_P_OUT_OF_FIFO_MEMORY(hGrc->fifo_base_offset, hContext->m2mc_offset) ) |
|---|
| 1353 | { |
|---|
| 1354 | hContext->m2mc_offset = BGRC_P_ReadReg32( hGrc->hRegister, LIST_CURR_PKT_ADDR ); |
|---|
| 1355 | if( BGRC_PACKET_P_OUT_OF_FIFO_MEMORY(hGrc->fifo_base_offset, hContext->m2mc_offset) ) |
|---|
| 1356 | return false; |
|---|
| 1357 | } |
|---|
| 1358 | |
|---|
| 1359 | /* reset to base */ |
|---|
| 1360 | hGrc->end_flush_addr = hGrc->curr_fifo_addr; |
|---|
| 1361 | hGrc->curr_fifo_addr = hGrc->fifo_base_addr; |
|---|
| 1362 | hGrc->curr_fifo_offset = hGrc->fifo_base_offset; |
|---|
| 1363 | } |
|---|
| 1364 | |
|---|
| 1365 | return true; |
|---|
| 1366 | } |
|---|
| 1367 | |
|---|
| 1368 | /***************************************************************************/ |
|---|
| 1369 | static void BGRC_PACKET_P_FlushFifoMemory( BGRC_Handle hGrc ) |
|---|
| 1370 | { |
|---|
| 1371 | if( hGrc->curr_fifo_addr > hGrc->start_flush_addr ) |
|---|
| 1372 | { |
|---|
| 1373 | /* flush unwrapped memory */ |
|---|
| 1374 | int flush_size = (uint8_t *) hGrc->curr_fifo_addr - (uint8_t *) hGrc->start_flush_addr; |
|---|
| 1375 | BMEM_FlushCache( hGrc->hMemory, hGrc->start_flush_addr, flush_size ); |
|---|
| 1376 | } |
|---|
| 1377 | else if( hGrc->curr_fifo_addr < hGrc->start_flush_addr ) |
|---|
| 1378 | { |
|---|
| 1379 | /* flush wrapped memory */ |
|---|
| 1380 | int flush_size = (uint8_t *) hGrc->end_flush_addr - (uint8_t *) hGrc->start_flush_addr; |
|---|
| 1381 | BMEM_FlushCache( hGrc->hMemory, hGrc->start_flush_addr, flush_size ); |
|---|
| 1382 | |
|---|
| 1383 | flush_size = (uint8_t *) hGrc->start_flush_addr - (uint8_t *) hGrc->fifo_cached_addr; |
|---|
| 1384 | BMEM_FlushCache( hGrc->hMemory, hGrc->fifo_cached_addr, flush_size ); |
|---|
| 1385 | } |
|---|
| 1386 | } |
|---|
| 1387 | |
|---|
| 1388 | /***************************************************************************/ |
|---|
| 1389 | static void BGRC_PACKET_P_WriteFifoMemory( |
|---|
| 1390 | BGRC_Handle hGrc, |
|---|
| 1391 | BGRC_PacketContext_Handle hContext, |
|---|
| 1392 | uint32_t group_header ) |
|---|
| 1393 | { |
|---|
| 1394 | uint32_t *curr_fifo_addr = hGrc->curr_fifo_addr; |
|---|
| 1395 | uint32_t curr_fifo_offset = hGrc->curr_fifo_offset; |
|---|
| 1396 | |
|---|
| 1397 | int groups = sizeof s_BGRC_PACKET_P_DeviceGroupSizes / sizeof (uint32_t); |
|---|
| 1398 | int ii, jj; |
|---|
| 1399 | |
|---|
| 1400 | /* store context's last fifo offset used */ |
|---|
| 1401 | hContext->last_fifo_offset = hGrc->curr_fifo_offset; |
|---|
| 1402 | |
|---|
| 1403 | /* write group header */ |
|---|
| 1404 | BGRC_PACKET_P_DEBUG_PRINT( "** REGISTERS " ); |
|---|
| 1405 | BGRC_PACKET_P_WRITE_DATA( *hGrc->curr_fifo_addr++, BCHP_M2MC_LIST_PACKET_HEADER_0_LAST_PKT_IND_MASK ); |
|---|
| 1406 | BGRC_PACKET_P_WRITE_DATA( *hGrc->curr_fifo_addr++, group_header ); |
|---|
| 1407 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1408 | hGrc->curr_fifo_offset += 2 * sizeof (uint32_t); |
|---|
| 1409 | |
|---|
| 1410 | /* write groups */ |
|---|
| 1411 | for( ii = groups - 1; ii >= 0; --ii ) |
|---|
| 1412 | { |
|---|
| 1413 | uint32_t group_mask = group_header & (1 << ii); |
|---|
| 1414 | if( group_mask ) |
|---|
| 1415 | { |
|---|
| 1416 | int count = s_BGRC_PACKET_P_DeviceGroupSizes[ii] / sizeof (uint32_t); |
|---|
| 1417 | int index = s_BGRC_PACKET_P_DeviceRegisterOffsets[ii] / sizeof (uint32_t); |
|---|
| 1418 | |
|---|
| 1419 | /* store last blit header to possibly set interrupt later */ |
|---|
| 1420 | if( group_mask & BGRC_M2MC(LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK) ) |
|---|
| 1421 | { |
|---|
| 1422 | hContext->last_blitheader_addr = hGrc->curr_fifo_addr; |
|---|
| 1423 | hContext->last_blitheader = BGRC_PACKET_P_GET_REG_FROM_INDEX(index); |
|---|
| 1424 | } |
|---|
| 1425 | |
|---|
| 1426 | /* write group registers */ |
|---|
| 1427 | BGRC_PACKET_P_DEBUG_PRINT( "** " ); |
|---|
| 1428 | for( jj = 0; jj < count; ++jj ) |
|---|
| 1429 | BGRC_PACKET_P_WRITE_REG( *hGrc->curr_fifo_addr++, index + jj ); |
|---|
| 1430 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1431 | |
|---|
| 1432 | hGrc->curr_fifo_offset += count * sizeof (uint32_t); |
|---|
| 1433 | } |
|---|
| 1434 | } |
|---|
| 1435 | |
|---|
| 1436 | /* write previous group's next offset */ |
|---|
| 1437 | if( hGrc->prev_fifo_addr ) |
|---|
| 1438 | { |
|---|
| 1439 | BGRC_PACKET_P_DEBUG_PRINT( "-- NEXT " ); |
|---|
| 1440 | BGRC_PACKET_P_WRITE_DATA( *hGrc->prev_fifo_addr, curr_fifo_offset ); |
|---|
| 1441 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1442 | } |
|---|
| 1443 | hGrc->prev_fifo_addr = curr_fifo_addr; |
|---|
| 1444 | } |
|---|
| 1445 | |
|---|
| 1446 | /***************************************************************************/ |
|---|
| 1447 | static void BGRC_PACKET_P_InitiateBlits( |
|---|
| 1448 | BGRC_Handle hGrc, |
|---|
| 1449 | BGRC_PacketContext_Handle hContext, |
|---|
| 1450 | uint32_t *fifo_addr, |
|---|
| 1451 | uint32_t fifo_offset, |
|---|
| 1452 | bool advance_interrupt, |
|---|
| 1453 | bool sync_interrupt ) |
|---|
| 1454 | { |
|---|
| 1455 | hContext->advance_interrupt = hContext->advance_interrupt || advance_interrupt; |
|---|
| 1456 | |
|---|
| 1457 | /* prepare for advance interrupt */ |
|---|
| 1458 | advance_interrupt = advance_interrupt && (!hGrc->advance_interrupt); |
|---|
| 1459 | if( advance_interrupt ) |
|---|
| 1460 | { |
|---|
| 1461 | /* reset advance event */ |
|---|
| 1462 | if( BGRC_PACKET_P_USING_EVENT(hContext, advance) ) |
|---|
| 1463 | { |
|---|
| 1464 | if( !hGrc->advance_interrupt ) |
|---|
| 1465 | BKNI_ResetEvent( hContext->advance_event ); |
|---|
| 1466 | hContext->advance_wait = true; |
|---|
| 1467 | } |
|---|
| 1468 | hGrc->advance_interrupt = true; |
|---|
| 1469 | |
|---|
| 1470 | /* enable blitheader interrupt field */ |
|---|
| 1471 | if( hContext->last_blitheader_addr ) |
|---|
| 1472 | BGRC_PACKET_P_WRITE_DATA( *hContext->last_blitheader_addr, hContext->last_blitheader | BGRC_M2MC(BLIT_HEADER_INTERRUPT_ENABLE_MASK) ); |
|---|
| 1473 | } |
|---|
| 1474 | |
|---|
| 1475 | /* prepare for sync interrupt */ |
|---|
| 1476 | if( sync_interrupt ) |
|---|
| 1477 | { |
|---|
| 1478 | /* reset sync event */ |
|---|
| 1479 | if( BGRC_PACKET_P_USING_EVENT(hContext, sync) ) |
|---|
| 1480 | { |
|---|
| 1481 | BKNI_ResetEvent( hContext->sync_event ); |
|---|
| 1482 | hContext->sync_wait = true; |
|---|
| 1483 | } |
|---|
| 1484 | hContext->sync_interrupt = true; |
|---|
| 1485 | } |
|---|
| 1486 | |
|---|
| 1487 | /* flush memory */ |
|---|
| 1488 | if( hGrc->fifo_base_addr == hGrc->fifo_cached_addr ) |
|---|
| 1489 | { |
|---|
| 1490 | hGrc->start_flush_addr = fifo_addr; |
|---|
| 1491 | BGRC_PACKET_P_FlushFifoMemory( hGrc ); |
|---|
| 1492 | } |
|---|
| 1493 | |
|---|
| 1494 | /* init blits */ |
|---|
| 1495 | if( hGrc->last_fifo_addr ) |
|---|
| 1496 | { |
|---|
| 1497 | /* write next offset from previous blits */ |
|---|
| 1498 | BGRC_PACKET_P_DEBUG_PRINT( "** NEXT " ); |
|---|
| 1499 | BGRC_PACKET_P_WRITE_DATA( *hGrc->last_fifo_addr, fifo_offset ); |
|---|
| 1500 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1501 | |
|---|
| 1502 | /* flush next offset from previous blits */ |
|---|
| 1503 | if( hGrc->fifo_base_addr == hGrc->fifo_cached_addr ) |
|---|
| 1504 | BMEM_FlushCache( hGrc->hMemory, hGrc->last_fifo_addr, sizeof (uint32_t) ); |
|---|
| 1505 | |
|---|
| 1506 | BGRC_P_WriteReg32( hGrc->hRegister, LIST_CTRL, |
|---|
| 1507 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, WAKE, WakeUp ) | |
|---|
| 1508 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, RUN, Run ) | |
|---|
| 1509 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, WAKE_MODE, ResumeFromLast ) ); |
|---|
| 1510 | } |
|---|
| 1511 | else |
|---|
| 1512 | { |
|---|
| 1513 | BGRC_P_WriteReg32( hGrc->hRegister, LIST_FIRST_PKT_ADDR, fifo_offset ); |
|---|
| 1514 | BGRC_P_WriteReg32( hGrc->hRegister, LIST_CTRL, |
|---|
| 1515 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, WAKE, Ack ) | |
|---|
| 1516 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, RUN, Run ) | |
|---|
| 1517 | BCHP_FIELD_ENUM( M2MC_LIST_CTRL, WAKE_MODE, ResumeFromFirst ) ); |
|---|
| 1518 | } |
|---|
| 1519 | |
|---|
| 1520 | hGrc->last_fifo_addr = hGrc->prev_fifo_addr; |
|---|
| 1521 | hGrc->prev_fifo_addr = 0; |
|---|
| 1522 | } |
|---|
| 1523 | |
|---|
| 1524 | /***************************************************************************/ |
|---|
| 1525 | #if defined(BCHP_M2MC_SRC_SURFACE_0_FORMAT_DEF_3_RANGE_EXP_MAP_SCALE_FACTOR_C_SHIFT) |
|---|
| 1526 | #define BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3 ( \ |
|---|
| 1527 | (8L << BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_3_RANGE_EXP_MAP_SCALE_FACTOR_C_SHIFT)) | \ |
|---|
| 1528 | (8L << BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_3_RANGE_EXP_MAP_SCALE_FACTOR_Y_SHIFT)) | \ |
|---|
| 1529 | BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_3_PALETTE_BYPASS_DONT_LOOKUP)) |
|---|
| 1530 | #elif defined(BGRC_M2MC_SRC_SURFACE_0_FORMAT_DEF_3_PALETTE_BYPASS_DONT_LOOKUP) |
|---|
| 1531 | #define BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3 \ |
|---|
| 1532 | BCHP_M2MC_SRC_SURFACE_0_FORMAT_DEF_3_PALETTE_BYPASS_DONT_LOOKUP |
|---|
| 1533 | #else |
|---|
| 1534 | #define BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3 0 |
|---|
| 1535 | #endif |
|---|
| 1536 | |
|---|
| 1537 | #define BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ( \ |
|---|
| 1538 | BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_3_ZERO_PAD_MASK) | BGRC_M2MC(SRC_SURFACE_FORMAT_DEF_3_CHROMA_FILTER_MASK)) |
|---|
| 1539 | #define BGRC_PACKET_P_DEST_SURFACE_FORMAT_DEF_3_MASK ( \ |
|---|
| 1540 | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_ZERO_PAD_MASK) | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_CHROMA_FILTER_MASK)) |
|---|
| 1541 | #define BGRC_PACKET_P_OUTPUT_SURFACE_FORMAT_DEF_3_MASK ( \ |
|---|
| 1542 | BGRC_M2MC(OUTPUT_SURFACE_FORMAT_DEF_3_DITHER_ENABLE_MASK) | BGRC_M2MC(OUTPUT_SURFACE_FORMAT_DEF_3_CHROMA_FILTER_MASK)) |
|---|
| 1543 | |
|---|
| 1544 | #define BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS( sur ) ( \ |
|---|
| 1545 | BGRC_M2MC(sur##_FORMAT_DEF_3_CH0_DISABLE_MASK) | BGRC_M2MC(sur##_FORMAT_DEF_3_CH1_DISABLE_MASK) | \ |
|---|
| 1546 | BGRC_M2MC(sur##_FORMAT_DEF_3_CH2_DISABLE_MASK) | BGRC_M2MC(sur##_FORMAT_DEF_3_CH3_DISABLE_MASK)) |
|---|
| 1547 | |
|---|
| 1548 | /***************************************************************************/ |
|---|
| 1549 | static void BGRC_PACKET_P_SubmitSourceFeederPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1550 | { |
|---|
| 1551 | BM2MC_PACKET_PacketSourceFeeder *packet = (BM2MC_PACKET_PacketSourceFeeder *) header; |
|---|
| 1552 | uint32_t format00 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][0]; |
|---|
| 1553 | uint32_t format01 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][1]; |
|---|
| 1554 | uint32_t format02 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][2] | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1555 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1556 | uint32_t format12 = BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS(SRC_SURFACE) | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1557 | #endif |
|---|
| 1558 | uint32_t palette_lookup = 0; |
|---|
| 1559 | |
|---|
| 1560 | hContext->src_format0 = format00; |
|---|
| 1561 | if( (hContext->src_format0 & M2MC_FT_Palette) == M2MC_FT_Palette ) |
|---|
| 1562 | { |
|---|
| 1563 | if( (hContext->out_format0 & M2MC_FT_Palette) == M2MC_FT_Palette ) |
|---|
| 1564 | format00 &= M2MC_CHANNEL_MASK; |
|---|
| 1565 | else |
|---|
| 1566 | palette_lookup = BCHP_M2MC_SRC_SURFACE_FORMAT_DEF_3_PALETTE_BYPASS_MASK; |
|---|
| 1567 | } |
|---|
| 1568 | |
|---|
| 1569 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcFeeder " ); |
|---|
| 1570 | BGRC_PACKET_P_STORE_REG( SRC_FEEDER_ENABLE, packet->plane.address ? 1 : 0 ); |
|---|
| 1571 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, packet->plane.address ); |
|---|
| 1572 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_0, packet->plane.pitch ); |
|---|
| 1573 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_1, 0 ); |
|---|
| 1574 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_1, 0 ); |
|---|
| 1575 | |
|---|
| 1576 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, format00 ); |
|---|
| 1577 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_2, format01 ); |
|---|
| 1578 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_FORMAT_DEF_3, format02 | palette_lookup, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1579 | |
|---|
| 1580 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1581 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_1, 0 ); |
|---|
| 1582 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_2, 0 ); |
|---|
| 1583 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_1_FORMAT_DEF_3, format12, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1584 | #endif |
|---|
| 1585 | |
|---|
| 1586 | BGRC_PACKET_P_STORE_REG( SRC_W_ALPHA, packet->color >> 24 ); |
|---|
| 1587 | BGRC_PACKET_P_STORE_REG( SRC_CONSTANT_COLOR, packet->color ); |
|---|
| 1588 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1589 | |
|---|
| 1590 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 1591 | hContext->SRC_surface_width = packet->plane.width; |
|---|
| 1592 | hContext->SRC_surface_height = packet->plane.height; |
|---|
| 1593 | hContext->SRC_surface_format = packet->plane.format; |
|---|
| 1594 | #endif |
|---|
| 1595 | } |
|---|
| 1596 | |
|---|
| 1597 | /***************************************************************************/ |
|---|
| 1598 | static void BGRC_PACKET_P_SubmitSourceFeedersPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1599 | { |
|---|
| 1600 | BM2MC_PACKET_PacketSourceFeeders *packet = (BM2MC_PACKET_PacketSourceFeeders *) header; |
|---|
| 1601 | uint32_t format01 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane0.format][1]; |
|---|
| 1602 | uint32_t format02 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane0.format][2] | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1603 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1604 | uint32_t format10 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane1.format][0]; |
|---|
| 1605 | uint32_t format11 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane1.format][1]; |
|---|
| 1606 | uint32_t format12 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane1.format][2] | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1607 | #endif |
|---|
| 1608 | hContext->src_format0 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane0.format][0]; |
|---|
| 1609 | |
|---|
| 1610 | #ifdef BCHP_M2MC_SRC_SURFACE_0_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK |
|---|
| 1611 | if( hContext->linear_destripe ) |
|---|
| 1612 | { |
|---|
| 1613 | hContext->src_format0 &= ~BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK); |
|---|
| 1614 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1615 | format10 &= ~BGRC_M2MC(SRC_SURFACE_0_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK); |
|---|
| 1616 | #endif |
|---|
| 1617 | } |
|---|
| 1618 | #endif |
|---|
| 1619 | |
|---|
| 1620 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcFeeders " ); |
|---|
| 1621 | BGRC_PACKET_P_STORE_REG( SRC_FEEDER_ENABLE, packet->plane0.address ? 1 : 0 ); |
|---|
| 1622 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, packet->plane0.address ); |
|---|
| 1623 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_0, packet->plane0.pitch ); |
|---|
| 1624 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_1, packet->plane1.address ); |
|---|
| 1625 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_1, packet->plane1.pitch ); |
|---|
| 1626 | |
|---|
| 1627 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, hContext->src_format0 ); |
|---|
| 1628 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_2, format01 ); |
|---|
| 1629 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_FORMAT_DEF_3, format02, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1630 | |
|---|
| 1631 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1632 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_1, format10 ); |
|---|
| 1633 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_2, format11 ); |
|---|
| 1634 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_1_FORMAT_DEF_3, format12, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1635 | #endif |
|---|
| 1636 | |
|---|
| 1637 | BGRC_PACKET_P_STORE_REG( SRC_W_ALPHA, packet->color >> 24 ); |
|---|
| 1638 | BGRC_PACKET_P_STORE_REG( SRC_CONSTANT_COLOR, packet->color ); |
|---|
| 1639 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1640 | |
|---|
| 1641 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 1642 | hContext->SRC_surface_width = packet->plane0.width; |
|---|
| 1643 | hContext->SRC_surface_height = packet->plane0.height; |
|---|
| 1644 | hContext->SRC_surface_format = packet->plane0.format; |
|---|
| 1645 | #endif |
|---|
| 1646 | } |
|---|
| 1647 | |
|---|
| 1648 | /***************************************************************************/ |
|---|
| 1649 | #if (BCHP_CHIP==7422) || (BCHP_CHIP==7425) || (BCHP_CHIP==7435) || (BCHP_CHIP==7344) || (BCHP_CHIP==7346) || (BCHP_CHIP==7429) || \ |
|---|
| 1650 | (BCHP_CHIP==7231) || (BCHP_CHIP==7358) || (BCHP_CHIP==7360) || (BCHP_CHIP==7552) || (BCHP_CHIP==35233) |
|---|
| 1651 | #define BGRC_PACKET_P_SRC_FEEDER_ENABLE_DISABLE 1 |
|---|
| 1652 | #define BGRC_PACKET_P_SRC_SURFACE_ADDR_0 hContext->sync_output_offset |
|---|
| 1653 | #define BGRC_PACKET_P_SURFACE_FORMAT_DEF_1_DISABLE s_BGRC_PACKET_P_DevicePixelFormats[BM2MC_PACKET_PixelFormat_eA1][0] |
|---|
| 1654 | #define BGRC_PACKET_P_SURFACE_FORMAT_DEF_2_DISABLE s_BGRC_PACKET_P_DevicePixelFormats[BM2MC_PACKET_PixelFormat_eA1][1] |
|---|
| 1655 | #else |
|---|
| 1656 | #define BGRC_PACKET_P_SRC_FEEDER_ENABLE_DISABLE 0 |
|---|
| 1657 | #define BGRC_PACKET_P_SRC_SURFACE_ADDR_0 0 |
|---|
| 1658 | #define BGRC_PACKET_P_SURFACE_FORMAT_DEF_1_DISABLE 0 |
|---|
| 1659 | #define BGRC_PACKET_P_SURFACE_FORMAT_DEF_2_DISABLE 0 |
|---|
| 1660 | #endif |
|---|
| 1661 | /***************************************************************************/ |
|---|
| 1662 | static void BGRC_PACKET_P_SubmitSourceColorPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1663 | { |
|---|
| 1664 | BM2MC_PACKET_PacketSourceColor *packet = (BM2MC_PACKET_PacketSourceColor *) header; |
|---|
| 1665 | uint32_t format2 = BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS(SRC_SURFACE) | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1666 | hContext->src_format0 = 0; |
|---|
| 1667 | |
|---|
| 1668 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcColor " ); |
|---|
| 1669 | BGRC_PACKET_P_STORE_REG( SRC_FEEDER_ENABLE, 1 ); |
|---|
| 1670 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, BGRC_PACKET_P_SRC_SURFACE_ADDR_0 ); |
|---|
| 1671 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_0, 0 ); |
|---|
| 1672 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_1, 0 ); |
|---|
| 1673 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_1, 0 ); |
|---|
| 1674 | |
|---|
| 1675 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, BGRC_PACKET_P_SURFACE_FORMAT_DEF_1_DISABLE ); |
|---|
| 1676 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_2, BGRC_PACKET_P_SURFACE_FORMAT_DEF_2_DISABLE ); |
|---|
| 1677 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_FORMAT_DEF_3, format2, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1678 | |
|---|
| 1679 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1680 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_1, 0 ); |
|---|
| 1681 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_2, 0 ); |
|---|
| 1682 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_1_FORMAT_DEF_3, format2, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1683 | #endif |
|---|
| 1684 | |
|---|
| 1685 | BGRC_PACKET_P_STORE_REG( SRC_W_ALPHA, packet->color >> 24 ); |
|---|
| 1686 | BGRC_PACKET_P_STORE_REG( SRC_CONSTANT_COLOR, packet->color ); |
|---|
| 1687 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1688 | } |
|---|
| 1689 | |
|---|
| 1690 | /***************************************************************************/ |
|---|
| 1691 | static void BGRC_PACKET_P_SubmitSourceNonePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1692 | { |
|---|
| 1693 | uint32_t format2 = BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS(SRC_SURFACE) | BGRC_PACKET_P_DEFAULT_SOURCE_SURFACE_FORMAT_DEF_3; |
|---|
| 1694 | hContext->src_format0 = 0; |
|---|
| 1695 | BSTD_UNUSED(header); |
|---|
| 1696 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcNone " ); |
|---|
| 1697 | BGRC_PACKET_P_STORE_REG( SRC_FEEDER_ENABLE, BGRC_PACKET_P_SRC_FEEDER_ENABLE_DISABLE ); |
|---|
| 1698 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, BGRC_PACKET_P_SRC_SURFACE_ADDR_0 ); |
|---|
| 1699 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_0, 0 ); |
|---|
| 1700 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_1, 0 ); |
|---|
| 1701 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_STRIDE_1, 0 ); |
|---|
| 1702 | |
|---|
| 1703 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, BGRC_PACKET_P_SURFACE_FORMAT_DEF_1_DISABLE ); |
|---|
| 1704 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_2, BGRC_PACKET_P_SURFACE_FORMAT_DEF_2_DISABLE ); |
|---|
| 1705 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_FORMAT_DEF_3, format2, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1706 | |
|---|
| 1707 | #if defined(BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1) |
|---|
| 1708 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_1, 0 ); |
|---|
| 1709 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_1_FORMAT_DEF_2, 0 ); |
|---|
| 1710 | BGRC_PACKET_P_STORE_REG_MASK( SRC_SURFACE_1_FORMAT_DEF_3, format2, BGRC_PACKET_P_SRC_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1711 | #endif |
|---|
| 1712 | |
|---|
| 1713 | BGRC_PACKET_P_STORE_REG( SRC_W_ALPHA, 0 ); |
|---|
| 1714 | BGRC_PACKET_P_STORE_REG( SRC_CONSTANT_COLOR, 0 ); |
|---|
| 1715 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1716 | } |
|---|
| 1717 | |
|---|
| 1718 | /***************************************************************************/ |
|---|
| 1719 | static void BGRC_PACKET_P_SubmitSourceControlPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1720 | { |
|---|
| 1721 | BM2MC_PACKET_PacketSourceControl *packet = (BM2MC_PACKET_PacketSourceControl *) header; |
|---|
| 1722 | |
|---|
| 1723 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcControl " ); |
|---|
| 1724 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SRC_SURFACE_FORMAT_DEF_3, ZERO_PAD, REPLICATE, ZERO_PAD, packet->zero_pad ); |
|---|
| 1725 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SRC_SURFACE_FORMAT_DEF_3, CHROMA_FILTER, REPLICATE, FILTER, packet->chroma_filter ); |
|---|
| 1726 | |
|---|
| 1727 | #ifdef BCHP_M2MC_SRC_SURFACE_1_FORMAT_DEF_1_STRIPED_IMAGE_FORMAT_MASK |
|---|
| 1728 | BGRC_PACKET_P_STORE_REG_FIELD_DATA( SRC_SURFACE_0_FORMAT_DEF_1, STRIPED_IMAGE_FORMAT, packet->linear_destripe ? 0 : 1 ); |
|---|
| 1729 | BGRC_PACKET_P_STORE_REG_FIELD_DATA( SRC_SURFACE_1_FORMAT_DEF_1, STRIPED_IMAGE_FORMAT, packet->linear_destripe ? 0 : 1 ); |
|---|
| 1730 | #endif |
|---|
| 1731 | hContext->linear_destripe = packet->linear_destripe; |
|---|
| 1732 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1733 | } |
|---|
| 1734 | |
|---|
| 1735 | /***************************************************************************/ |
|---|
| 1736 | static void BGRC_PACKET_P_SubmitDestinationFeederPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1737 | { |
|---|
| 1738 | BM2MC_PACKET_PacketDestinationFeeder *packet = (BM2MC_PACKET_PacketDestinationFeeder *) header; |
|---|
| 1739 | uint32_t format2 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][2]; |
|---|
| 1740 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstFeeder " ); |
|---|
| 1741 | BGRC_PACKET_P_STORE_REG( DEST_FEEDER_ENABLE, packet->plane.address ? 1 : 0 ); |
|---|
| 1742 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_0, packet->plane.address ); |
|---|
| 1743 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_0, packet->plane.pitch ); |
|---|
| 1744 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_1, 0 ); |
|---|
| 1745 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_1, 0 ); |
|---|
| 1746 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_1, s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][0] ); |
|---|
| 1747 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_2, s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][1] ); |
|---|
| 1748 | BGRC_PACKET_P_STORE_REG_MASK( DEST_SURFACE_FORMAT_DEF_3, format2, BGRC_PACKET_P_DEST_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1749 | BGRC_PACKET_P_STORE_REG( DEST_W_ALPHA, packet->color >> 24 ); |
|---|
| 1750 | BGRC_PACKET_P_STORE_REG( DEST_CONSTANT_COLOR, packet->color ); |
|---|
| 1751 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1752 | |
|---|
| 1753 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 1754 | hContext->DEST_surface_width = packet->plane.width; |
|---|
| 1755 | hContext->DEST_surface_height = packet->plane.height; |
|---|
| 1756 | hContext->DEST_surface_format = packet->plane.format; |
|---|
| 1757 | #endif |
|---|
| 1758 | } |
|---|
| 1759 | |
|---|
| 1760 | /***************************************************************************/ |
|---|
| 1761 | static void BGRC_PACKET_P_SubmitDestinationColorPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1762 | { |
|---|
| 1763 | BM2MC_PACKET_PacketDestinationColor *packet = (BM2MC_PACKET_PacketDestinationColor *) header; |
|---|
| 1764 | uint32_t format2 = BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS(DEST_SURFACE); |
|---|
| 1765 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstColor " ); |
|---|
| 1766 | BGRC_PACKET_P_STORE_REG( DEST_FEEDER_ENABLE, 1 ); |
|---|
| 1767 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_0, hContext->sync_output_offset ); |
|---|
| 1768 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_0, 0 ); |
|---|
| 1769 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_1, 0 ); |
|---|
| 1770 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_1, 0 ); |
|---|
| 1771 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_1, s_BGRC_PACKET_P_DevicePixelFormats[BM2MC_PACKET_PixelFormat_eA1][0] ); |
|---|
| 1772 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_2, s_BGRC_PACKET_P_DevicePixelFormats[BM2MC_PACKET_PixelFormat_eA1][1] ); |
|---|
| 1773 | BGRC_PACKET_P_STORE_REG_MASK( DEST_SURFACE_FORMAT_DEF_3, format2, BGRC_PACKET_P_DEST_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1774 | BGRC_PACKET_P_STORE_REG( DEST_W_ALPHA, packet->color >> 24 ); |
|---|
| 1775 | BGRC_PACKET_P_STORE_REG( DEST_CONSTANT_COLOR, packet->color ); |
|---|
| 1776 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1777 | } |
|---|
| 1778 | |
|---|
| 1779 | /***************************************************************************/ |
|---|
| 1780 | static void BGRC_PACKET_P_SubmitDestinationNonePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1781 | { |
|---|
| 1782 | uint32_t format2 = BGRC_PACKET_P_DISABLE_SURFACE_CHANNELS(DEST_SURFACE); |
|---|
| 1783 | BSTD_UNUSED(header); |
|---|
| 1784 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstNone " ); |
|---|
| 1785 | BGRC_PACKET_P_STORE_REG( DEST_FEEDER_ENABLE, 0 ); |
|---|
| 1786 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_0, 0 ); |
|---|
| 1787 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_0, 0 ); |
|---|
| 1788 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_ADDR_1, 0 ); |
|---|
| 1789 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_STRIDE_1, 0 ); |
|---|
| 1790 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_1, 0 ); |
|---|
| 1791 | BGRC_PACKET_P_STORE_REG( DEST_SURFACE_FORMAT_DEF_2, 0 ); |
|---|
| 1792 | BGRC_PACKET_P_STORE_REG_MASK( DEST_SURFACE_FORMAT_DEF_3, format2, BGRC_PACKET_P_DEST_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1793 | BGRC_PACKET_P_STORE_REG( DEST_W_ALPHA, 0 ); |
|---|
| 1794 | BGRC_PACKET_P_STORE_REG( DEST_CONSTANT_COLOR, 0 ); |
|---|
| 1795 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1796 | } |
|---|
| 1797 | |
|---|
| 1798 | /***************************************************************************/ |
|---|
| 1799 | static void BGRC_PACKET_P_SubmitDestinationControlPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1800 | { |
|---|
| 1801 | BM2MC_PACKET_PacketDestinationControl *packet = (BM2MC_PACKET_PacketDestinationControl *) header; |
|---|
| 1802 | |
|---|
| 1803 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstControl " ); |
|---|
| 1804 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( DEST_SURFACE_FORMAT_DEF_3, ZERO_PAD, REPLICATE, ZERO_PAD, packet->zero_pad ); |
|---|
| 1805 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( DEST_SURFACE_FORMAT_DEF_3, CHROMA_FILTER, REPLICATE, FILTER, packet->chroma_filter ); |
|---|
| 1806 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1807 | } |
|---|
| 1808 | |
|---|
| 1809 | /***************************************************************************/ |
|---|
| 1810 | static void BGRC_PACKET_P_SubmitOutputFeederPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1811 | { |
|---|
| 1812 | BM2MC_PACKET_PacketOutputFeeder *packet = (BM2MC_PACKET_PacketOutputFeeder *) header; |
|---|
| 1813 | uint32_t out_format0 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][0]; |
|---|
| 1814 | uint32_t out_format2 = s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][2]; |
|---|
| 1815 | uint32_t format_type = out_format0 & BGRC_M2MC(OUTPUT_SURFACE_FORMAT_DEF_1_FORMAT_TYPE_MASK); |
|---|
| 1816 | uint32_t format0 = ((format_type == M2MC_FT_Palette) || (format_type == M2MC_FT_YCbCr420)) ? out_format0 & M2MC_CHANNEL_MASK : out_format0; |
|---|
| 1817 | hContext->out_format0 = out_format0; |
|---|
| 1818 | BGRC_PACKET_P_DEBUG_PRINT( "-- OutFeeder " ); |
|---|
| 1819 | BGRC_PACKET_P_STORE_REG( OUTPUT_FEEDER_ENABLE, packet->plane.address ? 1 : 0 ); |
|---|
| 1820 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_ADDR_0, packet->plane.address ); |
|---|
| 1821 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_STRIDE_0, packet->plane.pitch ); |
|---|
| 1822 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_ADDR_1, 0 ); |
|---|
| 1823 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_STRIDE_1, 0 ); |
|---|
| 1824 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_FORMAT_DEF_1, format0 ); |
|---|
| 1825 | BGRC_PACKET_P_STORE_REG( OUTPUT_SURFACE_FORMAT_DEF_2, s_BGRC_PACKET_P_DevicePixelFormats[packet->plane.format][1] ); |
|---|
| 1826 | BGRC_PACKET_P_STORE_REG_MASK( OUTPUT_SURFACE_FORMAT_DEF_3, out_format2, BGRC_PACKET_P_OUTPUT_SURFACE_FORMAT_DEF_3_MASK ); |
|---|
| 1827 | |
|---|
| 1828 | /* check if source is palette */ |
|---|
| 1829 | if( (hContext->src_format0 & M2MC_FT_Palette) == M2MC_FT_Palette ) |
|---|
| 1830 | { |
|---|
| 1831 | uint32_t def1 = BGRC_PACKET_P_GET_REG(SRC_SURFACE_FORMAT_DEF_1); |
|---|
| 1832 | uint32_t def3 = BGRC_PACKET_P_GET_REG(SRC_SURFACE_FORMAT_DEF_3); |
|---|
| 1833 | |
|---|
| 1834 | if( (hContext->out_format0 & M2MC_FT_Palette) == M2MC_FT_Palette ) |
|---|
| 1835 | { |
|---|
| 1836 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, hContext->src_format0 & M2MC_CHANNEL_MASK ); |
|---|
| 1837 | BGRC_PACKET_P_STORE_REG_FIELD( SRC_SURFACE_FORMAT_DEF_3, PALETTE_BYPASS, DONT_LOOKUP ); |
|---|
| 1838 | } |
|---|
| 1839 | else |
|---|
| 1840 | { |
|---|
| 1841 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_FORMAT_DEF_1, hContext->src_format0 ); |
|---|
| 1842 | BGRC_PACKET_P_STORE_REG_FIELD( SRC_SURFACE_FORMAT_DEF_3, PALETTE_BYPASS, LOOKUP ); |
|---|
| 1843 | } |
|---|
| 1844 | |
|---|
| 1845 | if( (def1 != BGRC_PACKET_P_GET_REG(SRC_SURFACE_FORMAT_DEF_1)) || (def3 != BGRC_PACKET_P_GET_REG(SRC_SURFACE_FORMAT_DEF_3)) ) |
|---|
| 1846 | hContext->group_header |= BGRC_M2MC(LIST_PACKET_HEADER_1_SRC_FEEDER_GRP_CNTRL_MASK); |
|---|
| 1847 | } |
|---|
| 1848 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1849 | |
|---|
| 1850 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 1851 | hContext->OUTPUT_surface_width = packet->plane.width; |
|---|
| 1852 | hContext->OUTPUT_surface_height = packet->plane.height; |
|---|
| 1853 | hContext->OUTPUT_surface_format = packet->plane.format; |
|---|
| 1854 | #endif |
|---|
| 1855 | } |
|---|
| 1856 | |
|---|
| 1857 | /***************************************************************************/ |
|---|
| 1858 | static void BGRC_PACKET_P_SubmitOutputControlPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1859 | { |
|---|
| 1860 | BM2MC_PACKET_PacketOutputControl *packet = (BM2MC_PACKET_PacketOutputControl *) header; |
|---|
| 1861 | |
|---|
| 1862 | BGRC_PACKET_P_DEBUG_PRINT( "-- OutControl " ); |
|---|
| 1863 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( OUTPUT_SURFACE_FORMAT_DEF_3, DITHER_ENABLE, DISABLE, ENABLE, packet->dither ); |
|---|
| 1864 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( OUTPUT_SURFACE_FORMAT_DEF_3, CHROMA_FILTER, FIRST, FILTER, packet->chroma_filter ); |
|---|
| 1865 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1866 | } |
|---|
| 1867 | |
|---|
| 1868 | /***************************************************************************/ |
|---|
| 1869 | static uint32_t s_BGRC_PACKET_P_BlendOps[] = |
|---|
| 1870 | { |
|---|
| 1871 | BGRC_M2MC(BLEND_COLOR_OP_OP_D_ZERO), |
|---|
| 1872 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_HALF), |
|---|
| 1873 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_ZERO) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1874 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_SOURCE_COLOR), |
|---|
| 1875 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_SOURCE_COLOR) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1876 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_SOURCE_ALPHA), |
|---|
| 1877 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_SOURCE_ALPHA) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1878 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_DEST_COLOR), |
|---|
| 1879 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_DEST_COLOR) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1880 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_DEST_ALPHA), |
|---|
| 1881 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_DEST_ALPHA) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1882 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_CONSTANT_COLOR), |
|---|
| 1883 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_CONSTANT_COLOR) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK), |
|---|
| 1884 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_CONSTANT_ALPHA), |
|---|
| 1885 | BGRC_M2MC(BLEND_COLOR_OP_OP_A_CONSTANT_ALPHA) | BGRC_M2MC(BLEND_COLOR_OP_OP_A_INV_MASK) |
|---|
| 1886 | }; |
|---|
| 1887 | |
|---|
| 1888 | /***************************************************************************/ |
|---|
| 1889 | #define BGRC_PACKET_P_CONVERT_BLEND( equation ) ( \ |
|---|
| 1890 | (s_BGRC_PACKET_P_BlendOps[(equation).a] << BGRC_M2MC(BLEND_COLOR_OP_OP_A_SHIFT)) | \ |
|---|
| 1891 | (s_BGRC_PACKET_P_BlendOps[(equation).b] << BGRC_M2MC(BLEND_COLOR_OP_OP_B_SHIFT)) | \ |
|---|
| 1892 | ((equation).sub_cd << BGRC_M2MC(BLEND_COLOR_OP_SUBTRACT_CD_SHIFT)) | \ |
|---|
| 1893 | (s_BGRC_PACKET_P_BlendOps[(equation).c] << BGRC_M2MC(BLEND_COLOR_OP_OP_C_SHIFT)) | \ |
|---|
| 1894 | (s_BGRC_PACKET_P_BlendOps[(equation).d] << BGRC_M2MC(BLEND_COLOR_OP_OP_D_SHIFT)) | \ |
|---|
| 1895 | ((equation).sub_e << BGRC_M2MC(BLEND_COLOR_OP_SUBTRACT_E_SHIFT)) | \ |
|---|
| 1896 | (s_BGRC_PACKET_P_BlendOps[(equation).e] << BGRC_M2MC(BLEND_COLOR_OP_OP_E_SHIFT))) |
|---|
| 1897 | |
|---|
| 1898 | #define BGRC_PACKET_P_SRC_COLOR_KEY_ACTION ( \ |
|---|
| 1899 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1900 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_DEST_SHIFT)) | \ |
|---|
| 1901 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1902 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_SHIFT))) |
|---|
| 1903 | |
|---|
| 1904 | #define BGRC_PACKET_P_DST_COLOR_KEY_ACTION ( \ |
|---|
| 1905 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1906 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_DEST_SHIFT)) | \ |
|---|
| 1907 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1908 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_SHIFT))) |
|---|
| 1909 | |
|---|
| 1910 | #define BGRC_PACKET_P_BLEND_COLOR_KEY_ACTION ( \ |
|---|
| 1911 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1912 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_TAKE_DEST) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_NOT_SRC_DEST_SHIFT)) | \ |
|---|
| 1913 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_NOT_DEST_SHIFT)) | \ |
|---|
| 1914 | (BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_TAKE_ROP) << BGRC_M2MC(BLEND_COLOR_KEY_ACTION_ACTION_SRC_DEST_SHIFT))) |
|---|
| 1915 | |
|---|
| 1916 | #define BGRC_PACKET_P_SET_COLORKEY_ACTION() \ |
|---|
| 1917 | { \ |
|---|
| 1918 | if( BGRC_PACKET_P_GET_REG_FIELD(BLIT_HEADER, SRC_COLOR_KEY_ENABLE) && \ |
|---|
| 1919 | BGRC_PACKET_P_GET_REG_FIELD(BLIT_HEADER, DEST_COLOR_KEY_ENABLE) ) \ |
|---|
| 1920 | { \ |
|---|
| 1921 | BGRC_PACKET_P_STORE_REG( BLEND_COLOR_KEY_ACTION, BGRC_PACKET_P_BLEND_COLOR_KEY_ACTION ); \ |
|---|
| 1922 | } \ |
|---|
| 1923 | else if( BGRC_PACKET_P_GET_REG_FIELD(BLIT_HEADER, DEST_COLOR_KEY_ENABLE) ) \ |
|---|
| 1924 | { \ |
|---|
| 1925 | BGRC_PACKET_P_STORE_REG( BLEND_COLOR_KEY_ACTION, BGRC_PACKET_P_DST_COLOR_KEY_ACTION ); \ |
|---|
| 1926 | } \ |
|---|
| 1927 | else \ |
|---|
| 1928 | { \ |
|---|
| 1929 | BGRC_PACKET_P_STORE_REG( BLEND_COLOR_KEY_ACTION, BGRC_PACKET_P_SRC_COLOR_KEY_ACTION ); \ |
|---|
| 1930 | } \ |
|---|
| 1931 | } |
|---|
| 1932 | |
|---|
| 1933 | /***************************************************************************/ |
|---|
| 1934 | static void BGRC_PACKET_P_SubmitBlendPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1935 | { |
|---|
| 1936 | BM2MC_PACKET_PacketBlend *packet = (BM2MC_PACKET_PacketBlend *) header; |
|---|
| 1937 | BGRC_PACKET_P_DEBUG_PRINT( "-- Blend " ); |
|---|
| 1938 | BGRC_PACKET_P_STORE_REG( BLEND_COLOR_OP, BGRC_PACKET_P_CONVERT_BLEND(packet->color_blend) ); |
|---|
| 1939 | BGRC_PACKET_P_STORE_REG( BLEND_ALPHA_OP, BGRC_PACKET_P_CONVERT_BLEND(packet->alpha_blend) ); |
|---|
| 1940 | BGRC_PACKET_P_STORE_REG( BLEND_CONSTANT_COLOR, packet->color ); |
|---|
| 1941 | |
|---|
| 1942 | BGRC_PACKET_P_SET_COLORKEY_ACTION(); |
|---|
| 1943 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1944 | } |
|---|
| 1945 | |
|---|
| 1946 | /***************************************************************************/ |
|---|
| 1947 | static void BGRC_PACKET_P_SubmitBlendColorPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1948 | { |
|---|
| 1949 | BM2MC_PACKET_PacketBlendColor *packet = (BM2MC_PACKET_PacketBlendColor *) header; |
|---|
| 1950 | BGRC_PACKET_P_DEBUG_PRINT( "-- BlendColor " ); |
|---|
| 1951 | BGRC_PACKET_P_STORE_REG( BLEND_CONSTANT_COLOR, packet->color ); |
|---|
| 1952 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1953 | } |
|---|
| 1954 | |
|---|
| 1955 | /***************************************************************************/ |
|---|
| 1956 | static void BGRC_PACKET_P_SubmitRopPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1957 | { |
|---|
| 1958 | BM2MC_PACKET_PacketRop *packet = (BM2MC_PACKET_PacketRop *) header; |
|---|
| 1959 | BGRC_PACKET_P_DEBUG_PRINT( "-- Rop " ); |
|---|
| 1960 | BGRC_PACKET_P_STORE_REG( ROP_OPERATION, packet->rop ); |
|---|
| 1961 | BGRC_PACKET_P_STORE_REG( ROP_PATTERN_TOP, packet->pattern0 ); |
|---|
| 1962 | BGRC_PACKET_P_STORE_REG( ROP_PATTERN_BOTTOM, packet->pattern1 ); |
|---|
| 1963 | BGRC_PACKET_P_STORE_REG( ROP_PATTERN_COLOR_0, packet->color0 ); |
|---|
| 1964 | BGRC_PACKET_P_STORE_REG( ROP_PATTERN_COLOR_1, packet->color1 ); |
|---|
| 1965 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1966 | } |
|---|
| 1967 | |
|---|
| 1968 | /***************************************************************************/ |
|---|
| 1969 | static void BGRC_PACKET_P_SubmitSourceColorkeyPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1970 | { |
|---|
| 1971 | BM2MC_PACKET_PacketSourceColorkey *packet = (BM2MC_PACKET_PacketSourceColorkey *) header; |
|---|
| 1972 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcColorkey " ); |
|---|
| 1973 | BGRC_PACKET_P_STORE_REG( SRC_COLOR_KEY_HIGH, packet->high ); |
|---|
| 1974 | BGRC_PACKET_P_STORE_REG( SRC_COLOR_KEY_LOW, packet->low ); |
|---|
| 1975 | BGRC_PACKET_P_STORE_REG( SRC_COLOR_KEY_MASK, packet->mask ); |
|---|
| 1976 | BGRC_PACKET_P_STORE_REG( SRC_COLOR_KEY_REPLACEMENT, packet->replacement ); |
|---|
| 1977 | BGRC_PACKET_P_STORE_REG( SRC_COLOR_KEY_REPLACEMENT_MASK, packet->replacement_mask ); |
|---|
| 1978 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1979 | } |
|---|
| 1980 | |
|---|
| 1981 | /***************************************************************************/ |
|---|
| 1982 | static void BGRC_PACKET_P_SubmitSourceColorkeyEnablePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 1983 | { |
|---|
| 1984 | BM2MC_PACKET_PacketSourceColorkeyEnable *packet = (BM2MC_PACKET_PacketSourceColorkeyEnable *) header; |
|---|
| 1985 | if( packet->enable ) |
|---|
| 1986 | { |
|---|
| 1987 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcColorkeyEnable " ); |
|---|
| 1988 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_COLOR_KEY_ENABLE, ENABLE ); |
|---|
| 1989 | } |
|---|
| 1990 | else |
|---|
| 1991 | { |
|---|
| 1992 | BGRC_PACKET_P_DEBUG_PRINT( "-- SrcColorkeyDisable " ); |
|---|
| 1993 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_COLOR_KEY_ENABLE, DISABLE ); |
|---|
| 1994 | } |
|---|
| 1995 | |
|---|
| 1996 | BGRC_PACKET_P_SET_COLORKEY_ACTION(); |
|---|
| 1997 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 1998 | } |
|---|
| 1999 | |
|---|
| 2000 | /***************************************************************************/ |
|---|
| 2001 | static void BGRC_PACKET_P_SubmitDestinationColorkeyPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2002 | { |
|---|
| 2003 | BM2MC_PACKET_PacketDestinationColorkey *packet = (BM2MC_PACKET_PacketDestinationColorkey *) header; |
|---|
| 2004 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstColorkey " ); |
|---|
| 2005 | BGRC_PACKET_P_STORE_REG( DEST_COLOR_KEY_HIGH, packet->high ); |
|---|
| 2006 | BGRC_PACKET_P_STORE_REG( DEST_COLOR_KEY_LOW, packet->low ); |
|---|
| 2007 | BGRC_PACKET_P_STORE_REG( DEST_COLOR_KEY_MASK, packet->mask ); |
|---|
| 2008 | BGRC_PACKET_P_STORE_REG( DEST_COLOR_KEY_REPLACEMENT, packet->replacement ); |
|---|
| 2009 | BGRC_PACKET_P_STORE_REG( DEST_COLOR_KEY_REPLACEMENT_MASK, packet->replacement_mask ); |
|---|
| 2010 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2011 | } |
|---|
| 2012 | |
|---|
| 2013 | /***************************************************************************/ |
|---|
| 2014 | static void BGRC_PACKET_P_SubmitDestinationColorkeyEnablePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2015 | { |
|---|
| 2016 | BM2MC_PACKET_PacketDestinationColorkeyEnable *packet = (BM2MC_PACKET_PacketDestinationColorkeyEnable *) header; |
|---|
| 2017 | if( packet->enable ) |
|---|
| 2018 | { |
|---|
| 2019 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstColorkeyEnable " ); |
|---|
| 2020 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, DEST_COLOR_KEY_ENABLE, ENABLE ); |
|---|
| 2021 | } |
|---|
| 2022 | else |
|---|
| 2023 | { |
|---|
| 2024 | BGRC_PACKET_P_DEBUG_PRINT( "-- DstColorkeyDisable " ); |
|---|
| 2025 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, DEST_COLOR_KEY_ENABLE, DISABLE ); |
|---|
| 2026 | } |
|---|
| 2027 | |
|---|
| 2028 | BGRC_PACKET_P_SET_COLORKEY_ACTION(); |
|---|
| 2029 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2030 | } |
|---|
| 2031 | |
|---|
| 2032 | #if defined(BCHP_M2MC_HORIZ_FIR_COEFF_PHASE0_2_COEFF_2_SHIFT) |
|---|
| 2033 | /***************************************************************************/ |
|---|
| 2034 | #define BGRC_PACKET_P_CONVERT_COEFFS_1( coeff ) \ |
|---|
| 2035 | ((((uint32_t) (coeff)) << BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_2_COEFF_2_SHIFT)) & BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_2_COEFF_2_MASK)) |
|---|
| 2036 | |
|---|
| 2037 | #define BGRC_PACKET_P_CONVERT_COEFFS_2( coeff0, coeff1 ) \ |
|---|
| 2038 | ((((uint32_t) (coeff0)) << BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01_COEFF_0_SHIFT)) & BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01_COEFF_0_MASK)) | \ |
|---|
| 2039 | ((((uint32_t) (coeff1)) << BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01_COEFF_1_SHIFT)) & BGRC_M2MC(HORIZ_FIR_0_COEFF_PHASE0_01_COEFF_1_MASK)) |
|---|
| 2040 | |
|---|
| 2041 | /***************************************************************************/ |
|---|
| 2042 | static void BGRC_PACKET_P_SubmitFilterPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2043 | { |
|---|
| 2044 | BM2MC_PACKET_PacketFilter *packet = (BM2MC_PACKET_PacketFilter *) header; |
|---|
| 2045 | uint32_t hor_coeffs0 = BGRC_PACKET_P_CONVERT_COEFFS_2(packet->hor.coeffs[0][0], packet->hor.coeffs[0][1]); |
|---|
| 2046 | uint32_t hor_coeffs1 = BGRC_PACKET_P_CONVERT_COEFFS_1(packet->hor.coeffs[0][2]); |
|---|
| 2047 | uint32_t hor_coeffs2 = BGRC_PACKET_P_CONVERT_COEFFS_2(packet->hor.coeffs[1][0], packet->hor.coeffs[1][1]); |
|---|
| 2048 | uint32_t hor_coeffs3 = BGRC_PACKET_P_CONVERT_COEFFS_1(packet->hor.coeffs[1][2]); |
|---|
| 2049 | uint32_t ver_coeffs0 = BGRC_PACKET_P_CONVERT_COEFFS_2(packet->ver.coeffs[0][0], packet->ver.coeffs[0][1]); |
|---|
| 2050 | uint32_t ver_coeffs1 = BGRC_PACKET_P_CONVERT_COEFFS_1(packet->ver.coeffs[0][2]); |
|---|
| 2051 | uint32_t ver_coeffs2 = BGRC_PACKET_P_CONVERT_COEFFS_2(packet->ver.coeffs[1][0], packet->ver.coeffs[1][1]); |
|---|
| 2052 | uint32_t ver_coeffs3 = BGRC_PACKET_P_CONVERT_COEFFS_1(packet->ver.coeffs[1][2]); |
|---|
| 2053 | BGRC_PACKET_P_DEBUG_PRINT( "-- Filter " ); |
|---|
| 2054 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_0_COEFF_PHASE0_01, hor_coeffs0 ); |
|---|
| 2055 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_0_COEFF_PHASE0_2, hor_coeffs1 ); |
|---|
| 2056 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_0_COEFF_PHASE1_01, hor_coeffs2 ); |
|---|
| 2057 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_0_COEFF_PHASE1_2, hor_coeffs3 ); |
|---|
| 2058 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_1_COEFF_PHASE0_01, hor_coeffs0 ); |
|---|
| 2059 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_1_COEFF_PHASE0_2, hor_coeffs1 ); |
|---|
| 2060 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_1_COEFF_PHASE1_01, hor_coeffs2 ); |
|---|
| 2061 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_1_COEFF_PHASE1_2, hor_coeffs3 ); |
|---|
| 2062 | BGRC_PACKET_P_STORE_REG( VERT_FIR_0_COEFF_PHASE0_01, ver_coeffs0 ); |
|---|
| 2063 | BGRC_PACKET_P_STORE_REG( VERT_FIR_0_COEFF_PHASE0_2, ver_coeffs1 ); |
|---|
| 2064 | BGRC_PACKET_P_STORE_REG( VERT_FIR_0_COEFF_PHASE1_01, ver_coeffs2 ); |
|---|
| 2065 | BGRC_PACKET_P_STORE_REG( VERT_FIR_0_COEFF_PHASE1_2, ver_coeffs3 ); |
|---|
| 2066 | BGRC_PACKET_P_STORE_REG( VERT_FIR_1_COEFF_PHASE0_01, ver_coeffs0 ); |
|---|
| 2067 | BGRC_PACKET_P_STORE_REG( VERT_FIR_1_COEFF_PHASE0_2, ver_coeffs1 ); |
|---|
| 2068 | BGRC_PACKET_P_STORE_REG( VERT_FIR_1_COEFF_PHASE1_01, ver_coeffs2 ); |
|---|
| 2069 | BGRC_PACKET_P_STORE_REG( VERT_FIR_1_COEFF_PHASE1_2, ver_coeffs3 ); |
|---|
| 2070 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2071 | } |
|---|
| 2072 | #else |
|---|
| 2073 | /***************************************************************************/ |
|---|
| 2074 | #define BGRC_PACKET_P_CONVERT_COEFFS( coeff0, coeff1 ) \ |
|---|
| 2075 | (((uint32_t) (coeff0) << 16) & BGRC_M2MC(HORIZ_FIR_COEFF_PHASE0_01_COEFF_0_MASK)) | \ |
|---|
| 2076 | (((uint32_t) (coeff1)) & BGRC_M2MC(HORIZ_FIR_COEFF_PHASE0_01_COEFF_1_MASK)) |
|---|
| 2077 | |
|---|
| 2078 | /***************************************************************************/ |
|---|
| 2079 | static void BGRC_PACKET_P_SubmitFilterPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2080 | { |
|---|
| 2081 | BM2MC_PACKET_PacketFilter *packet = (BM2MC_PACKET_PacketFilter *) header; |
|---|
| 2082 | BGRC_PACKET_P_DEBUG_PRINT( "-- Filter " ); |
|---|
| 2083 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE0_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[0][0], packet->hor.coeffs[0][1]) ); |
|---|
| 2084 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE0_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[0][2], packet->hor.coeffs[0][3]) ); |
|---|
| 2085 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE0_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[0][4], packet->hor.coeffs[0][5]) ); |
|---|
| 2086 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE0_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[0][6], packet->hor.coeffs[0][7]) ); |
|---|
| 2087 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE1_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[1][0], packet->hor.coeffs[1][1]) ); |
|---|
| 2088 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE1_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[1][2], packet->hor.coeffs[1][3]) ); |
|---|
| 2089 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE1_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[1][4], packet->hor.coeffs[1][5]) ); |
|---|
| 2090 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE1_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[1][6], packet->hor.coeffs[1][7]) ); |
|---|
| 2091 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE2_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[2][0], packet->hor.coeffs[2][1]) ); |
|---|
| 2092 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE2_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[2][2], packet->hor.coeffs[2][3]) ); |
|---|
| 2093 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE2_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[2][4], packet->hor.coeffs[2][5]) ); |
|---|
| 2094 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE2_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[2][6], packet->hor.coeffs[2][7]) ); |
|---|
| 2095 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE3_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[3][0], packet->hor.coeffs[3][1]) ); |
|---|
| 2096 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE3_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[3][2], packet->hor.coeffs[3][3]) ); |
|---|
| 2097 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE3_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[3][4], packet->hor.coeffs[3][5]) ); |
|---|
| 2098 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE3_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[3][6], packet->hor.coeffs[3][7]) ); |
|---|
| 2099 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE4_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[4][0], packet->hor.coeffs[4][1]) ); |
|---|
| 2100 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE4_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[4][2], packet->hor.coeffs[4][3]) ); |
|---|
| 2101 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE4_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[4][4], packet->hor.coeffs[4][5]) ); |
|---|
| 2102 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE4_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[4][6], packet->hor.coeffs[4][7]) ); |
|---|
| 2103 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE5_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[5][0], packet->hor.coeffs[5][1]) ); |
|---|
| 2104 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE5_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[5][2], packet->hor.coeffs[5][3]) ); |
|---|
| 2105 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE5_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[5][4], packet->hor.coeffs[5][5]) ); |
|---|
| 2106 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE5_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[5][6], packet->hor.coeffs[5][7]) ); |
|---|
| 2107 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE6_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[6][0], packet->hor.coeffs[6][1]) ); |
|---|
| 2108 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE6_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[6][2], packet->hor.coeffs[6][3]) ); |
|---|
| 2109 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE6_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[6][4], packet->hor.coeffs[6][5]) ); |
|---|
| 2110 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE6_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[6][6], packet->hor.coeffs[6][7]) ); |
|---|
| 2111 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE7_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[7][0], packet->hor.coeffs[7][1]) ); |
|---|
| 2112 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE7_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[7][2], packet->hor.coeffs[7][3]) ); |
|---|
| 2113 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE7_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[7][4], packet->hor.coeffs[7][5]) ); |
|---|
| 2114 | BGRC_PACKET_P_STORE_REG( HORIZ_FIR_COEFF_PHASE7_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->hor.coeffs[7][6], packet->hor.coeffs[7][7]) ); |
|---|
| 2115 | |
|---|
| 2116 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE0_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[0][0], packet->ver.coeffs[0][1]) ); |
|---|
| 2117 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE0_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[0][2], packet->ver.coeffs[0][3]) ); |
|---|
| 2118 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE0_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[0][4], packet->ver.coeffs[0][5]) ); |
|---|
| 2119 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE0_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[0][6], packet->ver.coeffs[0][7]) ); |
|---|
| 2120 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE1_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[1][0], packet->ver.coeffs[1][1]) ); |
|---|
| 2121 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE1_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[1][2], packet->ver.coeffs[1][3]) ); |
|---|
| 2122 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE1_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[1][4], packet->ver.coeffs[1][5]) ); |
|---|
| 2123 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE1_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[1][6], packet->ver.coeffs[1][7]) ); |
|---|
| 2124 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE2_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[2][0], packet->ver.coeffs[2][1]) ); |
|---|
| 2125 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE2_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[2][2], packet->ver.coeffs[2][3]) ); |
|---|
| 2126 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE2_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[2][4], packet->ver.coeffs[2][5]) ); |
|---|
| 2127 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE2_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[2][6], packet->ver.coeffs[2][7]) ); |
|---|
| 2128 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE3_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[3][0], packet->ver.coeffs[3][1]) ); |
|---|
| 2129 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE3_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[3][2], packet->ver.coeffs[3][3]) ); |
|---|
| 2130 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE3_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[3][4], packet->ver.coeffs[3][5]) ); |
|---|
| 2131 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE3_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[3][6], packet->ver.coeffs[3][7]) ); |
|---|
| 2132 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE4_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[4][0], packet->ver.coeffs[4][1]) ); |
|---|
| 2133 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE4_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[4][2], packet->ver.coeffs[4][3]) ); |
|---|
| 2134 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE4_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[4][4], packet->ver.coeffs[4][5]) ); |
|---|
| 2135 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE4_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[4][6], packet->ver.coeffs[4][7]) ); |
|---|
| 2136 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE5_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[5][0], packet->ver.coeffs[5][1]) ); |
|---|
| 2137 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE5_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[5][2], packet->ver.coeffs[5][3]) ); |
|---|
| 2138 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE5_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[5][4], packet->ver.coeffs[5][5]) ); |
|---|
| 2139 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE5_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[5][6], packet->ver.coeffs[5][7]) ); |
|---|
| 2140 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE6_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[6][0], packet->ver.coeffs[6][1]) ); |
|---|
| 2141 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE6_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[6][2], packet->ver.coeffs[6][3]) ); |
|---|
| 2142 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE6_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[6][4], packet->ver.coeffs[6][5]) ); |
|---|
| 2143 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE6_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[6][6], packet->ver.coeffs[6][7]) ); |
|---|
| 2144 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE7_01, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[7][0], packet->ver.coeffs[7][1]) ); |
|---|
| 2145 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE7_23, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[7][2], packet->ver.coeffs[7][3]) ); |
|---|
| 2146 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE7_45, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[7][4], packet->ver.coeffs[7][5]) ); |
|---|
| 2147 | BGRC_PACKET_P_STORE_REG( VERT_FIR_COEFF_PHASE7_67, BGRC_PACKET_P_CONVERT_COEFFS(packet->ver.coeffs[7][6], packet->ver.coeffs[7][7]) ); |
|---|
| 2148 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2149 | } |
|---|
| 2150 | #endif |
|---|
| 2151 | |
|---|
| 2152 | /***************************************************************************/ |
|---|
| 2153 | static void BGRC_PACKET_P_SubmitFilterEnablePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2154 | { |
|---|
| 2155 | #if defined(BCHP_M2MC_SCALER_CTRL_CLUT_SCALE_MODE_MASK) |
|---|
| 2156 | BM2MC_PACKET_PacketFilterEnable *packet = (BM2MC_PACKET_PacketFilterEnable *) header; |
|---|
| 2157 | if( packet->enable ) |
|---|
| 2158 | { |
|---|
| 2159 | BGRC_PACKET_P_DEBUG_PRINT( "-- FilterEnable \n" ); |
|---|
| 2160 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, CLUT_SCALE_MODE, DISABLE ); |
|---|
| 2161 | } |
|---|
| 2162 | else |
|---|
| 2163 | { |
|---|
| 2164 | BGRC_PACKET_P_DEBUG_PRINT( "-- FilterDisable \n" ); |
|---|
| 2165 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, CLUT_SCALE_MODE, ENABLE ); |
|---|
| 2166 | } |
|---|
| 2167 | #else |
|---|
| 2168 | BSTD_UNUSED(hContext); |
|---|
| 2169 | BSTD_UNUSED(header); |
|---|
| 2170 | #endif |
|---|
| 2171 | } |
|---|
| 2172 | |
|---|
| 2173 | /***************************************************************************/ |
|---|
| 2174 | static void BGRC_PACKET_P_SubmitSourceColorMatrixPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2175 | { |
|---|
| 2176 | BM2MC_PACKET_PacketSourceColorMatrix *packet = (BM2MC_PACKET_PacketSourceColorMatrix *) header; |
|---|
| 2177 | BGRC_PACKET_P_DEBUG_PRINT( "-- ColorMatrix " ); |
|---|
| 2178 | BGRC_PACKET_P_STORE_REG( SRC_CM_C00_C01, packet->matrix.m[0][1] | (packet->matrix.m[0][0] << BGRC_M2MC(SRC_CM_C00_C01_CM_C00_SHIFT)) ); |
|---|
| 2179 | BGRC_PACKET_P_STORE_REG( SRC_CM_C02_C03, packet->matrix.m[0][3] | (packet->matrix.m[0][2] << BGRC_M2MC(SRC_CM_C02_C03_CM_C02_SHIFT)) ); |
|---|
| 2180 | BGRC_PACKET_P_STORE_REG( SRC_CM_C04, packet->matrix.m[0][4] ); |
|---|
| 2181 | BGRC_PACKET_P_STORE_REG( SRC_CM_C10_C11, packet->matrix.m[1][1] | (packet->matrix.m[1][0] << BGRC_M2MC(SRC_CM_C10_C11_CM_C10_SHIFT)) ); |
|---|
| 2182 | BGRC_PACKET_P_STORE_REG( SRC_CM_C12_C13, packet->matrix.m[1][3] | (packet->matrix.m[1][2] << BGRC_M2MC(SRC_CM_C12_C13_CM_C12_SHIFT)) ); |
|---|
| 2183 | BGRC_PACKET_P_STORE_REG( SRC_CM_C14, packet->matrix.m[1][4] ); |
|---|
| 2184 | BGRC_PACKET_P_STORE_REG( SRC_CM_C20_C21, packet->matrix.m[2][1] | (packet->matrix.m[2][0] << BGRC_M2MC(SRC_CM_C20_C21_CM_C20_SHIFT)) ); |
|---|
| 2185 | BGRC_PACKET_P_STORE_REG( SRC_CM_C22_C23, packet->matrix.m[2][3] | (packet->matrix.m[2][2] << BGRC_M2MC(SRC_CM_C22_C23_CM_C22_SHIFT)) ); |
|---|
| 2186 | BGRC_PACKET_P_STORE_REG( SRC_CM_C24, packet->matrix.m[2][4] ); |
|---|
| 2187 | BGRC_PACKET_P_STORE_REG( SRC_CM_C30_C31, packet->matrix.m[3][1] | (packet->matrix.m[3][0] << BGRC_M2MC(SRC_CM_C30_C31_CM_C30_SHIFT)) ); |
|---|
| 2188 | BGRC_PACKET_P_STORE_REG( SRC_CM_C32_C33, packet->matrix.m[3][3] | (packet->matrix.m[3][2] << BGRC_M2MC(SRC_CM_C32_C33_CM_C32_SHIFT)) ); |
|---|
| 2189 | BGRC_PACKET_P_STORE_REG( SRC_CM_C34, packet->matrix.m[3][4] ); |
|---|
| 2190 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2191 | } |
|---|
| 2192 | |
|---|
| 2193 | /***************************************************************************/ |
|---|
| 2194 | static void BGRC_PACKET_P_SubmitSourceColorMatrixEnablePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2195 | { |
|---|
| 2196 | BM2MC_PACKET_PacketSourceColorMatrixEnable *packet = (BM2MC_PACKET_PacketSourceColorMatrixEnable *) header; |
|---|
| 2197 | if( packet->enable ) |
|---|
| 2198 | { |
|---|
| 2199 | BGRC_PACKET_P_DEBUG_PRINT( "-- ColorMatrixEnable \n" ); |
|---|
| 2200 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_COLOR_MATRIX_ENABLE, ENABLE ); |
|---|
| 2201 | } |
|---|
| 2202 | else |
|---|
| 2203 | { |
|---|
| 2204 | BGRC_PACKET_P_DEBUG_PRINT( "-- ColorMatrixDisable \n" ); |
|---|
| 2205 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_COLOR_MATRIX_ENABLE, DISABLE ); |
|---|
| 2206 | } |
|---|
| 2207 | } |
|---|
| 2208 | |
|---|
| 2209 | /***************************************************************************/ |
|---|
| 2210 | static void BGRC_PACKET_P_SubmitSourcePalettePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2211 | { |
|---|
| 2212 | BM2MC_PACKET_PacketSourcePalette *packet = (BM2MC_PACKET_PacketSourcePalette *) header; |
|---|
| 2213 | BGRC_PACKET_P_DEBUG_PRINT( "-- Palette " ); |
|---|
| 2214 | BGRC_PACKET_P_STORE_REG( SRC_CLUT_ENTRY_i_ARRAY_BASE, packet->address ? packet->address : hContext->sync_output_offset ); |
|---|
| 2215 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2216 | } |
|---|
| 2217 | |
|---|
| 2218 | /***************************************************************************/ |
|---|
| 2219 | static void BGRC_PACKET_P_SubmitMirrorPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2220 | { |
|---|
| 2221 | BM2MC_PACKET_PacketMirror *packet = (BM2MC_PACKET_PacketMirror *) header; |
|---|
| 2222 | BGRC_PACKET_P_DEBUG_PRINT( "-- Mirror " ); |
|---|
| 2223 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->src_hor ); |
|---|
| 2224 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->src_ver ); |
|---|
| 2225 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->dst_hor ); |
|---|
| 2226 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->dst_ver ); |
|---|
| 2227 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->out_hor ); |
|---|
| 2228 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->out_ver ); |
|---|
| 2229 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, SRC_H_DIRECTION, LEFT_TO_RIGHT, RIGHT_TO_LEFT, packet->src_hor ); |
|---|
| 2230 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, SRC_V_DIRECTION, TOP_TO_BOTTOM, BOTTOM_TO_TOP, packet->src_ver ); |
|---|
| 2231 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, DEST_H_DIRECTION, LEFT_TO_RIGHT, RIGHT_TO_LEFT, packet->dst_hor ); |
|---|
| 2232 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, DEST_V_DIRECTION, TOP_TO_BOTTOM, BOTTOM_TO_TOP, packet->dst_ver ); |
|---|
| 2233 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, OUTPUT_H_DIRECTION, LEFT_TO_RIGHT, RIGHT_TO_LEFT, packet->out_hor ); |
|---|
| 2234 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, OUTPUT_V_DIRECTION, TOP_TO_BOTTOM, BOTTOM_TO_TOP, packet->out_ver ); |
|---|
| 2235 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2236 | } |
|---|
| 2237 | |
|---|
| 2238 | /***************************************************************************/ |
|---|
| 2239 | static void BGRC_PACKET_P_SubmitFixedScalePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2240 | { |
|---|
| 2241 | BM2MC_PACKET_PacketFixedScale *packet = (BM2MC_PACKET_PacketFixedScale *) header; |
|---|
| 2242 | BGRC_PACKET_P_DEBUG_PRINT( "-- FixedScale " ); |
|---|
| 2243 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->hor_phase ); |
|---|
| 2244 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->ver_phase ); |
|---|
| 2245 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->hor_step ); |
|---|
| 2246 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->ver_step ); |
|---|
| 2247 | BGRC_PACKET_P_DEBUG_PRINT_VALUE( packet->shift ); |
|---|
| 2248 | hContext->fixed_scale = *packet; |
|---|
| 2249 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2250 | } |
|---|
| 2251 | |
|---|
| 2252 | /***************************************************************************/ |
|---|
| 2253 | static void BGRC_PACKET_P_SubmitDestripeFixedScalePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2254 | { |
|---|
| 2255 | BM2MC_PACKET_PacketDestripeFixedScale *packet = (BM2MC_PACKET_PacketDestripeFixedScale *) header; |
|---|
| 2256 | BGRC_PACKET_P_DEBUG_PRINT( "-- DestripeFixedScale " ); |
|---|
| 2257 | hContext->destripe_fixed_scale = *packet; |
|---|
| 2258 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2259 | } |
|---|
| 2260 | |
|---|
| 2261 | /***************************************************************************/ |
|---|
| 2262 | static void BGRC_PACKET_P_SubmitAlphaPremultiplyPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2263 | { |
|---|
| 2264 | #if defined(BCHP_M2MC_SCALER_CTRL_ALPHA_PRE_MULTIPLY_ENABLE_MASK) |
|---|
| 2265 | BM2MC_PACKET_PacketAlphaPremultiply *packet = (BM2MC_PACKET_PacketAlphaPremultiply *) header; |
|---|
| 2266 | if( packet->enable ) |
|---|
| 2267 | { |
|---|
| 2268 | BGRC_PACKET_P_DEBUG_PRINT( "-- AlphaPremulEnable \n" ); |
|---|
| 2269 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, ALPHA_PRE_MULTIPLY_ENABLE, ENABLE ); |
|---|
| 2270 | } |
|---|
| 2271 | else |
|---|
| 2272 | { |
|---|
| 2273 | BGRC_PACKET_P_DEBUG_PRINT( "-- AlphaPremulDisable \n" ); |
|---|
| 2274 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, ALPHA_PRE_MULTIPLY_ENABLE, DISABLE ); |
|---|
| 2275 | } |
|---|
| 2276 | #endif |
|---|
| 2277 | } |
|---|
| 2278 | |
|---|
| 2279 | /***************************************************************************/ |
|---|
| 2280 | static void BGRC_PACKET_P_SubmitFillBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2281 | { |
|---|
| 2282 | BM2MC_PACKET_PacketFillBlit *packet = (BM2MC_PACKET_PacketFillBlit *) header; |
|---|
| 2283 | uint32_t pos = packet->rect.x | ((uint32_t) packet->rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2284 | uint32_t size = packet->rect.height | ((uint32_t) packet->rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2285 | |
|---|
| 2286 | BGRC_PACKET_P_DEBUG_PRINT( "-- FillBlit " ); |
|---|
| 2287 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, DISABLE ); |
|---|
| 2288 | BGRC_PACKET_P_STORE_RECT_REGS( pos, size, 0, 0, pos, size, pos, size ); |
|---|
| 2289 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2290 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2291 | } |
|---|
| 2292 | |
|---|
| 2293 | /***************************************************************************/ |
|---|
| 2294 | #if ((BCHP_CHIP==7400) && (BCHP_VER == BCHP_VER_A0)) || \ |
|---|
| 2295 | ((BCHP_CHIP==7550) && (BCHP_VER == BCHP_VER_A0)) || \ |
|---|
| 2296 | (BCHP_CHIP==7401) || (BCHP_CHIP==7403) || (BCHP_CHIP==7038) || (BCHP_CHIP==3573) || \ |
|---|
| 2297 | (BCHP_CHIP==3548) || (BCHP_CHIP==7358) || (BCHP_CHIP==7552) |
|---|
| 2298 | #define BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ) |
|---|
| 2299 | #else |
|---|
| 2300 | #if 1 |
|---|
| 2301 | #define BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ) |
|---|
| 2302 | #else |
|---|
| 2303 | #define BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ) \ |
|---|
| 2304 | { \ |
|---|
| 2305 | /* if the source format is 422 and the source x is odd, then adjust source x and source address to make it even */ \ |
|---|
| 2306 | if( BGRC_PACKET_P_GET_REG_FIELD(SRC_SURFACE_FORMAT_DEF_1, FORMAT_TYPE) == M2MC_FT_YCbCr422 ) \ |
|---|
| 2307 | { \ |
|---|
| 2308 | if( src_pos & 1 ) \ |
|---|
| 2309 | { \ |
|---|
| 2310 | src_pos &= ~1; \ |
|---|
| 2311 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, BGRC_PACKET_P_GET_REG(SRC_SURFACE_ADDR_0) + 2 ); \ |
|---|
| 2312 | } \ |
|---|
| 2313 | else \ |
|---|
| 2314 | { \ |
|---|
| 2315 | BGRC_PACKET_P_STORE_REG( SRC_SURFACE_ADDR_0, BGRC_PACKET_P_GET_REG(SRC_SURFACE_ADDR_0) & (~3) ); \ |
|---|
| 2316 | } \ |
|---|
| 2317 | } \ |
|---|
| 2318 | } |
|---|
| 2319 | #endif |
|---|
| 2320 | #endif |
|---|
| 2321 | |
|---|
| 2322 | #if 0/*def BGRC_M2MC(BLIT_CTRL_BLOCK_AUTO_SPLIT_FIFO_MASK)*/ |
|---|
| 2323 | #define BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_1_SRC( x0, w0 ) \ |
|---|
| 2324 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, BLOCK_AUTO_SPLIT_FIFO, DISABLE, ENABLE, \ |
|---|
| 2325 | (x0 & 7) && (w0 >= 57) && (w0 <= 64) ) |
|---|
| 2326 | #define BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_2_SRC( x0, w0, x1, w1 ) \ |
|---|
| 2327 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, BLOCK_AUTO_SPLIT_FIFO, DISABLE, ENABLE, ( \ |
|---|
| 2328 | (x0 & 7) && (w0 >= 57) && (w0 <= 64)) || ( \ |
|---|
| 2329 | (x1 & 7) && (w1 >= 57) && (w1 <= 64)) ) |
|---|
| 2330 | #else |
|---|
| 2331 | #define BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_1_SRC( x0, w0 ) |
|---|
| 2332 | #define BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_2_SRC( x0, w0, x1, w1 ) |
|---|
| 2333 | #endif |
|---|
| 2334 | |
|---|
| 2335 | /***************************************************************************/ |
|---|
| 2336 | static void BGRC_PACKET_P_SubmitCopyBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2337 | { |
|---|
| 2338 | BM2MC_PACKET_PacketCopyBlit *packet = (BM2MC_PACKET_PacketCopyBlit *) header; |
|---|
| 2339 | uint32_t src_pos = packet->src_rect.x | ((uint32_t) packet->src_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2340 | uint32_t out_pos = packet->out_point.x | ((uint32_t) packet->out_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2341 | uint32_t size = packet->src_rect.height | ((uint32_t) packet->src_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2342 | |
|---|
| 2343 | BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ); |
|---|
| 2344 | |
|---|
| 2345 | BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_1_SRC( packet->src_rect.x, packet->src_rect.width ); |
|---|
| 2346 | |
|---|
| 2347 | BGRC_PACKET_P_DEBUG_PRINT( "-- CopyBlit " ); |
|---|
| 2348 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, DISABLE ); |
|---|
| 2349 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos, size, 0, 0, out_pos, size, out_pos, size ); |
|---|
| 2350 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2351 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2352 | } |
|---|
| 2353 | |
|---|
| 2354 | /***************************************************************************/ |
|---|
| 2355 | static void BGRC_PACKET_P_SubmitBlendBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2356 | { |
|---|
| 2357 | BM2MC_PACKET_PacketBlendBlit *packet = (BM2MC_PACKET_PacketBlendBlit *) header; |
|---|
| 2358 | uint32_t src_pos = packet->src_rect.x | ((uint32_t) packet->src_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2359 | uint32_t out_pos = packet->out_point.x | ((uint32_t) packet->out_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2360 | uint32_t dst_pos = packet->dst_point.x | ((uint32_t) packet->dst_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2361 | uint32_t size = packet->src_rect.height | ((uint32_t) packet->src_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2362 | |
|---|
| 2363 | BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ); |
|---|
| 2364 | |
|---|
| 2365 | BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_2_SRC( packet->src_rect.x, packet->src_rect.width, packet->dst_point.x, packet->src_rect.width ); |
|---|
| 2366 | |
|---|
| 2367 | BGRC_PACKET_P_DEBUG_PRINT( "-- BlendBlit " ); |
|---|
| 2368 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, DISABLE ); |
|---|
| 2369 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos, size, 0, 0, dst_pos, size, out_pos, size ); |
|---|
| 2370 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2371 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2372 | } |
|---|
| 2373 | |
|---|
| 2374 | /***************************************************************************/ |
|---|
| 2375 | #if defined(BCHP_M2MC_HORIZ_SCALER_0_STEP_reserved0_SHIFT) |
|---|
| 2376 | #else |
|---|
| 2377 | #define BCHP_M2MC_HORIZ_SCALER_0_STEP_reserved0_SHIFT BCHP_M2MC_HORIZ_SCALER_STEP_reserved0_SHIFT |
|---|
| 2378 | #endif |
|---|
| 2379 | |
|---|
| 2380 | #define BGRC_PACKET_P_SCALER_STEP_FRAC_BITS (BGRC_M2MC(HORIZ_SCALER_0_STEP_reserved0_SHIFT) - 4) |
|---|
| 2381 | #define BGRC_PACKET_P_SCALER_STEP_FRAC_ONE (1 << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) |
|---|
| 2382 | #define BGRC_PACKET_P_SCALER_STEP_FRAC_MASK (BGRC_PACKET_P_SCALER_STEP_FRAC_ONE - 1) |
|---|
| 2383 | #define BGRC_PACKET_P_SCALER_STRIPE_MAX 128 |
|---|
| 2384 | #define BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - 16) |
|---|
| 2385 | #define BGRC_PACKET_P_SCALER_WIDTH_TO_INT_SHIFT (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT) |
|---|
| 2386 | #define BGRC_PACKET_P_SCALER_HALF_SIZE 4095 |
|---|
| 2387 | |
|---|
| 2388 | #define BGRC_PACKET_P_FIXED_SHIFT_RIGHT( data, shift ) \ |
|---|
| 2389 | (((data) >> (shift)) | (((data) & 0x80000000) ? ~(0xFFFFFFFF >> (shift)) : 0)) |
|---|
| 2390 | |
|---|
| 2391 | #if (BCHP_CHIP==7038) |
|---|
| 2392 | #define BGRC_PACKET_P_SCALER_STRIPE_OVERLAP 2 |
|---|
| 2393 | #else |
|---|
| 2394 | #define BGRC_PACKET_P_SCALER_STRIPE_OVERLAP 3 |
|---|
| 2395 | #endif |
|---|
| 2396 | |
|---|
| 2397 | /***************************************************************************/ |
|---|
| 2398 | static void BGRC_PACKET_P_SetScaler( BGRC_PacketContext_Handle hContext, BGRC_PACKET_P_Scaler *scaler, |
|---|
| 2399 | BM2MC_PACKET_Rectangle *src_rect, BM2MC_PACKET_Rectangle *out_rect, |
|---|
| 2400 | uint32_t hor_luma_phase, uint32_t hor_chroma_phase, uint32_t ver_luma_phase, uint32_t ver_chroma_phase, |
|---|
| 2401 | uint32_t hor_step, uint32_t ver_step, uint32_t shift ) |
|---|
| 2402 | { |
|---|
| 2403 | uint32_t hor_shift_adjust = (src_rect->width > BGRC_PACKET_P_SCALER_HALF_SIZE) ? 1 : 0; |
|---|
| 2404 | uint32_t ver_shift_adjust = (src_rect->height > BGRC_PACKET_P_SCALER_HALF_SIZE) ? 1 : 0; |
|---|
| 2405 | uint32_t actual_hor_step = (((uint32_t) src_rect->width << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - hor_shift_adjust)) / out_rect->width) << hor_shift_adjust; |
|---|
| 2406 | uint32_t actual_ver_step = (((uint32_t) src_rect->height << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - ver_shift_adjust)) / out_rect->height) << ver_shift_adjust; |
|---|
| 2407 | |
|---|
| 2408 | BSTD_UNUSED(hContext); |
|---|
| 2409 | |
|---|
| 2410 | /* calculate scaler steps and initial phases */ |
|---|
| 2411 | scaler->hor_step = hor_step << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2412 | if( scaler->hor_step || (hor_step == BM2MC_PACKET_FIXED_SCALE_STEP_ZERO) ) |
|---|
| 2413 | { |
|---|
| 2414 | scaler->hor_step &= ~BM2MC_PACKET_FIXED_SCALE_STEP_ZERO; |
|---|
| 2415 | scaler->hor_phase = hor_luma_phase << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2416 | scaler->hor_chroma_phase = hor_chroma_phase << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2417 | } |
|---|
| 2418 | else |
|---|
| 2419 | { |
|---|
| 2420 | scaler->hor_step = actual_hor_step; |
|---|
| 2421 | scaler->hor_phase = BGRC_PACKET_P_FIXED_SHIFT_RIGHT(scaler->hor_step - BGRC_PACKET_P_SCALER_STEP_FRAC_MASK - 1, 1); |
|---|
| 2422 | scaler->hor_chroma_phase = 0; |
|---|
| 2423 | } |
|---|
| 2424 | |
|---|
| 2425 | scaler->ver_step = ver_step << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2426 | if( scaler->ver_step || (ver_step == BM2MC_PACKET_FIXED_SCALE_STEP_ZERO) ) |
|---|
| 2427 | { |
|---|
| 2428 | scaler->ver_step &= ~BM2MC_PACKET_FIXED_SCALE_STEP_ZERO; |
|---|
| 2429 | scaler->ver_phase = ver_luma_phase << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2430 | scaler->ver_chroma_phase = ver_chroma_phase << (BGRC_PACKET_P_SCALER_STEP_FRAC_BITS - shift); |
|---|
| 2431 | } |
|---|
| 2432 | else |
|---|
| 2433 | { |
|---|
| 2434 | scaler->ver_step = actual_ver_step; |
|---|
| 2435 | scaler->ver_phase = BGRC_PACKET_P_FIXED_SHIFT_RIGHT(scaler->ver_step - BGRC_PACKET_P_SCALER_STEP_FRAC_MASK - 1, 1); |
|---|
| 2436 | scaler->ver_chroma_phase = 0; |
|---|
| 2437 | } |
|---|
| 2438 | |
|---|
| 2439 | #if 0 |
|---|
| 2440 | /* set vertical phase to the minimum allowed value when vertically down scaling 4x or greater */ |
|---|
| 2441 | if( (actual_hor_step > scaler->hor_step) || (actual_ver_step > scaler->ver_step) ) |
|---|
| 2442 | { |
|---|
| 2443 | int32_t hor_step_diff = (actual_hor_step - scaler->hor_step) * out_rect->width; |
|---|
| 2444 | int32_t ver_step_diff = (actual_ver_step - scaler->ver_step) * out_rect->height; |
|---|
| 2445 | |
|---|
| 2446 | if( (scaler->ver_step > BGRC_PACKET_P_SCALER_STEP_FRAC_ONE) && |
|---|
| 2447 | ((scaler->ver_step + hor_step_diff + ver_step_diff) >> BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) >= 4 ) |
|---|
| 2448 | { |
|---|
| 2449 | uint32_t min_phase = scaler->ver_step - (4L << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS); |
|---|
| 2450 | |
|---|
| 2451 | if( actual_hor_step > scaler->hor_step ) |
|---|
| 2452 | min_phase += hor_step_diff; |
|---|
| 2453 | |
|---|
| 2454 | if( actual_ver_step > scaler->ver_step ) |
|---|
| 2455 | min_phase += ver_step_diff; |
|---|
| 2456 | |
|---|
| 2457 | if( (int32_t) scaler->ver_phase < (int32_t) min_phase ) |
|---|
| 2458 | scaler->ver_phase = min_phase; |
|---|
| 2459 | } |
|---|
| 2460 | } |
|---|
| 2461 | #endif |
|---|
| 2462 | |
|---|
| 2463 | #if 0 |
|---|
| 2464 | #if (BCHP_CHIP==7038) |
|---|
| 2465 | /* to fix artifact set vertical phase to -1 when using a horizontal step of 0 */ |
|---|
| 2466 | if( (src_rect->width == 1) && (hor_step == BM2MC_PACKET_FIXED_SCALE_STEP_ZERO) ) |
|---|
| 2467 | scaler->ver_phase = -(1 << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS); |
|---|
| 2468 | #endif |
|---|
| 2469 | #endif |
|---|
| 2470 | |
|---|
| 2471 | /* check if striping is required */ |
|---|
| 2472 | if( (src_rect->width > BGRC_PACKET_P_SCALER_STRIPE_MAX) && (out_rect->width > BGRC_PACKET_P_SCALER_STRIPE_MAX) ) |
|---|
| 2473 | { |
|---|
| 2474 | /* calculate stripe overlap */ |
|---|
| 2475 | scaler->stripe_overlap = ((scaler->hor_step + BGRC_PACKET_P_SCALER_STEP_FRAC_MASK) >> |
|---|
| 2476 | BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) + BGRC_PACKET_P_SCALER_STRIPE_OVERLAP; |
|---|
| 2477 | if( scaler->stripe_overlap > BGRC_PACKET_P_SCALER_STRIPE_OVERLAP * 2 ) |
|---|
| 2478 | scaler->stripe_overlap = BGRC_PACKET_P_SCALER_STRIPE_OVERLAP * 2; |
|---|
| 2479 | |
|---|
| 2480 | /* calculate output stripe width */ |
|---|
| 2481 | scaler->output_stripe_width = BGRC_PACKET_P_SCALER_STRIPE_MAX - scaler->stripe_overlap * 2; |
|---|
| 2482 | |
|---|
| 2483 | if( src_rect->width < out_rect->width ) |
|---|
| 2484 | scaler->output_stripe_width = (scaler->output_stripe_width << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) / scaler->hor_step; |
|---|
| 2485 | |
|---|
| 2486 | if( scaler->output_stripe_width & 1 ) |
|---|
| 2487 | scaler->output_stripe_width--; |
|---|
| 2488 | |
|---|
| 2489 | /* make sure last stripe is at least two pixels for both source and output */ |
|---|
| 2490 | if( (scaler->output_stripe_width > 2) && ((out_rect->width % scaler->output_stripe_width) < 2) ) |
|---|
| 2491 | scaler->output_stripe_width -= 2; |
|---|
| 2492 | |
|---|
| 2493 | scaler->input_stripe_width = (scaler->output_stripe_width * scaler->hor_step) >> BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT; |
|---|
| 2494 | while( scaler->input_stripe_width && (scaler->output_stripe_width > 2) && ( |
|---|
| 2495 | ((out_rect->width % scaler->output_stripe_width) < 4) || |
|---|
| 2496 | ((((uint32_t) src_rect->width << 16) % scaler->input_stripe_width) < (2L << 16)) || |
|---|
| 2497 | ((((uint32_t) src_rect->width << 16) / scaler->input_stripe_width) != (out_rect->width / scaler->output_stripe_width))) ) |
|---|
| 2498 | { |
|---|
| 2499 | scaler->output_stripe_width -= 2; |
|---|
| 2500 | scaler->input_stripe_width = (scaler->output_stripe_width * scaler->hor_step) >> BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT; |
|---|
| 2501 | } |
|---|
| 2502 | |
|---|
| 2503 | if( (scaler->output_stripe_width > 2) && ((out_rect->width % scaler->output_stripe_width) < 2) ) |
|---|
| 2504 | scaler->output_stripe_width -= 2; |
|---|
| 2505 | |
|---|
| 2506 | #if defined(BCHP_M2MC_BLIT_CTRL_BLOCK_AUTO_SPLIT_FIFO_MASK) |
|---|
| 2507 | { |
|---|
| 2508 | /* make sure last stripe is less pixels than the rest */ |
|---|
| 2509 | uint32_t scale_factor = (BGRC_PACKET_P_SCALER_STEP_FRAC_ONE << 2) / scaler->hor_step + 1; |
|---|
| 2510 | if( (scaler->output_stripe_width > 2) && ((out_rect->width % scaler->output_stripe_width) >= scaler->output_stripe_width - scale_factor) ) |
|---|
| 2511 | scaler->output_stripe_width += 2; |
|---|
| 2512 | } |
|---|
| 2513 | #endif |
|---|
| 2514 | |
|---|
| 2515 | /* calculate input stripe width */ |
|---|
| 2516 | scaler->input_stripe_width = (scaler->output_stripe_width * scaler->hor_step) >> BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT; |
|---|
| 2517 | if( scaler->output_stripe_width > 0 ) |
|---|
| 2518 | scaler->stripe_count = (out_rect->width + scaler->output_stripe_width - 1) / scaler->output_stripe_width; |
|---|
| 2519 | else |
|---|
| 2520 | scaler->stripe_count = 1; |
|---|
| 2521 | } |
|---|
| 2522 | else |
|---|
| 2523 | { |
|---|
| 2524 | scaler->stripe_overlap = 0; |
|---|
| 2525 | scaler->output_stripe_width = 0; |
|---|
| 2526 | scaler->input_stripe_width = 0; |
|---|
| 2527 | scaler->stripe_count = 1; |
|---|
| 2528 | } |
|---|
| 2529 | } |
|---|
| 2530 | |
|---|
| 2531 | /***************************************************************************/ |
|---|
| 2532 | static void BGRC_PACKET_P_SetStriping( BGRC_PacketContext_Handle hContext, |
|---|
| 2533 | BM2MC_PACKET_Rectangle *src_rect, BM2MC_PACKET_Rectangle *out_rect, BM2MC_PACKET_Point *dst_point, |
|---|
| 2534 | BGRC_PACKET_P_Scaler *scaler, BGRC_PACKET_P_Stripe *stripe, uint32_t stripe_num ) |
|---|
| 2535 | { |
|---|
| 2536 | stripe->hor_phase = scaler->hor_phase; |
|---|
| 2537 | stripe->src_x = src_rect->x; |
|---|
| 2538 | stripe->dst_x = dst_point->x; |
|---|
| 2539 | stripe->out_x = out_rect->x; |
|---|
| 2540 | |
|---|
| 2541 | if( scaler->stripe_count <= 1 ) |
|---|
| 2542 | { |
|---|
| 2543 | stripe->src_width = src_rect->width; |
|---|
| 2544 | stripe->out_width = out_rect->width; |
|---|
| 2545 | } |
|---|
| 2546 | else |
|---|
| 2547 | { |
|---|
| 2548 | /* adjust phase and positions for all but the first stripe */ |
|---|
| 2549 | if( stripe_num > 0 ) |
|---|
| 2550 | { |
|---|
| 2551 | uint32_t input_stripe_start = scaler->input_stripe_width * stripe_num; |
|---|
| 2552 | uint32_t output_stripe_start = scaler->output_stripe_width * stripe_num; |
|---|
| 2553 | uint32_t fixed_phase = BGRC_PACKET_P_FIXED_SHIFT_RIGHT(stripe->hor_phase, BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT); |
|---|
| 2554 | uint32_t fixed_left = fixed_phase + input_stripe_start; |
|---|
| 2555 | uint32_t pad_left = BGRC_PACKET_P_SCALER_STRIPE_OVERLAP; |
|---|
| 2556 | |
|---|
| 2557 | stripe->src_x += BGRC_PACKET_P_FIXED_SHIFT_RIGHT(fixed_left, BGRC_PACKET_P_SCALER_WIDTH_TO_INT_SHIFT) - BGRC_PACKET_P_SCALER_STRIPE_OVERLAP; |
|---|
| 2558 | stripe->dst_x += output_stripe_start; |
|---|
| 2559 | stripe->out_x += output_stripe_start; |
|---|
| 2560 | |
|---|
| 2561 | stripe->hor_phase += input_stripe_start << BGRC_PACKET_P_SCALER_STEP_TO_WIDTH_SHIFT; |
|---|
| 2562 | stripe->hor_phase &= BGRC_PACKET_P_SCALER_STEP_FRAC_MASK; |
|---|
| 2563 | stripe->hor_phase += pad_left << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS; |
|---|
| 2564 | } |
|---|
| 2565 | |
|---|
| 2566 | /* adjust widths */ |
|---|
| 2567 | if( stripe_num < scaler->stripe_count - 1 ) |
|---|
| 2568 | { |
|---|
| 2569 | stripe->src_width = (scaler->input_stripe_width >> BGRC_PACKET_P_SCALER_WIDTH_TO_INT_SHIFT) + BGRC_PACKET_P_SCALER_STRIPE_OVERLAP; |
|---|
| 2570 | if( stripe_num > 0 ) |
|---|
| 2571 | stripe->src_width += BGRC_PACKET_P_SCALER_STRIPE_OVERLAP; |
|---|
| 2572 | stripe->out_width = scaler->output_stripe_width; |
|---|
| 2573 | } |
|---|
| 2574 | else |
|---|
| 2575 | { |
|---|
| 2576 | stripe->src_width = src_rect->width - (stripe->src_x - src_rect->x); |
|---|
| 2577 | stripe->out_width = out_rect->width - scaler->output_stripe_width * (scaler->stripe_count - 1); |
|---|
| 2578 | } |
|---|
| 2579 | |
|---|
| 2580 | /* adjust output x for horizontal output mirroring */ |
|---|
| 2581 | if( BGRC_PACKET_P_GET_REG(BLIT_CTRL) & BGRC_M2MC(BLIT_CTRL_OUTPUT_H_DIRECTION_MASK) ) |
|---|
| 2582 | { |
|---|
| 2583 | stripe->out_x = out_rect->x; |
|---|
| 2584 | if( stripe_num < scaler->stripe_count - 1 ) |
|---|
| 2585 | stripe->out_x += out_rect->width - scaler->output_stripe_width * (scaler->stripe_count - 1); |
|---|
| 2586 | if( stripe_num < scaler->stripe_count - 2 ) |
|---|
| 2587 | stripe->out_x += scaler->output_stripe_width * (scaler->stripe_count - stripe_num - 2); |
|---|
| 2588 | } |
|---|
| 2589 | |
|---|
| 2590 | /* adjust destination x for horizontal destination mirroring */ |
|---|
| 2591 | if( BGRC_PACKET_P_GET_REG(BLIT_CTRL) & BGRC_M2MC(BLIT_CTRL_DEST_H_DIRECTION_MASK) ) |
|---|
| 2592 | { |
|---|
| 2593 | stripe->dst_x = dst_point->x; |
|---|
| 2594 | if( stripe_num < scaler->stripe_count - 1 ) |
|---|
| 2595 | stripe->dst_x += out_rect->width - scaler->output_stripe_width * (scaler->stripe_count - 1); |
|---|
| 2596 | if( stripe_num < scaler->stripe_count - 2 ) |
|---|
| 2597 | stripe->dst_x += scaler->output_stripe_width * (scaler->stripe_count - stripe_num - 2); |
|---|
| 2598 | } |
|---|
| 2599 | } |
|---|
| 2600 | |
|---|
| 2601 | #if (BCHP_CHIP!=7038) |
|---|
| 2602 | /* need even stripe width for YCbCr422 surfaces */ |
|---|
| 2603 | if( (stripe->src_x & 1) && (BGRC_PACKET_P_GET_REG_FIELD(SRC_SURFACE_FORMAT_DEF_1, FORMAT_TYPE) == M2MC_FT_YCbCr422) ) |
|---|
| 2604 | { |
|---|
| 2605 | stripe->src_x--; |
|---|
| 2606 | stripe->hor_phase += 1L << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS; |
|---|
| 2607 | stripe->src_width++; |
|---|
| 2608 | } |
|---|
| 2609 | #endif |
|---|
| 2610 | } |
|---|
| 2611 | |
|---|
| 2612 | /***************************************************************************/ |
|---|
| 2613 | static void BGRC_PACKET_P_SubmitScaleBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2614 | { |
|---|
| 2615 | BM2MC_PACKET_PacketScaleBlit *packet = (BM2MC_PACKET_PacketScaleBlit *) header; |
|---|
| 2616 | uint32_t src_pos = packet->src_rect.x | ((uint32_t) packet->src_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2617 | uint32_t out_pos = packet->out_rect.x | ((uint32_t) packet->out_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2618 | uint32_t src_size = packet->src_rect.height | ((uint32_t) packet->src_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2619 | uint32_t out_size = packet->out_rect.height | ((uint32_t) packet->out_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2620 | |
|---|
| 2621 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 2622 | hContext->fixed_scale.hor_phase, 0, hContext->fixed_scale.ver_phase, 0, |
|---|
| 2623 | hContext->fixed_scale.hor_step, hContext->fixed_scale.ver_step, hContext->fixed_scale.shift ); |
|---|
| 2624 | hContext->scaler_header = header; |
|---|
| 2625 | |
|---|
| 2626 | BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ); |
|---|
| 2627 | |
|---|
| 2628 | BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_1_SRC( packet->src_rect.x, packet->src_rect.width ); |
|---|
| 2629 | |
|---|
| 2630 | BGRC_PACKET_P_DEBUG_PRINT( "-- ScaleBlit " ); |
|---|
| 2631 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, STRIPE_ENABLE, DISABLE, ENABLE, hContext->scaler.stripe_count > 1 ); |
|---|
| 2632 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos, src_size, 0, 0, out_pos, out_size, out_pos, out_size ); |
|---|
| 2633 | BGRC_PACKET_P_STORE_REG( BLIT_INPUT_STRIPE_WIDTH, hContext->scaler.input_stripe_width ); |
|---|
| 2634 | BGRC_PACKET_P_STORE_REG( BLIT_OUTPUT_STRIPE_WIDTH, hContext->scaler.output_stripe_width ); |
|---|
| 2635 | BGRC_PACKET_P_STORE_REG( BLIT_STRIPE_OVERLAP, hContext->scaler.stripe_overlap ); |
|---|
| 2636 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2637 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2638 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2639 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2640 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, packet->src_rect.width >= packet->out_rect.width ); |
|---|
| 2641 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, hContext->scaler.hor_phase, hContext->scaler.hor_step ); |
|---|
| 2642 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2643 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, 0, 0 ); |
|---|
| 2644 | #endif |
|---|
| 2645 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, hContext->scaler.ver_phase, hContext->scaler.ver_step ); |
|---|
| 2646 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2647 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, 0, 0 ); |
|---|
| 2648 | #endif |
|---|
| 2649 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2650 | } |
|---|
| 2651 | |
|---|
| 2652 | /***************************************************************************/ |
|---|
| 2653 | static void BGRC_PACKET_P_SubmitStripeBlitPacket( BGRC_PacketContext_Handle hContext, |
|---|
| 2654 | BM2MC_PACKET_Rectangle *src_rect, BM2MC_PACKET_Rectangle *out_rect, BM2MC_PACKET_Point *dst_point ) |
|---|
| 2655 | { |
|---|
| 2656 | BGRC_PACKET_P_Stripe stripe; |
|---|
| 2657 | BGRC_PACKET_P_SetStriping( hContext, src_rect, out_rect, dst_point, &hContext->scaler, &stripe, hContext->scaler.stripe_num ); |
|---|
| 2658 | hContext->scaler.stripe_num++; |
|---|
| 2659 | |
|---|
| 2660 | { |
|---|
| 2661 | uint32_t src_pos = stripe.src_x | ((uint32_t) src_rect->y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2662 | uint32_t out_pos = stripe.out_x | ((uint32_t) out_rect->y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2663 | uint32_t dst_pos = stripe.dst_x | ((uint32_t) dst_point->y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2664 | uint32_t src_size = src_rect->height | ((uint32_t) stripe.src_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2665 | uint32_t out_size = out_rect->height | ((uint32_t) stripe.out_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2666 | |
|---|
| 2667 | BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ); |
|---|
| 2668 | |
|---|
| 2669 | BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_2_SRC( stripe.src_x, stripe.src_width, stripe.dst_x, stripe.out_width ); |
|---|
| 2670 | |
|---|
| 2671 | BGRC_PACKET_P_DEBUG_PRINT( "-- StripeBlit " ); |
|---|
| 2672 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2673 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos, src_size, 0, 0, dst_pos, out_size, out_pos, out_size ); |
|---|
| 2674 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2675 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2676 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2677 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2678 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, stripe.src_width >= stripe.out_width ); |
|---|
| 2679 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, stripe.hor_phase, hContext->scaler.hor_step ); |
|---|
| 2680 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2681 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, 0, 0 ); |
|---|
| 2682 | #endif |
|---|
| 2683 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, hContext->scaler.ver_phase, hContext->scaler.ver_step ); |
|---|
| 2684 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2685 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, 0, 0 ); |
|---|
| 2686 | #endif |
|---|
| 2687 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2688 | } |
|---|
| 2689 | } |
|---|
| 2690 | |
|---|
| 2691 | /***************************************************************************/ |
|---|
| 2692 | static void BGRC_PACKET_P_SubmitScaleBlendBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2693 | { |
|---|
| 2694 | BM2MC_PACKET_PacketScaleBlendBlit *packet = (BM2MC_PACKET_PacketScaleBlendBlit *) header; |
|---|
| 2695 | |
|---|
| 2696 | if( hContext->scaler.stripe_num == 0 ) |
|---|
| 2697 | { |
|---|
| 2698 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 2699 | hContext->fixed_scale.hor_phase, 0, hContext->fixed_scale.ver_phase, 0, |
|---|
| 2700 | hContext->fixed_scale.hor_step, hContext->fixed_scale.ver_step, hContext->fixed_scale.shift ); |
|---|
| 2701 | hContext->scaler_header = header; |
|---|
| 2702 | } |
|---|
| 2703 | |
|---|
| 2704 | BGRC_PACKET_P_SubmitStripeBlitPacket( hContext, &packet->src_rect, &packet->out_rect, &packet->dst_point ); |
|---|
| 2705 | } |
|---|
| 2706 | |
|---|
| 2707 | /***************************************************************************/ |
|---|
| 2708 | static void BGRC_PACKET_P_SubmitUpdateScaleBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2709 | { |
|---|
| 2710 | BM2MC_PACKET_PacketUpdateScaleBlit *packet = (BM2MC_PACKET_PacketUpdateScaleBlit *) header; |
|---|
| 2711 | uint32_t shift = BGRC_PACKET_P_SCALER_STEP_FRAC_BITS; |
|---|
| 2712 | |
|---|
| 2713 | uint32_t hor_step = ((uint32_t) packet->src_rect.width << shift) / packet->out_rect.width; |
|---|
| 2714 | uint32_t ver_step = ((uint32_t) packet->src_rect.height << shift) / packet->out_rect.height; |
|---|
| 2715 | |
|---|
| 2716 | uint32_t offset_x = packet->update_rect.x * hor_step; |
|---|
| 2717 | uint32_t offset_y = packet->update_rect.y * ver_step; |
|---|
| 2718 | |
|---|
| 2719 | uint32_t src_x0 = packet->src_rect.x; |
|---|
| 2720 | uint32_t src_y0 = packet->src_rect.y; |
|---|
| 2721 | uint32_t src_x1 = packet->src_rect.x + packet->src_rect.width; |
|---|
| 2722 | uint32_t src_y1 = packet->src_rect.y + packet->src_rect.height; |
|---|
| 2723 | |
|---|
| 2724 | uint32_t scale_x0 = ((uint32_t) packet->update_rect.x * hor_step) >> shift; |
|---|
| 2725 | uint32_t scale_y0 = ((uint32_t) packet->update_rect.y * ver_step) >> shift; |
|---|
| 2726 | uint32_t scale_x1 = ((uint32_t) (packet->update_rect.x + packet->update_rect.width) * hor_step) >> shift; |
|---|
| 2727 | uint32_t scale_y1 = ((uint32_t) (packet->update_rect.y + packet->update_rect.height) * ver_step) >> shift; |
|---|
| 2728 | |
|---|
| 2729 | uint32_t pad = 2; |
|---|
| 2730 | uint32_t pad_x0 = ((scale_x0 > src_x0 + pad) ? scale_x0 - pad : src_x0); |
|---|
| 2731 | uint32_t pad_y0 = ((scale_y0 > src_y0 + pad) ? scale_y0 - pad : src_y0); |
|---|
| 2732 | uint32_t pad_x1 = ((scale_x1 + pad < src_x1) ? scale_x1 + pad : src_x1); |
|---|
| 2733 | uint32_t pad_y1 = ((scale_y1 + pad < src_y1) ? scale_y1 + pad : src_y1); |
|---|
| 2734 | |
|---|
| 2735 | uint32_t hor_phase = (((uint32_t) scale_x0 - pad_x0) << shift) + (offset_x & BGRC_PACKET_P_SCALER_STEP_FRAC_MASK) + |
|---|
| 2736 | BGRC_PACKET_P_FIXED_SHIFT_RIGHT(hor_step - BGRC_PACKET_P_SCALER_STEP_FRAC_MASK - 1, 1); |
|---|
| 2737 | uint32_t ver_phase = (((uint32_t) scale_y0 - pad_y0) << shift) + (offset_y & BGRC_PACKET_P_SCALER_STEP_FRAC_MASK) + |
|---|
| 2738 | BGRC_PACKET_P_FIXED_SHIFT_RIGHT(ver_step - BGRC_PACKET_P_SCALER_STEP_FRAC_MASK - 1, 1); |
|---|
| 2739 | |
|---|
| 2740 | bool adjust_ver = (packet->update_rect.height == 1) && ((ver_phase >> BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) >= 3); |
|---|
| 2741 | uint32_t new_ver_phase = ver_phase - (adjust_ver ? 0x100000 : 0); |
|---|
| 2742 | uint32_t new_pad_y0 = pad_y0 + (adjust_ver ? 1 : 0); |
|---|
| 2743 | |
|---|
| 2744 | uint32_t src_pos = pad_x0 | (new_pad_y0 << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2745 | uint32_t out_pos = packet->update_rect.x | ((uint32_t) packet->update_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2746 | uint32_t src_size = (pad_y1 - new_pad_y0) | ((pad_x1 - pad_x0) << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2747 | uint32_t out_size = packet->update_rect.height | ((uint32_t) packet->update_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2748 | |
|---|
| 2749 | BM2MC_PACKET_Rectangle src_rect; |
|---|
| 2750 | src_rect.x = pad_x0; |
|---|
| 2751 | src_rect.y = pad_y0; |
|---|
| 2752 | src_rect.width = pad_x1 - pad_x0; |
|---|
| 2753 | src_rect.height = pad_y1 - new_pad_y0; |
|---|
| 2754 | |
|---|
| 2755 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &src_rect, &packet->update_rect, |
|---|
| 2756 | hor_phase, 0, new_ver_phase, 0, hor_step, ver_step, shift ); |
|---|
| 2757 | hContext->scaler_header = header; |
|---|
| 2758 | |
|---|
| 2759 | hContext->scaler.input_stripe_width += 0x7FFF; |
|---|
| 2760 | hContext->scaler.input_stripe_width &= ~0x7FFF; |
|---|
| 2761 | |
|---|
| 2762 | BGRC_PACKET_P_422_ODD_POSITION_FIX( src_pos ); |
|---|
| 2763 | |
|---|
| 2764 | BGRC_PACKET_P_BLOCK_SPLIT_FIFO_FIX_2_SRC( pad_x, pad_w, packet->update_rect.x, packet->update_rect.width ); |
|---|
| 2765 | |
|---|
| 2766 | BGRC_PACKET_P_DEBUG_PRINT( "-- UpdateScaleBlit " ); |
|---|
| 2767 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, STRIPE_ENABLE, DISABLE, ENABLE, hContext->scaler.stripe_count > 1 ); |
|---|
| 2768 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos, src_size, 0, 0, out_pos, out_size, out_pos, out_size ); |
|---|
| 2769 | BGRC_PACKET_P_STORE_REG( BLIT_INPUT_STRIPE_WIDTH, hContext->scaler.input_stripe_width ); |
|---|
| 2770 | BGRC_PACKET_P_STORE_REG( BLIT_OUTPUT_STRIPE_WIDTH, hContext->scaler.output_stripe_width ); |
|---|
| 2771 | BGRC_PACKET_P_STORE_REG( BLIT_STRIPE_OVERLAP, hContext->scaler.stripe_overlap ); |
|---|
| 2772 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2773 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2774 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2775 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2776 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, packet->src_rect.width >= packet->out_rect.width ); |
|---|
| 2777 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, hor_phase, hor_step ); |
|---|
| 2778 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2779 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, 0, 0 ); |
|---|
| 2780 | #endif |
|---|
| 2781 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, ver_phase, ver_step ); |
|---|
| 2782 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2783 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, 0, 0 ); |
|---|
| 2784 | #endif |
|---|
| 2785 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2786 | } |
|---|
| 2787 | |
|---|
| 2788 | /***************************************************************************/ |
|---|
| 2789 | #if (BCHP_CHIP==7401) || (BCHP_CHIP==7400) |
|---|
| 2790 | #define BGRC_PACKET_P_SW_DESTRIPE |
|---|
| 2791 | #endif |
|---|
| 2792 | |
|---|
| 2793 | /***************************************************************************/ |
|---|
| 2794 | static void BGRC_PACKET_P_SubmitDestripeBlitPacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 2795 | { |
|---|
| 2796 | #if defined(BCHP_M2MC_BLIT_SRC_STRIPE_HEIGHT_WIDTH_0) |
|---|
| 2797 | #ifdef BGRC_PACKET_P_SW_DESTRIPE |
|---|
| 2798 | |
|---|
| 2799 | #if 1 |
|---|
| 2800 | |
|---|
| 2801 | BM2MC_PACKET_PacketDestripeBlit *packet = (BM2MC_PACKET_PacketDestripeBlit *) header; |
|---|
| 2802 | BGRC_PACKET_P_Stripe stripe; |
|---|
| 2803 | |
|---|
| 2804 | if( hContext->scaler.stripe_num == 0 ) |
|---|
| 2805 | { |
|---|
| 2806 | uint32_t hor_luma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_phase : hContext->fixed_scale.hor_phase; |
|---|
| 2807 | uint32_t ver_luma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_phase : hContext->fixed_scale.ver_phase; |
|---|
| 2808 | uint32_t hor_chroma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_chroma_phase : (hContext->fixed_scale.hor_phase / 2); |
|---|
| 2809 | uint32_t ver_chroma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_chroma_phase : (hContext->fixed_scale.ver_phase / 2); |
|---|
| 2810 | uint32_t hor_luma_step = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_step : hContext->fixed_scale.hor_step; |
|---|
| 2811 | uint32_t ver_luma_step = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_step : hContext->fixed_scale.ver_step; |
|---|
| 2812 | uint32_t shift = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.shift : hContext->fixed_scale.shift; |
|---|
| 2813 | |
|---|
| 2814 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 2815 | hor_luma_phase, hor_chroma_phase, ver_luma_phase, ver_chroma_phase, hor_luma_step, ver_luma_step, shift ); |
|---|
| 2816 | |
|---|
| 2817 | hContext->scaler_header = header; |
|---|
| 2818 | } |
|---|
| 2819 | |
|---|
| 2820 | BGRC_PACKET_P_SetStriping( hContext, &packet->src_rect, &packet->out_rect, &packet->dst_point, |
|---|
| 2821 | &hContext->scaler, &stripe, hContext->scaler.stripe_num ); |
|---|
| 2822 | hContext->scaler.stripe_num++; |
|---|
| 2823 | |
|---|
| 2824 | { |
|---|
| 2825 | uint32_t src_pos0 = stripe.src_x | ((uint32_t) packet->src_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2826 | uint32_t src_pos1 = (stripe.src_x / 2) | ((uint32_t) (packet->src_rect.y / 2) << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2827 | uint32_t out_pos = stripe.out_x | ((uint32_t) packet->out_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2828 | uint32_t dst_pos = stripe.dst_x | ((uint32_t) packet->dst_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2829 | uint32_t src_size0 = packet->src_rect.height | ((uint32_t) stripe.src_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2830 | uint32_t src_size1 = ((packet->src_rect.height + 1) / 2) | ((uint32_t) ((stripe.src_width + 1) / 2) << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2831 | uint32_t out_size = packet->out_rect.height | ((uint32_t) stripe.out_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2832 | uint32_t stripe_width = packet->source_stripe_width >> 7; |
|---|
| 2833 | |
|---|
| 2834 | BGRC_PACKET_P_DEBUG_PRINT( "-- DestripeBlit " ); |
|---|
| 2835 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2836 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos0, src_size0, src_pos1, src_size1, dst_pos, out_size, out_pos, out_size ); |
|---|
| 2837 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_0, stripe_width | |
|---|
| 2838 | (packet->luma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_0_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2839 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_1, stripe_width | |
|---|
| 2840 | (packet->chroma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_1_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2841 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2842 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2843 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2844 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2845 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, stripe.src_width >= stripe.out_width ); |
|---|
| 2846 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, stripe.hor_phase, hContext->scaler.hor_step ); |
|---|
| 2847 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2848 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, stripe.hor_phase / 2, hContext->scaler.hor_step / 2 ); |
|---|
| 2849 | #endif |
|---|
| 2850 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, hContext->scaler.ver_phase, hContext->scaler.ver_step ); |
|---|
| 2851 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2852 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, hContext->scaler.ver_phase / 2, hContext->scaler.ver_step / 2 ); |
|---|
| 2853 | #endif |
|---|
| 2854 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2855 | } |
|---|
| 2856 | |
|---|
| 2857 | #else |
|---|
| 2858 | |
|---|
| 2859 | BM2MC_PACKET_PacketDestripeBlit *packet = (BM2MC_PACKET_PacketDestripeBlit *) header; |
|---|
| 2860 | BGRC_PACKET_P_Stripe luma_stripe; |
|---|
| 2861 | BGRC_PACKET_P_Stripe chroma_stripe; |
|---|
| 2862 | BGRC_PACKET_P_Scaler chroma_scaler; |
|---|
| 2863 | BM2MC_PACKET_Rectangle chroma_rect; |
|---|
| 2864 | |
|---|
| 2865 | if( hContext->destripe_fixed_scale.chroma_rect.width ) |
|---|
| 2866 | { |
|---|
| 2867 | chroma_rect = hContext->destripe_fixed_scale.chroma_rect; |
|---|
| 2868 | } |
|---|
| 2869 | else |
|---|
| 2870 | { |
|---|
| 2871 | chroma_rect.x = packet->src_rect.x / 2; |
|---|
| 2872 | chroma_rect.y = packet->src_rect.y / 2; |
|---|
| 2873 | chroma_rect.width = (packet->src_rect.width + 1) / 2; |
|---|
| 2874 | chroma_rect.height = (packet->src_rect.height + 1) / 2; |
|---|
| 2875 | } |
|---|
| 2876 | |
|---|
| 2877 | if( hContext->scaler.stripe_num == 0 ) |
|---|
| 2878 | { |
|---|
| 2879 | uint32_t hor_luma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_phase : hContext->fixed_scale.hor_phase; |
|---|
| 2880 | uint32_t ver_luma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_phase : hContext->fixed_scale.ver_phase; |
|---|
| 2881 | uint32_t hor_chroma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_chroma_phase : (hContext->fixed_scale.hor_phase / 2); |
|---|
| 2882 | uint32_t ver_chroma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_chroma_phase : (hContext->fixed_scale.ver_phase / 2); |
|---|
| 2883 | uint32_t hor_luma_step = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_step : hContext->fixed_scale.hor_step; |
|---|
| 2884 | uint32_t ver_luma_step = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_step : hContext->fixed_scale.ver_step; |
|---|
| 2885 | uint32_t hor_chroma_step = (hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_step : hContext->fixed_scale.hor_step) / 2; |
|---|
| 2886 | uint32_t ver_chroma_step = (hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_step : hContext->fixed_scale.ver_step) / 2; |
|---|
| 2887 | uint32_t shift = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.shift : hContext->fixed_scale.shift; |
|---|
| 2888 | |
|---|
| 2889 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 2890 | hor_luma_phase, hor_chroma_phase, ver_luma_phase, ver_chroma_phase, hor_luma_step, ver_luma_step, shift ); |
|---|
| 2891 | BGRC_PACKET_P_SetScaler( hContext, &chroma_scaler, &chroma_rect, &packet->out_rect, |
|---|
| 2892 | hor_chroma_phase, hor_chroma_phase, ver_chroma_phase, ver_chroma_phase, hor_chroma_step, ver_chroma_step, shift ); |
|---|
| 2893 | chroma_scaler.input_stripe_width /= 2; |
|---|
| 2894 | chroma_scaler.stripe_count = hContext->scaler.stripe_count; |
|---|
| 2895 | |
|---|
| 2896 | hContext->scaler_header = header; |
|---|
| 2897 | } |
|---|
| 2898 | |
|---|
| 2899 | BGRC_PACKET_P_SetStriping( hContext, &packet->src_rect, &packet->out_rect, &packet->dst_point, |
|---|
| 2900 | &hContext->scaler, &luma_stripe, hContext->scaler.stripe_num ); |
|---|
| 2901 | BGRC_PACKET_P_SetStriping( hContext, &chroma_rect, &packet->out_rect, &packet->dst_point, |
|---|
| 2902 | &chroma_scaler, &chroma_stripe, hContext->scaler.stripe_num ); |
|---|
| 2903 | hContext->scaler.stripe_num++; |
|---|
| 2904 | |
|---|
| 2905 | { |
|---|
| 2906 | uint32_t src_pos0 = luma_stripe.src_x | ((uint32_t) packet->src_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2907 | uint32_t src_pos1 = chroma_stripe.src_x | ((uint32_t) chroma_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2908 | uint32_t out_pos = luma_stripe.out_x | ((uint32_t) packet->out_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2909 | uint32_t dst_pos = luma_stripe.dst_x | ((uint32_t) packet->dst_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2910 | uint32_t src_size0 = packet->src_rect.height | ((uint32_t) luma_stripe.src_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2911 | uint32_t src_size1 = chroma_rect.height | ((uint32_t) chroma_stripe.src_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2912 | uint32_t out_size = packet->out_rect.height | ((uint32_t) luma_stripe.out_width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2913 | uint32_t stripe_width = packet->source_stripe_width >> 7; |
|---|
| 2914 | |
|---|
| 2915 | BGRC_PACKET_P_DEBUG_PRINT( "-- DestripeBlit " ); |
|---|
| 2916 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, STRIPE_ENABLE, DISABLE ); |
|---|
| 2917 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos0, src_size0, src_pos1, src_size1, dst_pos, out_size, out_pos, out_size ); |
|---|
| 2918 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_0, stripe_width | |
|---|
| 2919 | (packet->luma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_0_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2920 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_1, stripe_width | |
|---|
| 2921 | (packet->chroma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_1_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2922 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2923 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2924 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2925 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2926 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, luma_stripe.src_width >= luma_stripe.out_width ); |
|---|
| 2927 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, luma_stripe.hor_phase, hContext->scaler.hor_step ); |
|---|
| 2928 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2929 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, chroma_stripe.hor_phase, hContext->scaler.hor_step / 2 ); |
|---|
| 2930 | #endif |
|---|
| 2931 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, hContext->scaler.ver_phase, hContext->scaler.ver_step ); |
|---|
| 2932 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2933 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, hContext->scaler.ver_phase / 2, hContext->scaler.ver_step / 2 ); |
|---|
| 2934 | #endif |
|---|
| 2935 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 2936 | } |
|---|
| 2937 | |
|---|
| 2938 | #endif |
|---|
| 2939 | |
|---|
| 2940 | #else |
|---|
| 2941 | BM2MC_PACKET_PacketDestripeBlit *packet = (BM2MC_PACKET_PacketDestripeBlit *) header; |
|---|
| 2942 | uint32_t src_width_chroma = hContext->destripe_fixed_scale.chroma_rect.width; |
|---|
| 2943 | uint32_t src_height_chroma = hContext->destripe_fixed_scale.chroma_rect.height; |
|---|
| 2944 | uint32_t src_x0 = packet->src_rect.x; |
|---|
| 2945 | uint32_t src_y0 = packet->src_rect.y; |
|---|
| 2946 | uint32_t src_x1 = src_width_chroma ? hContext->destripe_fixed_scale.chroma_rect.x : (src_x0 / 2); |
|---|
| 2947 | uint32_t src_y1 = src_height_chroma ? hContext->destripe_fixed_scale.chroma_rect.y : (src_y0 / 2); |
|---|
| 2948 | uint32_t src_width0 = packet->src_rect.width; |
|---|
| 2949 | uint32_t src_height0 = packet->src_rect.height; |
|---|
| 2950 | uint32_t src_width1 = src_width_chroma ? src_width_chroma : ((src_width0 > 1) ? src_width0 / 2 : 1); |
|---|
| 2951 | uint32_t src_height1 = src_height_chroma ? src_height_chroma : ((src_height0 > 1) ? src_height0 / 2 : 1); |
|---|
| 2952 | uint32_t src_pos0 = src_x0 | (src_y0 << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2953 | uint32_t src_pos1 = src_x1 | (src_y1 << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2954 | uint32_t out_pos = packet->out_rect.x | ((uint32_t) packet->out_rect.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2955 | uint32_t dst_pos = packet->dst_point.x | ((uint32_t) packet->dst_point.y << BGRC_M2MC(BLIT_OUTPUT_TOP_LEFT_TOP_SHIFT)); |
|---|
| 2956 | uint32_t src_size0 = src_height0 | (src_width0 << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2957 | uint32_t src_size1 = src_height1 | (src_width1 << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2958 | uint32_t out_size = packet->out_rect.height | ((uint32_t) packet->out_rect.width << BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT)); |
|---|
| 2959 | uint32_t stripe_width = packet->source_stripe_width >> 7; |
|---|
| 2960 | |
|---|
| 2961 | uint32_t hor_luma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_phase : hContext->fixed_scale.hor_phase; |
|---|
| 2962 | uint32_t ver_luma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_phase : hContext->fixed_scale.ver_phase; |
|---|
| 2963 | uint32_t hor_chroma_phase = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_chroma_phase : (hContext->fixed_scale.hor_phase / 2); |
|---|
| 2964 | uint32_t ver_chroma_phase = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_chroma_phase : (hContext->fixed_scale.ver_phase / 2); |
|---|
| 2965 | uint32_t hor_luma_step = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.hor_luma_step : hContext->fixed_scale.hor_step; |
|---|
| 2966 | uint32_t ver_luma_step = hContext->destripe_fixed_scale.ver_luma_step ? hContext->destripe_fixed_scale.ver_luma_step : hContext->fixed_scale.ver_step; |
|---|
| 2967 | uint32_t shift = hContext->destripe_fixed_scale.hor_luma_step ? hContext->destripe_fixed_scale.shift : hContext->fixed_scale.shift; |
|---|
| 2968 | |
|---|
| 2969 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 2970 | hor_luma_phase, hor_chroma_phase, ver_luma_phase, ver_chroma_phase, hor_luma_step, ver_luma_step, shift ); |
|---|
| 2971 | |
|---|
| 2972 | BGRC_PACKET_P_DEBUG_PRINT( "-- DestripeBlit " ); |
|---|
| 2973 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( BLIT_CTRL, STRIPE_ENABLE, DISABLE, ENABLE, hContext->scaler.stripe_count > 1 ); |
|---|
| 2974 | BGRC_PACKET_P_STORE_RECT_REGS( src_pos0, src_size0, src_pos1, src_size1, dst_pos, out_size, out_pos, out_size ); |
|---|
| 2975 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_0, stripe_width | |
|---|
| 2976 | (packet->luma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_0_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2977 | BGRC_PACKET_P_STORE_REG( BLIT_SRC_STRIPE_HEIGHT_WIDTH_1, stripe_width | |
|---|
| 2978 | (packet->chroma_stripe_height << BGRC_M2MC(BLIT_SRC_STRIPE_HEIGHT_WIDTH_1_STRIPE_HEIGHT_SHIFT)) ); |
|---|
| 2979 | BGRC_PACKET_P_STORE_REG( BLIT_INPUT_STRIPE_WIDTH, hContext->scaler.input_stripe_width ); |
|---|
| 2980 | BGRC_PACKET_P_STORE_REG( BLIT_INPUT_STRIPE_WIDTH_1, hContext->scaler.input_stripe_width / 2 ); |
|---|
| 2981 | BGRC_PACKET_P_STORE_REG( BLIT_OUTPUT_STRIPE_WIDTH, hContext->scaler.output_stripe_width ); |
|---|
| 2982 | BGRC_PACKET_P_STORE_REG( BLIT_STRIPE_OVERLAP, hContext->scaler.stripe_overlap ); |
|---|
| 2983 | BGRC_PACKET_P_STORE_REG( BLIT_STRIPE_OVERLAP_1, hContext->scaler.stripe_overlap ); |
|---|
| 2984 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_HEADER, SRC_SCALER_ENABLE, ENABLE ); |
|---|
| 2985 | BGRC_PACKET_P_DEBUG_PRINT( "\n " ); |
|---|
| 2986 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, HORIZ_SCALER_ENABLE, ENABLE ); |
|---|
| 2987 | BGRC_PACKET_P_STORE_REG_FIELD( SCALER_CTRL, VERT_SCALER_ENABLE, ENABLE ); |
|---|
| 2988 | BGRC_PACKET_P_STORE_REG_FIELD_COMP( SCALER_CTRL, SCALER_ORDER, VERT_THEN_HORIZ, HORIZ_THEN_VERT, packet->src_rect.width >= packet->out_rect.width ); |
|---|
| 2989 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 0, hContext->scaler.hor_phase, hContext->scaler.hor_step ); |
|---|
| 2990 | #if defined(BCHP_M2MC_HORIZ_FIR_1_COEFF_PHASE0_01) |
|---|
| 2991 | BGRC_PACKET_P_STORE_SCALE_REGS( HORIZ, 1, |
|---|
| 2992 | src_width_chroma ? hContext->scaler.hor_chroma_phase : (hContext->scaler.hor_phase / 2), hContext->scaler.hor_step / 2 ); |
|---|
| 2993 | #endif |
|---|
| 2994 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 0, hContext->scaler.ver_phase, hContext->scaler.ver_step ); |
|---|
| 2995 | #if defined(BCHP_M2MC_VERT_FIR_1_COEFF_PHASE0_01) |
|---|
| 2996 | BGRC_PACKET_P_STORE_SCALE_REGS( VERT, 1, |
|---|
| 2997 | src_height_chroma ? hContext->scaler.ver_chroma_phase : (hContext->scaler.ver_phase / 2), hContext->scaler.ver_step / 2 ); |
|---|
| 2998 | #endif |
|---|
| 2999 | BGRC_PACKET_P_DEBUG_PRINT( "\n" ); |
|---|
| 3000 | #endif |
|---|
| 3001 | #endif |
|---|
| 3002 | } |
|---|
| 3003 | |
|---|
| 3004 | /***************************************************************************/ |
|---|
| 3005 | #define BGRC_PACKET_P_RESET_COLOR_BLEND { \ |
|---|
| 3006 | BM2MC_PACKET_BlendFactor_eSourceColor, BM2MC_PACKET_BlendFactor_eOne, false, \ |
|---|
| 3007 | BM2MC_PACKET_BlendFactor_eZero, BM2MC_PACKET_BlendFactor_eZero, false, BM2MC_PACKET_BlendFactor_eZero } |
|---|
| 3008 | |
|---|
| 3009 | #define BGRC_PACKET_P_RESET_ALPHA_BLEND { \ |
|---|
| 3010 | BM2MC_PACKET_BlendFactor_eSourceAlpha, BM2MC_PACKET_BlendFactor_eOne, false, \ |
|---|
| 3011 | BM2MC_PACKET_BlendFactor_eZero, BM2MC_PACKET_BlendFactor_eZero, false, BM2MC_PACKET_BlendFactor_eZero } |
|---|
| 3012 | |
|---|
| 3013 | #define BGRC_PACKET_P_RESET_ROP_VECTOR 0xCC |
|---|
| 3014 | |
|---|
| 3015 | /***************************************************************************/ |
|---|
| 3016 | void BGRC_PACKET_P_ResetState( BGRC_PacketContext_Handle hContext ) |
|---|
| 3017 | { |
|---|
| 3018 | BM2MC_PACKET_PacketSourceNone src_packet; |
|---|
| 3019 | BM2MC_PACKET_PacketDestinationNone dst_packet; |
|---|
| 3020 | BM2MC_PACKET_PacketOutputFeeder out_packet; |
|---|
| 3021 | BM2MC_PACKET_PacketBlend blend_packet; |
|---|
| 3022 | BM2MC_PACKET_PacketRop rop_packet; |
|---|
| 3023 | BM2MC_PACKET_PacketFilter filter_packet; |
|---|
| 3024 | BM2MC_PACKET_PacketSourcePalette palette_packet; |
|---|
| 3025 | BM2MC_PACKET_PacketFillBlit fill_packet; |
|---|
| 3026 | BM2MC_PACKET_Blend color_blend = BGRC_PACKET_P_RESET_COLOR_BLEND; |
|---|
| 3027 | BM2MC_PACKET_Blend alpha_blend = BGRC_PACKET_P_RESET_ALPHA_BLEND; |
|---|
| 3028 | |
|---|
| 3029 | /* clear registers */ |
|---|
| 3030 | BGRC_PACKET_P_DEBUG_PRINT( "-- Reset \n" ); |
|---|
| 3031 | BKNI_Memset( hContext->stored_registers, 0, sizeof (uint32_t) * BGRC_PACKET_P_REGISTER_COUNT ); |
|---|
| 3032 | |
|---|
| 3033 | /* set default surfaces */ |
|---|
| 3034 | BM2MC_PACKET_INIT( &src_packet, SourceNone, false ); |
|---|
| 3035 | BGRC_PACKET_P_SubmitSourceNonePacket( hContext, (BM2MC_PACKET_Header *) &src_packet ); |
|---|
| 3036 | |
|---|
| 3037 | BM2MC_PACKET_INIT( &dst_packet, DestinationNone, false ); |
|---|
| 3038 | BGRC_PACKET_P_SubmitDestinationNonePacket( hContext, (BM2MC_PACKET_Header *) &dst_packet ); |
|---|
| 3039 | |
|---|
| 3040 | BM2MC_PACKET_INIT( &out_packet, OutputFeeder, false ); |
|---|
| 3041 | out_packet.plane.address = hContext->sync_output_offset; |
|---|
| 3042 | out_packet.plane.pitch = 4; |
|---|
| 3043 | out_packet.plane.format = BM2MC_PACKET_PixelFormat_eA8_R8_G8_B8; |
|---|
| 3044 | out_packet.plane.width = 1; |
|---|
| 3045 | out_packet.plane.height = 1; |
|---|
| 3046 | BGRC_PACKET_P_SubmitOutputFeederPacket( hContext, (BM2MC_PACKET_Header *) &out_packet ); |
|---|
| 3047 | |
|---|
| 3048 | /* set default blend - source pixel */ |
|---|
| 3049 | BM2MC_PACKET_INIT( &blend_packet, Blend, false ); |
|---|
| 3050 | blend_packet.color_blend = color_blend; |
|---|
| 3051 | blend_packet.alpha_blend = alpha_blend; |
|---|
| 3052 | blend_packet.color = 0; |
|---|
| 3053 | BGRC_PACKET_P_SubmitBlendPacket( hContext, (BM2MC_PACKET_Header *) &blend_packet ); |
|---|
| 3054 | |
|---|
| 3055 | /* set default ROP - source copy */ |
|---|
| 3056 | BM2MC_PACKET_INIT( &rop_packet, Rop, false ); |
|---|
| 3057 | rop_packet.rop = BGRC_PACKET_P_RESET_ROP_VECTOR; |
|---|
| 3058 | rop_packet.pattern0 = 0; |
|---|
| 3059 | rop_packet.pattern1 = 0; |
|---|
| 3060 | rop_packet.color0 = 0; |
|---|
| 3061 | rop_packet.color1 = 0; |
|---|
| 3062 | BGRC_PACKET_P_SubmitRopPacket( hContext, (BM2MC_PACKET_Header *) &rop_packet ); |
|---|
| 3063 | |
|---|
| 3064 | /* set default filter - bilinear */ |
|---|
| 3065 | BM2MC_PACKET_INIT( &filter_packet, Filter, false ); |
|---|
| 3066 | filter_packet.hor = s_BGRC_PACKET_P_DeviceFilter_Bilinear; |
|---|
| 3067 | filter_packet.ver = s_BGRC_PACKET_P_DeviceFilter_Bilinear; |
|---|
| 3068 | BGRC_PACKET_P_SubmitFilterPacket( hContext, (BM2MC_PACKET_Header *) &filter_packet ); |
|---|
| 3069 | |
|---|
| 3070 | /* set default palette */ |
|---|
| 3071 | BM2MC_PACKET_INIT( &palette_packet, SourcePalette, false ); |
|---|
| 3072 | palette_packet.address = 0; |
|---|
| 3073 | BGRC_PACKET_P_SubmitSourcePalettePacket( hContext, (BM2MC_PACKET_Header *) &palette_packet ); |
|---|
| 3074 | |
|---|
| 3075 | /* set default rectangle*/ |
|---|
| 3076 | BM2MC_PACKET_INIT( &fill_packet, FillBlit, false ); |
|---|
| 3077 | fill_packet.rect.x = 0; |
|---|
| 3078 | fill_packet.rect.y = 0; |
|---|
| 3079 | fill_packet.rect.width = 1; |
|---|
| 3080 | fill_packet.rect.height = 1; |
|---|
| 3081 | BGRC_PACKET_P_SubmitFillBlitPacket( hContext, (BM2MC_PACKET_Header *) &fill_packet ); |
|---|
| 3082 | |
|---|
| 3083 | BKNI_Memset( &hContext->destripe_fixed_scale, 0, sizeof (BM2MC_PACKET_PacketDestripeFixedScale) ); |
|---|
| 3084 | BKNI_Memset( &hContext->fixed_scale, 0, sizeof (BM2MC_PACKET_PacketFixedScale) ); |
|---|
| 3085 | |
|---|
| 3086 | hContext->src_format0 = 0; |
|---|
| 3087 | hContext->out_format0 = 0; |
|---|
| 3088 | hContext->linear_destripe = false; |
|---|
| 3089 | hContext->reset_state = true; |
|---|
| 3090 | |
|---|
| 3091 | #if defined(BCHP_M2MC_BLIT_CTRL_BLOCK_AUTO_SPLIT_FIFO_MASK) |
|---|
| 3092 | BGRC_PACKET_P_STORE_REG_FIELD( BLIT_CTRL, BLOCK_AUTO_SPLIT_FIFO, ENABLE ); |
|---|
| 3093 | #endif |
|---|
| 3094 | } |
|---|
| 3095 | |
|---|
| 3096 | /***************************************************************************/ |
|---|
| 3097 | static void BGRC_PACKET_P_SubmitResetStatePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 3098 | { |
|---|
| 3099 | BSTD_UNUSED(header); |
|---|
| 3100 | BGRC_PACKET_P_ResetState( hContext ); |
|---|
| 3101 | } |
|---|
| 3102 | |
|---|
| 3103 | /***************************************************************************/ |
|---|
| 3104 | static void BGRC_PACKET_P_SubmitSaveStatePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 3105 | { |
|---|
| 3106 | BSTD_UNUSED(header); |
|---|
| 3107 | BKNI_Memcpy( hContext->saved_registers, hContext->stored_registers, BGRC_PACKET_P_REGISTER_COUNT * sizeof (uint32_t) ); |
|---|
| 3108 | hContext->saved_destripe_fixed_scale = hContext->destripe_fixed_scale; |
|---|
| 3109 | hContext->saved_fixed_scale = hContext->fixed_scale; |
|---|
| 3110 | hContext->saved_src_format0 = hContext->src_format0; |
|---|
| 3111 | hContext->saved_out_format0 = hContext->out_format0; |
|---|
| 3112 | hContext->saved_linear_destripe = hContext->linear_destripe; |
|---|
| 3113 | |
|---|
| 3114 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 3115 | hContext->saved_SRC_surface_width = hContext->SRC_surface_width; |
|---|
| 3116 | hContext->saved_SRC_surface_height = hContext->SRC_surface_height; |
|---|
| 3117 | hContext->saved_SRC_surface_format = hContext->SRC_surface_format; |
|---|
| 3118 | hContext->saved_DEST_surface_width = hContext->DEST_surface_width; |
|---|
| 3119 | hContext->saved_DEST_surface_height = hContext->DEST_surface_height; |
|---|
| 3120 | hContext->saved_DEST_surface_format = hContext->DEST_surface_format; |
|---|
| 3121 | hContext->saved_OUTPUT_surface_width = hContext->OUTPUT_surface_width; |
|---|
| 3122 | hContext->saved_OUTPUT_surface_height = hContext->OUTPUT_surface_height; |
|---|
| 3123 | hContext->saved_OUTPUT_surface_format = hContext->OUTPUT_surface_format; |
|---|
| 3124 | #endif |
|---|
| 3125 | } |
|---|
| 3126 | |
|---|
| 3127 | /***************************************************************************/ |
|---|
| 3128 | static void BGRC_PACKET_P_SubmitRestoreStatePacket( BGRC_PacketContext_Handle hContext, BM2MC_PACKET_Header *header ) |
|---|
| 3129 | { |
|---|
| 3130 | BSTD_UNUSED(header); |
|---|
| 3131 | BKNI_Memcpy( hContext->stored_registers, hContext->saved_registers, BGRC_PACKET_P_REGISTER_COUNT * sizeof (uint32_t) ); |
|---|
| 3132 | hContext->destripe_fixed_scale = hContext->saved_destripe_fixed_scale; |
|---|
| 3133 | hContext->fixed_scale = hContext->saved_fixed_scale; |
|---|
| 3134 | hContext->src_format0 = hContext->saved_src_format0; |
|---|
| 3135 | hContext->out_format0 = hContext->saved_out_format0; |
|---|
| 3136 | hContext->linear_destripe = hContext->saved_linear_destripe; |
|---|
| 3137 | hContext->reset_state = true; |
|---|
| 3138 | |
|---|
| 3139 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 3140 | hContext->SRC_surface_width = hContext->saved_SRC_surface_width; |
|---|
| 3141 | hContext->SRC_surface_height = hContext->saved_SRC_surface_height; |
|---|
| 3142 | hContext->SRC_surface_format = hContext->saved_SRC_surface_format; |
|---|
| 3143 | hContext->DEST_surface_width = hContext->saved_DEST_surface_width; |
|---|
| 3144 | hContext->DEST_surface_height = hContext->saved_DEST_surface_height; |
|---|
| 3145 | hContext->DEST_surface_format = hContext->saved_DEST_surface_format; |
|---|
| 3146 | hContext->OUTPUT_surface_width = hContext->saved_OUTPUT_surface_width; |
|---|
| 3147 | hContext->OUTPUT_surface_height = hContext->saved_OUTPUT_surface_height; |
|---|
| 3148 | hContext->OUTPUT_surface_format = hContext->saved_OUTPUT_surface_format; |
|---|
| 3149 | #endif |
|---|
| 3150 | } |
|---|
| 3151 | |
|---|
| 3152 | /***************************************************************************/ |
|---|
| 3153 | static uint32_t *BGRC_PACKET_P_SubmitPacket( |
|---|
| 3154 | BGRC_PacketContext_Handle hContext, |
|---|
| 3155 | BM2MC_PACKET_Header *header, |
|---|
| 3156 | bool *force_striping ) |
|---|
| 3157 | { |
|---|
| 3158 | uint32_t *packet = (uint32_t *) header; |
|---|
| 3159 | |
|---|
| 3160 | switch( header->type ) |
|---|
| 3161 | { |
|---|
| 3162 | case 0: |
|---|
| 3163 | BGRC_PACKET_P_DEBUG_PRINT( "-- EndOfBuffer \n" ); |
|---|
| 3164 | packet = (uint32_t *) ((uint8_t *) hContext->buffer_base_addr - header->size * sizeof (uint32_t)); |
|---|
| 3165 | break; |
|---|
| 3166 | case BM2MC_PACKET_PacketType_eSourceFeeder: |
|---|
| 3167 | BGRC_PACKET_P_SubmitSourceFeederPacket( hContext, header ); |
|---|
| 3168 | break; |
|---|
| 3169 | case BM2MC_PACKET_PacketType_eSourceFeeders: |
|---|
| 3170 | BGRC_PACKET_P_SubmitSourceFeedersPacket( hContext, header ); |
|---|
| 3171 | break; |
|---|
| 3172 | case BM2MC_PACKET_PacketType_eSourceColor: |
|---|
| 3173 | BGRC_PACKET_P_SubmitSourceColorPacket( hContext, header ); |
|---|
| 3174 | break; |
|---|
| 3175 | case BM2MC_PACKET_PacketType_eSourceNone: |
|---|
| 3176 | BGRC_PACKET_P_SubmitSourceNonePacket( hContext, header ); |
|---|
| 3177 | break; |
|---|
| 3178 | case BM2MC_PACKET_PacketType_eSourceControl: |
|---|
| 3179 | BGRC_PACKET_P_SubmitSourceControlPacket( hContext, header ); |
|---|
| 3180 | break; |
|---|
| 3181 | case BM2MC_PACKET_PacketType_eDestinationFeeder: |
|---|
| 3182 | BGRC_PACKET_P_SubmitDestinationFeederPacket( hContext, header ); |
|---|
| 3183 | break; |
|---|
| 3184 | case BM2MC_PACKET_PacketType_eDestinationColor: |
|---|
| 3185 | BGRC_PACKET_P_SubmitDestinationColorPacket( hContext, header ); |
|---|
| 3186 | break; |
|---|
| 3187 | case BM2MC_PACKET_PacketType_eDestinationNone: |
|---|
| 3188 | BGRC_PACKET_P_SubmitDestinationNonePacket( hContext, header ); |
|---|
| 3189 | break; |
|---|
| 3190 | case BM2MC_PACKET_PacketType_eDestinationControl: |
|---|
| 3191 | BGRC_PACKET_P_SubmitDestinationControlPacket( hContext, header ); |
|---|
| 3192 | break; |
|---|
| 3193 | case BM2MC_PACKET_PacketType_eOutputFeeder: |
|---|
| 3194 | BGRC_PACKET_P_SubmitOutputFeederPacket( hContext, header ); |
|---|
| 3195 | break; |
|---|
| 3196 | case BM2MC_PACKET_PacketType_eOutputControl: |
|---|
| 3197 | BGRC_PACKET_P_SubmitOutputControlPacket( hContext, header ); |
|---|
| 3198 | break; |
|---|
| 3199 | case BM2MC_PACKET_PacketType_eBlend: |
|---|
| 3200 | BGRC_PACKET_P_SubmitBlendPacket( hContext, header ); |
|---|
| 3201 | break; |
|---|
| 3202 | case BM2MC_PACKET_PacketType_eBlendColor: |
|---|
| 3203 | BGRC_PACKET_P_SubmitBlendColorPacket( hContext, header ); |
|---|
| 3204 | break; |
|---|
| 3205 | case BM2MC_PACKET_PacketType_eRop: |
|---|
| 3206 | BGRC_PACKET_P_SubmitRopPacket( hContext, header ); |
|---|
| 3207 | break; |
|---|
| 3208 | case BM2MC_PACKET_PacketType_eSourceColorkey: |
|---|
| 3209 | BGRC_PACKET_P_SubmitSourceColorkeyPacket( hContext, header ); |
|---|
| 3210 | break; |
|---|
| 3211 | case BM2MC_PACKET_PacketType_eSourceColorkeyEnable: |
|---|
| 3212 | BGRC_PACKET_P_SubmitSourceColorkeyEnablePacket( hContext, header ); |
|---|
| 3213 | break; |
|---|
| 3214 | case BM2MC_PACKET_PacketType_eDestinationColorkey: |
|---|
| 3215 | BGRC_PACKET_P_SubmitDestinationColorkeyPacket( hContext, header ); |
|---|
| 3216 | break; |
|---|
| 3217 | case BM2MC_PACKET_PacketType_eDestinationColorkeyEnable: |
|---|
| 3218 | BGRC_PACKET_P_SubmitDestinationColorkeyEnablePacket( hContext, header ); |
|---|
| 3219 | break; |
|---|
| 3220 | case BM2MC_PACKET_PacketType_eFilter: |
|---|
| 3221 | BGRC_PACKET_P_SubmitFilterPacket( hContext, header ); |
|---|
| 3222 | break; |
|---|
| 3223 | case BM2MC_PACKET_PacketType_eFilterEnable: |
|---|
| 3224 | BGRC_PACKET_P_SubmitFilterEnablePacket( hContext, header ); |
|---|
| 3225 | break; |
|---|
| 3226 | case BM2MC_PACKET_PacketType_eSourceColorMatrix: |
|---|
| 3227 | BGRC_PACKET_P_SubmitSourceColorMatrixPacket( hContext, header ); |
|---|
| 3228 | break; |
|---|
| 3229 | case BM2MC_PACKET_PacketType_eSourceColorMatrixEnable: |
|---|
| 3230 | BGRC_PACKET_P_SubmitSourceColorMatrixEnablePacket( hContext, header ); |
|---|
| 3231 | break; |
|---|
| 3232 | case BM2MC_PACKET_PacketType_eSourcePalette: |
|---|
| 3233 | BGRC_PACKET_P_SubmitSourcePalettePacket( hContext, header ); |
|---|
| 3234 | break; |
|---|
| 3235 | case BM2MC_PACKET_PacketType_eMirror: |
|---|
| 3236 | BGRC_PACKET_P_SubmitMirrorPacket( hContext, header ); |
|---|
| 3237 | break; |
|---|
| 3238 | case BM2MC_PACKET_PacketType_eFixedScale: |
|---|
| 3239 | BGRC_PACKET_P_SubmitFixedScalePacket( hContext, header ); |
|---|
| 3240 | break; |
|---|
| 3241 | case BM2MC_PACKET_PacketType_eDestripeFixedScale: |
|---|
| 3242 | BGRC_PACKET_P_SubmitDestripeFixedScalePacket( hContext, header ); |
|---|
| 3243 | break; |
|---|
| 3244 | case BM2MC_PACKET_PacketType_eAlphaPremultiply: |
|---|
| 3245 | BGRC_PACKET_P_SubmitAlphaPremultiplyPacket( hContext, header ); |
|---|
| 3246 | break; |
|---|
| 3247 | case BM2MC_PACKET_PacketType_eFillBlit: |
|---|
| 3248 | BGRC_PACKET_P_SubmitFillBlitPacket( hContext, header ); |
|---|
| 3249 | break; |
|---|
| 3250 | case BM2MC_PACKET_PacketType_eCopyBlit: |
|---|
| 3251 | BGRC_PACKET_P_SubmitCopyBlitPacket( hContext, header ); |
|---|
| 3252 | break; |
|---|
| 3253 | case BM2MC_PACKET_PacketType_eBlendBlit: |
|---|
| 3254 | BGRC_PACKET_P_SubmitBlendBlitPacket( hContext, header ); |
|---|
| 3255 | break; |
|---|
| 3256 | case BM2MC_PACKET_PacketType_eScaleBlit: |
|---|
| 3257 | |
|---|
| 3258 | /* use sw striping if YCbCr422 source with scaling or scale down max exceeded */ |
|---|
| 3259 | if( (BGRC_PACKET_P_GET_REG_FIELD(SRC_SURFACE_FORMAT_DEF_1, FORMAT_TYPE) == M2MC_FT_YCbCr422) || |
|---|
| 3260 | (BGRC_PACKET_P_GET_REG(BLIT_CTRL) & BGRC_M2MC(BLIT_CTRL_OUTPUT_H_DIRECTION_MASK)) || |
|---|
| 3261 | (hContext->scaler.ver_step > (BGRC_P_SCALE_DOWN_MAX_Y << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS)) ) |
|---|
| 3262 | { |
|---|
| 3263 | BM2MC_PACKET_PacketScaleBlit *packet = (BM2MC_PACKET_PacketScaleBlit *) header; |
|---|
| 3264 | |
|---|
| 3265 | BGRC_PACKET_P_SetScaler( hContext, &hContext->scaler, &packet->src_rect, &packet->out_rect, |
|---|
| 3266 | hContext->fixed_scale.hor_phase, 0, hContext->fixed_scale.ver_phase, 0, |
|---|
| 3267 | hContext->fixed_scale.hor_step, hContext->fixed_scale.ver_step, hContext->fixed_scale.shift ); |
|---|
| 3268 | |
|---|
| 3269 | BGRC_PACKET_P_SubmitStripeBlitPacket( hContext, &packet->src_rect, &packet->out_rect, |
|---|
| 3270 | (BM2MC_PACKET_Point *) (void *) &packet->out_rect ); |
|---|
| 3271 | |
|---|
| 3272 | hContext->scaler_header = header; |
|---|
| 3273 | *force_striping = true; |
|---|
| 3274 | } |
|---|
| 3275 | else |
|---|
| 3276 | { |
|---|
| 3277 | BGRC_PACKET_P_SubmitScaleBlitPacket( hContext, header ); |
|---|
| 3278 | } |
|---|
| 3279 | break; |
|---|
| 3280 | case BM2MC_PACKET_PacketType_eScaleBlendBlit: |
|---|
| 3281 | BGRC_PACKET_P_SubmitScaleBlendBlitPacket( hContext, header ); |
|---|
| 3282 | break; |
|---|
| 3283 | case BM2MC_PACKET_PacketType_eUpdateScaleBlit: |
|---|
| 3284 | BGRC_PACKET_P_SubmitUpdateScaleBlitPacket( hContext, header ); |
|---|
| 3285 | break; |
|---|
| 3286 | case BM2MC_PACKET_PacketType_eDestripeBlit: |
|---|
| 3287 | BGRC_PACKET_P_SubmitDestripeBlitPacket( hContext, header ); |
|---|
| 3288 | break; |
|---|
| 3289 | case BM2MC_PACKET_PacketType_eResetState: |
|---|
| 3290 | BGRC_PACKET_P_SubmitResetStatePacket( hContext, header ); |
|---|
| 3291 | break; |
|---|
| 3292 | case BM2MC_PACKET_PacketType_eSaveState: |
|---|
| 3293 | BGRC_PACKET_P_SubmitSaveStatePacket( hContext, header ); |
|---|
| 3294 | break; |
|---|
| 3295 | case BM2MC_PACKET_PacketType_eRestoreState: |
|---|
| 3296 | BGRC_PACKET_P_SubmitRestoreStatePacket( hContext, header ); |
|---|
| 3297 | break; |
|---|
| 3298 | default: |
|---|
| 3299 | break; |
|---|
| 3300 | } |
|---|
| 3301 | |
|---|
| 3302 | return (uint32_t *) ((uint8_t *) packet + header->size * sizeof (uint32_t)); |
|---|
| 3303 | } |
|---|
| 3304 | |
|---|
| 3305 | /***************************************************************************/ |
|---|
| 3306 | #define BGRC_PACKET_P_GET_SURFACE_BPP( surface ) (( \ |
|---|
| 3307 | BGRC_PACKET_P_GET_REG_FIELD_SHIFT(surface##_FORMAT_DEF_1, CH0_NUM_BITS) + \ |
|---|
| 3308 | BGRC_PACKET_P_GET_REG_FIELD_SHIFT(surface##_FORMAT_DEF_1, CH1_NUM_BITS) + \ |
|---|
| 3309 | BGRC_PACKET_P_GET_REG_FIELD_SHIFT(surface##_FORMAT_DEF_1, CH2_NUM_BITS) + \ |
|---|
| 3310 | BGRC_PACKET_P_GET_REG_FIELD_SHIFT(surface##_FORMAT_DEF_1, CH3_NUM_BITS)) / \ |
|---|
| 3311 | ((BGRC_PACKET_P_GET_REG_FIELD(surface##_FORMAT_DEF_1, FORMAT_TYPE) == M2MC_FT_YCbCr422) ? 2 : 1)) |
|---|
| 3312 | |
|---|
| 3313 | /***************************************************************************/ |
|---|
| 3314 | #define BGRC_PACKET_P_VERIFY_RECTANGLE_SCALE() \ |
|---|
| 3315 | { \ |
|---|
| 3316 | if( hContext->scaler.hor_step > (BGRC_P_SCALE_DOWN_MAX << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) ) \ |
|---|
| 3317 | { \ |
|---|
| 3318 | BDBG_ERR(( "Horizontal down scale factor larger than %dx (%d->%d)", BGRC_P_SCALE_DOWN_MAX, \ |
|---|
| 3319 | BGRC_PACKET_P_GET_REG(BLIT_SRC_SIZE) >> BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT), \ |
|---|
| 3320 | BGRC_PACKET_P_GET_REG(BLIT_OUTPUT_SIZE) >> BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT) )); \ |
|---|
| 3321 | hContext->scaler.hor_step = 0; \ |
|---|
| 3322 | BGRC_PACKET_P_STORE_REG( HORIZ_SCALER_STEP, BGRC_P_SCALE_DOWN_MAX << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS ); \ |
|---|
| 3323 | /* violation = true; */\ |
|---|
| 3324 | } \ |
|---|
| 3325 | if( hContext->scaler.ver_step > (BGRC_P_SCALE_DOWN_MAX_Y << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) ) \ |
|---|
| 3326 | { \ |
|---|
| 3327 | BDBG_ERR(( "Vertical down scale factor larger than %dx (%d->%d)", BGRC_P_SCALE_DOWN_MAX_Y, \ |
|---|
| 3328 | BGRC_PACKET_P_GET_REG(BLIT_SRC_SIZE) & 0xFFFF, BGRC_PACKET_P_GET_REG(BLIT_OUTPUT_SIZE) & 0xFFFF )); \ |
|---|
| 3329 | hContext->scaler.ver_step = 0; \ |
|---|
| 3330 | BGRC_PACKET_P_STORE_REG( VERT_SCALER_STEP, BGRC_P_SCALE_DOWN_MAX_Y << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS ); \ |
|---|
| 3331 | /* violation = true; */\ |
|---|
| 3332 | } \ |
|---|
| 3333 | if( BGRC_PACKET_P_GET_REG(BLIT_SRC_SIZE) & (~(BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_MASK) | BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_HEIGHT_MASK))) ) \ |
|---|
| 3334 | { \ |
|---|
| 3335 | BDBG_ERR(( "Source surface rectangle is larger than 8191 (%dx%d)", \ |
|---|
| 3336 | BGRC_PACKET_P_GET_REG(BLIT_SRC_SIZE) >> BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT), \ |
|---|
| 3337 | BGRC_PACKET_P_GET_REG(BLIT_SRC_SIZE) & 0xFFFF )); \ |
|---|
| 3338 | violation = true; \ |
|---|
| 3339 | } \ |
|---|
| 3340 | if( BGRC_PACKET_P_GET_REG(BLIT_OUTPUT_SIZE) & (~(BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_MASK) | BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_HEIGHT_MASK))) ) \ |
|---|
| 3341 | { \ |
|---|
| 3342 | BDBG_ERR(( "Output surface rectangle is larger than 8191 (%dx%d)", \ |
|---|
| 3343 | BGRC_PACKET_P_GET_REG(BLIT_OUTPUT_SIZE) >> BGRC_M2MC(BLIT_OUTPUT_SIZE_SURFACE_WIDTH_SHIFT), \ |
|---|
| 3344 | BGRC_PACKET_P_GET_REG(BLIT_OUTPUT_SIZE) & 0xFFFF )); \ |
|---|
| 3345 | violation = true; \ |
|---|
| 3346 | } \ |
|---|
| 3347 | } |
|---|
| 3348 | |
|---|
| 3349 | /***************************************************************************/ |
|---|
| 3350 | #define BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_BOUNDS( surface, num, pos, dim, mask ) \ |
|---|
| 3351 | { \ |
|---|
| 3352 | if( BGRC_PACKET_P_GET_REG(surface##_FEEDER_ENABLE) ) \ |
|---|
| 3353 | { \ |
|---|
| 3354 | uint32_t surface_offset = BGRC_PACKET_P_GET_REG(surface##_SURFACE_ADDR_0); \ |
|---|
| 3355 | if( surface_offset != hContext->sync_output_offset ) \ |
|---|
| 3356 | { \ |
|---|
| 3357 | if( surface_offset ) \ |
|---|
| 3358 | { \ |
|---|
| 3359 | uint32_t bpp = BGRC_PACKET_P_GET_SURFACE_BPP(surface##_##num); \ |
|---|
| 3360 | uint32_t pitch = BGRC_PACKET_P_GET_REG(surface##_SURFACE_STRIDE_0); \ |
|---|
| 3361 | uint32_t x = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_##pos, LEFT); \ |
|---|
| 3362 | uint32_t y = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_##pos, TOP); \ |
|---|
| 3363 | uint32_t w = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_##dim, SURFACE_WIDTH); \ |
|---|
| 3364 | uint32_t h = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_##dim, SURFACE_HEIGHT); \ |
|---|
| 3365 | uint32_t start_offset = surface_offset + (x * bpp) / 8 + y * pitch; \ |
|---|
| 3366 | uint32_t end_offset = surface_offset + ((x + w) * bpp) / 8 + (y + h - 1) * pitch; \ |
|---|
| 3367 | \ |
|---|
| 3368 | if( start_offset < hContext->create_settings.memory_bounds.offset ) \ |
|---|
| 3369 | { \ |
|---|
| 3370 | BDBG_ERR(( "%6s context memory violation (bounds=%08x-%08x start=%08x) sur (off=%08x x=%4d y=%4d w=%4d h=%4d)", \ |
|---|
| 3371 | #surface, hContext->create_settings.memory_bounds.offset, \ |
|---|
| 3372 | hContext->create_settings.memory_bounds.offset + hContext->create_settings.memory_bounds.size, \ |
|---|
| 3373 | start_offset, surface_offset, x, y, w, h )); \ |
|---|
| 3374 | violation = true; \ |
|---|
| 3375 | } \ |
|---|
| 3376 | \ |
|---|
| 3377 | if( end_offset > hContext->create_settings.memory_bounds.offset + hContext->create_settings.memory_bounds.size ) \ |
|---|
| 3378 | { \ |
|---|
| 3379 | BDBG_ERR(( "%6s context memory violation (bounds=%08x-%08x end=%08x) sur (off=%08x x=%4d y=%4d w=%4d h=%4d)", \ |
|---|
| 3380 | #surface, hContext->create_settings.memory_bounds.offset, \ |
|---|
| 3381 | hContext->create_settings.memory_bounds.offset + hContext->create_settings.memory_bounds.size, \ |
|---|
| 3382 | end_offset, surface_offset, x, y, w, h )); \ |
|---|
| 3383 | violation = true; \ |
|---|
| 3384 | } \ |
|---|
| 3385 | } \ |
|---|
| 3386 | else if( (mask) ) \ |
|---|
| 3387 | { \ |
|---|
| 3388 | if( (BGRC_PACKET_P_GET_REG(surface##_SURFACE_FORMAT_DEF_3) & (mask)) != (mask) ) \ |
|---|
| 3389 | { \ |
|---|
| 3390 | BDBG_ERR(( "%6s feeder violates memory at offset 0." )); \ |
|---|
| 3391 | violation = true; \ |
|---|
| 3392 | } \ |
|---|
| 3393 | } \ |
|---|
| 3394 | } \ |
|---|
| 3395 | } \ |
|---|
| 3396 | } |
|---|
| 3397 | |
|---|
| 3398 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 3399 | /***************************************************************************/ |
|---|
| 3400 | #define BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_SURFACE( surface ) \ |
|---|
| 3401 | { \ |
|---|
| 3402 | if( BGRC_PACKET_P_GET_REG(surface##_FEEDER_ENABLE) ) \ |
|---|
| 3403 | { \ |
|---|
| 3404 | uint32_t surface_offset = BGRC_PACKET_P_GET_REG(surface##_SURFACE_ADDR_0); \ |
|---|
| 3405 | if( surface_offset != hContext->sync_output_offset ) \ |
|---|
| 3406 | { \ |
|---|
| 3407 | if( surface_offset ) \ |
|---|
| 3408 | { \ |
|---|
| 3409 | uint32_t bpp = BGRC_PACKET_P_GET_SURFACE_BPP(surface##_SURFACE); \ |
|---|
| 3410 | uint32_t pitch = BGRC_PACKET_P_GET_REG(surface##_SURFACE_STRIDE_0); \ |
|---|
| 3411 | uint32_t x = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_TOP_LEFT, LEFT); \ |
|---|
| 3412 | uint32_t y = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_TOP_LEFT, TOP); \ |
|---|
| 3413 | uint32_t w = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_SIZE, SURFACE_WIDTH); \ |
|---|
| 3414 | uint32_t h = BGRC_PACKET_P_GET_REG_FIELD_SHIFT(BLIT_##surface##_SIZE, SURFACE_HEIGHT); \ |
|---|
| 3415 | uint32_t end_offset = surface_offset + ((x + w) * bpp) / 8 + (y + h - 1) * pitch; \ |
|---|
| 3416 | uint32_t surface_size = hContext->surface##_surface_height * pitch; \ |
|---|
| 3417 | \ |
|---|
| 3418 | if( surface_size && (end_offset > surface_offset + surface_size) ) \ |
|---|
| 3419 | { \ |
|---|
| 3420 | BDBG_ERR(( "%6s surface memory violation (bounds=%08x-%08x end=%08x) sur (off=%08x x=%4d y=%4d w=%4d h=%4d bpp=%d) %08x %08x", \ |
|---|
| 3421 | #surface, surface_offset, surface_offset + surface_size, end_offset, surface_offset, x, y, w, h, bpp, BGRC_PACKET_P_GET_REG(BLIT_##surface##_SIZE), BGRC_PACKET_P_GET_REG(BLIT_##surface##_TOP_LEFT) )); \ |
|---|
| 3422 | violation = true; \ |
|---|
| 3423 | } \ |
|---|
| 3424 | \ |
|---|
| 3425 | if( hContext->surface##_surface_format >= BM2MC_PACKET_PixelFormat_eMax ) \ |
|---|
| 3426 | { \ |
|---|
| 3427 | BDBG_ERR(( "%6s surface format invalid", \ |
|---|
| 3428 | #surface, surface_offset, surface_offset + surface_size, end_offset, surface_offset, x, y, w, h )); \ |
|---|
| 3429 | violation = true; \ |
|---|
| 3430 | } \ |
|---|
| 3431 | } \ |
|---|
| 3432 | } \ |
|---|
| 3433 | } \ |
|---|
| 3434 | } |
|---|
| 3435 | #endif |
|---|
| 3436 | |
|---|
| 3437 | /***************************************************************************/ |
|---|
| 3438 | void BGRC_PACKET_P_SubmitPackets( |
|---|
| 3439 | BGRC_Handle hGrc, |
|---|
| 3440 | BGRC_PacketContext_Handle hContext ) |
|---|
| 3441 | { |
|---|
| 3442 | /* get first packet and group header */ |
|---|
| 3443 | uint32_t *packet = (uint32_t *) ((uint8_t *) hContext->buffer_base_addr + hContext->buffer_submit_offset); |
|---|
| 3444 | uint32_t *next_packet = packet; |
|---|
| 3445 | uint32_t group_header = 0; |
|---|
| 3446 | bool execute = false; |
|---|
| 3447 | bool sync_interrupt = false; |
|---|
| 3448 | bool advance_interrupt = false; |
|---|
| 3449 | bool first_blit = true; |
|---|
| 3450 | |
|---|
| 3451 | uint32_t *start_fifo_addr = 0; |
|---|
| 3452 | uint32_t start_fifo_offset = 0; |
|---|
| 3453 | uint32_t ii; |
|---|
| 3454 | |
|---|
| 3455 | /* check if context changing */ |
|---|
| 3456 | if( hGrc->hContext != hContext ) |
|---|
| 3457 | hContext->group_header = BGRC_PACKET_P_DEVICE_GROUP_HEADER_FULL; |
|---|
| 3458 | |
|---|
| 3459 | /* get m2mc's current offset */ |
|---|
| 3460 | hContext->m2mc_offset = BGRC_P_ReadReg32( hGrc->hRegister, LIST_CURR_PKT_ADDR ); |
|---|
| 3461 | |
|---|
| 3462 | /* clear scaler's stripe counts */ |
|---|
| 3463 | hContext->scaler.stripe_count = 0; |
|---|
| 3464 | hContext->scaler.stripe_num = 0; |
|---|
| 3465 | |
|---|
| 3466 | /* loop through packets */ |
|---|
| 3467 | while( hContext->buffer_submit_size ) |
|---|
| 3468 | { |
|---|
| 3469 | BM2MC_PACKET_Header *header = (BM2MC_PACKET_Header *) packet; |
|---|
| 3470 | bool force_striping = false; |
|---|
| 3471 | |
|---|
| 3472 | /* set group header */ |
|---|
| 3473 | hContext->group_header |= hContext->reset_state ? BGRC_PACKET_P_DEVICE_GROUP_HEADER_FULL : s_BGRC_PACKET_P_DeviceGroupHeaderMasks[header->type]; |
|---|
| 3474 | hContext->reset_state = false; |
|---|
| 3475 | group_header = hContext->group_header; |
|---|
| 3476 | |
|---|
| 3477 | if( header->execute ) |
|---|
| 3478 | { |
|---|
| 3479 | /* exit loop if out of memory */ |
|---|
| 3480 | if( !BGRC_PACKET_P_AvailableFifoMemory( hGrc, hContext ) ) |
|---|
| 3481 | { |
|---|
| 3482 | advance_interrupt = first_blit && (!hGrc->advance_interrupt); |
|---|
| 3483 | |
|---|
| 3484 | /* allow allocation for sync blit and for first blit if no advance interrupt pending */ |
|---|
| 3485 | if( (!header->sync) && (!advance_interrupt) ) |
|---|
| 3486 | break; |
|---|
| 3487 | } |
|---|
| 3488 | |
|---|
| 3489 | /* store first blit offset */ |
|---|
| 3490 | if( start_fifo_offset == 0 ) |
|---|
| 3491 | { |
|---|
| 3492 | start_fifo_addr = hGrc->curr_fifo_addr; |
|---|
| 3493 | start_fifo_offset = hGrc->curr_fifo_offset; |
|---|
| 3494 | } |
|---|
| 3495 | } |
|---|
| 3496 | |
|---|
| 3497 | /* submit packet */ |
|---|
| 3498 | next_packet = BGRC_PACKET_P_SubmitPacket( hContext, header, &force_striping ); |
|---|
| 3499 | |
|---|
| 3500 | /* decrease size of buffer submitted */ |
|---|
| 3501 | hContext->buffer_submit_size -= header->size * sizeof (uint32_t); |
|---|
| 3502 | |
|---|
| 3503 | /* store last header type for a blit packet */ |
|---|
| 3504 | if( (header->type >= BM2MC_PACKET_PacketType_eFillBlit) && (header->type <= BM2MC_PACKET_PacketType_eDestripeBlit) ) |
|---|
| 3505 | hContext->last_blit_type = header->type; |
|---|
| 3506 | |
|---|
| 3507 | if( header->execute ) |
|---|
| 3508 | { |
|---|
| 3509 | static bool violation = false; |
|---|
| 3510 | |
|---|
| 3511 | BGRC_PACKET_P_VERIFY_RECTANGLE_SCALE(); |
|---|
| 3512 | |
|---|
| 3513 | /* bounds check memory */ |
|---|
| 3514 | if( hContext->create_settings.memory_bounds.offset && hContext->create_settings.memory_bounds.size ) |
|---|
| 3515 | { |
|---|
| 3516 | static uint32_t disable_mask = |
|---|
| 3517 | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_CH0_DISABLE_MASK) | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_CH1_DISABLE_MASK) | |
|---|
| 3518 | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_CH2_DISABLE_MASK) | BGRC_M2MC(DEST_SURFACE_FORMAT_DEF_3_CH3_DISABLE_MASK); |
|---|
| 3519 | |
|---|
| 3520 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_BOUNDS( SRC, SURFACE, TOP_LEFT, SIZE, disable_mask ); |
|---|
| 3521 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_BOUNDS( DEST, SURFACE, TOP_LEFT, SIZE, disable_mask ); |
|---|
| 3522 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_BOUNDS( OUTPUT, SURFACE, TOP_LEFT, SIZE, 0 ); |
|---|
| 3523 | } |
|---|
| 3524 | |
|---|
| 3525 | |
|---|
| 3526 | #ifdef BGRC_PACKET_P_VERIFY_SURFACE_RECTANGLE |
|---|
| 3527 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_SURFACE( SRC ); |
|---|
| 3528 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_SURFACE( DEST ); |
|---|
| 3529 | BGRC_PACKET_P_VERIFY_RECTANGLE_WITH_SURFACE( OUTPUT ); |
|---|
| 3530 | #endif |
|---|
| 3531 | if( !violation ) |
|---|
| 3532 | { |
|---|
| 3533 | first_blit = false; |
|---|
| 3534 | |
|---|
| 3535 | /* handle blit without any register groups */ |
|---|
| 3536 | if( hContext->group_header == 0 ) |
|---|
| 3537 | hContext->group_header = BCHP_M2MC_LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK; |
|---|
| 3538 | |
|---|
| 3539 | /* write blits */ |
|---|
| 3540 | BGRC_PACKET_P_WriteFifoMemory( hGrc, hContext, hContext->group_header ); |
|---|
| 3541 | execute = true; |
|---|
| 3542 | group_header = 0; |
|---|
| 3543 | |
|---|
| 3544 | /* write scaler stripe blits */ |
|---|
| 3545 | if( force_striping || |
|---|
| 3546 | #ifdef BGRC_PACKET_P_SW_DESTRIPE |
|---|
| 3547 | (hContext->last_blit_type == BM2MC_PACKET_PacketType_eDestripeBlit) || |
|---|
| 3548 | #endif |
|---|
| 3549 | (hContext->last_blit_type == BM2MC_PACKET_PacketType_eScaleBlendBlit) ) |
|---|
| 3550 | { |
|---|
| 3551 | for( ii = 1; ii < hContext->scaler.stripe_count; ++ii ) |
|---|
| 3552 | { |
|---|
| 3553 | hGrc->curr_fifo_addr = (uint32_t *) BGRC_PACKET_P_ALIGN_MEMORY( hGrc->curr_fifo_addr ); |
|---|
| 3554 | hGrc->curr_fifo_offset = (uint32_t ) BGRC_PACKET_P_ALIGN_MEMORY( hGrc->curr_fifo_offset ); |
|---|
| 3555 | |
|---|
| 3556 | if( hContext->scaler_header->type == BM2MC_PACKET_PacketType_eScaleBlendBlit ) |
|---|
| 3557 | { |
|---|
| 3558 | BM2MC_PACKET_PacketScaleBlendBlit *scale_packet = (BM2MC_PACKET_PacketScaleBlendBlit *) hContext->scaler_header; |
|---|
| 3559 | BGRC_PACKET_P_SubmitStripeBlitPacket( hContext, &scale_packet->src_rect, &scale_packet->out_rect, &scale_packet->dst_point ); |
|---|
| 3560 | } |
|---|
| 3561 | #ifdef BGRC_PACKET_P_SW_DESTRIPE |
|---|
| 3562 | else if( hContext->scaler_header->type == BM2MC_PACKET_PacketType_eDestripeBlit ) |
|---|
| 3563 | { |
|---|
| 3564 | BGRC_PACKET_P_SubmitDestripeBlitPacket( hContext, hContext->scaler_header ); |
|---|
| 3565 | } |
|---|
| 3566 | #endif |
|---|
| 3567 | else |
|---|
| 3568 | { |
|---|
| 3569 | BM2MC_PACKET_PacketScaleBlit *scale_packet = (BM2MC_PACKET_PacketScaleBlit *) hContext->scaler_header; |
|---|
| 3570 | BGRC_PACKET_P_SubmitStripeBlitPacket( hContext, &scale_packet->src_rect, &scale_packet->out_rect, |
|---|
| 3571 | (BM2MC_PACKET_Point*) (void *) &scale_packet->out_rect ); |
|---|
| 3572 | } |
|---|
| 3573 | |
|---|
| 3574 | BGRC_PACKET_P_WriteFifoMemory( hGrc, hContext, |
|---|
| 3575 | BGRC_M2MC(LIST_PACKET_HEADER_1_BLIT_GRP_CNTRL_MASK) | BGRC_M2MC(LIST_PACKET_HEADER_1_SCALE_PARAM_GRP_CNTRL_MASK) ); |
|---|
| 3576 | } |
|---|
| 3577 | } |
|---|
| 3578 | |
|---|
| 3579 | /* enable blitheader interrupt field */ |
|---|
| 3580 | if( header->sync ) |
|---|
| 3581 | BGRC_PACKET_P_WRITE_DATA( *hContext->last_blitheader_addr, hContext->last_blitheader | BGRC_M2MC(BLIT_HEADER_INTERRUPT_ENABLE_MASK) ); |
|---|
| 3582 | sync_interrupt = sync_interrupt || header->sync; |
|---|
| 3583 | |
|---|
| 3584 | /* clear group header */ |
|---|
| 3585 | hContext->group_header = 0; |
|---|
| 3586 | } |
|---|
| 3587 | |
|---|
| 3588 | /* clear scaler's stripe counts */ |
|---|
| 3589 | hContext->scaler.stripe_count = 0; |
|---|
| 3590 | hContext->scaler.stripe_num = 0; |
|---|
| 3591 | } |
|---|
| 3592 | |
|---|
| 3593 | packet = next_packet; |
|---|
| 3594 | } |
|---|
| 3595 | |
|---|
| 3596 | /* adjust buffer offset */ |
|---|
| 3597 | hContext->buffer_submit_offset = (uint8_t *) packet - (uint8_t *) hContext->buffer_base_addr; |
|---|
| 3598 | |
|---|
| 3599 | /* initiate blits */ |
|---|
| 3600 | if( execute ) |
|---|
| 3601 | { |
|---|
| 3602 | BGRC_PACKET_P_InitiateBlits( hGrc, hContext, start_fifo_addr, start_fifo_offset, |
|---|
| 3603 | hContext->buffer_submit_size || advance_interrupt, sync_interrupt ); |
|---|
| 3604 | |
|---|
| 3605 | /* save current context */ |
|---|
| 3606 | hGrc->hContext = hContext; |
|---|
| 3607 | hContext->group_header = group_header; |
|---|
| 3608 | } |
|---|
| 3609 | } |
|---|
| 3610 | |
|---|
| 3611 | /***************************************************************************/ |
|---|
| 3612 | #define BGRC_PACKET_P_SYNC_COLOR_BLEND { \ |
|---|
| 3613 | BM2MC_PACKET_BlendFactor_eConstantColor, BM2MC_PACKET_BlendFactor_eOne, false, \ |
|---|
| 3614 | BM2MC_PACKET_BlendFactor_eZero, BM2MC_PACKET_BlendFactor_eZero, false, BM2MC_PACKET_BlendFactor_eZero } |
|---|
| 3615 | |
|---|
| 3616 | #define BGRC_PACKET_P_SYNC_ALPHA_BLEND { \ |
|---|
| 3617 | BM2MC_PACKET_BlendFactor_eConstantAlpha, BM2MC_PACKET_BlendFactor_eOne, false, \ |
|---|
| 3618 | BM2MC_PACKET_BlendFactor_eZero, BM2MC_PACKET_BlendFactor_eZero, false, BM2MC_PACKET_BlendFactor_eZero } |
|---|
| 3619 | |
|---|
| 3620 | /***************************************************************************/ |
|---|
| 3621 | BERR_Code BGRC_PACKET_P_SyncBlit( |
|---|
| 3622 | BGRC_Handle hGrc, |
|---|
| 3623 | BGRC_PacketContext_Handle hContext ) |
|---|
| 3624 | { |
|---|
| 3625 | void *buffer; |
|---|
| 3626 | size_t size_out; |
|---|
| 3627 | |
|---|
| 3628 | BGRC_Packet_GetPacketMemory( hGrc, hContext, &buffer, &size_out, BGRC_PACKET_P_SYNC_PACKET_SIZE ); |
|---|
| 3629 | if( buffer ) |
|---|
| 3630 | { |
|---|
| 3631 | BM2MC_PACKET_PacketSaveState *save_packet = (BM2MC_PACKET_PacketSaveState *) ((uint8_t *) buffer); |
|---|
| 3632 | BM2MC_PACKET_PacketSourceNone *src_packet = (BM2MC_PACKET_PacketSourceNone *) (save_packet + 1); |
|---|
| 3633 | BM2MC_PACKET_PacketDestinationNone *dst_packet = (BM2MC_PACKET_PacketDestinationNone *) (src_packet + 1); |
|---|
| 3634 | BM2MC_PACKET_PacketOutputFeeder *out_packet = (BM2MC_PACKET_PacketOutputFeeder *) (dst_packet + 1); |
|---|
| 3635 | BM2MC_PACKET_PacketBlend *blend_packet = (BM2MC_PACKET_PacketBlend *) (out_packet + 1); |
|---|
| 3636 | BM2MC_PACKET_PacketRop *rop_packet = (BM2MC_PACKET_PacketRop *) (blend_packet + 1); |
|---|
| 3637 | BM2MC_PACKET_PacketSourceColorkeyEnable *key_packet = (BM2MC_PACKET_PacketSourceColorkeyEnable *) (rop_packet + 1); |
|---|
| 3638 | BM2MC_PACKET_PacketSourceColorMatrixEnable *matrix_packet = (BM2MC_PACKET_PacketSourceColorMatrixEnable *) (key_packet + 1); |
|---|
| 3639 | BM2MC_PACKET_PacketMirror *mirror_packet = (BM2MC_PACKET_PacketMirror *) (matrix_packet + 1); |
|---|
| 3640 | BM2MC_PACKET_PacketFillBlit *fill_packet = (BM2MC_PACKET_PacketFillBlit *) (mirror_packet + 1); |
|---|
| 3641 | BM2MC_PACKET_PacketRestoreState *restore_packet = (BM2MC_PACKET_PacketRestoreState *) (fill_packet + 1); |
|---|
| 3642 | BM2MC_PACKET_Blend color_blend = BGRC_PACKET_P_SYNC_COLOR_BLEND; |
|---|
| 3643 | BM2MC_PACKET_Blend alpha_blend = BGRC_PACKET_P_SYNC_ALPHA_BLEND; |
|---|
| 3644 | |
|---|
| 3645 | /* clear output pixel */ |
|---|
| 3646 | hContext->sync_output_addr[0] = 0; |
|---|
| 3647 | |
|---|
| 3648 | /* write packets */ |
|---|
| 3649 | BM2MC_PACKET_INIT( save_packet, SaveState, false ); |
|---|
| 3650 | BM2MC_PACKET_INIT( src_packet, SourceNone, false ); |
|---|
| 3651 | BM2MC_PACKET_INIT( dst_packet, DestinationNone, false ); |
|---|
| 3652 | |
|---|
| 3653 | BM2MC_PACKET_INIT( out_packet, OutputFeeder, false ); |
|---|
| 3654 | out_packet->plane.address = hContext->sync_output_offset; |
|---|
| 3655 | out_packet->plane.pitch = sizeof (uint32_t); |
|---|
| 3656 | out_packet->plane.format = BM2MC_PACKET_PixelFormat_eA8_R8_G8_B8; |
|---|
| 3657 | out_packet->plane.width = 1; |
|---|
| 3658 | out_packet->plane.height = 1; |
|---|
| 3659 | |
|---|
| 3660 | BM2MC_PACKET_INIT( blend_packet, Blend, false ); |
|---|
| 3661 | blend_packet->color_blend = color_blend; |
|---|
| 3662 | blend_packet->alpha_blend = alpha_blend; |
|---|
| 3663 | blend_packet->color = 0xFFFFFFFF; |
|---|
| 3664 | |
|---|
| 3665 | BM2MC_PACKET_INIT( rop_packet, Rop, false ); |
|---|
| 3666 | rop_packet->rop = BGRC_PACKET_P_RESET_ROP_VECTOR; |
|---|
| 3667 | rop_packet->pattern0 = 0; |
|---|
| 3668 | rop_packet->pattern1 = 0; |
|---|
| 3669 | rop_packet->color0 = 0; |
|---|
| 3670 | rop_packet->color1 = 0; |
|---|
| 3671 | |
|---|
| 3672 | BM2MC_PACKET_INIT( key_packet, SourceColorkeyEnable, false ); |
|---|
| 3673 | key_packet->enable = false; |
|---|
| 3674 | BM2MC_PACKET_INIT( matrix_packet, SourceColorMatrixEnable, false ); |
|---|
| 3675 | matrix_packet->enable = false; |
|---|
| 3676 | BM2MC_PACKET_INIT( mirror_packet, Mirror, false ); |
|---|
| 3677 | mirror_packet->src_hor = false; |
|---|
| 3678 | mirror_packet->src_ver = false; |
|---|
| 3679 | mirror_packet->dst_hor = false; |
|---|
| 3680 | mirror_packet->dst_ver = false; |
|---|
| 3681 | mirror_packet->out_hor = false; |
|---|
| 3682 | mirror_packet->out_ver = false; |
|---|
| 3683 | |
|---|
| 3684 | BM2MC_PACKET_INIT( fill_packet, FillBlit, true ); |
|---|
| 3685 | fill_packet->header.sync = true; |
|---|
| 3686 | fill_packet->rect.x = 0; |
|---|
| 3687 | fill_packet->rect.y = 0; |
|---|
| 3688 | fill_packet->rect.width = 1; |
|---|
| 3689 | fill_packet->rect.height = 1; |
|---|
| 3690 | |
|---|
| 3691 | BM2MC_PACKET_INIT( restore_packet, RestoreState, false ); |
|---|
| 3692 | |
|---|
| 3693 | /* submit packets */ |
|---|
| 3694 | hContext->last_size_out = BGRC_PACKET_P_SYNC_PACKET_SIZE; |
|---|
| 3695 | BGRC_Packet_SubmitPackets( hGrc, hContext, BGRC_PACKET_P_SYNC_PACKET_SIZE ); |
|---|
| 3696 | } |
|---|
| 3697 | else |
|---|
| 3698 | { |
|---|
| 3699 | return BERR_OUT_OF_SYSTEM_MEMORY; |
|---|
| 3700 | } |
|---|
| 3701 | |
|---|
| 3702 | return BERR_SUCCESS; |
|---|
| 3703 | } |
|---|
| 3704 | |
|---|
| 3705 | /***************************************************************************/ |
|---|
| 3706 | BM2MC_PACKET_PixelFormat BGRC_PACKET_P_ConvertPixelFormat( BPXL_Format format ) |
|---|
| 3707 | { |
|---|
| 3708 | switch( format ) |
|---|
| 3709 | { |
|---|
| 3710 | case 0: return BM2MC_PACKET_PixelFormat_eUnknown; |
|---|
| 3711 | case BPXL_eR5_G6_B5: return BM2MC_PACKET_PixelFormat_eR5_G6_B5; |
|---|
| 3712 | case BPXL_eB5_G6_R5: return BM2MC_PACKET_PixelFormat_eB5_G6_R5; |
|---|
| 3713 | case BPXL_eA1_R5_G5_B5: return BM2MC_PACKET_PixelFormat_eA1_R5_G5_B5; |
|---|
| 3714 | case BPXL_eX1_R5_G5_B5: return BM2MC_PACKET_PixelFormat_eX1_R5_G5_B5; |
|---|
| 3715 | case BPXL_eA1_B5_G5_R5: return BM2MC_PACKET_PixelFormat_eA1_B5_G5_R5; |
|---|
| 3716 | case BPXL_eX1_B5_G5_R5: return BM2MC_PACKET_PixelFormat_eX1_B5_G5_R5; |
|---|
| 3717 | case BPXL_eR5_G5_B5_A1: return BM2MC_PACKET_PixelFormat_eR5_G5_B5_A1; |
|---|
| 3718 | case BPXL_eR5_G5_B5_X1: return BM2MC_PACKET_PixelFormat_eR5_G5_B5_X1; |
|---|
| 3719 | case BPXL_eB5_G5_R5_A1: return BM2MC_PACKET_PixelFormat_eB5_G5_R5_A1; |
|---|
| 3720 | case BPXL_eB5_G5_R5_X1: return BM2MC_PACKET_PixelFormat_eB5_G5_R5_X1; |
|---|
| 3721 | case BPXL_eA4_R4_G4_B4: return BM2MC_PACKET_PixelFormat_eA4_R4_G4_B4; |
|---|
| 3722 | case BPXL_eX4_R4_G4_B4: return BM2MC_PACKET_PixelFormat_eX4_R4_G4_B4; |
|---|
| 3723 | case BPXL_eA4_B4_G4_R4: return BM2MC_PACKET_PixelFormat_eA4_B4_G4_R4; |
|---|
| 3724 | case BPXL_eX4_B4_G4_R4: return BM2MC_PACKET_PixelFormat_eX4_B4_G4_R4; |
|---|
| 3725 | case BPXL_eR4_G4_B4_A4: return BM2MC_PACKET_PixelFormat_eR4_G4_B4_A4; |
|---|
| 3726 | case BPXL_eR4_G4_B4_X4: return BM2MC_PACKET_PixelFormat_eR4_G4_B4_X4; |
|---|
| 3727 | case BPXL_eB4_G4_R4_A4: return BM2MC_PACKET_PixelFormat_eB4_G4_R4_A4; |
|---|
| 3728 | case BPXL_eB4_G4_R4_X4: return BM2MC_PACKET_PixelFormat_eB4_G4_R4_X4; |
|---|
| 3729 | case BPXL_eA8_R8_G8_B8: return BM2MC_PACKET_PixelFormat_eA8_R8_G8_B8; |
|---|
| 3730 | case BPXL_eX8_R8_G8_B8: return BM2MC_PACKET_PixelFormat_eX8_R8_G8_B8; |
|---|
| 3731 | case BPXL_eA8_B8_G8_R8: return BM2MC_PACKET_PixelFormat_eA8_B8_G8_R8; |
|---|
| 3732 | case BPXL_eX8_B8_G8_R8: return BM2MC_PACKET_PixelFormat_eX8_B8_G8_R8; |
|---|
| 3733 | case BPXL_eR8_G8_B8_A8: return BM2MC_PACKET_PixelFormat_eR8_G8_B8_A8; |
|---|
| 3734 | case BPXL_eR8_G8_B8_X8: return BM2MC_PACKET_PixelFormat_eR8_G8_B8_X8; |
|---|
| 3735 | case BPXL_eB8_G8_R8_A8: return BM2MC_PACKET_PixelFormat_eB8_G8_R8_A8; |
|---|
| 3736 | case BPXL_eB8_G8_R8_X8: return BM2MC_PACKET_PixelFormat_eB8_G8_R8_X8; |
|---|
| 3737 | case BPXL_eA8: return BM2MC_PACKET_PixelFormat_eA8; |
|---|
| 3738 | case BPXL_eA4: return BM2MC_PACKET_PixelFormat_eA4; |
|---|
| 3739 | case BPXL_eA2: return BM2MC_PACKET_PixelFormat_eA2; |
|---|
| 3740 | case BPXL_eA1: return BM2MC_PACKET_PixelFormat_eA1; |
|---|
| 3741 | case BPXL_eW1: return BM2MC_PACKET_PixelFormat_eW1; |
|---|
| 3742 | case BPXL_eA8_P8: return BM2MC_PACKET_PixelFormat_eA8_P8; |
|---|
| 3743 | case BPXL_eP8: return BM2MC_PACKET_PixelFormat_eP8; |
|---|
| 3744 | case BPXL_eP4: return BM2MC_PACKET_PixelFormat_eP4; |
|---|
| 3745 | case BPXL_eP2: return BM2MC_PACKET_PixelFormat_eP2; |
|---|
| 3746 | case BPXL_eP1: return BM2MC_PACKET_PixelFormat_eP1; |
|---|
| 3747 | case BPXL_eY8_P8: return BM2MC_PACKET_PixelFormat_eY8_P8; |
|---|
| 3748 | case BPXL_eY8: return BM2MC_PACKET_PixelFormat_eY8; |
|---|
| 3749 | case BPXL_eA8_Y8: return BM2MC_PACKET_PixelFormat_eA8_Y8; |
|---|
| 3750 | case BPXL_eCb8_Cr8: return BM2MC_PACKET_PixelFormat_eCb8_Cr8; |
|---|
| 3751 | case BPXL_eCr8_Cb8: return BM2MC_PACKET_PixelFormat_eCr8_Cb8; |
|---|
| 3752 | case BPXL_eCb8: return BM2MC_PACKET_PixelFormat_eCb8; |
|---|
| 3753 | case BPXL_eCr8: return BM2MC_PACKET_PixelFormat_eCr8; |
|---|
| 3754 | case BPXL_eY08_Cb8_Y18_Cr8: return BM2MC_PACKET_PixelFormat_eY08_Cb8_Y18_Cr8; |
|---|
| 3755 | case BPXL_eY08_Cr8_Y18_Cb8: return BM2MC_PACKET_PixelFormat_eY08_Cr8_Y18_Cb8; |
|---|
| 3756 | case BPXL_eY18_Cb8_Y08_Cr8: return BM2MC_PACKET_PixelFormat_eY18_Cb8_Y08_Cr8; |
|---|
| 3757 | case BPXL_eY18_Cr8_Y08_Cb8: return BM2MC_PACKET_PixelFormat_eY18_Cr8_Y08_Cb8; |
|---|
| 3758 | case BPXL_eCb8_Y08_Cr8_Y18: return BM2MC_PACKET_PixelFormat_eCb8_Y08_Cr8_Y18; |
|---|
| 3759 | case BPXL_eCb8_Y18_Cr8_Y08: return BM2MC_PACKET_PixelFormat_eCb8_Y18_Cr8_Y08; |
|---|
| 3760 | case BPXL_eCr8_Y18_Cb8_Y08: return BM2MC_PACKET_PixelFormat_eCr8_Y18_Cb8_Y08; |
|---|
| 3761 | case BPXL_eCr8_Y08_Cb8_Y18: return BM2MC_PACKET_PixelFormat_eCr8_Y08_Cb8_Y18; |
|---|
| 3762 | case BPXL_eX2_Cr10_Y10_Cb10: return BM2MC_PACKET_PixelFormat_eX2_Cr10_Y10_Cb10; |
|---|
| 3763 | case BPXL_eA8_Y8_Cb8_Cr8: return BM2MC_PACKET_PixelFormat_eA8_Y8_Cb8_Cr8; |
|---|
| 3764 | case BPXL_eA8_Cr8_Cb8_Y8: return BM2MC_PACKET_PixelFormat_eA8_Cr8_Cb8_Y8; |
|---|
| 3765 | case BPXL_eCr8_Cb8_Y8_A8: return BM2MC_PACKET_PixelFormat_eCr8_Cb8_Y8_A8; |
|---|
| 3766 | case BPXL_eY8_Cb8_Cr8_A8: return BM2MC_PACKET_PixelFormat_eY8_Cb8_Cr8_A8; |
|---|
| 3767 | case BPXL_eY010_Cb10_Y110_Cr10: return BM2MC_PACKET_PixelFormat_eY010_Cb10_Y110_Cr10; |
|---|
| 3768 | case BPXL_eY010_Cr10_Y110_Cb10: return BM2MC_PACKET_PixelFormat_eY010_Cr10_Y110_Cb10; |
|---|
| 3769 | case BPXL_eY110_Cb10_Y010_Cr10: return BM2MC_PACKET_PixelFormat_eY110_Cb10_Y010_Cr10; |
|---|
| 3770 | case BPXL_eY110_Cr10_Y010_Cb10: return BM2MC_PACKET_PixelFormat_eY110_Cr10_Y010_Cb10; |
|---|
| 3771 | case BPXL_eCb10_Y010_Cr10_Y110: return BM2MC_PACKET_PixelFormat_eCb10_Y010_Cr10_Y110; |
|---|
| 3772 | case BPXL_eCb10_Y110_Cr10_Y010: return BM2MC_PACKET_PixelFormat_eCb10_Y110_Cr10_Y010; |
|---|
| 3773 | case BPXL_eCr10_Y110_Cb10_Y010: return BM2MC_PACKET_PixelFormat_eCr10_Y110_Cb10_Y010; |
|---|
| 3774 | case BPXL_eCr10_Y010_Cb10_Y110: return BM2MC_PACKET_PixelFormat_eCr10_Y010_Cb10_Y110; |
|---|
| 3775 | case BPXL_eL15_L05_A6: return BM2MC_PACKET_PixelFormat_eL15_L05_A6; |
|---|
| 3776 | default: return 0; |
|---|
| 3777 | } |
|---|
| 3778 | } |
|---|
| 3779 | |
|---|
| 3780 | /***************************************************************************/ |
|---|
| 3781 | void BGRC_PACKET_P_ConvertFilterCoeffs( BM2MC_PACKET_FilterCoeffs *coeffs, BGRC_FilterCoeffs filter, size_t src_size, size_t out_size ) |
|---|
| 3782 | { |
|---|
| 3783 | static BM2MC_PACKET_FilterCoeffs *pcoeffs = NULL; |
|---|
| 3784 | int iIndex; |
|---|
| 3785 | int iIndexMax; |
|---|
| 3786 | |
|---|
| 3787 | switch( filter ) |
|---|
| 3788 | { |
|---|
| 3789 | case BGRC_FilterCoeffs_ePointSample: |
|---|
| 3790 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_PointSample; |
|---|
| 3791 | break; |
|---|
| 3792 | |
|---|
| 3793 | case BGRC_FilterCoeffs_eBilinear: |
|---|
| 3794 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_Bilinear; |
|---|
| 3795 | break; |
|---|
| 3796 | |
|---|
| 3797 | case BGRC_FilterCoeffs_eAnisotropic: |
|---|
| 3798 | iIndexMax = sizeof s_BGRC_PACKET_P_DeviceFilter_Anisotropic / sizeof (BM2MC_PACKET_FilterCoeffs); |
|---|
| 3799 | iIndex = out_size ? ((src_size << BGRC_PACKET_P_SCALER_STEP_FRAC_BITS) / out_size) >> BGRC_PACKET_P_SCALER_STEP_FRAC_BITS : 0; |
|---|
| 3800 | iIndex = (iIndex > iIndexMax) ? iIndexMax : iIndex; |
|---|
| 3801 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_Anisotropic[iIndex]; |
|---|
| 3802 | break; |
|---|
| 3803 | |
|---|
| 3804 | case BGRC_FilterCoeffs_eSharp: |
|---|
| 3805 | iIndexMax = sizeof s_BGRC_PACKET_P_DeviceFilter_Sharp / sizeof (BM2MC_PACKET_FilterCoeffs); |
|---|
| 3806 | iIndex = src_size ? (out_size * 8) / src_size : 0; |
|---|
| 3807 | iIndex = (iIndex > iIndexMax) ? iIndexMax : iIndex; |
|---|
| 3808 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_Sharp[iIndex]; |
|---|
| 3809 | break; |
|---|
| 3810 | |
|---|
| 3811 | case BGRC_FilterCoeffs_eSharper: |
|---|
| 3812 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_Sharper; |
|---|
| 3813 | break; |
|---|
| 3814 | |
|---|
| 3815 | case BGRC_FilterCoeffs_eBlurry: |
|---|
| 3816 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_Blurry; |
|---|
| 3817 | break; |
|---|
| 3818 | |
|---|
| 3819 | case BGRC_FilterCoeffs_eAntiFlutter: |
|---|
| 3820 | if( src_size == out_size ) |
|---|
| 3821 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutter; |
|---|
| 3822 | else |
|---|
| 3823 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutterScale; |
|---|
| 3824 | break; |
|---|
| 3825 | |
|---|
| 3826 | case BGRC_FilterCoeffs_eAntiFlutterBlurry: |
|---|
| 3827 | if( src_size == out_size ) |
|---|
| 3828 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutterBlurry; |
|---|
| 3829 | else |
|---|
| 3830 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutterScale; |
|---|
| 3831 | break; |
|---|
| 3832 | |
|---|
| 3833 | case BGRC_FilterCoeffs_eAntiFlutterSharp: |
|---|
| 3834 | if( src_size == out_size ) |
|---|
| 3835 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutterSharp; |
|---|
| 3836 | else |
|---|
| 3837 | pcoeffs = &s_BGRC_PACKET_P_DeviceFilter_AntiFlutterScale; |
|---|
| 3838 | break; |
|---|
| 3839 | } |
|---|
| 3840 | |
|---|
| 3841 | if( coeffs && pcoeffs ) |
|---|
| 3842 | BKNI_Memcpy( coeffs, pcoeffs, sizeof (BM2MC_PACKET_FilterCoeffs) ); |
|---|
| 3843 | } |
|---|
| 3844 | |
|---|
| 3845 | /***************************************************************************/ |
|---|
| 3846 | #define BGRC_PACKET_P_MATRIX_FRAC_BITS 10 |
|---|
| 3847 | |
|---|
| 3848 | #if (BCHP_CHIP!=7038) |
|---|
| 3849 | #define BGRC_PACKET_P_MATRIX_FRAC_ADD_BITS 4 |
|---|
| 3850 | #else |
|---|
| 3851 | #define BGRC_PACKET_P_MATRIX_FRAC_ADD_BITS 0 |
|---|
| 3852 | #endif |
|---|
| 3853 | |
|---|
| 3854 | #define BGRC_PACKET_P_GET_MATRIX_ENTRY( entry, left, right ) (int16_t) \ |
|---|
| 3855 | ((((((entry) * (((entry) < 0) ? -1 : 1)) << (left)) >> (right)) * (((entry) < 0) ? -1 : 1)) & BGRC_M2MC(SRC_CM_C00_C01_CM_C01_MASK)) |
|---|
| 3856 | |
|---|
| 3857 | /***************************************************************************/ |
|---|
| 3858 | void BGRC_PACKET_P_ConvertColorMatrix( BM2MC_PACKET_ColorMatrix *matrix_out, const int32_t *matrix_in, size_t shift ) |
|---|
| 3859 | { |
|---|
| 3860 | int ii; |
|---|
| 3861 | for( ii = 0; ii < 4; ++ii ) |
|---|
| 3862 | { |
|---|
| 3863 | matrix_out->m[ii][0] = BGRC_PACKET_P_GET_MATRIX_ENTRY(matrix_in[ii*5+0], BGRC_PACKET_P_MATRIX_FRAC_BITS, shift); |
|---|
| 3864 | matrix_out->m[ii][1] = BGRC_PACKET_P_GET_MATRIX_ENTRY(matrix_in[ii*5+1], BGRC_PACKET_P_MATRIX_FRAC_BITS, shift); |
|---|
| 3865 | matrix_out->m[ii][2] = BGRC_PACKET_P_GET_MATRIX_ENTRY(matrix_in[ii*5+2], BGRC_PACKET_P_MATRIX_FRAC_BITS, shift); |
|---|
| 3866 | matrix_out->m[ii][3] = BGRC_PACKET_P_GET_MATRIX_ENTRY(matrix_in[ii*5+3], BGRC_PACKET_P_MATRIX_FRAC_BITS, shift); |
|---|
| 3867 | matrix_out->m[ii][4] = BGRC_PACKET_P_GET_MATRIX_ENTRY(matrix_in[ii*5+4], BGRC_PACKET_P_MATRIX_FRAC_ADD_BITS, shift); |
|---|
| 3868 | } |
|---|
| 3869 | } |
|---|