Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: "Voidcoder" <voidcoder@xxxxxxxxx>
- Date: Tue, 15 Nov 2005 13:38:14 -0800
Hey-ho! :) I talked to dump registers after the LCD state has
been restored. The idea is to see the difference in configuration
that probably causing problems on resume. So dump registers here:
void DispDrvrPowerHandler(BOOL bOff)
{
if (bOff)
{
DumpLCDRegs(); // <- Dump here before we go sleeping
... Any further processing like disabling LCD ect
comes here ...
}
else
{
... restore LCD configuration, palette, enable LCD etc ...
DumpLCDRegs(); // <- Dump here again
}
}
"cool_harber" <cool_harber@xxxxxxxxxxx> wrote in message news:uriF74d6FHA.4012@xxxxxxxxxxxxxxxxxxxxxxx
>I tried as you said,I found when system wake up,you tell me to dump lcd registers.
> But this action would cause the lcd display nothing!!
> I send my code to your email.please help me,thanks...
>
>
> "Voidcoder" <voidcoder@xxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:e%23W0nRT6FHA.2400@xxxxxxxxxxxxxxxxxxxxxxx
>> ok, now seems to be clear. I think dumping LCD controller
>> registers prior to go sleeping and after wakeup will tell
>> You the truth. Just do it in these places:
>>
>> void DispDrvrPowerHandler(BOOL bOff)
>> {
>> if (bOff)
>> {
>> // Dump LCD registers
>>
>> ...
>> }
>> else
>> {
>> ...
>>
>> // Dump LCD registers
>> }
>> }
>>
>>
>>
>>
>>
>> "cool_harber" <cool_harber@xxxxxxxxxxx> wrote in message news:OPLxGCT6FHA.3636@xxxxxxxxxxxxxxxxxxxxxxx
>>> The SA_LCD display driver called DispDrvrSetPalette in SetPalette function.
>>>
>>> The "bad" display look means that the screen seems lose some color(gray sclale).
>>> The difference between "bad" and "good" is just like 24bit color bmp and 8bit color bmp.
>>> thanks.
>>>
>>> "Voidcoder" <voidcoder@xxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:eX3bk3S6FHA.1276@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Well, now not clear where the palette is loaded
>>>> first time? since You have commented the following
>>>> code in DispDrvrInitialize:
>>>>
>>>> // if(bpp < 16)
>>>> // {
>>>> // DispDrvrSetPalette(_rgbIdentity,0,PALETTE_SIZE);
>>>> //
>>>>
>>>> How does the "bad" display look?
>>>>
>>>>
>>>>
>>>> "cool_harber" <cool_harber@xxxxxxxxxxx> wrote in message news:uNNc6tS6FHA.3880@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> //---------------------------------------------------------
>>>>> void DispDrvrPowerHandler(BOOL bOff)
>>>>> {
>>>>>
>>>>> if(bOff)
>>>>> {
>>>>> DisableLCDController();
>>>>> }
>>>>> else
>>>>> {
>>>>> // Copy the original frame buffer back in.
>>>>> CopyFrameBuffer(FALSE);
>>>>>
>>>>> // Initialize the GPIO registers for proper LCD Controller operation
>>>>> LcdSetupGPIOs();
>>>>>
>>>>> // Initialize the LCD Controller and Board Control Register
>>>>> InitLCDController();
>>>>>
>>>>> // Clear LCD Controller status register
>>>>> LCDClearStatusReg();
>>>>>
>>>>> // Enable the LCD controller
>>>>> EnableLCDController();
>>>>> DispDrvrSetPalette(_rgbIdentity,0,256); //added by cool_harber
>>>>>
>>>>> }
>>>>> }
>>>>> //---------------------------------------------------------
>>>>> "Voidcoder" <voidcoder@xxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:eZrejWS6FHA.1420@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>> Post the whole DispDrvrPowerHandler code
>>>>>> here.
>>>>>>
>>>>>> "cool_harber" <cool_harber@xxxxxxxxxxx> wrote in message news:udaqCMS6FHA.3588@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>
>>>>>>> I use PXA255 and winCE.net 4.2.The display driver is based on
>>>>>>> Lubbock SA_LCD driver¡£
>>>>>>> In Funcion DispDrvrSetPalette,I trans the color palette to gray palette:
>>>>>>> ......
>>>>>>> for(i=firstEntry;i<end;i++)
>>>>>>> {
>>>>>>> // store 5 bits red, 6 bits green, and 5 bits blue
>>>>>>> v_pPaletteBuffer->palette[i] = (unsigned short)(
>>>>>>> (source[i].peBlue)+
>>>>>>> (source[i].peGreen)+
>>>>>>> ((source[i].peRed)
>>>>>>> )/3;
>>>>>>> }
>>>>>>> ......
>>>>>>> In Function DispDrvrInitialize,I commented follow lines:
>>>>>>> ......
>>>>>>> // if(bpp < 16)
>>>>>>> // {
>>>>>>> // DispDrvrSetPalette(_rgbIdentity,0,PALETTE_SIZE);
>>>>>>> // }
>>>>>>> ......
>>>>>>> In SCODE SA2Video::SetMode,I modified follow lines about palette:
>>>>>>> ......
>>>>>>> if(pPalette) {
>>>>>>> PALETTEENTRY Gray_Palette;
>>>>>>> for(int i=0i<256;i++)
>>>>>>> {
>>>>>>> Gray_Palette[i].peBlue =Gray_Palette[i].Blue =Gray_Palette[i].peRed = (
>>>>>>> (source[i].peBlue)+(source[i].peGreen)+((source[i].peRed))/3£»
>>>>>>> *pPalette = EngCreatePalette(PAL_INDEXED,0,Gray_Palette,0,0,0);
>>>>>>> .....
>>>>>>> In addition,I modified some LCD controller registers.
>>>>>>> Afer all these,The screen display seems Good~!
>>>>>>>
>>>>>>> But when the paltform wakeup from sleep mode.The screen display bad.As if the palette is not loaded.
>>>>>>> So I add follow line in DispDrvrPowerHandler:
>>>>>>> ......
>>>>>>> if(bOff)
>>>>>>> {
>>>>>>> DisableLCDController();
>>>>>>> }
>>>>>>> else
>>>>>>> {
>>>>>>> ........................
>>>>>>>
>>>>>>> DispDrvrSetPalette(_rgbIdentity,0,256);
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>> ......
>>>>>>> Afer did this.
>>>>>>> When I awaken the system first,The display is wrong.when I awaker the system secondly,the display is ok again.
>>>>>>> Then,The 3rd is wrong,the 4nd is ok........in the analogy order...
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: cool_harber
- Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- References:
- SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: cool_harber
- Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: Voidcoder
- Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: cool_harber
- Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- From: cool_harber
- SURPRISING!!!!The diplay driver "changed" when system awaken.
- Prev by Date: Re: Porting eMVC MFC application into CEPB
- Next by Date: Re: Hard Drive problem....
- Previous by thread: Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- Next by thread: Re: SURPRISING!!!!The diplay driver "changed" when system awaken.
- Index(es):
Relevant Pages
|