gallium: remove st_framebuffer_iface::st_manager_private
It's always equal to self. Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
This commit is contained in:
@@ -50,8 +50,7 @@ dri_st_framebuffer_validate(struct st_context *st,
|
|||||||
struct pipe_resource **out)
|
struct pipe_resource **out)
|
||||||
{
|
{
|
||||||
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
||||||
struct dri_drawable *drawable =
|
struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
|
||||||
(struct dri_drawable *) stfbi->st_manager_private;
|
|
||||||
struct dri_screen *screen = drawable->screen;
|
struct dri_screen *screen = drawable->screen;
|
||||||
unsigned statt_mask, new_mask;
|
unsigned statt_mask, new_mask;
|
||||||
bool new_stamp;
|
bool new_stamp;
|
||||||
@@ -117,8 +116,7 @@ dri_st_framebuffer_flush_front(struct st_context *st,
|
|||||||
enum st_attachment_type statt)
|
enum st_attachment_type statt)
|
||||||
{
|
{
|
||||||
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
||||||
struct dri_drawable *drawable =
|
struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
|
||||||
(struct dri_drawable *) stfbi->st_manager_private;
|
|
||||||
|
|
||||||
/* XXX remove this and just set the correct one on the framebuffer */
|
/* XXX remove this and just set the correct one on the framebuffer */
|
||||||
return drawable->flush_frontbuffer(ctx, drawable, statt);
|
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 st_framebuffer_iface *stfbi)
|
||||||
{
|
{
|
||||||
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
struct dri_context *ctx = (struct dri_context *)st->frontend_context;
|
||||||
struct dri_drawable *drawable =
|
struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
|
||||||
(struct dri_drawable *) stfbi->st_manager_private;
|
|
||||||
|
|
||||||
if (drawable->flush_swapbuffers)
|
if (drawable->flush_swapbuffers)
|
||||||
drawable->flush_swapbuffers(ctx, drawable);
|
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.flush_front = dri_st_framebuffer_flush_front;
|
||||||
drawable->base.validate = dri_st_framebuffer_validate;
|
drawable->base.validate = dri_st_framebuffer_validate;
|
||||||
drawable->base.flush_swapbuffers = dri_st_framebuffer_flush_swapbuffers;
|
drawable->base.flush_swapbuffers = dri_st_framebuffer_flush_swapbuffers;
|
||||||
drawable->base.st_manager_private = (void *) drawable;
|
|
||||||
|
|
||||||
drawable->screen = screen;
|
drawable->screen = screen;
|
||||||
|
|
||||||
|
@@ -822,7 +822,6 @@ kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual
|
|||||||
|
|
||||||
// relocate references to the old struct
|
// relocate references to the old struct
|
||||||
drawable->base.visual = &drawable->stvis;
|
drawable->base.visual = &drawable->stvis;
|
||||||
drawable->base.st_manager_private = (void *) drawable;
|
|
||||||
|
|
||||||
// and fill in the vtable
|
// and fill in the vtable
|
||||||
drawable->allocate_textures = kopper_allocate_textures;
|
drawable->allocate_textures = kopper_allocate_textures;
|
||||||
|
@@ -54,7 +54,7 @@ struct xmesa_st_framebuffer {
|
|||||||
static inline struct xmesa_st_framebuffer *
|
static inline struct xmesa_st_framebuffer *
|
||||||
xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi)
|
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.ID = p_atomic_inc_return(&xmesa_stfbi_ID);
|
||||||
xstfb->base.fscreen = xmdpy->fscreen;
|
xstfb->base.fscreen = xmdpy->fscreen;
|
||||||
p_atomic_set(&xstfb->base.stamp, 1);
|
p_atomic_set(&xstfb->base.stamp, 1);
|
||||||
xstfb->base.st_manager_private = (void *) xstfb;
|
|
||||||
|
|
||||||
return &xstfb->base;
|
return &xstfb->base;
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
|
|||||||
{
|
{
|
||||||
struct hgl_buffer* buffer;
|
struct hgl_buffer* buffer;
|
||||||
assert(stfbi);
|
assert(stfbi);
|
||||||
buffer = (struct hgl_buffer*)stfbi->st_manager_private;
|
buffer = (struct hgl_buffer*)stfbi;
|
||||||
assert(buffer);
|
assert(buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,6 @@ hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext)
|
|||||||
buffer->stfbi->visual = context->stVisual;
|
buffer->stfbi->visual = context->stVisual;
|
||||||
|
|
||||||
p_atomic_set(&buffer->stfbi->stamp, 1);
|
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->ID = p_atomic_inc_return(&hgl_fb_ID);
|
||||||
buffer->stfbi->fscreen = context->display->fscreen;
|
buffer->stfbi->fscreen = context->display->fscreen;
|
||||||
|
|
||||||
|
@@ -332,7 +332,7 @@ osmesa_init_st_visual(struct st_visual *vis,
|
|||||||
static inline struct osmesa_buffer *
|
static inline struct osmesa_buffer *
|
||||||
stfbi_to_osbuffer(struct st_framebuffer_iface *stfbi)
|
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);
|
struct osmesa_buffer *osbuffer = CALLOC_STRUCT(osmesa_buffer);
|
||||||
if (osbuffer) {
|
if (osbuffer) {
|
||||||
osbuffer->stfb = osmesa_create_st_framebuffer();
|
osbuffer->stfb = osmesa_create_st_framebuffer();
|
||||||
|
|
||||||
osbuffer->stfb->st_manager_private = osbuffer;
|
|
||||||
osbuffer->stfb->visual = &osbuffer->visual;
|
osbuffer->stfb->visual = &osbuffer->visual;
|
||||||
|
|
||||||
osmesa_init_st_visual(&osbuffer->visual, color_format,
|
osmesa_init_st_visual(&osbuffer->visual, color_format,
|
||||||
|
@@ -245,11 +245,6 @@ struct st_framebuffer_iface
|
|||||||
*/
|
*/
|
||||||
struct pipe_frontend_screen *fscreen;
|
struct pipe_frontend_screen *fscreen;
|
||||||
|
|
||||||
/**
|
|
||||||
* Available for the frontend manager to use.
|
|
||||||
*/
|
|
||||||
void *st_manager_private;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The visual of a framebuffer.
|
* The visual of a framebuffer.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user