mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 00:10:33 +01:00
frontend/dri: unduplicate flush_drawable callback
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
This commit is contained in:
parent
eaf99194ea
commit
51fcabfb04
4 changed files with 17 additions and 21 deletions
|
|
@ -67,18 +67,6 @@ dri2_buffer(__DRIbuffer * driBufferPriv)
|
|||
return (struct dri2_buffer *) driBufferPriv;
|
||||
}
|
||||
|
||||
/**
|
||||
* DRI2 flush extension.
|
||||
*/
|
||||
static void
|
||||
dri2_flush_drawable(__DRIdrawable *dPriv)
|
||||
{
|
||||
struct dri_context *ctx = dri_get_current();
|
||||
|
||||
if (ctx)
|
||||
dri_flush(opaque_dri_context(ctx), dPriv, __DRI2_FLUSH_DRAWABLE, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate the drawable.
|
||||
*
|
||||
|
|
@ -115,7 +103,7 @@ dri2_invalidate_drawable(__DRIdrawable *dPriv)
|
|||
static const __DRI2flushExtension dri2FlushExtension = {
|
||||
.base = { __DRI2_FLUSH, 4 },
|
||||
|
||||
.flush = dri2_flush_drawable,
|
||||
.flush = dri_flush_drawable,
|
||||
.invalidate = dri2_invalidate_drawable,
|
||||
.flush_with_flags = dri_flush,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -569,6 +569,18 @@ dri_flush(__DRIcontext *cPriv,
|
|||
st->invalidate_state(st, ST_INVALIDATE_FB_STATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* DRI2 flush extension.
|
||||
*/
|
||||
void
|
||||
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_throttle - A DRI2ThrottleExtension throttling function.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -158,6 +158,9 @@ dri_flush(__DRIcontext *cPriv,
|
|||
unsigned flags,
|
||||
enum __DRI2throttleReason reason);
|
||||
|
||||
void
|
||||
dri_flush_drawable(__DRIdrawable *dPriv);
|
||||
|
||||
extern const __DRItexBufferExtension driTexBufferExtension;
|
||||
extern const __DRI2throttleExtension dri2ThrottleExtension;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -59,13 +59,6 @@ static struct dri_drawable *
|
|||
kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
|
||||
boolean isPixmap, void *loaderPrivate);
|
||||
|
||||
static void
|
||||
kopper_flush_drawable(__DRIdrawable *dPriv)
|
||||
{
|
||||
dri_flush(opaque_dri_context(dri_get_current()), dPriv,
|
||||
__DRI2_FLUSH_DRAWABLE, -1);
|
||||
}
|
||||
|
||||
static inline void
|
||||
kopper_invalidate_drawable(__DRIdrawable *dPriv)
|
||||
{
|
||||
|
|
@ -79,7 +72,7 @@ kopper_invalidate_drawable(__DRIdrawable *dPriv)
|
|||
static const __DRI2flushExtension driVkFlushExtension = {
|
||||
.base = { __DRI2_FLUSH, 4 },
|
||||
|
||||
.flush = kopper_flush_drawable,
|
||||
.flush = dri_flush_drawable,
|
||||
.invalidate = kopper_invalidate_drawable,
|
||||
.flush_with_flags = dri_flush,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue