Re: [PATCH] xfree86: Add Option "PreferCloneMode"

2017-05-25 Thread Alex Deucher
On Thu, May 25, 2017 at 3:21 AM, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
> When the default behaviour was changed from clone mode to horizontal
> extended layout, a boolean ScrnInfoRec member preferClone was introduced
> to choose the old default behaviour. Option "PreferCloneMode" allows
> setting this preferClone member.
>
> Signed-off-by: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  hw/xfree86/man/xorg.conf.man | 5 +
>  hw/xfree86/modes/xf86Crtc.c  | 4 
>  2 files changed, 9 insertions(+)
>
> diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
> index 0c39062e6..ec8d07c65 100644
> --- a/hw/xfree86/man/xorg.conf.man
> +++ b/hw/xfree86/man/xorg.conf.man
> @@ -1495,6 +1495,11 @@ option.
>  .BI "Option \*qModeDebug\*q \*q" boolean \*q
>  Enable printing of additional debugging information about modesetting to
>  the server log.
> +.TP 7
> +.BI "Option \*qPreferCloneMode\*q \*q" boolean \*q
> +If enabled, bring up monitors of a screen in clone mode instead of horizontal
> +extended layout by default. (Defaults to off; the video driver can change the
> +default value, but this option can always override it)
>  .ig
>  .TP 7
>  This optional entry allows an IRQ number to be specified.
> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
> index 3f9857b4a..fa404d9d4 100644
> --- a/hw/xfree86/modes/xf86Crtc.c
> +++ b/hw/xfree86/modes/xf86Crtc.c
> @@ -469,10 +469,12 @@ static OptionInfoRec xf86OutputOptions[] = {
>
>  enum {
>  OPTION_MODEDEBUG,
> +OPTION_PREFER_CLONEMODE,
>  };
>
>  static OptionInfoRec xf86DeviceOptions[] = {
>  {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE},
> +{OPTION_PREFER_CLONEMODE, "PreferCloneMode", OPTV_BOOLEAN, {0}, FALSE},
>  {-1, NULL, OPTV_NONE, {0}, FALSE},
>  };
>
> @@ -2134,6 +2136,8 @@ xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr 
> config,
>  Bool has_tile = FALSE;
>  uint32_t configured_outputs;
>
> +xf86GetOptValBool(config->options, OPTION_PREFER_CLONEMODE,
> +  >preferClone);
>  if (scrn->preferClone)
>  return FALSE;
>
> --
> 2.11.0
>
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] xfree86: Add Option "PreferCloneMode"

2017-05-25 Thread Michel Dänzer
From: Michel Dänzer 

When the default behaviour was changed from clone mode to horizontal
extended layout, a boolean ScrnInfoRec member preferClone was introduced
to choose the old default behaviour. Option "PreferCloneMode" allows
setting this preferClone member.

Signed-off-by: Michel Dänzer 
---
 hw/xfree86/man/xorg.conf.man | 5 +
 hw/xfree86/modes/xf86Crtc.c  | 4 
 2 files changed, 9 insertions(+)

diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 0c39062e6..ec8d07c65 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -1495,6 +1495,11 @@ option.
 .BI "Option \*qModeDebug\*q \*q" boolean \*q
 Enable printing of additional debugging information about modesetting to
 the server log.
+.TP 7
+.BI "Option \*qPreferCloneMode\*q \*q" boolean \*q
+If enabled, bring up monitors of a screen in clone mode instead of horizontal
+extended layout by default. (Defaults to off; the video driver can change the
+default value, but this option can always override it)
 .ig
 .TP 7
 This optional entry allows an IRQ number to be specified.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3f9857b4a..fa404d9d4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -469,10 +469,12 @@ static OptionInfoRec xf86OutputOptions[] = {
 
 enum {
 OPTION_MODEDEBUG,
+OPTION_PREFER_CLONEMODE,
 };
 
 static OptionInfoRec xf86DeviceOptions[] = {
 {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE},
+{OPTION_PREFER_CLONEMODE, "PreferCloneMode", OPTV_BOOLEAN, {0}, FALSE},
 {-1, NULL, OPTV_NONE, {0}, FALSE},
 };
 
@@ -2134,6 +2136,8 @@ xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr 
config,
 Bool has_tile = FALSE;
 uint32_t configured_outputs;
 
+xf86GetOptValBool(config->options, OPTION_PREFER_CLONEMODE,
+  >preferClone);
 if (scrn->preferClone)
 return FALSE;
 
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel