From 553f13fdca80f7aaf3b80d20eccafcd5905da635 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 3 Sep 2025 15:54:57 +0200 Subject: [PATCH] xfree86: dri: ProcXF86DRIGetDrawableInfo(): cache screen pointer Cache the screen pointer in local variable, instead of fetching it from global array several times. Follow-up commits will use some inline helper for that. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/dri/xf86dri.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 1e7547ac0b..3b4dba1f9a 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -353,7 +353,9 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) if (rc != Success) return rc; - if (!DRIGetDrawableInfo(screenInfo.screens[stuff->screen], + ScreenPtr pScreen = screenInfo.screens[stuff->screen]; + + if (!DRIGetDrawableInfo(pScreen, pDrawable, (unsigned int *) &rep.drawableTableIndex, (unsigned int *) &rep.drawableTableStamp, @@ -389,7 +391,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) if (!pClippedRects) return BadAlloc; - ScreenPtr pScreen = screenInfo.screens[stuff->screen]; int i, j; for (i = 0, j = 0; i < rep.numClipRects; i++) {