static struct gbm_bo *
lock_front_buffer(struct gbm_surface *_surf)
{
- struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf;
+ struct gbm_dri_surface *surf = gbm_dri_surface(_surf);
struct dri2_egl_surface *dri2_surf = surf->dri_private;
struct gbm_dri_device *device = gbm_dri_device(_surf->gbm);
struct gbm_bo *bo;
static void
release_buffer(struct gbm_surface *_surf, struct gbm_bo *bo)
{
- struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf;
+ struct gbm_dri_surface *surf = gbm_dri_surface(_surf);
struct dri2_egl_surface *dri2_surf = surf->dri_private;
for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
static int
has_free_buffers(struct gbm_surface *_surf)
{
- struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf;
+ struct gbm_dri_surface *surf = gbm_dri_surface(_surf);
struct dri2_egl_surface *dri2_surf = surf->dri_private;
for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)