summaryrefslogtreecommitdiffstats
path: root/vidix/pm3_regs.h
blob: 0ace0cbd30f4b10c80afff94d4c77f1d2dddf59b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.9 2001/11/20 00:09:15 alanh Exp $ */

/*
 * glint register file 
 *
 * Copyright by Sven Luther
 * Authors: Sven Luther, <luther@dpt-info.u-strasbg.fr>
 *          Thomas Witzel, <twitzel@nmr.mgh.harvard.edu>
 *
 * this work is sponsored by Appian Graphics.
 *
 */ 

#ifndef PM3_REGS_H
#define PM3_REGS_H

/**********************************************
*  GLINT Permedia3 Control Status registers   *
***********************************************/
/* Control Status Registers */
#define PM3ResetStatus						0x0000
#define PM3IntEnable						0x0008
#define PM3IntFlags						0x0010
#define PM3InFIFOSpace						0x0018
#define PM3OutFIFOWords						0x0020
#define PM3DMAAddress						0x0028
#define PM3DMACount						0x0030
#define PM3ErrorFlags						0x0038
#define PM3VClkCtl						0x0040
#define PM3TestRegister						0x0048
#define PM3Aperture0						0x0050
#define PM3Aperture1						0x0058
#define PM3DMAControl						0x0060
#define PM3FIFODis						0x0068
#define PM3ChipConfig						0x0070
#define PM3AGPControl						0x0078

#define PM3GPOutDMAAddress					0x0080
#define PM3PCIFeedbackCount					0x0088
#define PM3PCIAbortStatus					0x0090
#define PM3PCIAbortAddress					0x0098

#define PM3PCIPLLStatus						0x00f0

#define PM3HostTextureAddress					0x0100
#define PM3TextureDownloadControl				0x0108
#define PM3TextureOperation					0x0110
#define PM3LogicalTexturePage					0x0118
#define PM3TexDMAAddress					0x0120
#define PM3TexFIFOSpace						0x0128

/**********************************************
*  GLINT Permedia3 Region 0 Bypass Controls   *
***********************************************/
#define PM3ByAperture1Mode					0x0300
	#define PM3ByApertureMode_BYTESWAP_ABCD			(0<<0)
	#define PM3ByApertureMode_BYTESWAP_BADC			(1<<0)
	#define PM3ByApertureMode_BYTESWAP_CDAB			(2<<0)
	#define PM3ByApertureMode_BYTESWAP_DCBA			(3<<0)
	#define PM3ByApertureMode_PATCH_DISABLE			(0<<2)
	#define PM3ByApertureMode_PATCH_ENABLE			(1<<2)
	#define PM3ByApertureMode_FORMAT_RAW			(0<<3)
	#define PM3ByApertureMode_FORMAT_YUYV			(1<<3)
	#define PM3ByApertureMode_FORMAT_UYVY			(2<<3)
	#define PM3ByApertureMode_PIXELSIZE_8BIT		(0<<5)
	#define PM3ByApertureMode_PIXELSIZE_16BIT		(1<<5)
	#define PM3ByApertureMode_PIXELSIZE_32BIT		(2<<5)
	#define PM3ByApertureMode_EFFECTIVE_STRIDE_1024		(0<<7)
	#define PM3ByApertureMode_EFFECTIVE_STRIDE_2048		(1<<7)
	#define PM3ByApertureMode_EFFECTIVE_STRIDE_4096		(2<<7)
	#define PM3ByApertureMode_EFFECTIVE_STRIDE_8192		(3<<7)
	#define PM3ByApertureMode_PATCH_OFFSET_X(off)	(((off)&7f)<<9)
	#define PM3ByApertureMode_PATCH_OFFSET_Y(off)	(((off)&7f)<<16)
	#define PM3ByApertureMode_FRAMEBUFFER			(0<<21)
	#define PM3ByApertureMode_LOCALBUFFER			(1<<21)
	#define PM3ByApertureMode_DOUBLE_WRITE_OFF		(0<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_1MB		(1<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_2MB		(2<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_4MB		(3<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_8MB		(4<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_16MB		(5<<22)
	#define PM3ByApertureMode_DOUBLE_WRITE_32MB		(6<<22)

