michaelforney/swc

Garbage on the screen on first launch of wm

Closed this issue · 2 comments

Hi,
When I launch example/wm I get garbage on the screen. After running st everything goes fine.

When I lauch Velox; I have flipping between screen with garbage and black screen every second. Top bar draws correctly.

It seems to me that renderer_repaint function in compositor.c don’t called when wm is just initialised.

I want to make my own compositor and am trying to understand wayland, swc, wld, drm etc.

Are you using an Nvidia or AMD card? Because it is a known issue on Nvidia, not sure about AMD. I had that too the first time I tried using it. If you use the software drm driver it should all work. Execute with WLD_DRM_DUMB=1 for software drm driver.

I have AMD card.
I executed

swc-launch ./wm

and got the same rubbish. Than I lauched st and pressed Win-Q to quit.
Output:

Running on VT 3
[swc:libswc/drm.c:169] DEBUG: /dev/dri/card0 is the primary GPU
# find_driver: Trying DRM driver `dumb'
# wayland_create_context: No wl_drm global
# wld_font_open_pattern: Loading font file: /usr/share/fonts/pcf/k.pcf.gz
# wld_font_open_pattern: Loading font file: /usr/share/fonts/pcf/k.pcf.gz
# wld_font_open_pattern: Loading font file: /usr/share/fonts/pcf/k.pcf.gz
# wld_font_open_pattern: Loading font file: /usr/share/fonts/pcf/k.pcf.gz
[swc:libswc/window.c:381] DEBUG: Initializing window, 0x2467400
[swc:libswc/compositor.c:721] DEBUG: Performing update
[swc:libswc/compositor.c:239] DEBUG: Rendering to target { x: 0, y: 0, w: 1280, h: 1024 }
[swc:libswc/compositor.c:721] DEBUG: Performing update
[swc:libswc/compositor.c:239] DEBUG: Rendering to target { x: 0, y: 0, w: 1280, h: 1024 }
Connection error
Server exited with status 0
Restoring VT to original state

As I can see dumb driver is used.
When wm just lauched, there NO message about updating screen. Only after lauching st the message DEBUG: Performing update appears.

Why not to update screen on first launch?