diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index b13a9fe98f1..20ce2ddc103 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1211,7 +1211,7 @@ dri2_create_context(_EGLDisplay *disp, _EGLConfig *conf, struct dri2_egl_context *dri2_ctx; struct dri2_egl_display *dri2_dpy = dri2_egl_display_lock(disp); struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list); - __DRIcontext *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); const __DRIconfig *dri_config; int api; @@ -1367,7 +1367,7 @@ static void dri2_surf_update_fence_fd(_EGLContext *ctx, _EGLDisplay *disp, _EGLSurface *surf) { - __DRIcontext *dri_ctx = dri2_egl_context(ctx)->dri_context; + struct dri_context *dri_ctx = dri2_egl_context(ctx)->dri_context; struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); int fence_fd = -1; @@ -1413,7 +1413,7 @@ dri2_make_current(_EGLDisplay *disp, _EGLSurface *dsurf, _EGLSurface *rsurf, _EGLSurface *old_dsurf, *old_rsurf; _EGLSurface *tmp_dsurf, *tmp_rsurf; __DRIdrawable *ddraw, *rdraw; - __DRIcontext *cctx; + struct dri_context *cctx; EGLint egl_error = EGL_SUCCESS; if (!dri2_dpy) @@ -1431,7 +1431,7 @@ dri2_make_current(_EGLDisplay *disp, _EGLSurface *dsurf, _EGLSurface *rsurf, } if (old_ctx) { - __DRIcontext *old_cctx = dri2_egl_context(old_ctx)->dri_context; + struct dri_context *old_cctx = dri2_egl_context(old_ctx)->dri_context; old_disp = old_ctx->Resource.Display; old_dri2_dpy = dri2_egl_display(old_disp); diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 32332748371..819070c9aec 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -315,7 +315,7 @@ struct dri2_egl_display { struct dri2_egl_context { _EGLContext base; - __DRIcontext *dri_context; + struct dri_context *dri_context; }; struct dri2_egl_surface { diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 076adae68d4..bb351317cbf 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -67,7 +67,7 @@ egl_dri3_in_current_context(struct loader_dri3_drawable *draw) return ctx->Resource.Display == dri3_surf->surf.base.Resource.Display; } -static __DRIcontext * +static struct dri_context * egl_dri3_get_dri_context(struct loader_dri3_drawable *draw) { _EGLContext *ctx = _eglGetCurrentContext(); diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index a57ab7ac99f..960192fc6a6 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1775,12 +1775,11 @@ dri2_query_compression_modifiers(struct dri_screen *screen, uint32_t fourcc, } void -dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src, +dri2_blit_image(struct dri_context *ctx, __DRIimage *dst, __DRIimage *src, int dstx0, int dsty0, int dstwidth, int dstheight, int srcx0, int srcy0, int srcwidth, int srcheight, int flush_flag) { - struct dri_context *ctx = dri_context(context); struct pipe_context *pipe = ctx->st->pipe; struct pipe_screen *screen; struct pipe_fence_handle *fence; @@ -1829,11 +1828,10 @@ dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src, } void * -dri2_map_image(__DRIcontext *context, __DRIimage *image, +dri2_map_image(struct dri_context *ctx, __DRIimage *image, int x0, int y0, int width, int height, unsigned int flags, int *stride, void **data) { - struct dri_context *ctx = dri_context(context); struct pipe_context *pipe = ctx->st->pipe; enum pipe_map_flags pipe_access = 0; struct pipe_transfer *trans; @@ -1873,9 +1871,8 @@ dri2_map_image(__DRIcontext *context, __DRIimage *image, } void -dri2_unmap_image(__DRIcontext *context, __DRIimage *image, void *data) +dri2_unmap_image(struct dri_context *ctx, __DRIimage *image, void *data) { - struct dri_context *ctx = dri_context(context); struct pipe_context *pipe = ctx->st->pipe; /* Wait for glthread to finish because we can't use pipe_context from @@ -1893,26 +1890,26 @@ dri2_get_capabilities(struct dri_screen *screen) } int -dri_interop_query_device_info(__DRIcontext *_ctx, +dri_interop_query_device_info(struct dri_context *ctx, struct mesa_glinterop_device_info *out) { - return st_interop_query_device_info(dri_context(_ctx)->st, out); + return st_interop_query_device_info(ctx->st, out); } int -dri_interop_export_object(__DRIcontext *_ctx, +dri_interop_export_object(struct dri_context *ctx, struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_out *out) { - return st_interop_export_object(dri_context(_ctx)->st, in, out); + return st_interop_export_object(ctx->st, in, out); } int -dri_interop_flush_objects(__DRIcontext *_ctx, +dri_interop_flush_objects(struct dri_context *ctx, unsigned count, struct mesa_glinterop_export_in *objects, struct mesa_glinterop_flush_out *out) { - return st_interop_flush_objects(dri_context(_ctx)->st, count, objects, out); + return st_interop_flush_objects(ctx->st, count, objects, out); } /** diff --git a/src/gallium/frontends/dri/dri_context.h b/src/gallium/frontends/dri/dri_context.h index e008ed34912..f36f796e469 100644 --- a/src/gallium/frontends/dri/dri_context.h +++ b/src/gallium/frontends/dri/dri_context.h @@ -79,18 +79,6 @@ struct dri_context struct hud_context *hud; }; -static inline struct dri_context * -dri_context(__DRIcontext *driContextPriv) -{ - return (struct dri_context *)driContextPriv; -} - -static inline __DRIcontext * -opaque_dri_context(struct dri_context *ctx) -{ - return (__DRIcontext *)ctx; -} - /*********************************************************************** * dri_context.c */ diff --git a/src/gallium/frontends/dri/dri_drawable.c b/src/gallium/frontends/dri/dri_drawable.c index e763505f131..384c7b1c036 100644 --- a/src/gallium/frontends/dri/dri_drawable.c +++ b/src/gallium/frontends/dri/dri_drawable.c @@ -261,10 +261,9 @@ dri_drawable_validate_att(struct dri_context *ctx, * These are used for GLX_EXT_texture_from_pixmap */ void -dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target, +dri_set_tex_buffer2(struct dri_context *ctx, GLint target, GLint format, __DRIdrawable *dPriv) { - struct dri_context *ctx = dri_context(pDRICtx); struct st_context *st = ctx->st; struct dri_drawable *drawable = dri_drawable(dPriv); struct pipe_resource *pt; @@ -473,12 +472,11 @@ notify_before_flush_cb(void* _args) * \param throttle_reason the reason for throttling, 0 = no throttling */ void -dri_flush(__DRIcontext *cPriv, +dri_flush(struct dri_context *ctx, __DRIdrawable *dPriv, unsigned flags, enum __DRI2throttleReason reason) { - struct dri_context *ctx = dri_context(cPriv); struct dri_drawable *drawable = dri_drawable(dPriv); struct st_context *st; unsigned flush_flags; @@ -580,14 +578,14 @@ dri_flush_drawable(__DRIdrawable *dPriv) struct dri_context *ctx = dri_get_current(); if (ctx) - dri_flush(opaque_dri_context(ctx), dPriv, __DRI2_FLUSH_DRAWABLE, -1); + dri_flush(ctx, dPriv, __DRI2_FLUSH_DRAWABLE, -1); } /** * dri_throttle - A DRI2ThrottleExtension throttling function. */ void -dri_throttle(__DRIcontext *cPriv, __DRIdrawable *dPriv, +dri_throttle(struct dri_context *cPriv, __DRIdrawable *dPriv, enum __DRI2throttleReason reason) { dri_flush(cPriv, dPriv, 0, reason); diff --git a/src/gallium/frontends/dri/dri_drawable.h b/src/gallium/frontends/dri/dri_drawable.h index 7c41daf4221..7ed73cbce09 100644 --- a/src/gallium/frontends/dri/dri_drawable.h +++ b/src/gallium/frontends/dri/dri_drawable.h @@ -153,7 +153,7 @@ dri_pipe_blit(struct pipe_context *pipe, struct pipe_resource *src); void -dri_flush(__DRIcontext *cPriv, +dri_flush(struct dri_context *ctx, __DRIdrawable *dPriv, unsigned flags, enum __DRI2throttleReason reason); diff --git a/src/gallium/frontends/dri/dri_helpers.c b/src/gallium/frontends/dri/dri_helpers.c index 068bf7a6140..7712573f357 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -90,9 +90,8 @@ dri_fence_get_caps(struct dri_screen *driscreen) } void * -dri_create_fence(__DRIcontext *_ctx) +dri_create_fence(struct dri_context *ctx) { - struct dri_context *ctx = dri_context(_ctx); struct st_context *st = ctx->st; struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence); @@ -116,9 +115,8 @@ dri_create_fence(__DRIcontext *_ctx) } void * -dri_create_fence_fd(__DRIcontext *_ctx, int fd) +dri_create_fence_fd(struct dri_context *dri_ctx, int fd) { - struct dri_context *dri_ctx = dri_context(_ctx); struct st_context *st = dri_ctx->st; struct pipe_context *ctx = st->pipe; struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence); @@ -193,7 +191,7 @@ dri_destroy_fence(struct dri_screen *driscreen, void *_fence) } GLboolean -dri_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags, +dri_client_wait_sync(struct dri_context *_ctx, void *_fence, unsigned flags, uint64_t timeout) { struct dri2_fence *fence = (struct dri2_fence*)_fence; @@ -220,9 +218,9 @@ dri_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags, } void -dri_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags) +dri_server_wait_sync(struct dri_context *_ctx, void *_fence, unsigned flags) { - struct st_context *st = dri_context(_ctx)->st; + struct st_context *st = _ctx->st; struct pipe_context *ctx = st->pipe; struct dri2_fence *fence = (struct dri2_fence*)_fence; @@ -255,11 +253,10 @@ const __DRI2fenceExtension dri2FenceExtension = { }; __DRIimage * -dri_create_image_from_renderbuffer(__DRIcontext *context, +dri_create_image_from_renderbuffer(struct dri_context *dri_ctx, int renderbuffer, void *loaderPrivate, unsigned *error) { - struct dri_context *dri_ctx = dri_context(context); struct st_context *st = dri_ctx->st; struct gl_context *ctx = st->ctx; struct pipe_context *p_ctx = st->pipe; @@ -347,12 +344,11 @@ dri2_destroy_image(__DRIimage *img) __DRIimage * -dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture, +dri2_create_from_texture(struct dri_context *dri_ctx, int target, unsigned texture, int depth, int level, unsigned *error, void *loaderPrivate) { __DRIimage *img; - struct dri_context *dri_ctx = dri_context(context); struct st_context *st = dri_ctx->st; struct gl_context *ctx = st->ctx; struct pipe_context *p_ctx = st->pipe; diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c index 28453f4d2d0..409ff58de6a 100644 --- a/src/gallium/frontends/dri/dri_util.c +++ b/src/gallium/frontends/dri/dri_util.c @@ -422,10 +422,10 @@ validate_context_version(struct dri_screen *screen, /*****************************************************************/ /*@{*/ -__DRIcontext * +struct dri_context * driCreateContextAttribs(struct dri_screen *screen, int api, const __DRIconfig *config, - __DRIcontext *shared, + struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, unsigned *error, @@ -602,15 +602,14 @@ driCreateContextAttribs(struct dri_screen *screen, int api, struct dri_context *ctx = dri_create_context(screen, mesa_api, modes, &ctx_config, error, - dri_context(shared), - data); - return opaque_dri_context(ctx); + shared, data); + return ctx; } -static __DRIcontext * +static struct dri_context * driCreateNewContextForAPI(struct dri_screen *screen, int api, const __DRIconfig *config, - __DRIcontext *shared, void *data) + struct dri_context *shared, void *data) { unsigned error; @@ -618,9 +617,9 @@ driCreateNewContextForAPI(struct dri_screen *screen, int api, &error, data); } -__DRIcontext * +struct dri_context * driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, - __DRIcontext *shared, void *data) + struct dri_context *shared, void *data) { return driCreateNewContextForAPI(screen, __DRI_API_OPENGL, config, shared, data); @@ -634,14 +633,14 @@ driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, * drmDestroyContext(), and finally frees \p contextPrivate. */ void -driDestroyContext(__DRIcontext *pcp) +driDestroyContext(struct dri_context *ctx) { - if (pcp) - dri_destroy_context(dri_context(pcp)); + if (ctx) + dri_destroy_context(ctx); } int -driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask) +driCopyContext(struct dri_context *dest, struct dri_context *src, unsigned long mask) { (void) dest; (void) src; @@ -662,7 +661,7 @@ driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask) * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent * function. */ -int driBindContext(__DRIcontext *pcp, +int driBindContext(struct dri_context *ctx, __DRIdrawable *pdp, __DRIdrawable *prp) { @@ -671,10 +670,10 @@ int driBindContext(__DRIcontext *pcp, ** calling driBindContext. */ - if (!pcp) + if (!ctx) return GL_FALSE; - return dri_make_current(dri_context(pcp), dri_drawable(pdp), + return dri_make_current(ctx, dri_drawable(pdp), dri_drawable(prp)); } @@ -694,21 +693,21 @@ int driBindContext(__DRIcontext *pcp, * While casting the opaque private pointers associated with the parameters * into their respective real types it also assures they are not \c NULL. */ -int driUnbindContext(__DRIcontext *pcp) +int driUnbindContext(struct dri_context *ctx) { /* ** Assume error checking is done properly in glXMakeCurrent before ** calling driUnbindContext. */ - if (pcp == NULL) + if (ctx == NULL) return GL_FALSE; /* ** Call dri_unbind_context before checking for valid drawables ** to handle surfaceless contexts properly. */ - return dri_unbind_context(dri_context(pcp)); + return dri_unbind_context(ctx); } /*@}*/ diff --git a/src/gallium/frontends/dri/dri_util.h b/src/gallium/frontends/dri/dri_util.h index fae4ec50a8e..e304d620364 100644 --- a/src/gallium/frontends/dri/dri_util.h +++ b/src/gallium/frontends/dri/dri_util.h @@ -112,10 +112,10 @@ driCreateNewScreen3(int scrn, int fd, enum dri_screen_type type, const __DRIconfig ***driver_configs, bool driver_name_is_inferred, bool has_multibuffer, void *data); -PUBLIC __DRIcontext * +PUBLIC struct dri_context * driCreateContextAttribs(struct dri_screen *psp, int api, const __DRIconfig *config, - __DRIcontext *shared, + struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, unsigned *error, @@ -140,14 +140,14 @@ PUBLIC void driSwapBuffers(__DRIdrawable *pdp); PUBLIC void driSwapBuffersWithDamage(__DRIdrawable *pdp, int nrects, const int *rects); -PUBLIC __DRIcontext * -driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, __DRIcontext *shared, void *data); +PUBLIC struct dri_context * +driCreateNewContext(struct dri_screen *screen, const __DRIconfig *config, struct dri_context *shared, void *data); PUBLIC int -driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask); +driCopyContext(struct dri_context *dest, struct dri_context *src, unsigned long mask); PUBLIC void -driDestroyContext(__DRIcontext *pcp); -PUBLIC int driBindContext(__DRIcontext *pcp, __DRIdrawable *pdp, __DRIdrawable *prp); -PUBLIC int driUnbindContext(__DRIcontext *pcp); +driDestroyContext(struct dri_context *ctx); +PUBLIC int driBindContext(struct dri_context *ctx, __DRIdrawable *pdp, __DRIdrawable *prp); +PUBLIC int driUnbindContext(struct dri_context *ctx); PUBLIC int64_t @@ -168,7 +168,7 @@ PUBLIC void driswCopySubBuffer(__DRIdrawable *pdp, int x, int y, int w, int h); PUBLIC void -dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target, +dri_set_tex_buffer2(struct dri_context *ctx, GLint target, GLint format, __DRIdrawable *dPriv); PUBLIC int @@ -181,7 +181,7 @@ dri_query_renderer_integer(struct dri_screen *_screen, int param, PUBLIC void dri_flush_drawable(__DRIdrawable *dPriv); PUBLIC void -dri_flush(__DRIcontext *cPriv, +dri_flush(struct dri_context *cPriv, __DRIdrawable *dPriv, unsigned flags, enum __DRI2throttleReason reason); @@ -202,31 +202,31 @@ 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, +dri_throttle(struct dri_context *cPriv, __DRIdrawable *dPriv, enum __DRI2throttleReason reason); PUBLIC int -dri_interop_query_device_info(__DRIcontext *_ctx, - struct mesa_glinterop_device_info *out); +dri_interop_query_device_info(struct dri_context *ctx, + struct mesa_glinterop_device_info *out); PUBLIC int -dri_interop_export_object(__DRIcontext *_ctx, - struct mesa_glinterop_export_in *in, - struct mesa_glinterop_export_out *out); +dri_interop_export_object(struct dri_context *ctx, + struct mesa_glinterop_export_in *in, + struct mesa_glinterop_export_out *out); PUBLIC int -dri_interop_flush_objects(__DRIcontext *_ctx, +dri_interop_flush_objects(struct dri_context *_ctx, unsigned count, struct mesa_glinterop_export_in *objects, struct mesa_glinterop_flush_out *out); PUBLIC __DRIimage * -dri_create_image_from_renderbuffer(__DRIcontext *context, - int renderbuffer, void *loaderPrivate, - unsigned *error); +dri_create_image_from_renderbuffer(struct dri_context *dri_ctx, + int renderbuffer, void *loaderPrivate, + unsigned *error); PUBLIC void dri2_destroy_image(__DRIimage *img); PUBLIC __DRIimage * -dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture, +dri2_create_from_texture(struct dri_context *dri_ctx, int target, unsigned texture, int depth, int level, unsigned *error, void *loaderPrivate); @@ -263,18 +263,18 @@ dri2_from_dma_bufs(struct dri_screen *screen, unsigned *error, void *loaderPrivate); PUBLIC void -dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src, +dri2_blit_image(struct dri_context *ctx, __DRIimage *dst, __DRIimage *src, int dstx0, int dsty0, int dstwidth, int dstheight, int srcx0, int srcy0, int srcwidth, int srcheight, int flush_flag); PUBLIC int dri2_get_capabilities(struct dri_screen *_screen); PUBLIC void * -dri2_map_image(__DRIcontext *context, __DRIimage *image, - int x0, int y0, int width, int height, - unsigned int flags, int *stride, void **data); +dri2_map_image(struct dri_context *ctx, __DRIimage *image, + int x0, int y0, int width, int height, + unsigned int flags, int *stride, void **data); PUBLIC void -dri2_unmap_image(__DRIcontext *context, __DRIimage *image, void *data); +dri2_unmap_image(struct dri_context *ctx, __DRIimage *image, void *data); PUBLIC bool dri_query_dma_buf_formats(struct dri_screen *_screen, int max, int *formats, int *count); @@ -316,9 +316,9 @@ dri_set_damage_region(__DRIdrawable *dPriv, unsigned int nrects, int *rects); PUBLIC unsigned dri_fence_get_caps(struct dri_screen *screen); PUBLIC void * -dri_create_fence(__DRIcontext *_ctx); +dri_create_fence(struct dri_context *ctx); PUBLIC void * -dri_create_fence_fd(__DRIcontext *_ctx, int fd); +dri_create_fence_fd(struct dri_context *_ctx, int fd); PUBLIC int dri_get_fence_fd(struct dri_screen *driscreen, void *_fence); PUBLIC void * @@ -326,10 +326,10 @@ dri_get_fence_from_cl_event(struct dri_screen *driscreen, intptr_t cl_event); PUBLIC void dri_destroy_fence(struct dri_screen *driscreen, void *_fence); PUBLIC GLboolean -dri_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags, +dri_client_wait_sync(struct dri_context *_ctx, void *_fence, unsigned flags, uint64_t timeout); PUBLIC void -dri_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags); +dri_server_wait_sync(struct dri_context *ctx, void *_fence, unsigned flags); PUBLIC void dri_set_blob_cache_funcs(struct dri_screen *screen, __DRIblobCacheSet set, diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index a07624f3e06..aeb809b428d 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -548,7 +548,7 @@ kopperSwapBuffersWithDamage(__DRIdrawable *dPriv, uint32_t flush_flags, int nrec drawable->texture_stamp = drawable->lastStamp - 1; - dri_flush(opaque_dri_context(ctx), opaque_dri_drawable(drawable), + dri_flush(ctx, opaque_dri_drawable(drawable), __DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT | flush_flags, __DRI2_THROTTLE_SWAPBUFFER); diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c index cc8be105efb..d24d3fcfb8d 100644 --- a/src/gallium/frontends/dri/loader_dri3_helper.c +++ b/src/gallium/frontends/dri/loader_dri3_helper.c @@ -46,7 +46,7 @@ */ struct loader_dri3_blit_context { simple_mtx_t mtx; - __DRIcontext *ctx; + struct dri_context *ctx; struct dri_screen *cur_screen; const __DRIcoreExtension *core; }; @@ -149,7 +149,7 @@ dri3_get_red_mask_for_depth(struct loader_dri3_drawable *draw, int depth) * When the caller is done with the context (even if the context returned was * NULL), the caller must call loader_dri3_blit_context_put. */ -static __DRIcontext * +static struct dri_context * loader_dri3_blit_context_get(struct loader_dri3_drawable *draw) { simple_mtx_lock(&blit_context.mtx); @@ -199,7 +199,7 @@ loader_dri3_blit_image(struct loader_dri3_drawable *draw, int dstx0, int dsty0, int width, int height, int srcx0, int srcy0, int flush_flag) { - __DRIcontext *dri_context; + struct dri_context *dri_context; bool use_blit_context = false; dri_context = draw->vtable->get_dri_context(draw); @@ -801,7 +801,7 @@ loader_dri3_flush(struct loader_dri3_drawable *draw, enum __DRI2throttleReason throttle_reason) { /* NEED TO CHECK WHETHER CONTEXT IS NULL */ - __DRIcontext *dri_context = draw->vtable->get_dri_context(draw); + struct dri_context *dri_context = draw->vtable->get_dri_context(draw); if (dri_context) { dri_flush(dri_context, draw->dri_drawable, flags, throttle_reason); diff --git a/src/gallium/frontends/dri/loader_dri3_helper.h b/src/gallium/frontends/dri/loader_dri3_helper.h index b1b95225e38..62d71856acf 100644 --- a/src/gallium/frontends/dri/loader_dri3_helper.h +++ b/src/gallium/frontends/dri/loader_dri3_helper.h @@ -100,7 +100,7 @@ struct loader_dri3_drawable; 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 *); + struct dri_context *(*get_dri_context)(struct loader_dri3_drawable *); struct dri_screen *(*get_dri_screen)(void); void (*flush_drawable)(struct loader_dri3_drawable *, unsigned); }; diff --git a/src/gallium/include/mesa_interface.h b/src/gallium/include/mesa_interface.h index 75a15be6147..32747f9549a 100644 --- a/src/gallium/include/mesa_interface.h +++ b/src/gallium/include/mesa_interface.h @@ -33,6 +33,7 @@ #include struct dri_screen; +struct dri_context; /** * \name DRI interface structures @@ -41,7 +42,6 @@ struct dri_screen; * side library and the DRI (direct rendering infrastructure). */ /*@{*/ -typedef struct __DRIcontextRec __DRIcontext; typedef struct __DRIdrawableRec __DRIdrawable; typedef struct __DRIconfigRec __DRIconfig; @@ -110,7 +110,7 @@ struct __DRItexBufferExtensionRec { * * \since 2 */ - void (*setTexBuffer2)(__DRIcontext *pDRICtx, + void (*setTexBuffer2)(struct dri_context *pDRICtx, int target, int format, __DRIdrawable *pDraw); @@ -166,7 +166,7 @@ struct __DRI2fenceExtensionRec { /** * Create and insert a fence into the command stream of the context. */ - void *(*create_fence)(__DRIcontext *ctx); + void *(*create_fence)(struct dri_context *ctx); /** * Get a fence associated with the OpenCL event object. @@ -188,7 +188,7 @@ struct __DRI2fenceExtensionRec { * \param flags a combination of __DRI2_FENCE_FLAG_xxx flags * \param timeout the timeout in ns or __DRI2_FENCE_TIMEOUT_INFINITE */ - unsigned char (*client_wait_sync)(__DRIcontext *ctx, void *fence, + unsigned char (*client_wait_sync)(struct dri_context *ctx, void *fence, unsigned flags, uint64_t timeout); /** @@ -203,7 +203,7 @@ struct __DRI2fenceExtensionRec { * \param flags a combination of __DRI2_FENCE_FLAG_xxx flags that make * sense with this function (right now there are none) */ - void (*server_wait_sync)(__DRIcontext *ctx, void *fence, unsigned flags); + void (*server_wait_sync)(struct dri_context *ctx, void *fence, unsigned flags); /** * Query for general capabilities of the driver that concern fences. @@ -226,7 +226,7 @@ struct __DRI2fenceExtensionRec { * \param ctx the context associated with the fence * \param fd the fence fd or -1 */ - void *(*create_fence_fd)(__DRIcontext *ctx, int fd); + void *(*create_fence_fd)(struct dri_context *ctx, int fd); /** * For fences created with create_fence_fd(), after rendering is flushed, @@ -549,26 +549,26 @@ struct __DRIcoreExtensionRec { void (*swapBuffers)(__DRIdrawable *drawable); /* Used by the X server in swrast mode. */ - __DRIcontext *(*createNewContext)(struct dri_screen *screen, + struct dri_context *(*createNewContext)(struct dri_screen *screen, const __DRIconfig *config, - __DRIcontext *shared, + struct dri_context *shared, void *loaderPrivate); /* Used by the X server. */ - int (*copyContext)(__DRIcontext *dest, - __DRIcontext *src, + int (*copyContext)(struct dri_context *dest, + struct dri_context *src, unsigned long mask); /* Used by the X server. */ - void (*destroyContext)(__DRIcontext *context); + void (*destroyContext)(struct dri_context *context); /* Used by the X server. */ - int (*bindContext)(__DRIcontext *ctx, + int (*bindContext)(struct dri_context *ctx, __DRIdrawable *pdraw, __DRIdrawable *pread); /* Used by the X server. */ - int (*unbindContext)(__DRIcontext *ctx); + int (*unbindContext)(struct dri_context *ctx); void (*swapBuffersWithDamage)(__DRIdrawable *drawable, int nrects, const int *rects); }; @@ -595,11 +595,11 @@ typedef __DRIdrawable * const __DRIconfig *config, void *loaderPrivate); -typedef __DRIcontext * +typedef struct dri_context * (*__DRIcreateContextAttribsFunc)(struct dri_screen *screen, int api, const __DRIconfig *config, - __DRIcontext *shared, + struct dri_context *shared, unsigned num_attribs, const uint32_t *attribs, unsigned *error, @@ -1015,7 +1015,7 @@ struct __DRIimageExtensionRec { * * \since 6 */ - __DRIimage *(*createImageFromTexture)(__DRIcontext *context, + __DRIimage *(*createImageFromTexture)(struct dri_context *context, int target, unsigned texture, int depth, @@ -1033,7 +1033,7 @@ struct __DRIimageExtensionRec { * * \since 9 */ - void (*blitImage)(__DRIcontext *context, __DRIimage *dst, __DRIimage *src, + void (*blitImage)(struct dri_context *context, __DRIimage *dst, __DRIimage *src, int dstx0, int dsty0, int dstwidth, int dstheight, int srcx0, int srcy0, int srcwidth, int srcheight, int flush_flag); @@ -1061,7 +1061,7 @@ struct __DRIimageExtensionRec { * * \since 12 */ - void *(*mapImage)(__DRIcontext *context, __DRIimage *image, + void *(*mapImage)(struct dri_context *context, __DRIimage *image, int x0, int y0, int width, int height, unsigned int flags, int *stride, void **data); @@ -1070,7 +1070,7 @@ struct __DRIimageExtensionRec { * * \since 12 */ - void (*unmapImage)(__DRIcontext *context, __DRIimage *image, void *data); + void (*unmapImage)(struct dri_context *context, __DRIimage *image, void *data); /* * dmabuf format query to support EGL_EXT_image_dma_buf_import_modifiers. @@ -1140,7 +1140,7 @@ struct __DRIimageExtensionRec { * \param error will be set to one of __DRI_IMAGE_ERROR_xxx * \return the newly created image on success, or NULL otherwise */ - __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context, + __DRIimage *(*createImageFromRenderbuffer)(struct dri_context *context, int renderbuffer, void *loaderPrivate, unsigned *error); diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h index 714b325a5fa..8be93aa7e49 100644 --- a/src/gbm/backends/dri/gbm_driint.h +++ b/src/gbm/backends/dri/gbm_driint.h @@ -57,7 +57,7 @@ struct gbm_dri_device { bool has_compression_modifiers; struct dri_screen *screen; - __DRIcontext *context; + struct dri_context *context; mtx_t mutex; const __DRIconfig **driver_configs; diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 1d704151c10..895454f8c25 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -243,7 +243,7 @@ dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, return 1; } -static __DRIcontext * +static struct dri_context * dri2GetCurrentContext() { struct glx_context *gc = __glXGetCurrentContext(); @@ -263,7 +263,7 @@ dri2Throttle(struct dri2_screen *psc, struct dri2_drawable *draw, enum __DRI2throttleReason reason) { - __DRIcontext *ctx = dri2GetCurrentContext(); + struct dri_context *ctx = dri2GetCurrentContext(); dri_throttle(ctx, draw->base.dri_drawable, reason); } @@ -276,7 +276,7 @@ dri2Throttle(struct dri2_screen *psc, */ static void dri2Flush(struct dri2_screen *psc, - __DRIcontext *ctx, + struct dri_context *ctx, struct dri2_drawable *draw, unsigned flags, enum __DRI2throttleReason throttle_reason) @@ -302,7 +302,7 @@ __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, struct dri2_screen *psc = (struct dri2_screen *) pdraw->psc; XRectangle xrect; XserverRegion region; - __DRIcontext *ctx = dri2GetCurrentContext(); + struct dri_context *ctx = dri2GetCurrentContext(); unsigned flags; /* Check we have the right attachments */ @@ -527,7 +527,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, if (!priv->have_back) return ret; - __DRIcontext *ctx = dri2GetCurrentContext(); + struct dri_context *ctx = dri2GetCurrentContext(); unsigned flags = __DRI2_FLUSH_DRAWABLE; if (flush) flags |= __DRI2_FLUSH_CONTEXT; diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index afaf3a56e9a..ad1df2dab7c 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -111,7 +111,7 @@ glx_dri3_in_current_context(struct loader_dri3_drawable *draw) return (pcp != &dummyContext) && pcp->psc == &psc->base; } -static __DRIcontext * +static struct dri_context * glx_dri3_get_dri_context(struct loader_dri3_drawable *draw) { struct glx_context *gc = __glXGetCurrentContext(); diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index ee60e4efd38..d2838da7af6 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -829,7 +829,7 @@ dri_create_context_attribs(struct glx_screen *base, { struct glx_context *pcp = NULL; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; - __DRIcontext *shared = NULL; + struct dri_context *shared = NULL; struct dri_ctx_attribs dca; uint32_t ctx_attribs[2 * 6];