#define PM3ByAperture2Mode					0x0328
	
/**********************************************
*  GLINT Permedia3 Memory Control (0x1000)    *
***********************************************/
#define PM3MemCounter						0x1000
#define PM3MemBypassWriteMask					0x1008
#define PM3MemScratch						0x1010
#define PM3LocalMemCaps						0x1018
	#define PM3LocalMemCaps_NoWriteMask			(1<<28)
#define PM3LocalMemTimings					0x1020
#define PM3LocalMemControl					0x1028
#define PM3LocalMemRefresh					0x1030
#define PM3LocalMemPowerDown					0x1038
#define PM3RemoteMemControl					0x1100

/**********************************************
*  GLINT Permedia3 Video Control (0x3000)     *
***********************************************/

#define PM3ScreenBase						0x3000
#define PM3ScreenStride						0x3008
#define PM3HTotal						0x3010
#define PM3HgEnd						0x3018
#define PM3HbEnd						0x3020
#define PM3HsStart						0x3028
#define PM3HsEnd						0x3030
#define PM3VTotal						0x3038
#define PM3VbEnd						0x3040
#define PM3VsStart						0x3048
#define PM3VsEnd						0x3050
#define PM3VideoControl						0x3058
	#define PM3VideoControl_DISABLE				(0<<0)
	#define PM3VideoControl_ENABLE				(1<<0)
	#define PM3VideoControl_BLANK_ACTIVE_HIGH		(0<<1)
	#define PM3VideoControl_BLANK_ACTIVE_LOW		(1<<1)
	#define PM3VideoControl_LINE_DOUBLE_OFF			(0<<2)
	#define PM3VideoControl_LINE_DOUBLE_ON			(1<<2)
	#define PM3VideoControl_HSYNC_FORCE_HIGH		(0<<3)
	#define PM3VideoControl_HSYNC_ACTIVE_HIGH		(1<<3)
	#define PM3VideoControl_HSYNC_FORCE_LOW			(2<<3)
	#define PM3VideoControl_HSYNC_ACTIVE_LOW		(3<<3)
	#define PM3VideoControl_VSYNC_FORCE_HIGH		(0<<5)
	#define PM3VideoControl_VSYNC_ACTIVE_HIGH		(1<<5)
	#define PM3VideoControl_VSYNC_FORCE_LOW			(2<<5)
	#define PM3VideoControl_VSYNC_ACTIVE_LOW		(3<<5)
	#define PM3VideoControl_BYTE_DOUBLE_OFF			(0<<7)
	#define PM3VideoControl_BYTE_DOUBLE_ON			(1<<7)
	#define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK	(0<<9)
	#define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING	(1<<9)
	#define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE	(2<<9)
	#define PM3VideoControl_STEREO_DISABLE			(0<<11)
	#define PM3VideoControl_STEREO_ENABLE			(1<<11)
	#define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH		(0<<12)
	#define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW		(1<<12)
	#define PM3VideoControl_VIDEO_EXT_LOW			(0<<14)
	#define PM3VideoControl_VIDEO_EXT_HIGH			(1<<14)
	#define PM3VideoControl_SYNC_MODE_INDEPENDENT		(0<<16)
	#define PM3VideoControl_SYNC_MODE_SYNCTO_VSA		(1<<16)
	#define PM3VideoControl_SYNC_MODE_SYNCTO_VSB		(2<<16)
	#define PM3VideoControl_PATCH_DISABLE			(0<<18)
	#define PM3VideoControl_PATCH_ENABLE			(1<<18)
	#define PM3VideoControl_PIXELSIZE_8BIT			(0<<19)
	#define PM3VideoControl_PIXELSIZE_16BIT			(1<<19)
	#define PM3VideoControl_PIXELSIZE_32BIT			(2<<19)
	#define PM3VideoControl_DISPLAY_DISABLE			(0<<21)
	#define PM3VideoControl_DISPLAY_ENABLE			(1<<21)
	#define PM3VideoControl_PATCH_OFFSET_X(off)	(((off)&0x3f)<<22)
	#define PM3VideoControl_PATCH_OFFSET_Y(off)	(((off)&0x3f)<<28)
