a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright © 2008 Intel Corporation
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * copy of this software and associated documentation files (the "Software"),
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * to deal in the Software without restriction, including without limitation
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and/or sell copies of the Software, and to permit persons to whom the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Software is furnished to do so, subject to the following conditions:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The above copyright notice and this permission notice (including the next
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * paragraph) shall be included in all copies or substantial portions of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Software.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IN THE SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Authors:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Eric Anholt <eric@anholt.net>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Zhigang Gong <zhigang.gong@linux.intel.com>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef GLAMOR_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <scrnintstr.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <pixmapstr.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <gcstruct.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <picturestr.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <fb.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <fbpict.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef GLAMOR_FOR_XORG
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <xf86xv.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncstruct glamor_context;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * glamor_pixmap_type : glamor pixmap's type.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @MEMORY: pixmap is in memory.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @TEXTURE_DRM: pixmap is in a texture created from a DRM buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @SEPARATE_TEXTURE: The texture is created from a DRM buffer, but
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the format is incompatible, so this type of pixmap
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * will never fallback to DDX layer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @DRM_ONLY: pixmap is in a external DRM buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @TEXTURE_ONLY: pixmap is in an internal texture.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef enum glamor_pixmap_type {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_MEMORY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_MEMORY_MAP,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_TEXTURE_DRM,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_SEPARATE_TEXTURE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_DRM_ONLY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_TEXTURE_ONLY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_TEXTURE_LARGE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GLAMOR_TEXTURE_PACK
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} glamor_pixmap_type_t;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_EGL_EXTERNAL_BUFFER 3
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_INVERTED_Y_AXIS 1 /* compat stub */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_USE_SCREEN (1 << 1)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_USE_PICTURE_SCREEN (1 << 2)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_USE_EGL_SCREEN (1 << 3)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_NO_DRI3 (1 << 4)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync | GLAMOR_USE_SCREEN \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync | GLAMOR_USE_PICTURE_SCREEN \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync | GLAMOR_USE_EGL_SCREEN \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync | GLAMOR_NO_DRI3)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_init: Initialize glamor internal data structure.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @screen: Current screen pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @flags: Please refer the flags description above.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @GLAMOR_USE_SCREEN:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * If running in an pre-existing X environment, and the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * gl context is GLX, then you should set this bit and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * let the glamor to handle all the screen related
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * functions such as GC ops and CreatePixmap/DestroyPixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @GLAMOR_USE_PICTURE_SCREEN:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * If don't use any other underlying DDX driver to handle
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the picture related rendering functions, please set this
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * bit on. Otherwise, clear this bit. And then it is the DDX
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * driver's responsibility to determine how/when to jump to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * glamor's picture compositing path.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @GLAMOR_USE_EGL_SCREEN:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * If you are using EGL layer, then please set this bit
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * on, otherwise, clear it.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This function initializes necessary internal data structure
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * for glamor. And before calling into this function, the OpenGL
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * environment should be ready. Should be called before any real
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * glamor rendering or texture allocation functions. And should
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * be called after the DDX's screen initialization or at the last
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * step of the DDX's screen initialization.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_fini(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* This function is used to free the glamor private screen's
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * resources. If the DDX driver is not set GLAMOR_USE_SCREEN,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * then, DDX need to call this function at proper stage, if
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * it is the xorg DDX driver,then it should be called at free
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * screen stage not the close screen stage. The reason is after
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * call to this function, the xorg DDX may need to destroy the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * screen pixmap which must be a glamor pixmap and requires
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the internal data structure still exist at that time.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Otherwise, the glamor internal structure will not be freed.*/
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_close_screen(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* Let glamor to know the screen's fbo. The low level
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * driver should already assign a tex
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * to this pixmap through the set_pixmap_texture. */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_set_screen_pixmap(PixmapPtr screen_pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr *back_pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_glyphs_init(ScreenPtr pScreen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int tex);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync glamor_pixmap_type_t type);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_destroy_textured_pixmap(PixmapPtr pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_block_handler(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int depth, unsigned int usage);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_PIXMAP_CPU 0x100
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_PIXMAP_FIXUP 0x101
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_FBO_NO_FBO 0x103
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_PIXMAP_MAP 0x104
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_NO_LARGE 0x105
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo).
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @front: front pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @back: back pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Used by the DRI2 page flip. This function will exchange the KHR images and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * fbos of the two pixmaps.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr back);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr back);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* The DDX is not supposed to call these three functions */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int w,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int h);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int, Bool,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 *, CARD32 *);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_supports_pixmap_import_export: Returns whether
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * glamor_pixmap_from_fd() are supported.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @screen: Current screen pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * To have DRI3 support enabled, glamor and glamor_egl need to be
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * initialized. glamor also has to be compiled with gbm support.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The EGL layer needs to have the following extensions working:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * .EGL_KHR_gl_texture_2D_image
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * .EGL_EXT_image_dma_buf_import
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @screen: Current screen pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @pixmap: The pixmap from which we want the fd.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @stride, @size: Pointers to fill the stride and size of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * buffer associated to the fd.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the pixmap and the buffer associated by the fd will share the same
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * content.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Returns the fd on success, -1 on error.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 *stride, CARD32 *size);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/**
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @glamor_name_from_pixmap: Gets a gem name from a pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @pixmap: The pixmap from which we want the gem name.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the pixmap and the buffer associated by the gem name will share the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * same content. This function can be used by the DDX to support DRI2,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * and needs the same set of buffer export GL extensions as DRI3
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * support.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Returns the name on success, -1 on error.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 *stride, CARD32 *size);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @screen: Current screen pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @fd: The dma-buf fd to import.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @width: The width of the buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @height: The height of the buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @stride: The stride of the buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @depth: The depth of the buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @bpp: The number of bpp of the buffer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Returns a valid pixmap if the import succeeded, else NULL.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int fd,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 width,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 height,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 stride,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD8 depth,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD8 bpp);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef GLAMOR_FOR_XORG
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_EGL_MODULE_NAME "glamoregl"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_egl_init: Initialize EGL environment.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @scrn: Current screen info pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @fd: Current drm fd.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This function creates and intialize EGL contexts.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Should be called from DDX's preInit function.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Return TRUE if success, otherwise return FALSE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_egl_create_textured_screen: Create textured screen pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @screen: screen pointer to be processed.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @handle: screen pixmap's BO handle.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @stride: screen pixmap's stride in bytes.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This function is similar with the create_textured_pixmap. As the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * screen pixmap is a special, we handle it separately in this function.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int handle, int stride);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* @glamor_egl_create_textured_screen_ext:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * extent one parameter to track the pointer of the DDX layer's back pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * We need this pointer during the closing screen stage. As before back to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the DDX's close screen, we have to free all the glamor related resources.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_egl_create_textured_screen_ext(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int handle,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int stride,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *back_pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @glamor_egl_create_textured_pixmap: Try to create a textured pixmap from
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * a BO handle.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @pixmap: The pixmap need to be processed.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @handle: The BO's handle attached to this pixmap at DDX layer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @stride: Stride in bytes for this pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This function try to create a texture from the handle and attach
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the texture to the pixmap , thus glamor can render to this pixmap
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * as well. Return true if successful, otherwise return FALSE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int handle, int stride);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * from a gbm_bo.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @pixmap: The pixmap need to be processed.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @bo: a pointer on a gbm_bo structure attached to this pixmap at DDX layer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This function is similar to glamor_egl_create_textured_pixmap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct glamor_context *glamor_ctx);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int glamor_create_gc(GCPtr gc);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_validate_gc(GCPtr gc, unsigned long changes,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DrawablePtr drawable);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_destroy_gc(GCPtr gc);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define HAS_GLAMOR_DESTROY_GC 1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern Bool _X_EXPORT glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern void _X_EXPORT glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* Glamor rendering/drawing functions with XXX_nf.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * nf means no fallback within glamor internal if possible. If glamor
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * fail to accelerate the operation, glamor will return a false, and the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * caller need to implement fallback method. Return a true means the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * rendering request get done successfully. */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_fill_spans_nf(DrawablePtr drawable,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int n, DDXPointPtr points,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int *widths, int sorted);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_fill_rect_nf(DrawablePtr drawable,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int nrect, xRectangle *prect);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_put_image_nf(DrawablePtr drawable,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr gc, int depth, int x, int y,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int w, int h, int left_pad,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int image_format, char *bits);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_copy_n_to_n_nf(DrawablePtr src,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DrawablePtr dst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BoxPtr box,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int nbox,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int dx,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int dy,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool reverse,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool upsidedown, Pixel bitplane,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *closure);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_copy_nf(DrawablePtr src,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DrawablePtr dst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BoxPtr box,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int nbox,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int dx,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int dy,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool reverse,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool upsidedown, Pixel bitplane,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *closure);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_composite_nf(CARD8 op,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr source,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr mask,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr dest,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_source,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 y_source,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_mask,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 y_mask,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_dest, INT16 y_dest,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 width, CARD16 height);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_trapezoids_nf(CARD8 op,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr src, PicturePtr dst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PictFormatPtr mask_format,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_src, INT16 y_src,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int ntrap, xTrapezoid *traps);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_glyphs_nf(CARD8 op,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr src,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr dst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PictFormatPtr mask_format,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_src,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 y_src, int nlist,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GlyphListPtr list, GlyphPtr *glyphs);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_triangles_nf(CARD8 op,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr pSrc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr pDst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PictFormatPtr maskFormat,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 xSrc, INT16 ySrc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int ntris, xTriangle *tris);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void glamor_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_set_spans_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char *src, DDXPointPtr points,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int *widths, int n, int sorted);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_get_spans_nf(DrawablePtr drawable, int wmax,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DDXPointPtr points, int *widths,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int count, char *dst);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_composite_rects_nf(CARD8 op,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PicturePtr pDst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync xRenderColor *color,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int nRect, xRectangle *rects);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_get_image_nf(DrawablePtr pDrawable, int x, int y,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int w, int h, unsigned int format,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long planeMask, char *d);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_add_traps_nf(PicturePtr pPicture,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 x_off,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync INT16 y_off, int ntrap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync xTrap *traps);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr pGC, int srcx, int srcy, int w,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int h, int dstx, int dsty,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long bitPlane,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RegionPtr *pRegion);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_image_glyph_blt_nf(DrawablePtr pDrawable,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr pGC, int x, int y,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int nglyph,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CharInfoPtr *ppci,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pglyphBase);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_glyph_blt_nf(DrawablePtr pDrawable, GCPtr pGC,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int nglyph,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CharInfoPtr *ppci,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pglyphBase);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_push_pixels_nf(GCPtr pGC, PixmapPtr pBitmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DrawablePtr pDrawable, int w, int h,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_point_nf(DrawablePtr pDrawable, GCPtr pGC,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int mode, int npt, DDXPointPtr ppt);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_segment_nf(DrawablePtr pDrawable, GCPtr pGC,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int nseg, xSegment *pSeg);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int mode, int n, DDXPointPtr points);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_text8_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y, int count, char *chars, int *final_pos);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_poly_text16_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y, int count, unsigned short *chars, int *final_pos);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_image_text8_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y, int count, char *chars);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool glamor_image_text16_nf(DrawablePtr drawable, GCPtr gc,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y, int count, unsigned short *chars);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define HAS_GLAMOR_TEXT 1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef GLAMOR_FOR_XORG
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT XF86VideoAdaptorPtr glamor_xv_init(ScreenPtr pScreen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int num_texture_ports);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* GLAMOR_H */