| @@ -51,51 +51,53 @@ static void CG6LeaveVT(int scrnIndex, in | | | @@ -51,51 +51,53 @@ static void CG6LeaveVT(int scrnIndex, in |
51 | static Bool CG6CloseScreen(int scrnIndex, ScreenPtr pScreen); | | 51 | static Bool CG6CloseScreen(int scrnIndex, ScreenPtr pScreen); |
52 | static Bool CG6SaveScreen(ScreenPtr pScreen, int mode); | | 52 | static Bool CG6SaveScreen(ScreenPtr pScreen, int mode); |
53 | | | 53 | |
54 | /* Required if the driver supports mode switching */ | | 54 | /* Required if the driver supports mode switching */ |
55 | static Bool CG6SwitchMode(int scrnIndex, DisplayModePtr mode, int flags); | | 55 | static Bool CG6SwitchMode(int scrnIndex, DisplayModePtr mode, int flags); |
56 | /* Required if the driver supports moving the viewport */ | | 56 | /* Required if the driver supports moving the viewport */ |
57 | static void CG6AdjustFrame(int scrnIndex, int x, int y, int flags); | | 57 | static void CG6AdjustFrame(int scrnIndex, int x, int y, int flags); |
58 | | | 58 | |
59 | /* Optional functions */ | | 59 | /* Optional functions */ |
60 | static void CG6FreeScreen(int scrnIndex, int flags); | | 60 | static void CG6FreeScreen(int scrnIndex, int flags); |
61 | static ModeStatus CG6ValidMode(int scrnIndex, DisplayModePtr mode, | | 61 | static ModeStatus CG6ValidMode(int scrnIndex, DisplayModePtr mode, |
62 | Bool verbose, int flags); | | 62 | Bool verbose, int flags); |
63 | | | 63 | |
64 | void CG6Sync(ScrnInfoPtr pScrn); | | 64 | static Bool CG6DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, |
| | | 65 | pointer ptr); |
65 | | | 66 | |
66 | #define CG6_VERSION 4000 | | 67 | #define CG6_VERSION 4000 |
67 | #define CG6_NAME "SUNCG6" | | 68 | #define CG6_NAME "SUNCG6" |
68 | #define CG6_DRIVER_NAME "suncg6" | | 69 | #define CG6_DRIVER_NAME "suncg6" |
69 | #define CG6_MAJOR_VERSION PACKAGE_VERSION_MAJOR | | 70 | #define CG6_MAJOR_VERSION PACKAGE_VERSION_MAJOR |
70 | #define CG6_MINOR_VERSION PACKAGE_VERSION_MINOR | | 71 | #define CG6_MINOR_VERSION PACKAGE_VERSION_MINOR |
71 | #define CG6_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL | | 72 | #define CG6_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL |
72 | | | 73 | |
73 | /* | | 74 | /* |
74 | * This contains the functions needed by the server after loading the driver | | 75 | * This contains the functions needed by the server after loading the driver |
75 | * module. It must be supplied, and gets passed back by the SetupProc | | 76 | * module. It must be supplied, and gets passed back by the SetupProc |
76 | * function in the dynamic case. In the static case, a reference to this | | 77 | * function in the dynamic case. In the static case, a reference to this |
77 | * is compiled in, and this requires that the name of this DriverRec be | | 78 | * is compiled in, and this requires that the name of this DriverRec be |
78 | * an upper-case version of the driver name. | | 79 | * an upper-case version of the driver name. |
79 | */ | | 80 | */ |
80 | | | 81 | |
81 | _X_EXPORT DriverRec SUNCG6 = { | | 82 | _X_EXPORT DriverRec SUNCG6 = { |
82 | CG6_VERSION, | | 83 | CG6_VERSION, |
83 | CG6_DRIVER_NAME, | | 84 | CG6_DRIVER_NAME, |
84 | CG6Identify, | | 85 | CG6Identify, |
85 | CG6Probe, | | 86 | CG6Probe, |
86 | CG6AvailableOptions, | | 87 | CG6AvailableOptions, |
87 | NULL, | | 88 | NULL, |
88 | 0 | | 89 | 0, |
| | | 90 | CG6DriverFunc |
89 | }; | | 91 | }; |
90 | | | 92 | |
91 | typedef enum { | | 93 | typedef enum { |
92 | OPTION_SW_CURSOR, | | 94 | OPTION_SW_CURSOR, |
93 | OPTION_HW_CURSOR, | | 95 | OPTION_HW_CURSOR, |
94 | OPTION_NOACCEL | | 96 | OPTION_NOACCEL |
95 | } CG6Opts; | | 97 | } CG6Opts; |
96 | | | 98 | |
97 | static const OptionInfoRec CG6Options[] = { | | 99 | static const OptionInfoRec CG6Options[] = { |
98 | { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, | | 100 | { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, |
99 | { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, | | 101 | { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, |
100 | { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, | | 102 | { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, |
101 | { -1, NULL, OPTV_NONE, {0}, FALSE } | | 103 | { -1, NULL, OPTV_NONE, {0}, FALSE } |
| @@ -126,27 +128,27 @@ static XF86ModuleVersionInfo suncg6VersR | | | @@ -126,27 +128,27 @@ static XF86ModuleVersionInfo suncg6VersR |
126 | MOD_CLASS_VIDEODRV, | | 128 | MOD_CLASS_VIDEODRV, |
127 | {0,0,0,0} | | 129 | {0,0,0,0} |
128 | }; | | 130 | }; |
129 | | | 131 | |
130 | _X_EXPORT XF86ModuleData suncg6ModuleData = { &suncg6VersRec, cg6Setup, NULL }; | | 132 | _X_EXPORT XF86ModuleData suncg6ModuleData = { &suncg6VersRec, cg6Setup, NULL }; |
131 | | | 133 | |
132 | pointer | | 134 | pointer |
133 | cg6Setup(pointer module, pointer opts, int *errmaj, int *errmin) | | 135 | cg6Setup(pointer module, pointer opts, int *errmaj, int *errmin) |
134 | { | | 136 | { |
135 | static Bool setupDone = FALSE; | | 137 | static Bool setupDone = FALSE; |
136 | | | 138 | |
137 | if (!setupDone) { | | 139 | if (!setupDone) { |
138 | setupDone = TRUE; | | 140 | setupDone = TRUE; |
139 | xf86AddDriver(&SUNCG6, module, 0); | | 141 | xf86AddDriver(&SUNCG6, module, HaveDriverFuncs); |
140 | | | 142 | |
141 | /* | | 143 | /* |
142 | * Modules that this driver always requires can be loaded here | | 144 | * Modules that this driver always requires can be loaded here |
143 | * by calling LoadSubModule(). | | 145 | * by calling LoadSubModule(). |
144 | */ | | 146 | */ |
145 | | | 147 | |
146 | /* | | 148 | /* |
147 | * The return value must be non-NULL on success even though there | | 149 | * The return value must be non-NULL on success even though there |
148 | * is no TearDownProc. | | 150 | * is no TearDownProc. |
149 | */ | | 151 | */ |
150 | return (pointer)TRUE; | | 152 | return (pointer)TRUE; |
151 | } else { | | 153 | } else { |
152 | if (errmaj) *errmaj = LDR_ONCEONLY; | | 154 | if (errmaj) *errmaj = LDR_ONCEONLY; |
| @@ -742,21 +744,29 @@ CG6SaveScreen(ScreenPtr pScreen, int mod | | | @@ -742,21 +744,29 @@ CG6SaveScreen(ScreenPtr pScreen, int mod |
742 | break; | | 744 | break; |
743 | case SCREEN_SAVER_OFF: | | 745 | case SCREEN_SAVER_OFF: |
744 | case SCREEN_SAVER_FORCER: | | 746 | case SCREEN_SAVER_FORCER: |
745 | tmp |= CG6_THC_MISC_SYNC_ENAB; | | 747 | tmp |= CG6_THC_MISC_SYNC_ENAB; |
746 | break; | | 748 | break; |
747 | default: | | 749 | default: |
748 | return FALSE; | | 750 | return FALSE; |
749 | } | | 751 | } |
750 | | | 752 | |
751 | pCg6->thc->thc_misc = tmp; | | 753 | pCg6->thc->thc_misc = tmp; |
752 | return TRUE; | | 754 | return TRUE; |
753 | } | | 755 | } |
754 | | | 756 | |
755 | /* | | 757 | static Bool |
756 | * This is the implementation of the Sync() function. | | 758 | CG6DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, |
757 | */ | | 759 | pointer ptr) |
758 | void | | | |
759 | CG6Sync(ScrnInfoPtr pScrn) | | | |
760 | { | | 760 | { |
761 | return; | | 761 | xorgHWFlags *flag; |
| | | 762 | |
| | | 763 | switch (op) { |
| | | 764 | case GET_REQUIRED_HW_INTERFACES: |
| | | 765 | flag = (CARD32*)ptr; |
| | | 766 | (*flag) = HW_MMIO; |
| | | 767 | return TRUE; |
| | | 768 | default: |
| | | 769 | return FALSE; |
| | | 770 | } |
762 | } | | 771 | } |
| | | 772 | |