#define PM3InterruptLine					0x3060
#define PM3DisplayData						0x3068
#define PM3VerticalLineCount					0x3070
#define PM3FifoControl						0x3078
#define PM3ScreenBaseRight					0x3080
#define PM3MiscControl						0x3088

#define PM3VideoOverlayUpdate					0x3100
	#define PM3VideoOverlayUpdate_DISABLE			(0<<0)
	#define PM3VideoOverlayUpdate_ENABLE			(1<<0)
#define PM3VideoOverlayMode					0x3108
	#define PM3VideoOverlayMode_DISABLE			(0<<0)
	#define PM3VideoOverlayMode_ENABLE			(1<<0)
	#define PM3VideoOverlayMode_BUFFERSYNC_MANUAL		(0<<1)
	#define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA	(1<<1)
	#define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB	(2<<1)
	#define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL	(0<<4)
	#define PM3VideoOverlayMode_FIELDPOLARITY_INVERT	(1<<4)
	#define PM3VideoOverlayMode_PIXELSIZE_8BIT		(0<<5)
	#define PM3VideoOverlayMode_PIXELSIZE_16BIT		(1<<5)
	#define PM3VideoOverlayMode_PIXELSIZE_32BIT		(2<<5)
	#define PM3VideoOverlayMode_COLORFORMAT_RGB8888	((0<<7)|(1<<12)|(2<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_RGB4444	((1<<7)|(1<<12)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_RGB5551	((2<<7)|(1<<12)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_RGB565	((3<<7)|(1<<12)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_RGB332	((4<<7)|(1<<12)|(0<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_BGR8888	((0<<7)|(2<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_BGR4444	((1<<7)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_BGR5551	((2<<7)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_BGR565	((3<<7)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_BGR332	((4<<7)|(0<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_CI8	((5<<7)|(1<<12)|(0<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_VUY444	((2<<10)|(1<<12)|(2<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_YUV444	((2<<10)|(2<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_VUY422	((1<<10)|(1<<12)|(1<<5))
	#define PM3VideoOverlayMode_COLORFORMAT_YUV422	((1<<10)|(1<<5))
	#define PM3VideoOverlayMode_COLORORDER_BGR		(0<<12)
	#define PM3VideoOverlayMode_COLORORDER_RGB		(1<<12)
	#define PM3VideoOverlayMode_LINEARCOLOREXT_OFF		(0<<13)
	#define PM3VideoOverlayMode_LINEARCOLOREXT_ON		(1<<13)
	#define PM3VideoOverlayMode_FILTER_MASK			(3<<14)
	#define PM3VideoOverlayMode_FILTER_OFF			(0<<14)
	#define PM3VideoOverlayMode_FILTER_FULL			(1<<14)
	#define PM3VideoOverlayMode_FILTER_PARTIAL		(2<<14)
	#define PM3VideoOverlayMode_DEINTERLACE_OFF		(0<<16)
	#define PM3VideoOverlayMode_DEINTERLACE_BOB		(1<<16)
	#define PM3VideoOverlayMode_PATCHMODE_OFF		(0<<18)
	#define PM3VideoOverlayMode_PATCHMODE_ON		(1<<18)
	#define PM3VideoOverlayMode_FLIP_VIDEO			(0<<20)
	#define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA		(1<<20)
	#define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB		(2<<20)
	#define PM3VideoOverlayMode_MIRROR_MASK			(3<<23)
	#define PM3VideoOverlayMode_MIRRORX_OFF			(0<<23)
	#define PM3VideoOverlayMode_MIRRORX_ON			(1<<23)
	#define PM3VideoOverlayMode_MIRRORY_OFF			(0<<24)
	#define PM3VideoOverlayMode_MIRRORY_ON			(1<<24)
#define PM3VideoOverlayFifoControl				0x3110
#define PM3VideoOverlayIndex					0x3118
#define PM3VideoOverlayBase					0x3120
#define PM3VideoOverlayBase0					0x3120
#define PM3VideoOverlayBase1					0x3128
#define PM3VideoOverlayBase2					0x3130
#define PM3VideoOverlayStride					0x3138
	#define PM3VideoOverlayStride_STRIDE(s)		(((s)&0xfff)<<0)
#define PM3VideoOverlayWidth					0x3140
	#define PM3VideoOverlayWidth_WIDTH(w)		(((w)&0xfff)<<0)
#define PM3VideoOverlayHeight					0x3148
	#define PM3VideoOverlayHeight_HEIGHT(h)		(((h)&0xfff)<<0)
#define PM3VideoOverlayOrigin					0x3150
	#define PM3VideoOverlayOrigin_XORIGIN(x)	(((x)&0xfff)<<0)
	#define PM3VideoOverlayOrigin_YORIGIN(y)	(((y)&0xfff)<<16)
#define PM3VideoOverlayShrinkXDelta				0x3158
	#define PM3VideoOverlayShrinkXDelta_NONE		(1<<16)
	#define PM3VideoOverlayShrinkXDelta_DELTA(s,d)		\
		((((s)<<16)/(d))&0x0ffffff0)
#define PM3VideoOverlayZoomXDelta				0x3160
	#define PM3VideoOverlayZoomXDelta_NONE			(1<<16)
	#define PM3VideoOverlayZoomXDelta_DELTA(s,d)		\
		((((s)<<16)/(d))&0x0001fff0)
#define PM3VideoOverlayYDelta					0x3168
	#define PM3VideoOverlayYDelta_NONE			(1<<16)
	#define PM3VideoOverlayYDelta_DELTA(s,d)			\
		((((s)<<16)/(d))&0x0ffffff0)
#define PM3VideoOverlayFieldOffset				0x3170
#define PM3VideoOverlayStatus					0x3178

/**********************************************
*  GLINT Permedia3 RAMDAC Registers (0x4000)  *
***********************************************/
/* Direct Registers */
#define PM3RD_PaletteWriteAddress				0x4000
#define PM3RD_PaletteData					0x4008
#define PM3RD_PixelMask						0x4010
#define PM3RD_PaletteReadAddress				0x4018

#define PM3RD_IndexLow						0x4020
#define PM3RD_IndexHigh						0x4028
#define PM3RD_IndexedData					0x4030
#define PM3RD_IndexControl					0x4038
	#define PM3RD_IndexControl_AUTOINCREMENT_ENABLE		(1<<0)
	#define PM3RD_IndexControl_AUTOINCREMENT_DISABLE	(0<<0)

/* Indirect Registers */
#define PM3RD_MiscControl					0x000
	#define PM3RD_MiscControl_HIGHCOLOR_RES_DISABLE		(0<<0)
	#define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE		(1<<0)
	#define PM3RD_MiscControl_PIXELDOUBLE_DISABLE		(0<<1)
	#define PM3RD_MiscControl_PIXELDOUBLE_ENABLE		(1<<1)
	#define PM3RD_MiscControl_LASTREAD_ADDR_DISABLE		(0<<2)
	#define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE		(1<<2)
	#define PM3RD_MiscControl_DIRECTCOLOR_DISABLE		(0<<3)
	#define PM3RD_MiscControl_DIRECTCOLOR_ENABLE		(1<<3)
	#define PM3RD_MiscControl_OVERLAY_DISABLE		(0<<4)
	#define PM3RD_MiscControl_OVERLAY_ENABLE		(1<<4)
	#define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_DISABLE	(0<<5)
	#define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE	(1<<5)
	#define PM3RD_MiscControl_VSB_OUTPUT_DISABLE		(0<<6)
	#define PM3RD_MiscControl_VSB_OUTPUT_ENABLE		(1<<6)
	#define PM3RD_MiscControl_STEREODOUBLE_BUFFER_DISABLE	(0<<7)
	#define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE	(1<<7)
#define PM3RD_SyncControl					0x001
	#define PM3RD_SyncControl_HSYNC_ACTIVE_LOW		(0<<0)
	#define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH		(1<<0)
	#define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE		(3<<0)
	#define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE		(4<<0)
	#define PM3RD_SyncControl_HSYNC_TRI_STATE		(2<<0)
	#define PM3RD_SyncControl_VSYNC_ACTIVE_LOW		(0<<3)
	#define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH		(1<<3)
	#define PM3RD_SyncControl_VSYNC_TRI_STATE		(2<<3)
	#define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE		(3<<3)
	#define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE		(4<<3)
	#define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC	(0<<6)
	#define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH	(1<<6)
	#define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC	(0<<7)
	#define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH	(1<<7)
#define PM3RD_DACControl					0x002
	#define PM3RD_DACControl_DAC_POWER_ON			(0<<0)
	#define PM3RD_DACControl_DAC_POWER_OFF			(1<<0)
	#define PM3RD_DACControl_SYNC_ON_GREEN_DISABLE		(0<<3)
	#define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE		(1<<3)
	#define PM3RD_DACControl_BLANK_RED_DAC_DISABLE		(0<<4)
	#define PM3RD_DACControl_BLANK_RED_DAC_ENABLE		(1<<4)
	#define PM3RD_DACControl_BLANK_GREEN_DAC_DISABLE	(0<<5)
	#define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE		(1<<5)
	#define PM3RD_DACControl_BLANK_BLUE_DAC_DISABLE		(0<<6)
	#define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE		(1<<6)
	#define PM3RD_DACControl_BLANK_PEDESTAL_DISABLE		(0<<7)
	#define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE		(1<<7)
#define PM3RD_PixelSize						0x003
	#define PM3RD_PixelSize_24_BIT_PIXELS			(4<<0)
	#define PM3RD_PixelSize_32_BIT_PIXELS			(2<<0)
	#define PM3RD_PixelSize_16_BIT_PIXELS			(1<<0)
	#define PM3RD_PixelSize_8_BIT_PIXELS			(0<<0)
#define PM3RD_ColorFormat					0x004
	#define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE	(1<<6)
	#define PM3RD_ColorFormat_LINEAR_COLOR_EXT_DISABLE	(0<<6)
	#define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW		(1<<5)
	#define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW		(0<<5)
	#define PM3RD_ColorFormat_COLOR_FORMAT_MASK		(0x1f<<0)
	#define PM3RD_ColorFormat_8888_COLOR			(0<<0)
	#define PM3RD_ColorFormat_5551_FRONT_COLOR		(1<<0)
	#define PM3RD_ColorFormat_4444_COLOR			(2<<0)
	#define PM3RD_ColorFormat_332_FRONT_COLOR		(5<<0)
	#define PM3RD_ColorFormat_332_BACK_COLOR		(6<<0)
	#define PM3RD_ColorFormat_2321_FRONT_COLOR		(9<<0)
	#define PM3RD_ColorFormat_2321_BACK_COLOR		(10<<0)
	#define PM3RD_ColorFormat_232_FRONTOFF_COLOR		(11<<0)
	#define PM3RD_ColorFormat_232_BACKOFF_COLOR		(12<<0)
	#define PM3RD_ColorFormat_5551_BACK_COLOR		(13<<0)
	#define PM3RD_ColorFormat_CI8_COLOR			(14<<0)
	#define PM3RD_ColorFormat_565_FRONT_COLOR		(16<<0)
	#define PM3RD_ColorFormat_565_BACK_COLOR		(17<<0)
