mesa_interface: replace opaque __DRIscreen with struct dri_screen everywhere
it's always struct dri_screen Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31752>
This commit is contained in:
@@ -63,7 +63,7 @@ struct __DRIkopperExtensionRec {
|
||||
* on-screen surfaces (eg X11 window) and trying to create a swapchain for
|
||||
* a pixmap is undefined.
|
||||
*/
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
__DRIdrawable *(*createNewDrawable)(struct dri_screen *screen,
|
||||
const __DRIconfig *config,
|
||||
void *loaderPrivate,
|
||||
__DRIkopperDrawableInfo *info);
|
||||
|
@@ -623,7 +623,7 @@ void
|
||||
dri2_setup_screen(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri_screen *screen = dri_screen(dri2_dpy->dri_screen_render_gpu);
|
||||
struct dri_screen *screen = dri2_dpy->dri_screen_render_gpu;
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
unsigned int api_mask = screen->api_mask;
|
||||
|
||||
|
@@ -232,14 +232,14 @@ struct dri2_egl_display {
|
||||
|
||||
int dri2_major;
|
||||
int dri2_minor;
|
||||
__DRIscreen *dri_screen_render_gpu;
|
||||
struct dri_screen *dri_screen_render_gpu;
|
||||
/* dri_screen_display_gpu holds display GPU in case of prime gpu offloading
|
||||
* else dri_screen_render_gpu and dri_screen_display_gpu is same. In case of
|
||||
* prime gpu offloading, if display and render driver names are different
|
||||
* (potentially not compatible), dri_screen_display_gpu will be NULL but
|
||||
* fd_display_gpu will still hold fd for display driver.
|
||||
*/
|
||||
__DRIscreen *dri_screen_display_gpu;
|
||||
struct dri_screen *dri_screen_display_gpu;
|
||||
bool own_dri_screen;
|
||||
const __DRIconfig **driver_configs;
|
||||
/* fd of the GPU used for rendering. */
|
||||
|
@@ -78,7 +78,7 @@ egl_dri3_get_dri_context(struct loader_dri3_drawable *draw)
|
||||
return dri2_ctx->dri_context;
|
||||
}
|
||||
|
||||
static __DRIscreen *
|
||||
static struct dri_screen *
|
||||
egl_dri3_get_dri_screen(void)
|
||||
{
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
|
@@ -913,13 +913,12 @@ from_dri_compression_rate(enum __DRIFixedRateCompression rate)
|
||||
}
|
||||
|
||||
static __DRIimage *
|
||||
dri_create_image_from_winsys(__DRIscreen *_screen,
|
||||
dri_create_image_from_winsys(struct dri_screen *screen,
|
||||
int width, int height, const struct dri2_format_mapping *map,
|
||||
int num_handles, struct winsys_handle *whandle,
|
||||
unsigned bind,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
__DRIimage *img;
|
||||
struct pipe_resource templ;
|
||||
@@ -1088,10 +1087,10 @@ dri_create_image_from_winsys(__DRIscreen *_screen,
|
||||
}
|
||||
|
||||
static unsigned
|
||||
dri2_get_modifier_num_planes(__DRIscreen *_screen,
|
||||
dri2_get_modifier_num_planes(struct dri_screen *screen,
|
||||
uint64_t modifier, int fourcc)
|
||||
{
|
||||
struct pipe_screen *pscreen = dri_screen(_screen)->base.screen;
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
|
||||
|
||||
if (!map)
|
||||
@@ -1119,7 +1118,7 @@ dri2_get_modifier_num_planes(__DRIscreen *_screen,
|
||||
}
|
||||
|
||||
__DRIimage *
|
||||
dri_create_image(__DRIscreen *_screen,
|
||||
dri_create_image(struct dri_screen *screen,
|
||||
int width, int height,
|
||||
int format,
|
||||
const uint64_t *modifiers,
|
||||
@@ -1128,7 +1127,6 @@ dri_create_image(__DRIscreen *_screen,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
const struct dri2_format_mapping *map = dri2_get_mapping_by_format(format);
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
__DRIimage *img;
|
||||
struct pipe_resource templ;
|
||||
@@ -1505,7 +1503,7 @@ dri2_validate_usage(__DRIimage *image, unsigned int use)
|
||||
}
|
||||
|
||||
__DRIimage *
|
||||
dri2_from_names(__DRIscreen *screen, int width, int height, int fourcc,
|
||||
dri2_from_names(struct dri_screen *screen, int width, int height, int fourcc,
|
||||
int *names, int num_names, int *strides, int *offsets,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
@@ -1579,11 +1577,10 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
|
||||
}
|
||||
|
||||
bool
|
||||
dri_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
|
||||
dri_query_dma_buf_modifiers(struct dri_screen *screen, int fourcc, int max,
|
||||
uint64_t *modifiers, unsigned int *external_only,
|
||||
int *count)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
|
||||
enum pipe_format format;
|
||||
@@ -1617,11 +1614,10 @@ dri_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
|
||||
}
|
||||
|
||||
bool
|
||||
dri2_query_dma_buf_format_modifier_attribs(__DRIscreen *_screen,
|
||||
dri2_query_dma_buf_format_modifier_attribs(struct dri_screen *screen,
|
||||
uint32_t fourcc, uint64_t modifier,
|
||||
int attrib, uint64_t *value)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
|
||||
if (!pscreen->query_dmabuf_modifiers)
|
||||
@@ -1629,7 +1625,7 @@ dri2_query_dma_buf_format_modifier_attribs(__DRIscreen *_screen,
|
||||
|
||||
switch (attrib) {
|
||||
case __DRI_IMAGE_FORMAT_MODIFIER_ATTRIB_PLANE_COUNT: {
|
||||
uint64_t mod_planes = dri2_get_modifier_num_planes(_screen, modifier,
|
||||
uint64_t mod_planes = dri2_get_modifier_num_planes(screen, modifier,
|
||||
fourcc);
|
||||
if (mod_planes > 0)
|
||||
*value = mod_planes;
|
||||
@@ -1641,7 +1637,7 @@ dri2_query_dma_buf_format_modifier_attribs(__DRIscreen *_screen,
|
||||
}
|
||||
|
||||
__DRIimage *
|
||||
dri2_from_dma_bufs(__DRIscreen *screen,
|
||||
dri2_from_dma_bufs(struct dri_screen *screen,
|
||||
int width, int height, int fourcc,
|
||||
uint64_t modifier, int *fds, int num_fds,
|
||||
int *strides, int *offsets,
|
||||
@@ -1656,7 +1652,7 @@ dri2_from_dma_bufs(__DRIscreen *screen,
|
||||
__DRIimage *img;
|
||||
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
|
||||
|
||||
if (!dri_screen(screen)->dmabuf_import) {
|
||||
if (!screen->dmabuf_import) {
|
||||
if (error)
|
||||
*error = __DRI_IMAGE_ERROR_BAD_PARAMETER;
|
||||
return NULL;
|
||||
@@ -1729,10 +1725,9 @@ exit:
|
||||
}
|
||||
|
||||
bool
|
||||
dri2_query_compression_rates(__DRIscreen *_screen, const __DRIconfig *config, int max,
|
||||
dri2_query_compression_rates(struct dri_screen *screen, const __DRIconfig *config, int max,
|
||||
enum __DRIFixedRateCompression *rates, int *count)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
struct gl_config *gl_config = (struct gl_config *) config;
|
||||
enum pipe_format format = gl_config->color_format;
|
||||
@@ -1754,11 +1749,10 @@ dri2_query_compression_rates(__DRIscreen *_screen, const __DRIconfig *config, in
|
||||
}
|
||||
|
||||
bool
|
||||
dri2_query_compression_modifiers(__DRIscreen *_screen, uint32_t fourcc,
|
||||
dri2_query_compression_modifiers(struct dri_screen *screen, uint32_t fourcc,
|
||||
enum __DRIFixedRateCompression rate, int max,
|
||||
uint64_t *modifiers, int *count)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
|
||||
uint32_t pipe_rate = from_dri_compression_rate(rate);
|
||||
@@ -1893,10 +1887,8 @@ dri2_unmap_image(__DRIcontext *context, __DRIimage *image, void *data)
|
||||
}
|
||||
|
||||
int
|
||||
dri2_get_capabilities(__DRIscreen *_screen)
|
||||
dri2_get_capabilities(struct dri_screen *screen)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
|
||||
return (screen->can_share_buffer ? __DRI_IMAGE_CAP_GLOBAL_NAMES : 0);
|
||||
}
|
||||
|
||||
@@ -1968,10 +1960,9 @@ dri_set_damage_region(__DRIdrawable *dPriv, unsigned int nrects, int *rects)
|
||||
* \brief the DRI2blobExtension set_cache_funcs method
|
||||
*/
|
||||
void
|
||||
dri_set_blob_cache_funcs(__DRIscreen *sPriv, __DRIblobCacheSet set,
|
||||
dri_set_blob_cache_funcs(struct dri_screen *screen, __DRIblobCacheSet set,
|
||||
__DRIblobCacheGet get)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
|
||||
if (!pscreen->get_disk_shader_cache)
|
||||
|
@@ -149,10 +149,9 @@ dri_st_framebuffer_flush_swapbuffers(struct st_context *st,
|
||||
* This is called when we need to set up GL rendering to a new X window.
|
||||
*/
|
||||
__DRIdrawable *
|
||||
dri_create_drawable(__DRIscreen *psp, const __DRIconfig *config,
|
||||
dri_create_drawable(struct dri_screen *screen, const __DRIconfig *config,
|
||||
bool isPixmap, void *loaderPrivate)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
const struct gl_config *visual = &config->modes;
|
||||
struct dri_drawable *drawable = NULL;
|
||||
|
||||
|
@@ -78,9 +78,8 @@ struct dri2_fence {
|
||||
};
|
||||
|
||||
unsigned
|
||||
dri_fence_get_caps(__DRIscreen *_screen)
|
||||
dri_fence_get_caps(struct dri_screen *driscreen)
|
||||
{
|
||||
struct dri_screen *driscreen = dri_screen(_screen);
|
||||
struct pipe_screen *screen = driscreen->base.screen;
|
||||
unsigned caps = 0;
|
||||
|
||||
@@ -146,9 +145,8 @@ dri_create_fence_fd(__DRIcontext *_ctx, int fd)
|
||||
}
|
||||
|
||||
int
|
||||
dri_get_fence_fd(__DRIscreen *_screen, void *_fence)
|
||||
dri_get_fence_fd(struct dri_screen *driscreen, void *_fence)
|
||||
{
|
||||
struct dri_screen *driscreen = dri_screen(_screen);
|
||||
struct pipe_screen *screen = driscreen->base.screen;
|
||||
struct dri2_fence *fence = (struct dri2_fence*)_fence;
|
||||
|
||||
@@ -156,9 +154,8 @@ dri_get_fence_fd(__DRIscreen *_screen, void *_fence)
|
||||
}
|
||||
|
||||
void *
|
||||
dri_get_fence_from_cl_event(__DRIscreen *_screen, intptr_t cl_event)
|
||||
dri_get_fence_from_cl_event(struct dri_screen *driscreen, intptr_t cl_event)
|
||||
{
|
||||
struct dri_screen *driscreen = dri_screen(_screen);
|
||||
struct dri2_fence *fence;
|
||||
|
||||
if (!dri2_load_opencl_interop(driscreen))
|
||||
@@ -180,9 +177,8 @@ dri_get_fence_from_cl_event(__DRIscreen *_screen, intptr_t cl_event)
|
||||
}
|
||||
|
||||
void
|
||||
dri_destroy_fence(__DRIscreen *_screen, void *_fence)
|
||||
dri_destroy_fence(struct dri_screen *driscreen, void *_fence)
|
||||
{
|
||||
struct dri_screen *driscreen = dri_screen(_screen);
|
||||
struct pipe_screen *screen = driscreen->base.screen;
|
||||
struct dri2_fence *fence = (struct dri2_fence*)_fence;
|
||||
|
||||
@@ -702,10 +698,9 @@ dri2_yuv_dma_buf_supported(struct dri_screen *screen,
|
||||
}
|
||||
|
||||
bool
|
||||
dri_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
|
||||
dri_query_dma_buf_formats(struct dri_screen *screen, int max, int *formats,
|
||||
int *count)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
int i, j;
|
||||
|
||||
@@ -736,7 +731,7 @@ dri_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
|
||||
|
||||
|
||||
__DRIimage *
|
||||
dri_create_image_with_modifiers(__DRIscreen *screen,
|
||||
dri_create_image_with_modifiers(struct dri_screen *screen,
|
||||
uint32_t width, uint32_t height,
|
||||
uint32_t dri_format, uint32_t dri_usage,
|
||||
const uint64_t *modifiers,
|
||||
|
@@ -76,11 +76,9 @@ driQueryRendererIntegerCommon(struct dri_screen *screen, int param, unsigned int
|
||||
}
|
||||
|
||||
int
|
||||
dri_query_renderer_integer(__DRIscreen *_screen, int param,
|
||||
dri_query_renderer_integer(struct dri_screen *screen, int param,
|
||||
unsigned int *value)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
|
||||
switch (param) {
|
||||
case __DRI2_RENDERER_VENDOR_ID:
|
||||
value[0] =
|
||||
@@ -125,11 +123,9 @@ dri_query_renderer_integer(__DRIscreen *_screen, int param,
|
||||
}
|
||||
|
||||
int
|
||||
dri_query_renderer_string(__DRIscreen *_screen, int param,
|
||||
dri_query_renderer_string(struct dri_screen *screen, int param,
|
||||
const char **value)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(_screen);
|
||||
|
||||
switch (param) {
|
||||
case __DRI2_RENDERER_VENDOR_ID:
|
||||
value[0] = screen->base.screen->get_vendor(screen->base.screen);
|
||||
|
@@ -131,19 +131,6 @@ struct dri_screen
|
||||
bool is_sw;
|
||||
};
|
||||
|
||||
/** cast wrapper */
|
||||
static inline struct dri_screen *
|
||||
dri_screen(__DRIscreen * sPriv)
|
||||
{
|
||||
return (struct dri_screen *)sPriv;
|
||||
}
|
||||
|
||||
static inline __DRIscreen *
|
||||
opaque_dri_screen(struct dri_screen *screen)
|
||||
{
|
||||
return (__DRIscreen *)screen;
|
||||
}
|
||||
|
||||
static inline const __DRIkopperLoaderExtension *
|
||||
dri_screen_get_kopper(struct dri_screen *screen)
|
||||
{
|
||||
|
@@ -98,7 +98,7 @@ setupLoaderExtensions(struct dri_screen *screen,
|
||||
* It's used to create global state for the driver across contexts on the same
|
||||
* Display.
|
||||
*/
|
||||
__DRIscreen *
|
||||
struct dri_screen *
|
||||
driCreateNewScreen3(int scrn, int fd,
|
||||
const __DRIextension **loader_extensions,
|
||||
enum dri_screen_type type,
|
||||
@@ -186,7 +186,7 @@ driCreateNewScreen3(int scrn, int fd,
|
||||
if (screen->max_gl_es2_version >= 30)
|
||||
screen->api_mask |= (1 << __DRI_API_GLES3);
|
||||
|
||||
return opaque_dri_screen(screen);
|
||||
return screen;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,7 +196,7 @@ driCreateNewScreen3(int scrn, int fd,
|
||||
* This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
|
||||
* drmClose(), and finally frees \p screenPrivate.
|
||||
*/
|
||||
void driDestroyScreen(__DRIscreen *psp)
|
||||
void driDestroyScreen(struct dri_screen *psp)
|
||||
{
|
||||
if (psp) {
|
||||
/* No interaction with the X-server is possible at this point. This
|
||||
@@ -204,7 +204,7 @@ void driDestroyScreen(__DRIscreen *psp)
|
||||
* stream open to the X-server anymore.
|
||||
*/
|
||||
|
||||
dri_destroy_screen(dri_screen(psp));
|
||||
dri_destroy_screen(psp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ validate_context_version(struct dri_screen *screen,
|
||||
/*@{*/
|
||||
|
||||
__DRIcontext *
|
||||
driCreateContextAttribs(__DRIscreen *psp, int api,
|
||||
driCreateContextAttribs(struct dri_screen *screen, int api,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
unsigned num_attribs,
|
||||
@@ -431,7 +431,6 @@ driCreateContextAttribs(__DRIscreen *psp, int api,
|
||||
unsigned *error,
|
||||
void *data)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
|
||||
gl_api mesa_api;
|
||||
struct __DriverContextConfig ctx_config;
|
||||
@@ -609,7 +608,7 @@ driCreateContextAttribs(__DRIscreen *psp, int api,
|
||||
}
|
||||
|
||||
static __DRIcontext *
|
||||
driCreateNewContextForAPI(__DRIscreen *screen, int api,
|
||||
driCreateNewContextForAPI(struct dri_screen *screen, int api,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared, void *data)
|
||||
{
|
||||
@@ -620,7 +619,7 @@ driCreateNewContextForAPI(__DRIscreen *screen, int api,
|
||||
}
|
||||
|
||||
__DRIcontext *
|
||||
driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
|
||||
driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config,
|
||||
__DRIcontext *shared, void *data)
|
||||
{
|
||||
return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,
|
||||
@@ -721,10 +720,8 @@ driDestroyDrawable(__DRIdrawable *pdp)
|
||||
}
|
||||
|
||||
static int
|
||||
dri2ConfigQueryb(__DRIscreen *psp, const char *var, unsigned char *val)
|
||||
dri2ConfigQueryb(struct dri_screen *screen, const char *var, unsigned char *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
|
||||
if (!driCheckOption(&screen->optionCache, var, DRI_BOOL))
|
||||
return -1;
|
||||
|
||||
@@ -734,10 +731,8 @@ dri2ConfigQueryb(__DRIscreen *psp, const char *var, unsigned char *val)
|
||||
}
|
||||
|
||||
static int
|
||||
dri2ConfigQueryi(__DRIscreen *psp, const char *var, int *val)
|
||||
dri2ConfigQueryi(struct dri_screen *screen, const char *var, int *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
|
||||
if (!driCheckOption(&screen->optionCache, var, DRI_INT) &&
|
||||
!driCheckOption(&screen->optionCache, var, DRI_ENUM))
|
||||
return -1;
|
||||
@@ -748,10 +743,8 @@ dri2ConfigQueryi(__DRIscreen *psp, const char *var, int *val)
|
||||
}
|
||||
|
||||
static int
|
||||
dri2ConfigQueryf(__DRIscreen *psp, const char *var, float *val)
|
||||
dri2ConfigQueryf(struct dri_screen *screen, const char *var, float *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
|
||||
if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT))
|
||||
return -1;
|
||||
|
||||
@@ -761,10 +754,8 @@ dri2ConfigQueryf(__DRIscreen *psp, const char *var, float *val)
|
||||
}
|
||||
|
||||
static int
|
||||
dri2ConfigQuerys(__DRIscreen *psp, const char *var, char **val)
|
||||
dri2ConfigQuerys(struct dri_screen *screen, const char *var, char **val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(psp);
|
||||
|
||||
if (!driCheckOption(&screen->optionCache, var, DRI_STRING))
|
||||
return -1;
|
||||
|
||||
@@ -778,13 +769,11 @@ dri2ConfigQuerys(__DRIscreen *psp, const char *var, char **val)
|
||||
* \brief the DRI2ConfigQueryExtension configQueryb method
|
||||
*/
|
||||
int
|
||||
dri2GalliumConfigQueryb(__DRIscreen *sPriv, const char *var,
|
||||
dri2GalliumConfigQueryb(struct dri_screen *screen, const char *var,
|
||||
unsigned char *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
|
||||
if (!driCheckOption(&screen->dev->option_cache, var, DRI_BOOL))
|
||||
return dri2ConfigQueryb(sPriv, var, val);
|
||||
return dri2ConfigQueryb(screen, var, val);
|
||||
|
||||
*val = driQueryOptionb(&screen->dev->option_cache, var);
|
||||
|
||||
@@ -795,13 +784,11 @@ dri2GalliumConfigQueryb(__DRIscreen *sPriv, const char *var,
|
||||
* \brief the DRI2ConfigQueryExtension configQueryi method
|
||||
*/
|
||||
int
|
||||
dri2GalliumConfigQueryi(__DRIscreen *sPriv, const char *var, int *val)
|
||||
dri2GalliumConfigQueryi(struct dri_screen *screen, const char *var, int *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
|
||||
if (!driCheckOption(&screen->dev->option_cache, var, DRI_INT) &&
|
||||
!driCheckOption(&screen->dev->option_cache, var, DRI_ENUM))
|
||||
return dri2ConfigQueryi(sPriv, var, val);
|
||||
return dri2ConfigQueryi(screen, var, val);
|
||||
|
||||
*val = driQueryOptioni(&screen->dev->option_cache, var);
|
||||
|
||||
@@ -812,12 +799,10 @@ dri2GalliumConfigQueryi(__DRIscreen *sPriv, const char *var, int *val)
|
||||
* \brief the DRI2ConfigQueryExtension configQueryf method
|
||||
*/
|
||||
int
|
||||
dri2GalliumConfigQueryf(__DRIscreen *sPriv, const char *var, float *val)
|
||||
dri2GalliumConfigQueryf(struct dri_screen *screen, const char *var, float *val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
|
||||
if (!driCheckOption(&screen->dev->option_cache, var, DRI_FLOAT))
|
||||
return dri2ConfigQueryf(sPriv, var, val);
|
||||
return dri2ConfigQueryf(screen, var, val);
|
||||
|
||||
*val = driQueryOptionf(&screen->dev->option_cache, var);
|
||||
|
||||
@@ -828,12 +813,10 @@ dri2GalliumConfigQueryf(__DRIscreen *sPriv, const char *var, float *val)
|
||||
* \brief the DRI2ConfigQueryExtension configQuerys method
|
||||
*/
|
||||
int
|
||||
dri2GalliumConfigQuerys(__DRIscreen *sPriv, const char *var, char **val)
|
||||
dri2GalliumConfigQuerys(struct dri_screen *screen, const char *var, char **val)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
|
||||
if (!driCheckOption(&screen->dev->option_cache, var, DRI_STRING))
|
||||
return dri2ConfigQuerys(sPriv, var, val);
|
||||
return dri2ConfigQuerys(screen, var, val);
|
||||
|
||||
*val = driQueryOptionstr(&screen->dev->option_cache, var);
|
||||
|
||||
@@ -856,9 +839,9 @@ const __DRI2configQueryExtension dri2GalliumConfigQueryExtension = {
|
||||
|
||||
|
||||
unsigned int
|
||||
driGetAPIMask(__DRIscreen *screen)
|
||||
driGetAPIMask(struct dri_screen *screen)
|
||||
{
|
||||
return dri_screen(screen)->api_mask;
|
||||
return screen->api_mask;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1030,7 +1013,7 @@ driImageFormatToSizedInternalGLFormat(uint32_t image_format)
|
||||
return GL_NONE;
|
||||
}
|
||||
|
||||
static int dri_vblank_mode(__DRIscreen *driScreen)
|
||||
static int dri_vblank_mode(struct dri_screen *driScreen)
|
||||
{
|
||||
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
|
||||
|
||||
@@ -1039,7 +1022,7 @@ static int dri_vblank_mode(__DRIscreen *driScreen)
|
||||
return vblank_mode;
|
||||
}
|
||||
|
||||
int dri_get_initial_swap_interval(__DRIscreen *driScreen)
|
||||
int dri_get_initial_swap_interval(struct dri_screen *driScreen)
|
||||
{
|
||||
int vblank_mode = dri_vblank_mode(driScreen);
|
||||
|
||||
@@ -1054,7 +1037,7 @@ int dri_get_initial_swap_interval(__DRIscreen *driScreen)
|
||||
}
|
||||
}
|
||||
|
||||
bool dri_valid_swap_interval(__DRIscreen *driScreen, int interval)
|
||||
bool dri_valid_swap_interval(struct dri_screen *driScreen, int interval)
|
||||
{
|
||||
int vblank_mode = dri_vblank_mode(driScreen);
|
||||
|
||||
@@ -1075,14 +1058,13 @@ bool dri_valid_swap_interval(__DRIscreen *driScreen, int interval)
|
||||
}
|
||||
|
||||
struct pipe_screen *
|
||||
dri_get_pipe_screen(__DRIscreen *driScreen)
|
||||
dri_get_pipe_screen(struct dri_screen *screen)
|
||||
{
|
||||
struct dri_screen *screen = dri_screen(driScreen);
|
||||
return screen->base.screen;
|
||||
}
|
||||
|
||||
int
|
||||
dri_get_screen_param(__DRIscreen *driScreen, enum pipe_cap param)
|
||||
dri_get_screen_param(struct dri_screen *driScreen, enum pipe_cap param)
|
||||
{
|
||||
struct pipe_screen *screen = dri_get_pipe_screen(driScreen);
|
||||
return screen->get_param(screen, param);
|
||||
|
@@ -106,14 +106,14 @@ struct __DriverContextConfig {
|
||||
#define __DRIVER_CONTEXT_ATTRIB_NO_ERROR (1 << 3)
|
||||
#define __DRIVER_CONTEXT_ATTRIB_PROTECTED (1 << 4)
|
||||
|
||||
PUBLIC __DRIscreen *
|
||||
PUBLIC struct dri_screen *
|
||||
driCreateNewScreen3(int scrn, int fd,
|
||||
const __DRIextension **loader_extensions,
|
||||
enum dri_screen_type type,
|
||||
const __DRIconfig ***driver_configs, bool driver_name_is_inferred,
|
||||
bool has_multibuffer, void *data);
|
||||
PUBLIC __DRIcontext *
|
||||
driCreateContextAttribs(__DRIscreen *psp, int api,
|
||||
driCreateContextAttribs(struct dri_screen *psp, int api,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
unsigned num_attribs,
|
||||
@@ -124,12 +124,12 @@ driCreateContextAttribs(__DRIscreen *psp, int api,
|
||||
extern uint32_t
|
||||
driImageFormatToSizedInternalGLFormat(uint32_t image_format);
|
||||
PUBLIC unsigned int
|
||||
driGetAPIMask(__DRIscreen *screen);
|
||||
driGetAPIMask(struct dri_screen *screen);
|
||||
PUBLIC __DRIdrawable *
|
||||
dri_create_drawable(__DRIscreen *psp, const __DRIconfig *config,
|
||||
dri_create_drawable(struct dri_screen *psp, const __DRIconfig *config,
|
||||
bool isPixmap, void *loaderPrivate);
|
||||
extern const __DRIimageDriverExtension driImageDriverExtension;
|
||||
PUBLIC void driDestroyScreen(__DRIscreen *psp);
|
||||
PUBLIC void driDestroyScreen(struct dri_screen *psp);
|
||||
PUBLIC int
|
||||
driGetConfigAttrib(const __DRIconfig *config, unsigned int attrib, unsigned int *value);
|
||||
PUBLIC int
|
||||
@@ -141,7 +141,7 @@ driSwapBuffers(__DRIdrawable *pdp);
|
||||
PUBLIC void
|
||||
driSwapBuffersWithDamage(__DRIdrawable *pdp, int nrects, const int *rects);
|
||||
PUBLIC __DRIcontext *
|
||||
driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, __DRIcontext *shared, void *data);
|
||||
driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, __DRIcontext *shared, void *data);
|
||||
PUBLIC int
|
||||
driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask);
|
||||
PUBLIC void
|
||||
@@ -155,7 +155,7 @@ kopperSwapBuffers(__DRIdrawable *dPriv, uint32_t flush_flags);
|
||||
PUBLIC int64_t
|
||||
kopperSwapBuffersWithDamage(__DRIdrawable *dPriv, uint32_t flush_flags, int nrects, const int *rects);
|
||||
PUBLIC __DRIdrawable *
|
||||
kopperCreateNewDrawable(__DRIscreen *psp,
|
||||
kopperCreateNewDrawable(struct dri_screen *psp,
|
||||
const __DRIconfig *config,
|
||||
void *data,
|
||||
__DRIkopperDrawableInfo *info);
|
||||
@@ -172,10 +172,10 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
|
||||
GLint format, __DRIdrawable *dPriv);
|
||||
|
||||
PUBLIC int
|
||||
dri_query_renderer_string(__DRIscreen *_screen, int param,
|
||||
dri_query_renderer_string(struct dri_screen *_screen, int param,
|
||||
const char **value);
|
||||
PUBLIC int
|
||||
dri_query_renderer_integer(__DRIscreen *_screen, int param,
|
||||
dri_query_renderer_integer(struct dri_screen *_screen, int param,
|
||||
unsigned int *value);
|
||||
|
||||
PUBLIC void
|
||||
@@ -189,17 +189,17 @@ PUBLIC void
|
||||
dri_invalidate_drawable(__DRIdrawable *dPriv);
|
||||
|
||||
PUBLIC int
|
||||
dri2GalliumConfigQueryb(__DRIscreen *sPriv, const char *var,
|
||||
dri2GalliumConfigQueryb(struct dri_screen *sPriv, const char *var,
|
||||
unsigned char *val);
|
||||
PUBLIC int
|
||||
dri2GalliumConfigQueryi(__DRIscreen *sPriv, const char *var, int *val);
|
||||
dri2GalliumConfigQueryi(struct dri_screen *sPriv, const char *var, int *val);
|
||||
PUBLIC int
|
||||
dri2GalliumConfigQueryf(__DRIscreen *sPriv, const char *var, float *val);
|
||||
dri2GalliumConfigQueryf(struct dri_screen *sPriv, const char *var, float *val);
|
||||
PUBLIC int
|
||||
dri2GalliumConfigQuerys(__DRIscreen *sPriv, const char *var, char **val);
|
||||
dri2GalliumConfigQuerys(struct dri_screen *sPriv, const char *var, char **val);
|
||||
|
||||
PUBLIC int dri_get_initial_swap_interval(__DRIscreen *driScreen);
|
||||
PUBLIC bool dri_valid_swap_interval(__DRIscreen *driScreen, int interval);
|
||||
PUBLIC int dri_get_initial_swap_interval(struct dri_screen *driScreen);
|
||||
PUBLIC bool dri_valid_swap_interval(struct dri_screen *driScreen, int interval);
|
||||
|
||||
PUBLIC void
|
||||
dri_throttle(__DRIcontext *cPriv, __DRIdrawable *dPriv,
|
||||
@@ -231,13 +231,13 @@ dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture,
|
||||
void *loaderPrivate);
|
||||
|
||||
PUBLIC __DRIimage *
|
||||
dri_create_image(__DRIscreen *_screen,
|
||||
int width, int height,
|
||||
int format,
|
||||
const uint64_t *modifiers,
|
||||
const unsigned _count,
|
||||
unsigned int use,
|
||||
void *loaderPrivate);
|
||||
dri_create_image(struct dri_screen *screen,
|
||||
int width, int height,
|
||||
int format,
|
||||
const uint64_t *modifiers,
|
||||
const unsigned _count,
|
||||
unsigned int use,
|
||||
void *loaderPrivate);
|
||||
PUBLIC GLboolean
|
||||
dri2_query_image(__DRIimage *image, int attrib, int *value);
|
||||
PUBLIC __DRIimage *
|
||||
@@ -245,13 +245,13 @@ dri2_dup_image(__DRIimage *image, void *loaderPrivate);
|
||||
PUBLIC GLboolean
|
||||
dri2_validate_usage(__DRIimage *image, unsigned int use);
|
||||
PUBLIC __DRIimage *
|
||||
dri2_from_names(__DRIscreen *screen, int width, int height, int fourcc,
|
||||
dri2_from_names(struct dri_screen *screen, int width, int height, int fourcc,
|
||||
int *names, int num_names, int *strides, int *offsets,
|
||||
void *loaderPrivate);
|
||||
PUBLIC __DRIimage *
|
||||
dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate);
|
||||
PUBLIC __DRIimage *
|
||||
dri2_from_dma_bufs(__DRIscreen *screen,
|
||||
dri2_from_dma_bufs(struct dri_screen *screen,
|
||||
int width, int height, int fourcc,
|
||||
uint64_t modifier, int *fds, int num_fds,
|
||||
int *strides, int *offsets,
|
||||
@@ -268,7 +268,7 @@ dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src,
|
||||
int srcx0, int srcy0, int srcwidth, int srcheight,
|
||||
int flush_flag);
|
||||
PUBLIC int
|
||||
dri2_get_capabilities(__DRIscreen *_screen);
|
||||
dri2_get_capabilities(struct dri_screen *_screen);
|
||||
PUBLIC void *
|
||||
dri2_map_image(__DRIcontext *context, __DRIimage *image,
|
||||
int x0, int y0, int width, int height,
|
||||
@@ -276,18 +276,18 @@ dri2_map_image(__DRIcontext *context, __DRIimage *image,
|
||||
PUBLIC void
|
||||
dri2_unmap_image(__DRIcontext *context, __DRIimage *image, void *data);
|
||||
PUBLIC bool
|
||||
dri_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
|
||||
dri_query_dma_buf_formats(struct dri_screen *_screen, int max, int *formats,
|
||||
int *count);
|
||||
PUBLIC bool
|
||||
dri_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
|
||||
dri_query_dma_buf_modifiers(struct dri_screen *_screen, int fourcc, int max,
|
||||
uint64_t *modifiers, unsigned int *external_only,
|
||||
int *count);
|
||||
PUBLIC bool
|
||||
dri2_query_dma_buf_format_modifier_attribs(__DRIscreen *_screen,
|
||||
dri2_query_dma_buf_format_modifier_attribs(struct dri_screen *_screen,
|
||||
uint32_t fourcc, uint64_t modifier,
|
||||
int attrib, uint64_t *value);
|
||||
PUBLIC __DRIimage *
|
||||
dri_create_image_with_modifiers(__DRIscreen *screen,
|
||||
dri_create_image_with_modifiers(struct dri_screen *screen,
|
||||
uint32_t width, uint32_t height,
|
||||
uint32_t dri_format, uint32_t dri_usage,
|
||||
const uint64_t *modifiers,
|
||||
@@ -303,10 +303,10 @@ PUBLIC void
|
||||
dri2_set_in_fence_fd(__DRIimage *img, int fd);
|
||||
|
||||
PUBLIC bool
|
||||
dri2_query_compression_rates(__DRIscreen *_screen, const __DRIconfig *config, int max,
|
||||
dri2_query_compression_rates(struct dri_screen *_screen, const __DRIconfig *config, int max,
|
||||
enum __DRIFixedRateCompression *rates, int *count);
|
||||
PUBLIC bool
|
||||
dri2_query_compression_modifiers(__DRIscreen *_screen, uint32_t fourcc,
|
||||
dri2_query_compression_modifiers(struct dri_screen *_screen, uint32_t fourcc,
|
||||
enum __DRIFixedRateCompression rate, int max,
|
||||
uint64_t *modifiers, int *count);
|
||||
|
||||
@@ -314,17 +314,17 @@ PUBLIC void
|
||||
dri_set_damage_region(__DRIdrawable *dPriv, unsigned int nrects, int *rects);
|
||||
|
||||
PUBLIC unsigned
|
||||
dri_fence_get_caps(__DRIscreen *_screen);
|
||||
dri_fence_get_caps(struct dri_screen *screen);
|
||||
PUBLIC void *
|
||||
dri_create_fence(__DRIcontext *_ctx);
|
||||
PUBLIC void *
|
||||
dri_create_fence_fd(__DRIcontext *_ctx, int fd);
|
||||
PUBLIC int
|
||||
dri_get_fence_fd(__DRIscreen *_screen, void *_fence);
|
||||
dri_get_fence_fd(struct dri_screen *driscreen, void *_fence);
|
||||
PUBLIC void *
|
||||
dri_get_fence_from_cl_event(__DRIscreen *_screen, intptr_t cl_event);
|
||||
dri_get_fence_from_cl_event(struct dri_screen *driscreen, intptr_t cl_event);
|
||||
PUBLIC void
|
||||
dri_destroy_fence(__DRIscreen *_screen, void *_fence);
|
||||
dri_destroy_fence(struct dri_screen *driscreen, void *_fence);
|
||||
PUBLIC GLboolean
|
||||
dri_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
|
||||
uint64_t timeout);
|
||||
@@ -332,11 +332,11 @@ PUBLIC void
|
||||
dri_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags);
|
||||
|
||||
PUBLIC void
|
||||
dri_set_blob_cache_funcs(__DRIscreen *sPriv, __DRIblobCacheSet set,
|
||||
dri_set_blob_cache_funcs(struct dri_screen *screen, __DRIblobCacheSet set,
|
||||
__DRIblobCacheGet get);
|
||||
|
||||
PUBLIC struct pipe_screen *
|
||||
dri_get_pipe_screen(__DRIscreen *driScreen);
|
||||
dri_get_pipe_screen(struct dri_screen *driScreen);
|
||||
PUBLIC int
|
||||
dri_get_screen_param(__DRIscreen *driScreen, enum pipe_cap param);
|
||||
dri_get_screen_param(struct dri_screen *driScreen, enum pipe_cap param);
|
||||
#endif /* _DRI_UTIL_H_ */
|
||||
|
@@ -156,7 +156,7 @@ kopper_get_pixmap_buffer(struct dri_drawable *drawable,
|
||||
*/
|
||||
struct dri_screen *screen = drawable->screen;
|
||||
|
||||
drawable->image = loader_dri3_get_pixmap_buffer(conn, pixmap, opaque_dri_screen(screen),
|
||||
drawable->image = loader_dri3_get_pixmap_buffer(conn, pixmap, screen,
|
||||
fourcc, drawable->screen->dmabuf_import, &width, &height, drawable);
|
||||
if (!drawable->image)
|
||||
return NULL;
|
||||
|
@@ -47,7 +47,7 @@
|
||||
struct loader_dri3_blit_context {
|
||||
simple_mtx_t mtx;
|
||||
__DRIcontext *ctx;
|
||||
__DRIscreen *cur_screen;
|
||||
struct dri_screen *cur_screen;
|
||||
const __DRIcoreExtension *core;
|
||||
};
|
||||
|
||||
@@ -363,8 +363,8 @@ int
|
||||
loader_dri3_drawable_init(xcb_connection_t *conn,
|
||||
xcb_drawable_t drawable,
|
||||
enum loader_dri3_drawable_type type,
|
||||
__DRIscreen *dri_screen_render_gpu,
|
||||
__DRIscreen *dri_screen_display_gpu,
|
||||
struct dri_screen *dri_screen_render_gpu,
|
||||
struct dri_screen *dri_screen_display_gpu,
|
||||
bool multiplanes_available,
|
||||
bool prefer_back_buffer_reuse,
|
||||
const __DRIconfig *dri_config,
|
||||
@@ -1763,7 +1763,7 @@ __DRIimage *
|
||||
loader_dri3_create_image(xcb_connection_t *c,
|
||||
xcb_dri3_buffer_from_pixmap_reply_t *bp_reply,
|
||||
unsigned int fourcc,
|
||||
__DRIscreen *dri_screen,
|
||||
struct dri_screen *dri_screen,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
int *fds;
|
||||
@@ -1810,7 +1810,7 @@ __DRIimage *
|
||||
loader_dri3_create_image_from_buffers(xcb_connection_t *c,
|
||||
xcb_dri3_buffers_from_pixmap_reply_t *bp_reply,
|
||||
unsigned int fourcc,
|
||||
__DRIscreen *dri_screen,
|
||||
struct dri_screen *dri_screen,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
__DRIimage *ret;
|
||||
@@ -1849,7 +1849,7 @@ loader_dri3_create_image_from_buffers(xcb_connection_t *c,
|
||||
#endif
|
||||
|
||||
__DRIimage *
|
||||
loader_dri3_get_pixmap_buffer(xcb_connection_t *conn, xcb_drawable_t pixmap, __DRIscreen *screen,
|
||||
loader_dri3_get_pixmap_buffer(xcb_connection_t *conn, xcb_drawable_t pixmap, struct dri_screen *screen,
|
||||
unsigned fourcc, bool multiplanes_available,
|
||||
int *width, int *height, void *loader_data)
|
||||
{
|
||||
@@ -1907,7 +1907,7 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable, unsigned int fourcc,
|
||||
int width;
|
||||
int height;
|
||||
int fence_fd;
|
||||
__DRIscreen *cur_screen;
|
||||
struct dri_screen *cur_screen;
|
||||
|
||||
if (buffer)
|
||||
return buffer;
|
||||
@@ -2280,12 +2280,12 @@ loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw)
|
||||
|
||||
/**
|
||||
* Perform any cleanup associated with a close screen operation.
|
||||
* \param dri_screen[in,out] Pointer to __DRIscreen about to be closed.
|
||||
* \param dri_screen[in,out] Pointer to struct dri_screen about to be closed.
|
||||
*
|
||||
* This function destroys the screen's cached swap context if any.
|
||||
*/
|
||||
void
|
||||
loader_dri3_close_screen(__DRIscreen *dri_screen)
|
||||
loader_dri3_close_screen(struct dri_screen *dri_screen)
|
||||
{
|
||||
simple_mtx_lock(&blit_context.mtx);
|
||||
if (blit_context.ctx && blit_context.cur_screen == dri_screen) {
|
||||
|
@@ -101,7 +101,7 @@ struct loader_dri3_vtable {
|
||||
void (*set_drawable_size)(struct loader_dri3_drawable *, int, int);
|
||||
bool (*in_current_context)(struct loader_dri3_drawable *);
|
||||
__DRIcontext *(*get_dri_context)(struct loader_dri3_drawable *);
|
||||
__DRIscreen *(*get_dri_screen)(void);
|
||||
struct dri_screen *(*get_dri_screen)(void);
|
||||
void (*flush_drawable)(struct loader_dri3_drawable *, unsigned);
|
||||
};
|
||||
|
||||
@@ -131,14 +131,14 @@ struct loader_dri3_drawable {
|
||||
/* Information about the GPU owning the buffer */
|
||||
bool multiplanes_available;
|
||||
bool prefer_back_buffer_reuse;
|
||||
__DRIscreen *dri_screen_render_gpu;
|
||||
struct dri_screen *dri_screen_render_gpu;
|
||||
/* dri_screen_display_gpu holds display GPU in case of prime gpu offloading else
|
||||
* dri_screen_render_gpu and dri_screen_display_gpu is same.
|
||||
* In case of prime gpu offloading, if display and render driver names are different
|
||||
* (potentially not compatible), dri_screen_display_gpu will be NULL but fd_display_gpu
|
||||
* will still hold fd for display driver.
|
||||
*/
|
||||
__DRIscreen *dri_screen_display_gpu;
|
||||
struct dri_screen *dri_screen_display_gpu;
|
||||
|
||||
/* SBC numbers are tracked by using the serial numbers
|
||||
* in the present request and complete events
|
||||
@@ -200,8 +200,8 @@ PUBLIC int
|
||||
loader_dri3_drawable_init(xcb_connection_t *conn,
|
||||
xcb_drawable_t drawable,
|
||||
enum loader_dri3_drawable_type type,
|
||||
__DRIscreen *dri_screen_render_gpu,
|
||||
__DRIscreen *dri_screen_display_gpu,
|
||||
struct dri_screen *dri_screen_render_gpu,
|
||||
struct dri_screen *dri_screen_display_gpu,
|
||||
bool is_multiplanes_available,
|
||||
bool prefer_back_buffer_reuse,
|
||||
const __DRIconfig *dri_config,
|
||||
@@ -253,7 +253,7 @@ PUBLIC __DRIimage *
|
||||
loader_dri3_create_image(xcb_connection_t *c,
|
||||
xcb_dri3_buffer_from_pixmap_reply_t *bp_reply,
|
||||
unsigned int fourcc,
|
||||
__DRIscreen *dri_screen,
|
||||
struct dri_screen *dri_screen,
|
||||
void *loaderPrivate);
|
||||
|
||||
#ifdef HAVE_X11_DRM
|
||||
@@ -261,7 +261,7 @@ PUBLIC __DRIimage *
|
||||
loader_dri3_create_image_from_buffers(xcb_connection_t *c,
|
||||
xcb_dri3_buffers_from_pixmap_reply_t *bp_reply,
|
||||
unsigned int fourcc,
|
||||
__DRIscreen *dri_screen,
|
||||
struct dri_screen *dri_screen,
|
||||
void *loaderPrivate);
|
||||
#endif
|
||||
PUBLIC int
|
||||
@@ -279,9 +279,9 @@ PUBLIC void
|
||||
loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw);
|
||||
|
||||
PUBLIC void
|
||||
loader_dri3_close_screen(__DRIscreen *dri_screen);
|
||||
loader_dri3_close_screen(struct dri_screen *dri_screen);
|
||||
__DRIimage *
|
||||
loader_dri3_get_pixmap_buffer(xcb_connection_t *conn, xcb_drawable_t pixmap, __DRIscreen *screen,
|
||||
loader_dri3_get_pixmap_buffer(xcb_connection_t *conn, xcb_drawable_t pixmap, struct dri_screen *screen,
|
||||
unsigned fourcc, bool multiplanes_available,
|
||||
int *width, int *height, void *loader_data);
|
||||
#endif
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct dri_screen;
|
||||
|
||||
/**
|
||||
* \name DRI interface structures
|
||||
*
|
||||
@@ -39,7 +41,6 @@
|
||||
* side library and the DRI (direct rendering infrastructure).
|
||||
*/
|
||||
/*@{*/
|
||||
typedef struct __DRIscreenRec __DRIscreen;
|
||||
typedef struct __DRIcontextRec __DRIcontext;
|
||||
typedef struct __DRIdrawableRec __DRIdrawable;
|
||||
typedef struct __DRIconfigRec __DRIconfig;
|
||||
@@ -171,12 +172,12 @@ struct __DRI2fenceExtensionRec {
|
||||
* Get a fence associated with the OpenCL event object.
|
||||
* This can be NULL, meaning that OpenCL interoperability is not supported.
|
||||
*/
|
||||
void *(*get_fence_from_cl_event)(__DRIscreen *screen, intptr_t cl_event);
|
||||
void *(*get_fence_from_cl_event)(struct dri_screen *screen, intptr_t cl_event);
|
||||
|
||||
/**
|
||||
* Destroy a fence.
|
||||
*/
|
||||
void (*destroy_fence)(__DRIscreen *screen, void *fence);
|
||||
void (*destroy_fence)(struct dri_screen *screen, void *fence);
|
||||
|
||||
/**
|
||||
* This function waits and doesn't return until the fence is signalled
|
||||
@@ -210,7 +211,7 @@ struct __DRI2fenceExtensionRec {
|
||||
*
|
||||
* \since 2
|
||||
*/
|
||||
unsigned (*get_capabilities)(__DRIscreen *screen);
|
||||
unsigned (*get_capabilities)(struct dri_screen *screen);
|
||||
|
||||
/**
|
||||
* Create an fd (file descriptor) associated fence. If the fence fd
|
||||
@@ -237,7 +238,7 @@ struct __DRI2fenceExtensionRec {
|
||||
* \param screen the screen associated with the fence
|
||||
* \param fence the fence
|
||||
*/
|
||||
int (*get_fence_fd)(__DRIscreen *screen, void *fence);
|
||||
int (*get_fence_fd)(struct dri_screen *screen, void *fence);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -515,15 +516,15 @@ struct __DRIcoreExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/* Not used by the X server. */
|
||||
__DRIscreen *(*createNewScreen)(int screen, int fd,
|
||||
struct dri_screen *(*createNewScreen)(int screen, int fd,
|
||||
unsigned int sarea_handle,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIconfig ***driverConfigs,
|
||||
void *loaderPrivate);
|
||||
|
||||
void (*destroyScreen)(__DRIscreen *screen);
|
||||
void (*destroyScreen)(struct dri_screen *screen);
|
||||
|
||||
const __DRIextension **(*getExtensions)(__DRIscreen *screen);
|
||||
const __DRIextension **(*getExtensions)(struct dri_screen *screen);
|
||||
|
||||
/* Not used by the X server. */
|
||||
int (*getConfigAttrib)(const __DRIconfig *config,
|
||||
@@ -535,7 +536,7 @@ struct __DRIcoreExtensionRec {
|
||||
unsigned int *attrib, unsigned int *value);
|
||||
|
||||
/* Not used by the X server. */
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
__DRIdrawable *(*createNewDrawable)(struct dri_screen *screen,
|
||||
const __DRIconfig *config,
|
||||
unsigned int drawable_id,
|
||||
unsigned int head,
|
||||
@@ -548,7 +549,7 @@ struct __DRIcoreExtensionRec {
|
||||
void (*swapBuffers)(__DRIdrawable *drawable);
|
||||
|
||||
/* Used by the X server in swrast mode. */
|
||||
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
||||
__DRIcontext *(*createNewContext)(struct dri_screen *screen,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
void *loaderPrivate);
|
||||
@@ -575,13 +576,13 @@ struct __DRIcoreExtensionRec {
|
||||
/** Common DRI function definitions, shared among DRI2 and Image extensions
|
||||
*/
|
||||
|
||||
typedef __DRIscreen *
|
||||
typedef struct dri_screen *
|
||||
(*__DRIcreateNewScreen2Func)(int screen, int fd,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIextension **driver_extensions,
|
||||
const __DRIconfig ***driver_configs,
|
||||
void *loaderPrivate);
|
||||
typedef __DRIscreen *
|
||||
typedef struct dri_screen *
|
||||
(*__DRIcreateNewScreen3Func)(int screen, int fd,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIextension **driver_extensions,
|
||||
@@ -590,12 +591,12 @@ typedef __DRIscreen *
|
||||
void *loaderPrivate);
|
||||
|
||||
typedef __DRIdrawable *
|
||||
(*__DRIcreateNewDrawableFunc)(__DRIscreen *screen,
|
||||
(*__DRIcreateNewDrawableFunc)(struct dri_screen *screen,
|
||||
const __DRIconfig *config,
|
||||
void *loaderPrivate);
|
||||
|
||||
typedef __DRIcontext *
|
||||
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
|
||||
(*__DRIcreateContextAttribsFunc)(struct dri_screen *screen,
|
||||
int api,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
@@ -605,7 +606,7 @@ typedef __DRIcontext *
|
||||
void *loaderPrivate);
|
||||
|
||||
typedef unsigned int
|
||||
(*__DRIgetAPIMaskFunc)(__DRIscreen *screen);
|
||||
(*__DRIgetAPIMaskFunc)(struct dri_screen *screen);
|
||||
|
||||
/**
|
||||
* DRI2 Loader extension.
|
||||
@@ -985,7 +986,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 5
|
||||
*/
|
||||
__DRIimage *(*createImageFromNames)(__DRIscreen *screen,
|
||||
__DRIimage *(*createImageFromNames)(struct dri_screen *screen,
|
||||
int width, int height, int fourcc,
|
||||
int *names, int num_names,
|
||||
int *strides, int *offsets,
|
||||
@@ -1043,7 +1044,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 10
|
||||
*/
|
||||
int (*getCapabilities)(__DRIscreen *screen);
|
||||
int (*getCapabilities)(struct dri_screen *screen);
|
||||
|
||||
/**
|
||||
* Returns a map of the specified region of a __DRIimage for the specified usage.
|
||||
@@ -1086,7 +1087,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 15
|
||||
*/
|
||||
bool (*queryDmaBufFormats)(__DRIscreen *screen, int max, int *formats,
|
||||
bool (*queryDmaBufFormats)(struct dri_screen *screen, int max, int *formats,
|
||||
int *count);
|
||||
|
||||
/*
|
||||
@@ -1108,7 +1109,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 15
|
||||
*/
|
||||
bool (*queryDmaBufModifiers)(__DRIscreen *screen, int fourcc, int max,
|
||||
bool (*queryDmaBufModifiers)(struct dri_screen *screen, int fourcc, int max,
|
||||
uint64_t *modifiers,
|
||||
unsigned int *external_only, int *count);
|
||||
|
||||
@@ -1126,7 +1127,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 16
|
||||
*/
|
||||
bool (*queryDmaBufFormatModifierAttribs)(__DRIscreen *screen,
|
||||
bool (*queryDmaBufFormatModifierAttribs)(struct dri_screen *screen,
|
||||
uint32_t fourcc, uint64_t modifier,
|
||||
int attrib, uint64_t *value);
|
||||
|
||||
@@ -1149,7 +1150,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* See __DRI_IMAGE_*_FLAG for valid definitions of flags.
|
||||
*/
|
||||
__DRIimage *(*createImageFromDmaBufs)(__DRIscreen *screen,
|
||||
__DRIimage *(*createImageFromDmaBufs)(struct dri_screen *screen,
|
||||
int width, int height, int fourcc,
|
||||
uint64_t modifier,
|
||||
int *fds, int num_fds,
|
||||
@@ -1179,7 +1180,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 19
|
||||
*/
|
||||
__DRIimage *(*createImage)(__DRIscreen *screen,
|
||||
__DRIimage *(*createImage)(struct dri_screen *screen,
|
||||
int width, int height, int format,
|
||||
const uint64_t *modifiers,
|
||||
const unsigned int modifier_count,
|
||||
@@ -1215,7 +1216,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 22
|
||||
*/
|
||||
bool (*queryCompressionRates)(__DRIscreen *screen, const __DRIconfig *config,
|
||||
bool (*queryCompressionRates)(struct dri_screen *screen, const __DRIconfig *config,
|
||||
int max, enum __DRIFixedRateCompression *rates,
|
||||
int *count);
|
||||
|
||||
@@ -1238,7 +1239,7 @@ struct __DRIimageExtensionRec {
|
||||
*
|
||||
* \since 22
|
||||
*/
|
||||
bool (*queryCompressionModifiers)(__DRIscreen *screen, uint32_t format,
|
||||
bool (*queryCompressionModifiers)(struct dri_screen *screen, uint32_t format,
|
||||
enum __DRIFixedRateCompression rate,
|
||||
int max, uint64_t *modifiers, int *count);
|
||||
};
|
||||
@@ -1281,10 +1282,10 @@ typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
|
||||
struct __DRI2configQueryExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
int (*configQueryb)(__DRIscreen *screen, const char *var, unsigned char *val);
|
||||
int (*configQueryi)(__DRIscreen *screen, const char *var, int *val);
|
||||
int (*configQueryf)(__DRIscreen *screen, const char *var, float *val);
|
||||
int (*configQuerys)(__DRIscreen *screen, const char *var, char **val);
|
||||
int (*configQueryb)(struct dri_screen *screen, const char *var, unsigned char *val);
|
||||
int (*configQueryi)(struct dri_screen *screen, const char *var, int *val);
|
||||
int (*configQueryf)(struct dri_screen *screen, const char *var, float *val);
|
||||
int (*configQuerys)(struct dri_screen *screen, const char *var, char **val);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1208,7 +1208,7 @@ dri_device_create(int fd, uint32_t gbm_backend_version)
|
||||
if (ret)
|
||||
goto err_dri;
|
||||
|
||||
struct dri_screen *screen = dri_screen(dri->screen);
|
||||
struct dri_screen *screen = dri->screen;
|
||||
struct pipe_screen *pscreen = screen->base.screen;
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_IMPORT)
|
||||
|
@@ -56,7 +56,7 @@ struct gbm_dri_device {
|
||||
bool has_dmabuf_export;
|
||||
bool has_compression_modifiers;
|
||||
|
||||
__DRIscreen *screen;
|
||||
struct dri_screen *screen;
|
||||
__DRIcontext *context;
|
||||
mtx_t mutex;
|
||||
|
||||
|
@@ -119,7 +119,7 @@ glx_dri3_get_dri_context(struct loader_dri3_drawable *draw)
|
||||
return (gc != &dummyContext) ? gc->driContext : NULL;
|
||||
}
|
||||
|
||||
static __DRIscreen *
|
||||
static struct dri_screen *
|
||||
glx_dri3_get_dri_screen(void)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
@@ -74,7 +74,7 @@ struct dri3_screen {
|
||||
* (potentially not compatible), driScreenDisplayGPU will be NULL but
|
||||
* fd_display_gpu will still hold fd for display driver.
|
||||
*/
|
||||
__DRIscreen *driScreenDisplayGPU;
|
||||
struct dri_screen *driScreenDisplayGPU;
|
||||
|
||||
/* fd of the GPU used for rendering. */
|
||||
int fd_render_gpu;
|
||||
|
@@ -43,7 +43,7 @@ struct driwindows_config
|
||||
struct driwindows_screen
|
||||
{
|
||||
struct glx_screen base;
|
||||
__DRIscreen *driScreen;
|
||||
struct dri_screen *driScreen;
|
||||
int event_base;
|
||||
Bool copySubBuffer;
|
||||
};
|
||||
|
@@ -524,7 +524,7 @@ struct glx_screen
|
||||
* Per screen direct rendering interface functions and data.
|
||||
*/
|
||||
__GLXDRIscreen driScreen;
|
||||
__DRIscreen *frontend_screen;
|
||||
struct dri_screen *frontend_screen;
|
||||
const __DRIconfig **driver_configs;
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user