bugfix: method offset in transfer_inline
[ps3freebsd_ps3gpu_test.git] / reset_gpu_state.c
blob123efbc2507ec9668d42ba1c8b542ae9eb77b748
1 /*-
2 * Copyright (C) 2011, 2012 glevand <geoffrey.levand@mail.ru>
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer,
10 * without modification, immediately at the beginning of the file.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * $FreeBSD$
29 #include <stdint.h>
31 uint32_t reset_gpu_state_3d[] = {
32 /* These commands are executed every time after flip to reset GPU state !!! */
34 /* program 1 */
36 0x00040000,
37 0x31337000,
39 0x003c0180,
40 0x66604200,
41 0xfeed0000,
42 0xfeed0001,
43 0xfeed0000,
44 0x00000000,
45 0xfeed0000,
46 0xfeed0000,
47 0xfeed0000,
48 0xfeed0001,
49 0x66606660,
50 0x66626660,
51 0x00000000,
52 0x00000000,
53 0xfeed0000,
54 0xfeed0000,
56 0x00040060,
57 0x66616661,
59 0x00340200,
60 0x00000000,
61 0x00000000,
62 0x00000121,
63 0x00000040,
64 0x00000000,
65 0x00000000,
66 0x00000000,
67 0x00000040,
68 0x00000001,
69 0x00000080,
70 0x00000100,
71 0x00000040,
72 0x00000000,
74 0x00100280,
75 0x00000040,
76 0x00000040,
77 0x00000000,
78 0x00000000,
80 0x00041d80,
81 0x00000003,
83 0x004802b8,
84 0x00000000,
85 0x00000000,
86 0x0fff0000,
87 0x0fff0000,
88 0x0fff0000,
89 0x0fff0000,
90 0x0fff0000,
91 0x0fff0000,
92 0x0fff0000,
93 0x0fff0000,
94 0x0fff0000,
95 0x0fff0000,
96 0x0fff0000,
97 0x0fff0000,
98 0x0fff0000,
99 0x0fff0000,
100 0x0fff0000,
101 0x0fff0000,
103 0x00081d98,
104 0x0fff0000,
105 0x0fff0000,
107 0x00041da4,
108 0x00000000,
110 0x000403b0,
111 0x00100000,
113 0x00041454,
114 0x00000000,
116 0x00041ff4,
117 0x003fffff,
119 0x00181fc0,
120 0x00000000,
121 0x06144321,
122 0xedcba987,
123 0x0000006f,
124 0x00171615,
125 0x001b1a19,
127 0x00280b40,
128 0x00000000,
129 0x00000000,
130 0x00000000,
131 0x00000000,
132 0x00000000,
133 0x00000000,
134 0x00000000,
135 0x00000000,
136 0x00000000,
137 0x00000000,
139 0x00040a0c,
140 0x00000000,
142 0x000c0a60,
143 0x00000000,
144 0x00000000,
145 0x00000000,
147 0x00080a78,
148 0x00000000,
149 0x00000000,
151 0x00041428,
152 0x00000001,
154 0x00041d88,
155 0x00001000,
157 0x00041e94,
158 0x00000011,
160 0x00041450,
161 0x00080003,
163 0x00041d64,
164 0x02000000,
166 0x0004145c,
167 0x00000001,
169 0x00041fe0,
170 0x00000001,
172 0x00400b00,
173 0x00002dc8,
174 0x00002dc8,
175 0x00002dc8,
176 0x00002dc8,
177 0x00002dc8,
178 0x00002dc8,
179 0x00002dc8,
180 0x00002dc8,
181 0x00002dc8,
182 0x00002dc8,
183 0x00002dc8,
184 0x00002dc8,
185 0x00002dc8,
186 0x00002dc8,
187 0x00002dc8,
188 0x00002dc8,
190 0x001008cc,
191 0x00000800,
192 0x00000000,
193 0x00000000,
194 0x00000000,
196 0x00100240,
197 0x0000ffff,
198 0x00000000,
199 0x00000000,
200 0x00000000,
202 0x00c003c0,
203 0x00010101,
204 0x00010101,
205 0x00010101,
206 0x00010101,
207 0x00010101,
208 0x00010101,
209 0x00010101,
210 0x00010101,
211 0x00010101,
212 0x00010101,
213 0x00010101,
214 0x00010101,
215 0x00010101,
216 0x00010101,
217 0x00010101,
218 0x00010101,
219 0x00007421,
220 0x00007421,
221 0x00007421,
222 0x00007421,
223 0x00007421,
224 0x00007421,
225 0x00007421,
226 0x00007421,
227 0x00007421,
228 0x00007421,
229 0x00007421,
230 0x00007421,
231 0x00007421,
232 0x00007421,
233 0x00007421,
234 0x00007421,
235 0x9aabaa98,
236 0x66666789,
237 0x98766666,
238 0x89aabaa9,
239 0x99999999,
240 0x88888889,
241 0x98888888,
242 0x99999999,
243 0x56676654,
244 0x33333345,
245 0x54333333,
246 0x45667665,
247 0xaabbba99,
248 0x66667899,
249 0x99876666,
250 0x99abbbaa,
252 0x00081738,
253 0x00000000,
254 0x00000000,
256 0x0004e000,
257 0xcafebabe,
259 /* program 2 */
261 0x00080308,
262 0x00000207,
263 0x00000000,
265 0x00040304,
266 0x00000000,
268 0x000c0350,
269 0x00000207,
270 0x00000000,
271 0x000000ff,
273 0x0004034c,
274 0x000000ff,
276 0x000c035c,
277 0x00001e00,
278 0x00001e00,
279 0x00001e00,
281 0x0004031c,
282 0x00000000,
284 0x0004037c,
285 0x00000000,
287 0x00040310, /* blend control */
288 0x00000000, /* disable */
290 0x0004036c,
291 0x00000000,
293 0x00040320,
294 0x80068006,
296 0x00080314,
297 0x00010001,
298 0x00000000,
300 0x00041d8c,
301 0xffffff00,
303 0x00041d94,
304 0x00000000,
306 0x00040100,
307 0x00000000,
309 0x00040324,
310 0x01010101,
312 0x0004183c,
313 0x00000000,
315 0x00041830,
316 0x00000405,
318 0x00080384,
319 0x00000000,
320 0x3f800000,
322 0x00040380,
323 0x00000000,
325 0x00040a6c,
326 0x00000201,
328 0x00040a70,
329 0x00000001,
331 0x00040a74,
332 0x00000000,
334 0x00040300,
335 0x00000001,
337 0x00041fec,
338 0x00000000,
340 0x00041fc0,
341 0x00000000,
343 0x00041834, /* set front face mode */
344 0x00000901, /* ccw */
346 0x000403b8,
347 0x00000008,
349 0x00040374, /* logic op control */
350 0x00000000, /* disable */
352 0x00040378, /* set logic op */
353 0x00001503, /* copy */
355 0x00041ee0,
356 0x3f800000,
358 0x00040a68,
359 0x00000000,
361 0x00080a78,
362 0x00000000,
363 0x00000000,
365 0x00041dac,
366 0x00000000,
368 0x00041db0,
369 0xffffffff,
371 0x000808c0,
372 0x10000000,
373 0x10000000,
375 0x00040368, /* set shade model */
376 0x00001d01, /* smooth */
378 0x000c0330,
379 0x00000207,
380 0x00000000,
381 0x000000ff,
383 0x0004032c,
384 0x000000ff,
386 0x000c033c,
387 0x00001e00,
388 0x00001e00,
389 0x00001e00,
391 0x00040328,
392 0x00000000,
394 0x00041a08,
395 0x00030101,
397 0x00041a1c,
398 0x00000000,
400 0x00041a0c,
401 0x00060000,
403 0x00041a14,
404 0x02052000,
406 0x00041a28,
407 0x00030101,
409 0x00041a3c,
410 0x00000000,
412 0x00041a2c,
413 0x00060000,
415 0x00041a34,
416 0x02052000,
418 0x00041a48,
419 0x00030101,
421 0x00041a5c,
422 0x00000000,
424 0x00041a4c,
425 0x00060000,
427 0x00041a54,
428 0x02052000,
430 0x00041a68,
431 0x00030101,
433 0x00041a7c,
434 0x00000000,
436 0x00041a6c,
437 0x00060000,
439 0x00041a74,
440 0x02052000,
442 0x00041a88,
443 0x00030101,
445 0x00041a9c,
446 0x00000000,
448 0x00041a8c,
449 0x00060000,
451 0x00041a94,
452 0x02052000,
454 0x00041aa8,
455 0x00030101,
457 0x00041abc,
458 0x00000000,
460 0x00041aac,
461 0x00060000,
463 0x00041ab4,
464 0x02052000,
466 0x00041ac8,
467 0x00030101,
469 0x00041adc,
470 0x00000000,
472 0x00041acc,
473 0x00060000,
475 0x00041ad4,
476 0x02052000,
478 0x00041ae8,
479 0x00030101,
481 0x00041afc,
482 0x00000000,
484 0x00041aec,
485 0x00060000,
487 0x00041af4,
488 0x02052000,
490 0x00041b08,
491 0x00030101,
493 0x00041b1c,
494 0x00000000,
496 0x00041b0c,
497 0x00060000,
499 0x00041b14,
500 0x02052000,
502 0x00041b28,
503 0x00030101,
505 0x00041b3c,
506 0x00000000,
508 0x00041b2c,
509 0x00060000,
511 0x00041b34,
512 0x02052000,
514 0x00041b48,
515 0x00030101,
517 0x00041b5c,
518 0x00000000,
520 0x00041b4c,
521 0x00060000,
523 0x00041b54,
524 0x02052000,
526 0x00041b68,
527 0x00030101,
529 0x00041b7c,
530 0x00000000,
532 0x00041b6c,
533 0x00060000,
535 0x00041b74,
536 0x02052000,
538 0x00041b88,
539 0x00030101,
541 0x00041b9c,
542 0x00000000,
544 0x00041b8c,
545 0x00060000,
547 0x00041b94,
548 0x02052000,
550 0x00041ba8,
551 0x00030101,
553 0x00041bbc,
554 0x00000000,
556 0x00041bac,
557 0x00060000,
559 0x00041bb4,
560 0x02052000,
562 0x00041bc8,
563 0x00030101,
565 0x00041bdc,
566 0x00000000,
568 0x00041bcc,
569 0x00060000,
571 0x00041bd4,
572 0x02052000,
574 0x00041be8,
575 0x00030101,
577 0x00041bfc,
578 0x00000000,
580 0x00041bec,
581 0x00060000,
583 0x00041bf4,
584 0x02052000,
586 0x00040348,
587 0x00000000,
589 0x00041740,
590 0x00000002,
592 0x00041680,
593 0x00000000,
595 0x00041744,
596 0x00000002,
598 0x00041684,
599 0x00000000,
601 0x00041748,
602 0x00000002,
604 0x00041688,
605 0x00000000,
607 0x0004174c,
608 0x00000002,
610 0x0004168c,
611 0x00000000,
613 0x00041750,
614 0x00000002,
616 0x00041690,
617 0x00000000,
619 0x00041754,
620 0x00000002,
622 0x00041694,
623 0x00000000,
625 0x00041758,
626 0x00000002,
628 0x00041698,
629 0x00000000,
631 0x0004175c,
632 0x00000002,
634 0x0004169c,
635 0x00000000,
637 0x00041760,
638 0x00000002,
640 0x000416a0,
641 0x00000000,
643 0x00041764,
644 0x00000002,
646 0x000416a4,
647 0x00000000,
649 0x00041768,
650 0x00000002,
652 0x000416a8,
653 0x00000000,
655 0x0004176c,
656 0x00000002,
658 0x000416ac,
659 0x00000000,
661 0x00041770,
662 0x00000002,
664 0x000416b0,
665 0x00000000,
667 0x00041774,
668 0x00000002,
670 0x000416b4,
671 0x00000000,
673 0x00041778,
674 0x00000002,
676 0x000416b8,
677 0x00000000,
679 0x0004177c,
680 0x00000002,
682 0x000416bc,
683 0x00000000,
685 0x00080a00,
686 0x10000000,
687 0x10000000,
688 0x00080394,
689 0x00000000,
690 0x3f800000,
692 0x00200a20,
693 0x45000000,
694 0x45000000,
695 0x3f000000,
696 0x00000000,
697 0x45000000,
698 0x45000000,
699 0x3f000000,
700 0x00000000,
702 0x00200a20,
703 0x45000000,
704 0x45000000,
705 0x3f000000,
706 0x00000000,
707 0x45000000,
708 0x45000000,
709 0x3f000000,
710 0x00000000,
712 0x00041d7c,
713 0xffff0000,
715 0x0004182c,
716 0x00001b02,
718 0x00041d90,
719 0x00000000,
721 0x00040370,
722 0x00000000,
724 0x00041828,
725 0x00001b02,
727 0x000403bc,
728 0x00000000,
730 0x00041db4,
731 0x00000000,
733 0x00041ee4,
734 0x00000000,
736 0x00041ee8,
737 0x00000000,
739 0x00041838,
740 0x00000000,
742 0x0004147c,
743 0x00000000,
745 0x00041e98,
746 0x01000000,
748 0x00041478,
749 0x00000000,
751 0x00041ff0,
752 0x0000ffff,
754 0x000417cc,
755 0x00000000,
757 0x00040908,
758 0x00000101,
760 0x0004091c,
761 0x00000000,
763 0x0004090c,
764 0x00060000,
766 0x00040914,
767 0x00000000,
769 0x00040928,
770 0x00000101,
772 0x0004093c,
773 0x00000000,
775 0x0004092c,
776 0x00060000,
778 0x00040934,
779 0x00000000,
781 0x00040948,
782 0x00000101,
784 0x0004095c,
785 0x00000000,
787 0x0004094c,
788 0x00060000,
790 0x00040954,
791 0x00000000,
793 0x00040968,
794 0x00000101,
796 0x0004097c,
797 0x00000000,
799 0x0004096c,
800 0x00060000,
802 0x00040974,
803 0x00000000,
805 0x00040238,
806 0x00000000,
808 0x00041d78,
809 0x00000001,
811 0x0004142c,
812 0x00000000,
814 0x00041ff8,
815 0x00000000,
817 0x00041fe8,
818 0x00000000,
820 /* program 3 */
822 0x00042000,
823 0x31337303,
825 0x000c2180,
826 0x66604200,
827 0xfeed0001,
828 0xfeed0000,
830 0x00046000,
831 0x313371c3,
834 0x000c6180,
835 0x66604200,
836 0xfeed0000,
837 0xfeed0000,
840 0x0004a000,
841 0x31337808,
843 0x0020a180,
844 0x66604200,
845 0x00000000,
846 0x00000000,
847 0x00000000,
848 0x00000000,
849 0x00000000,
850 0x00000000,
851 0x313371c3,
853 0x0008a2fc,
854 0x00000003,
855 0x00000004,
857 0x00048000,
858 0x31337a73,
860 0x00088180,
861 0x66604200,
862 0xfeed0000,
864 0x0004c000,
865 0x3137af00,
867 0x0004c180,
868 0x66604200,
870 0x00020000, /* return */
873 int reset_gpu_state_3d_size = sizeof(reset_gpu_state_3d);