#define PM3RD_CursorMode					0x005
	#define PM3RD_CursorMode_CURSOR_DISABLE			(0<<0)
	#define PM3RD_CursorMode_CURSOR_ENABLE			(1<<0)
	#define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123	(0<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0		(1<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1		(2<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2		(3<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3		(4<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01		(5<<2)
	#define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23		(6<<2)
	#define PM3RD_CursorMode_TYPE_MS			(0<<4)
	#define PM3RD_CursorMode_TYPE_X				(1<<4)
	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_DISABLE	(0<<6)
	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE	(1<<6)
	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR	(2<<6)
	#define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR	(3<<6)
#define PM3RD_CursorControl					0x006
	#define PM3RD_CursorControl_DOUBLE_X_DISABLED		(0<<0)
	#define PM3RD_CursorControl_DOUBLE_X_ENABLED		(1<<0)
	#define PM3RD_CursorControl_DOUBLE_Y_DISABLED		(0<<1)
	#define PM3RD_CursorControl_DOUBLE_Y_ENABLED		(1<<1)
	#define PM3RD_CursorControl_READBACK_POS_DISABLED	(0<<2)
	#define PM3RD_CursorControl_READBACK_POS_ENABLED	(1<<2)

#define PM3RD_CursorXLow					0x007
#define PM3RD_CursorXHigh					0x008
#define PM3RD_CursorYLow					0x009
#define PM3RD_CursorYHigh					0x00a
#define PM3RD_CursorHotSpotX					0x00b
#define PM3RD_CursorHotSpotY					0x00c
#define PM3RD_OverlayKey					0x00d
#define PM3RD_Pan						0x00e
	#define PM3RD_Pan_DISABLE				(0<<0)
	#define PM3RD_Pan_ENABLE				(1<<0)
	#define PM3RD_Pan_GATE_DISABLE				(0<<1)
	#define PM3RD_Pan_GATE_ENABLE				(1<<1)
#define PM3RD_Sense						0x00f

#define PM3RD_CheckControl					0x018
	#define PM3RD_CheckControl_PIXEL_DISABLED		(0<<0)
	#define PM3RD_CheckControl_PIXEL_ENABLED		(1<<0)
	#define PM3RD_CheckControl_LUT_DISABLED			(0<<1)
	#define PM3RD_CheckControl_LUT_ENABLED			(1<<1)
#define PM3RD_CheckPixelRed					0x019
#define PM3RD_CheckPixelGreen					0x01a
#define PM3RD_CheckPixelBlue					0x01b
#define PM3RD_CheckLUTRed					0x01c
#define PM3RD_CheckLUTGreen					0x01d
#define PM3RD_CheckLUTBlue					0x01e
#define PM3RD_Scratch						0x01f

#define PM3RD_VideoOverlayControl				0x020
	#define PM3RD_VideoOverlayControl_DISABLE		(0<<0)
	#define PM3RD_VideoOverlayControl_ENABLE		(1<<0)
	#define PM3RD_VideoOverlayControl_MODE_MASK		(3<<1)
	#define PM3RD_VideoOverlayControl_MODE_MAINKEY		(0<<1)
	#define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY	(1<<1)
	#define PM3RD_VideoOverlayControl_MODE_ALWAYS		(2<<1)
	#define PM3RD_VideoOverlayControl_MODE_BLEND		(3<<1)
	#define PM3RD_VideoOverlayControl_DIRECTCOLOR_DISABLED	(0<<3)
	#define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED	(1<<3)
	#define PM3RD_VideoOverlayControl_BLENDSRC_MAIN		(0<<4)
	#define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER	(1<<4)
	#define PM3RD_VideoOverlayControl_KEY_COLOR		(0<<5)
	#define PM3RD_VideoOverlayControl_KEY_ALPHA		(1<<5)
