mesa_interface: rename __DRIconfig to struct dri_config

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31752>
This commit is contained in:
Marek Olšák
2024-10-21 02:19:46 -04:00
committed by Marge Bot
parent 872b5c70d1
commit ee54fe9f69
27 changed files with 93 additions and 94 deletions

View File

@@ -64,7 +64,7 @@ struct __DRIkopperExtensionRec {
* a pixmap is undefined. * a pixmap is undefined.
*/ */
struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen, struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen,
const __DRIconfig *config, const struct dri_config *config,
void *loaderPrivate, void *loaderPrivate,
__DRIkopperDrawableInfo *info); __DRIkopperDrawableInfo *info);
/* flags is a set of __DRI2_FLUSH_* flags */ /* flags is a set of __DRI2_FLUSH_* flags */

View File

@@ -277,7 +277,7 @@ static const EGLint dri2_to_egl_attribute_map[__DRI_ATTRIB_MAX] = {
[__DRI_ATTRIB_YINVERTED] = EGL_Y_INVERTED_NOK, [__DRI_ATTRIB_YINVERTED] = EGL_Y_INVERTED_NOK,
}; };
const __DRIconfig * const struct dri_config *
dri2_get_dri_config(struct dri2_egl_config *conf, EGLint surface_type, dri2_get_dri_config(struct dri2_egl_config *conf, EGLint surface_type,
EGLenum colorspace) EGLenum colorspace)
{ {
@@ -307,7 +307,7 @@ dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
} }
void void
dri2_get_shifts_and_sizes(const __DRIconfig *config, int *shifts, dri2_get_shifts_and_sizes(const struct dri_config *config, int *shifts,
unsigned int *sizes) unsigned int *sizes)
{ {
driGetConfigAttrib(config, __DRI_ATTRIB_RED_SHIFT, driGetConfigAttrib(config, __DRI_ATTRIB_RED_SHIFT,
@@ -326,14 +326,14 @@ dri2_get_shifts_and_sizes(const __DRIconfig *config, int *shifts,
enum pipe_format enum pipe_format
dri2_image_format_for_pbuffer_config(struct dri2_egl_display *dri2_dpy, dri2_image_format_for_pbuffer_config(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config) const struct dri_config *config)
{ {
struct gl_config *gl_config = (struct gl_config *) config; struct gl_config *gl_config = (struct gl_config *) config;
return gl_config->color_format; return gl_config->color_format;
} }
struct dri2_egl_config * struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, dri2_add_config(_EGLDisplay *disp, const struct dri_config *dri_config,
EGLint surface_type, const EGLint *attr_list) EGLint surface_type, const EGLint *attr_list)
{ {
struct dri2_egl_config *conf; struct dri2_egl_config *conf;
@@ -1026,7 +1026,7 @@ dri2_display_destroy(_EGLDisplay *disp)
*/ */
if (disp->Platform != _EGL_PLATFORM_DRM && dri2_dpy->driver_configs) { if (disp->Platform != _EGL_PLATFORM_DRM && dri2_dpy->driver_configs) {
for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++) for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++)
free((__DRIconfig *)dri2_dpy->driver_configs[i]); free((struct dri_config *)dri2_dpy->driver_configs[i]);
free(dri2_dpy->driver_configs); free(dri2_dpy->driver_configs);
} }
free(dri2_dpy); free(dri2_dpy);
@@ -1213,7 +1213,7 @@ dri2_create_context(_EGLDisplay *disp, _EGLConfig *conf,
struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list); struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list);
struct dri_context *shared = dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL; struct dri_context *shared = dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL;
struct dri2_egl_config *dri2_config = dri2_egl_config(conf); struct dri2_egl_config *dri2_config = dri2_egl_config(conf);
const __DRIconfig *dri_config; const struct dri_config *dri_config;
int api; int api;
unsigned error; unsigned error;
unsigned num_attribs = NUM_ATTRIBS; unsigned num_attribs = NUM_ATTRIBS;
@@ -1386,7 +1386,7 @@ dri2_surf_update_fence_fd(_EGLContext *ctx, _EGLDisplay *disp,
EGLBoolean EGLBoolean
dri2_create_drawable(struct dri2_egl_display *dri2_dpy, dri2_create_drawable(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config, const struct dri_config *config,
struct dri2_egl_surface *dri2_surf, void *loaderPrivate) struct dri2_egl_surface *dri2_surf, void *loaderPrivate)
{ {
bool is_pixmap = dri2_surf->base.Type == EGL_PBUFFER_BIT || bool is_pixmap = dri2_surf->base.Type == EGL_PBUFFER_BIT ||
@@ -3342,7 +3342,7 @@ dri2_query_supported_compression_rates(_EGLDisplay *disp, _EGLConfig *config,
enum __DRIFixedRateCompression dri_rates[rate_size]; enum __DRIFixedRateCompression dri_rates[rate_size];
if (dri2_dpy->has_compression_modifiers) { if (dri2_dpy->has_compression_modifiers) {
const __DRIconfig *dri_conf = const struct dri_config *dri_conf =
dri2_get_dri_config(conf, EGL_WINDOW_BIT, EGL_GL_COLORSPACE_LINEAR); dri2_get_dri_config(conf, EGL_WINDOW_BIT, EGL_GL_COLORSPACE_LINEAR);
if (!dri2_query_compression_rates( if (!dri2_query_compression_rates(
dri2_dpy->dri_screen_render_gpu, dri_conf, rate_size, dri_rates, dri2_dpy->dri_screen_render_gpu, dri_conf, rate_size, dri_rates,

View File

@@ -241,7 +241,7 @@ struct dri2_egl_display {
*/ */
struct dri_screen *dri_screen_display_gpu; struct dri_screen *dri_screen_display_gpu;
bool own_dri_screen; bool own_dri_screen;
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
/* fd of the GPU used for rendering. */ /* fd of the GPU used for rendering. */
int fd_render_gpu; int fd_render_gpu;
/* fd of the GPU used for display. If the same GPU is used for display /* fd of the GPU used for display. If the same GPU is used for display
@@ -409,7 +409,7 @@ struct dri2_egl_surface {
struct dri2_egl_config { struct dri2_egl_config {
_EGLConfig base; _EGLConfig base;
const __DRIconfig *dri_config[2][2]; const struct dri_config *dri_config[2][2];
}; };
struct dri2_egl_image { struct dri2_egl_image {
@@ -480,15 +480,15 @@ __DRIimage *
dri2_lookup_egl_image_validated(void *image, void *data); dri2_lookup_egl_image_validated(void *image, void *data);
void void
dri2_get_shifts_and_sizes(const __DRIconfig *config, int *shifts, dri2_get_shifts_and_sizes(const struct dri_config *config, int *shifts,
unsigned int *sizes); unsigned int *sizes);
enum pipe_format enum pipe_format
dri2_image_format_for_pbuffer_config(struct dri2_egl_display *dri2_dpy, dri2_image_format_for_pbuffer_config(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config); const struct dri_config *config);
struct dri2_egl_config * struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, dri2_add_config(_EGLDisplay *disp, const struct dri_config *dri_config,
EGLint surface_type, const EGLint *attr_list); EGLint surface_type, const EGLint *attr_list);
void void
@@ -599,7 +599,7 @@ dri2_flush_drawable_for_swapbuffers_flags(
void void
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw); dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw);
const __DRIconfig * const struct dri_config *
dri2_get_dri_config(struct dri2_egl_config *conf, EGLint surface_type, dri2_get_dri_config(struct dri2_egl_config *conf, EGLint surface_type,
EGLenum colorspace); EGLenum colorspace);
#include "dri_util.h" #include "dri_util.h"
@@ -634,7 +634,7 @@ dri2_fini_surface(_EGLSurface *surf);
EGLBoolean EGLBoolean
dri2_create_drawable(struct dri2_egl_display *dri2_dpy, dri2_create_drawable(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config, const struct dri_config *config,
struct dri2_egl_surface *dri2_surf, void *loaderPrivate); struct dri2_egl_surface *dri2_surf, void *loaderPrivate);
static inline uint64_t static inline uint64_t

View File

@@ -280,7 +280,7 @@ droid_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf; struct dri2_egl_surface *dri2_surf;
struct ANativeWindow *window = native_window; struct ANativeWindow *window = native_window;
const __DRIconfig *config; const struct dri_config *config;
dri2_surf = calloc(1, sizeof *dri2_surf); dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) { if (!dri2_surf) {

View File

@@ -112,7 +112,7 @@ dri2_device_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf; struct dri2_egl_surface *dri2_surf;
const __DRIconfig *config; const struct dri_config *config;
/* Make sure to calloc so all pointers /* Make sure to calloc so all pointers
* are originally NULL. * are originally NULL.

View File

@@ -98,7 +98,7 @@ has_free_buffers(struct gbm_surface *_surf)
static bool static bool
dri2_drm_config_is_compatible(struct dri2_egl_display *dri2_dpy, dri2_drm_config_is_compatible(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config, const struct dri_config *config,
struct gbm_surface *surface) struct gbm_surface *surface)
{ {
const struct gl_config *gl_config = (struct gl_config *) config; const struct gl_config *gl_config = (struct gl_config *) config;
@@ -141,7 +141,7 @@ dri2_drm_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
struct dri2_egl_surface *dri2_surf; struct dri2_egl_surface *dri2_surf;
struct gbm_surface *surface = native_surface; struct gbm_surface *surface = native_surface;
struct gbm_dri_surface *surf; struct gbm_dri_surface *surf;
const __DRIconfig *config; const struct dri_config *config;
dri2_surf = calloc(1, sizeof *dri2_surf); dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) { if (!dri2_surf) {
@@ -498,7 +498,7 @@ drm_add_configs_for_visuals(_EGLDisplay *disp)
memset(format_count, 0, num_visuals * sizeof(unsigned int)); memset(format_count, 0, num_visuals * sizeof(unsigned int));
for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++) { for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++) {
const __DRIconfig *config = dri2_dpy->driver_configs[i]; const struct dri_config *config = dri2_dpy->driver_configs[i];
struct gl_config *gl_config = (struct gl_config *) config; struct gl_config *gl_config = (struct gl_config *) config;
for (unsigned j = 0; j < num_visuals; j++) { for (unsigned j = 0; j < num_visuals; j++) {

View File

@@ -111,7 +111,7 @@ dri2_surfaceless_create_surface(_EGLDisplay *disp, EGLint type,
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf; struct dri2_egl_surface *dri2_surf;
const __DRIconfig *config; const struct dri_config *config;
/* Make sure to calloc so all pointers /* Make sure to calloc so all pointers
* are originally NULL. * are originally NULL.

View File

@@ -183,7 +183,7 @@ dri2_wl_visual_idx_from_pipe_format(enum pipe_format pipe_format)
} }
static int static int
dri2_wl_visual_idx_from_config(const __DRIconfig *config) dri2_wl_visual_idx_from_config(const struct dri_config *config)
{ {
struct gl_config *gl_config = (struct gl_config *) config; struct gl_config *gl_config = (struct gl_config *) config;
@@ -664,7 +664,7 @@ dri2_wl_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
struct dri2_egl_surface *dri2_surf; struct dri2_egl_surface *dri2_surf;
struct zwp_linux_dmabuf_v1 *dmabuf_wrapper; struct zwp_linux_dmabuf_v1 *dmabuf_wrapper;
int visual_idx; int visual_idx;
const __DRIconfig *config; const struct dri_config *config;
if (!window) { if (!window) {
_eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface"); _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");

View File

@@ -418,7 +418,7 @@ dri2_x11_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
xcb_get_geometry_cookie_t cookie; xcb_get_geometry_cookie_t cookie;
xcb_get_geometry_reply_t *reply; xcb_get_geometry_reply_t *reply;
xcb_generic_error_t *error; xcb_generic_error_t *error;
const __DRIconfig *config; const struct dri_config *config;
dri2_surf = calloc(1, sizeof *dri2_surf); dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) { if (!dri2_surf) {
@@ -976,7 +976,7 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
}; };
for (int j = 0; dri2_dpy->driver_configs[j]; j++) { for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
const __DRIconfig *config = dri2_dpy->driver_configs[j]; const struct dri_config *config = dri2_dpy->driver_configs[j];
int shifts[4]; int shifts[4];
unsigned int sizes[4]; unsigned int sizes[4];

View File

@@ -158,7 +158,7 @@ dri3_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri3_egl_surface *dri3_surf; struct dri3_egl_surface *dri3_surf;
const __DRIconfig *dri_config; const struct dri_config *dri_config;
xcb_drawable_t drawable; xcb_drawable_t drawable;
dri3_surf = calloc(1, sizeof *dri3_surf); dri3_surf = calloc(1, sizeof *dri3_surf);

View File

@@ -1719,7 +1719,7 @@ exit:
} }
bool bool
dri2_query_compression_rates(struct dri_screen *screen, const __DRIconfig *config, int max, dri2_query_compression_rates(struct dri_screen *screen, const struct dri_config *config, int max,
enum __DRIFixedRateCompression *rates, int *count) enum __DRIFixedRateCompression *rates, int *count)
{ {
struct pipe_screen *pscreen = screen->base.screen; struct pipe_screen *pscreen = screen->base.screen;

View File

@@ -149,7 +149,7 @@ 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. * This is called when we need to set up GL rendering to a new X window.
*/ */
struct dri_drawable * struct dri_drawable *
dri_create_drawable(struct dri_screen *screen, const __DRIconfig *config, dri_create_drawable(struct dri_screen *screen, const struct dri_config *config,
bool isPixmap, void *loaderPrivate) bool isPixmap, void *loaderPrivate)
{ {
const struct gl_config *visual = &config->modes; const struct gl_config *visual = &config->modes;

View File

@@ -136,12 +136,12 @@ dri_loader_get_cap(struct dri_screen *screen, enum dri_loader_cap cap)
* 16-bit color to have 16-bit depth. * 16-bit color to have 16-bit depth.
* *
* \returns * \returns
* Pointer to any array of pointers to the \c __DRIconfig structures created * Pointer to any array of pointers to the \c struct dri_config structures created
* for the specified formats. If there is an error, \c NULL is returned. * for the specified formats. If there is an error, \c NULL is returned.
* Currently the only cause of failure is a bad parameter (i.e., unsupported * Currently the only cause of failure is a bad parameter (i.e., unsupported
* \c format). * \c format).
*/ */
static __DRIconfig ** static struct dri_config **
driCreateConfigs(enum pipe_format format, driCreateConfigs(enum pipe_format format,
enum pipe_format *zs_formats, unsigned num_zs_formats, enum pipe_format *zs_formats, unsigned num_zs_formats,
const bool *db_modes, unsigned num_db_modes, const bool *db_modes, unsigned num_db_modes,
@@ -151,7 +151,7 @@ driCreateConfigs(enum pipe_format format,
uint32_t masks[4]; uint32_t masks[4];
int shifts[4]; int shifts[4];
int color_bits[4]; int color_bits[4];
__DRIconfig **configs, **c; struct dri_config **configs, **c;
struct gl_config *modes; struct gl_config *modes;
unsigned i, j, k, h; unsigned i, j, k, h;
unsigned num_modes; unsigned num_modes;
@@ -267,10 +267,10 @@ driCreateConfigs(enum pipe_format format,
return configs; return configs;
} }
static __DRIconfig ** static struct dri_config **
driConcatConfigs(__DRIconfig **a, __DRIconfig **b) driConcatConfigs(struct dri_config **a, struct dri_config **b)
{ {
__DRIconfig **all; struct dri_config **all;
int i, j, index; int i, j, index;
if (a == NULL || a[0] == NULL) if (a == NULL || a[0] == NULL)
@@ -300,7 +300,7 @@ driConcatConfigs(__DRIconfig **a, __DRIconfig **b)
} }
static const __DRIconfig ** static const struct dri_config **
dri_fill_in_modes(struct dri_screen *screen) dri_fill_in_modes(struct dri_screen *screen)
{ {
/* The 32-bit RGBA format must not precede the 32-bit BGRA format. /* The 32-bit RGBA format must not precede the 32-bit BGRA format.
@@ -309,13 +309,13 @@ dri_fill_in_modes(struct dri_screen *screen)
* resulting in swapped color channels. * resulting in swapped color channels.
* *
* The problem, as of 2017-05-30: * The problem, as of 2017-05-30:
* When matching a GLXFBConfig to a __DRIconfig, GLX ignores the channel * When matching a GLXFBConfig to a struct dri_config, GLX ignores the channel
* order and chooses the first __DRIconfig with the expected channel * order and chooses the first struct dri_config with the expected channel
* sizes. Specifically, GLX compares the GLXFBConfig's and __DRIconfig's * sizes. Specifically, GLX compares the GLXFBConfig's and struct dri_config's
* __DRI_ATTRIB_{CHANNEL}_SIZE but ignores __DRI_ATTRIB_{CHANNEL}_MASK. * __DRI_ATTRIB_{CHANNEL}_SIZE but ignores __DRI_ATTRIB_{CHANNEL}_MASK.
* *
* EGL does not suffer from this problem. It correctly compares the * EGL does not suffer from this problem. It correctly compares the
* channel masks when matching EGLConfig to __DRIconfig. * channel masks when matching EGLConfig to struct dri_config.
*/ */
static const enum pipe_format pipe_formats[] = { static const enum pipe_format pipe_formats[] = {
PIPE_FORMAT_B10G10R10A2_UNORM, PIPE_FORMAT_B10G10R10A2_UNORM,
@@ -338,7 +338,7 @@ dri_fill_in_modes(struct dri_screen *screen)
PIPE_FORMAT_B4G4R4A4_UNORM, PIPE_FORMAT_B4G4R4A4_UNORM,
PIPE_FORMAT_R4G4B4A4_UNORM, PIPE_FORMAT_R4G4B4A4_UNORM,
}; };
__DRIconfig **configs = NULL; struct dri_config **configs = NULL;
enum pipe_format zs_formats[5]; enum pipe_format zs_formats[5];
unsigned num_zs_formats = 0; unsigned num_zs_formats = 0;
unsigned i; unsigned i;
@@ -385,7 +385,7 @@ dri_fill_in_modes(struct dri_screen *screen)
/* Add configs. */ /* Add configs. */
for (unsigned f = 0; f < ARRAY_SIZE(pipe_formats); f++) { for (unsigned f = 0; f < ARRAY_SIZE(pipe_formats); f++) {
__DRIconfig **new_configs = NULL; struct dri_config **new_configs = NULL;
unsigned num_msaa_modes = 0; /* includes a single-sample mode */ unsigned num_msaa_modes = 0; /* includes a single-sample mode */
uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES];
@@ -455,7 +455,7 @@ dri_fill_in_modes(struct dri_screen *screen)
return NULL; return NULL;
} }
return (const __DRIconfig **)configs; return (const struct dri_config **)configs;
} }
/** /**
@@ -616,7 +616,7 @@ dri_set_background_context(struct st_context *st,
hud_add_queue_for_monitoring(ctx->hud, queue_info); hud_add_queue_for_monitoring(ctx->hud, queue_info);
} }
const __DRIconfig ** const struct dri_config **
dri_init_screen(struct dri_screen *screen, dri_init_screen(struct dri_screen *screen,
struct pipe_screen *pscreen, struct pipe_screen *pscreen,
bool has_multibuffer) bool has_multibuffer)

View File

@@ -185,7 +185,7 @@ dri_fill_st_visual(struct st_visual *stvis,
void void
dri_init_options(struct dri_screen *screen); dri_init_options(struct dri_screen *screen);
const __DRIconfig ** const struct dri_config **
dri_init_screen(struct dri_screen *screen, dri_init_screen(struct dri_screen *screen,
struct pipe_screen *pscreen, struct pipe_screen *pscreen,
bool has_multibuffer); bool has_multibuffer);

View File

@@ -102,7 +102,7 @@ struct dri_screen *
driCreateNewScreen3(int scrn, int fd, driCreateNewScreen3(int scrn, int fd,
const __DRIextension **loader_extensions, const __DRIextension **loader_extensions,
enum dri_screen_type type, enum dri_screen_type type,
const __DRIconfig ***driver_configs, bool driver_name_is_inferred, const struct dri_config ***driver_configs, bool driver_name_is_inferred,
bool has_multibuffer, void *data) bool has_multibuffer, void *data)
{ {
struct dri_screen *screen; struct dri_screen *screen;
@@ -222,7 +222,7 @@ void driDestroyScreen(struct dri_screen *psp)
* indicated by the index. * indicated by the index.
*/ */
static int static int
driGetConfigAttribIndex(const __DRIconfig *config, driGetConfigAttribIndex(const struct dri_config *config,
unsigned int index, unsigned int *value) unsigned int index, unsigned int *value)
{ {
switch (index + 1) { switch (index + 1) {
@@ -343,7 +343,7 @@ driGetConfigAttribIndex(const __DRIconfig *config,
* \return 1 for success, 0 for failure * \return 1 for success, 0 for failure
*/ */
int int
driGetConfigAttrib(const __DRIconfig *config, driGetConfigAttrib(const struct dri_config *config,
unsigned int attrib, unsigned int *value) unsigned int attrib, unsigned int *value)
{ {
return driGetConfigAttribIndex(config, attrib - 1, value); return driGetConfigAttribIndex(config, attrib - 1, value);
@@ -351,13 +351,13 @@ driGetConfigAttrib(const __DRIconfig *config,
/** /**
* Get a configuration attribute name and value, given an index. * Get a configuration attribute name and value, given an index.
* \param index which field of the __DRIconfig to query * \param index which field of the struct dri_config to query
* \param attrib returns the attribute name (one of the _DRI_ATTRIB_x tokens) * \param attrib returns the attribute name (one of the _DRI_ATTRIB_x tokens)
* \param value returns the attribute's value * \param value returns the attribute's value
* \return 1 for success, 0 for failure * \return 1 for success, 0 for failure
*/ */
int int
driIndexConfigAttrib(const __DRIconfig *config, int index, driIndexConfigAttrib(const struct dri_config *config, int index,
unsigned int *attrib, unsigned int *value) unsigned int *attrib, unsigned int *value)
{ {
if (driGetConfigAttribIndex(config, index, value)) { if (driGetConfigAttribIndex(config, index, value)) {
@@ -424,7 +424,7 @@ validate_context_version(struct dri_screen *screen,
struct dri_context * struct dri_context *
driCreateContextAttribs(struct dri_screen *screen, int api, driCreateContextAttribs(struct dri_screen *screen, int api,
const __DRIconfig *config, const struct dri_config *config,
struct dri_context *shared, struct dri_context *shared,
unsigned num_attribs, unsigned num_attribs,
const uint32_t *attribs, const uint32_t *attribs,
@@ -608,7 +608,7 @@ driCreateContextAttribs(struct dri_screen *screen, int api,
static struct dri_context * static struct dri_context *
driCreateNewContextForAPI(struct dri_screen *screen, int api, driCreateNewContextForAPI(struct dri_screen *screen, int api,
const __DRIconfig *config, const struct dri_config *config,
struct dri_context *shared, void *data) struct dri_context *shared, void *data)
{ {
unsigned error; unsigned error;
@@ -618,7 +618,7 @@ driCreateNewContextForAPI(struct dri_screen *screen, int api,
} }
struct dri_context * struct dri_context *
driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, driCreateNewContext(struct dri_screen *screen, const struct dri_config *config,
struct dri_context *shared, void *data) struct dri_context *shared, void *data)
{ {
return driCreateNewContextForAPI(screen, __DRI_API_OPENGL, return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,

View File

@@ -53,7 +53,7 @@ struct mesa_glinterop_flush_out;
#define __DRI_BACKEND_VTABLE "DRI_DriverVtable" #define __DRI_BACKEND_VTABLE "DRI_DriverVtable"
struct __DRIconfigRec { struct dri_config {
struct gl_config modes; struct gl_config modes;
}; };
@@ -110,11 +110,11 @@ PUBLIC struct dri_screen *
driCreateNewScreen3(int scrn, int fd, driCreateNewScreen3(int scrn, int fd,
const __DRIextension **loader_extensions, const __DRIextension **loader_extensions,
enum dri_screen_type type, enum dri_screen_type type,
const __DRIconfig ***driver_configs, bool driver_name_is_inferred, const struct dri_config ***driver_configs, bool driver_name_is_inferred,
bool has_multibuffer, void *data); bool has_multibuffer, void *data);
PUBLIC struct dri_context * PUBLIC struct dri_context *
driCreateContextAttribs(struct dri_screen *psp, int api, driCreateContextAttribs(struct dri_screen *psp, int api,
const __DRIconfig *config, const struct dri_config *config,
struct dri_context *shared, struct dri_context *shared,
unsigned num_attribs, unsigned num_attribs,
const uint32_t *attribs, const uint32_t *attribs,
@@ -126,14 +126,14 @@ driImageFormatToSizedInternalGLFormat(uint32_t image_format);
PUBLIC unsigned int PUBLIC unsigned int
driGetAPIMask(struct dri_screen *screen); driGetAPIMask(struct dri_screen *screen);
PUBLIC struct dri_drawable * PUBLIC struct dri_drawable *
dri_create_drawable(struct dri_screen *psp, const __DRIconfig *config, dri_create_drawable(struct dri_screen *psp, const struct dri_config *config,
bool isPixmap, void *loaderPrivate); bool isPixmap, void *loaderPrivate);
extern const __DRIimageDriverExtension driImageDriverExtension; extern const __DRIimageDriverExtension driImageDriverExtension;
PUBLIC void driDestroyScreen(struct dri_screen *psp); PUBLIC void driDestroyScreen(struct dri_screen *psp);
PUBLIC int PUBLIC int
driGetConfigAttrib(const __DRIconfig *config, unsigned int attrib, unsigned int *value); driGetConfigAttrib(const struct dri_config *config, unsigned int attrib, unsigned int *value);
PUBLIC int PUBLIC int
driIndexConfigAttrib(const __DRIconfig *config, int index, unsigned int *attrib, unsigned int *value); driIndexConfigAttrib(const struct dri_config *config, int index, unsigned int *attrib, unsigned int *value);
PUBLIC void PUBLIC void
driDestroyDrawable(struct dri_drawable *drawable); driDestroyDrawable(struct dri_drawable *drawable);
PUBLIC void PUBLIC void
@@ -141,7 +141,7 @@ driSwapBuffers(struct dri_drawable *drawable);
PUBLIC void PUBLIC void
driSwapBuffersWithDamage(struct dri_drawable *drawable, int nrects, const int *rects); driSwapBuffersWithDamage(struct dri_drawable *drawable, int nrects, const int *rects);
PUBLIC struct dri_context * PUBLIC struct dri_context *
driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, struct dri_context *shared, void *data); driCreateNewContext(struct dri_screen *screen, const struct dri_config *config, struct dri_context *shared, void *data);
PUBLIC int PUBLIC int
driCopyContext(struct dri_context *dest, struct dri_context *src, unsigned long mask); driCopyContext(struct dri_context *dest, struct dri_context *src, unsigned long mask);
PUBLIC void PUBLIC void
@@ -156,7 +156,7 @@ PUBLIC int64_t
kopperSwapBuffersWithDamage(struct dri_drawable *drawable, uint32_t flush_flags, int nrects, const int *rects); kopperSwapBuffersWithDamage(struct dri_drawable *drawable, uint32_t flush_flags, int nrects, const int *rects);
PUBLIC struct dri_drawable * PUBLIC struct dri_drawable *
kopperCreateNewDrawable(struct dri_screen *psp, kopperCreateNewDrawable(struct dri_screen *psp,
const __DRIconfig *config, const struct dri_config *config,
void *data, void *data,
__DRIkopperDrawableInfo *info); __DRIkopperDrawableInfo *info);
PUBLIC void PUBLIC void
@@ -303,7 +303,7 @@ PUBLIC void
dri2_set_in_fence_fd(__DRIimage *img, int fd); dri2_set_in_fence_fd(__DRIimage *img, int fd);
PUBLIC bool PUBLIC bool
dri2_query_compression_rates(struct dri_screen *_screen, const __DRIconfig *config, int max, dri2_query_compression_rates(struct dri_screen *_screen, const struct dri_config *config, int max,
enum __DRIFixedRateCompression *rates, int *count); enum __DRIFixedRateCompression *rates, int *count);
PUBLIC bool PUBLIC bool
dri2_query_compression_modifiers(struct dri_screen *_screen, uint32_t fourcc, dri2_query_compression_modifiers(struct dri_screen *_screen, uint32_t fourcc,

View File

@@ -25,9 +25,9 @@ kopperQueryBufferAge(struct dri_drawable *dPriv)
return 0; return 0;
} }
const __DRIconfig ** const struct dri_config **
kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred); kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred);
const __DRIconfig ** const struct dri_config **
kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred) kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred)
{ {
return NULL; return NULL;

View File

@@ -367,7 +367,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
struct dri_screen *dri_screen_display_gpu, struct dri_screen *dri_screen_display_gpu,
bool multiplanes_available, bool multiplanes_available,
bool prefer_back_buffer_reuse, bool prefer_back_buffer_reuse,
const __DRIconfig *dri_config, const struct dri_config *dri_config,
const struct loader_dri3_vtable *vtable, const struct loader_dri3_vtable *vtable,
struct loader_dri3_drawable *draw) struct loader_dri3_drawable *draw)
{ {

View File

@@ -204,7 +204,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
struct dri_screen *dri_screen_display_gpu, struct dri_screen *dri_screen_display_gpu,
bool is_multiplanes_available, bool is_multiplanes_available,
bool prefer_back_buffer_reuse, bool prefer_back_buffer_reuse,
const __DRIconfig *dri_config, const struct dri_config *dri_config,
const struct loader_dri3_vtable *vtable, const struct loader_dri3_vtable *vtable,
struct loader_dri3_drawable*); struct loader_dri3_drawable*);

View File

@@ -34,8 +34,7 @@
struct dri_screen; struct dri_screen;
struct dri_context; struct dri_context;
struct dri_drawable; struct dri_drawable;
struct dri_config;
typedef struct __DRIconfigRec __DRIconfig;
/** /**
* Extension struct. Drivers 'inherit' from this struct by embedding * Extension struct. Drivers 'inherit' from this struct by embedding
@@ -391,7 +390,7 @@ typedef struct {
} __DRIuseInvalidateExtension; } __DRIuseInvalidateExtension;
/** /**
* Tokens for __DRIconfig attribs. A number of attributes defined by * Tokens for struct dri_config attribs. A number of attributes defined by
* GLX or EGL standards are not in the table, as they must be provided * GLX or EGL standards are not in the table, as they must be provided
* by the loader. For example, FBConfig ID or visual ID, drawable type. * by the loader. For example, FBConfig ID or visual ID, drawable type.
*/ */
@@ -494,7 +493,7 @@ typedef struct {
struct dri_screen *(*createNewScreen)(int screen, int fd, struct dri_screen *(*createNewScreen)(int screen, int fd,
unsigned int sarea_handle, unsigned int sarea_handle,
const __DRIextension **extensions, const __DRIextension **extensions,
const __DRIconfig ***driverConfigs, const struct dri_config ***driverConfigs,
void *loaderPrivate); void *loaderPrivate);
void (*destroyScreen)(struct dri_screen *screen); void (*destroyScreen)(struct dri_screen *screen);
@@ -502,17 +501,17 @@ typedef struct {
const __DRIextension **(*getExtensions)(struct dri_screen *screen); const __DRIextension **(*getExtensions)(struct dri_screen *screen);
/* Not used by the X server. */ /* Not used by the X server. */
int (*getConfigAttrib)(const __DRIconfig *config, int (*getConfigAttrib)(const struct dri_config *config,
unsigned int attrib, unsigned int attrib,
unsigned int *value); unsigned int *value);
/* Not used by the X server. */ /* Not used by the X server. */
int (*indexConfigAttrib)(const __DRIconfig *config, int index, int (*indexConfigAttrib)(const struct dri_config *config, int index,
unsigned int *attrib, unsigned int *value); unsigned int *attrib, unsigned int *value);
/* Not used by the X server. */ /* Not used by the X server. */
struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen, struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen,
const __DRIconfig *config, const struct dri_config *config,
unsigned int drawable_id, unsigned int drawable_id,
unsigned int head, unsigned int head,
void *loaderPrivate); void *loaderPrivate);
@@ -525,7 +524,7 @@ typedef struct {
/* Used by the X server in swrast mode. */ /* Used by the X server in swrast mode. */
struct dri_context *(*createNewContext)(struct dri_screen *screen, struct dri_context *(*createNewContext)(struct dri_screen *screen,
const __DRIconfig *config, const struct dri_config *config,
struct dri_context *shared, struct dri_context *shared,
void *loaderPrivate); void *loaderPrivate);
@@ -555,25 +554,25 @@ typedef struct dri_screen *
(*__DRIcreateNewScreen2Func)(int screen, int fd, (*__DRIcreateNewScreen2Func)(int screen, int fd,
const __DRIextension **extensions, const __DRIextension **extensions,
const __DRIextension **driver_extensions, const __DRIextension **driver_extensions,
const __DRIconfig ***driver_configs, const struct dri_config ***driver_configs,
void *loaderPrivate); void *loaderPrivate);
typedef struct dri_screen * typedef struct dri_screen *
(*__DRIcreateNewScreen3Func)(int screen, int fd, (*__DRIcreateNewScreen3Func)(int screen, int fd,
const __DRIextension **extensions, const __DRIextension **extensions,
const __DRIextension **driver_extensions, const __DRIextension **driver_extensions,
const __DRIconfig ***driver_configs, const struct dri_config ***driver_configs,
bool implicit, bool implicit,
void *loaderPrivate); void *loaderPrivate);
typedef struct dri_drawable * typedef struct dri_drawable *
(*__DRIcreateNewDrawableFunc)(struct dri_screen *screen, (*__DRIcreateNewDrawableFunc)(struct dri_screen *screen,
const __DRIconfig *config, const struct dri_config *config,
void *loaderPrivate); void *loaderPrivate);
typedef struct dri_context * typedef struct dri_context *
(*__DRIcreateContextAttribsFunc)(struct dri_screen *screen, (*__DRIcreateContextAttribsFunc)(struct dri_screen *screen,
int api, int api,
const __DRIconfig *config, const struct dri_config *config,
struct dri_context *shared, struct dri_context *shared,
unsigned num_attribs, unsigned num_attribs,
const uint32_t *attribs, const uint32_t *attribs,
@@ -1190,7 +1189,7 @@ typedef struct {
* *
* \since 22 * \since 22
*/ */
bool (*queryCompressionRates)(struct dri_screen *screen, const __DRIconfig *config, bool (*queryCompressionRates)(struct dri_screen *screen, const struct dri_config *config,
int max, enum __DRIFixedRateCompression *rates, int max, enum __DRIFixedRateCompression *rates,
int *count); int *count);
@@ -1565,7 +1564,7 @@ typedef struct {
__DRIcreateContextAttribsFunc createContext; __DRIcreateContextAttribsFunc createContext;
/* driver function for finishing initialization inside createNewScreen(). */ /* driver function for finishing initialization inside createNewScreen(). */
const __DRIconfig **(*initScreen)(struct dri_screen *screen, bool driver_name_is_inferred); const struct dri_config **(*initScreen)(struct dri_screen *screen, bool driver_name_is_inferred);
int (*queryCompatibleRenderOnlyDeviceFd)(int kms_only_fd); int (*queryCompatibleRenderOnlyDeviceFd)(int kms_only_fd);

View File

@@ -1149,7 +1149,7 @@ dri_destroy(struct gbm_device *gbm)
driDestroyScreen(dri->screen); driDestroyScreen(dri->screen);
for (i = 0; dri->driver_configs[i]; i++) for (i = 0; dri->driver_configs[i]; i++)
free((__DRIconfig *) dri->driver_configs[i]); free((struct dri_config *) dri->driver_configs[i]);
free(dri->driver_configs); free(dri->driver_configs);
free(dri->driver_name); free(dri->driver_name);

View File

@@ -60,7 +60,7 @@ struct gbm_dri_device {
struct dri_context *context; struct dri_context *context;
mtx_t mutex; mtx_t mutex;
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
const __DRIextension **loader_extensions; const __DRIextension **loader_extensions;
GLboolean (*validate_image)(void *image, void *data); GLboolean (*validate_image)(void *image, void *data);

View File

@@ -42,7 +42,7 @@ extern "C" {
struct dri2_screen { struct dri2_screen {
struct glx_screen base; struct glx_screen base;
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
int fd; int fd;

View File

@@ -491,7 +491,7 @@ struct glx_screen *
dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred, bool *return_zink) dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred, bool *return_zink)
{ {
xcb_connection_t *c = XGetXCBConnection(priv->dpy); xcb_connection_t *c = XGetXCBConnection(priv->dpy);
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
struct dri3_screen *psc; struct dri3_screen *psc;
__GLXDRIscreen *psp; __GLXDRIscreen *psp;
char *driverName, *driverNameDisplayGPU; char *driverName, *driverNameDisplayGPU;

View File

@@ -92,7 +92,7 @@ scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value)
} }
static int static int
driConfigEqual(struct glx_config *config, const __DRIconfig *driConfig) driConfigEqual(struct glx_config *config, const struct dri_config *driConfig)
{ {
unsigned int attrib, value, glxValue; unsigned int attrib, value, glxValue;
int i; int i;
@@ -186,7 +186,7 @@ driConfigEqual(struct glx_config *config, const __DRIconfig *driConfig)
} }
static struct glx_config * static struct glx_config *
createDriMode(struct glx_config *config, const __DRIconfig **driConfigs) createDriMode(struct glx_config *config, const struct dri_config **driConfigs)
{ {
__GLXDRIconfigPrivate *driConfig; __GLXDRIconfigPrivate *driConfig;
int i; int i;
@@ -210,7 +210,7 @@ createDriMode(struct glx_config *config, const __DRIconfig **driConfigs)
} }
_X_HIDDEN struct glx_config * _X_HIDDEN struct glx_config *
driConvertConfigs(struct glx_config *configs, const __DRIconfig **driConfigs) driConvertConfigs(struct glx_config *configs, const struct dri_config **driConfigs)
{ {
struct glx_config head, *tail, *m; struct glx_config head, *tail, *m;
@@ -231,12 +231,12 @@ driConvertConfigs(struct glx_config *configs, const __DRIconfig **driConfigs)
} }
_X_HIDDEN void _X_HIDDEN void
driDestroyConfigs(const __DRIconfig **configs) driDestroyConfigs(const struct dri_config **configs)
{ {
int i; int i;
for (i = 0; configs[i]; i++) for (i = 0; configs[i]; i++)
free((__DRIconfig *) configs[i]); free((struct dri_config *) configs[i]);
free(configs); free(configs);
} }
@@ -970,7 +970,7 @@ dri_bind_tex_image(__GLXDRIdrawable *base, int buffer, const int *attrib_list)
bool bool
dri_screen_init(struct glx_screen *psc, struct glx_display *priv, int screen, int fd, const __DRIextension **loader_extensions, bool driver_name_is_inferred) dri_screen_init(struct glx_screen *psc, struct glx_display *priv, int screen, int fd, const __DRIextension **loader_extensions, bool driver_name_is_inferred)
{ {
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
struct glx_config *configs = NULL, *visuals = NULL; struct glx_config *configs = NULL, *visuals = NULL;
if (!glx_screen_init(psc, screen, priv)) if (!glx_screen_init(psc, screen, priv))

View File

@@ -48,13 +48,13 @@ typedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate;
struct __GLXDRIconfigPrivateRec struct __GLXDRIconfigPrivateRec
{ {
struct glx_config base; struct glx_config base;
const __DRIconfig *driConfig; const struct dri_config *driConfig;
}; };
extern struct glx_config *driConvertConfigs(struct glx_config * modes, extern struct glx_config *driConvertConfigs(struct glx_config * modes,
const __DRIconfig ** configs); const struct dri_config ** configs);
extern void driDestroyConfigs(const __DRIconfig **configs); extern void driDestroyConfigs(const struct dri_config **configs);
extern __GLXDRIdrawable * extern __GLXDRIdrawable *
driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable); driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);

View File

@@ -525,7 +525,7 @@ struct glx_screen
*/ */
__GLXDRIscreen driScreen; __GLXDRIscreen driScreen;
struct dri_screen *frontend_screen; struct dri_screen *frontend_screen;
const __DRIconfig **driver_configs; const struct dri_config **driver_configs;
#endif #endif
/** /**