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

Alex Deucher agd5f at kemper.freedesktop.org
Wed May 23 18:38:09 PDT 2007


 src/radeon.h         |    3 +
 src/radeon_crtc.c    |    1 
 src/radeon_display.c |   19 +++++----
 src/radeon_output.c  |  106 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/radeon_video.c   |    2 
 5 files changed, 120 insertions(+), 11 deletions(-)

New commits:
diff-tree abb9b57e7b4162ab6c21fd1e809d24f13f7e1ea1 (from 679236defd28bea8874004377436347950ff7bec)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Wed May 23 21:37:58 2007 -0400

    RADEON: clean up some logic

diff --git a/src/radeon_display.c b/src/radeon_display.c
index 76affcb..3bbf371 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -568,14 +568,17 @@ RADEONMonitorType RADEONDisplayDDCConnec
 	   ~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1));
 
     if (*MonInfo) {
-	/* if it's digital */
-	if ((*MonInfo)->rawData[0x14] & 0x80) {
-	    if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_LVDS_ATOM) ||
-		radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)
-		MonType = MT_LCD;
-	    else
-		MonType = MT_DFP;
-	} else MonType = MT_CRT;
+	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_LVDS_ATOM) ||
+	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)) {
+	    MonType = MT_LCD;
+	} else if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_D_ATOM) ||
+		 (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_D)) {
+	    MonType = MT_DFP;
+	} else if ((*MonInfo)->rawData[0x14] & 0x80) {	/* if it's digital */
+	    MonType = MT_DFP;
+	} else {
+	    MonType = MT_CRT;
+	}
     } else MonType = MT_NONE;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
diff --git a/src/radeon_output.c b/src/radeon_output.c
index ce743c5..e45690b 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -191,7 +191,7 @@ static RADEONMonitorType RADEONPortCheck
 
     if (info->IsMobility) {
         if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_LVDS_ATOM) ||
-	     radeon_output->ConnectorType == CONNECTOR_PROPRIETARY) {
+	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)) {
 	     if (INREG(RADEON_BIOS_4_SCRATCH) & 4)
 	         MonType =  MT_LCD;
         }
diff-tree 679236defd28bea8874004377436347950ff7bec (from e38cad5633c974467f6417051eda8d487ac3686e)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Wed May 23 21:18:40 2007 -0400

    RADEON: add output properties (not functional yet)

diff --git a/src/radeon.h b/src/radeon.h
index 75dd234..fcbae2a 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -78,6 +78,7 @@
 #endif
 
 #include "xf86Crtc.h"
+#include "X11/Xatom.h"
 
 				/* Render support */
 #ifdef RENDER
@@ -174,6 +175,8 @@ do {									\
 #define RADEONTRACE(x) do { } while(0)
 #endif
 
+/* for Xv, outputs */
+#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
 
 /* Other macros */
 #define RADEON_ARRAY_SIZE(x)  (sizeof(x)/sizeof(x[0]))
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index c24be8f..638bdd0 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -279,7 +279,6 @@ static const xf86CrtcFuncsRec radeon_crt
     .set_cursor_position = radeon_crtc_set_cursor_position,
     .show_cursor = radeon_crtc_show_cursor,
     .hide_cursor = radeon_crtc_hide_cursor,
-/*    .load_cursor_image = i830_crtc_load_cursor_image, */
     .load_cursor_argb = radeon_crtc_load_cursor_argb,
     .destroy = NULL, /* XXX */
 };
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 7fb5fb7..ce743c5 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -373,7 +373,110 @@ radeon_destroy (xf86OutputPtr output)
         xfree(output->driver_private);
 }
 
+static Atom backlight_atom;
+static Atom rmx_atom;
+static Atom monitor_type_atom;
+
+static void
+radeon_create_resources(xf86OutputPtr output)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    INT32 range[2];
+    int data, err;
+
+    /* backlight control */
+    if (radeon_output->type == OUTPUT_LVDS) {
+	backlight_atom = MAKE_ATOM("BACKLIGHT");
+
+	range[0] = 0;
+	range[1] = 255; // i830_lvds_get_max_backlight(pScrn);
+	err = RRConfigureOutputProperty(output->randr_output, backlight_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	/* Set the current value of the backlight property */
+	data = 127; //pI830->backlight_duty_cycle;
+	err = RRChangeOutputProperty(output->randr_output, backlight_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+    /* RMX control - fullscreen, centered, keep ratio */
+    if (radeon_output->type == OUTPUT_LVDS ||
+	radeon_output->type == OUTPUT_DVI) {
+	rmx_atom = MAKE_ATOM("PANELSCALER");
+
+	range[0] = 0;
+	range[1] = 2; // i830_lvds_get_max_backlight(pScrn);
+	err = RRConfigureOutputProperty(output->randr_output, rmx_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	/* Set the current value of the backlight property */
+	data = 0; //pI830->backlight_duty_cycle;
+	err = RRChangeOutputProperty(output->randr_output, rmx_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+    /* force analog/digital for DVI-I ports */
+    /* FIXME: make sure this is DVI-I */
+    if (radeon_output->type == OUTPUT_DVI) {
+	monitor_type_atom = MAKE_ATOM("MONITORTYPE");
+
+	range[0] = 0;
+	range[1] = 1; // i830_lvds_get_max_backlight(pScrn);
+	err = RRConfigureOutputProperty(output->randr_output, monitor_type_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+	/* Set the current value of the backlight property */
+	data = 0; //pI830->backlight_duty_cycle;
+	err = RRChangeOutputProperty(output->randr_output, monitor_type_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
+}
+
+static Bool
+radeon_set_property(xf86OutputPtr output, Atom property,
+		       RRPropertyValuePtr value)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+
+    if (property == backlight_atom) {
+	return TRUE;
+    } else if (property == rmx_atom) {
+	return TRUE;
+    } else if (property == monitor_type_atom) {
+	return TRUE;
+    }
+
+    return TRUE;
+}
+
 static const xf86OutputFuncsRec radeon_output_funcs = {
+    .create_resources = radeon_create_resources,
     .dpms = radeon_dpms,
     .save = radeon_save,
     .restore = radeon_restore,
@@ -384,6 +487,7 @@ static const xf86OutputFuncsRec radeon_o
     .commit = radeon_mode_commit,
     .detect = radeon_detect,
     .get_modes = radeon_get_modes,
+    .set_property = radeon_set_property,
     .destroy = radeon_destroy
 };
 
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 6d085cc..5510d7b 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -99,7 +99,7 @@ static void RADEON_TDA9885_SetEncoding(R
 static void RADEON_FI1236_SetEncoding(RADEONPortPrivPtr pPriv);
 
 
-#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
+
 #define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v))
 
 static Atom xvBrightness, xvColorKey, xvSaturation, xvDoubleBuffer;


More information about the xorg-commit mailing list