#define PM3RD_VideoOverlayXStartLow				0x021
#define PM3RD_VideoOverlayXStartHigh				0x022
#define PM3RD_VideoOverlayYStartLow				0x023
#define PM3RD_VideoOverlayYStartHigh				0x024
#define PM3RD_VideoOverlayXEndLow				0x025
#define PM3RD_VideoOverlayXEndHigh				0x026
#define PM3RD_VideoOverlayYEndLow				0x027
#define PM3RD_VideoOverlayYEndHigh				0x028
#define PM3RD_VideoOverlayKeyR					0x029
#define PM3RD_VideoOverlayKeyG					0x02a
#define PM3RD_VideoOverlayKeyB					0x02b
#define PM3RD_VideoOverlayBlend					0x02c
	#define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT	(0<<6)
	#define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT	(1<<6)
	#define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT	(2<<6)
	#define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT	(3<<6)

#define PM3RD_DClkSetup1					0x1f0
#define PM3RD_DClkSetup2					0x1f1
#define PM3RD_KClkSetup1					0x1f2
#define PM3RD_KClkSetup2					0x1f3

#define PM3RD_DClkControl					0x200
	#define PM3RD_DClkControl_SOURCE_PLL			(0<<4)
	#define PM3RD_DClkControl_SOURCE_VSA			(1<<4)
	#define PM3RD_DClkControl_SOURCE_VSB			(2<<4)
	#define PM3RD_DClkControl_SOURCE_EXT			(3<<4)
	#define PM3RD_DClkControl_STATE_RUN			(2<<2)
	#define PM3RD_DClkControl_STATE_HIGH			(1<<2)
	#define PM3RD_DClkControl_STATE_LOW			(0<<2)
	#define PM3RD_DClkControl_LOCKED			(1<<1)
	#define PM3RD_DClkControl_NOT_LOCKED			(0<<1)
	#define PM3RD_DClkControl_ENABLE			(1<<0)
	#define PM3RD_DClkControl_DISABLE			(0<<0)
#define PM3RD_DClk0PreScale					0x201
#define PM3RD_DClk0FeedbackScale				0x202
#define PM3RD_DClk0PostScale					0x203
#define PM3RD_DClk1PreScale					0x204
#define PM3RD_DClk1FeedbackScale				0x205
#define PM3RD_DClk1PostScale					0x206
#define PM3RD_DClk2PreScale					0x207
#define PM3RD_DClk2FeedbackScale				0x208
#define PM3RD_DClk2PostScale					0x209
#define PM3RD_DClk3PreScale					0x20a
#define PM3RD_DClk3FeedbackScale				0x20b
#define PM3RD_DClk3PostScale					0x20c
#define PM3RD_KClkControl					0x20d
	#define PM3RD_KClkControl_DISABLE			(0<<0)
	#define PM3RD_KClkControl_ENABLE			(1<<0)
	#define PM3RD_KClkControl_NOT_LOCKED			(0<<1)
	#define PM3RD_KClkControl_LOCKED			(1<<1)
	#define PM3RD_KClkControl_STATE_LOW			(0<<2)
	#define PM3RD_KClkControl_STATE_HIGH			(1<<2)
	#define PM3RD_KClkControl_STATE_RUN			(2<<2)
	#define PM3RD_KClkControl_STATE_LOW_POWER		(3<<2)
	#define PM3RD_KClkControl_SOURCE_PCLK			(0<<4)
	#define PM3RD_KClkControl_SOURCE_HALF_PCLK		(1<<4)
	#define PM3RD_KClkControl_SOURCE_PLL			(2<<4)
#define PM3RD_KClkPreScale					0x20e
#define PM3RD_KClkFeedbackScale					0x20f
#define PM3RD_KClkPostScale					0x210
#define PM3RD_MClkControl					0x211
	#define PM3RD_MClkControl_DISABLE			(0<<0)
	#define PM3RD_MClkControl_ENABLE			(1<<0)
	#define PM3RD_MClkControl_NOT_LOCKED			(0<<1)
	#define PM3RD_MClkControl_LOCKED			(1<<1)
	#define PM3RD_MClkControl_STATE_LOW			(0<<2)
	#define PM3RD_MClkControl_STATE_HIGH			(1<<2)
	#define PM3RD_MClkControl_STATE_RUN			(2<<2)
	#define PM