/*
*
* Copyright (C) 2000 Keith Packard, member of The XFree86 Project, Inc.
* 2005 Zack Rusin, Trolltech
*
* 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 name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE 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.
*/
#ifndef EXAPRIV_H
#define EXAPRIV_H
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "exa.h"
#ifdef MITSHM
#include "shmint.h"
#endif
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "windowstr.h"
#include "servermd.h"
#include "colormapst.h"
#include "gcstruct.h"
#include "input.h"
#include "mipointer.h"
#include "mi.h"
#include "dix.h"
#include "fb.h"
#include "fboverlay.h"
#include "fbpict.h"
#include "glyphstr.h"
#include "damage.h"
#define DEBUG_TRACE_FALL 0
#define DEBUG_MIGRATE 0
#define DEBUG_PIXMAP 0
#define DEBUG_OFFSCREEN 0
#define DEBUG_GLYPH_CACHE 0
#if DEBUG_TRACE_FALL
#define EXA_FALLBACK(x) \
do { \
ErrorF x; \
} while (0)
char
#else
#define EXA_FALLBACK(x)
#endif
#if DEBUG_PIXMAP
#else
#define DBG_PIXMAP(a)
#endif
#ifndef EXA_MAX_FB
#endif
#ifdef DEBUG
#else
do { \
ErrorF x; \
return ret; \
} while (0)
#endif
/**
* This is the list of migration heuristics supported by EXA. See
* exaDoMigration() for what their implementations do.
*/
enum ExaMigrationHeuristic {
};
typedef struct {
typedef struct {
/* The identity of the cache, statically configured at initialization */
unsigned int format;
int glyphWidth;
int glyphHeight;
/* Hash table mapping from glyph sha1 to position in the glyph; we use
* open addressing with a hash table size determined based on size and large
* enough so that we always have a good amount of free space, so we can
* use linear probing. (Linear probing is preferrable to double hashing
* here because it allows us to easily remove entries.)
*/
int *hashEntries;
int hashSize;
typedef struct _ExaMigrationRec {
typedef struct {
unsigned disableFbCount;
unsigned offScreenCounter;
unsigned numOffscreenAvailable;
/* Reference counting for accessed pixmaps */
struct {
int count;
/* Holds information on fallbacks that cannot be relayed otherwise. */
unsigned int fallback_flags;
unsigned int fallback_counter;
/**
* Regions affected by fallback composite source / mask operations.
*/
/*
* This is the only completely portable way to
* compute this info.
*/
#ifndef BitsPerPixel
#define BitsPerPixel(d) (\
PixmapWidthPaddingInfo[d].notPower2 ? \
#endif
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey))
#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec))
/*
* Some macros to deal with function wrapping.
*/
}
}
}
pExaScr->fallback_counter++; \
pExaScr->fallback_counter--; \
/** Align an offset to an arbitrary alignment */
/** Align an offset to a power-of-two alignment */
#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &ExaGetScreenPriv((p)->drawable.pScreen)->pixmapPrivateKeyRec))
typedef struct {
/**
* Holds information about whether this pixmap can be used for
* acceleration (== 0) or not (> 0).
*
* Contains a OR'ed combination of the following values:
* EXA_RANGE_PITCH - set if the pixmap's pitch is out of range
* EXA_RANGE_WIDTH - set if the pixmap's width is out of range
* EXA_RANGE_HEIGHT - set if the pixmap's height is out of range
*/
unsigned int accel_blocked;
/**
* The damage record contains the areas of the pixmap's current location
* (framebuffer or system) that have been damaged compared to the other
* location.
*/
/**
* The valid regions mark the valid bits (at least, as they're derived from
* damage, which may be overreported) of a pixmap's system and FB copies.
*/
/**
* Driver private storage per EXA pixmap
*/
void *driverPriv;
typedef struct {
/* GC values from the layer below. */
typedef struct {
/**
* 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.
*/
/* exa_unaccel.c */
void
void
void
void
void
char *bits);
void
unsigned long bitPlane);
void
void
void
void
void
void
int x, int y, unsigned int nglyph,
void
int x, int y, unsigned int nglyph,
void
DrawablePtr pDrawable, int w, int h, int x, int y);
void
void
void
int wMax,
void
/* exa_accel.c */
unsigned int clientClipType)
{
clientClipType != CT_NONE ||
}
void
unsigned int clientClipType);
void
void
int nbox,
int dx,
int dy,
void
void
/* exa_offscreen.c */
void
void
void
/* exa.c */
void
void
void
void
void
void
int w, int h, int bpp);
void
int w, int h, int bpp);
void
extern const GCFuncs exaGCFuncs;
/* exa_classic.c */
unsigned usage_hint);
/* exa_driver.c */
unsigned usage_hint);
/* exa_mixed.c */
unsigned usage_hint);
/* exa_migration_mixed.c */
void
void
void
void
void
/* exa_render.c */
void
void
void
void
/* exa_glyph.c */
void
void
void
/* exa_migration_classic.c */
void
void
void
void
void
void
void
#endif /* EXAPRIV_H */