Skip to content

Commit

Permalink
update to current atomic RFC
Browse files Browse the repository at this point in the history
remove cursor and atomic event..
  • Loading branch information
robclark committed Oct 14, 2013
1 parent 3590b62 commit 97c21d4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 159 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
plane
*~
*.o
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
CFLAGS+=-O0 -g3 $(shell pkg-config --cflags libdrm gbm gl egl)
CPPFLAGS+=-Wall -Wextra
CPPFLAGS+=-Wall
LDFLAGS+=
LDLIBS+=$(shell pkg-config --libs libdrm gbm gl egl) -lm

Expand Down
1 change: 0 additions & 1 deletion common.h
Expand Up @@ -32,7 +32,6 @@

struct my_surface {
struct surface base;
int pending_events;
EGLSurface egl_surface;
GLuint fbo[2];
GLuint tex[2];
Expand Down
12 changes: 6 additions & 6 deletions gutils.c
Expand Up @@ -38,23 +38,23 @@ bool surface_has_free_buffers(struct surface *s)
return gbm_surface_has_free_buffers(s->gbm_surface);
}

struct buffer *surface_find_buffer_by_fb_id(struct surface *s, uint32_t fb_id)
void surface_retire_buffers(struct surface *s, int fence)
{
int i;

for (i = 0; i < ARRAY_SIZE(s->buffers); i++) {
if (s->buffers[i].fb_id == fb_id) {
assert(s->buffers[i].ref >= 0);
return &s->buffers[i];
struct buffer *b = &s->buffers[i];
if (b->bo && b->fence && (b->fence < fence)) {
surface_buffer_put_fb(s, b);
}
}

return NULL;
}

void surface_buffer_put_fb(struct surface *s, struct buffer *b)
{
b->ref--;
b->fence = 0;
gbm_surface_release_buffer(s->gbm_surface, b->bo);
}

Expand Down Expand Up @@ -86,7 +86,7 @@ struct buffer *surface_get_front(int fd, struct surface *s)
}

for (i = 0; i < ARRAY_SIZE(s->buffers); i++) {
if (s->buffers[i].ref == 0) {
if (!s->buffers[i].bo) {
b = &s->buffers[i];
break;
}
Expand Down
3 changes: 2 additions & 1 deletion gutils.h
Expand Up @@ -29,6 +29,7 @@

struct buffer {
int fd;
int fence;
unsigned int size;
uint32_t offset[4];
uint32_t stride[4];
Expand Down Expand Up @@ -59,7 +60,7 @@ struct gbm_bo;

bool surface_has_free_buffers(struct surface *s);

struct buffer *surface_find_buffer_by_fb_id(struct surface *s, uint32_t fb_id);
void surface_retire_buffers(struct surface *s, int fence);

void surface_buffer_put_fb(struct surface *s, struct buffer *b);

Expand Down

0 comments on commit 97c21d4

Please sign in to comment.