xf86-video-ati: Branch 'randr-1.2' - 5 commits

Alex Deucher agd5f at kemper.freedesktop.org
Sun Aug 5 13:14:58 PDT 2007


 src/radeon.h        |    1 
 src/radeon_bios.c   |   15 +-
 src/radeon_output.c |  284 +++++++++++++++++++++++++++++++++++++++++++++-------
 src/radeon_probe.h  |    1 
 src/radeon_tv.c     |    2 
 5 files changed, 261 insertions(+), 42 deletions(-)

New commits:
diff-tree 3752808d6c08a9727370ef8d79088e787791e131 (from b4ec3e436afb5bc99ec755cbd96eee9a1ec492a5)
Author: Alex Deucher <alex at botch2.com>
Date:   Sun Aug 5 16:13:39 2007 -0400

    RADEON: Always set MonType in radeon_detect()
    
    - Always set the the MonType in radeon detect even if no
    monitor is detected so users can still force disconnected
    outputs on.  For DVI-I users will have to set the
    dvi_monitor_type attribute to force digital or analog,
    everything else should just work.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 1bbc73e..7a26d43 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1035,13 +1035,12 @@ radeon_detect(xf86OutputPtr output)
     ScrnInfoPtr	    pScrn = output->scrn;
     RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    Bool connected = TRUE;
 
-    /* assume tv is connected for now */
+    /* assume tv is disconnected for now */
     if (radeon_output->type == OUTPUT_STV) {
-	/*radeon_output->MonType = MT_STV;*/
 	radeon_output->MonType = MT_NONE;
     } else if (radeon_output->type == OUTPUT_CTV) {
-	/*radeon_output->MonType = MT_CTV;*/
 	radeon_output->MonType = MT_NONE;
     } else {
 	radeon_output->MonType = MT_UNKNOWN;
@@ -1050,25 +1049,36 @@ radeon_detect(xf86OutputPtr output)
 
     /* force montype based on output property */
     if (radeon_output->type == OUTPUT_DVI) {
+	if (radeon_output->MonType == MT_NONE)
+	    connected = FALSE;
 	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I_ATOM) ||
 	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I)) {
-	    if (radeon_output->MonType > MT_NONE) {
-		if (radeon_output->DVIType == DVI_ANALOG)
-		    radeon_output->MonType = MT_CRT;
-		else if (radeon_output->DVIType == DVI_DIGITAL)
-		    radeon_output->MonType = MT_DFP;
-	    }
+	    if (radeon_output->DVIType == DVI_ANALOG)
+		radeon_output->MonType = MT_CRT;
+	    else if (radeon_output->DVIType == DVI_DIGITAL)
+		radeon_output->MonType = MT_DFP;
 	}
     }
 
+    /* set montype so users can force outputs on even if detection fails */
+    if (radeon_output->MonType == MT_NONE) {
+	connected = FALSE;
+	if (radeon_output->type == OUTPUT_LVDS)
+	    radeon_output->MonType = MT_LCD;
+	else if (radeon_output->type == OUTPUT_VGA)
+            radeon_output->MonType = MT_CRT;
+	else if (radeon_output->type == OUTPUT_STV)
+            radeon_output->MonType = MT_STV;
+	else if (radeon_output->type == OUTPUT_CTV)
+            radeon_output->MonType = MT_CTV;
+	else if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_D_ATOM) ||
+		 (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_D))
+	    radeon_output->MonType = MT_DFP;
+    }
 
     if (radeon_output->MonType == MT_UNKNOWN) {
         output->subpixel_order = SubPixelUnknown;
 	return XF86OutputStatusUnknown;
-    }
-    else if (radeon_output->MonType == MT_NONE) {
-        output->subpixel_order = SubPixelUnknown;
-	return XF86OutputStatusDisconnected;
     } else {
 
       switch(radeon_output->MonType) {
@@ -1080,8 +1090,11 @@ radeon_detect(xf86OutputPtr output)
 	  output->subpixel_order = SubPixelNone;
 	  break;
       }
-      
-      return XF86OutputStatusConnected;
+
+      if (connected)
+	  return XF86OutputStatusConnected;
+      else
+	  return XF86OutputStatusDisconnected;
     }
 
 }
diff-tree b4ec3e436afb5bc99ec755cbd96eee9a1ec492a5 (from 1fc2a1120e7c05938e2bd72d3c7837ecff8bc9da)
Author: Alex Deucher <alex at botch2.com>
Date:   Sun Aug 5 15:37:04 2007 -0400

    RADEON: add tv out properties

