ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / arch / GC350 / hal / kernel / gc_hal_kernel_hardware_vg.c
blobb5cd03572734215b21be74428e475d0699818be4
1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
24 #include "gc_hal.h"
25 #include "gc_hal_kernel.h"
27 #if gcdENABLE_VG
29 #define _GC_OBJ_ZONE gcvZONE_HARDWARE
31 /******************************************************************************\
32 ********************************* Support Code *********************************
33 \******************************************************************************/
35 static gceSTATUS
36 _IdentifyHardware(
37 IN gckOS Os,
38 OUT gceCHIPMODEL * ChipModel,
39 OUT gctUINT32 * ChipRevision,
40 OUT gctUINT32 * ChipFeatures,
41 OUT gctUINT32 * ChipMinorFeatures,
42 OUT gctUINT32 * ChipMinorFeatures2
45 gceSTATUS status;
46 gctUINT32 chipIdentity;
50 /* Read chip identity register. */
51 gcmkERR_BREAK(gckOS_ReadRegisterEx(Os, gcvCORE_VG, 0x00018, &chipIdentity));
53 /* Special case for older graphic cores. */
54 if (((((gctUINT32) (chipIdentity)) >> (0 ? 31:24) & ((gctUINT32) ((((1 ? 31:24) - (0 ? 31:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:24) - (0 ? 31:24) + 1)))))) == (0x01 & ((gctUINT32) ((((1 ? 31:24) - (0 ? 31:24) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:24) - (0 ? 31:24) + 1))))))))
56 *ChipModel = gcv500;
57 *ChipRevision = (((((gctUINT32) (chipIdentity)) >> (0 ? 15:12)) & ((gctUINT32) ((((1 ? 15:12) - (0 ? 15:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:12) - (0 ? 15:12) + 1)))))) );
60 else
62 /* Read chip identity register. */
63 gcmkERR_BREAK(gckOS_ReadRegisterEx(Os, gcvCORE_VG,
64 0x00020,
65 (gctUINT32 *) ChipModel));
67 /* Read CHIP_REV register. */
68 gcmkERR_BREAK(gckOS_ReadRegisterEx(Os, gcvCORE_VG,
69 0x00024,
70 ChipRevision));
73 /* Read chip feature register. */
74 gcmkERR_BREAK(gckOS_ReadRegisterEx(
75 Os, gcvCORE_VG, 0x0001C, ChipFeatures
76 ));
78 /* Read chip minor feature register. */
79 gcmkERR_BREAK(gckOS_ReadRegisterEx(
80 Os, gcvCORE_VG, 0x00034, ChipMinorFeatures
81 ));
83 /* Read chip minor feature register #2. */
84 gcmkERR_BREAK(gckOS_ReadRegisterEx(
85 Os, gcvCORE_VG, 0x00074, ChipMinorFeatures2
86 ));
88 gcmkTRACE(
89 gcvLEVEL_VERBOSE,
90 "ChipModel=0x%08X\n"
91 "ChipRevision=0x%08X\n"
92 "ChipFeatures=0x%08X\n"
93 "ChipMinorFeatures=0x%08X\n"
94 "ChipMinorFeatures2=0x%08X\n",
95 *ChipModel,
96 *ChipRevision,
97 *ChipFeatures,
98 *ChipMinorFeatures,
99 *ChipMinorFeatures2
102 /* Success. */
103 return gcvSTATUS_OK;
105 while (gcvFALSE);
107 /* Return the status. */
108 return status;
111 /******************************************************************************\
112 ****************************** gckVGHARDWARE API code *****************************
113 \******************************************************************************/
115 /*******************************************************************************
117 ** gckVGHARDWARE_Construct
119 ** Construct a new gckVGHARDWARE object.
121 ** INPUT:
123 ** gckOS Os
124 ** Pointer to an initialized gckOS object.
126 ** OUTPUT:
128 ** gckVGHARDWARE * Hardware
129 ** Pointer to a variable that will hold the pointer to the gckVGHARDWARE
130 ** object.
132 gceSTATUS
133 gckVGHARDWARE_Construct(
134 IN gckOS Os,
135 OUT gckVGHARDWARE * Hardware
138 gckVGHARDWARE hardware;
139 gceSTATUS status;
140 gceCHIPMODEL chipModel;
141 gctUINT32 chipRevision;
142 gctUINT32 chipFeatures;
143 gctUINT32 chipMinorFeatures;
144 gctUINT32 chipMinorFeatures2;
146 gcmkHEADER_ARG("Os=0x%x Hardware=0x%x ", Os, Hardware);
148 /* Verify the arguments. */
149 gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
150 gcmkVERIFY_ARGUMENT(Hardware != gcvNULL);
154 /* Identify the hardware. */
155 gcmkERR_BREAK(_IdentifyHardware(Os,
156 &chipModel, &chipRevision,
157 &chipFeatures, &chipMinorFeatures, &chipMinorFeatures2
160 /* Allocate the gckVGHARDWARE object. */
161 gcmkERR_BREAK(gckOS_Allocate(Os,
162 gcmSIZEOF(struct _gckVGHARDWARE), (gctPOINTER *) &hardware
165 /* Initialize the gckVGHARDWARE object. */
166 hardware->object.type = gcvOBJ_HARDWARE;
167 hardware->os = Os;
169 /* Set chip identity. */
170 hardware->chipModel = chipModel;
171 hardware->chipRevision = chipRevision;
172 hardware->chipFeatures = chipFeatures;
173 hardware->chipMinorFeatures = chipMinorFeatures;
174 hardware->chipMinorFeatures2 = chipMinorFeatures2;
176 /* Determine whether FE 2.0 is present. */
177 hardware->fe20 = ((((gctUINT32) (hardware->chipFeatures)) >> (0 ? 28:28) & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))));
179 /* Determine whether VG 2.0 is present. */
180 hardware->vg20 = ((((gctUINT32) (hardware->chipMinorFeatures)) >> (0 ? 13:13) & ((gctUINT32) ((((1 ? 13:13) - (0 ? 13:13) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:13) - (0 ? 13:13) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 13:13) - (0 ? 13:13) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 13:13) - (0 ? 13:13) + 1)))))));
182 /* Determine whether VG 2.1 is present. */
183 hardware->vg21 = ((((gctUINT32) (hardware->chipMinorFeatures)) >> (0 ? 18:18) & ((gctUINT32) ((((1 ? 18:18) - (0 ? 18:18) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 18:18) - (0 ? 18:18) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 18:18) - (0 ? 18:18) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 18:18) - (0 ? 18:18) + 1)))))));
185 /* Set default event mask. */
186 hardware->eventMask = 0xFFFFFFFF;
188 /* Set fast clear to auto. */
189 gcmkVERIFY_OK(gckVGHARDWARE_SetFastClear(hardware, -1));
191 /* Return pointer to the gckVGHARDWARE object. */
192 *Hardware = hardware;
194 gcmkFOOTER_NO();
195 /* Success. */
196 return gcvSTATUS_OK;
198 while (gcvFALSE);
200 gcmkFOOTER();
201 /* Return the status. */
202 return status;
205 /*******************************************************************************
207 ** gckVGHARDWARE_Destroy
209 ** Destroy an gckVGHARDWARE object.
211 ** INPUT:
213 ** gckVGHARDWARE Hardware
214 ** Pointer to the gckVGHARDWARE object that needs to be destroyed.
216 ** OUTPUT:
218 ** Nothing.
220 gceSTATUS
221 gckVGHARDWARE_Destroy(
222 IN gckVGHARDWARE Hardware
225 gceSTATUS status;
226 gcmkHEADER_ARG("Hardware=0x%x ", Hardware);
227 /* Verify the arguments. */
228 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
230 /* Mark the object as unknown. */
231 Hardware->object.type = gcvOBJ_UNKNOWN;
233 /* Free the object. */
234 status = gckOS_Free(Hardware->os, Hardware);
235 gcmkFOOTER();
236 return status;
239 /*******************************************************************************
241 ** gckVGHARDWARE_QueryMemory
243 ** Query the amount of memory available on the hardware.
245 ** INPUT:
247 ** gckVGHARDWARE Hardware
248 ** Pointer to the gckVGHARDWARE object.
250 ** OUTPUT:
252 ** gctSIZE_T * InternalSize
253 ** Pointer to a variable that will hold the size of the internal video
254 ** memory in bytes. If 'InternalSize' is gcvNULL, no information of the
255 ** internal memory will be returned.
257 ** gctUINT32 * InternalBaseAddress
258 ** Pointer to a variable that will hold the hardware's base address for
259 ** the internal video memory. This pointer cannot be gcvNULL if
260 ** 'InternalSize' is also non-gcvNULL.
262 ** gctUINT32 * InternalAlignment
263 ** Pointer to a variable that will hold the hardware's base address for
264 ** the internal video memory. This pointer cannot be gcvNULL if
265 ** 'InternalSize' is also non-gcvNULL.
267 ** gctSIZE_T * ExternalSize
268 ** Pointer to a variable that will hold the size of the external video
269 ** memory in bytes. If 'ExternalSize' is gcvNULL, no information of the
270 ** external memory will be returned.
272 ** gctUINT32 * ExternalBaseAddress
273 ** Pointer to a variable that will hold the hardware's base address for
274 ** the external video memory. This pointer cannot be gcvNULL if
275 ** 'ExternalSize' is also non-gcvNULL.
277 ** gctUINT32 * ExternalAlignment
278 ** Pointer to a variable that will hold the hardware's base address for
279 ** the external video memory. This pointer cannot be gcvNULL if
280 ** 'ExternalSize' is also non-gcvNULL.
282 ** gctUINT32 * HorizontalTileSize
283 ** Number of horizontal pixels per tile. If 'HorizontalTileSize' is
284 ** gcvNULL, no horizontal pixel per tile will be returned.
286 ** gctUINT32 * VerticalTileSize
287 ** Number of vertical pixels per tile. If 'VerticalTileSize' is
288 ** gcvNULL, no vertical pixel per tile will be returned.
290 gceSTATUS
291 gckVGHARDWARE_QueryMemory(
292 IN gckVGHARDWARE Hardware,
293 OUT gctSIZE_T * InternalSize,
294 OUT gctUINT32 * InternalBaseAddress,
295 OUT gctUINT32 * InternalAlignment,
296 OUT gctSIZE_T * ExternalSize,
297 OUT gctUINT32 * ExternalBaseAddress,
298 OUT gctUINT32 * ExternalAlignment,
299 OUT gctUINT32 * HorizontalTileSize,
300 OUT gctUINT32 * VerticalTileSize
303 gcmkHEADER_ARG("Hardware=0x%x InternalSize=0x%x InternalBaseAddress=0x%x InternalAlignment=0x%x"
304 "ExternalSize=0x%x ExternalBaseAddress=0x%x ExternalAlignment=0x%x HorizontalTileSize=0x%x VerticalTileSize=0x%x",
305 Hardware, InternalSize, InternalBaseAddress, InternalAlignment,
306 ExternalSize, ExternalBaseAddress, ExternalAlignment, HorizontalTileSize, VerticalTileSize);
308 /* Verify the arguments. */
309 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
311 if (InternalSize != gcvNULL)
313 /* No internal memory. */
314 *InternalSize = 0;
317 if (ExternalSize != gcvNULL)
319 /* No external memory. */
320 *ExternalSize = 0;
323 if (HorizontalTileSize != gcvNULL)
325 /* 4x4 tiles. */
326 *HorizontalTileSize = 4;
329 if (VerticalTileSize != gcvNULL)
331 /* 4x4 tiles. */
332 *VerticalTileSize = 4;
335 gcmkFOOTER_NO();
336 /* Success. */
337 return gcvSTATUS_OK;
340 /*******************************************************************************
342 ** gckVGHARDWARE_QueryChipIdentity
344 ** Query the identity of the hardware.
346 ** INPUT:
348 ** gckVGHARDWARE Hardware
349 ** Pointer to the gckVGHARDWARE object.
351 ** OUTPUT:
353 ** gceCHIPMODEL * ChipModel
354 ** If 'ChipModel' is not gcvNULL, the variable it points to will
355 ** receive the model of the chip.
357 ** gctUINT32 * ChipRevision
358 ** If 'ChipRevision' is not gcvNULL, the variable it points to will
359 ** receive the revision of the chip.
361 ** gctUINT32 * ChipFeatures
362 ** If 'ChipFeatures' is not gcvNULL, the variable it points to will
363 ** receive the feature set of the chip.
365 ** gctUINT32 * ChipMinorFeatures
366 ** If 'ChipMinorFeatures' is not gcvNULL, the variable it points to
367 ** will receive the minor feature set of the chip.
369 ** gctUINT32 * ChipMinorFeatures2
370 ** If 'ChipMinorFeatures2' is not gcvNULL, the variable it points to
371 ** will receive the minor feature set of the chip.
374 gceSTATUS
375 gckVGHARDWARE_QueryChipIdentity(
376 IN gckVGHARDWARE Hardware,
377 OUT gceCHIPMODEL * ChipModel,
378 OUT gctUINT32 * ChipRevision,
379 OUT gctUINT32* ChipFeatures,
380 OUT gctUINT32* ChipMinorFeatures,
381 OUT gctUINT32* ChipMinorFeatures2
384 gcmkHEADER_ARG("Hardware=0x%x ChipModel=0x%x ChipRevision=0x%x ChipFeatures = 0x%x ChipMinorFeatures = 0x%x ChipMinorFeatures2 = 0x%x",
385 Hardware, ChipModel, ChipRevision, ChipFeatures, ChipMinorFeatures, ChipMinorFeatures2);
387 /* Verify the arguments. */
388 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
390 /* Return chip model. */
391 if (ChipModel != gcvNULL)
393 *ChipModel = Hardware->chipModel;
396 /* Return revision number. */
397 if (ChipRevision != gcvNULL)
399 *ChipRevision = Hardware->chipRevision;
402 /* Return feature set. */
403 if (ChipFeatures != gcvNULL)
405 gctUINT32 features = Hardware->chipFeatures;
407 if ((((((gctUINT32) (features)) >> (0 ? 0:0)) & ((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1)))))) ))
409 features = ((((gctUINT32) (features)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1))))))) << (0 ? 0:0))) | (((gctUINT32) ((gctUINT32) (Hardware->allowFastClear) & ((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1))))))) << (0 ? 0:0)));
412 /* Mark 2D pipe as available for GC500.0 since it did not have this *\
413 \* bit. */
414 if ((Hardware->chipModel == gcv500)
415 && (Hardware->chipRevision == 0)
418 features = ((((gctUINT32) (features)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 9:9) - (0 ? 9:9) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 9:9) - (0 ? 9:9) + 1))))))) << (0 ? 9:9))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 9:9) - (0 ? 9:9) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 9:9) - (0 ? 9:9) + 1))))))) << (0 ? 9:9)));
421 /* Mark 2D pipe as available for GC300 since it did not have this *\
422 \* bit. */
423 if (Hardware->chipModel == gcv300)
425 features = ((((gctUINT32) (features)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 9:9) - (0 ? 9:9) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 9:9) - (0 ? 9:9) + 1))))))) << (0 ? 9:9))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 9:9) - (0 ? 9:9) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 9:9) - (0 ? 9:9) + 1))))))) << (0 ? 9:9)));
428 *ChipFeatures = features;
431 /* Return minor feature set. */
432 if (ChipMinorFeatures != gcvNULL)
434 *ChipMinorFeatures = Hardware->chipMinorFeatures;
437 /* Return minor feature set #2. */
438 if (ChipMinorFeatures2 != gcvNULL)
440 *ChipMinorFeatures2 = Hardware->chipMinorFeatures2;
443 gcmkFOOTER_NO();
444 /* Success. */
445 return gcvSTATUS_OK;
448 /*******************************************************************************
450 ** gckVGHARDWARE_ConvertFormat
452 ** Convert an API format to hardware parameters.
454 ** INPUT:
456 ** gckVGHARDWARE Hardware
457 ** Pointer to the gckVGHARDWARE object.
459 ** gceSURF_FORMAT Format
460 ** API format to convert.
462 ** OUTPUT:
464 ** gctUINT32 * BitsPerPixel
465 ** Pointer to a variable that will hold the number of bits per pixel.
467 ** gctUINT32 * BytesPerTile
468 ** Pointer to a variable that will hold the number of bytes per tile.
470 gceSTATUS
471 gckVGHARDWARE_ConvertFormat(
472 IN gckVGHARDWARE Hardware,
473 IN gceSURF_FORMAT Format,
474 OUT gctUINT32 * BitsPerPixel,
475 OUT gctUINT32 * BytesPerTile
478 gctUINT32 bitsPerPixel;
479 gctUINT32 bytesPerTile;
481 gcmkHEADER_ARG("Hardware=0x%x Format=0x%x BitsPerPixel=0x%x BytesPerTile = 0x%x",
482 Hardware, Format, BitsPerPixel, BytesPerTile);
484 /* Verify the arguments. */
485 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
487 /* Dispatch on format. */
488 switch (Format)
490 case gcvSURF_A1:
491 case gcvSURF_L1:
492 /* 1-bpp format. */
493 bitsPerPixel = 1;
494 bytesPerTile = (1 * 4 * 4) / 8;
495 break;
497 case gcvSURF_A4:
498 /* 4-bpp format. */
499 bitsPerPixel = 4;
500 bytesPerTile = (4 * 4 * 4) / 8;
501 break;
503 case gcvSURF_INDEX8:
504 case gcvSURF_A8:
505 case gcvSURF_L8:
506 /* 8-bpp format. */
507 bitsPerPixel = 8;
508 bytesPerTile = (8 * 4 * 4) / 8;
509 break;
511 case gcvSURF_YV12:
512 /* 12-bpp planar YUV formats. */
513 bitsPerPixel = 12;
514 bytesPerTile = (12 * 4 * 4) / 8;
515 break;
517 case gcvSURF_NV12:
518 /* 12-bpp planar YUV formats. */
519 bitsPerPixel = 12;
520 bytesPerTile = (12 * 4 * 4) / 8;
521 break;
523 /* 4444 variations. */
524 case gcvSURF_X4R4G4B4:
525 case gcvSURF_A4R4G4B4:
526 case gcvSURF_R4G4B4X4:
527 case gcvSURF_R4G4B4A4:
528 case gcvSURF_B4G4R4X4:
529 case gcvSURF_B4G4R4A4:
530 case gcvSURF_X4B4G4R4:
531 case gcvSURF_A4B4G4R4:
533 /* 1555 variations. */
534 case gcvSURF_X1R5G5B5:
535 case gcvSURF_A1R5G5B5:
536 case gcvSURF_R5G5B5X1:
537 case gcvSURF_R5G5B5A1:
538 case gcvSURF_X1B5G5R5:
539 case gcvSURF_A1B5G5R5:
540 case gcvSURF_B5G5R5X1:
541 case gcvSURF_B5G5R5A1:
543 /* 565 variations. */
544 case gcvSURF_R5G6B5:
545 case gcvSURF_B5G6R5:
547 case gcvSURF_A8L8:
548 case gcvSURF_YUY2:
549 case gcvSURF_UYVY:
550 case gcvSURF_D16:
551 /* 16-bpp format. */
552 bitsPerPixel = 16;
553 bytesPerTile = (16 * 4 * 4) / 8;
554 break;
556 case gcvSURF_X8R8G8B8:
557 case gcvSURF_A8R8G8B8:
558 case gcvSURF_X8B8G8R8:
559 case gcvSURF_A8B8G8R8:
560 case gcvSURF_R8G8B8X8:
561 case gcvSURF_R8G8B8A8:
562 case gcvSURF_B8G8R8X8:
563 case gcvSURF_B8G8R8A8:
564 case gcvSURF_D32:
565 /* 32-bpp format. */
566 bitsPerPixel = 32;
567 bytesPerTile = (32 * 4 * 4) / 8;
568 break;
570 case gcvSURF_D24S8:
571 /* 24-bpp format. */
572 bitsPerPixel = 32;
573 bytesPerTile = (32 * 4 * 4) / 8;
574 break;
576 case gcvSURF_DXT1:
577 case gcvSURF_ETC1:
578 bitsPerPixel = 4;
579 bytesPerTile = (4 * 4 * 4) / 8;
580 break;
582 case gcvSURF_DXT2:
583 case gcvSURF_DXT3:
584 case gcvSURF_DXT4:
585 case gcvSURF_DXT5:
586 bitsPerPixel = 8;
587 bytesPerTile = (8 * 4 * 4) / 8;
588 break;
590 default:
591 /* Invalid format. */
592 return gcvSTATUS_INVALID_ARGUMENT;
595 /* Set the result. */
596 if (BitsPerPixel != gcvNULL)
598 * BitsPerPixel = bitsPerPixel;
601 if (BytesPerTile != gcvNULL)
603 * BytesPerTile = bytesPerTile;
606 gcmkFOOTER_NO();
607 /* Success. */
608 return gcvSTATUS_OK;
611 /*******************************************************************************
613 ** gckVGHARDWARE_SplitMemory
615 ** Split a hardware specific memory address into a pool and offset.
617 ** INPUT:
619 ** gckVGHARDWARE Hardware
620 ** Pointer to the gckVGHARDWARE object.
622 ** gctUINT32 Address
623 ** Address in hardware specific format.
625 ** OUTPUT:
627 ** gcePOOL * Pool
628 ** Pointer to a variable that will hold the pool type for the address.
630 ** gctUINT32 * Offset
631 ** Pointer to a variable that will hold the offset for the address.
633 gceSTATUS
634 gckVGHARDWARE_SplitMemory(
635 IN gckVGHARDWARE Hardware,
636 IN gctUINT32 Address,
637 OUT gcePOOL * Pool,
638 OUT gctUINT32 * Offset
641 gcmkHEADER_ARG("Hardware=0x%x Address=0x%x Pool=0x%x Offset = 0x%x",
642 Hardware, Address, Pool, Offset);
643 /* Verify the arguments. */
644 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
645 gcmkVERIFY_ARGUMENT(Pool != gcvNULL);
646 gcmkVERIFY_ARGUMENT(Offset != gcvNULL);
648 /* Dispatch on memory type. */
649 switch ((((((gctUINT32) (Address)) >> (0 ? 1:0)) & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1)))))) ))
651 case 0x0:
652 /* System memory. */
653 *Pool = gcvPOOL_SYSTEM;
654 break;
656 case 0x2:
657 /* Virtual memory. */
658 *Pool = gcvPOOL_VIRTUAL;
659 break;
661 default:
662 /* Invalid memory type. */
663 return gcvSTATUS_INVALID_ARGUMENT;
666 /* Return offset of address. */
667 *Offset = ((((gctUINT32) (Address)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0))) | (((gctUINT32) ((gctUINT32) (0) & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0)));
669 gcmkFOOTER_NO();
670 /* Success. */
671 return gcvSTATUS_OK;
674 /*******************************************************************************
676 ** gckVGHARDWARE_Execute
678 ** Kickstart the hardware's command processor with an initialized command
679 ** buffer.
681 ** INPUT:
683 ** gckVGHARDWARE Hardware
684 ** Pointer to the gckVGHARDWARE object.
686 ** gctUINT32 Address
687 ** Address of the command buffer.
689 ** gctSIZE_T Count
690 ** Number of command-sized data units to be executed.
692 ** OUTPUT:
694 ** Nothing.
696 gceSTATUS
697 gckVGHARDWARE_Execute(
698 IN gckVGHARDWARE Hardware,
699 IN gctUINT32 Address,
700 IN gctSIZE_T Count
703 gceSTATUS status;
705 gcmkHEADER_ARG("Hardware=0x%x Address=0x%x Count=0x%x",
706 Hardware, Address, Count);
708 /* Verify the arguments. */
709 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
713 /* Enable all events. */
714 gcmkERR_BREAK(gckOS_WriteRegisterEx(
715 Hardware->os,
716 gcvCORE_VG,
717 0x00014,
718 Hardware->eventMask
721 if (Hardware->fe20)
723 /* Write address register. */
724 gcmkERR_BREAK(gckOS_WriteRegisterEx(
725 Hardware->os,
726 gcvCORE_VG,
727 0x00500,
728 gcmFIXADDRESS(Address)
731 /* Write control register. */
732 gcmkERR_BREAK(gckOS_WriteRegisterEx(
733 Hardware->os,
734 gcvCORE_VG,
735 0x00504,
736 Count
739 else
741 /* Write address register. */
742 gcmkERR_BREAK(gckOS_WriteRegisterEx(
743 Hardware->os,
744 gcvCORE_VG,
745 0x00654,
746 gcmFIXADDRESS(Address)
749 /* Write control register. */
750 gcmkERR_BREAK(gckOS_WriteRegisterEx(
751 Hardware->os,
752 gcvCORE_VG,
753 0x00658,
754 ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 16:16) - (0 ? 16:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 16:16) - (0 ? 16:16) + 1))))))) << (0 ? 16:16))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 16:16) - (0 ? 16:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 16:16) - (0 ? 16:16) + 1))))))) << (0 ? 16:16))) |
755 ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (Count) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)))
759 /* Success. */
760 return gcvSTATUS_OK;
762 while (gcvFALSE);
765 gcmkFOOTER();
766 /* Return the status. */
767 return status;
770 /*******************************************************************************
772 ** gckVGHARDWARE_AlignToTile
774 ** Align the specified width and height to tile boundaries.
776 ** INPUT:
778 ** gckVGHARDWARE Hardware
779 ** Pointer to an gckVGHARDWARE object.
781 ** gceSURF_TYPE Type
782 ** Type of alignment.
784 ** gctUINT32 * Width
785 ** Pointer to the width to be aligned. If 'Width' is gcvNULL, no width
786 ** will be aligned.
788 ** gctUINT32 * Height
789 ** Pointer to the height to be aligned. If 'Height' is gcvNULL, no height
790 ** will be aligned.
792 ** OUTPUT:
794 ** gctUINT32 * Width
795 ** Pointer to a variable that will receive the aligned width.
797 ** gctUINT32 * Height
798 ** Pointer to a variable that will receive the aligned height.
800 gceSTATUS
801 gckVGHARDWARE_AlignToTile(
802 IN gckVGHARDWARE Hardware,
803 IN gceSURF_TYPE Type,
804 IN OUT gctUINT32 * Width,
805 IN OUT gctUINT32 * Height
808 gcmkHEADER_ARG("Hardware=0x%x Type=0x%x Width=0x%x Height=0x%x",
809 Hardware, Type, Width, Height);
810 /* Verify the arguments. */
811 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
813 if (Width != gcvNULL)
815 /* Align the width. */
816 *Width = gcmALIGN(*Width, (Type == gcvSURF_TEXTURE) ? 4 : 16);
819 if (Height != gcvNULL)
821 /* Special case for VG images. */
822 if ((*Height == 0) && (Type == gcvSURF_IMAGE))
824 *Height = 4;
826 else
828 /* Align the height. */
829 *Height = gcmALIGN(*Height, 4);
833 gcmkFOOTER_NO();
834 /* Success. */
835 return gcvSTATUS_OK;
838 /*******************************************************************************
840 ** gckVGHARDWARE_ConvertLogical
842 ** Convert a logical system address into a hardware specific address.
844 ** INPUT:
846 ** gckVGHARDWARE Hardware
847 ** Pointer to an gckVGHARDWARE object.
849 ** gctPOINTER Logical
850 ** Logical address to convert.
852 ** gctUINT32* Address
853 ** Return hardware specific address.
855 ** OUTPUT:
857 ** Nothing.
859 gceSTATUS
860 gckVGHARDWARE_ConvertLogical(
861 IN gckVGHARDWARE Hardware,
862 IN gctPOINTER Logical,
863 OUT gctUINT32 * Address
866 gctUINT32 address;
867 gceSTATUS status;
869 gcmkHEADER_ARG("Hardware=0x%x Logical=0x%x Address=0x%x",
870 Hardware, Logical, Address);
872 /* Verify the arguments. */
873 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
874 gcmkVERIFY_ARGUMENT(Logical != gcvNULL);
875 gcmkVERIFY_ARGUMENT(Address != gcvNULL);
879 /* Convert logical address into a physical address. */
880 gcmkERR_BREAK(gckOS_GetPhysicalAddress(
881 Hardware->os, Logical, &address
884 /* Return hardware specific address. */
885 *Address = ((((gctUINT32) (address)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0))) | (((gctUINT32) (0x0 & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0)));
887 /* Success. */
888 return gcvSTATUS_OK;
890 while (gcvFALSE);
892 gcmkFOOTER();
893 /* Return the status. */
894 return status;
897 /*******************************************************************************
899 ** gckVGHARDWARE_QuerySystemMemory
901 ** Query the command buffer alignment and number of reserved bytes.
903 ** INPUT:
905 ** gckVGHARDWARE Harwdare
906 ** Pointer to an gckVGHARDWARE object.
908 ** OUTPUT:
910 ** gctSIZE_T * SystemSize
911 ** Pointer to a variable that receives the maximum size of the system
912 ** memory.
914 ** gctUINT32 * SystemBaseAddress
915 ** Poinetr to a variable that receives the base address for system
916 ** memory.
918 gceSTATUS gckVGHARDWARE_QuerySystemMemory(
919 IN gckVGHARDWARE Hardware,
920 OUT gctSIZE_T * SystemSize,
921 OUT gctUINT32 * SystemBaseAddress
924 gcmkHEADER_ARG("Hardware=0x%x SystemSize=0x%x SystemBaseAddress=0x%x",
925 Hardware, SystemSize, SystemBaseAddress);
927 /* Verify the arguments. */
928 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
930 if (SystemSize != gcvNULL)
932 /* Maximum system memory can be 2GB. */
933 *SystemSize = (gctSIZE_T)(1 << 31);
936 if (SystemBaseAddress != gcvNULL)
938 /* Set system memory base address. */
939 *SystemBaseAddress = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0))) | (((gctUINT32) (0x0 & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0)));
942 gcmkFOOTER_NO();
943 /* Success. */
944 return gcvSTATUS_OK;
947 /*******************************************************************************
949 ** gckVGHARDWARE_SetMMU
951 ** Set the page table base address.
953 ** INPUT:
955 ** gckVGHARDWARE Harwdare
956 ** Pointer to an gckVGHARDWARE object.
958 ** gctPOINTER Logical
959 ** Logical address of the page table.
961 ** OUTPUT:
963 ** Nothing.
965 gceSTATUS gckVGHARDWARE_SetMMU(
966 IN gckVGHARDWARE Hardware,
967 IN gctPOINTER Logical
970 gceSTATUS status;
971 gctUINT32 address = 0;
973 gcmkHEADER_ARG("Hardware=0x%x Logical=0x%x",
974 Hardware, Logical);
976 /* Verify the arguments. */
977 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
978 gcmkVERIFY_ARGUMENT(Logical != gcvNULL);
982 /* Convert the logical address into an hardware address. */
983 gcmkERR_BREAK(gckVGHARDWARE_ConvertLogical(Hardware, Logical, &address) );
985 /* Write the AQMemoryFePageTable register. */
986 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
987 0x00400,
988 gcmFIXADDRESS(address)) );
990 /* Write the AQMemoryTxPageTable register. */
991 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
992 0x00404,
993 gcmFIXADDRESS(address)) );
995 /* Write the AQMemoryPePageTable register. */
996 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
997 0x00408,
998 gcmFIXADDRESS(address)) );
1000 /* Write the AQMemoryPezPageTable register. */
1001 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
1002 0x0040C,
1003 gcmFIXADDRESS(address)) );
1005 /* Write the AQMemoryRaPageTable register. */
1006 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
1007 0x00410,
1008 gcmFIXADDRESS(address)) );
1010 while (gcvFALSE);
1012 gcmkFOOTER();
1013 /* Return the status. */
1014 return status;
1017 /*******************************************************************************
1019 ** gckVGHARDWARE_FlushMMU
1021 ** Flush the page table.
1023 ** INPUT:
1025 ** gckVGHARDWARE Harwdare
1026 ** Pointer to an gckVGHARDWARE object.
1028 ** OUTPUT:
1030 ** Nothing.
1032 gceSTATUS gckVGHARDWARE_FlushMMU(
1033 IN gckVGHARDWARE Hardware
1036 gceSTATUS status;
1037 gckVGCOMMAND command;
1039 gcmkHEADER_ARG("Hardware=0x%x ", Hardware);
1040 /* Verify the arguments. */
1041 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
1045 gcsCMDBUFFER_PTR commandBuffer;
1046 gctUINT32_PTR buffer;
1048 /* Create a shortcut to the command buffer object. */
1049 command = Hardware->kernel->command;
1051 /* Allocate command buffer space. */
1052 gcmkERR_BREAK(gckVGCOMMAND_Allocate(
1053 Hardware->kernel->command, 8, &commandBuffer, (gctPOINTER *) &buffer
1056 buffer[0]
1057 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x01 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
1058 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (0x0E04) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)))
1059 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16)));
1061 buffer[1]
1062 = ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1))))))) << (0 ? 0:0))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1))))))) << (0 ? 0:0)))
1063 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:1) - (0 ? 1:1) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:1) - (0 ? 1:1) + 1))))))) << (0 ? 1:1))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 1:1) - (0 ? 1:1) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:1) - (0 ? 1:1) + 1))))))) << (0 ? 1:1)))
1064 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 2:2) - (0 ? 2:2) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 2:2) - (0 ? 2:2) + 1))))))) << (0 ? 2:2))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 2:2) - (0 ? 2:2) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 2:2) - (0 ? 2:2) + 1))))))) << (0 ? 2:2)))
1065 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 3:3) - (0 ? 3:3) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 3:3) - (0 ? 3:3) + 1))))))) << (0 ? 3:3))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 3:3) - (0 ? 3:3) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 3:3) - (0 ? 3:3) + 1))))))) << (0 ? 3:3)))
1066 | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 4:4) - (0 ? 4:4) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 ? 4:4) + 1))))))) << (0 ? 4:4))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((1 ? 4:4) - (0 ? 4:4) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 ? 4:4) + 1))))))) << (0 ? 4:4)));
1068 gcmkERR_BREAK(gckVGCOMMAND_Execute(
1069 Hardware->kernel->command,
1070 commandBuffer
1073 while(gcvFALSE);
1074 gcmkFOOTER();
1075 /* Return the status. */
1076 return status;
1079 /*******************************************************************************
1081 ** gckVGHARDWARE_BuildVirtualAddress
1083 ** Build a virtual address.
1085 ** INPUT:
1087 ** gckVGHARDWARE Harwdare
1088 ** Pointer to an gckVGHARDWARE object.
1090 ** gctUINT32 Index
1091 ** Index into page table.
1093 ** gctUINT32 Offset
1094 ** Offset into page.
1096 ** OUTPUT:
1098 ** gctUINT32 * Address
1099 ** Pointer to a variable receiving te hardware address.
1101 gceSTATUS gckVGHARDWARE_BuildVirtualAddress(
1102 IN gckVGHARDWARE Hardware,
1103 IN gctUINT32 Index,
1104 IN gctUINT32 Offset,
1105 OUT gctUINT32 * Address
1108 gctUINT32 address;
1110 gcmkHEADER_ARG("Hardware=0x%x Index=0x%x Offset=0x%x Address=0x%x",
1111 Hardware, Index, Offset, Address);
1113 /* Verify the arguments. */
1114 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
1115 gcmkVERIFY_ARGUMENT(Address != gcvNULL);
1117 /* Build virtual address. */
1118 address = (Index << 12) | Offset;
1120 /* Set virtual type. */
1121 address = ((((gctUINT32) (address)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0))) | (((gctUINT32) (0x2 & ((gctUINT32) ((((1 ? 1:0) - (0 ? 1:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 1:0) - (0 ? 1:0) + 1))))))) << (0 ? 1:0)));
1123 /* Set the result. */
1124 *Address = address;
1126 gcmkFOOTER_NO();
1127 /* Success. */
1128 return gcvSTATUS_OK;
1131 gceSTATUS
1132 gckVGHARDWARE_GetIdle(
1133 IN gckVGHARDWARE Hardware,
1134 OUT gctUINT32 * Data
1137 gceSTATUS status;
1138 gcmkHEADER_ARG("Hardware=0x%x Data=0x%x", Hardware, Data);
1139 /* Verify the arguments. */
1140 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
1141 gcmkVERIFY_ARGUMENT(Data != gcvNULL);
1143 /* Read register and return. */
1144 status = gckOS_ReadRegisterEx(Hardware->os, gcvCORE_VG, 0x00004, Data);
1145 gcmkFOOTER();
1146 return status;
1149 gceSTATUS
1150 gckVGHARDWARE_SetFastClear(
1151 IN gckVGHARDWARE Hardware,
1152 IN gctINT Enable
1155 gctUINT32 debug;
1156 gceSTATUS status;
1158 if (!(((((gctUINT32) (Hardware->chipFeatures)) >> (0 ? 0:0)) & ((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 0:0) - (0 ? 0:0) + 1)))))) ))
1160 return gcvSTATUS_OK;
1165 if (Enable == -1)
1167 Enable = (Hardware->chipModel > gcv500) ||
1168 ((Hardware->chipModel == gcv500) && (Hardware->chipRevision >= 3));
1171 gcmkERR_BREAK(gckOS_ReadRegisterEx(Hardware->os, gcvCORE_VG,
1172 0x00414,
1173 &debug));
1175 debug = ((((gctUINT32) (debug)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 20:20) - (0 ? 20:20) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:20) - (0 ? 20:20) + 1))))))) << (0 ? 20:20))) | (((gctUINT32) ((gctUINT32) (Enable == 0) & ((gctUINT32) ((((1 ? 20:20) - (0 ? 20:20) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 20:20) - (0 ? 20:20) + 1))))))) << (0 ? 20:20)));
1177 #ifdef AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION
1178 debug = ((((gctUINT32) (debug)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) - (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) + 1) == 32) ? ~0 : (~(~0 << ((1 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) - (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) + 1))))))) << (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION))) | (((gctUINT32) ((gctUINT32) (Enable == 0) & ((gctUINT32) ((((1 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) - (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) + 1) == 32) ? ~0 : (~(~0 << ((1 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) - (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION) + 1))))))) << (0 ? AQ_MEMORY_DEBUG_DISABLE_Z_COMPRESSION)));
1179 #endif
1181 gcmkERR_BREAK(gckOS_WriteRegisterEx(Hardware->os, gcvCORE_VG,
1182 0x00414,
1183 debug));
1185 Hardware->allowFastClear = Enable;
1187 status = gcvFALSE;
1189 while (gcvFALSE);
1191 return status;
1194 gceSTATUS
1195 gckVGHARDWARE_ReadInterrupt(
1196 IN gckVGHARDWARE Hardware,
1197 OUT gctUINT32_PTR IDs
1200 gceSTATUS status;
1201 gcmkHEADER_ARG("Hardware=0x%x IDs=0x%x", Hardware, IDs);
1203 /* Verify the arguments. */
1204 gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE);
1205 gcmkVERIFY_ARGUMENT(IDs != gcvNULL);
1207 /* Read AQIntrAcknowledge register. */
1208 status = gckOS_ReadRegisterEx(Hardware->os, gcvCORE_VG,
1209 0x00010,
1210 IDs);
1211 gcmkFOOTER();
1212 return status;
1215 #endif /* gcdENABLE_VG */