xf86-video-intel: Branch 'modesetting' - 3 commits - src/i830_randr.c src/i830_sdvo.c src/i830_xf86Crtc.c
Keith Packard
keithp at kemper.freedesktop.org
Fri Feb 2 07:32:11 EET 2007
src/i830_randr.c | 3 +++
src/i830_sdvo.c | 3 +--
src/i830_xf86Crtc.c | 48 +++++++++++++++++++++++++++++++++++++++---------
3 files changed, 43 insertions(+), 11 deletions(-)
New commits:
diff-tree 1dde7a15a3a42b881c57ece95feceffadf412cff (from parents)
Merge: 16f30b2e6c72e228c66946ff9efadd7278379745 1ba45a3fcd40aaf4d373447fb9f252ca053f9105
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Feb 1 21:31:27 2007 -0800
Merge branch 'modesetting-origin' into modesetting
diff-tree 16f30b2e6c72e228c66946ff9efadd7278379745 (from 9f0acf1eb01ad8320f4da4cc5e498af25c0ecc5e)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Feb 1 21:30:19 2007 -0800
Add "Ignore" option to per-output monitor, removes output from server.
Setting option "Ignore" "Yes" will cause the server to pretend as if the
specified output does not exist at all. It will not be listed by the
RandR1.2 extension, and the server will not attempt to detect monitors at
startup time.
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index ea62ad9..46a35f1 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1079,8 +1079,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
char *name_prefix;
char *name_suffix;
- output = xf86OutputCreate (pScrn, &i830_sdvo_output_funcs,
- "ADD2 PCIE card");
+ output = xf86OutputCreate (pScrn, &i830_sdvo_output_funcs,NULL);
if (!output)
return;
intel_output = xnfcalloc (sizeof (I830OutputPrivateRec) +
diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c
index a209914..0ea0ced 100644
--- a/src/i830_xf86Crtc.c
+++ b/src/i830_xf86Crtc.c
@@ -273,6 +273,7 @@ typedef enum {
OPTION_DISABLE,
OPTION_MIN_CLOCK,
OPTION_MAX_CLOCK,
+ OPTION_IGNORE,
} OutputOpts;
static OptionInfoRec xf86OutputOptions[] = {
@@ -286,6 +287,7 @@ static OptionInfoRec xf86OutputOptions[]
{OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE },
{OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE },
{OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE },
+ {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE },
{-1, NULL, OPTV_NONE, {0}, FALSE },
};
@@ -296,6 +298,9 @@ xf86OutputSetMonitor (xf86OutputPtr outp
static const char monitor_prefix[] = "monitor-";
char *monitor;
+ if (!output->name)
+ return;
+
if (output->options)
xfree (output->options);
@@ -332,6 +337,12 @@ xf86OutputEnabled (xf86OutputPtr outp
return TRUE;
}
+static Bool
+xf86OutputIgnored (xf86OutputPtr output)
+{
+ return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE);
+}
+
xf86OutputPtr
xf86OutputCreate (ScrnInfoPtr scrn,
const xf86OutputFuncsRec *funcs,
@@ -339,20 +350,37 @@ xf86OutputCreate (ScrnInfoPtr scrn,
{
xf86OutputPtr output, *outputs;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- int len = strlen (name);
+ int len;
+
+ if (name)
+ len = strlen (name) + 1;
+ else
+ len = 0;
- output = xcalloc (sizeof (xf86OutputRec) + len + 1, 1);
+ output = xcalloc (sizeof (xf86OutputRec) + len, 1);
if (!output)
return NULL;
output->scrn = scrn;
output->funcs = funcs;
- output->name = (char *) (output + 1);
+ if (name)
+ {
+ output->name = (char *) (output + 1);
+ strcpy (output->name, name);
+ }
output->subpixel_order = SubPixelUnknown;
- strcpy (output->name, name);
#ifdef RANDR_12_INTERFACE
output->randr_output = NULL;
#endif
- xf86OutputSetMonitor (output);
+ if (name)
+ {
+ xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ {
+ xfree (output);
+ return FALSE;
+ }
+ }
+
if (xf86_config->output)
outputs = xrealloc (xf86_config->output,
@@ -374,17 +402,19 @@ xf86OutputCreate (ScrnInfoPtr scrn,
Bool
xf86OutputRename (xf86OutputPtr output, const char *name)
{
- int len = strlen(name);
- char *newname = xalloc (len + 1);
+ int len = strlen(name) + 1;
+ char *newname = xalloc (len);
if (!newname)
return FALSE; /* so sorry... */
strcpy (newname, name);
- if (output->name != (char *) (output + 1))
+ if (output->name && output->name != (char *) (output + 1))
xfree (output->name);
output->name = newname;
xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ return FALSE;
return TRUE;
}
@@ -407,7 +437,7 @@ xf86OutputDestroy (xf86OutputPtr output)
xf86_config->num_output--;
break;
}
- if (output->name != (char *) (output + 1))
+ if (output->name && output->name != (char *) (output + 1))
xfree (output->name);
xfree (output);
}
diff-tree 9f0acf1eb01ad8320f4da4cc5e498af25c0ecc5e (from d6bc03c379c46842676f640b8edb13ea828bf20c)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Feb 1 15:44:18 2007 -0800
Check for rotation change in xf86RandR12CrtcSet.
xf86RandRCrtcSet was ignoring changes to only rotation, so the screen would
be left incorrectly rotated.
diff --git a/src/i830_randr.c b/src/i830_randr.c
index 5eccf4b..811fc50 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -608,6 +608,9 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
else if (mode && !xf86ModesEqual (&crtc->mode, mode))
changed = TRUE;
+ if (rotation != crtc->rotation)
+ changed = TRUE;
+
if (x != crtc->x || y != crtc->y)
changed = TRUE;
for (o = 0; o < config->num_output; o++)
More information about the xorg-commit
mailing list