Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#10196 closed defect (fixed)

starting X corrupts DCON image

Reported by: dsd Owned by: dsd
Priority: normal Milestone: 10.1.2
Component: distro Version: Development build as of this date
Keywords: Cc:
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

F11 regression on XO1:

If you start X with a DCON image frozen, the DCON image gets corrupted. (this happens during regular boot, as bootanim finishes up with the final frame frozen)

Test case:

stop prefdm
echo 1 > /sys/platform/devices/dcon/freeze; sleep 10; xinit

The image will get frozen but after 10 seconds it will go black (or show signs of corruption).

(xinit itself fails because it can't find twm, but it initializes enough of X to reproduce the bug)

Attachments (3)

dsd.patch (2 bytes) - added by dsd 4 years ago.
oops, ignore this
getcrtc.patch (1.1 KB) - added by dsd 4 years ago.
add trivial get_crtc implementation
freezedcon.patch (1.6 KB) - added by dsd 4 years ago.
don't power down dcon when it is frozen

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 years ago by dsd

This is because geode (src/geode_dcon.c) puts the dcon to sleep (via sysfs) when X changes DPMS mode. And X is changing to mode 3 (DPMSModeOff) twice during startup, before turning it on again.

Disabling DPMS (like XO-1.5) is probably one way to work around this, but I'll try and understand why X is behaving this way.

comment:2 Changed 4 years ago by dsd

First of all, xf86PrepareCrtcs powers down the display:

0 DCONDPMSSet (pScrni=0x89f3b58, mode=3) at geode_dcon.c:60
#1 0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=3) at lx_display.c:199
#2 0x080e8a1a in xf86PrepareCrtcs (scrn=<value optimized out>)

at xf86Crtc.c:2428

#3 xf86SetDesiredModes (scrn=<value optimized out>) at xf86Crtc.c:2450
#4 0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>,

pScrni=0x89f3b58) at lx_driver.c:799

#5 0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1,

argv=0xbfac8694) at lx_driver.c:872

#6 0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1,

argv=0xbfac8694) at main.c:702

#7 0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)

at xf86Init.c:1269

#8 0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315

This happens because the geode xf86OutputFuncsRec does not define get_crtc, so X decides that it doesn't know anything about the crtc behind the output so it decides to reset it.

X already has a mapping between output and crtc so it is simple enough to implement this (will attach a patch). But I'm probably missing something here.

#0 DCONDPMSSet (pScrni=0x89f3b58, mode=3) at geode_dcon.c:60
#1 0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=3) at lx_display.c:199
#2 0xb769fb57 in lx_crtc_prepare (crtc=0x89f45c8) at lx_display.c:252
#3 0x080e847b in xf86CrtcSetModeTransform (crtc=0x89f45c8, mode=0x89f4684,

rotation=1, transform=0x0, x=0, y=0) at xf86Crtc.c:331

#4 0x080e888f in xf86SetDesiredModes (scrn=0x89f3b58) at xf86Crtc.c:2499
#5 0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>,

pScrni=0x89f3b58) at lx_driver.c:799

#6 0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1,

argv=0xbfac8694) at lx_driver.c:872

#7 0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1,

argv=0xbfac8694) at main.c:702

#8 0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)

at xf86Init.c:1269

#9 0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315

Now xf86SetDesiredModes decides that it needs to prepare a new CRTC configuration causing the geode driver to power down the display while the new mode is being applied.

In this case, X does not seem to have any code to consider the current configuration in order to say "we don't need to change anything", so this is hard to avoid. (this is only possible when KMS is being used, in which case a different codepath is followed)

#0 DCONDPMSSet (pScrni=0x89f3b58, mode=0) at geode_dcon.c:60
#1 0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=0) at lx_display.c:199
#2 0xb769fa52 in lx_crtc_commit (crtc=0x89f45c8) at lx_display.c:308
#3 0x080e84e1 in xf86CrtcSetModeTransform (crtc=0x89f45c8, mode=0x89f4684,

rotation=1, transform=0x0, x=0, y=0) at xf86Crtc.c:345

#4 0x080e888f in xf86SetDesiredModes (scrn=0x89f3b58) at xf86Crtc.c:2499
#5 0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>,

pScrni=0x89f3b58) at lx_driver.c:799

#6 0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1,

argv=0xbfac8694) at lx_driver.c:872

#7 0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1,

argv=0xbfac8694) at main.c:702

#8 0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)

at xf86Init.c:1269

#9 0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315

