xf86-video-ati: Branch 'master' - 2 commits
Alex Deucher
agd5f at kemper.freedesktop.org
Tue Mar 3 23:53:35 PST 2009
src/radeon_modes.c | 117 +++++++++++++++++++---------------------------------
src/radeon_output.c | 32 --------------
2 files changed, 44 insertions(+), 105 deletions(-)
New commits:
commit e88b0eac8cab8b54b769fd7b4ad3b3b65a90de09
Author: Alex Deucher <alexdeucher at gmail.com>
Date: Wed Mar 4 02:52:36 2009 -0500
radeon: just add some common modes for LVDS
avoids needing to hack around with the edid
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 0a8fa00..3545cdc 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -415,6 +415,56 @@ RADEONUpdatePanelSize(xf86OutputPtr output)
}
}
+static void
+radeon_add_common_modes(xf86OutputPtr output, DisplayModePtr modes)
+{
+ RADEONOutputPrivatePtr radeon_output = output->driver_private;
+ radeon_native_mode_ptr native_mode = &radeon_output->native_mode;
+ DisplayModePtr last = NULL;
+ DisplayModePtr new = NULL;
+ DisplayModePtr first = NULL;
+ int i;
+ /* Add some common sizes */
+ int widths[10] = {640, 800, 1024, 1280, 1280, 1440, 1400, 1680, 1600, 1920};
+ int heights[10] = {480, 600, 768, 960, 1024, 900, 1050, 1050, 1200, 1200};
+
+ for (i = 0; i < 10; i++) {
+ if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT)) {
+ /* already added the native mode */
+ if (widths[i] == native_mode->PanelXRes && heights[i] == native_mode->PanelYRes)
+ continue;
+
+ /* Note: We allow all non-standard modes as long as they do not
+ * exceed the native resolution of the panel. Since these modes
+ * need the internal RMX unit in the video chips (and there is
+ * only one per card), this will only apply to the primary head.
+ */
+ if (widths[i] < 320 || widths[i] > native_mode->PanelXRes ||
+ heights[i] < 200 || heights[i] > native_mode->PanelYRes)
+ continue;
+ }
+
+ new = xf86CVTMode(widths[i], heights[i], 60.0, FALSE, FALSE);
+
+ new->type = M_T_DRIVER;
+
+ 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;
+ }
+
+ xf86ModesAdd(modes, first);
+
+}
+
DisplayModePtr
RADEONProbeOutputModes(xf86OutputPtr output)
{
@@ -463,12 +513,16 @@ RADEONProbeOutputModes(xf86OutputPtr output)
if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT))
modes = RADEONFPNativeMode(output);
/* add the screen modes */
- RADEONAddScreenModes(output, &modes);
+ if (modes == NULL)
+ RADEONAddScreenModes(output, &modes);
}
}
}
}
+ if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT))
+ radeon_add_common_modes(output, modes);
+
return modes;
}
commit 2bb319fd80d20a3d4e5cc9416891bc7e4c3e431e
Author: Alex Deucher <alexdeucher at gmail.com>
Date: Wed Mar 4 02:50:45 2009 -0500
Revert "radeon: adjust LVDS so that default modes get added"
This reverts commit 1a2b16561d19ec9c027c562902f5fc086c856994.
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 662071b..0a8fa00 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -415,83 +415,6 @@ RADEONUpdatePanelSize(xf86OutputPtr output)
}
}
-static void fill_detailed_block(struct detailed_monitor_section *det_mon,
- DisplayModePtr mode)
-{
- struct detailed_timings *timing = &det_mon->section.d_timings;
- det_mon->type = DT;
- timing->clock = mode->Clock * 1000;
- timing->h_active = mode->HDisplay;
- timing->h_blanking = mode->HTotal - mode->HDisplay;
- timing->v_active = mode->VDisplay;
- timing->v_blanking = mode->VTotal - mode->VDisplay;
- timing->h_sync_off = mode->HSyncStart - mode->HDisplay;
- timing->h_sync_width = mode->HSyncEnd - mode->HSyncStart;
- timing->v_sync_off = mode->VSyncStart - mode->VDisplay;
- timing->v_sync_width = mode->VSyncEnd - mode->VSyncStart;
-
- if (mode->Flags & V_PVSYNC)
- timing->misc |= 0x02;
-
- if (mode->Flags & V_PHSYNC)
- timing->misc |= 0x01;
-}
-
-static void
-radeon_lvds_add_fake_edid(xf86OutputPtr output, DisplayModePtr mode)
-{
- ScrnInfoPtr pScrn = output->scrn;
- xf86MonPtr edid_mon = NULL;
-
- if (!output->MonInfo) {
- edid_mon = xcalloc (1, sizeof (xf86Monitor));
- if (edid_mon) {
- struct detailed_monitor_section *det_mon = edid_mon->det_mon;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adding fake EDID for LVDS\n");
-
- /*support DPM, instead of DPMS*/
- edid_mon->features.dpms |= 0x1;
- /*default support RGB color display*/
- edid_mon->features.display_type |= 0x1;
- /*default display support continuous-freqencey*/
- edid_mon->features.msc |= 0x1;
- /*default the EDID version is 1.4 */
- edid_mon->ver.version = 1;
- edid_mon->ver.revision = 4;
-
- if (mode) {
- /* now we construct new EDID monitor,
- * so filled one detailed timing block
- */
- fill_detailed_block(det_mon, mode);
- /* the filed timing block should be set preferred*/
- edid_mon->features.msc |= 0x2;
- det_mon = det_mon + 1;
- }
-
- /* Set wide sync ranges so we get all modes
- * handed to valid_mode for checking
- */
- det_mon->type = DS_RANGES;
- det_mon->section.ranges.min_v = 0;
- det_mon->section.ranges.max_v = 200;
- det_mon->section.ranges.min_h = 0;
- det_mon->section.ranges.max_h = 200;
-
- /* empty edid */
- edid_mon->rawData = xcalloc (1, 128);
-
- edid_mon->vendor.name[0] = 70;
- edid_mon->vendor.name[1] = 65;
- edid_mon->vendor.name[2] = 75;
- edid_mon->vendor.name[3] = 69;
-
- output->MonInfo = edid_mon;
- }
- }
-}
-
DisplayModePtr
RADEONProbeOutputModes(xf86OutputPtr output)
{
@@ -537,16 +460,10 @@ RADEONProbeOutputModes(xf86OutputPtr output)
}
}
if (modes == NULL) {
- if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT)) {
+ if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT))
modes = RADEONFPNativeMode(output);
- radeon_lvds_add_fake_edid(output, modes);
- xfree(modes);
- modes = xf86OutputGetEDIDModes (output);
- }
-
/* add the screen modes */
- if (modes == NULL)
- RADEONAddScreenModes(output, &modes);
+ RADEONAddScreenModes(output, &modes);
}
}
}
diff --git a/src/radeon_output.c b/src/radeon_output.c
index cded74b..6bbe9ab 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -208,37 +208,6 @@ radeon_set_active_device(xf86OutputPtr output)
}
}
-/* X Server pre-1.5 compatibility */
-#ifndef DS_VENDOR
-#define DS_VENDOR 0x101
-#endif
-
-static void radeon_fixup_edid_for_panel(xf86MonPtr edid_mon)
-{
- int i, j = -1;
-
- if (edid_mon) {
- /* mark it to support continous timing so we can add default modes */
- edid_mon->features.msc |= 0x1;
- for (i = 0; i < sizeof (edid_mon->det_mon) / sizeof (edid_mon->det_mon[0]); i++) {
- if (edid_mon->det_mon[i].type >= DS_VENDOR && j == -1)
- j = i;
- if (edid_mon->det_mon[i].type == DS_RANGES) {
- j = i;
- break;
- }
- }
- if (j != -1) {
- struct monitor_ranges *ranges = &edid_mon->det_mon[j].section.ranges;
- edid_mon->det_mon[j].type = DS_RANGES;
- ranges->min_v = 0;
- ranges->max_v = 200;
- ranges->min_h = 0;
- ranges->max_h = 200;
- }
- }
-}
-
static RADEONMonitorType
radeon_ddc_connected(xf86OutputPtr output)
{
@@ -273,7 +242,6 @@ radeon_ddc_connected(xf86OutputPtr output)
switch (radeon_output->ConnectorType) {
case CONNECTOR_LVDS:
MonType = MT_LCD;
- radeon_fixup_edid_for_panel(MonInfo);
break;
case CONNECTOR_DVI_D:
case CONNECTOR_HDMI_TYPE_A:
More information about the xorg-commit
mailing list