2 * Copyright 2006 Dave Airlie
3 * Copyright 2007 Maarten Maathuis
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
25 * this code uses ideas taken from the NVIDIA nv driver - the nvidia license
26 * decleration is at the bottom of this file as it is rather ugly
40 #include "mipointer.h"
41 #include "windowstr.h"
43 #include <X11/extensions/render.h>
44 #include "X11/Xatom.h"
47 #include "nv_include.h"
49 const char *OutputType[] = {
58 const char *MonTypeName[7] = {
69 * TMDS registers are indirect 8 bit registers.
70 * Reading is straightforward, writing a bit odd.
71 * Reading: Write adress (+write protect bit, do not forget this), then read value.
72 * Writing: Write adress (+write protect bit), write value, write adress again and write it again (+write protect bit).
75 void NVWriteTMDS(NVPtr pNv, int ramdac, CARD32 tmds_reg, CARD32 val)
77 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL,
78 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE);
80 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_DATA, val & 0xff);
82 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL, tmds_reg & 0xff);
83 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL,
84 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE);
87 CARD8 NVReadTMDS(NVPtr pNv, int ramdac, CARD32 tmds_reg)
89 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL,
90 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE);
92 return (nvReadRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_DATA) & 0xff);
95 /* Two register sets exist, this one is only used for dual link dvi/lvds */
97 void NVWriteTMDS2(NVPtr pNv, int ramdac, CARD32 tmds_reg, CARD32 val)
99 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL_2,
100 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_2_WRITE_DISABLE);
102 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_DATA_2, val & 0xff);
104 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL_2, tmds_reg & 0xff);
105 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL_2,
106 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_2_WRITE_DISABLE);
109 CARD8 NVReadTMDS2(NVPtr pNv, int ramdac, CARD32 tmds_reg)
111 nvWriteRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_CONTROL_2,
112 (tmds_reg & 0xff) | NV_RAMDAC_FP_TMDS_CONTROL_2_WRITE_DISABLE);
114 return (nvReadRAMDAC(pNv, ramdac, NV_RAMDAC_FP_TMDS_DATA_2) & 0xff);
117 void NVOutputWriteTMDS(xf86OutputPtr output, CARD32 tmds_reg, CARD32 val)
119 NVOutputPrivatePtr nv_output = output->driver_private;
120 ScrnInfoPtr pScrn = output->scrn;
121 NVPtr pNv = NVPTR(pScrn);
123 /* We must write to the "bus" of the output */
124 NVWriteTMDS(pNv, nv_output->preferred_output, tmds_reg, val);
127 CARD8 NVOutputReadTMDS(xf86OutputPtr output, CARD32 tmds_reg)
129 NVOutputPrivatePtr nv_output = output->driver_private;
130 ScrnInfoPtr pScrn = output->scrn;
131 NVPtr pNv = NVPTR(pScrn);
133 /* We must read from the "bus" of the output */
134 return NVReadTMDS(pNv, nv_output->preferred_output, tmds_reg);
137 void NVOutputWriteTMDS2(xf86OutputPtr output, CARD32 tmds_reg, CARD32 val)
139 NVOutputPrivatePtr nv_output = output->driver_private;
140 ScrnInfoPtr pScrn = output->scrn;
141 NVPtr pNv = NVPTR(pScrn);
143 /* We must write to the "bus" of the output */
144 NVWriteTMDS2(pNv, nv_output->preferred_output, tmds_reg, val);
147 CARD8 NVOutputReadTMDS2(xf86OutputPtr output, CARD32 tmds_reg)
149 NVOutputPrivatePtr nv_output = output->driver_private;
150 ScrnInfoPtr pScrn = output->scrn;
151 NVPtr pNv = NVPTR(pScrn);
153 /* We must read from the "bus" of the output */
154 return NVReadTMDS2(pNv, nv_output->preferred_output, tmds_reg);
157 /* These functions now write into the output, instead of a specific ramdac */
159 void NVOutputWriteRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg, CARD32 val)
161 NVOutputPrivatePtr nv_output = output->driver_private;
162 ScrnInfoPtr pScrn = output->scrn;
163 NVPtr pNv = NVPTR(pScrn);
165 nvWriteRAMDAC(pNv, nv_output->preferred_output, ramdac_reg, val);
168 CARD32 NVOutputReadRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg)
170 NVOutputPrivatePtr nv_output = output->driver_private;
171 ScrnInfoPtr pScrn = output->scrn;
172 NVPtr pNv = NVPTR(pScrn);
174 return nvReadRAMDAC(pNv, nv_output->preferred_output, ramdac_reg);
177 static void dpms_update_output_ramdac(xf86OutputPtr output, int mode)
179 NVOutputPrivatePtr nv_output = output->driver_private;
180 ScrnInfoPtr pScrn = output->scrn;
181 NVPtr pNv = NVPTR(pScrn);
182 xf86CrtcPtr crtc = output->crtc;
183 if (!crtc) /* we need nv_crtc, so give up */
185 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
187 /* We may be going for modesetting, so we must reset our output binding */
188 if (mode == DPMSModeOff) {
189 NVWriteVGACR5758(pNv, nv_crtc->head, 0, 0x7f);
190 NVWriteVGACR5758(pNv, nv_crtc->head, 2, 0);
194 /* The previous call was not a modeset, but a normal dpms call */
195 NVWriteVGACR5758(pNv, nv_crtc->head, 0, pNv->dcb_table.entry[nv_output->dcb_entry].type);
196 NVWriteVGACR5758(pNv, nv_crtc->head, 2, pNv->dcb_table.entry[nv_output->dcb_entry].or);
200 nv_lvds_output_dpms(xf86OutputPtr output, int mode)
202 NVOutputPrivatePtr nv_output = output->driver_private;
203 NVPtr pNv = NVPTR(output->scrn);
204 xf86CrtcPtr crtc = output->crtc;
205 if (!crtc) /* we need nv_crtc, so give up */
207 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
209 ErrorF("nv_lvds_output_dpms is called with mode %d\n", mode);
211 dpms_update_output_ramdac(output, mode);
213 if (!pNv->dcb_table.entry[nv_output->dcb_entry].lvdsconf.use_power_scripts)
217 case DPMSModeStandby:
218 case DPMSModeSuspend:
219 call_lvds_script(output->scrn, nv_crtc->head, nv_output->dcb_entry, LVDS_BACKLIGHT_OFF, 0);
222 call_lvds_script(output->scrn, nv_crtc->head, nv_output->dcb_entry, LVDS_PANEL_OFF, 0);
225 call_lvds_script(output->scrn, nv_crtc->head, nv_output->dcb_entry, LVDS_PANEL_ON, 0);
232 nv_analog_output_dpms(xf86OutputPtr output, int mode)
234 xf86CrtcPtr crtc = output->crtc;
236 ErrorF("nv_analog_output_dpms is called with mode %d\n", mode);
238 dpms_update_output_ramdac(output, mode);
241 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
243 ErrorF("nv_analog_output_dpms is called for CRTC %d with mode %d\n", nv_crtc->head, mode);
248 nv_tmds_output_dpms(xf86OutputPtr output, int mode)
250 xf86CrtcPtr crtc = output->crtc;
251 NVPtr pNv = NVPTR(output->scrn);
253 ErrorF("nv_tmds_output_dpms is called with mode %d\n", mode);
255 dpms_update_output_ramdac(output, mode);
257 /* Are we assigned a ramdac already?, else we will be activated during mode set */
259 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
261 ErrorF("nv_tmds_output_dpms is called for CRTC %d with mode %d\n", nv_crtc->head, mode);
263 CARD32 fpcontrol = nvReadRAMDAC(pNv, nv_crtc->head, NV_RAMDAC_FP_CONTROL);
265 case DPMSModeStandby:
266 case DPMSModeSuspend:
268 /* cut the TMDS output */
269 fpcontrol |= 0x20000022;
272 /* disable cutting the TMDS output */
273 fpcontrol &= ~0x20000022;
276 nvWriteRAMDAC(pNv, nv_crtc->head, NV_RAMDAC_FP_CONTROL, fpcontrol);
280 void nv_output_save_state_ext(xf86OutputPtr output, RIVA_HW_STATE *state)
282 NVOutputPrivatePtr nv_output = output->driver_private;
286 regp = &state->dac_reg[nv_output->preferred_output];
288 regp->output = NVOutputReadRAMDAC(output, NV_RAMDAC_OUTPUT);
290 /* NV11's don't seem to like this, so let's restrict it to digital outputs only. */
291 if (nv_output->type == OUTPUT_TMDS || nv_output->type == OUTPUT_LVDS) {
292 /* Store the registers in case we need them again for something (like data for VT restore) */
293 for (i = 0; i < 0xFF; i++) {
294 regp->TMDS[i] = NVOutputReadTMDS(output, i);
297 for (i = 0; i < 0xFF; i++) {
298 regp->TMDS2[i] = NVOutputReadTMDS2(output, i);
303 void nv_output_load_state_ext(xf86OutputPtr output, RIVA_HW_STATE *state, Bool override)
305 NVOutputPrivatePtr nv_output = output->driver_private;
308 regp = &state->dac_reg[nv_output->preferred_output];
310 /* This exists purely for proper text mode restore */
311 if (override) NVOutputWriteRAMDAC(output, NV_RAMDAC_OUTPUT, regp->output);
314 /* NOTE: Don't rely on this data for anything other than restoring VT's */
317 nv_output_save (xf86OutputPtr output)
319 ScrnInfoPtr pScrn = output->scrn;
320 NVPtr pNv = NVPTR(pScrn);
321 RIVA_HW_STATE *state;
323 ErrorF("nv_output_save is called\n");
324 state = &pNv->SavedReg;
326 /* Due to strange mapping of outputs we could have swapped analog and digital */
327 /* So we force save all the registers */
328 nv_output_save_state_ext(output, state);
331 uint32_t nv_calc_tmds_clock_from_pll(xf86OutputPtr output)
333 ScrnInfoPtr pScrn = output->scrn;
334 NVPtr pNv = NVPTR(pScrn);
335 RIVA_HW_STATE *state;
337 NVOutputPrivatePtr nv_output = output->driver_private;
339 state = &pNv->SavedReg;
340 /* Registers are stored by their preferred ramdac */
341 regp = &state->dac_reg[nv_output->preferred_output];
343 /* Only do it once for a dvi-d/dvi-a pair */
344 Bool swapped_clock = FALSE;
345 Bool vpllb_disabled = FALSE;
346 /* Bit3 swaps crtc (clocks are bound to crtc) and output */
347 if (regp->TMDS[0x4] & (1 << 3)) {
348 swapped_clock = TRUE;
351 uint8_t vpll_num = swapped_clock ^ nv_output->preferred_output;
356 /* For the moment the syntax is the same for NV40 and earlier */
357 if (pNv->Architecture == NV_ARCH_40) {
358 vplla = vpll_num ? state->vpll2_a : state->vpll1_a;
359 vpllb = vpll_num ? state->vpll2_b : state->vpll1_b;
361 vplla = vpll_num ? state->vpll2 : state->vpll;
362 if (pNv->twoStagePLL)
363 vpllb = vpll_num ? state->vpll2B : state->vpllB;
366 if (!pNv->twoStagePLL)
367 vpllb_disabled = TRUE;
369 /* This is the dummy value nvidia sets when vpll is disabled */
370 if ((vpllb & 0xFFFF) == 0x11F)
371 vpllb_disabled = TRUE;
373 uint8_t m1, m2, n1, n2, p;
376 n1 = (vplla >> 8) & 0xFF;
377 p = (vplla >> 16) & 0x7;
379 if (vpllb_disabled) {
384 n2 = (vpllb >> 8) & 0xFF;
387 uint32_t clock = ((pNv->CrystalFreqKHz * n1 * n2)/(m1 * m2)) >> p;
388 ErrorF("The original bios clock seems to have been %d kHz\n", clock);
392 void nv_set_tmds_registers(xf86OutputPtr output, uint32_t clock, Bool override, Bool crosswired)
394 ScrnInfoPtr pScrn = output->scrn;
395 NVOutputPrivatePtr nv_output = output->driver_private;
396 xf86CrtcPtr crtc = output->crtc;
397 /* We have no crtc, so what are we supposed to do now? */
398 /* This can only happen during VT restore */
399 if (crtc && !override) {
400 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
402 * Resetting all registers is a bad idea, it seems to work fine without it.
404 if (nv_output->type == OUTPUT_TMDS)
405 run_tmds_table(pScrn, nv_output->dcb_entry, nv_crtc->head, clock/10);
407 call_lvds_script(pScrn, nv_crtc->head, nv_output->dcb_entry, LVDS_RESET, clock / 10);
410 * We have no crtc, but we do know what output we are and if we were crosswired.
411 * We can determine our crtc from this.
413 if (nv_output->type == OUTPUT_TMDS)
414 run_tmds_table(pScrn, nv_output->dcb_entry, nv_output->preferred_output ^ crosswired, clock/10);
416 call_lvds_script(pScrn, nv_output->preferred_output ^ crosswired, nv_output->dcb_entry, LVDS_RESET, clock / 10);
417 call_lvds_script(pScrn, nv_output->preferred_output ^ crosswired, nv_output->dcb_entry, LVDS_PANEL_ON, 0);
423 nv_output_restore (xf86OutputPtr output)
425 ScrnInfoPtr pScrn = output->scrn;
426 NVPtr pNv = NVPTR(pScrn);
427 RIVA_HW_STATE *state;
428 NVOutputPrivatePtr nv_output = output->driver_private;
430 ErrorF("nv_output_restore is called\n");
432 state = &pNv->SavedReg;
433 regp = &state->dac_reg[nv_output->preferred_output];
435 /* Due to strange mapping of outputs we could have swapped analog and digital */
436 /* So we force load all the registers */
437 nv_output_load_state_ext(output, state, TRUE);
441 nv_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
443 if (pMode->Flags & V_DBLSCAN)
444 return MODE_NO_DBLESCAN;
446 if (pMode->Clock > 400000 || pMode->Clock < 25000)
447 return MODE_CLOCK_RANGE;
454 nv_output_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
455 DisplayModePtr adjusted_mode)
457 ErrorF("nv_output_mode_fixup is called\n");
463 nv_output_mode_set_regs(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode)
465 NVOutputPrivatePtr nv_output = output->driver_private;
466 ScrnInfoPtr pScrn = output->scrn;
467 //RIVA_HW_STATE *state;
468 //NVOutputRegPtr regp, savep;
470 xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
473 /* It's getting quiet here, not removing function just yet, we may still need it */
475 //state = &pNv->ModeReg;
476 //regp = &state->dac_reg[nv_output->preferred_output];
478 if (nv_output->type == OUTPUT_TMDS || nv_output->type == OUTPUT_LVDS)
482 NVCrtcPrivatePtr nv_crtc = output->crtc->driver_private;
486 for (i = 0; i < config->num_output; i++) {
487 NVOutputPrivatePtr nv_output2 = config->output[i]->driver_private;
489 /* is it this output ?? */
490 if (config->output[i] == output)
493 /* it the output connected */
494 if (config->output[i]->crtc == NULL)
498 if ((nv_output2->type == OUTPUT_ANALOG) && (nv_output->type == OUTPUT_ANALOG)) {
503 ErrorF("%d: crtc %d output %d twocrt %d twomon %d\n", is_fp, nv_crtc->head, nv_output->preferred_output, two_crt, two_mon);
507 /* Only return if output is active (=have a crtc). */
510 nv_have_duallink(ScrnInfoPtr pScrn)
512 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
513 NVPtr pNv = NVPTR(pScrn);
516 for (i = 0; i < xf86_config->num_output; i++) {
517 xf86OutputPtr output = xf86_config->output[i];
518 NVOutputPrivatePtr nv_output = output->driver_private;
519 if (pNv->dcb_table.entry[nv_output->dcb_entry].duallink_possible &&
520 (pNv->dcb_table.entry[nv_output->dcb_entry].type == OUTPUT_LVDS ||
521 pNv->dcb_table.entry[nv_output->dcb_entry].type == OUTPUT_TMDS) &&
532 nv_output_mode_set_routing(xf86OutputPtr output)
534 NVOutputPrivatePtr nv_output = output->driver_private;
535 xf86CrtcPtr crtc = output->crtc;
536 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
537 ScrnInfoPtr pScrn = output->scrn;
538 NVPtr pNv = NVPTR(pScrn);
540 uint32_t output_reg[2] = {0, 0};
542 /* This is for simplicity */
543 output_reg[0] = NV_RAMDAC_OUTPUT_DAC_ENABLE;
544 output_reg[1] = NV_RAMDAC_OUTPUT_DAC_ENABLE;
546 /* Some (most?) pre-NV30 cards have switchable crtc's. */
547 if (pNv->switchable_crtc) {
548 if (!nv_have_duallink(pScrn)) { /* normal */
549 if (nv_crtc->head == 1) {
550 output_reg[nv_output->preferred_output] |= NV_RAMDAC_OUTPUT_SELECT_CRTC1;
552 output_reg[(~nv_output->preferred_output) & 1] |= NV_RAMDAC_OUTPUT_SELECT_CRTC1;
554 } else { /* some dual-link stuff is strange */
555 output_reg[0] |= NV_RAMDAC_OUTPUT_SELECT_CRTC1;
556 output_reg[1] |= NV_RAMDAC_OUTPUT_SELECT_CRTC1;
558 /* There are some odd bits that we want to keep. */
559 /* bit 17 and 18 for example. */
560 output_reg[0] |= (pNv->misc_info.output[0] & (~0 << 9));
561 output_reg[1] |= (pNv->misc_info.output[1] & (~0 << 9));
565 /* The registers can't be considered seperately on most cards */
566 nvWriteRAMDAC(pNv, 0, NV_RAMDAC_OUTPUT, output_reg[0]);
567 nvWriteRAMDAC(pNv, 1, NV_RAMDAC_OUTPUT, output_reg[1]);
569 /* This could use refinement for flatpanels, but it should work this way */
570 if (pNv->NVArch < 0x44) {
571 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, 0xf0000000);
572 if (pNv->Architecture == NV_ARCH_40)
573 nvWriteRAMDAC(pNv, 0, NV_RAMDAC_670, 0xf0000000);
575 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, 0x00100000);
576 nvWriteRAMDAC(pNv, 0, NV_RAMDAC_670, 0x00100000);
581 nv_output_mode_set(xf86OutputPtr output, DisplayModePtr mode,
582 DisplayModePtr adjusted_mode)
584 ScrnInfoPtr pScrn = output->scrn;
585 NVPtr pNv = NVPTR(pScrn);
586 NVOutputPrivatePtr nv_output = output->driver_private;
587 RIVA_HW_STATE *state;
589 ErrorF("nv_output_mode_set is called\n");
591 state = &pNv->ModeReg;
593 nv_output_mode_set_regs(output, mode, adjusted_mode);
594 nv_output_load_state_ext(output, state, FALSE);
595 if (nv_output->type == OUTPUT_TMDS || nv_output->type == OUTPUT_LVDS)
596 nv_set_tmds_registers(output, adjusted_mode->Clock, FALSE, FALSE);
598 nv_output_mode_set_routing(output);
602 nv_get_edid(xf86OutputPtr output)
604 /* no use for shared DDC output */
605 NVOutputPrivatePtr nv_output = output->driver_private;
608 if (nv_output->pDDCBus == NULL)
611 ddc_mon = xf86OutputGetEDID(output, nv_output->pDDCBus);
615 if (ddc_mon->features.input_type && (nv_output->type == OUTPUT_ANALOG))
618 if ((!ddc_mon->features.input_type) && (nv_output->type == OUTPUT_TMDS ||
619 nv_output->type == OUTPUT_LVDS))
630 nv_ddc_detect(xf86OutputPtr output)
632 xf86MonPtr m = nv_get_edid(output);
642 nv_crt_load_detect(xf86OutputPtr output)
644 ScrnInfoPtr pScrn = output->scrn;
645 NVOutputPrivatePtr nv_output = output->driver_private;
646 NVPtr pNv = NVPTR(pScrn);
647 CARD32 reg_output, reg_test_ctrl, temp;
648 Bool present = FALSE;
650 /* For some reason we get false positives on output 1, maybe due tv-out? */
651 if (nv_output->preferred_output == 1) {
655 if (nv_output->pDDCBus != NULL) {
656 xf86MonPtr ddc_mon = xf86OutputGetEDID(output, nv_output->pDDCBus);
657 /* Is there a digital flatpanel on this channel? */
658 if (ddc_mon && ddc_mon->features.input_type) {
663 reg_output = nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_OUTPUT);
664 reg_test_ctrl = nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL);
666 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, (reg_test_ctrl & ~0x00010000));
668 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_OUTPUT, (reg_output & 0x0000FEEE));
671 temp = nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_OUTPUT);
672 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_OUTPUT, temp | 1);
674 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_DATA, 0x94050140);
675 temp = nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL);
676 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, temp | 0x1000);
680 present = (nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL) & (1 << 28)) ? TRUE : FALSE;
682 temp = NVOutputReadRAMDAC(output, NV_RAMDAC_TEST_CONTROL);
683 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, temp & 0x000EFFF);
685 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_OUTPUT, reg_output);
686 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_TEST_CONTROL, reg_test_ctrl);
689 ErrorF("A crt was detected on output %d with no ddc support\n", nv_output->preferred_output);
696 static xf86OutputStatus
697 nv_tmds_output_detect(xf86OutputPtr output)
699 ErrorF("nv_tmds_output_detect is called\n");
701 if (nv_ddc_detect(output))
702 return XF86OutputStatusConnected;
704 return XF86OutputStatusDisconnected;
708 static xf86OutputStatus
709 nv_analog_output_detect(xf86OutputPtr output)
711 ErrorF("nv_analog_output_detect is called\n");
713 if (nv_ddc_detect(output))
714 return XF86OutputStatusConnected;
716 if (nv_crt_load_detect(output))
717 return XF86OutputStatusConnected;
719 return XF86OutputStatusDisconnected;
722 static DisplayModePtr
723 nv_output_get_modes(xf86OutputPtr output)
725 NVOutputPrivatePtr nv_output = output->driver_private;
727 DisplayModePtr ddc_modes;
729 ErrorF("nv_output_get_modes is called\n");
731 ddc_mon = nv_get_edid(output);
733 xf86OutputSetEDID(output, ddc_mon);
738 ddc_modes = xf86OutputGetEDIDModes (output);
740 if (nv_output->type == OUTPUT_TMDS || nv_output->type == OUTPUT_LVDS) {
744 for (i = 0; i < 4; i++) {
745 /* We only look at detailed timings atm */
746 if (ddc_mon->det_mon[i].type != DT)
748 /* Selecting only based on width ok? */
749 if (ddc_mon->det_mon[i].section.d_timings.h_active > nv_output->fpWidth) {
750 nv_output->fpWidth = ddc_mon->det_mon[i].section.d_timings.h_active;
751 nv_output->fpHeight = ddc_mon->det_mon[i].section.d_timings.v_active;
755 /* Add a native resolution mode that is preferred */
756 /* Reduced blanking should be fine on DVI monitor */
757 nv_output->native_mode = xf86CVTMode(nv_output->fpWidth, nv_output->fpHeight, 60.0, TRUE, FALSE);
758 nv_output->native_mode->type = M_T_DRIVER | M_T_PREFERRED;
760 if (output->funcs->mode_valid(output, nv_output->native_mode) == MODE_OK) {
761 /* We want the new mode to be preferred */
762 for (mode = ddc_modes; mode != NULL; mode = mode->next) {
763 if (mode->type & M_T_PREFERRED) {
764 mode->type &= ~M_T_PREFERRED;
767 ddc_modes = xf86ModesAdd(ddc_modes, nv_output->native_mode);
768 } else { /* invalid mode */
769 nv_output->native_mode = NULL;
770 for (mode = ddc_modes; mode != NULL; mode = mode->next) {
771 if (mode->HDisplay == nv_output->fpWidth &&
772 mode->VDisplay == nv_output->fpHeight) {
774 nv_output->native_mode = mode;
778 if (!nv_output->native_mode) {
779 ErrorF("Really bad stuff happening, CVT mode bad and no other native mode can be found.\n");
780 ErrorF("Bailing out\n");
783 ErrorF("CVT mode was invalid(=bad), but another mode was found\n");
792 nv_output_destroy (xf86OutputPtr output)
794 ErrorF("nv_output_destroy is called\n");
795 if (output->driver_private)
796 xfree (output->driver_private);
800 nv_output_prepare(xf86OutputPtr output)
802 ErrorF("nv_output_prepare is called\n");
803 NVOutputPrivatePtr nv_output = output->driver_private;
804 ScrnInfoPtr pScrn = output->scrn;
805 xf86CrtcPtr crtc = output->crtc;
806 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
807 NVPtr pNv = NVPTR(pScrn);
809 output->funcs->dpms(output, DPMSModeOff);
811 /* Shut down the tmds pll, a short sleep period will happen at crtc prepare. */
812 uint32_t debug0 = nvReadRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_FP_DEBUG_0) |
813 NV_RAMDAC_FP_DEBUG_0_PWRDOWN_TMDS_PLL;
814 nvWriteRAMDAC(pNv, nv_output->preferred_output, NV_RAMDAC_FP_DEBUG_0, debug0);
816 /* Set our output type and output routing possibilities to the right registers */
817 NVWriteVGACR5758(pNv, nv_crtc->head, 0, pNv->dcb_table.entry[nv_output->dcb_entry].type);
818 NVWriteVGACR5758(pNv, nv_crtc->head, 2, pNv->dcb_table.entry[nv_output->dcb_entry].or);
822 nv_output_commit(xf86OutputPtr output)
824 ErrorF("nv_output_commit is called\n");
826 output->funcs->dpms(output, DPMSModeOn);
829 static const xf86OutputFuncsRec nv_analog_output_funcs = {
830 .dpms = nv_analog_output_dpms,
831 .save = nv_output_save,
832 .restore = nv_output_restore,
833 .mode_valid = nv_output_mode_valid,
834 .mode_fixup = nv_output_mode_fixup,
835 .mode_set = nv_output_mode_set,
836 .detect = nv_analog_output_detect,
837 .get_modes = nv_output_get_modes,
838 .destroy = nv_output_destroy,
839 .prepare = nv_output_prepare,
840 .commit = nv_output_commit,
843 #ifdef RANDR_12_INTERFACE
845 * Several scaling modes exist, let the user choose.
847 #define SCALING_MODE_NAME "SCALING_MODE"
848 static const struct {
850 enum scaling_modes mode;
852 { "panel", SCALE_PANEL },
853 { "fullscreen", SCALE_FULLSCREEN },
854 { "aspect", SCALE_ASPECT },
855 { "noscale", SCALE_NOSCALE },
856 { NULL, SCALE_INVALID}
858 static Atom scaling_mode_atom;
861 nv_scaling_mode_lookup(char *name, int size)
865 /* for when name is zero terminated */
869 for (i = 0; scaling_mode[i].name; i++)
870 /* We're getting non-terminated strings */
871 if (strlen(scaling_mode[i].name) >= size &&
872 !strncasecmp(name, scaling_mode[i].name, size))
875 return scaling_mode[i].mode;
879 nv_digital_output_create_resources(xf86OutputPtr output)
881 NVOutputPrivatePtr nv_output = output->driver_private;
882 ScrnInfoPtr pScrn = output->scrn;
886 * Setup scaling mode property.
888 scaling_mode_atom = MakeAtom(SCALING_MODE_NAME, sizeof(SCALING_MODE_NAME) - 1, TRUE);
890 error = RRConfigureOutputProperty(output->randr_output,
891 scaling_mode_atom, TRUE, FALSE, FALSE,
895 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
896 "RRConfigureOutputProperty error, %d\n", error);
899 char *existing_scale_name = NULL;
900 for (i = 0; scaling_mode[i].name; i++)
901 if (scaling_mode[i].mode == nv_output->scaling_mode)
902 existing_scale_name = scaling_mode[i].name;
904 error = RRChangeOutputProperty(output->randr_output, scaling_mode_atom,
905 XA_STRING, 8, PropModeReplace,
906 strlen(existing_scale_name),
907 existing_scale_name, FALSE, TRUE);
910 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
911 "Failed to set scaling mode, %d\n", error);
916 nv_digital_output_set_property(xf86OutputPtr output, Atom property,
917 RRPropertyValuePtr value)
919 NVOutputPrivatePtr nv_output = output->driver_private;
921 if (property == scaling_mode_atom) {
925 if (value->type != XA_STRING || value->format != 8)
928 name = (char *) value->data;
930 /* Match a string to a scaling mode */
931 ret = nv_scaling_mode_lookup(name, value->size);
932 if (ret == SCALE_INVALID)
935 nv_output->scaling_mode = ret;
942 #endif /* RANDR_12_INTERFACE */
945 nv_tmds_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
947 NVOutputPrivatePtr nv_output = output->driver_private;
949 /* We can't exceed the native mode.*/
950 if (pMode->HDisplay > nv_output->fpWidth || pMode->VDisplay > nv_output->fpHeight)
953 return nv_output_mode_valid(output, pMode);
956 static const xf86OutputFuncsRec nv_tmds_output_funcs = {
957 .dpms = nv_tmds_output_dpms,
958 .save = nv_output_save,
959 .restore = nv_output_restore,
960 .mode_valid = nv_tmds_output_mode_valid,
961 .mode_fixup = nv_output_mode_fixup,
962 .mode_set = nv_output_mode_set,
963 .detect = nv_tmds_output_detect,
964 .get_modes = nv_output_get_modes,
965 .destroy = nv_output_destroy,
966 .prepare = nv_output_prepare,
967 .commit = nv_output_commit,
968 #ifdef RANDR_12_INTERFACE
969 .create_resources = nv_digital_output_create_resources,
970 .set_property = nv_digital_output_set_property,
971 #endif /* RANDR_12_INTERFACE */
974 static int nv_lvds_output_mode_valid
975 (xf86OutputPtr output, DisplayModePtr pMode)
977 NVOutputPrivatePtr nv_output = output->driver_private;
979 /* No modes > panel's native res */
980 if (pMode->HDisplay > nv_output->fpWidth || pMode->VDisplay > nv_output->fpHeight)
983 return nv_output_mode_valid(output, pMode);
986 static xf86OutputStatus
987 nv_lvds_output_detect(xf86OutputPtr output)
989 ScrnInfoPtr pScrn = output->scrn;
990 NVPtr pNv = NVPTR(pScrn);
991 NVOutputPrivatePtr nv_output = output->driver_private;
993 if (pNv->dcb_table.entry[nv_output->dcb_entry].lvdsconf.use_straps_for_mode &&
994 pNv->VBIOS.fp.native_mode)
995 return XF86OutputStatusConnected;
996 if (nv_ddc_detect(output))
997 return XF86OutputStatusConnected;
999 return XF86OutputStatusDisconnected;
1002 static DisplayModePtr
1003 nv_lvds_output_get_modes(xf86OutputPtr output)
1005 ScrnInfoPtr pScrn = output->scrn;
1006 NVPtr pNv = NVPTR(pScrn);
1007 NVOutputPrivatePtr nv_output = output->driver_private;
1008 DisplayModePtr modes;
1010 if ((modes = nv_output_get_modes(output)))
1013 /* it is possible to set up a mode from what we can read from the
1014 * RAMDAC registers, but if we can't read the BIOS table correctly
1015 * we might as well give up */
1016 if (!pNv->dcb_table.entry[nv_output->dcb_entry].lvdsconf.use_straps_for_mode ||
1017 (pNv->VBIOS.fp.native_mode == NULL))
1020 nv_output->fpWidth = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_HDISP_END) + 1;
1021 nv_output->fpHeight = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_VDISP_END) + 1;
1022 nv_output->fpSyncs = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_CONTROL) & 0x30000033;
1024 if (pNv->VBIOS.fp.native_mode->HDisplay != nv_output->fpWidth ||
1025 pNv->VBIOS.fp.native_mode->VDisplay != nv_output->fpHeight) {
1026 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
1027 "Panel size mismatch; ignoring RAMDAC\n");
1028 nv_output->fpWidth = pNv->VBIOS.fp.native_mode->HDisplay;
1029 nv_output->fpHeight = pNv->VBIOS.fp.native_mode->VDisplay;
1032 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Panel size is %u x %u\n",
1033 nv_output->fpWidth, nv_output->fpHeight);
1035 nv_output->native_mode = xf86DuplicateMode(pNv->VBIOS.fp.native_mode);
1037 return xf86DuplicateMode(pNv->VBIOS.fp.native_mode);
1040 static const xf86OutputFuncsRec nv_lvds_output_funcs = {
1041 .dpms = nv_lvds_output_dpms,
1042 .save = nv_output_save,
1043 .restore = nv_output_restore,
1044 .mode_valid = nv_lvds_output_mode_valid,
1045 .mode_fixup = nv_output_mode_fixup,
1046 .mode_set = nv_output_mode_set,
1047 .detect = nv_lvds_output_detect,
1048 .get_modes = nv_lvds_output_get_modes,
1049 .destroy = nv_output_destroy,
1050 .prepare = nv_output_prepare,
1051 .commit = nv_output_commit,
1052 #ifdef RANDR_12_INTERFACE
1053 .create_resources = nv_digital_output_create_resources,
1054 .set_property = nv_digital_output_set_property,
1055 #endif /* RANDR_12_INTERFACE */
1058 static void nv_add_analog_output(ScrnInfoPtr pScrn, int dcb_entry, Bool dvi_pair)
1060 NVPtr pNv = NVPTR(pScrn);
1061 xf86OutputPtr output;
1062 NVOutputPrivatePtr nv_output;
1063 char outputname[20];
1064 Bool create_output = TRUE;
1065 int i2c_index = pNv->dcb_table.entry[dcb_entry].i2c_index;
1067 /* DVI have an analog connector and a digital one, differentiate between that and a normal vga */
1069 sprintf(outputname, "DVI-A-%d", pNv->dvi_a_count);
1072 sprintf(outputname, "VGA-%d", pNv->vga_count);
1076 nv_output = xnfcalloc (sizeof (NVOutputPrivateRec), 1);
1081 nv_output->dcb_entry = dcb_entry;
1083 if (pNv->dcb_table.i2c_read[i2c_index] && pNv->pI2CBus[i2c_index] == NULL)
1084 NV_I2CInit(pScrn, &pNv->pI2CBus[i2c_index], pNv->dcb_table.i2c_read[i2c_index], xstrdup(outputname));
1086 nv_output->type = OUTPUT_ANALOG;
1089 * bit0: OUTPUT_0 valid
1090 * bit1: OUTPUT_1 valid
1091 * So lowest order has highest priority.
1092 * Below is guesswork:
1093 * bit2: All outputs valid
1095 /* This also facilitates proper output routing for dvi */
1096 /* See sel_clk assignment in nv_crtc.c */
1097 if (ffs(pNv->dcb_table.entry[dcb_entry].or) & OUTPUT_1) {
1098 nv_output->preferred_output = 1;
1100 nv_output->preferred_output = 0;
1103 nv_output->bus = pNv->dcb_table.entry[dcb_entry].bus;
1105 if (!create_output) {
1110 /* Delay creation of output until we actually know we want it */
1111 output = xf86OutputCreate (pScrn, &nv_analog_output_funcs, outputname);
1115 output->driver_private = nv_output;
1117 nv_output->pDDCBus = pNv->pI2CBus[i2c_index];
1119 if (pNv->switchable_crtc) {
1120 output->possible_crtcs = pNv->dcb_table.entry[dcb_entry].heads;
1122 output->possible_crtcs = (1 << nv_output->preferred_output);
1125 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Adding output %s\n", outputname);
1128 static void nv_add_digital_output(ScrnInfoPtr pScrn, int dcb_entry, int lvds)
1130 NVPtr pNv = NVPTR(pScrn);
1131 xf86OutputPtr output;
1132 NVOutputPrivatePtr nv_output;
1133 char outputname[20];
1134 Bool create_output = TRUE;
1135 int i2c_index = pNv->dcb_table.entry[dcb_entry].i2c_index;
1138 sprintf(outputname, "LVDS-%d", pNv->lvds_count);
1141 sprintf(outputname, "DVI-D-%d", pNv->dvi_d_count);
1145 nv_output = xnfcalloc (sizeof (NVOutputPrivateRec), 1);
1151 nv_output->dcb_entry = dcb_entry;
1153 if (pNv->dcb_table.i2c_read[i2c_index] && pNv->pI2CBus[i2c_index] == NULL)
1154 NV_I2CInit(pScrn, &pNv->pI2CBus[i2c_index], pNv->dcb_table.i2c_read[i2c_index], xstrdup(outputname));
1156 nv_output->pDDCBus = pNv->pI2CBus[i2c_index];
1159 * bit0: OUTPUT_0 valid
1160 * bit1: OUTPUT_1 valid
1161 * So lowest order has highest priority.
1162 * Below is guesswork:
1163 * bit2: All outputs valid
1165 /* This also facilitates proper output routing for dvi */
1166 /* See sel_clk assignment in nv_crtc.c */
1167 if (ffs(pNv->dcb_table.entry[dcb_entry].or) & OUTPUT_1) {
1168 nv_output->preferred_output = 1;
1170 nv_output->preferred_output = 0;
1173 nv_output->bus = pNv->dcb_table.entry[dcb_entry].bus;
1176 nv_output->type = OUTPUT_LVDS;
1177 /* comment below two lines to test LVDS under RandR12.
1178 * If your screen "blooms" or "bleeds" (i.e. has a developing
1179 * white / psychedelic pattern) then KILL X IMMEDIATELY
1180 * (ctrl+alt+backspace) & if the effect continues reset power */
1181 ErrorF("Output refused because we don't accept LVDS at the moment.\n");
1182 create_output = FALSE;
1184 nv_output->type = OUTPUT_TMDS;
1187 if (!create_output) {
1192 /* Delay creation of output until we are certain is desirable */
1194 output = xf86OutputCreate (pScrn, &nv_lvds_output_funcs, outputname);
1196 output = xf86OutputCreate (pScrn, &nv_tmds_output_funcs, outputname);
1200 output->driver_private = nv_output;
1202 if (pNv->fpScaler) /* GPU Scaling */
1203 nv_output->scaling_mode = SCALE_ASPECT;
1204 else /* Panel scaling */
1205 nv_output->scaling_mode = SCALE_PANEL;
1207 #ifdef RANDR_12_INTERFACE
1208 if (xf86GetOptValString(pNv->Options, OPTION_SCALING_MODE)) {
1209 nv_output->scaling_mode = nv_scaling_mode_lookup(xf86GetOptValString(pNv->Options, OPTION_SCALING_MODE), -1);
1210 if (nv_output->scaling_mode == SCALE_INVALID)
1211 nv_output->scaling_mode = SCALE_ASPECT; /* default */
1213 #endif /* RANDR_12_INTERFACE */
1215 /* Due to serious problems we have to restrict the crtc's for certain types of outputs. */
1216 /* This is a result of problems with G70 cards that have a dvi with ffs(or) == 1 */
1217 /* Anyone know what the solution for this is? */
1218 if (nv_output->preferred_output == 0) {
1219 output->possible_crtcs = (1 << 0);
1221 if (pNv->switchable_crtc) {
1222 output->possible_crtcs = pNv->dcb_table.entry[dcb_entry].heads;
1224 output->possible_crtcs = (1 << nv_output->preferred_output);
1228 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Adding output %s\n", outputname);
1231 void NvDCBSetupOutputs(ScrnInfoPtr pScrn)
1233 NVPtr pNv = NVPTR(pScrn);
1234 int i, type, i2c_count[0xf];
1236 pNv->switchable_crtc = FALSE;
1237 /* I was wrong, again. */
1238 if (pNv->NVArch > 0x11 && pNv->twoHeads)
1239 pNv->switchable_crtc = TRUE;
1241 memset(i2c_count, 0, sizeof(i2c_count));
1242 for (i = 0 ; i < pNv->dcb_table.entries; i++)
1243 i2c_count[pNv->dcb_table.entry[i].i2c_index]++;
1245 /* we setup the outputs up from the BIOS table */
1246 for (i = 0 ; i < pNv->dcb_table.entries; i++) {
1247 type = pNv->dcb_table.entry[i].type;
1249 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DCB type %d not known\n", type);
1253 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DCB entry %d: type: %d, i2c_index: %d, heads: %d, bus: %d, or: %d\n", i, type, pNv->dcb_table.entry[i].i2c_index, pNv->dcb_table.entry[i].heads, pNv->dcb_table.entry[i].bus, pNv->dcb_table.entry[i].or);
1257 nv_add_analog_output(pScrn, i, (i2c_count[pNv->dcb_table.entry[i].i2c_index] > 1));
1260 nv_add_digital_output(pScrn, i, 0);
1263 nv_add_digital_output(pScrn, i, 1);
1271 void NvSetupOutputs(ScrnInfoPtr pScrn)
1273 NVPtr pNv = NVPTR(pScrn);
1275 pNv->Television = FALSE;
1277 memset(pNv->pI2CBus, 0, sizeof(pNv->pI2CBus));
1278 NvDCBSetupOutputs(pScrn);
1281 /*************************************************************************** \
1283 |* Copyright 1993-2003 NVIDIA, Corporation. All rights reserved. *|
1285 |* NOTICE TO USER: The source code is copyrighted under U.S. and *|
1286 |* international laws. Users and possessors of this source code are *|
1287 |* hereby granted a nonexclusive, royalty-free copyright license to *|
1288 |* use this code in individual and commercial software. *|
1290 |* Any use of this source code must include, in the user documenta- *|
1291 |* tion and internal comments to the code, notices to the end user *|
1294 |* Copyright 1993-1999 NVIDIA, Corporation. All rights reserved. *|
1296 |* NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY *|
1297 |* OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" *|
1298 |* WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPOR- *|
1299 |* ATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE, *|
1300 |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE- *|
1301 |* MENT, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL *|
1302 |* NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCI- *|
1303 |* DENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RE- *|
1304 |* SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION *|
1305 |* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *|
1306 |* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
1308 |* U.S. Government End Users. This source code is a "commercial *|
1309 |* item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
1310 |* consisting of "commercial computer software" and "commercial *|
1311 |* computer software documentation," as such terms are used in *|
1312 |* 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Govern- *|
1313 |* ment only as a commercial end item. Consistent with 48 C.F.R. *|
1314 |* 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
1315 |* all U.S. Government End Users acquire the source code with only *|
1316 |* those rights set forth herein. *|
1318 \***************************************************************************/