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 nv_output->native_mode = NULL;
756 if (nv_output->type == OUTPUT_TMDS) {
757 DisplayModePtr cvtmode;
758 /* Add a native resolution mode that is preferred */
759 /* Reduced blanking should be fine on DVI monitor */
760 cvtmode = xf86CVTMode(nv_output->fpWidth, nv_output->fpHeight, 60.0, TRUE, FALSE);
761 cvtmode->type = M_T_DRIVER | M_T_PREFERRED;
763 /* can xf86CVTMode generate invalid modes? */
764 if (output->funcs->mode_valid(output, cvtmode) == MODE_OK) {
765 ddc_modes = xf86ModesAdd(ddc_modes, cvtmode);
766 nv_output->native_mode = cvtmode;
768 xf86DeleteMode(&cvtmode, cvtmode);
771 if (!nv_output->native_mode)
772 for (mode = ddc_modes; mode != NULL; mode = mode->next)
773 if (mode->HDisplay == nv_output->fpWidth &&
774 mode->VDisplay == nv_output->fpHeight) {
775 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");
784 /* We want the new mode to be the only preferred one */
785 for (mode = ddc_modes; mode != NULL; mode = mode->next)
786 if (mode->type & M_T_PREFERRED && mode != nv_output->native_mode)
787 mode->type &= ~M_T_PREFERRED;
794 nv_output_destroy (xf86OutputPtr output)
796 ErrorF("nv_output_destroy is called\n");
797 if (output->driver_private)
798 xfree (output->driver_private);
802 nv_output_prepare(xf86OutputPtr output)
804 ErrorF("nv_output_prepare is called\n");
805 NVOutputPrivatePtr nv_output = output->driver_private;
806 ScrnInfoPtr pScrn = output->scrn;
807 xf86CrtcPtr crtc = output->crtc;
808 NVCrtcPrivatePtr nv_crtc = crtc->driver_private;
809 NVPtr pNv = NVPTR(pScrn);
811 output->funcs->dpms(output, DPMSModeOff);
813 /* Set our output type and output routing possibilities to the right registers */
814 NVWriteVGACR5758(pNv, nv_crtc->head, 0, pNv->dcb_table.entry[nv_output->dcb_entry].type);
815 NVWriteVGACR5758(pNv, nv_crtc->head, 2, pNv->dcb_table.entry[nv_output->dcb_entry].or);
819 nv_output_commit(xf86OutputPtr output)
821 ErrorF("nv_output_commit is called\n");
823 output->funcs->dpms(output, DPMSModeOn);
826 static const xf86OutputFuncsRec nv_analog_output_funcs = {
827 .dpms = nv_analog_output_dpms,
828 .save = nv_output_save,
829 .restore = nv_output_restore,
830 .mode_valid = nv_output_mode_valid,
831 .mode_fixup = nv_output_mode_fixup,
832 .mode_set = nv_output_mode_set,
833 .detect = nv_analog_output_detect,
834 .get_modes = nv_output_get_modes,
835 .destroy = nv_output_destroy,
836 .prepare = nv_output_prepare,
837 .commit = nv_output_commit,
840 #ifdef RANDR_12_INTERFACE
842 * Several scaling modes exist, let the user choose.
844 #define SCALING_MODE_NAME "SCALING_MODE"
845 static const struct {
847 enum scaling_modes mode;
849 { "panel", SCALE_PANEL },
850 { "fullscreen", SCALE_FULLSCREEN },
851 { "aspect", SCALE_ASPECT },
852 { "noscale", SCALE_NOSCALE },
853 { NULL, SCALE_INVALID}
855 static Atom scaling_mode_atom;
858 nv_scaling_mode_lookup(char *name, int size)
862 /* for when name is zero terminated */
866 for (i = 0; scaling_mode[i].name; i++)
867 /* We're getting non-terminated strings */
868 if (strlen(scaling_mode[i].name) >= size &&
869 !strncasecmp(name, scaling_mode[i].name, size))
872 return scaling_mode[i].mode;
876 nv_digital_output_create_resources(xf86OutputPtr output)
878 NVOutputPrivatePtr nv_output = output->driver_private;
879 ScrnInfoPtr pScrn = output->scrn;
883 * Setup scaling mode property.
885 scaling_mode_atom = MakeAtom(SCALING_MODE_NAME, sizeof(SCALING_MODE_NAME) - 1, TRUE);
887 error = RRConfigureOutputProperty(output->randr_output,
888 scaling_mode_atom, TRUE, FALSE, FALSE,
892 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
893 "RRConfigureOutputProperty error, %d\n", error);
896 char *existing_scale_name = NULL;
897 for (i = 0; scaling_mode[i].name; i++)
898 if (scaling_mode[i].mode == nv_output->scaling_mode)
899 existing_scale_name = scaling_mode[i].name;
901 error = RRChangeOutputProperty(output->randr_output, scaling_mode_atom,
902 XA_STRING, 8, PropModeReplace,
903 strlen(existing_scale_name),
904 existing_scale_name, FALSE, TRUE);
907 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
908 "Failed to set scaling mode, %d\n", error);
913 nv_digital_output_set_property(xf86OutputPtr output, Atom property,
914 RRPropertyValuePtr value)
916 NVOutputPrivatePtr nv_output = output->driver_private;
918 if (property == scaling_mode_atom) {
922 if (value->type != XA_STRING || value->format != 8)
925 name = (char *) value->data;
927 /* Match a string to a scaling mode */
928 ret = nv_scaling_mode_lookup(name, value->size);
929 if (ret == SCALE_INVALID)
932 /* LVDS must always use gpu scaling. */
933 if (ret == SCALE_PANEL && nv_output->type == OUTPUT_LVDS)
936 nv_output->scaling_mode = ret;
943 #endif /* RANDR_12_INTERFACE */
946 nv_tmds_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
948 ScrnInfoPtr pScrn = output->scrn;
949 NVPtr pNv = NVPTR(pScrn);
950 NVOutputPrivatePtr nv_output = output->driver_private;
952 /* We can't exceed the native mode.*/
953 if (pMode->HDisplay > nv_output->fpWidth || pMode->VDisplay > nv_output->fpHeight)
956 if (pNv->dcb_table.entry[nv_output->dcb_entry].duallink_possible) {
957 if (pMode->Clock > 330000) /* 2x165 MHz */
958 return MODE_CLOCK_RANGE;
960 if (pMode->Clock > 165000) /* 165 MHz */
961 return MODE_CLOCK_RANGE;
964 return nv_output_mode_valid(output, pMode);
967 static const xf86OutputFuncsRec nv_tmds_output_funcs = {
968 .dpms = nv_tmds_output_dpms,
969 .save = nv_output_save,
970 .restore = nv_output_restore,
971 .mode_valid = nv_tmds_output_mode_valid,
972 .mode_fixup = nv_output_mode_fixup,
973 .mode_set = nv_output_mode_set,
974 .detect = nv_tmds_output_detect,
975 .get_modes = nv_output_get_modes,
976 .destroy = nv_output_destroy,
977 .prepare = nv_output_prepare,
978 .commit = nv_output_commit,
979 #ifdef RANDR_12_INTERFACE
980 .create_resources = nv_digital_output_create_resources,
981 .set_property = nv_digital_output_set_property,
982 #endif /* RANDR_12_INTERFACE */
985 static int nv_lvds_output_mode_valid
986 (xf86OutputPtr output, DisplayModePtr pMode)
988 NVOutputPrivatePtr nv_output = output->driver_private;
990 /* No modes > panel's native res */
991 if (pMode->HDisplay > nv_output->fpWidth || pMode->VDisplay > nv_output->fpHeight)
994 return nv_output_mode_valid(output, pMode);
997 static xf86OutputStatus
998 nv_lvds_output_detect(xf86OutputPtr output)
1000 ScrnInfoPtr pScrn = output->scrn;
1001 NVPtr pNv = NVPTR(pScrn);
1002 NVOutputPrivatePtr nv_output = output->driver_private;
1004 if (pNv->dcb_table.entry[nv_output->dcb_entry].lvdsconf.use_straps_for_mode &&
1005 pNv->VBIOS.fp.native_mode)
1006 return XF86OutputStatusConnected;
1007 if (nv_ddc_detect(output))
1008 return XF86OutputStatusConnected;
1010 return XF86OutputStatusDisconnected;
1013 static DisplayModePtr
1014 nv_lvds_output_get_modes(xf86OutputPtr output)
1016 ScrnInfoPtr pScrn = output->scrn;
1017 NVPtr pNv = NVPTR(pScrn);
1018 NVOutputPrivatePtr nv_output = output->driver_private;
1019 DisplayModePtr modes;
1021 if ((modes = nv_output_get_modes(output)))
1024 /* it is possible to set up a mode from what we can read from the
1025 * RAMDAC registers, but if we can't read the BIOS table correctly
1026 * we might as well give up */
1027 if (!pNv->dcb_table.entry[nv_output->dcb_entry].lvdsconf.use_straps_for_mode ||
1028 (pNv->VBIOS.fp.native_mode == NULL))
1031 nv_output->fpWidth = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_HDISP_END) + 1;
1032 nv_output->fpHeight = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_VDISP_END) + 1;
1033 nv_output->fpSyncs = NVOutputReadRAMDAC(output, NV_RAMDAC_FP_CONTROL) & 0x30000033;
1035 if (pNv->VBIOS.fp.native_mode->HDisplay != nv_output->fpWidth ||
1036 pNv->VBIOS.fp.native_mode->VDisplay != nv_output->fpHeight) {
1037 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
1038 "Panel size mismatch; ignoring RAMDAC\n");
1039 nv_output->fpWidth = pNv->VBIOS.fp.native_mode->HDisplay;
1040 nv_output->fpHeight = pNv->VBIOS.fp.native_mode->VDisplay;
1043 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Panel size is %u x %u\n",
1044 nv_output->fpWidth, nv_output->fpHeight);
1046 nv_output->native_mode = xf86DuplicateMode(pNv->VBIOS.fp.native_mode);
1048 return xf86DuplicateMode(pNv->VBIOS.fp.native_mode);
1051 static const xf86OutputFuncsRec nv_lvds_output_funcs = {
1052 .dpms = nv_lvds_output_dpms,
1053 .save = nv_output_save,
1054 .restore = nv_output_restore,
1055 .mode_valid = nv_lvds_output_mode_valid,
1056 .mode_fixup = nv_output_mode_fixup,
1057 .mode_set = nv_output_mode_set,
1058 .detect = nv_lvds_output_detect,
1059 .get_modes = nv_lvds_output_get_modes,
1060 .destroy = nv_output_destroy,
1061 .prepare = nv_output_prepare,
1062 .commit = nv_output_commit,
1063 #ifdef RANDR_12_INTERFACE
1064 .create_resources = nv_digital_output_create_resources,
1065 .set_property = nv_digital_output_set_property,
1066 #endif /* RANDR_12_INTERFACE */
1069 static void nv_add_analog_output(ScrnInfoPtr pScrn, int dcb_entry, Bool dvi_pair)
1071 NVPtr pNv = NVPTR(pScrn);
1072 xf86OutputPtr output;
1073 NVOutputPrivatePtr nv_output;
1074 char outputname[20];
1075 Bool create_output = TRUE;
1076 int i2c_index = pNv->dcb_table.entry[dcb_entry].i2c_index;
1078 /* DVI have an analog connector and a digital one, differentiate between that and a normal vga */
1080 sprintf(outputname, "DVI-A-%d", pNv->dvi_a_count);
1083 sprintf(outputname, "VGA-%d", pNv->vga_count);
1087 nv_output = xnfcalloc (sizeof (NVOutputPrivateRec), 1);
1092 nv_output->dcb_entry = dcb_entry;
1094 if (pNv->dcb_table.i2c_read[i2c_index] && pNv->pI2CBus[i2c_index] == NULL)
1095 NV_I2CInit(pScrn, &pNv->pI2CBus[i2c_index], pNv->dcb_table.i2c_read[i2c_index], xstrdup(outputname));
1097 nv_output->type = OUTPUT_ANALOG;
1100 * bit0: OUTPUT_0 valid
1101 * bit1: OUTPUT_1 valid
1102 * So lowest order has highest priority.
1103 * Below is guesswork:
1104 * bit2: All outputs valid
1106 /* This also facilitates proper output routing for dvi */
1107 /* See sel_clk assignment in nv_crtc.c */
1108 if (ffs(pNv->dcb_table.entry[dcb_entry].or) & OUTPUT_1) {
1109 nv_output->preferred_output = 1;
1111 nv_output->preferred_output = 0;
1114 nv_output->bus = pNv->dcb_table.entry[dcb_entry].bus;
1116 if (!create_output) {
1121 /* Delay creation of output until we actually know we want it */
1122 output = xf86OutputCreate (pScrn, &nv_analog_output_funcs, outputname);
1126 output->driver_private = nv_output;
1128 nv_output->pDDCBus = pNv->pI2CBus[i2c_index];
1130 if (pNv->switchable_crtc) {
1131 output->possible_crtcs = pNv->dcb_table.entry[dcb_entry].heads;
1133 output->possible_crtcs = (1 << nv_output->preferred_output);
1136 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Adding output %s\n", outputname);
1139 static void nv_add_digital_output(ScrnInfoPtr pScrn, int dcb_entry, int lvds)
1141 NVPtr pNv = NVPTR(pScrn);
1142 xf86OutputPtr output;
1143 NVOutputPrivatePtr nv_output;
1144 char outputname[20];
1145 Bool create_output = TRUE;
1146 int i2c_index = pNv->dcb_table.entry[dcb_entry].i2c_index;
1149 sprintf(outputname, "LVDS-%d", pNv->lvds_count);
1152 sprintf(outputname, "DVI-D-%d", pNv->dvi_d_count);
1156 nv_output = xnfcalloc (sizeof (NVOutputPrivateRec), 1);
1162 nv_output->dcb_entry = dcb_entry;
1164 if (pNv->dcb_table.i2c_read[i2c_index] && pNv->pI2CBus[i2c_index] == NULL)
1165 NV_I2CInit(pScrn, &pNv->pI2CBus[i2c_index], pNv->dcb_table.i2c_read[i2c_index], xstrdup(outputname));
1167 nv_output->pDDCBus = pNv->pI2CBus[i2c_index];
1170 * bit0: OUTPUT_0 valid
1171 * bit1: OUTPUT_1 valid
1172 * So lowest order has highest priority.
1173 * Below is guesswork:
1174 * bit2: All outputs valid
1176 /* This also facilitates proper output routing for dvi */
1177 /* See sel_clk assignment in nv_crtc.c */
1178 if (ffs(pNv->dcb_table.entry[dcb_entry].or) & OUTPUT_1) {
1179 nv_output->preferred_output = 1;
1181 nv_output->preferred_output = 0;
1184 nv_output->bus = pNv->dcb_table.entry[dcb_entry].bus;
1187 nv_output->type = OUTPUT_LVDS;
1188 /* comment below two lines to test LVDS under RandR12.
1189 * If your screen "blooms" or "bleeds" (i.e. has a developing
1190 * white / psychedelic pattern) then KILL X IMMEDIATELY
1191 * (ctrl+alt+backspace) & if the effect continues reset power */
1192 ErrorF("Output refused because we don't accept LVDS at the moment.\n");
1193 create_output = FALSE;
1195 nv_output->type = OUTPUT_TMDS;
1198 if (!create_output) {
1203 /* Delay creation of output until we are certain is desirable */
1205 output = xf86OutputCreate (pScrn, &nv_lvds_output_funcs, outputname);
1207 output = xf86OutputCreate (pScrn, &nv_tmds_output_funcs, outputname);
1211 output->driver_private = nv_output;
1213 if (pNv->fpScaler) /* GPU Scaling */
1214 nv_output->scaling_mode = SCALE_ASPECT;
1215 else /* Panel scaling */
1216 nv_output->scaling_mode = SCALE_PANEL;
1218 #ifdef RANDR_12_INTERFACE
1219 if (xf86GetOptValString(pNv->Options, OPTION_SCALING_MODE)) {
1220 nv_output->scaling_mode = nv_scaling_mode_lookup(xf86GetOptValString(pNv->Options, OPTION_SCALING_MODE), -1);
1221 if (nv_output->scaling_mode == SCALE_INVALID)
1222 nv_output->scaling_mode = SCALE_ASPECT; /* default */
1224 #endif /* RANDR_12_INTERFACE */
1226 /* Due to serious problems we have to restrict the crtc's for certain types of outputs. */
1227 /* This is a result of problems with G70 cards that have a dvi with ffs(or) == 1 */
1228 /* Anyone know what the solution for this is? */
1229 if (nv_output->preferred_output == 0) {
1230 output->possible_crtcs = (1 << 0);
1232 if (pNv->switchable_crtc) {
1233 output->possible_crtcs = pNv->dcb_table.entry[dcb_entry].heads;
1235 output->possible_crtcs = (1 << nv_output->preferred_output);
1239 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Adding output %s\n", outputname);
1242 void NvDCBSetupOutputs(ScrnInfoPtr pScrn)
1244 NVPtr pNv = NVPTR(pScrn);
1245 int i, type, i2c_count[0xf];
1247 pNv->switchable_crtc = FALSE;
1248 /* I was wrong, again. */
1249 if (pNv->NVArch > 0x11 && pNv->twoHeads)
1250 pNv->switchable_crtc = TRUE;
1252 memset(i2c_count, 0, sizeof(i2c_count));
1253 for (i = 0 ; i < pNv->dcb_table.entries; i++)
1254 i2c_count[pNv->dcb_table.entry[i].i2c_index]++;
1256 /* we setup the outputs up from the BIOS table */
1257 for (i = 0 ; i < pNv->dcb_table.entries; i++) {
1258 type = pNv->dcb_table.entry[i].type;
1260 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DCB type %d not known\n", type);
1264 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);
1268 nv_add_analog_output(pScrn, i, (i2c_count[pNv->dcb_table.entry[i].i2c_index] > 1));
1271 nv_add_digital_output(pScrn, i, 0);
1274 nv_add_digital_output(pScrn, i, 1);
1282 void NvSetupOutputs(ScrnInfoPtr pScrn)
1284 NVPtr pNv = NVPTR(pScrn);
1286 pNv->Television = FALSE;
1288 memset(pNv->pI2CBus, 0, sizeof(pNv->pI2CBus));
1289 NvDCBSetupOutputs(pScrn);
1292 /*************************************************************************** \
1294 |* Copyright 1993-2003 NVIDIA, Corporation. All rights reserved. *|
1296 |* NOTICE TO USER: The source code is copyrighted under U.S. and *|
1297 |* international laws. Users and possessors of this source code are *|
1298 |* hereby granted a nonexclusive, royalty-free copyright license to *|
1299 |* use this code in individual and commercial software. *|
1301 |* Any use of this source code must include, in the user documenta- *|
1302 |* tion and internal comments to the code, notices to the end user *|
1305 |* Copyright 1993-1999 NVIDIA, Corporation. All rights reserved. *|
1307 |* NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY *|
1308 |* OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" *|
1309 |* WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPOR- *|
1310 |* ATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE, *|
1311 |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE- *|
1312 |* MENT, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL *|
1313 |* NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCI- *|
1314 |* DENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RE- *|
1315 |* SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION *|
1316 |* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *|
1317 |* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
1319 |* U.S. Government End Users. This source code is a "commercial *|
1320 |* item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
1321 |* consisting of "commercial computer software" and "commercial *|
1322 |* computer software documentation," as such terms are used in *|
1323 |* 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Govern- *|
1324 |* ment only as a commercial end item. Consistent with 48 C.F.R. *|
1325 |* 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
1326 |* all U.S. Government End Users acquire the source code with only *|
1327 |* those rights set forth herein. *|
1329 \***************************************************************************/