📄 dri_interface.h
字号:
/* * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2007-2008 Red Hat, Inc. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. *//** * \file dri_interface.h * * This file contains all the types and functions that define the interface * between a DRI driver and driver loader. Currently, the most common driver * loader is the XFree86 libGL.so. However, other loaders do exist, and in * the future the server-side libglx.a will also be a loader. * * \author Kevin E. Martin <kevin@precisioninsight.com> * \author Ian Romanick <idr@us.ibm.com> * \author Kristian Høgsberg <krh@redhat.com> */#ifndef DRI_INTERFACE_H#define DRI_INTERFACE_H/* Make this something other than __APPLE__ for other arcs with no drm.h */#ifndef __APPLE__#include <drm.h>#elsetypedef unsigned int drm_context_t;typedef unsigned int drm_drawable_t;typedef struct drm_clip_rect drm_clip_rect_t;#endif/** * \name DRI interface structures * * The following structures define the interface between the GLX client * side library and the DRI (direct rendering infrastructure). *//*@{*/typedef struct __DRIdisplayRec __DRIdisplay;typedef struct __DRIscreenRec __DRIscreen;typedef struct __DRIcontextRec __DRIcontext;typedef struct __DRIdrawableRec __DRIdrawable;typedef struct __DRIconfigRec __DRIconfig;typedef struct __DRIframebufferRec __DRIframebuffer;typedef struct __DRIversionRec __DRIversion;typedef struct __DRIcoreExtensionRec __DRIcoreExtension;typedef struct __DRIextensionRec __DRIextension;typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;typedef struct __DRIallocateExtensionRec __DRIallocateExtension;typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;typedef struct __DRIswrastExtensionRec __DRIswrastExtension;/*@}*//** * Extension struct. Drivers 'inherit' from this struct by embedding * it as the first element in the extension struct. * * We never break API in for a DRI extension. If we need to change * the way things work in a non-backwards compatible manner, we * introduce a new extension. During a transition period, we can * leave both the old and the new extension in the driver, which * allows us to move to the new interface without having to update the * loader(s) in lock step. * * However, we can add entry points to an extension over time as long * as we don't break the old ones. As we add entry points to an * extension, we increase the version number. The corresponding * #define can be used to guard code that accesses the new entry * points at compile time and the version field in the extension * struct can be used at run-time to determine how to use the * extension. */struct __DRIextensionRec { const char *name; int version;};/** * The first set of extension are the screen extensions, returned by * __DRIcore::getExtensions(). This entry point will return a list of * extensions and the loader can use the ones it knows about by * casting them to more specific extensions and advertising any GLX * extensions the DRI extensions enables. *//** * Used by drivers to indicate support for setting the read drawable. */#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"#define __DRI_READ_DRAWABLE_VERSION 1/** * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension. */#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"#define __DRI_COPY_SUB_BUFFER_VERSION 1struct __DRIcopySubBufferExtensionRec { __DRIextension base; void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);};/** * Used by drivers that implement the GLX_SGI_swap_control or * GLX_MESA_swap_control extension. */#define __DRI_SWAP_CONTROL "DRI_SwapControl"#define __DRI_SWAP_CONTROL_VERSION 1struct __DRIswapControlExtensionRec { __DRIextension base; void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval); unsigned int (*getSwapInterval)(__DRIdrawable *drawable);};/** * Used by drivers that implement the GLX_MESA_allocate_memory. */#define __DRI_ALLOCATE "DRI_Allocate"#define __DRI_ALLOCATE_VERSION 1struct __DRIallocateExtensionRec { __DRIextension base; void *(*allocateMemory)(__DRIscreen *screen, GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer); GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer);};/** * Used by drivers that implement the GLX_MESA_swap_frame_usage extension. */#define __DRI_FRAME_TRACKING "DRI_FrameTracking"#define __DRI_FRAME_TRACKING_VERSION 1struct __DRIframeTrackingExtensionRec { __DRIextension base; /** * Enable or disable frame usage tracking. * * \since Internal API version 20030317. */ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable); /** * Retrieve frame usage information. * * \since Internal API version 20030317. */ int (*queryFrameTracking)(__DRIdrawable *drawable, int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, float * usage);};/** * Used by drivers that implement the GLX_SGI_video_sync extension. */#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1struct __DRImediaStreamCounterExtensionRec { __DRIextension base; /** * Wait for the MSC to equal target_msc, or, if that has already passed, * the next time (MSC % divisor) is equal to remainder. If divisor is * zero, the function will return as soon as MSC is greater than or equal * to target_msc. */ int (*waitForMSC)(__DRIdrawable *drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc, int64_t * sbc); /** * Get the number of vertical refreshes since some point in time before * this function was first called (i.e., system start up). */ int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable, int64_t *msc);};#define __DRI_TEX_OFFSET "DRI_TexOffset"#define __DRI_TEX_OFFSET_VERSION 1struct __DRItexOffsetExtensionRec { __DRIextension base; /** * Method to override base texture image with a driver specific 'offset'. * The depth passed in allows e.g. to ignore the alpha channel of texture * images where the non-alpha components don't occupy a whole texel. * * For GLX_EXT_texture_from_pixmap with AIGLX. */ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname, unsigned long long offset, GLint depth, GLuint pitch);};#define __DRI_TEX_BUFFER "DRI_TexBuffer"#define __DRI_TEX_BUFFER_VERSION 1struct __DRItexBufferExtensionRec { __DRIextension base; /** * Method to override base texture image with the contents of a * __DRIdrawable. * * For GLX_EXT_texture_from_pixmap with AIGLX. */ void (*setTexBuffer)(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *pDraw);};/** * XML document describing the configuration options supported by the * driver. */extern const char __driConfigOptions[];/*@}*//** * The following extensions describe loader features that the DRI * driver can make use of. Some of these are mandatory, such as the * getDrawableInfo extension for DRI and the DRI Loader extensions for * DRI2, while others are optional, and if present allow the driver to * expose certain features. The loader pass in a NULL terminated * array of these extensions to the driver in the createNewScreen * constructor. */typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;typedef struct __DRIdamageExtensionRec __DRIdamageExtension;typedef struct __DRIloaderExtensionRec __DRIloaderExtension;typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;/** * Callback to getDrawableInfo protocol */#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"#define __DRI_GET_DRAWABLE_INFO_VERSION 1struct __DRIgetDrawableInfoExtensionRec { __DRIextension base; /** * This function is used to get information about the position, size, and * clip rects of a drawable. */ GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable, unsigned int * index, unsigned int * stamp, int * x, int * y, int * width, int * height, int * numClipRects, drm_clip_rect_t ** pClipRects, int * backX, int * backY, int * numBackClipRects, drm_clip_rect_t ** pBackClipRects, void *loaderPrivate);};/** * Callback to get system time for media stream counter extensions. */#define __DRI_SYSTEM_TIME "DRI_SystemTime"#define __DRI_SYSTEM_TIME_VERSION 1struct __DRIsystemTimeExtensionRec { __DRIextension base; /** * Get the 64-bit unadjusted system time (UST). */ int (*getUST)(int64_t * ust); /** * Get the media stream counter (MSC) rate. * * Matching the definition in GLX_OML_sync_control, this function returns * the rate of the "media stream counter". In practical terms, this is * the frame refresh rate of the display. */ GLboolean (*getMSCRate)(__DRIdrawable *draw, int32_t * numerator, int32_t * denominator, void *loaderPrivate);};/** * Damage reporting */#define __DRI_DAMAGE "DRI_Damage"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -