From 1ae09800863992cfb1d5d21c600e2bc29e3b6ab2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 9 Dec 2016 14:52:35 -0500 Subject: [PATCH] shadow: Lift 32->24 conversion from modesetting to dix Signed-off-by: Adam Jackson Reviewed-by: Keith Packard --- hw/xfree86/drivers/modesetting/Makefile.am | 2 -- hw/xfree86/drivers/modesetting/driver.c | 7 +++---- hw/xfree86/drivers/modesetting/sh3224.h | 7 ------- miext/shadow/Makefile.am | 1 + {hw/xfree86/drivers/modesetting => miext/shadow}/sh3224.c | 8 +++----- miext/shadow/shadow.h | 3 +++ 6 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 hw/xfree86/drivers/modesetting/sh3224.h rename {hw/xfree86/drivers/modesetting => miext/shadow}/sh3224.c (96%) diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am index 44823b0fb..e0411ef51 100644 --- a/hw/xfree86/drivers/modesetting/Makefile.am +++ b/hw/xfree86/drivers/modesetting/Makefile.am @@ -51,8 +51,6 @@ modesetting_drv_la_SOURCES = \ dumb_bo.c \ dumb_bo.h \ present.c \ - sh3224.c \ - sh3224.h \ vblank.c \ pageflip.c \ $(NULL) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 3da69a396..a27b32757 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -60,7 +60,6 @@ #endif #include "driver.h" -#include "sh3224.h" static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); static Bool CloseScreen(ScreenPtr pScreen); @@ -1124,7 +1123,7 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); - Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; + Bool use_3224 = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do { RegionPtr damage = DamageRegion(pBuf->pDamage), tiles; @@ -1166,8 +1165,8 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) free(prect); } while (0); - if (use_ms_shadow) - ms_shadowUpdate32to24(pScreen, pBuf); + if (use_3224) + shadowUpdate32to24(pScreen, pBuf); else shadowUpdatePacked(pScreen, pBuf); } diff --git a/hw/xfree86/drivers/modesetting/sh3224.h b/hw/xfree86/drivers/modesetting/sh3224.h deleted file mode 100644 index fc301f99d..000000000 --- a/hw/xfree86/drivers/modesetting/sh3224.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SH3224_H -#define SH3224_H - -void -ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); - -#endif diff --git a/miext/shadow/Makefile.am b/miext/shadow/Makefile.am index 27cf41422..b611c9bb0 100644 --- a/miext/shadow/Makefile.am +++ b/miext/shadow/Makefile.am @@ -10,6 +10,7 @@ libshadow_la_SOURCES = \ c2p_core.h \ shadow.c \ shadow.h \ + sh3224.c \ shafb4.c \ shafb8.c \ shalloc.c \ diff --git a/hw/xfree86/drivers/modesetting/sh3224.c b/miext/shadow/sh3224.c similarity index 96% rename from hw/xfree86/drivers/modesetting/sh3224.c rename to miext/shadow/sh3224.c index a64a1031e..ba541217e 100644 --- a/hw/xfree86/drivers/modesetting/sh3224.c +++ b/miext/shadow/sh3224.c @@ -1,5 +1,4 @@ /* - * * Copyright © 2000 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -25,10 +24,9 @@ #include "dix-config.h" #endif -#include "shadow.h" -#include "fb.h" +#include "shadow.h" +#include "fb.h" -#include "sh3224.h" #define Get8(a) ((CARD32) READ(a)) #if BITMAP_BIT_ORDER == MSBFirst @@ -100,7 +98,7 @@ sh24_32BltLine(CARD8 *srcLine, } void -ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf) +shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h index 7f22169dc..0bbbe45b6 100644 --- a/miext/shadow/shadow.h +++ b/miext/shadow/shadow.h @@ -156,6 +156,9 @@ extern _X_EXPORT void extern _X_EXPORT void shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf); +extern _X_EXPORT void + shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); + typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr); extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);