Move EXA implementation up to the top level and remove its XFree86
dependencies. It was nearly abstract enough already to be used by multiple DDXes. This will be useful for EXA development through providing a fake acceleration implementation within Xephyr, so that testing can be done on new EXA code without worrying about buggy drivers.
This commit is contained in:
parent
c170aa830d
commit
dc0354104c
|
@ -61,6 +61,7 @@ SUBDIRS = \
|
||||||
$(COMPOSITE_DIR) \
|
$(COMPOSITE_DIR) \
|
||||||
$(GLX_DIR) \
|
$(GLX_DIR) \
|
||||||
$(LBX_DIR) \
|
$(LBX_DIR) \
|
||||||
|
exa \
|
||||||
hw \
|
hw \
|
||||||
$(XPDDX_DIR) \
|
$(XPDDX_DIR) \
|
||||||
$(XPCONFIG_DIR)
|
$(XPCONFIG_DIR)
|
||||||
|
|
|
@ -1538,6 +1538,7 @@ xkb/Makefile
|
||||||
Xext/Makefile
|
Xext/Makefile
|
||||||
Xi/Makefile
|
Xi/Makefile
|
||||||
xfixes/Makefile
|
xfixes/Makefile
|
||||||
|
exa/Makefile
|
||||||
hw/Makefile
|
hw/Makefile
|
||||||
hw/xfree86/Makefile
|
hw/xfree86/Makefile
|
||||||
hw/xfree86/common/Makefile
|
hw/xfree86/common/Makefile
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
module_LTLIBRARIES = libexa.la
|
noinst_LTLIBRARIES = libexa.la
|
||||||
|
|
||||||
sdk_HEADERS = exa.h
|
sdk_HEADERS = exa.h
|
||||||
|
|
||||||
libexa_la_LDFLAGS = -avoid-version
|
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
$(XORG_INCS) \
|
$(XORG_INCS) \
|
||||||
-I$(srcdir)/../../../miext/cw
|
-I$(srcdir)/../miext/cw
|
||||||
|
|
||||||
AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ $(DIX_CFLAGS)
|
||||||
|
|
||||||
libexa_la_SOURCES = \
|
libexa_la_SOURCES = \
|
||||||
exa.c \
|
exa.c \
|
||||||
|
|
115
exa/exa.c
115
exa/exa.c
|
@ -22,14 +22,15 @@
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <xorg-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "exa_priv.h"
|
#include "exa_priv.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "xf86str.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
#include "exa.h"
|
#include "exa.h"
|
||||||
#include "cw.h"
|
#include "cw.h"
|
||||||
|
|
||||||
|
@ -119,29 +120,12 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
ExaPixmapPrivPtr pExaPixmap;
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
int bpp;
|
int bpp;
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
|
|
||||||
if (w > 32767 || h > 32767)
|
if (w > 32767 || h > 32767)
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
if (!pScrn->vtSema || pExaScr->swappedOut) {
|
pPixmap = fbCreatePixmap (pScreen, w, h, depth);
|
||||||
pPixmap = pExaScr->SavedCreatePixmap(pScreen, w, h, depth);
|
|
||||||
} else {
|
|
||||||
bpp = BitsPerPixel (depth);
|
|
||||||
if (bpp == 32 && depth == 24)
|
|
||||||
{
|
|
||||||
int format;
|
|
||||||
for (format = 0; format < MAXFORMATS && pScrn->formats[format].depth; ++format)
|
|
||||||
if (pScrn->formats[format].depth == 24)
|
|
||||||
{
|
|
||||||
bpp = pScrn->formats[format].bitsPerPixel;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pPixmap = fbCreatePixmapBpp (pScreen, w, h, depth, bpp);
|
|
||||||
}
|
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
return NULL;
|
return NULL;
|
||||||
pExaPixmap = ExaGetPixmapPriv(pPixmap);
|
pExaPixmap = ExaGetPixmapPriv(pPixmap);
|
||||||
|
@ -288,7 +272,6 @@ exaCloseScreen(int i, ScreenPtr pScreen)
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
||||||
#endif
|
#endif
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
|
||||||
|
|
||||||
pScreen->CreateGC = pExaScr->SavedCreateGC;
|
pScreen->CreateGC = pExaScr->SavedCreateGC;
|
||||||
pScreen->CloseScreen = pExaScr->SavedCloseScreen;
|
pScreen->CloseScreen = pExaScr->SavedCloseScreen;
|
||||||
|
@ -305,8 +288,6 @@ exaCloseScreen(int i, ScreenPtr pScreen)
|
||||||
ps->Glyphs = pExaScr->SavedGlyphs;
|
ps->Glyphs = pExaScr->SavedGlyphs;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (pExaScr->wrappedEnableDisableFB)
|
|
||||||
pScrn->EnableDisableFBAccess = pExaScr->SavedEnableDisableFBAccess;
|
|
||||||
|
|
||||||
xfree (pExaScr);
|
xfree (pExaScr);
|
||||||
|
|
||||||
|
@ -317,8 +298,6 @@ Bool
|
||||||
exaDriverInit (ScreenPtr pScreen,
|
exaDriverInit (ScreenPtr pScreen,
|
||||||
ExaDriverPtr pScreenInfo)
|
ExaDriverPtr pScreenInfo)
|
||||||
{
|
{
|
||||||
/* Do NOT use XF86SCRNINFO macro here!! */
|
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
||||||
ExaScreenPrivPtr pExaScr;
|
ExaScreenPrivPtr pExaScr;
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
|
@ -334,8 +313,8 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
pExaScr = xcalloc (sizeof (ExaScreenPrivRec), 1);
|
pExaScr = xcalloc (sizeof (ExaScreenPrivRec), 1);
|
||||||
|
|
||||||
if (!pExaScr) {
|
if (!pExaScr) {
|
||||||
xf86DrvMsg(pScreen->myNum, X_WARNING,
|
LogMessage(X_WARNING, "EXA(%d): Failed to allocate screen private\n",
|
||||||
"EXA: Failed to allocate screen private\n");
|
pScreen->myNum);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,6 +322,8 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
|
|
||||||
pScreen->devPrivates[exaScreenPrivateIndex].ptr = (pointer) pExaScr;
|
pScreen->devPrivates[exaScreenPrivateIndex].ptr = (pointer) pExaScr;
|
||||||
|
|
||||||
|
exaDDXDriverInit(pScreen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace various fb screen functions
|
* Replace various fb screen functions
|
||||||
*/
|
*/
|
||||||
|
@ -389,8 +370,9 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
{
|
{
|
||||||
if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex,
|
if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex,
|
||||||
sizeof (ExaPixmapPrivRec))) {
|
sizeof (ExaPixmapPrivRec))) {
|
||||||
xf86DrvMsg(pScreen->myNum, X_WARNING,
|
LogMessage(X_WARNING,
|
||||||
"EXA: Failed to allocate pixmap private\n");
|
"EXA(%d): Failed to allocate pixmap private\n",
|
||||||
|
pScreen->myNum);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
pExaScr->SavedCreatePixmap = pScreen->CreatePixmap;
|
pExaScr->SavedCreatePixmap = pScreen->CreatePixmap;
|
||||||
|
@ -401,7 +383,7 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xf86DrvMsg(pScreen->myNum, X_INFO, "EXA: No offscreen pixmaps\n");
|
LogMessage(X_INFO, "EXA(%d): No offscreen pixmaps\n", pScreen->myNum);
|
||||||
if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex, 0))
|
if (!AllocatePixmapPrivate(pScreen, exaPixmapPrivateIndex, 0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -410,14 +392,10 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
pExaScr->info->card.memorySize));
|
pExaScr->info->card.memorySize));
|
||||||
if (pExaScr->info->card.offScreenBase < pExaScr->info->card.memorySize) {
|
if (pExaScr->info->card.offScreenBase < pExaScr->info->card.memorySize) {
|
||||||
if (!exaOffscreenInit (pScreen)) {
|
if (!exaOffscreenInit (pScreen)) {
|
||||||
xf86DrvMsg(pScreen->myNum, X_WARNING,
|
LogMessage(X_WARNING, "EXA(%d): Offscreen pixmap setup failed\n",
|
||||||
"EXA: Offscreen pixmap setup failed\n");
|
pScreen->myNum);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pExaScr->SavedEnableDisableFBAccess = pScrn->EnableDisableFBAccess;
|
|
||||||
pScrn->EnableDisableFBAccess = exaEnableDisableFBAccess;
|
|
||||||
pExaScr->wrappedEnableDisableFB = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -444,9 +422,8 @@ void exaWaitSync(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
ExaCardInfoPtr card = &(pExaScr->info->card);
|
ExaCardInfoPtr card = &(pExaScr->info->card);
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
|
||||||
|
|
||||||
if (card->needsSync && pScrn->vtSema) {
|
if (card->needsSync && !pExaScr->swappedOut) {
|
||||||
(*pExaScr->info->accel.WaitMarker)(pScreen, card->lastMarker);
|
(*pExaScr->info->accel.WaitMarker)(pScreen, card->lastMarker);
|
||||||
card->needsSync = FALSE;
|
card->needsSync = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -456,61 +433,3 @@ unsigned int exaGetVersion(void)
|
||||||
{
|
{
|
||||||
return EXA_VERSION;
|
return EXA_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XFree86LOADER
|
|
||||||
static MODULESETUPPROTO(exaSetup);
|
|
||||||
|
|
||||||
|
|
||||||
static const OptionInfoRec EXAOptions[] = {
|
|
||||||
{ -1, NULL,
|
|
||||||
OPTV_NONE, {0}, FALSE }
|
|
||||||
};
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static const OptionInfoRec *
|
|
||||||
EXAAvailableOptions(void *unused)
|
|
||||||
{
|
|
||||||
return (EXAOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo exaVersRec =
|
|
||||||
{
|
|
||||||
"exa",
|
|
||||||
MODULEVENDORSTRING,
|
|
||||||
MODINFOSTRING1,
|
|
||||||
MODINFOSTRING2,
|
|
||||||
XORG_VERSION_CURRENT,
|
|
||||||
1, 2, 0,
|
|
||||||
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
|
|
||||||
ABI_VIDEODRV_VERSION,
|
|
||||||
MOD_CLASS_NONE,
|
|
||||||
{0,0,0,0}
|
|
||||||
};
|
|
||||||
|
|
||||||
XF86ModuleData exaModuleData = { &exaVersRec, exaSetup, NULL };
|
|
||||||
|
|
||||||
ModuleInfoRec EXA = {
|
|
||||||
1,
|
|
||||||
"EXA",
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
EXAAvailableOptions,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static pointer
|
|
||||||
exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
|
||||||
{
|
|
||||||
static Bool Initialised = FALSE;
|
|
||||||
|
|
||||||
if (!Initialised) {
|
|
||||||
Initialised = TRUE;
|
|
||||||
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
|
|
||||||
if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
|
|
||||||
#endif
|
|
||||||
xf86AddModuleInfo(&EXA, Module);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (pointer)TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -249,6 +249,9 @@ exaGetPixmapPitch(PixmapPtr pPix);
|
||||||
unsigned long
|
unsigned long
|
||||||
exaGetPixmapSize(PixmapPtr pPix);
|
exaGetPixmapSize(PixmapPtr pPix);
|
||||||
|
|
||||||
|
void
|
||||||
|
exaEnableDisableFBAccess (int index, Bool enable);
|
||||||
|
|
||||||
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
#define exaInitCard(exa, sync, memory_base, off_screen_base, memory_size, \
|
||||||
offscreen_byte_align, offscreen_pitch, flags, \
|
offscreen_byte_align, offscreen_pitch, flags, \
|
||||||
max_x, max_y) \
|
max_x, max_y) \
|
||||||
|
|
|
@ -22,14 +22,12 @@
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <xorg-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include "exa_priv.h"
|
#include "exa_priv.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "xf86str.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
#include "exa.h"
|
#include "exa.h"
|
||||||
#include "cw.h"
|
#include "cw.h"
|
||||||
|
|
||||||
|
@ -49,8 +47,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
int off_x, off_y;
|
int off_x, off_y;
|
||||||
|
|
||||||
|
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
if (pExaScr->swappedOut) {
|
||||||
if (!pScrn->vtSema) {
|
|
||||||
ExaCheckFillSpans(pDrawable, pGC, n, ppt, pwidth, fSorted);
|
ExaCheckFillSpans(pDrawable, pGC, n, ppt, pwidth, fSorted);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -213,8 +210,9 @@ RegionPtr
|
||||||
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
|
||||||
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pDstDrawable->pScreen);
|
ExaScreenPriv (pDstDrawable->pScreen);
|
||||||
if (!pScrn->vtSema) {
|
|
||||||
|
if (pExaScr->swappedOut) {
|
||||||
return ExaCheckCopyArea(pSrcDrawable, pDstDrawable, pGC,
|
return ExaCheckCopyArea(pSrcDrawable, pDstDrawable, pGC,
|
||||||
srcx, srcy, width, height, dstx, dsty);
|
srcx, srcy, width, height, dstx, dsty);
|
||||||
}
|
}
|
||||||
|
@ -232,7 +230,6 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
||||||
{
|
{
|
||||||
ExaScreenPriv (pDrawable->pScreen);
|
ExaScreenPriv (pDrawable->pScreen);
|
||||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pDrawable->pScreen);
|
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
register BoxPtr pbox;
|
register BoxPtr pbox;
|
||||||
BoxPtr pextent;
|
BoxPtr pextent;
|
||||||
|
@ -243,7 +240,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
||||||
int xorg, yorg;
|
int xorg, yorg;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (!pScrn->vtSema ||
|
if (pExaScr->swappedOut ||
|
||||||
pGC->fillStyle != FillSolid ||
|
pGC->fillStyle != FillSolid ||
|
||||||
pDrawable->width > pExaScr->info->card.maxX ||
|
pDrawable->width > pExaScr->info->card.maxX ||
|
||||||
pDrawable->height > pExaScr->info->card.maxY ||
|
pDrawable->height > pExaScr->info->card.maxY ||
|
||||||
|
@ -341,14 +338,13 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
||||||
int y2)
|
int y2)
|
||||||
{
|
{
|
||||||
ExaScreenPriv (pDrawable->pScreen);
|
ExaScreenPriv (pDrawable->pScreen);
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pDrawable->pScreen);
|
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
int nbox;
|
int nbox;
|
||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
int partX1, partX2, partY1, partY2;
|
int partX1, partX2, partY1, partY2;
|
||||||
|
|
||||||
if (!pScrn->vtSema ||
|
if (pExaScr->swappedOut ||
|
||||||
pDrawable->width > pExaScr->info->card.maxX ||
|
pDrawable->width > pExaScr->info->card.maxX ||
|
||||||
pDrawable->height > pExaScr->info->card.maxY ||
|
pDrawable->height > pExaScr->info->card.maxY ||
|
||||||
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||||
|
@ -560,12 +556,12 @@ const GCOps exaOps = {
|
||||||
void
|
void
|
||||||
exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
{
|
{
|
||||||
|
ExaScreenPriv (pWin->drawable.pScreen);
|
||||||
RegionRec rgnDst;
|
RegionRec rgnDst;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
PixmapPtr pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
|
PixmapPtr pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pWin->drawable.pScreen);
|
|
||||||
|
|
||||||
if (!pScrn->vtSema) {
|
if (pExaScr->swappedOut) {
|
||||||
ExaScreenPriv(pWin->drawable.pScreen);
|
ExaScreenPriv(pWin->drawable.pScreen);
|
||||||
pExaScr->SavedCopyWindow (pWin, ptOldOrg, prgnSrc);
|
pExaScr->SavedCopyWindow (pWin, ptOldOrg, prgnSrc);
|
||||||
exaDrawableDirty (&pWin->drawable);
|
exaDrawableDirty (&pWin->drawable);
|
||||||
|
@ -749,11 +745,10 @@ fallback:
|
||||||
void
|
void
|
||||||
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pWin->drawable.pScreen);
|
ExaScreenPriv (pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (!REGION_NUM_RECTS(pRegion))
|
if (!REGION_NUM_RECTS(pRegion))
|
||||||
return;
|
return;
|
||||||
if (pScrn->vtSema) {
|
if (!pExaScr->swappedOut) {
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case PW_BACKGROUND:
|
case PW_BACKGROUND:
|
||||||
switch (pWin->backgroundState) {
|
switch (pWin->backgroundState) {
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <xorg-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -31,8 +31,6 @@
|
||||||
#include "exa_priv.h"
|
#include "exa_priv.h"
|
||||||
#include <X11/fonts/fontstruct.h>
|
#include <X11/fonts/fontstruct.h>
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "xf86str.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
#include "exa.h"
|
#include "exa.h"
|
||||||
#include "cw.h"
|
#include "cw.h"
|
||||||
|
|
||||||
|
|
|
@ -270,12 +270,7 @@ exaEnableDisableFBAccess (int index, Bool enable)
|
||||||
if (!enable) {
|
if (!enable) {
|
||||||
ExaOffscreenSwapOut (pScreen);
|
ExaOffscreenSwapOut (pScreen);
|
||||||
pExaScr->swappedOut = TRUE;
|
pExaScr->swappedOut = TRUE;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (pExaScr->SavedEnableDisableFBAccess)
|
|
||||||
(*pExaScr->SavedEnableDisableFBAccess)(index, enable);
|
|
||||||
|
|
||||||
if (enable) {
|
|
||||||
ExaOffscreenSwapIn (pScreen);
|
ExaOffscreenSwapIn (pScreen);
|
||||||
pExaScr->swappedOut = FALSE;
|
pExaScr->swappedOut = FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
#ifndef EXAPRIV_H
|
#ifndef EXAPRIV_H
|
||||||
#define EXAPRIV_H
|
#define EXAPRIV_H
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <xorg-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "exa.h"
|
#include "exa.h"
|
||||||
|
@ -93,8 +93,6 @@ typedef struct {
|
||||||
CompositeProcPtr SavedComposite;
|
CompositeProcPtr SavedComposite;
|
||||||
GlyphsProcPtr SavedGlyphs;
|
GlyphsProcPtr SavedGlyphs;
|
||||||
#endif
|
#endif
|
||||||
EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
|
|
||||||
Bool wrappedEnableDisableFB;
|
|
||||||
Bool swappedOut;
|
Bool swappedOut;
|
||||||
} ExaScreenPrivRec, *ExaScreenPrivPtr;
|
} ExaScreenPrivRec, *ExaScreenPrivPtr;
|
||||||
|
|
||||||
|
@ -143,6 +141,11 @@ typedef struct {
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* exaDDXDriverInit must be implemented by the DDX using EXA, and is the place
|
||||||
|
* to set EXA options or hook in screen functions to handle using EXA as the AA.
|
||||||
|
*/
|
||||||
|
void exaDDXDriverInit (ScreenPtr pScreen);
|
||||||
|
|
||||||
/* exaasync.c */
|
/* exaasync.c */
|
||||||
void
|
void
|
||||||
|
@ -281,9 +284,6 @@ ExaOffscreenSwapIn (ScreenPtr pScreen);
|
||||||
void
|
void
|
||||||
ExaOffscreenFini (ScreenPtr pScreen);
|
ExaOffscreenFini (ScreenPtr pScreen);
|
||||||
|
|
||||||
void
|
|
||||||
exaEnableDisableFBAccess (int index, Bool enable);
|
|
||||||
|
|
||||||
/* exa.c */
|
/* exa.c */
|
||||||
void
|
void
|
||||||
exaDrawableUseScreen(DrawablePtr pDrawable);
|
exaDrawableUseScreen(DrawablePtr pDrawable);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright © 2001 Keith Packard
|
* Copyright © 2001 Keith Packard
|
||||||
*
|
*
|
||||||
* Partly based on code that is Copyright © The XFree86 Project Inc.
|
* Partly based on code that is Copyright © The XFree86 Project Inc.
|
||||||
|
@ -22,18 +22,17 @@
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <xorg-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "exa_priv.h"
|
#include "exa_priv.h"
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
#include "mipict.h"
|
#include "mipict.h"
|
||||||
|
|
||||||
#include "xf86str.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if DEBUG_TRACE_FALL
|
#if DEBUG_TRACE_FALL
|
||||||
static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
|
static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
|
||||||
{
|
{
|
||||||
|
@ -449,11 +448,10 @@ exaComposite(CARD8 op,
|
||||||
{
|
{
|
||||||
ExaScreenPriv (pDst->pDrawable->pScreen);
|
ExaScreenPriv (pDst->pDrawable->pScreen);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pDst->pDrawable->pScreen);
|
|
||||||
Bool saveSrcRepeat = pSrc->repeat;
|
Bool saveSrcRepeat = pSrc->repeat;
|
||||||
Bool saveMaskRepeat = pMask ? pMask->repeat : 0;
|
Bool saveMaskRepeat = pMask ? pMask->repeat : 0;
|
||||||
|
|
||||||
if (!pScrn->vtSema) {
|
if (pExaScr->swappedOut) {
|
||||||
exaDrawableDirty(pDst->pDrawable);
|
exaDrawableDirty(pDst->pDrawable);
|
||||||
pExaScr->SavedComposite(op, pSrc, pMask, pDst, xSrc, ySrc,
|
pExaScr->SavedComposite(op, pSrc, pMask, pDst, xSrc, ySrc,
|
||||||
xMask, yMask, xDst, yDst, width, height);
|
xMask, yMask, xDst, yDst, width, height);
|
||||||
|
|
|
@ -1,22 +1,16 @@
|
||||||
module_LTLIBRARIES = libexa.la
|
module_LTLIBRARIES = libexa.la
|
||||||
|
|
||||||
sdk_HEADERS = exa.h
|
|
||||||
|
|
||||||
libexa_la_LDFLAGS = -avoid-version
|
libexa_la_LDFLAGS = -avoid-version
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
$(XORG_INCS) \
|
$(XORG_INCS) \
|
||||||
|
-I$(srcdir)/../../../exa \
|
||||||
-I$(srcdir)/../../../miext/cw
|
-I$(srcdir)/../../../miext/cw
|
||||||
|
|
||||||
AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||||
|
|
||||||
libexa_la_SOURCES = \
|
libexa_la_SOURCES = \
|
||||||
exa.c \
|
examodule.c
|
||||||
exa.h \
|
|
||||||
exa_accel.c \
|
|
||||||
exa_migration.c \
|
|
||||||
exa_offscreen.c \
|
|
||||||
exa_render.c \
|
|
||||||
exa_priv.h \
|
|
||||||
exa_unaccel.c
|
|
||||||
|
|
||||||
|
libexa_la_LIBADD = \
|
||||||
|
../../../exa/libexa.la
|
||||||
|
|
|
@ -0,0 +1,161 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2006 Intel Corporation
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice (including the next
|
||||||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
* Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Eric Anholt <anholt@FreeBSD.org>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <xorg-config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "exa_priv.h"
|
||||||
|
|
||||||
|
#include "xf86str.h"
|
||||||
|
#include "xf86.h"
|
||||||
|
|
||||||
|
typedef struct _ExaXorgScreenPrivRec {
|
||||||
|
CloseScreenProcPtr SavedCloseScreen;
|
||||||
|
EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
|
||||||
|
} ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr;
|
||||||
|
|
||||||
|
static int exaXorgServerGeneration;
|
||||||
|
static int exaXorgScreenPrivateIndex;
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
exaXorgCloseScreen (int i, ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
||||||
|
ExaXorgScreenPrivPtr pScreenPriv =
|
||||||
|
pScreen->devPrivates[exaXorgScreenPrivateIndex].ptr;
|
||||||
|
|
||||||
|
pScreen->CloseScreen = pScreenPriv->SavedCloseScreen;
|
||||||
|
|
||||||
|
pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess;
|
||||||
|
|
||||||
|
xfree (pScreenPriv);
|
||||||
|
|
||||||
|
return pScreen->CloseScreen (i, pScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
exaXorgEnableDisableFBAccess (int index, Bool enable)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = screenInfo.screens[index];
|
||||||
|
ExaXorgScreenPrivPtr pScreenPriv =
|
||||||
|
pScreen->devPrivates[exaXorgScreenPrivateIndex].ptr;
|
||||||
|
|
||||||
|
if (!enable)
|
||||||
|
exaEnableDisableFBAccess (index, enable);
|
||||||
|
|
||||||
|
if (pScreenPriv->SavedEnableDisableFBAccess)
|
||||||
|
pScreenPriv->SavedEnableDisableFBAccess (index, enable);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
exaEnableDisableFBAccess (index, enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will be called during exaDriverInit, giving us the chance to set options
|
||||||
|
* and hook in our EnableDisableFBAccess.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
exaDDXDriverInit(ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
/* Do NOT use XF86SCRNINFO macro here!! */
|
||||||
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
|
ExaXorgScreenPrivPtr pScreenPriv;
|
||||||
|
|
||||||
|
if (exaXorgServerGeneration != serverGeneration) {
|
||||||
|
exaXorgScreenPrivateIndex = AllocateScreenPrivateIndex();
|
||||||
|
exaXorgServerGeneration = serverGeneration;
|
||||||
|
}
|
||||||
|
|
||||||
|
pScreenPriv = xcalloc (1, sizeof(ExaXorgScreenPrivRec));
|
||||||
|
if (pScreenPriv == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pScreen->devPrivates[exaXorgScreenPrivateIndex].ptr = pScreenPriv;
|
||||||
|
|
||||||
|
pScreenPriv->SavedEnableDisableFBAccess = pScrn->EnableDisableFBAccess;
|
||||||
|
pScrn->EnableDisableFBAccess = exaXorgEnableDisableFBAccess;
|
||||||
|
|
||||||
|
pScreenPriv->SavedCloseScreen = pScreen->CloseScreen;
|
||||||
|
pScreen->CloseScreen = exaXorgCloseScreen;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static MODULESETUPPROTO(exaSetup);
|
||||||
|
|
||||||
|
static const OptionInfoRec EXAOptions[] = {
|
||||||
|
{ -1, NULL,
|
||||||
|
OPTV_NONE, {0}, FALSE }
|
||||||
|
};
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
|
static const OptionInfoRec *
|
||||||
|
EXAAvailableOptions(void *unused)
|
||||||
|
{
|
||||||
|
return (EXAOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
static XF86ModuleVersionInfo exaVersRec =
|
||||||
|
{
|
||||||
|
"exa",
|
||||||
|
MODULEVENDORSTRING,
|
||||||
|
MODINFOSTRING1,
|
||||||
|
MODINFOSTRING2,
|
||||||
|
XORG_VERSION_CURRENT,
|
||||||
|
1, 2, 0,
|
||||||
|
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
|
||||||
|
ABI_VIDEODRV_VERSION,
|
||||||
|
MOD_CLASS_NONE,
|
||||||
|
{0,0,0,0}
|
||||||
|
};
|
||||||
|
|
||||||
|
XF86ModuleData exaModuleData = { &exaVersRec, exaSetup, NULL };
|
||||||
|
|
||||||
|
ModuleInfoRec EXA = {
|
||||||
|
1,
|
||||||
|
"EXA",
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
EXAAvailableOptions,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
|
static pointer
|
||||||
|
exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
||||||
|
{
|
||||||
|
static Bool Initialised = FALSE;
|
||||||
|
|
||||||
|
if (!Initialised) {
|
||||||
|
Initialised = TRUE;
|
||||||
|
#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
|
||||||
|
if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
|
||||||
|
#endif
|
||||||
|
xf86AddModuleInfo(&EXA, Module);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (pointer)TRUE;
|
||||||
|
}
|
Loading…
Reference in New Issue