From 5ee91ea8240d0cde563af00ff0fb90a7026347a1 Mon Sep 17 00:00:00 2001 From: Adiker Date: Thu, 8 Oct 2026 11:30:26 +0200 Subject: [PATCH] damage: Preserve existing DamageRec member offsets in stable branch Adding pListHead before damage shifted the existing DamageRec members without changing the video driver ABI. Existing xf86-video-amdgpu modules access damage->damage directly in their TearFree callback and interpret region extents as a data pointer, causing a crash. Append pListHead instead so the existing member offsets match 21.1.24, while retaining the damage-list registration fix. The structure still grows; this does not address external allocations using its old size. Fixes: 0fb16f3da03c077f5821f0eeb745384f5472faa5 ("damage: Unlink a damage from the list it was actually inserted on") Signed-off-by: Adiker --- miext/damage/damagestr.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h index 19624192eb..69cdf5c89e 100644 --- a/miext/damage/damagestr.h +++ b/miext/damage/damagestr.h @@ -35,12 +35,6 @@ typedef struct _damage { DamagePtr pNext; DamagePtr pNextWin; - /* - * Head of the pNext list this damage is currently linked on, or NULL if it is not linked on any list. Recorded at - * insertion time so that removal always unlinks from the list the damage actually went onto; see - * damageInsertDamage(). - */ - DamagePtr *pListHead; RegionRec damage; DamageReportLevel damageLevel; @@ -55,6 +49,13 @@ typedef struct _damage { Bool reportAfter; RegionRec pendingDamage; /* will be flushed post submission at the latest */ ScreenPtr pScreen; + + /* + * Head of the pNext list this damage is currently linked on, or NULL if it is not linked on any list. Recorded at + * insertion time so that removal always unlinks from the list the damage actually went onto; see + * damageInsertDamage(). + */ + DamagePtr *pListHead; } DamageRec; typedef struct _damageScrPriv { -- GitLab