Commit 5e4f1b09 authored by Siarhei Siamashka's avatar Siarhei Siamashka
Browse files

Added empty hooks for EXA (borrowed from xf86-video-omapfb)

Just use this stuff for testing performance and EXA overhead.
parent 6f708d4b
......@@ -33,6 +33,8 @@ sunxifb_drv_la_SOURCES = \
uthash.h \
fbdev.c \
fbdev_priv.h \
sw-exa.c \
sw-exa.h \
sunxi_disp.c \
sunxi_disp.h \
sunxi_disp_hwcursor.c \
......
......@@ -45,9 +45,12 @@
#include "xf86cmap.h"
#include "shadow.h"
#include "dgaproc.h"
#include "exa.h"
#include "fbdev_priv.h"
#include "sunxi_disp.h"
#include "sunxi_disp_hwcursor.h"
#include "sw-exa.h"
#ifdef HAVE_LIBUMP
#include "sunxi_mali_ump_dri2.h"
......@@ -215,10 +218,6 @@ FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */
/* -------------------------------------------------------------------- */
/* our private data, and two functions to allocate/free this */
#include "fbdev_priv.h"
static Bool
FBDevGetRec(ScrnInfoPtr pScrn)
......@@ -969,6 +968,18 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
}
#endif
/* EXA init */
xf86LoadSubModule(pScrn, "exa");
/* TODO: This should depend on the AccelMethod option */
fPtr->exa = exaDriverAlloc();
if (OMAPFBSetupExa(pScreen, fPtr)) {
exaDriverInit(pScreen, fPtr->exa);
} else {
free(fPtr->exa);
fPtr->exa = NULL;
}
TRACE_EXIT("FBDevScreenInit");
return TRUE;
......@@ -980,6 +991,12 @@ FBDevCloseScreen(CLOSE_SCREEN_ARGS_DECL)
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn);
if (fPtr->exa) {
exaDriverFini(pScreen);
free(fPtr->exa);
fPtr->exa = NULL;
}
#ifdef HAVE_LIBUMP
if (fPtr->SunxiMaliDRI2_private) {
SunxiMaliDRI2_Close(pScreen);
......
......@@ -30,6 +30,7 @@
*/
#include "compat-api.h"
#include "exa.h"
typedef struct {
unsigned char* fbstart;
......@@ -47,6 +48,7 @@ typedef struct {
DGAModePtr pDGAMode;
int nDGAMode;
OptionInfoPtr Options;
ExaDriverPtr exa;
void *sunxi_disp_private;;
void *SunxiDispHardwareCursor_private;
......
......@@ -28,6 +28,7 @@
#include "xf86.h"
#include "xf86Cursor.h"
#include "cursorstr.h"
#include "exa.h"
#include "sunxi_disp_hwcursor.h"
#include "sunxi_disp.h"
......
/* Texas Instruments OMAP framebuffer driver for X.Org
* Copyright 2008 Kalle Vahlman, <zuh@iki.fi>
*
* Permission to use, copy, modify, distribute and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of the authors and/or copyright holders
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. The authors and
* copyright holders make no representations about the suitability of this
* software for any purpose. It is provided "as is" without any express
* or implied warranty.
*
* THE AUTHORS AND COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xorgVersion.h"
#include "xf86.h"
#include "fb.h"
#include "fbdev_priv.h"
#include "sw-exa.h"
#ifdef LOG_CALLS
# define FALLBACK do { ErrorF("Fallback from %s\n", __FUNCTION__); } while (0)
#else
# define FALLBACK do { } while (0)
#endif
/*** Solid fill */
static Bool
SWPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
{
FALLBACK;
return FALSE;
}
static void
SWSolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
{
FALLBACK;
}
static void
SWDoneSolid(PixmapPtr pPixmap)
{
FALLBACK;
}
/*** Copy */
static Bool
SWPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, int alu, Pixel planemask)
{
FALLBACK;
return FALSE;
}
static void
SWCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height)
{
FALLBACK;
}
static void
SWDoneCopy(PixmapPtr pDstPixmap)
{
FALLBACK;
}
/*** Composite */
static Bool
SWCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture)
{
FALLBACK;
return FALSE;
}
static Bool
SWPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
{
FALLBACK;
return FALSE;
}
static void
SWComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height)
{
}
static void
SWDoneComposite(PixmapPtr pDst)
{
}
/*** General */
static void
SWWaitMarker(ScreenPtr pScreen, int marker)
{
}
static Bool
SWPrepareAccess(PixmapPtr pPix, int index)
{
return TRUE;
}
static void
SWFinishAccess(PixmapPtr pPix, int index)
{
}
/*** Setup */
Bool OMAPFBSetupExa(ScreenPtr pScreen, FBDevPtr ofb)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
ofb->exa->exa_major = 2;
ofb->exa->exa_minor = 0;
ofb->exa->flags = EXA_OFFSCREEN_PIXMAPS;
ofb->exa->memoryBase = ofb->fbmem;
ofb->exa->memorySize = ofb->lineLength * pScrn->virtualY;
ofb->exa->offScreenBase = ofb->exa->memorySize;
ofb->exa->pixmapOffsetAlign = 4;
ofb->exa->pixmapPitchAlign = 4;
ofb->exa->maxX = 8192;
ofb->exa->maxY = 8192;
#define EXA_FUNC(s) ofb->exa->s = SW ## s
EXA_FUNC(PrepareSolid);
EXA_FUNC(Solid);
EXA_FUNC(DoneSolid);
EXA_FUNC(PrepareCopy);
EXA_FUNC(Copy);
EXA_FUNC(DoneCopy);
EXA_FUNC(CheckComposite);
EXA_FUNC(PrepareComposite);
EXA_FUNC(Composite);
EXA_FUNC(DoneComposite);
EXA_FUNC(WaitMarker);
EXA_FUNC(PrepareAccess);
EXA_FUNC(FinishAccess);
return TRUE;
}
/* Texas Instruments OMAP framebuffer driver for X.Org
* Copyright 2008 Kalle Vahlman, <zuh@iki.fi>
*
* Permission to use, copy, modify, distribute and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of the authors and/or copyright holders
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. The authors and
* copyright holders make no representations about the suitability of this
* software for any purpose. It is provided "as is" without any express
* or implied warranty.
*
* THE AUTHORS AND COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
Bool OMAPFBSetupExa(ScreenPtr pScreen, FBDevPtr ofb);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment