This option can be used to disable 2D acceleration. DRI2 and XVideo blits will
still be accelerated, at least to some degree even with compositing.
PixmapPtr dst_pixmap;
GCPtr gc;
RegionPtr copy_clip;
PixmapPtr dst_pixmap;
GCPtr gc;
RegionPtr copy_clip;
/*
* In driCreateBuffers we dewrap windows into the
/*
* In driCreateBuffers we dewrap windows into the
+ save_accel = ms->exa->accel;
+ ms->exa->accel = TRUE;
(*gc->ops->CopyArea)(&src_pixmap->drawable, &dst_pixmap->drawable, gc,
0, 0, pDraw->width, pDraw->height, 0, 0);
(*gc->ops->CopyArea)(&src_pixmap->drawable, &dst_pixmap->drawable, gc,
0, 0, pDraw->width, pDraw->height, 0, 0);
+ ms->exa->accel = save_accel;
typedef enum
{
OPTION_SW_CURSOR,
typedef enum
{
OPTION_SW_CURSOR,
} modesettingOpts;
static const OptionInfoRec Options[] = {
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
} modesettingOpts;
static const OptionInfoRec Options[] = {
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_2D_ACCEL, "2DAccel", OPTV_BOOLEAN, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
xf86SetBlackWhitePixels(pScreen);
xf86SetBlackWhitePixels(pScreen);
- ms->exa = xorg_exa_init(pScrn);
+ ms->exa = xorg_exa_init(pScrn, xf86ReturnOptValBool(ms->Options,
+ OPTION_2D_ACCEL, TRUE));
ms->debug_fallback = debug_get_bool_option("XORG_DEBUG_FALLBACK", TRUE);
xorg_init_video(pScreen);
ms->debug_fallback = debug_get_bool_option("XORG_DEBUG_FALLBACK", TRUE);
xorg_init_video(pScreen);
#include "util/u_rect.h"
#define DEBUG_PRINT 0
#include "util/u_rect.h"
#define DEBUG_PRINT 0
-#define ACCEL_ENABLED TRUE
XORG_FALLBACK("format %s", pf_name(priv->tex->format));
}
XORG_FALLBACK("format %s", pf_name(priv->tex->format));
}
- return ACCEL_ENABLED && xorg_solid_bind_state(exa, priv, fg);
+ return exa->accel && xorg_solid_bind_state(exa, priv, fg);
exa->copy.src = src_priv;
exa->copy.dst = priv;
exa->copy.src = src_priv;
exa->copy.dst = priv;
render_format_name(pMaskPicture->format));
}
render_format_name(pMaskPicture->format));
}
- return ACCEL_ENABLED &&
xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture,
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture,
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
PicturePtr pSrcPicture, PicturePtr pMaskPicture,
PicturePtr pDstPicture)
{
PicturePtr pSrcPicture, PicturePtr pMaskPicture,
PicturePtr pDstPicture)
{
+ ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ modesettingPtr ms = modesettingPTR(pScrn);
+ struct exa_context *exa = ms->exa;
boolean accelerated = xorg_composite_accelerated(op,
pSrcPicture,
pMaskPicture,
boolean accelerated = xorg_composite_accelerated(op,
pSrcPicture,
pMaskPicture,
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
#endif
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
#endif
- return ACCEL_ENABLED && accelerated;
+ return exa->accel && accelerated;
bitsPerPixel, devKind, NULL);
/* Deal with screen resize */
bitsPerPixel, devKind, NULL);
/* Deal with screen resize */
- if (!priv->tex ||
- (priv->tex->width[0] != width ||
- priv->tex->height[0] != height ||
- priv->tex_flags != priv->flags)) {
+ if ((exa->accel || priv->flags) &&
+ (!priv->tex ||
+ (priv->tex->width[0] != width ||
+ priv->tex->height[0] != height ||
+ priv->tex_flags != priv->flags))) {
struct pipe_texture *texture = NULL;
struct pipe_texture template;
struct pipe_texture *texture = NULL;
struct pipe_texture template;
-xorg_exa_init(ScrnInfoPtr pScrn)
+xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa;
{
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa;
ms->ctx = exa->pipe;
exa->renderer = renderer_create(exa->pipe);
ms->ctx = exa->pipe;
exa->renderer = renderer_create(exa->pipe);
float solid_color[4];
boolean has_solid_color;
float solid_color[4];
boolean has_solid_color;
/* float[9] projective matrix bound to pictures */
struct {
float src[9];
/* float[9] projective matrix bound to pictures */
struct {
float src[9];
int depth, int bpp);
void *
int depth, int bpp);
void *
-xorg_exa_init(ScrnInfoPtr pScrn);
+xorg_exa_init(ScrnInfoPtr pScrn, Bool accel);
void
xorg_exa_close(ScrnInfoPtr pScrn);
void
xorg_exa_close(ScrnInfoPtr pScrn);