kde/qemu: KWIN_COMPOSE=Q (QPainter) — esquiva el segfault del rasterizador llvmpipe

El "pinta y vuelve a negro" NO era el output config: era kwin SEGFAULTEANDO (139) a
los segundos de pintar y respawneando. Core dump (core.llvmpipe-0, 176MB) + gdb del
host: el crash está en un hilo rasterizador de llvmpipe —
  #0 util_fill_rect  #1 util_fill_box  #2 lp_rast_clear_color  #3 rasterize_scene
  #4 thread_function (llvmpipe worker)
llvmpipe peta al limpiar el color buffer (bug de stride/geometría o vectorización del
fill en este entorno virtio+kms_swrast).

Fix: KWIN_COMPOSE=Q ⇒ kwin compone con QPainter (raster de Qt directo al buffer, SIN
armar escenas llvmpipe) ⇒ nunca entra a lp_rast_clear_color. (El segfault viejo con =Q
era el de gbm-init, ya resuelto por GBM_ALWAYS_SOFTWARE; llvmpipe sigue disponible para
gbm/EGL.) Verificado: QPainter compositing initialized, 139=0, kwin vivo a +15s/+30s.

+ STATUS monitor arreglado (busybox no tiene pgrep -c ⇒ pgrep|wc -l) con timestamp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-20 12:09:38 -04:00
co-authored by Claude Opus 4.8
parent 2f99446ca1
commit 82cbdb7e54
+9 -6
View File
@@ -57,10 +57,12 @@ export LP_NUM_THREADS=1
# pero los buffers del compositor van por AddFB2WithModifiers y fallan ⇒ vuelve a negro. KWIN_DRM_USE_MODIFIERS=0
# fuerza a kwin a usar drmModeAddFB2 plano (modifier implícito) que virtio-gpu sí acepta.
export KWIN_DRM_USE_MODIFIERS=0
# KWIN_COMPOSE: con llvmpipe (GL de software COMPLETO) dejamos que kwin use su compositor OpenGL por
# defecto — forzar QPainter (=Q) sobre una salida DRM/EGL con GL disponible segfaultea al componer la
# 1ra superficie. Si el GL-llvmpipe resultara inestable, KWIN_COMPOSE=Q es el fallback.
# export KWIN_COMPOSE=Q
# KWIN_COMPOSE=Q — compositor QPainter (raster de Qt directo al buffer, SIN escena llvmpipe). El
# compositor GL por defecto usa el rasterizador de llvmpipe, cuyo hilo SEGFAULTEA en lp_rast_clear_color
# → util_fill_rect al limpiar el color buffer (backtrace del core.llvmpipe-0): kwin pinta unos frames y
# muere → "vuelve a negro". QPainter no arma escenas llvmpipe ⇒ esquiva ese crash. (El segfault viejo con
# =Q era el de gbm-init, ya resuelto por GBM_ALWAYS_SOFTWARE.) llvmpipe sigue disponible para gbm/EGL.
export KWIN_COMPOSE=Q
export QT_QPA_PLATFORM=wayland
export QT_QPA_PLATFORMTHEME=kde
export QT_QPA_FONTDIR=/usr/share/fonts/dejavu
@@ -177,8 +179,9 @@ say "escritorio arriba (o mira /tmp/plasmashell.log). Ctrl-C mata la sesion."
dump /tmp/plasmashell.log
# monitor de estado: cada 15s dice si kwin/plasmashell siguen vivos ⇒ si vuelve a negro, sabremos si
# fue plasmashell que murió (containment) o kwin/output. (busybox pgrep -c cuenta procesos.)
( while sleep 15; do
say "STATUS: kwin=$(pgrep -c kwin_wayland 2>/dev/null) plasmashell=$(pgrep -c plasmashell 2>/dev/null) outputs_ok"
( n=0; while sleep 15; do
n=$((n+1))
say "STATUS +$((n*15))s: kwin=$(pgrep kwin_wayland 2>/dev/null | wc -l) plasmashell=$(pgrep plasmashell 2>/dev/null | wc -l)"
done ) &
wait $KWIN
RC=$?