summaryrefslogtreecommitdiff
path: root/src/radeon_modes.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@samba.(none)>2008-01-02 19:48:28 -0500
committerAlex Deucher <alex@samba.(none)>2008-01-02 19:48:28 -0500
commit1accfdd590828e95e0d68a576c8ee05a06a86e43 (patch)
tree8f6b403f91b29b59285013e7fba009f5b699fb5e /src/radeon_modes.c
parentce34090c758ac91171cb6adb9b8a36e4adbf99cf (diff)
RADEON: various avivo tv-out related clean-ups
Diffstat (limited to 'src/radeon_modes.c')
-rw-r--r--src/radeon_modes.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index e7759936..099a5e90 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -80,7 +80,8 @@ void RADEONSetPitch (ScrnInfoPtr pScrn)
}
-static DisplayModePtr RADEONTVModes(xf86OutputPtr output)
+static DisplayModePtr
+RADEONTVModes(xf86OutputPtr output)
{
DisplayModePtr new = NULL;
@@ -91,6 +92,55 @@ static DisplayModePtr RADEONTVModes(xf86OutputPtr output)
return new;
}
+static DisplayModePtr
+RADEONATOMTVModes(xf86OutputPtr output)
+{
+ RADEONOutputPrivatePtr radeon_output = output->driver_private;
+ DisplayModePtr last = NULL;
+ DisplayModePtr new = NULL;
+ DisplayModePtr first = NULL;
+ int max_v, i;
+ /* Add some common sizes */
+ int widths[5] = {640, 720, 800, 848, 1024};
+
+ if (radeon_output->tvStd == TV_STD_NTSC ||
+ radeon_output->tvStd == TV_STD_NTSC_J ||
+ radeon_output->tvStd == TV_STD_PAL_M)
+ max_v = 480;
+ else
+ max_v = 600;
+
+ for (i = 0; i < 5; i++) {
+ new = xf86CVTMode(widths[i], max_v, 60.0, FALSE, FALSE);
+
+ new->type = M_T_DRIVER;
+
+ if (radeon_output->tvStd == TV_STD_NTSC ||
+ radeon_output->tvStd == TV_STD_NTSC_J ||
+ radeon_output->tvStd == TV_STD_PAL_M) {
+ if (widths[i] == 640)
+ new->type |= M_T_PREFERRED;
+ } else {
+ if (widths[i] == 800)
+ new->type |= M_T_PREFERRED;
+ }
+
+ new->next = NULL;
+ new->prev = last;
+
+ if (last) last->next = new;
+ last = new;
+ if (!first) first = new;
+ }
+
+ if (last) {
+ last->next = NULL; //first;
+ first->prev = NULL; //last;
+ }
+
+ return first;
+}
+
/* This is used only when no mode is specified for FP and no ddc is
* available. We force it to native mode, if possible.
*/
@@ -221,7 +271,10 @@ RADEONProbeOutputModes(xf86OutputPtr output)
if (output->status == XF86OutputStatusConnected) {
if (OUTPUT_IS_TV) {
- modes = RADEONTVModes(output);
+ if (IS_AVIVO_VARIANT)
+ modes = RADEONATOMTVModes(output);
+ else
+ modes = RADEONTVModes(output);
} else if (radeon_output->type == OUTPUT_CV) {
atomBiosResult = RHDAtomBiosFunc(pScrn->scrnIndex, info->atomBIOS,
ATOMBIOS_GET_CV_MODES, &atomBiosArg);