I have a platform running Windows CE 6.0 and am having some problems
having the Display Stay on (it is turning off automatically when I
don't want it to.)

We basically do not want any idle or inactivity timers to be used by
the Power Manager with regards to the display, we only wish for it to
change power states via requests from Applications and due to Sleep
and Sleep Resume.

We have three (3) drivers in use, a Display Driver, Backlight Driver
and Battery Driver.

The Display Driver starts up in D0, after being left idle the Power
Manager sets the Display Driver into D1 followed by D4.

The Backlight Driver is staying on as expected.

I installed a stub battery driver (from public tree) that should set
the Power Source as AC Line Online with a Battery State of full. I
originally thought that maybe having the Battery Support in (without
an actual battery driver) may be causing a problem (as the default
power state was battery scheme.) Adding in this battery driver has
the default power state as AC Scheme but there is unfortunately no
change to how the driver behaves.

Via the Control Panel:
Power Scheme says AC Power and Switch to User Idle, System Idle and
Suspend all say never.

Display Backlight has two checkboxes "Automatically turn off backlight
while on battery power" and "Automatically turn off backlight while on
external power" and neither of these are actually checked.

My Registry:
[HKEY_LOCAL_MACHINE\System\GDI\ROTATION]
"Angle"=dword:00

[HKEY_LOCAL_MACHINE\Drivers\Display\LCDC]
"DisplayPowerClass"=multi_sz:"{EB91C7C9-8BF6-4a2d-9AB8-69724EED97D1}"
"Width"=dword:280 ; 640
"Height"=dword:1E0 ; 480
"Bpp"=dword:10 ; 16bpp
"VRAMWidthInPixel"=dword:400
"VRAMHeightInPixel"=dword:1000
"VRAMaddress"=dword:23c00000
"VRAMBusWidth"=dword:20
"UpperMargin"=dword:21
"LowerMargin"=dword:A
"LeftMargin"=dword:2D
"RightMargin"=dword:11
"Vsync"=dword:1
"Hsync"=dword:5F
"PixelClock"=dword:17D7840

[HKEY_LOCAL_MACHINE\system\gdi\monitors]
"TOTAL MONITORS"=dword:1

[HKEY_LOCAL_MACHINE\System\GDI\Drivers]
"Display"="Display_DDI.dll"

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power]
"BattPowerOff"=dword:0
"ExtPowerOff"=dword:0
"WakeupPowerOff"=dword:0
"ScreenPowerOff"=dword:0

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\Timeouts]
"ACUserIdle"=dword:0
"ACSystemIdle"=dword:0
"ACSuspend"=dword:0
"BattUserIdle"=dword:0
"BattSystemIdle"=dword:0
"BattSuspend"=dword:0

[HKEY_CURRENT_USER\ControlPanel\Backlight]
"BatteryTimeout"=dword:0
"ACTimeout"=dword:0
"UseExt"=dword:0
"UseBattery"=dword:0

Thank you,
Brad.

Re: Problems Disabling Automatic Screen Off for Display Driver. by Michel

Michel
Thu Apr 24 03:04:07 PDT 2008

Set the PM debugzones all on and show us some debug output around the
time the backlight turns off.

As far as the registry settings go the PM should do nothing, so I
suspect something else is going on...

Did you get these registry settings from the device (using remote
registry editor) or from platform.reg or from reginit.ini?


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Bradley Remedios wrote:
> I have a platform running Windows CE 6.0 and am having some problems
> having the Display Stay on (it is turning off automatically when I
> don't want it to.)
>
> We basically do not want any idle or inactivity timers to be used by
> the Power Manager with regards to the display, we only wish for it to
> change power states via requests from Applications and due to Sleep
> and Sleep Resume.
>
> We have three (3) drivers in use, a Display Driver, Backlight Driver
> and Battery Driver.
>
> The Display Driver starts up in D0, after being left idle the Power
> Manager sets the Display Driver into D1 followed by D4.
>
> The Backlight Driver is staying on as expected.
>
> I installed a stub battery driver (from public tree) that should set
> the Power Source as AC Line Online with a Battery State of full. I
> originally thought that maybe having the Battery Support in (without
> an actual battery driver) may be causing a problem (as the default
> power state was battery scheme.) Adding in this battery driver has
> the default power state as AC Scheme but there is unfortunately no
> change to how the driver behaves.
>
> Via the Control Panel:
> Power Scheme says AC Power and Switch to User Idle, System Idle and
> Suspend all say never.
>
> Display Backlight has two checkboxes "Automatically turn off backlight
> while on battery power" and "Automatically turn off backlight while on
> external power" and neither of these are actually checked.
>
> My Registry:
> [HKEY_LOCAL_MACHINE\System\GDI\ROTATION]
> "Angle"=dword:00
>
> [HKEY_LOCAL_MACHINE\Drivers\Display\LCDC]
> "DisplayPowerClass"=multi_sz:"{EB91C7C9-8BF6-4a2d-9AB8-69724EED97D1}"
> "Width"=dword:280 ; 640
> "Height"=dword:1E0 ; 480
> "Bpp"=dword:10 ; 16bpp
> "VRAMWidthInPixel"=dword:400
> "VRAMHeightInPixel"=dword:1000
> "VRAMaddress"=dword:23c00000
> "VRAMBusWidth"=dword:20
> "UpperMargin"=dword:21
> "LowerMargin"=dword:A
> "LeftMargin"=dword:2D
> "RightMargin"=dword:11
> "Vsync"=dword:1
> "Hsync"=dword:5F
> "PixelClock"=dword:17D7840
>
> [HKEY_LOCAL_MACHINE\system\gdi\monitors]
> "TOTAL MONITORS"=dword:1
>
> [HKEY_LOCAL_MACHINE\System\GDI\Drivers]
> "Display"="Display_DDI.dll"
>
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power]
> "BattPowerOff"=dword:0
> "ExtPowerOff"=dword:0
> "WakeupPowerOff"=dword:0
> "ScreenPowerOff"=dword:0
>
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\Timeouts]
> "ACUserIdle"=dword:0
> "ACSystemIdle"=dword:0
> "ACSuspend"=dword:0
> "BattUserIdle"=dword:0
> "BattSystemIdle"=dword:0
> "BattSuspend"=dword:0
>
> [HKEY_CURRENT_USER\ControlPanel\Backlight]
> "BatteryTimeout"=dword:0
> "ACTimeout"=dword:0
> "UseExt"=dword:0
> "UseBattery"=dword:0
>
> Thank you,
> Brad.