diff --git a/src/radeon.h b/src/radeon.h
index 432ee89..a8f72fc 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -926,6 +926,7 @@ extern int RADEONValidateDDCModes(ScrnIn
 				  RADEONMonitorType DisplayType, int crtc2);
 extern int RADEONValidateFPModes(xf86OutputPtr output, char **ppModeName, DisplayModePtr *modeList);
 extern void RADEONSetPitch (ScrnInfoPtr pScrn);
+extern void RADEONUpdateHVPosition(xf86OutputPtr output, DisplayModePtr mode);
 
 DisplayModePtr
 RADEONProbeOutputModes(xf86OutputPtr output);
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 4556552..696fee4 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -550,34 +550,35 @@ Bool RADEONGetTVInfoFromBIOS (xf86Output
 	    if (RADEON_BIOS8(offset + 6) == 'T') {
 		switch (RADEON_BIOS8(offset + 7) & 0xf) {
 		case 1:
-		    radeon_output->tvStd = TV_STD_NTSC;
+		    radeon_output->default_tvStd = TV_STD_NTSC;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: NTSC\n");
 		    break;
 		case 2:
-		    radeon_output->tvStd = TV_STD_PAL;
+		    radeon_output->default_tvStd = TV_STD_PAL;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL\n");
 		    break;
 		case 3:
-		    radeon_output->tvStd = TV_STD_PAL_M;
+		    radeon_output->default_tvStd = TV_STD_PAL_M;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL-M\n");
 		    break;
 		case 4:
-		    radeon_output->tvStd = TV_STD_PAL_60;
+		    radeon_output->default_tvStd = TV_STD_PAL_60;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL-60\n");
 		    break;
 		case 5:
-		    radeon_output->tvStd = TV_STD_NTSC_J;
+		    radeon_output->default_tvStd = TV_STD_NTSC_J;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: NTSC-J\n");
 		    break;
 		case 6:
-		    radeon_output->tvStd = TV_STD_SCART_PAL;
+		    radeon_output->default_tvStd = TV_STD_SCART_PAL;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: SCART-PAL\n");
 		    break;
 		default:
-		    radeon_output->tvStd = TV_STD_NTSC;
+		    radeon_output->default_tvStd = TV_STD_NTSC;
 		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unknown TV standard; defaulting to NTSC\n");
 		    break;
 		}
+		radeon_output->tvStd = radeon_output->default_tvStd;
 
 		refclk = (RADEON_BIOS8(offset + 9) >> 2) & 0x3;
 		if (refclk == 0)
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 8a35556..1bbc73e 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1125,6 +1125,10 @@ radeon_set_backlight_level(xf86OutputPtr
 static Atom backlight_atom;
 static Atom rmx_atom;
 static Atom monitor_type_atom;
+static Atom tv_hsize_atom;
+static Atom tv_hpos_atom;
+static Atom tv_vpos_atom;
+static Atom tv_std_atom;
 #define RADEON_MAX_BACKLIGHT_LEVEL 255
 
 static void
@@ -1188,7 +1192,7 @@ radeon_create_resources(xf86OutputPtr ou
     if (radeon_output->type == OUTPUT_DVI) {
 	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I_ATOM) ||
 	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I)) {
-	    monitor_type_atom = MAKE_ATOM("monitor_type");
+	    monitor_type_atom = MAKE_ATOM("dvi_monitor_type");
 
 	    err = RRConfigureOutputProperty(output->randr_output, monitor_type_atom,
 					    FALSE, FALSE, FALSE, 0, NULL);
@@ -1197,7 +1201,6 @@ radeon_create_resources(xf86OutputPtr ou
 			   "RRConfigureOutputProperty error, %d\n", err);
 	    }
 	    /* Set the current value of the backlight property */
-	    radeon_output->DVIType = DVI_AUTO;
 	    s = "auto";
 	    err = RRChangeOutputProperty(output->randr_output, monitor_type_atom,
 					 XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
@@ -1209,6 +1212,92 @@ radeon_create_resources(xf86OutputPtr ou
 	}
     }
 
+    if (radeon_output->type == OUTPUT_STV ||
+	radeon_output->type == OUTPUT_CTV) {
+	tv_hsize_atom = MAKE_ATOM("tv_horizontal_size");
+
+	range[0] = -MAX_H_SIZE;
+	range[1] = MAX_H_SIZE;
+	err = RRConfigureOutputProperty(output->randr_output, tv_hsize_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	data = 0;
+	err = RRChangeOutputProperty(output->randr_output, tv_hsize_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+    if (radeon_output->type == OUTPUT_STV ||
+	radeon_output->type == OUTPUT_CTV) {
+	tv_hpos_atom = MAKE_ATOM("tv_horizontal_position");
+
+	range[0] = -MAX_H_POSITION;
+	range[1] = MAX_H_POSITION;
+	err = RRConfigureOutputProperty(output->randr_output, tv_hpos_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	data = 0;
+	err = RRChangeOutputProperty(output->randr_output, tv_hpos_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+    if (radeon_output->type == OUTPUT_STV ||
+	radeon_output->type == OUTPUT_CTV) {
+	tv_vpos_atom = MAKE_ATOM("tv_vertical_position");
+
+	range[0] = -MAX_V_POSITION;
+	range[1] = MAX_V_POSITION;
+	err = RRConfigureOutputProperty(output->randr_output, tv_vpos_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	data = 0;
+	err = RRChangeOutputProperty(output->randr_output, tv_vpos_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+    if (radeon_output->type == OUTPUT_STV ||
+	radeon_output->type == OUTPUT_CTV) {
+	tv_std_atom = MAKE_ATOM("tv_standard");
+
+	err = RRConfigureOutputProperty(output->randr_output, tv_std_atom,
+					FALSE, FALSE, FALSE, 0, NULL);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	/* Set the current value of the backlight property */
+	s = "default";
+	err = RRChangeOutputProperty(output->randr_output, tv_std_atom,
+				     XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
+				     FALSE, FALSE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
 }
 
 static Bool
@@ -1271,6 +1360,100 @@ radeon_set_property(xf86OutputPtr output
 	    return TRUE;
 	}
 	return FALSE;
+    } else if (property == tv_hsize_atom) {
+	if (value->type != XA_INTEGER ||
+	    value->format != 32 ||
+	    value->size != 1) {
+	    return FALSE;
+	}
+
+	val = *(INT32 *)value->data;
+	if (val < -MAX_H_SIZE || val > MAX_H_SIZE)
+	    return FALSE;
+
+	radeon_output->hSize = val;
+	/*RADEONUpdateHVPosition(output, NULL);*/
+	return TRUE;
+    } else if (property == tv_hpos_atom) {
+	if (value->type != XA_INTEGER ||
+	    value->format != 32 ||
+	    value->size != 1) {
+	    return FALSE;
+	}
+
+	val = *(INT32 *)value->data;
+	if (val < -MAX_H_POSITION || val > MAX_H_POSITION)
+	    return FALSE;
+
+	radeon_output->hPos = val;
+	/*RADEONUpdateHVPosition(output, NULL);*/
+	return TRUE;
+    } else if (property == tv_vpos_atom) {
+	if (value->type != XA_INTEGER ||
+	    value->format != 32 ||
+	    value->size != 1) {
+	    return FALSE;
+	}
+
+	val = *(INT32 *)value->data;
+	if (val < -MAX_H_POSITION || val > MAX_H_POSITION)
+	    return FALSE;
+
+	radeon_output->vPos = val;
+	/*RADEONUpdateHVPosition(output, NULL);*/
+	return TRUE;
+    } else if (property == tv_std_atom) {
+	const char *s;
+	if (value->type != XA_STRING || value->format != 8)
+	    return FALSE;
+	s = (char*)value->data;
+	if (value->size == strlen("default") && !strncmp("default", s, strlen("default"))) {
+	    radeon_output->tvStd = radeon_output->default_tvStd;
+	    return TRUE;
+	} else if (value->size == strlen("ntsc") && !strncmp("ntsc", s, strlen("ntsc"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_NTSC) {
+		radeon_output->tvStd = TV_STD_NTSC;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	} else if (value->size == strlen("pal") && !strncmp("pal", s, strlen("pal"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_PAL) {
+		radeon_output->tvStd = TV_STD_PAL;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	} else if (value->size == strlen("pal-m") && !strncmp("pal-m", s, strlen("pal-m"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_PAL_M) {
+		radeon_output->tvStd = TV_STD_PAL_M;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	} else if (value->size == strlen("pal-60") && !strncmp("pal-60", s, strlen("pal-60"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_PAL_60) {
+		radeon_output->tvStd = TV_STD_PAL_60;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	} else if (value->size == strlen("ntsc-j") && !strncmp("ntsc-j", s, strlen("ntsc-j"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_NTSC_J) {
+		radeon_output->tvStd = TV_STD_NTSC_J;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	} else if (value->size == strlen("scart-pal") && !strncmp("scart-pal", s, strlen("scart-pal"))) {
+	    if (radeon_output->SupportedTVStds & TV_STD_SCART_PAL) {
+		radeon_output->tvStd = TV_STD_SCART_PAL;
+		return TRUE;
+	    } else {
+		return FALSE;
+	    }
+	}
+	return FALSE;
     }
 
     return TRUE;
@@ -1667,6 +1850,7 @@ RADEONGetTVInfo(xf86OutputPtr output)
     if (RADEONGetTVInfoFromBIOS(output)) return;
 
     /* set some reasonable defaults */
+    radeon_output->default_tvStd = TV_STD_NTSC;
     radeon_output->tvStd = TV_STD_NTSC;
     radeon_output->TVRefClk = 27.000000000;
     radeon_output->SupportedTVStds = TV_STD_NTSC | TV_STD_PAL;
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 27b78cc..d79e7ad 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -197,6 +197,7 @@ typedef struct _RADEONOutputPrivateRec {
     int               DotClock;
     RADEONTMDSPll     tmds_pll[4];
     /* TV out */
+    TVStd             default_tvStd;
     TVStd             tvStd;
     int               hPos;
     int               vPos;
diff --git a/src/radeon_tv.c b/src/radeon_tv.c
index 3c12dfd..db5288a 100644
--- a/src/radeon_tv.c
+++ b/src/radeon_tv.c
@@ -556,7 +556,7 @@ void RADEONInitTVRegisters(xf86OutputPtr
 
 
 /* Set hw registers for a new h/v position & h size */
-static void RADEONUpdateHVPosition(xf86OutputPtr output, DisplayModePtr mode)
+void RADEONUpdateHVPosition(xf86OutputPtr output, DisplayModePtr mode)
 {
     ScrnInfoPtr pScrn = output->scrn;
     RADEONInfoPtr  info = RADEONPTR(pScrn);
diff-tree 1fc2a1120e7c05938e2bd72d3c7837ecff8bc9da (from 7d8eb3751d74bd8a1fb9fa2d2fcb9c4c895f6ba4)
Author: Alex Deucher <alex at botch2.com>
Date:   Sun Aug 5 14:41:57 2007 -0400

    RADEON: switch DVI-I monitor type attribute to string

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 9ac7d43..8a35556 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1188,22 +1188,20 @@ radeon_create_resources(xf86OutputPtr ou
     if (radeon_output->type == OUTPUT_DVI) {
 	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I_ATOM) ||
 	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I)) {
-	    monitor_type_atom = MAKE_ATOM("MONITORTYPE");
+	    monitor_type_atom = MAKE_ATOM("monitor_type");
 
-	    range[0] = DVI_AUTO;
-	    range[1] = DVI_ANALOG;
 	    err = RRConfigureOutputProperty(output->randr_output, monitor_type_atom,
-					    FALSE, TRUE, FALSE, 2, range);
+					    FALSE, FALSE, FALSE, 0, NULL);
 	    if (err != 0) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "RRConfigureOutputProperty error, %d\n", err);
 	    }
 	    /* Set the current value of the backlight property */
 	    radeon_output->DVIType = DVI_AUTO;
-	    data = DVI_AUTO;
+	    s = "auto";
 	    err = RRChangeOutputProperty(output->randr_output, monitor_type_atom,
-					 XA_INTEGER, 32, PropModeReplace, 1, &data,
-					 FALSE, TRUE);
+					 XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
+					 FALSE, FALSE);
 	    if (err != 0) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "RRChangeOutputProperty error, %d\n", err);
@@ -1258,17 +1256,21 @@ radeon_set_property(xf86OutputPtr output
 	    return FALSE;
 	}
     } else if (property == monitor_type_atom) {
-	if (value->type != XA_INTEGER ||
-	    value->format != 32 ||
-	    value->size != 1) {
+	const char *s;
+	if (value->type != XA_STRING || value->format != 8)
 	    return FALSE;
+	s = (char*)value->data;
+	if (value->size == strlen("auto") && !strncmp("auto", s, strlen("auto"))) {
+	    radeon_output->DVIType = DVI_AUTO;
+	    return TRUE;
+	} else if (value->size == strlen("analog") && !strncmp("analog", s, strlen("analog"))) {
+	    radeon_output->DVIType = DVI_ANALOG;
+	    return TRUE;
+	} else if (value->size == strlen("digital") && !strncmp("digital", s, strlen("digital"))) {
+	    radeon_output->DVIType = DVI_DIGITAL;
+	    return TRUE;
 	}
-
-	val = *(INT32 *)value->data;
-	if (val < DVI_AUTO || val > DVI_ANALOG)
-	    return FALSE;
-
-	radeon_output->DVIType = val;
+	return FALSE;
     }
 
     return TRUE;
diff-tree 7d8eb3751d74bd8a1fb9fa2d2fcb9c4c895f6ba4 (from e71bb88bc9052af8866fb6945dbc06dbb0e6d1c0)
Author: Alex Deucher <alex at botch2.com>
Date:   Sun Aug 5 14:31:18 2007 -0400

    RADEON: make backlight attribute lower case

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 31d8881..9ac7d43 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1139,7 +1139,7 @@ radeon_create_resources(xf86OutputPtr ou
 
     /* backlight control */
     if (radeon_output->type == OUTPUT_LVDS) {
-	backlight_atom = MAKE_ATOM("BACKLIGHT");
+	backlight_atom = MAKE_ATOM("backlight");
 
 	range[0] = 0;
 	range[1] = RADEON_MAX_BACKLIGHT_LEVEL;
diff-tree e71bb88bc9052af8866fb6945dbc06dbb0e6d1c0 (from 284323135ec04635dfa9cabd5790a35b953abca2)
Author: Alex Deucher <alex at botch2.com>
Date:   Sun Aug 5 14:26:15 2007 -0400

    RADEON: switch RMX attribute to string type
    
    Still not actually hooked up.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index a759452..31d8881 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1135,6 +1135,7 @@ radeon_create_resources(xf86OutputPtr ou
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     INT32 range[2];
     int data, err;
+    const char *s;
 
     /* backlight control */
     if (radeon_output->type == OUTPUT_LVDS) {
@@ -1161,23 +1162,22 @@ radeon_create_resources(xf86OutputPtr ou
     }
 
     /* RMX control - fullscreen, centered, keep ratio */
+    /* actually more of a crtc property as only crtc1 has rmx */
     if (radeon_output->type == OUTPUT_LVDS ||
 	radeon_output->type == OUTPUT_DVI) {
-	rmx_atom = MAKE_ATOM("PANELSCALER");
+	rmx_atom = MAKE_ATOM("scaler");
 
-	range[0] = 0;
-	range[1] = 2;
 	err = RRConfigureOutputProperty(output->randr_output, rmx_atom,
-					FALSE, TRUE, FALSE, 2, range);
+					FALSE, FALSE, FALSE, 0, NULL);
 	if (err != 0) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRConfigureOutputProperty error, %d\n", err);
 	}
 	/* Set the current value of the property */
-	data = 0;
+	s = "fill";
 	err = RRChangeOutputProperty(output->randr_output, rmx_atom,
-				     XA_INTEGER, 32, PropModeReplace, 1, &data,
-				     FALSE, TRUE);
+				     XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
+				     FALSE, FALSE);
 	if (err != 0) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRChangeOutputProperty error, %d\n", err);
@@ -1239,7 +1239,24 @@ radeon_set_property(xf86OutputPtr output
 	radeon_set_backlight_level(output, val);
 
     } else if (property == rmx_atom) {
-	return TRUE;
+	xf86CrtcPtr	crtc = output->crtc;
+	RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+	if (radeon_crtc->crtc_id == 0) {
+	    const char *s;
+	    if (value->type != XA_STRING || value->format != 8)
+		return FALSE;
+	    s = (char*)value->data;
+	    if (value->size == strlen("full") && !strncmp("full", s, strlen("full"))) {
+		return TRUE;
+	    } else if (value->size == strlen("aspect") && !strncmp("aspect", s, strlen("aspect"))) {
+		return TRUE;
+	    } else if (value->size == strlen("center") && !strncmp("center", s, strlen("center"))) {
+		return TRUE;
+	    }
+	    return FALSE;
+	} else {
+	    return FALSE;
+	}
     } else if (property == monitor_type_atom) {
 	if (value->type != XA_INTEGER ||
 	    value->format != 32 ||


More information about the xorg-commit mailing list