summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl_g3d/kms/native_kms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl_g3d/kms/native_kms.c')
-rw-r--r--src/gallium/state_trackers/egl_g3d/kms/native_kms.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/egl_g3d/kms/native_kms.c b/src/gallium/state_trackers/egl_g3d/kms/native_kms.c
index 0e0babdb14..a44b9b9ae5 100644
--- a/src/gallium/state_trackers/egl_g3d/kms/native_kms.c
+++ b/src/gallium/state_trackers/egl_g3d/kms/native_kms.c
@@ -36,7 +36,7 @@ static boolean
kms_surface_validate(struct native_surface *nsurf,
const enum native_attachment *natts,
unsigned num_natts,
- struct pipe_texture **textures,
+ unsigned int *seq_num, struct pipe_texture **textures,
int *width, int *height)
{
struct kms_surface *ksurf = kms_surface(nsurf);
@@ -75,6 +75,8 @@ kms_surface_validate(struct native_surface *nsurf,
pipe_texture_reference(&textures[i], ptex);
}
+ if (seq_num)
+ *seq_num = ksurf->sequence_number;
if (width)
*width = ksurf->width;
if (height)
@@ -111,7 +113,7 @@ kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
if (!fb->texture) {
/* make sure the texture has been allocated */
- kms_surface_validate(&ksurf->base, &natt, 1, NULL, NULL, NULL);
+ kms_surface_validate(&ksurf->base, &natt, 1, NULL, NULL, NULL, NULL);
if (!ksurf->textures[natt])
return FALSE;
@@ -196,6 +198,9 @@ kms_surface_swap_buffers(struct native_surface *nsurf)
ksurf->textures[NATIVE_ATTACHMENT_BACK_LEFT];
ksurf->textures[NATIVE_ATTACHMENT_BACK_LEFT] = tmp_texture;
+ /* the front/back textures are swapped */
+ ksurf->sequence_number++;
+
return TRUE;
}