Re: Problems Disabling Automatic Screen Off for Display Driver. by Bradley

Bradley
Thu Apr 24 14:18:13 PDT 2008

On Apr 24, 3:04 am, "Michel Verhagen (eMVP)" <mic...@nospam.box>
wrote:
> Set the PM debugzones all on and show us some debug output around the
> time the backlight turns off.

Is doing dpCurSettings.ulZoneMask = 0xFFFF inside of OEMInit
sufficient for this? I've done this and only get the following:

The XXX: INFO : is from the display driver itself.

-BSPIntrDoneIrq(irq = 26)
-OEMInterruptDone
display_ddi: INFO : LCDC6xhw::DrvEscape: IOCTL_POWER_SET
display_ddi: INFO : LCDC6xhw::ApplyPowerState: D1
+BSPIntrActiveIrq(26)
-BSPIntrActiveIrq(26)

> As far as the registry settings go the PM should do nothing, so I
> suspect something else is going on...
>
> Did you get these registry settings from the device (using remote
> registry editor) or from platform.reg or from reginit.ini?

Those are the settings from platform.reg. I have confirmed that they
are making it into the device though using a version of regedit.

Thank you,
Brad.

Re: Problems Disabling Automatic Screen Off for Display Driver. by Bradley

Bradley
Thu Apr 24 15:11:27 PDT 2008

On Apr 24, 2:18 pm, Bradley Remedios <bremed...@gmail.com> wrote:
> On Apr 24, 3:04 am, "Michel Verhagen (eMVP)" <mic...@nospam.box>
> wrote:
>
> > Set the PM debugzones all on and show us some debug output around the
> > time the backlight turns off.
>
> Is doing dpCurSettings.ulZoneMask = 0xFFFF inside of OEMInit
> sufficient for this? I've done this and only get the following:
>
> The XXX: INFO : is from the display driver itself.
>
> -BSPIntrDoneIrq(irq = 26)
> -OEMInterruptDone
> display_ddi: INFO : LCDC6xhw::DrvEscape: IOCTL_POWER_SET
> display_ddi: INFO : LCDC6xhw::ApplyPowerState: D1
> +BSPIntrActiveIrq(26)
> -BSPIntrActiveIrq(26)
>
> > As far as the registry settings go the PM should do nothing, so I
> > suspect something else is going on...
>
> > Did you get these registry settings from the device (using remote
> > registry editor) or from platform.reg or from reginit.ini?
>
> Those are the settings from platform.reg. I have confirmed that they
> are making it into the device though using a version of regedit.
>
> Thank you,
> Brad.

It seems that the call originates from the process explorer.exe

Re: Problems Disabling Automatic Screen Off for Display Driver. by Michel

Michel
Thu Apr 24 16:16:37 PDT 2008

> Is doing dpCurSettings.ulZoneMask = 0xFFFF inside of OEMInit
> sufficient for this? I've done this and only get the following:

No, add the following registry value to your *development* machine (so
the PC with Platform Builder on it!):

[HKEY_CURRENT_USER\Pegasus\Zones]
"PM"=dword:ffff

After you set that, re-download the kernel and show the debug output again.

According to the debug output, the PM is still doing something so I
suspect your settings did not all make it to the device...

You do know that the PM is only a *sample* and you should clone and
modify the PDD code of the PM to suit your device right?


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Bradley Remedios wrote:
> On Apr 24, 3:04 am, "Michel Verhagen (eMVP)" <mic...@nospam.box>
> wrote:
>> Set the PM debugzones all on and show us some debug output around the
>> time the backlight turns off.
>
> Is doing dpCurSettings.ulZoneMask = 0xFFFF inside of OEMInit
> sufficient for this? I've done this and only get the following:
>
> The XXX: INFO : is from the display driver itself.
>
> -BSPIntrDoneIrq(irq = 26)
> -OEMInterruptDone
> display_ddi: INFO : LCDC6xhw::DrvEscape: IOCTL_POWER_SET
> display_ddi: INFO : LCDC6xhw::ApplyPowerState: D1
> +BSPIntrActiveIrq(26)
> -BSPIntrActiveIrq(26)
>
>> As far as the registry settings go the PM should do nothing, so I
>> suspect something else is going on...
>>
>> Did you get these registry settings from the device (using remote
>> registry editor) or from platform.reg or from reginit.ini?
>
> Those are the settings from platform.reg. I have confirmed that they
> are making it into the device though using a version of regedit.
>
> Thank you,
> Brad.

Re: Problems Disabling Automatic Screen Off for Display Driver. by Andrew

Andrew
Fri May 02 13:17:04 PDT 2008

"Michel Verhagen (eMVP)" wrote:

> You do know that the PM is only a *sample* and you should clone and
> modify the PDD code of the PM to suit your device right?

Michel: Could you point to a good resource that covers this in more detail?

Best,
Andrew Basta

Re: Problems Disabling Automatic Screen Off for Display Driver. by Bruce

Bruce
Fri May 02 13:47:40 PDT 2008

Your best bet is PB Help and the source code itself.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com

EuroTech Inc.
www.EuroTech.com

"Andrew Basta" <Andrew Basta@discussions.microsoft.com> wrote in message
news:6078A409-B097-4F38-8EA6-1C73FA2ECC74@microsoft.com...
> "Michel Verhagen (eMVP)" wrote:
>
>> You do know that the PM is only a *sample* and you should clone and
>> modify the PDD code of the PM to suit your device right?
>
> Michel: Could you point to a good resource that covers this in more
> detail?
>
> Best,
> Andrew Basta



Re: Problems Disabling Automatic Screen Off for Display Driver. by Michel

Michel
Fri May 02 14:25:28 PDT 2008

Nicolas Besson just recently did a couple of blog posts on PM. He
doesn't talk about cloning but these posts will give you at least an
overview of PM:

http://nicolasbesson.blogspot.com/2008/04/power-management-under-window-ce-part.html
http://nicolasbesson.blogspot.com/2008/04/power-management-under-windows-ce-part.html
http://nicolasbesson.blogspot.com/2008/04/power-management-under-windows-ce-part_11.html

If you want to change more than you can control with registry settings,
clone (just copy!) the PDD from
\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\PM\PDD\DEFAULT to your BSP, for
instance to \WINCE500\PLATFORM\YourBSP\SRC\PM (don't forget to add the
PM folder to the dirs file).

Then change the sources file so it looks like this:

TARGETNAME=pm
TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM
SYNCHRONIZE_DRAIN=1

!IF "$(BSP_CUSTOM_PM)" != "1"
SKIPBUILD=1
!ENDIF


DLLENTRY=DllEntry

DEFFILE=$(_PUBLICROOT)\common\oak\inc\pm.def

SOURCELIBS=\
$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\pm_mdd_lib.lib \
$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\pm_pdd_common_lib.lib

TARGETLIBS=\
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib

SOURCES = \
platform.cpp


Now if you set the environment variable "BSP_CUSTOM_PM" the customized
PM will be built and included in your image when you build your BSP and
makeimg.

The source code of PM PDD (platform.cpp) is quite easy to understand and
very well commented. You won't find that much detail in documentation!


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.


Andrew Basta wrote:
> "Michel Verhagen (eMVP)" wrote:
>
>> You do know that the PM is only a *sample* and you should clone and
>> modify the PDD code of the PM to suit your device right?
>
> Michel: Could you point to a good resource that covers this in more detail?
>
> Best,
> Andrew Basta

Re: Problems Disabling Automatic Screen Off for Display Driver. by Bradley

Bradley
Mon May 05 10:28:39 PDT 2008

On Apr 24, 3:11 pm, Bradley Remedios <bremed...@gmail.com> wrote:
> > > As far as the registry settings go the PM should do nothing, so I
> > > suspect something else is going on...
>
> > > Did you get these registry settings from the device (using remote
> > > registry editor) or from platform.reg or from reginit.ini?
>
> > Those are the settings from platform.reg. I have confirmed that they
> > are making it into the device though using a version of regedit.

In case this helps anyone else, I was using the correct registry keys
and they were making it into reginit.ini along with the persistent
registry.

The problem was that the PM was being loaded before the NAND Driver
(and therefore the persistent registry) so it is essentially loading
it's timeouts out of whatever was in the HIVE BOOT SECTION (which may
not be what is currently in the registry which is why regedit always
showed the correct value.) My registry entries were not a part of the
HIVE BOOT SECTION which is why they were not being found and it seemed
like the incorrect power down times were being used.