61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/*
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Copyright (C) 2000 Keith Packard
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * 2004 Eric Anholt
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * 2005 Zack Rusin
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Permission to use, copy, modify, distribute, and sell this software and its
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * documentation for any purpose is hereby granted without fee, provided that
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the above copyright notice appear in all copies and that both that
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * copyright notice and this permission notice appear in supporting
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * documentation, and that the name of copyright holders not be used in
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * advertising or publicity pertaining to distribution of the software without
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * specific, written prior permission. Copyright holders make no
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * representations about the suitability of this software for any purpose. It
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * is provided "as is" without express or implied warranty.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * SOFTWARE.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/** @file
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This is the header containing the public API of EXA for exa drivers.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#ifndef EXA_H
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_H
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "scrnintstr.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "pixmapstr.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "windowstr.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "gcstruct.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "picturestr.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#include "fb.h"
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_VERSION_MAJOR 2
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_VERSION_MINOR 6
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_VERSION_RELEASE 0
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsynctypedef struct _ExaOffscreenArea ExaOffscreenArea;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsynctypedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenArea * area);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsynctypedef enum _ExaOffscreenState {
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenAvail,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenRemovable,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenLocked
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync} ExaOffscreenState;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncstruct _ExaOffscreenArea {
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int base_offset; /* allocation base */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int offset; /* aligned offset */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int size; /* total allocation size */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync unsigned last_use;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void *privData;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenSaveProc save;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenState state;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenArea *next;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync unsigned eviction_cost;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenArea *prev; /* Double-linked list for defragmentation */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int align; /* required alignment */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync};
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The ExaDriver structure is allocated through exaDriverAlloc(), and then
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * fllled in by drivers.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsynctypedef struct _ExaDriver {
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * exa_major and exa_minor should be set by the driver to the version of
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA which the driver was compiled for (or configures itself at runtime
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to support). This allows EXA to extend the structure for new features
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * without breaking ABI for drivers compiled against older versions.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int exa_major, exa_minor;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * memoryBase is the address of the beginning of framebuffer memory.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The visible screen should be within memoryBase to memoryBase +
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * memorySize.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync CARD8 *memoryBase;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * offScreenBase is the offset from memoryBase of the beginning of the area
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to be managed by EXA's linear offscreen memory manager.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * In XFree86 DDX drivers, this is probably:
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (pScrn->displayWidth * cpp * pScrn->virtualY)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync unsigned long offScreenBase;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * memorySize is the length (in bytes) of framebuffer memory beginning
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * from memoryBase.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The offscreen memory manager will manage the area beginning at
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (memoryBase + offScreenBase), with a length of (memorySize -
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * offScreenBase)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * In XFree86 DDX drivers, this is probably (pScrn->videoRam * 1024)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync unsigned long memorySize;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmapOffsetAlign is the byte alignment necessary for pixmap offsets
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * within framebuffer.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Hardware typically has a required alignment of offsets, which may or may
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * not be a power of two. EXA will ensure that pixmaps managed by the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * offscreen memory manager meet this alignment requirement.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int pixmapOffsetAlign;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmapPitchAlign is the byte alignment necessary for pixmap pitches
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * within the framebuffer.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Hardware typically has a required alignment of pitches for acceleration.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * For 3D hardware, Composite acceleration often requires that source and
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * mask pixmaps (textures) have a power-of-two pitch, which can be demanded
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * using EXA_OFFSCREEN_ALIGN_POT. These pitch requirements only apply to
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmaps managed by the offscreen memory manager. Thus, it is up to the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * driver to ensure that the visible screen has an appropriate pitch for
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * acceleration.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int pixmapPitchAlign;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The flags field is bitfield of boolean values controlling EXA's behavior.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The flags in clude EXA_OFFSCREEN_PIXMAPS, EXA_OFFSCREEN_ALIGN_POT, and
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_TWO_BITBLT_DIRECTIONS.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int flags;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @{ */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * maxX controls the X coordinate limitation for rendering from the card.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The driver should never receive a request for rendering beyond maxX
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * in the X direction from the origin of a pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maxX;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * maxY controls the Y coordinate limitation for rendering from the card.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The driver should never receive a request for rendering beyond maxY
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * in the Y direction from the origin of a pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maxY;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /* private */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenArea *offScreenAreas;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool needsSync;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int lastMarker;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @name Solid
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @{
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareSolid() sets up the driver for doing a solid fill.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPixmap Destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param alu raster operation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param planemask write mask for the fill
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param fg "foreground" color for the fill
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call should set up the driver for doing a series of solid fills
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * through the Solid() call. The alu raster op is one of the GX*
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * graphics functions listed in X.h, and typically maps to a similar
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * single-byte "ROP" setting in all hardware. The planemask controls
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * which bits of the destination should be affected, and will only represent
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the bits up to the depth of pPixmap. The fg is the pixel value of the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * foreground color referred to in ROP descriptions.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Note that many drivers will need to store some of the data in the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * private record, for sending to the hardware with each drawing command.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The PrepareSolid() call is required of all drivers, but it may fail for any
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * reason. Failure results in a fallback to software rendering.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*PrepareSolid) (PixmapPtr pPixmap,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int alu, Pixel planemask, Pixel fg);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Solid() performs a solid fill set up in the last PrepareSolid() call.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPixmap destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param x1 left coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param y1 top coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param x2 right coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param y2 bottom coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Performs the fill set up by the last PrepareSolid() call, covering the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * area from (x1,y1) to (x2,y2) in pPixmap. Note that the coordinates are
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * in the coordinate space of the destination pixmap, so the driver will
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * need to set up the hardware's offset and pitch for the destination
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * coordinates according to the pixmap's offset and pitch within
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * framebuffer. This likely means using exaGetPixmapOffset() and
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * exaGetPixmapPitch().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareSolid() ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DoneSolid() finishes a set of solid fills.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPixmap destination pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The DoneSolid() call is called at the end of a series of consecutive
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Solid() calls following a successful PrepareSolid(). This allows drivers
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to finish up emitting drawing commands that were buffered, or clean up
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * state from PrepareSolid().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareSolid() ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*DoneSolid) (PixmapPtr pPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @name Copy
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @{
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareCopy() sets up the driver for doing a copy within video
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * memory.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pSrcPixmap source pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDstPixmap destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dx X copy direction
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dy Y copy direction
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param alu raster operation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param planemask write mask for the fill
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call should set up the driver for doing a series of copies from the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the pSrcPixmap to the pDstPixmap. The dx flag will be positive if the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * hardware should do the copy from the left to the right, and dy will be
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * positive if the copy should be done from the top to the bottom. This
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * is to deal with self-overlapping copies when pSrcPixmap == pDstPixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * If your hardware can only support blits that are (left to right, top to
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * bottom) or (right to left, bottom to top), then you should set
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * #EXA_TWO_BITBLT_DIRECTIONS, and EXA will break down Copy operations to
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * ones that meet those requirements. The alu raster op is one of the GX*
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * graphics functions listed in X.h, and typically maps to a similar
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * single-byte "ROP" setting in all hardware. The planemask controls which
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * bits of the destination should be affected, and will only represent the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * bits up to the depth of pPixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Note that many drivers will need to store some of the data in the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * private record, for sending to the hardware with each drawing command.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The PrepareCopy() call is required of all drivers, but it may fail for any
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * reason. Failure results in a fallback to software rendering.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*PrepareCopy) (PixmapPtr pSrcPixmap,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PixmapPtr pDstPixmap,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int dx, int dy, int alu, Pixel planemask);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Copy() performs a copy set up in the last PrepareCopy call.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDstPixmap destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param srcX source X coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param srcY source Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dstX destination X coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dstY destination Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param width width of the rectangle to be copied
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param height height of the rectangle to be copied.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Performs the copy set up by the last PrepareCopy() call, copying the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * rectangle from (srcX, srcY) to (srcX + width, srcY + width) in the source
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmap to the same-sized rectangle at (dstX, dstY) in the destination
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmap. Those rectangles may overlap in memory, if
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pSrcPixmap == pDstPixmap. Note that this call does not receive the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pSrcPixmap as an argument -- if it's needed in this function, it should
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * be stored in the driver private during PrepareCopy(). As with Solid(),
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the coordinates are in the coordinate space of each pixmap, so the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * will need to set up source and destination pitches and offsets from those
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmaps, probably using exaGetPixmapOffset() and exaGetPixmapPitch().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareCopy ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*Copy) (PixmapPtr pDstPixmap,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int srcX,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int srcY, int dstX, int dstY, int width, int height);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DoneCopy() finishes a set of copies.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPixmap destination pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The DoneCopy() call is called at the end of a series of consecutive
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Copy() calls following a successful PrepareCopy(). This allows drivers
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to finish up emitting drawing commands that were buffered, or clean up
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * state from PrepareCopy().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareCopy() ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*DoneCopy) (PixmapPtr pDstPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @name Composite
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @{
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * CheckComposite() checks to see if a composite operation could be
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * accelerated.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param op Render operation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pSrcPicture source Picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pMaskPicture mask picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDstPicture destination Picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The CheckComposite() call checks if the driver could handle acceleration
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * of op with the given source, mask, and destination pictures. This allows
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * drivers to check source and destination formats, supported operations,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * transformations, and component alpha state, and send operations it can't
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * support to software rendering early on. This avoids costly pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * migration to the wrong places when the driver can't accelerate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * operations. Note that because migration hasn't happened, the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * can't know during CheckComposite() what the offsets and pitches of the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmaps are going to be.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * See PrepareComposite() for more details on likely issues that drivers
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * will have in accelerating Composite operations.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The CheckComposite() call is recommended if PrepareComposite() is
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * implemented, but is not required.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*CheckComposite) (int op,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PicturePtr pSrcPicture,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PicturePtr pMaskPicture, PicturePtr pDstPicture);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareComposite() sets up the driver for doing a Composite operation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * described in the Render extension protocol spec.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param op Render operation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pSrcPicture source Picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pMaskPicture mask picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDstPicture destination Picture
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pSrc source pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pMask mask pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDst destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call should set up the driver for doing a series of Composite
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * operations, as described in the Render protocol spec, with the given
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pSrcPicture, pMaskPicture, and pDstPicture. The pSrc, pMask, and
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pDst are the pixmaps containing the pixel data, and should be used for
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * setting the offset and pitch used for the coordinate spaces for each of
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the Pictures.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Notes on interpreting Picture structures:
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The Picture structures will always have a valid pDrawable.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The Picture structures will never have alphaMap set.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The mask Picture (and therefore pMask) may be NULL, in which case the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * operation is simply src OP dst instead of src IN mask OP dst, and
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * mask coordinates should be ignored.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - pMarkPicture may have componentAlpha set, which greatly changes
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the behavior of the Composite operation. componentAlpha has no effect
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * when set on pSrcPicture or pDstPicture.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The source and mask Pictures may have a transformation set
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (Picture->transform != NULL), which means that the source coordinates
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * should be transformed by that transformation, resulting in scaling,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * rotation, etc. The PictureTransformPoint() call can transform
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * coordinates for you. Transforms have no effect on Pictures when used
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * as a destination.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The source and mask pictures may have a filter set. PictFilterNearest
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * and PictFilterBilinear are defined in the Render protocol, but others
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * may be encountered, and must be handled correctly (usually by
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareComposite failing, and falling back to software). Filters have
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * no effect on Pictures when used as a destination.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * - The source and mask Pictures may have repeating set, which must be
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * respected. Many chipsets will be unable to support repeating on
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmaps that have a width or height that is not a power of two.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * If your hardware can't support source pictures (textures) with
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * non-power-of-two pitches, you should set #EXA_OFFSCREEN_ALIGN_POT.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Note that many drivers will need to store some of the data in the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * private record, for sending to the hardware with each drawing command.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The PrepareComposite() call is not required. However, it is highly
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * recommended for performance of antialiased font rendering and performance
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * of cairo applications. Failure results in a fallback to software
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * rendering.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*PrepareComposite) (int op,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PicturePtr pSrcPicture,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PicturePtr pMaskPicture,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PicturePtr pDstPicture,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Composite() performs a Composite operation set up in the last
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareComposite() call.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDstPixmap destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param srcX source X coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param srcY source Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param maskX source X coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param maskY source Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dstX destination X coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dstY destination Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param width destination rectangle width
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param height destination rectangle height
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Performs the Composite operation set up by the last PrepareComposite()
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * call, to the rectangle from (dstX, dstY) to (dstX + width, dstY + height)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * in the destination Pixmap. Note that if a transformation was set on
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the source or mask Pictures, the source rectangles may not be the same
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * size as the destination rectangles and filtering. Getting the coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * transformation right at the subpixel level can be tricky, and rendercheck
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * can test this for you.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareComposite() ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*Composite) (PixmapPtr pDst,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int srcX,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int srcY,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maskX,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maskY, int dstX, int dstY, int width, int height);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DoneComposite() finishes a set of Composite operations.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPixmap destination pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The DoneComposite() call is called at the end of a series of consecutive
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Composite() calls following a successful PrepareComposite(). This allows
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * drivers to finish up emitting drawing commands that were buffered, or
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * clean up state from PrepareComposite().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This call is required if PrepareComposite() ever succeeds.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*DoneComposite) (PixmapPtr pDst);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * UploadToScreen() loads a rectangle of data from src into pDst.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pDst destination pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param x destination X coordinate.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param y destination Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param width width of the rectangle to be copied
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param height height of the rectangle to be copied
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param src pointer to the beginning of the source data
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param src_pitch pitch (in bytes) of the lines of source data.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * UploadToScreen() copies data in system memory beginning at src (with
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pitch src_pitch) into the destination pixmap from (x, y) to
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (x + width, y + height). This is typically done with hostdata uploads,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * where the CPU sets up a blit command on the hardware with instructions
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * that the blit data will be fed through some sort of aperture on the card.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * If UploadToScreen() is performed asynchronously, it is up to the driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to call exaMarkSync(). This is in contrast to most other acceleration
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * calls in EXA.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * UploadToScreen() can aid in pixmap migration, but is most important for
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the performance of exaGlyphs() (antialiased font drawing) by allowing
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pipelining of data uploads, avoiding a sync of the card after each glyph.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @return TRUE if the driver successfully uploaded the data. FALSE
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * indicates that EXA should fall back to doing the upload in software.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * UploadToScreen() is not required, but is recommended if Composite
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * acceleration is supported.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*UploadToScreen) (PixmapPtr pDst,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int x,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int y, int w, int h, char *src, int src_pitch);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * UploadToScratch() is no longer used and will be removed next time the EXA
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * major version needs to be bumped.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*UploadToScratch) (PixmapPtr pSrc, PixmapPtr pDst);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() loads a rectangle of data from pSrc into dst
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pSrc source pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param x source X coordinate.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param y source Y coordinate
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param width width of the rectangle to be copied
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param height height of the rectangle to be copied
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dst pointer to the beginning of the destination data
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param dst_pitch pitch (in bytes) of the lines of destination data.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() copies data from offscreen memory in pSrc from
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (x, y) to (x + width, y + height), to system memory starting at
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * dst (with pitch dst_pitch). This would usually be done
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * using scatter-gather DMA, supported by a DRM call, or by blitting to AGP
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * and then synchronously reading from AGP. Because the implementation
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * might be synchronous, EXA leaves it up to the driver to call
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * exaMarkSync() if DownloadFromScreen() was asynchronous. This is in
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * contrast to most other acceleration calls in EXA.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() can aid in the largest bottleneck in pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * migration, which is the read from framebuffer when evicting pixmaps from
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * framebuffer memory. Thus, it is highly recommended, even though
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * implementations are typically complicated.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @return TRUE if the driver successfully downloaded the data. FALSE
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * indicates that EXA should fall back to doing the download in software.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() is not required, but is highly recommended.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*DownloadFromScreen) (PixmapPtr pSrc,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int x, int y,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int w, int h, char *dst, int dst_pitch);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * MarkSync() requests that the driver mark a synchronization point,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * returning an driver-defined integer marker which could be requested for
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * synchronization to later in WaitMarker(). This might be used in the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * future to avoid waiting for full hardware stalls before accessing pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * data with the CPU, but is not important in the current incarnation of
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Note that drivers should call exaMarkSync() when they have done some
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * acceleration, rather than their own MarkSync() handler, as otherwise EXA
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * will be unaware of the driver's acceleration and not sync to it during
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * fallbacks.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * MarkSync() is optional.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int (*MarkSync) (ScreenPtr pScreen);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * WaitMarker() waits for all rendering before the given marker to have
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * completed. If the driver does not implement MarkSync(), marker is
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * meaningless, and all rendering by the hardware should be completed before
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * WaitMarker() returns.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Note that drivers should call exaWaitSync() to wait for all acceleration
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to finish, as otherwise EXA will be unaware of the driver having
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * synchronized, resulting in excessive WaitMarker() calls.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * WaitMarker() is required of all drivers.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*WaitMarker) (ScreenPtr pScreen, int marker);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @{ */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareAccess() is called before CPU access to an offscreen pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPix the pixmap being accessed
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param index the index of the pixmap being accessed.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareAccess() will be called before CPU access to an offscreen pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * This can be used to set up hardware surfaces for byteswapping or
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * untiling, or to adjust the pixmap's devPrivate.ptr for the purpose of
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * making CPU access use a different aperture.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The index is one of #EXA_PREPARE_DEST, #EXA_PREPARE_SRC,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * #EXA_PREPARE_MASK, #EXA_PREPARE_AUX_DEST, #EXA_PREPARE_AUX_SRC, or
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * #EXA_PREPARE_AUX_MASK. Since only up to #EXA_NUM_PREPARE_INDICES pixmaps
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * will have PrepareAccess() called on them per operation, drivers can have
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * a small, statically-allocated space to maintain state for PrepareAccess()
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * and FinishAccess() in. Note that PrepareAccess() is only called once per
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmap and operation, regardless of whether the pixmap is used as a
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * destination and/or source, and the index may not reflect the usage.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PrepareAccess() may fail. An example might be the case of hardware that
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * can set up 1 or 2 surfaces for CPU access, but not 3. If PrepareAccess()
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * fails, EXA will migrate the pixmap to system memory.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() must be implemented and must not fail if a driver
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * wishes to fail in PrepareAccess(). PrepareAccess() must not fail when
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pPix is the visible screen, because the visible screen can not be
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * migrated.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @return TRUE if PrepareAccess() successfully prepared the pixmap for CPU
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * drawing.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @return FALSE if PrepareAccess() is unsuccessful and EXA should use
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * DownloadFromScreen() to migate the pixmap out.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*PrepareAccess) (PixmapPtr pPix, int index);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * FinishAccess() is called after CPU access to an offscreen pixmap.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPix the pixmap being accessed
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param index the index of the pixmap being accessed.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * FinishAccess() will be called after finishing CPU access of an offscreen
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixmap set up by PrepareAccess(). Note that the FinishAccess() will not be
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * called if PrepareAccess() failed and the pixmap was migrated out.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*FinishAccess) (PixmapPtr pPix, int index);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * PixmapIsOffscreen() is an optional driver replacement to
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * exaPixmapHasGpuCopy(). Set to NULL if you want the standard behaviour
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * of exaPixmapHasGpuCopy().
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @param pPix the pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @return TRUE if the given drawable is in framebuffer memory.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * exaPixmapHasGpuCopy() is used to determine if a pixmap is in offscreen
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * memory, meaning that acceleration could probably be done to it, and that it
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * with the CPU.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*PixmapIsOffscreen) (PixmapPtr pPix);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @name PrepareAccess() and FinishAccess() indices
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @{
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_PREPARE_DEST is the index for a pixmap that may be drawn to or
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * read from.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_DEST 0
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_PREPARE_SRC is the index for a pixmap that may be read from
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_SRC 1
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_PREPARE_SRC is the index for a second pixmap that may be read
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * from.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_MASK 2
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * separate alpha maps with Composite operations.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_AUX_DEST 3
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_AUX_SRC 4
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PREPARE_AUX_MASK 5
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_NUM_PREPARE_INDICES 6
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * maxPitchPixels controls the pitch limitation for rendering from
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the card.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The driver should never receive a request for rendering a pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * that has a pitch (in pixels) beyond maxPitchPixels.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Setting this field is optional -- if your hardware doesn't have
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * a pitch limitation in pixels, don't set this. If neither this value
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * nor maxPitchBytes is set, then maxPitchPixels is set to maxX.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * If set, it must not be smaller than maxX.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @sa maxPitchBytes
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maxPitchPixels;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * maxPitchBytes controls the pitch limitation for rendering from
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * the card.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * The driver should never receive a request for rendering a pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * that has a pitch (in bytes) beyond maxPitchBytes.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Setting this field is optional -- if your hardware doesn't have
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * a pitch limitation in bytes, don't set this.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * If set, it must not be smaller than maxX * 4.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * There's no default value for maxPitchBytes.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @sa maxPitchPixels
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int maxPitchBytes;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /* Hooks to allow driver to its own pixmap memory management */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void *(*CreatePixmap) (ScreenPtr pScreen, int size, int align);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void (*DestroyPixmap) (ScreenPtr pScreen, void *driverPriv);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Returning a pixmap with non-NULL devPrivate.ptr implies a pixmap which is
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * not offscreen, which will never be accelerated and Prepare/FinishAccess won't
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * be called.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int depth, int bitsPerPixel, int devKind,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void *pPixData);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /* hooks for drivers with tiling support:
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * driver MUST fill out new_fb_pitch with valid pitch of pixmap
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void *(*CreatePixmap2) (ScreenPtr pScreen, int width, int height,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int depth, int usage_hint, int bitsPerPixel,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int *new_fb_pitch);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync /** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync} ExaDriverRec, *ExaDriverPtr;
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/** @name EXA driver flags
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * @{
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * offscreen pixmaps.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_OFFSCREEN_PIXMAPS (1 << 0)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_OFFSCREEN_ALIGN_POT indicates to EXA that the driver needs pixmaps
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * to have a power-of-two pitch.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_OFFSCREEN_ALIGN_POT (1 << 1)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_TWO_BITBLT_DIRECTIONS indicates to EXA that the driver can only
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * support copies that are (left-to-right, top-to-bottom) or
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * (right-to-left, bottom-to-top).
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * all pixmap addressing and migration.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_HANDLES_PIXMAPS (1 << 3)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * such hooks, this flag has no effect.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_SUPPORTS_PREPARE_AUX (1 << 4)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_SUPPORTS_OFFSCREEN_OVERLAPS indicates to EXA that the driver Copy hooks
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * can handle the source and destination occupying overlapping offscreen memory
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * areas. This allows the offscreen memory defragmentation code to defragment
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * areas where the defragmented position overlaps the fragmented position.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync *
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Typically this is supported by traditional 2D engines but not by 3D engines.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_SUPPORTS_OFFSCREEN_OVERLAPS (1 << 5)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * EXA_MIXED_PIXMAPS will hide unacceleratable pixmaps from drivers and manage the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * problem known software fallbacks like trapezoids. This only migrates pixmaps one way
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * into a driver pixmap and then pins it.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_MIXED_PIXMAPS (1 << 6)
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/** @} */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/* in exa.c */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT ExaDriverPtr exaDriverAlloc(void);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT Bool
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaDriverFini(ScreenPtr pScreen);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaMarkSync(ScreenPtr pScreen);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaWaitSync(ScreenPtr pScreen);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT unsigned long
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaGetPixmapOffset(PixmapPtr pPix);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT unsigned long
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaGetPixmapPitch(PixmapPtr pPix);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT unsigned long
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaGetPixmapSize(PixmapPtr pPix);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void *exaGetPixmapDriverPrivate(PixmapPtr p);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/* in exa_offscreen.c */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync int size, int align,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync Bool locked,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenSaveProc save,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync void *privData);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen,
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenArea * area);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync ExaOffscreenMarkUsed(PixmapPtr pPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT Bool
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaDrawableIsOffscreen(DrawablePtr pDrawable);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/* in exa.c */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaMoveInPixmap(PixmapPtr pPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT void
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaMoveOutPixmap(PixmapPtr pPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/* in exa_unaccel.c */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsyncextern _X_EXPORT CARD32
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync exaGetPixmapFirstPixel(PixmapPtr pPixmap);
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync/**
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * Returns TRUE if the given planemask covers all the significant bits in the
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync * pixel values for pDrawable.
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync */
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#define EXA_PM_IS_SOLID(_pDrawable, _pm) \
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync (((_pm) & FbFullMask((_pDrawable)->depth)) == \
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync FbFullMask((_pDrawable)->depth))
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync
61cb83a8ccd1dd7f671f31fa93c9d8b7be09b4ccvboxsync#endif /* EXA_H */