This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Backlight in Suspend mode

Other Parts Discussed in Thread: DM3730

Hi there,

I'm using a board that is very similar to omap evaluation board. 

My board is specifically from Embest SBC8530, has DM3730 on it, and running winCE 6 R3.

I'm having issue with backlight not going OFF when i enter Suspend mode.

I am calling SetSystemPowerState(NULL, POWER_STATE_SUSPEND, POWER_FORCE); from my application and I can see that it goes into a state IOCTL_POWER_SET in BKL_IOControl function in %WINCE600%/Platform/Common/soc/Common_Ti_V1/Common_Ti/Backlight/bkldrvapi.cpp. The power state it's trying to set is D3. 

But GetBestSupportedState(pBKLinfo, ReqDx, &SupportedDx) always sets SupportedDx to D0, which doesn't match up with what I'm seeing. I've made sure that pBKLinfo->ucSupportedStatesMask is 0x1F, and check *lpOutBuf in the watch window, which is set to 3. 

Could someone explain to me what I'm missing here? 

How do I turn off the backlight through Power manager??

Thanks,

Aelex

  • Hi,

    I've looked at this more today and I found many strange things.

    Firstly, I was trying to enable more debug messages in the backlight driver by changing the debug zones, but i could not access the different zones using "zo" command. So I checked where DEBUGREGISTER/RELEASERESGISTER was set, and found one in DllMain in bkldrvapi.cpp. I can put a breakpoint in DllMain but it doesn't seem to do what the function is defined to do. As in, I looked at the disassembly and it showed that there's only two lines of code, not going through state machine..

    Secondly, I was debugging through BKL_IOControl, as it tries to set the power state to D3. I stepped through GetBestSupportedState(pBKLinfo, ReqDx, &SupportedDx) and found that disassembly shows that the function sets SupportedDx to D0, whatever value is passed with ReqDx. The snippet from disassembly window is shown below.

    Can someone help me figure out what's going on with the Backlight driver? 

    I am still new to WinCE so I might only be missing something minor that I forgot etc. 

    Will be appreciated if someone can point me to the right direction ><

    Thanks,

    Aelex

    165: BOOL GetBestSupportedState(BKL_MDD_INFO *pBKLinfo, CEDEVICE_POWER_STATE ReqDx, CEDEVICE_POWER_STATE* SetDx)
    166: {
    D2F31D2C cmp r1, #0
    D2F31D30 mov r3, r0
    167: BOOL fRet = TRUE; // assume there's a suitable state we can go to
    D2F31D34 mov r0, #1
    168:

    169: switch(ReqDx)
    D2F31D38 beq |GetBestSupportedState+98h (d2f31dc4)|
    D2F31D3C cmp r1, #1
    D2F31D40 beq |GetBestSupportedState+78h (d2f31da4)|
    D2F31D44 cmp r1, #2
    D2F31D48 beq |GetBestSupportedState+60h (d2f31d8c)|
    D2F31D4C cmp r1, #3
    D2F31D50 beq |GetBestSupportedState+48h (d2f31d74)|
    D2F31D54 cmp r1, #4
    D2F31D58 bne |GetBestSupportedState+0A0h (d2f31dcc)|

    220: case D3:
    221: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D3])
    222: {
    223: *SetDx = D3;
    224: }
    225: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    226: {
    227: *SetDx = D4;
    228: }
    229: else
    230: {
    231: fRet = FALSE;
    D2F31D5C ldrb r3, [r3, #0x218]
    D2F31D60 tst r3, #0x10
    D2F31D64 beq |GetBestSupportedState+90h (d2f31dbc)|
    232: }
    233: break;
    D2F31D68 mov r3, #4
    170: {
    171: case D0:                                                       // <== trying to set to D0 !?
    172: 
    D2F31D6C str r3, SetDx


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {
    241: fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31D70 bx lr


    201: case D2:
    202: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D2])
    203: {
    204: *SetDx = D2;
    205: }
    206: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D3])
    207: {
    208: *SetDx = D3;
    209: }
    210: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    211: {
    212: *SetDx = D4;
    213: }
    214: else
    215: {
    216: fRet = FALSE;
    217: }
    D2F31D74 ldrb r3, [r3, #0x218]
    D2F31D78 tst r3, #8
    D2F31D7C beq |GetBestSupportedState+34h (d2f31d60)|
    218: break;
    219:
    D2F31D80 mov r3, #3
    170: {

    171: case D0:                                                              // <== trying to set to D0 !?

    172: 
    D2F31D84 str r3, SetDx


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {
    241: fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31D88 bx lr
    194: }
    195: else
    196: {
    197: fRet = FALSE;
    198: }
    D2F31D8C ldrb r3, [r3, #0x218]
    D2F31D90 tst r3, #4
    D2F31D94 beq |GetBestSupportedState+4Ch (d2f31d78)|
    199: break;
    200:
    D2F31D98 mov r3, #2
    170: {
    171: case D0:                                                                  // <== trying to set to D0 !?
    172: 
    D2F31D9C str r3, SetDx


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {
    241: fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31DA0 bx lr
    173: {
    174: *SetDx = D0;
    175: }
    D2F31DA4 ldrb r3, [r3, #0x218]
    D2F31DA8 tst r3, #2
    D2F31DAC beq |GetBestSupportedState+64h (d2f31d90)|
    176: break;
    177:
    D2F31DB0 mov r3, #1
    170: {
    171: case D0:                                                                  // <== trying to set to D0 !?
    172: 
    D2F31DB4 str r3, SetDx


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {

    fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31DB8 bx lr


    178: case D1:
    179: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D1])
    180: {
    181: *SetDx = D1;
    182: }
    183: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D2])
    184: {
    185: *SetDx = D2;
    186: }
    187: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D3])
    188: {
    189: *SetDx = D3;
    190: }
    191: else if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    192: {
    193: *SetDx = D4;
    D2F31DBC mov r0, #0


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {
    241: fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31DC0 bx lr
    170: {
    171: case D0:                                                                  // <== trying to set to D0 !?
    172: 
    D2F31DC4 mov r3, #0
    D2F31DC8 str r3, SetDx


    234: case D4:
    235: if(pBKLinfo->ucSupportedStatesMask & DeviceStateMasks[D4])
    236: {
    237: *SetDx = D4;
    238: }
    239: else
    240: {
    241: fRet = FALSE;
    242: }
    243: break;
    244: default:
    245: ASSERT(FALSE);
    246: break;
    247:
    D2F31DCC bx lr