From ee54fe9f691a27aab8690f3b95ac824efd2e80fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 21 Oct 2024 02:19:46 -0400 Subject: [PATCH] mesa_interface: rename __DRIconfig to struct dri_config Reviewed-By: Mike Blumenkrantz Part-of: --- include/kopper_interface.h | 2 +- src/egl/drivers/dri2/egl_dri2.c | 16 +++++----- src/egl/drivers/dri2/egl_dri2.h | 14 ++++----- src/egl/drivers/dri2/platform_android.c | 2 +- src/egl/drivers/dri2/platform_device.c | 2 +- src/egl/drivers/dri2/platform_drm.c | 6 ++-- src/egl/drivers/dri2/platform_surfaceless.c | 2 +- src/egl/drivers/dri2/platform_wayland.c | 4 +-- src/egl/drivers/dri2/platform_x11.c | 4 +-- src/egl/drivers/dri2/platform_x11_dri3.c | 2 +- src/gallium/frontends/dri/dri2.c | 2 +- src/gallium/frontends/dri/dri_drawable.c | 2 +- src/gallium/frontends/dri/dri_screen.c | 30 +++++++++---------- src/gallium/frontends/dri/dri_screen.h | 2 +- src/gallium/frontends/dri/dri_util.c | 16 +++++----- src/gallium/frontends/dri/dri_util.h | 18 +++++------ src/gallium/frontends/dri/kopper_stubs.c | 4 +-- .../frontends/dri/loader_dri3_helper.c | 2 +- .../frontends/dri/loader_dri3_helper.h | 2 +- src/gallium/include/mesa_interface.h | 27 ++++++++--------- src/gbm/backends/dri/gbm_dri.c | 2 +- src/gbm/backends/dri/gbm_driint.h | 2 +- src/glx/dri2_priv.h | 2 +- src/glx/dri3_glx.c | 2 +- src/glx/dri_common.c | 12 ++++---- src/glx/dri_common.h | 6 ++-- src/glx/glxclient.h | 2 +- 27 files changed, 93 insertions(+), 94 deletions(-) diff --git a/include/kopper_interface.h b/include/kopper_interface.h index 24d93f1049c..7e3027713e9 100644 --- a/include/kopper_interface.h +++ b/include/kopper_interface.h @@ -64,7 +64,7 @@ struct __DRIkopperExtensionRec { * a pixmap is undefined. */ struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen, - const __DRIconfig *config, + const struct dri_config *config, void *loaderPrivate, __DRIkopperDrawableInfo *info); /* flags is a set of __DRI2_FLUSH_* flags */ diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index d5b1fdc588e..f7face51075 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -277,7 +277,7 @@ static const EGLint dri2_to_egl_attribute_map[__DRI_ATTRIB_MAX] = { [__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, EGLenum colorspace) { @@ -307,7 +307,7 @@ dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria) } 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) { driGetConfigAttrib(config, __DRI_ATTRIB_RED_SHIFT, @@ -326,14 +326,14 @@ dri2_get_shifts_and_sizes(const __DRIconfig *config, int *shifts, enum pipe_format 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; return gl_config->color_format; } 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) { struct dri2_egl_config *conf; @@ -1026,7 +1026,7 @@ dri2_display_destroy(_EGLDisplay *disp) */ if (disp->Platform != _EGL_PLATFORM_DRM && dri2_dpy->driver_configs) { 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); @@ -1213,7 +1213,7 @@ dri2_create_context(_EGLDisplay *disp, _EGLConfig *conf, 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 dri2_egl_config *dri2_config = dri2_egl_config(conf); - const __DRIconfig *dri_config; + const struct dri_config *dri_config; int api; unsigned error; unsigned num_attribs = NUM_ATTRIBS; @@ -1386,7 +1386,7 @@ dri2_surf_update_fence_fd(_EGLContext *ctx, _EGLDisplay *disp, EGLBoolean 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) { 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]; 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); if (!dri2_query_compression_rates( dri2_dpy->dri_screen_render_gpu, dri_conf, rate_size, dri_rates, diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 5335931a49c..44cd6b76e68 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -241,7 +241,7 @@ struct dri2_egl_display { */ struct dri_screen *dri_screen_display_gpu; bool own_dri_screen; - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; /* fd of the GPU used for rendering. */ int fd_render_gpu; /* 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 { _EGLConfig base; - const __DRIconfig *dri_config[2][2]; + const struct dri_config *dri_config[2][2]; }; struct dri2_egl_image { @@ -480,15 +480,15 @@ __DRIimage * dri2_lookup_egl_image_validated(void *image, void *data); 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); enum pipe_format dri2_image_format_for_pbuffer_config(struct dri2_egl_display *dri2_dpy, - const __DRIconfig *config); + const struct dri_config *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); void @@ -599,7 +599,7 @@ dri2_flush_drawable_for_swapbuffers_flags( void 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, EGLenum colorspace); #include "dri_util.h" @@ -634,7 +634,7 @@ dri2_fini_surface(_EGLSurface *surf); EGLBoolean 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); static inline uint64_t diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 67379645550..835bb8cfa63 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -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_surface *dri2_surf; struct ANativeWindow *window = native_window; - const __DRIconfig *config; + const struct dri_config *config; dri2_surf = calloc(1, sizeof *dri2_surf); if (!dri2_surf) { diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index 5a5bcf8c217..3202b6069c5 100644 --- a/src/egl/drivers/dri2/platform_device.c +++ b/src/egl/drivers/dri2/platform_device.c @@ -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_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_surface *dri2_surf; - const __DRIconfig *config; + const struct dri_config *config; /* Make sure to calloc so all pointers * are originally NULL. diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 2d7e10b3fc5..0631b3d929f 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -98,7 +98,7 @@ has_free_buffers(struct gbm_surface *_surf) static bool dri2_drm_config_is_compatible(struct dri2_egl_display *dri2_dpy, - const __DRIconfig *config, + const struct dri_config *config, struct gbm_surface *surface) { 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 gbm_surface *surface = native_surface; struct gbm_dri_surface *surf; - const __DRIconfig *config; + const struct dri_config *config; dri2_surf = calloc(1, sizeof *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)); 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; for (unsigned j = 0; j < num_visuals; j++) { diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index 17dc86425fc..5f743b16b02 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -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_config *dri2_conf = dri2_egl_config(conf); struct dri2_egl_surface *dri2_surf; - const __DRIconfig *config; + const struct dri_config *config; /* Make sure to calloc so all pointers * are originally NULL. diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 74e64189ea8..4d1460400ba 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -183,7 +183,7 @@ dri2_wl_visual_idx_from_pipe_format(enum pipe_format pipe_format) } 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; @@ -664,7 +664,7 @@ dri2_wl_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf, struct dri2_egl_surface *dri2_surf; struct zwp_linux_dmabuf_v1 *dmabuf_wrapper; int visual_idx; - const __DRIconfig *config; + const struct dri_config *config; if (!window) { _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface"); diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index d95e15eaaeb..4895e6d24fd 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -418,7 +418,7 @@ dri2_x11_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf, xcb_get_geometry_cookie_t cookie; xcb_get_geometry_reply_t *reply; xcb_generic_error_t *error; - const __DRIconfig *config; + const struct dri_config *config; dri2_surf = calloc(1, sizeof *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++) { - const __DRIconfig *config = dri2_dpy->driver_configs[j]; + const struct dri_config *config = dri2_dpy->driver_configs[j]; int shifts[4]; unsigned int sizes[4]; diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 00ae25c2dfe..d9b518f2a8e 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -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_config *dri2_conf = dri2_egl_config(conf); struct dri3_egl_surface *dri3_surf; - const __DRIconfig *dri_config; + const struct dri_config *dri_config; xcb_drawable_t drawable; dri3_surf = calloc(1, sizeof *dri3_surf); diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 8b359480b4c..f9a52016edb 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1719,7 +1719,7 @@ exit: } 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) { struct pipe_screen *pscreen = screen->base.screen; diff --git a/src/gallium/frontends/dri/dri_drawable.c b/src/gallium/frontends/dri/dri_drawable.c index 1b64c6a1ebb..c9099671fbd 100644 --- a/src/gallium/frontends/dri/dri_drawable.c +++ b/src/gallium/frontends/dri/dri_drawable.c @@ -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. */ 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) { const struct gl_config *visual = &config->modes; diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index fe09eb5d65c..d55de482133 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -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. * * \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. * Currently the only cause of failure is a bad parameter (i.e., unsupported * \c format). */ -static __DRIconfig ** +static struct dri_config ** driCreateConfigs(enum pipe_format format, enum pipe_format *zs_formats, unsigned num_zs_formats, const bool *db_modes, unsigned num_db_modes, @@ -151,7 +151,7 @@ driCreateConfigs(enum pipe_format format, uint32_t masks[4]; int shifts[4]; int color_bits[4]; - __DRIconfig **configs, **c; + struct dri_config **configs, **c; struct gl_config *modes; unsigned i, j, k, h; unsigned num_modes; @@ -267,10 +267,10 @@ driCreateConfigs(enum pipe_format format, return configs; } -static __DRIconfig ** -driConcatConfigs(__DRIconfig **a, __DRIconfig **b) +static struct dri_config ** +driConcatConfigs(struct dri_config **a, struct dri_config **b) { - __DRIconfig **all; + struct dri_config **all; int i, j, index; 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) { /* 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. * * The problem, as of 2017-05-30: - * When matching a GLXFBConfig to a __DRIconfig, GLX ignores the channel - * order and chooses the first __DRIconfig with the expected channel - * sizes. Specifically, GLX compares the GLXFBConfig's and __DRIconfig's + * When matching a GLXFBConfig to a struct dri_config, GLX ignores the channel + * order and chooses the first struct dri_config with the expected channel + * sizes. Specifically, GLX compares the GLXFBConfig's and struct dri_config's * __DRI_ATTRIB_{CHANNEL}_SIZE but ignores __DRI_ATTRIB_{CHANNEL}_MASK. * * 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[] = { PIPE_FORMAT_B10G10R10A2_UNORM, @@ -338,7 +338,7 @@ dri_fill_in_modes(struct dri_screen *screen) PIPE_FORMAT_B4G4R4A4_UNORM, PIPE_FORMAT_R4G4B4A4_UNORM, }; - __DRIconfig **configs = NULL; + struct dri_config **configs = NULL; enum pipe_format zs_formats[5]; unsigned num_zs_formats = 0; unsigned i; @@ -385,7 +385,7 @@ dri_fill_in_modes(struct dri_screen *screen) /* Add configs. */ 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 */ uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; @@ -455,7 +455,7 @@ dri_fill_in_modes(struct dri_screen *screen) 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); } -const __DRIconfig ** +const struct dri_config ** dri_init_screen(struct dri_screen *screen, struct pipe_screen *pscreen, bool has_multibuffer) diff --git a/src/gallium/frontends/dri/dri_screen.h b/src/gallium/frontends/dri/dri_screen.h index 41b2454d984..5af32378d0f 100644 --- a/src/gallium/frontends/dri/dri_screen.h +++ b/src/gallium/frontends/dri/dri_screen.h @@ -185,7 +185,7 @@ dri_fill_st_visual(struct st_visual *stvis, void dri_init_options(struct dri_screen *screen); -const __DRIconfig ** +const struct dri_config ** dri_init_screen(struct dri_screen *screen, struct pipe_screen *pscreen, bool has_multibuffer); diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c index 98ba2a45607..5b3e92298c3 100644 --- a/src/gallium/frontends/dri/dri_util.c +++ b/src/gallium/frontends/dri/dri_util.c @@ -102,7 +102,7 @@ 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, + const struct dri_config ***driver_configs, bool driver_name_is_inferred, bool has_multibuffer, void *data) { struct dri_screen *screen; @@ -222,7 +222,7 @@ void driDestroyScreen(struct dri_screen *psp) * indicated by the index. */ static int -driGetConfigAttribIndex(const __DRIconfig *config, +driGetConfigAttribIndex(const struct dri_config *config, unsigned int index, unsigned int *value) { switch (index + 1) { @@ -343,7 +343,7 @@ driGetConfigAttribIndex(const __DRIconfig *config, * \return 1 for success, 0 for failure */ int -driGetConfigAttrib(const __DRIconfig *config, +driGetConfigAttrib(const struct dri_config *config, unsigned int attrib, unsigned int *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. - * \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 value returns the attribute's value * \return 1 for success, 0 for failure */ int -driIndexConfigAttrib(const __DRIconfig *config, int index, +driIndexConfigAttrib(const struct dri_config *config, int index, unsigned int *attrib, unsigned int *value) { if (driGetConfigAttribIndex(config, index, value)) { @@ -424,7 +424,7 @@ validate_context_version(struct dri_screen *screen, struct dri_context * driCreateContextAttribs(struct dri_screen *screen, int api, - const __DRIconfig *config, + const struct dri_config *config, struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, @@ -608,7 +608,7 @@ driCreateContextAttribs(struct dri_screen *screen, int api, static struct dri_context * driCreateNewContextForAPI(struct dri_screen *screen, int api, - const __DRIconfig *config, + const struct dri_config *config, struct dri_context *shared, void *data) { unsigned error; @@ -618,7 +618,7 @@ driCreateNewContextForAPI(struct dri_screen *screen, int api, } 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) { return driCreateNewContextForAPI(screen, __DRI_API_OPENGL, diff --git a/src/gallium/frontends/dri/dri_util.h b/src/gallium/frontends/dri/dri_util.h index 55b93754a57..593e4ce0acb 100644 --- a/src/gallium/frontends/dri/dri_util.h +++ b/src/gallium/frontends/dri/dri_util.h @@ -53,7 +53,7 @@ struct mesa_glinterop_flush_out; #define __DRI_BACKEND_VTABLE "DRI_DriverVtable" -struct __DRIconfigRec { +struct dri_config { struct gl_config modes; }; @@ -110,11 +110,11 @@ 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, + const struct dri_config ***driver_configs, bool driver_name_is_inferred, bool has_multibuffer, void *data); PUBLIC struct dri_context * driCreateContextAttribs(struct dri_screen *psp, int api, - const __DRIconfig *config, + const struct dri_config *config, struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, @@ -126,14 +126,14 @@ driImageFormatToSizedInternalGLFormat(uint32_t image_format); PUBLIC unsigned int driGetAPIMask(struct dri_screen *screen); 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); extern const __DRIimageDriverExtension driImageDriverExtension; PUBLIC void driDestroyScreen(struct dri_screen *psp); 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 -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 driDestroyDrawable(struct dri_drawable *drawable); PUBLIC void @@ -141,7 +141,7 @@ driSwapBuffers(struct dri_drawable *drawable); PUBLIC void driSwapBuffersWithDamage(struct dri_drawable *drawable, int nrects, const int *rects); 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 driCopyContext(struct dri_context *dest, struct dri_context *src, unsigned long mask); PUBLIC void @@ -156,7 +156,7 @@ PUBLIC int64_t kopperSwapBuffersWithDamage(struct dri_drawable *drawable, uint32_t flush_flags, int nrects, const int *rects); PUBLIC struct dri_drawable * kopperCreateNewDrawable(struct dri_screen *psp, - const __DRIconfig *config, + const struct dri_config *config, void *data, __DRIkopperDrawableInfo *info); PUBLIC void @@ -303,7 +303,7 @@ PUBLIC void dri2_set_in_fence_fd(__DRIimage *img, int fd); 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); PUBLIC bool dri2_query_compression_modifiers(struct dri_screen *_screen, uint32_t fourcc, diff --git a/src/gallium/frontends/dri/kopper_stubs.c b/src/gallium/frontends/dri/kopper_stubs.c index 80362091b26..fdb92bf610b 100644 --- a/src/gallium/frontends/dri/kopper_stubs.c +++ b/src/gallium/frontends/dri/kopper_stubs.c @@ -25,9 +25,9 @@ kopperQueryBufferAge(struct dri_drawable *dPriv) return 0; } -const __DRIconfig ** +const struct dri_config ** 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) { return NULL; diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c index 666ea87750e..a4afd0b2b0c 100644 --- a/src/gallium/frontends/dri/loader_dri3_helper.c +++ b/src/gallium/frontends/dri/loader_dri3_helper.c @@ -367,7 +367,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, struct dri_screen *dri_screen_display_gpu, bool multiplanes_available, bool prefer_back_buffer_reuse, - const __DRIconfig *dri_config, + const struct dri_config *dri_config, const struct loader_dri3_vtable *vtable, struct loader_dri3_drawable *draw) { diff --git a/src/gallium/frontends/dri/loader_dri3_helper.h b/src/gallium/frontends/dri/loader_dri3_helper.h index 21948e0029d..93c012100f2 100644 --- a/src/gallium/frontends/dri/loader_dri3_helper.h +++ b/src/gallium/frontends/dri/loader_dri3_helper.h @@ -204,7 +204,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn, struct dri_screen *dri_screen_display_gpu, bool is_multiplanes_available, bool prefer_back_buffer_reuse, - const __DRIconfig *dri_config, + const struct dri_config *dri_config, const struct loader_dri3_vtable *vtable, struct loader_dri3_drawable*); diff --git a/src/gallium/include/mesa_interface.h b/src/gallium/include/mesa_interface.h index 0b5e527f94c..9b972065da7 100644 --- a/src/gallium/include/mesa_interface.h +++ b/src/gallium/include/mesa_interface.h @@ -34,8 +34,7 @@ struct dri_screen; struct dri_context; struct dri_drawable; - -typedef struct __DRIconfigRec __DRIconfig; +struct dri_config; /** * Extension struct. Drivers 'inherit' from this struct by embedding @@ -391,7 +390,7 @@ typedef struct { } __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 * 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, unsigned int sarea_handle, const __DRIextension **extensions, - const __DRIconfig ***driverConfigs, + const struct dri_config ***driverConfigs, void *loaderPrivate); void (*destroyScreen)(struct dri_screen *screen); @@ -502,17 +501,17 @@ typedef struct { const __DRIextension **(*getExtensions)(struct dri_screen *screen); /* Not used by the X server. */ - int (*getConfigAttrib)(const __DRIconfig *config, + int (*getConfigAttrib)(const struct dri_config *config, unsigned int attrib, unsigned int *value); /* 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); /* Not used by the X server. */ struct dri_drawable *(*createNewDrawable)(struct dri_screen *screen, - const __DRIconfig *config, + const struct dri_config *config, unsigned int drawable_id, unsigned int head, void *loaderPrivate); @@ -525,7 +524,7 @@ typedef struct { /* Used by the X server in swrast mode. */ struct dri_context *(*createNewContext)(struct dri_screen *screen, - const __DRIconfig *config, + const struct dri_config *config, struct dri_context *shared, void *loaderPrivate); @@ -555,25 +554,25 @@ typedef struct dri_screen * (*__DRIcreateNewScreen2Func)(int screen, int fd, const __DRIextension **extensions, const __DRIextension **driver_extensions, - const __DRIconfig ***driver_configs, + const struct dri_config ***driver_configs, void *loaderPrivate); typedef struct dri_screen * (*__DRIcreateNewScreen3Func)(int screen, int fd, const __DRIextension **extensions, const __DRIextension **driver_extensions, - const __DRIconfig ***driver_configs, + const struct dri_config ***driver_configs, bool implicit, void *loaderPrivate); typedef struct dri_drawable * (*__DRIcreateNewDrawableFunc)(struct dri_screen *screen, - const __DRIconfig *config, + const struct dri_config *config, void *loaderPrivate); typedef struct dri_context * (*__DRIcreateContextAttribsFunc)(struct dri_screen *screen, int api, - const __DRIconfig *config, + const struct dri_config *config, struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, @@ -1190,7 +1189,7 @@ typedef struct { * * \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 *count); @@ -1565,7 +1564,7 @@ typedef struct { __DRIcreateContextAttribsFunc createContext; /* 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); diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 74cd789b951..b8ed7d04afa 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -1149,7 +1149,7 @@ dri_destroy(struct gbm_device *gbm) driDestroyScreen(dri->screen); 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_name); diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h index 46d1fc0a0c3..b924b7cbc1f 100644 --- a/src/gbm/backends/dri/gbm_driint.h +++ b/src/gbm/backends/dri/gbm_driint.h @@ -60,7 +60,7 @@ struct gbm_dri_device { struct dri_context *context; mtx_t mutex; - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; const __DRIextension **loader_extensions; GLboolean (*validate_image)(void *image, void *data); diff --git a/src/glx/dri2_priv.h b/src/glx/dri2_priv.h index 7d7342ee83a..d3fe9590abc 100644 --- a/src/glx/dri2_priv.h +++ b/src/glx/dri2_priv.h @@ -42,7 +42,7 @@ extern "C" { struct dri2_screen { struct glx_screen base; - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; int fd; diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 69732897fa9..dc4eb843526 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -491,7 +491,7 @@ struct glx_screen * dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred, bool *return_zink) { xcb_connection_t *c = XGetXCBConnection(priv->dpy); - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; struct dri3_screen *psc; __GLXDRIscreen *psp; char *driverName, *driverNameDisplayGPU; diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 092162fac53..6f2565732a6 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -92,7 +92,7 @@ scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value) } 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; int i; @@ -186,7 +186,7 @@ driConfigEqual(struct glx_config *config, const __DRIconfig *driConfig) } static struct glx_config * -createDriMode(struct glx_config *config, const __DRIconfig **driConfigs) +createDriMode(struct glx_config *config, const struct dri_config **driConfigs) { __GLXDRIconfigPrivate *driConfig; int i; @@ -210,7 +210,7 @@ createDriMode(struct glx_config *config, const __DRIconfig **driConfigs) } _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; @@ -231,12 +231,12 @@ driConvertConfigs(struct glx_config *configs, const __DRIconfig **driConfigs) } _X_HIDDEN void -driDestroyConfigs(const __DRIconfig **configs) +driDestroyConfigs(const struct dri_config **configs) { int i; for (i = 0; configs[i]; i++) - free((__DRIconfig *) configs[i]); + free((struct dri_config *) configs[i]); free(configs); } @@ -970,7 +970,7 @@ dri_bind_tex_image(__GLXDRIdrawable *base, int buffer, const int *attrib_list) 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) { - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; struct glx_config *configs = NULL, *visuals = NULL; if (!glx_screen_init(psc, screen, priv)) diff --git a/src/glx/dri_common.h b/src/glx/dri_common.h index 0f3f2be8e40..ff7fce93255 100644 --- a/src/glx/dri_common.h +++ b/src/glx/dri_common.h @@ -48,13 +48,13 @@ typedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate; struct __GLXDRIconfigPrivateRec { struct glx_config base; - const __DRIconfig *driConfig; + const struct dri_config *driConfig; }; 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 * driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable); diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index c0e188d09d9..97c5bc093f9 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -525,7 +525,7 @@ struct glx_screen */ __GLXDRIscreen driScreen; struct dri_screen *frontend_screen; - const __DRIconfig **driver_configs; + const struct dri_config **driver_configs; #endif /**