[PATCH xserver] : bug 106963 : change the DPMS initialization to be conditional on not set from config

Emil Velikov emil.l.velikov at gmail.com
Tue Jun 19 16:18:47 UTC 2018


Hi John,

On 19 June 2018 at 16:16, John Lumby <johnlumby at hotmail.com> wrote:
>
> --- xorg/xserver/Xext/dpms.c.orig       2018-06-16 18:54:24.520660890 -0400
> +++ xorg/xserver/Xext/dpms.c    2018-06-18 11:09:19.021529381 -0400
> @@ -45,9 +45,9 @@ Equipment Corporation.
>
>  CARD16 DPMSPowerLevel = 0;
>  Bool DPMSDisabledSwitch = FALSE;
> -CARD32 DPMSStandbyTime;
> -CARD32 DPMSSuspendTime;
> -CARD32 DPMSOffTime;
> +CARD32 DPMSStandbyTime = -1;
> +CARD32 DPMSSuspendTime = -1;
> +CARD32 DPMSOffTime = -1;
>  Bool DPMSEnabled;
>
>  Bool
> @@ -432,7 +432,15 @@ DPMSCloseDownExtension(ExtensionEntry *e
>  void
>  DPMSExtensionInit(void)
>  {
> -    DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime;
> +#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_)         \
> +    if (_timeout_value_ == -1) { /* not yet set from config */  \
> +        _timeout_value_ = ScreenSaverTime;                      \
> +    }
> +
> +    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSStandbyTime)
> +    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSSuspendTime)
> +    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSOffTime)
> +
>      DPMSPowerLevel = DPMSModeOn;
>      DPMSEnabled = DPMSSupported();

Functionality-wise the patch looks spot on. Can you please tweak the
formatting/commit message.
The specifics are listed here [1] although the gist is:
 - in the commit message explain why patch is needed - Otherwise any
user settings in xorg.conf will be discarded
 - use the full URL for bugzilla references - Fixes: https...
 - use git to manage/send patches - git send-email
--subject-prefix="PATCH xserver" --to=xorg-devel at lists.x.org ...

HTH
Emil

[1] https://www.x.org/wiki/Development/Documentation/SubmittingPatches/


More information about the xorg-devel mailing list