1
0

Accepting request 333717 from home:eeich:branches:X11:XOrg

- u_DPMS-Query-DPMS-capabilites-and-query-current-state-before-changing.patch
  If the Xserver provides the VBEDPMSGetCapabilities() and VBEDPMSGet()
  API, check DPMS capabilities if a requested DPMS mode is supported before
  changing, and only change DPMS mode when the new state is different from 
  the old (bsc#947356, boo#947493).

OBS-URL: https://build.opensuse.org/request/show/333717
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xf86-video-vesa?expand=0&rev=19
This commit is contained in:
Stefan Dirsch 2015-09-25 12:04:20 +00:00 committed by Git OBS Bridge
parent 647e7ca986
commit c64aa455e4
3 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From: Egbert Eich <eich@suse.de>
Date: Thu Sep 24 19:42:38 2015 +0200
Subject: [PATCH]DPMS: Query DPMS capabilites and query current state before changing
Patch-mainline: to be upstreamed
References: bsc#947356
Signed-off-by: Egbert Eich <eich@suse.com>
There is a VBE call to query the DPMS capabilities and the current
state. If available use these calls to make sure to set only modes
which are available and not set the state that is currently active
already.
The latter works around a problem found on an Intel BIOS.
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/vesa.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/vesa.c b/src/vesa.c
index 44f93b2..983a5f5 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -1687,10 +1687,20 @@ VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode,
int flags)
{
VESAPtr pVesa = VESAGetRec(pScrn);
-
+#ifdef VBE_HAVE_DPMS_GET_CAPABILITIES
+ int val;
+#endif
if (!pScrn->vtSema)
return;
+#ifdef VBE_HAVE_DPMS_GET_CAPABILITIES
+ if (VBEDPMSGetCapabilities(pVesa->pVbe, &val) == FALSE ||
+ (val & (1 << mode)) == 0)
+ return;
+
+ if (VBEDPMSGet(pVesa->pVbe, &val) == TRUE && val == mode)
+ return;
+#endif
VBEDPMSSet(pVesa->pVbe, mode);
}

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Sep 25 10:22:26 UTC 2015 - eich@suse.com
- u_DPMS-Query-DPMS-capabilites-and-query-current-state-before-changing.patch
If the Xserver provides the VBEDPMSGetCapabilities() and VBEDPMSGet()
API, check DPMS capabilities if a requested DPMS mode is supported before
changing, and only change DPMS mode when the new state is different from
the old (bsc#947356, boo#947493).
-------------------------------------------------------------------
Thu Jun 18 07:58:09 UTC 2015 - zaitor@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package xf86-video-vesa
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -26,6 +26,7 @@ Url: http://xorg.freedesktop.org/
Source0: http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2
Patch0: u_Enable-DefaultRefresh-by-default.patch
Patch1: u_Restore-palette-on-LeaveVT.patch
Patch2: u_DPMS-Query-DPMS-capabilites-and-query-current-state-before-changing.patch
#PATCH-FIX-UPSTREAM U_mibstore.patch -- removes obsolete include
BuildRequires: pkg-config
BuildRequires: pkgconfig(fontsproto)
@ -42,6 +43,7 @@ Conflicts: xorg-x11-driver-video <= 7.6
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 s390x
%x11_abi_videodrv_req
%{?x11_abi_has_dpms_get_capabilities: %x11_abi_has_dpms_get_capabilities}
%description
vesa is an Xorg driver for Generic VESA video cards.
@ -54,6 +56,7 @@ supports depths 8, 15 16 and 24.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%configure