Subversion Repositories Kolibri OS

Rev

Rev 1404 | Rev 2997 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1404 Rev 1963
Line 55... Line 55...
55
/* tv pll setting for 14 mhz ref clk */
55
/* tv pll setting for 14 mhz ref clk */
56
#define NTSC_TV_PLL_M_14 33
56
#define NTSC_TV_PLL_M_14 33
57
#define NTSC_TV_PLL_N_14 693
57
#define NTSC_TV_PLL_N_14 693
58
#define NTSC_TV_PLL_P_14 7
58
#define NTSC_TV_PLL_P_14 7
Line -... Line 59...
-
 
59
 
-
 
60
#define PAL_TV_PLL_M_14 19
-
 
61
#define PAL_TV_PLL_N_14 353
-
 
62
#define PAL_TV_PLL_P_14 5
59
 
63
 
60
#define VERT_LEAD_IN_LINES 2
64
#define VERT_LEAD_IN_LINES 2
61
#define FRAC_BITS 0xe
65
#define FRAC_BITS 0xe
Line 62... Line 66...
62
#define FRAC_MASK 0x3fff
66
#define FRAC_MASK 0x3fff
Line 206... Line 210...
206
		347,                /* crtcPLL_N */
210
		347,                /* crtcPLL_N */
207
		14,                 /* crtcPLL_M */
211
		14,                 /* crtcPLL_M */
208
			8,                  /* crtcPLL_postDiv */
212
			8,                  /* crtcPLL_postDiv */
209
		1022,               /* pixToTV */
213
		1022,               /* pixToTV */
210
	},
214
	},
-
 
215
	{ /* PAL timing for 14 Mhz ref clk */
-
 
216
		800,                /* horResolution */
-
 
217
		600,                /* verResolution */
-
 
218
		TV_STD_PAL,         /* standard */
-
 
219
		1131,               /* horTotal */
-
 
220
		742,                /* verTotal */
-
 
221
		813,                /* horStart */
-
 
222
		840,                /* horSyncStart */
-
 
223
		633,                /* verSyncStart */
-
 
224
		708369,             /* defRestart */
-
 
225
		211,                /* crtcPLL_N */
-
 
226
		9,                  /* crtcPLL_M */
-
 
227
		8,                  /* crtcPLL_postDiv */
-
 
228
		759,                /* pixToTV */
-
 
229
	},
211
};
230
};
Line 212... Line 231...
212
 
231
 
Line 213... Line 232...
213
#define N_AVAILABLE_MODES ARRAY_SIZE(available_tv_modes)
232
#define N_AVAILABLE_MODES ARRAY_SIZE(available_tv_modes)
Line 240... Line 259...
240
			const_ptr = &available_tv_modes[2];
259
			const_ptr = &available_tv_modes[2];
241
	} else {
260
	} else {
242
		if (pll->reference_freq == 2700)
261
		if (pll->reference_freq == 2700)
243
			const_ptr = &available_tv_modes[1];
262
			const_ptr = &available_tv_modes[1];
244
		else
263
		else
245
			const_ptr = &available_tv_modes[1]; /* FIX ME */
264
			const_ptr = &available_tv_modes[3];
246
	}
265
	}
247
	return const_ptr;
266
	return const_ptr;
248
}
267
}
Line 249... Line 268...
249
 
268
 
Line 475... Line 494...
475
	else
494
	else
476
		v_offset = ((int)(v_total * h_total) * 2 * tv_dac->v_pos) / (int)(PAL_TV_LINES_PER_FRAME);
495
		v_offset = ((int)(v_total * h_total) * 2 * tv_dac->v_pos) / (int)(PAL_TV_LINES_PER_FRAME);
Line 477... Line 496...
477
 
496
 
Line 478... Line 497...
478
	restart -= v_offset + h_offset;
497
	restart -= v_offset + h_offset;
479
 
498
 
