Use default screen monitor for one of the outputs.
By default, use the screen monitor section for output 0, however, a driver can change which output gets the screen monitor by calling xf86OutputUseScreenMonitor. (cherry picked from commit f4a8e54caf6b9431711383a39f55a18e7fd654f4)
This commit is contained in:
parent
97a2c2579c
commit
c41e3bd713
|
@ -414,10 +414,25 @@ xf86OutputSetMonitor (xf86OutputPtr output)
|
||||||
xfree (option_name);
|
xfree (option_name);
|
||||||
output->conf_monitor = xf86findMonitor (monitor,
|
output->conf_monitor = xf86findMonitor (monitor,
|
||||||
xf86configptr->conf_monitor_lst);
|
xf86configptr->conf_monitor_lst);
|
||||||
|
/*
|
||||||
|
* Find the monitor section of the screen and use that
|
||||||
|
*/
|
||||||
|
if (!output->conf_monitor && output->use_screen_monitor)
|
||||||
|
output->conf_monitor = xf86findMonitor (output->scrn->monitor->id,
|
||||||
|
xf86configptr->conf_monitor_lst);
|
||||||
if (output->conf_monitor)
|
if (output->conf_monitor)
|
||||||
|
{
|
||||||
|
xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
|
||||||
|
"Output %s using monitor section %s\n",
|
||||||
|
output->name, output->conf_monitor->mon_identifier);
|
||||||
xf86ProcessOptions (output->scrn->scrnIndex,
|
xf86ProcessOptions (output->scrn->scrnIndex,
|
||||||
output->conf_monitor->mon_option_lst,
|
output->conf_monitor->mon_option_lst,
|
||||||
output->options);
|
output->options);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
|
||||||
|
"Output %s has no monitor section\n",
|
||||||
|
output->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -463,7 +478,7 @@ xf86OutputInitialRotation (xf86OutputPtr output)
|
||||||
|
|
||||||
xf86OutputPtr
|
xf86OutputPtr
|
||||||
xf86OutputCreate (ScrnInfoPtr scrn,
|
xf86OutputCreate (ScrnInfoPtr scrn,
|
||||||
const xf86OutputFuncsRec *funcs,
|
const xf86OutputFuncsRec *funcs,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
xf86OutputPtr output, *outputs;
|
xf86OutputPtr output, *outputs;
|
||||||
|
@ -486,6 +501,10 @@ xf86OutputCreate (ScrnInfoPtr scrn,
|
||||||
strcpy (output->name, name);
|
strcpy (output->name, name);
|
||||||
}
|
}
|
||||||
output->subpixel_order = SubPixelUnknown;
|
output->subpixel_order = SubPixelUnknown;
|
||||||
|
/*
|
||||||
|
* Use the old per-screen monitor section for the first output
|
||||||
|
*/
|
||||||
|
output->use_screen_monitor = (xf86_config->num_output == 0);
|
||||||
#ifdef RANDR_12_INTERFACE
|
#ifdef RANDR_12_INTERFACE
|
||||||
output->randr_output = NULL;
|
output->randr_output = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -536,6 +555,16 @@ xf86OutputRename (xf86OutputPtr output, const char *name)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor)
|
||||||
|
{
|
||||||
|
if (use_screen_monitor != output->use_screen_monitor)
|
||||||
|
{
|
||||||
|
output->use_screen_monitor = use_screen_monitor;
|
||||||
|
xf86OutputSetMonitor (output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86OutputDestroy (xf86OutputPtr output)
|
xf86OutputDestroy (xf86OutputPtr output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -479,6 +479,9 @@ struct _xf86Output {
|
||||||
/** driver private information */
|
/** driver private information */
|
||||||
void *driver_private;
|
void *driver_private;
|
||||||
|
|
||||||
|
/** Whether to use the old per-screen Monitor config section */
|
||||||
|
Bool use_screen_monitor;
|
||||||
|
|
||||||
#ifdef RANDR_12_INTERFACE
|
#ifdef RANDR_12_INTERFACE
|
||||||
/**
|
/**
|
||||||
* RandR 1.2 output structure.
|
* RandR 1.2 output structure.
|
||||||
|
@ -618,9 +621,12 @@ xf86CrtcInUse (xf86CrtcPtr crtc);
|
||||||
* Output functions
|
* Output functions
|
||||||
*/
|
*/
|
||||||
xf86OutputPtr
|
xf86OutputPtr
|
||||||
xf86OutputCreate (ScrnInfoPtr scrn,
|
xf86OutputCreate (ScrnInfoPtr scrn,
|
||||||
const xf86OutputFuncsRec *funcs,
|
const xf86OutputFuncsRec *funcs,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
|
void
|
||||||
|
xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xf86OutputRename (xf86OutputPtr output, const char *name);
|
xf86OutputRename (xf86OutputPtr output, const char *name);
|
||||||
|
|
Loading…
Reference in New Issue