From e7a1cce4eec741f8d766cb2af15491d5c99c2509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 27 Nov 2022 16:04:52 -0500 Subject: [PATCH] gallium: remove st_framebuffer_iface::st_manager_private It's always equal to self. Reviewed-by: Emma Anholt Reviewed-by: Adam Jackson Reviewed-by: Yonggang Luo Part-of: --- src/gallium/frontends/dri/dri_drawable.c | 10 +++------- src/gallium/frontends/dri/kopper.c | 1 - src/gallium/frontends/glx/xlib/xm_st.c | 3 +-- src/gallium/frontends/hgl/hgl.c | 3 +-- src/gallium/frontends/osmesa/osmesa.c | 4 +--- src/gallium/include/frontend/api.h | 5 ----- 6 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/gallium/frontends/dri/dri_drawable.c b/src/gallium/frontends/dri/dri_drawable.c index b810d463f79..c036b70c8b7 100644 --- a/src/gallium/frontends/dri/dri_drawable.c +++ b/src/gallium/frontends/dri/dri_drawable.c @@ -50,8 +50,7 @@ dri_st_framebuffer_validate(struct st_context *st, struct pipe_resource **out) { struct dri_context *ctx = (struct dri_context *)st->frontend_context; - struct dri_drawable *drawable = - (struct dri_drawable *) stfbi->st_manager_private; + struct dri_drawable *drawable = (struct dri_drawable *)stfbi; struct dri_screen *screen = drawable->screen; unsigned statt_mask, new_mask; bool new_stamp; @@ -117,8 +116,7 @@ dri_st_framebuffer_flush_front(struct st_context *st, enum st_attachment_type statt) { struct dri_context *ctx = (struct dri_context *)st->frontend_context; - struct dri_drawable *drawable = - (struct dri_drawable *) stfbi->st_manager_private; + struct dri_drawable *drawable = (struct dri_drawable *)stfbi; /* XXX remove this and just set the correct one on the framebuffer */ return drawable->flush_frontbuffer(ctx, drawable, statt); @@ -132,8 +130,7 @@ dri_st_framebuffer_flush_swapbuffers(struct st_context *st, struct st_framebuffer_iface *stfbi) { struct dri_context *ctx = (struct dri_context *)st->frontend_context; - struct dri_drawable *drawable = - (struct dri_drawable *) stfbi->st_manager_private; + struct dri_drawable *drawable = (struct dri_drawable *)stfbi; if (drawable->flush_swapbuffers) drawable->flush_swapbuffers(ctx, drawable); @@ -170,7 +167,6 @@ dri_create_drawable(struct dri_screen *screen, const struct gl_config *visual, drawable->base.flush_front = dri_st_framebuffer_flush_front; drawable->base.validate = dri_st_framebuffer_validate; drawable->base.flush_swapbuffers = dri_st_framebuffer_flush_swapbuffers; - drawable->base.st_manager_private = (void *) drawable; drawable->screen = screen; diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 3e56181b245..8453585b847 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -822,7 +822,6 @@ kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual // relocate references to the old struct drawable->base.visual = &drawable->stvis; - drawable->base.st_manager_private = (void *) drawable; // and fill in the vtable drawable->allocate_textures = kopper_allocate_textures; diff --git a/src/gallium/frontends/glx/xlib/xm_st.c b/src/gallium/frontends/glx/xlib/xm_st.c index bff1479c4b3..6f049a75394 100644 --- a/src/gallium/frontends/glx/xlib/xm_st.c +++ b/src/gallium/frontends/glx/xlib/xm_st.c @@ -54,7 +54,7 @@ struct xmesa_st_framebuffer { static inline struct xmesa_st_framebuffer * xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi) { - return (struct xmesa_st_framebuffer *) stfbi->st_manager_private; + return (struct xmesa_st_framebuffer *)stfbi; } @@ -313,7 +313,6 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b) xstfb->base.ID = p_atomic_inc_return(&xmesa_stfbi_ID); xstfb->base.fscreen = xmdpy->fscreen; p_atomic_set(&xstfb->base.stamp, 1); - xstfb->base.st_manager_private = (void *) xstfb; return &xstfb->base; } diff --git a/src/gallium/frontends/hgl/hgl.c b/src/gallium/frontends/hgl/hgl.c index 90ce7686f30..e8ae1c712eb 100644 --- a/src/gallium/frontends/hgl/hgl.c +++ b/src/gallium/frontends/hgl/hgl.c @@ -49,7 +49,7 @@ hgl_st_framebuffer(struct st_framebuffer_iface *stfbi) { struct hgl_buffer* buffer; assert(stfbi); - buffer = (struct hgl_buffer*)stfbi->st_manager_private; + buffer = (struct hgl_buffer*)stfbi; assert(buffer); return buffer; } @@ -250,7 +250,6 @@ hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext) buffer->stfbi->visual = context->stVisual; p_atomic_set(&buffer->stfbi->stamp, 1); - buffer->stfbi->st_manager_private = (void*)buffer; buffer->stfbi->ID = p_atomic_inc_return(&hgl_fb_ID); buffer->stfbi->fscreen = context->display->fscreen; diff --git a/src/gallium/frontends/osmesa/osmesa.c b/src/gallium/frontends/osmesa/osmesa.c index 3db12c8b7ad..ae67e24b3b7 100644 --- a/src/gallium/frontends/osmesa/osmesa.c +++ b/src/gallium/frontends/osmesa/osmesa.c @@ -332,7 +332,7 @@ osmesa_init_st_visual(struct st_visual *vis, static inline struct osmesa_buffer * stfbi_to_osbuffer(struct st_framebuffer_iface *stfbi) { - return (struct osmesa_buffer *) stfbi->st_manager_private; + return (struct osmesa_buffer *)stfbi; } @@ -487,8 +487,6 @@ osmesa_create_buffer(enum pipe_format color_format, struct osmesa_buffer *osbuffer = CALLOC_STRUCT(osmesa_buffer); if (osbuffer) { osbuffer->stfb = osmesa_create_st_framebuffer(); - - osbuffer->stfb->st_manager_private = osbuffer; osbuffer->stfb->visual = &osbuffer->visual; osmesa_init_st_visual(&osbuffer->visual, color_format, diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 07104e1f3e1..3eddc77fc01 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -245,11 +245,6 @@ struct st_framebuffer_iface */ struct pipe_frontend_screen *fscreen; - /** - * Available for the frontend manager to use. - */ - void *st_manager_private; - /** * The visual of a framebuffer. */