Line 480... Line 499...
480
	DRM_DEBUG("compute_restarts: def = %u h = %d v = %d, p1 = %04x, p2 = %04x, restart = %d\n",
499
	DRM_DEBUG_KMS("compute_restarts: def = %u h = %d v = %d, p1 = %04x, p2 = %04x, restart = %d\n",
481
		  const_ptr->def_restart, tv_dac->h_pos, tv_dac->v_pos, p1, p2, restart);
500
		  const_ptr->def_restart, tv_dac->h_pos, tv_dac->v_pos, p1, p2, restart);
482
 
501
 
483
	tv_dac->tv.hrestart = restart % h_total;
502
	tv_dac->tv.hrestart = restart % h_total;
484
	restart /= h_total;
503
	restart /= h_total;
Line 485... Line 504...
485
	tv_dac->tv.vrestart = restart % v_total;
504
	tv_dac->tv.vrestart = restart % v_total;
486
	restart /= v_total;
505
	restart /= v_total;
487
	tv_dac->tv.frestart = restart % f_total;
506
	tv_dac->tv.frestart = restart % f_total;
488
 
507
 
Line 489... Line 508...
489
	DRM_DEBUG("compute_restart: F/H/V=%u,%u,%u\n",
508
	DRM_DEBUG_KMS("compute_restart: F/H/V=%u,%u,%u\n",
Line 502... Line 521...
502
			      (tv_dac->h_size * (int)(PAL_TV_H_SIZE_UNIT) + (int)(PAL_TV_ZERO_H_SIZE)));
521
			      (tv_dac->h_size * (int)(PAL_TV_H_SIZE_UNIT) + (int)(PAL_TV_ZERO_H_SIZE)));
Line 503... Line 522...
503
 
522
 
504
	tv_dac->tv.timing_cntl = (tv_dac->tv.timing_cntl & ~RADEON_H_INC_MASK) |
523
	tv_dac->tv.timing_cntl = (tv_dac->tv.timing_cntl & ~RADEON_H_INC_MASK) |
Line 505... Line 524...
505
		((u32)h_inc << RADEON_H_INC_SHIFT);
524
		((u32)h_inc << RADEON_H_INC_SHIFT);
Line 506... Line 525...
506
 
525
 
507
	DRM_DEBUG("compute_restart: h_size = %d h_inc = %d\n", tv_dac->h_size, h_inc);
526
	DRM_DEBUG_KMS("compute_restart: h_size = %d h_inc = %d\n", tv_dac->h_size, h_inc);
Line 508... Line 527...
508
 
527
 
Line 621... Line 640...
621
	} else {
640
	} else {
622
		tmp /= PAL_TV_LINES_PER_FRAME;
641
		tmp /= PAL_TV_LINES_PER_FRAME;
623
	}
642
	}
624
	flicker_removal = (tmp + 500) / 1000;
643
	flicker_removal = (tmp + 500) / 1000;
Line 625... Line 644...
625
 
644
 
626
	if (flicker_removal < 2)
645
	if (flicker_removal < 3)
627
		flicker_removal = 2;
646
		flicker_removal = 3;
628
	for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) {
647
	for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) {
629
		if (flicker_removal == SLOPE_limit[i])
648
		if (flicker_removal == SLOPE_limit[i])
630
			break;
649
			break;
Line 683... Line 702...
683
		if (pll_ref_freq == 2700) {
702
		if (pll_ref_freq == 2700) {
684
			m = PAL_TV_PLL_M_27;
703
			m = PAL_TV_PLL_M_27;
685
			n = PAL_TV_PLL_N_27;
704
			n = PAL_TV_PLL_N_27;
686
			p = PAL_TV_PLL_P_27;
705
			p = PAL_TV_PLL_P_27;
687
		} else {
706
		} else {
688
			m = PAL_TV_PLL_M_27;
707
			m = PAL_TV_PLL_M_14;
689
			n = PAL_TV_PLL_N_27;
708
			n = PAL_TV_PLL_N_14;
690
			p = PAL_TV_PLL_P_27;
709
			p = PAL_TV_PLL_P_14;
691
		}
710
		}
692
	}
711
	}
Line 693... Line 712...
693
 
712
 
694
	tv_pll_cntl = (m & RADEON_TV_M0LO_MASK) |
713
	tv_pll_cntl = (m & RADEON_TV_M0LO_MASK) |