and now geode powers the display on when it is asked to commit the new CRTC configuration.

Attaching 2 xf86-video-geode patches which together fix (or avoid) the bug at hand. Firstly we implement get_crtc trivially, and the second is perhaps a little questionable, it avoids powering down the dcon if the display is frozen.

comment:3 Changed 4 years ago by dsd

oops, here are the backtraces formatted nicer

0  DCONDPMSSet (pScrni=0x89f3b58, mode=3) at geode_dcon.c:60
#1  0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=3) at lx_display.c:199
#2  0x080e8a1a in xf86PrepareCrtcs (scrn=<value optimized out>)
    at xf86Crtc.c:2428
#3  xf86SetDesiredModes (scrn=<value optimized out>) at xf86Crtc.c:2450
#4  0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>, 
    pScrni=0x89f3b58) at lx_driver.c:799
#5  0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1, 
    argv=0xbfac8694) at lx_driver.c:872
#6  0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1, 
    argv=0xbfac8694) at main.c:702
#7  0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)
    at xf86Init.c:1269
#8  0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315


#0  DCONDPMSSet (pScrni=0x89f3b58, mode=3) at geode_dcon.c:60
#1  0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=3) at lx_display.c:199
#2  0xb769fb57 in lx_crtc_prepare (crtc=0x89f45c8) at lx_display.c:252
#3  0x080e847b in xf86CrtcSetModeTransform (crtc=0x89f45c8, mode=0x89f4684, 
    rotation=1, transform=0x0, x=0, y=0) at xf86Crtc.c:331
#4  0x080e888f in xf86SetDesiredModes (scrn=0x89f3b58) at xf86Crtc.c:2499
#5  0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>, 
    pScrni=0x89f3b58) at lx_driver.c:799
#6  0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1, 
    argv=0xbfac8694) at lx_driver.c:872
#7  0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1, 
    argv=0xbfac8694) at main.c:702
#8  0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)
    at xf86Init.c:1269
#9  0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315

#0  DCONDPMSSet (pScrni=0x89f3b58, mode=0) at geode_dcon.c:60
#1  0xb769fc54 in lx_crtc_dpms (crtc=0x89f45c8, mode=0) at lx_display.c:199
#2  0xb769fa52 in lx_crtc_commit (crtc=0x89f45c8) at lx_display.c:308
#3  0x080e84e1 in xf86CrtcSetModeTransform (crtc=0x89f45c8, mode=0x89f4684, 
    rotation=1, transform=0x0, x=0, y=0) at xf86Crtc.c:345
#4  0x080e888f in xf86SetDesiredModes (scrn=0x89f3b58) at xf86Crtc.c:2499
#5  0xb769cfd4 in LXEnterGraphics (pScrn=<value optimized out>, 
    pScrni=0x89f3b58) at lx_driver.c:799
#6  0xb769e319 in LXScreenInit (scrnIndex=0, pScrn=0x89f52d8, argc=1, 
    argv=0xbfac8694) at lx_driver.c:872
#7  0x0806b318 in AddScreen (pfnInit=0xb769e010 <LXScreenInit>, argc=1, 
    argv=0xbfac8694) at main.c:702
#8  0x080a974e in InitOutput (pScreenInfo=0x8212540, argc=1, argv=0xbfac8694)
    at xf86Init.c:1269
#9  0x0806ba2b in main (argc=1, argv=0xbfac8694, envp=0xbfac869c) at main.c:315

Changed 4 years ago by dsd

oops, ignore this

Changed 4 years ago by dsd

add trivial get_crtc implementation

Changed 4 years ago by dsd

don't power down dcon when it is frozen

comment:4 Changed 4 years ago by dsd

  • Resolution set to fixed
  • Status changed from new to closed

Sent patches to geode list.

Pushed patches to xorg-x11-drv-geode-2.11.2-1.fc11.olpc1 and tested locally.

comment:5 Changed 4 years ago by cjb

  • Action Needed changed from diagnose to add to build
  • Resolution fixed deleted
  • Status changed from closed to reopened

Switching to "add to build" to check that we pick this package up

comment:6 Changed 4 years ago by dsd

  • Resolution set to fixed
  • Status changed from reopened to closed

confirmed fixed in 10.1.2 build 300 for XO-1

comment:7 Changed 4 years ago by Quozl

  • Action Needed changed from add to build to no action
  • Milestone changed from 1.0-software-update to 10.1.2
  • Version changed from not specified to Development build as of this date
Note: See TracTickets for help on using tickets.