#include "intel_batchbuffer.h"
#include "intel_reg.h"
+struct intel_gl_sync_object {
+ struct gl_sync_object Base;
+
+ /** Batch associated with this sync object */
+ drm_intel_bo *bo;
+};
+
static struct gl_sync_object *
-intel_new_sync_object(struct gl_context *ctx, GLuint id)
+intel_gl_new_sync_object(struct gl_context *ctx, GLuint id)
{
- struct intel_sync_object *sync;
+ struct intel_gl_sync_object *sync;
- sync = calloc(1, sizeof(struct intel_sync_object));
+ sync = calloc(1, sizeof(*sync));
if (!sync)
return NULL;
}
static void
-intel_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *s)
+intel_gl_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *s)
{
- struct intel_sync_object *sync = (struct intel_sync_object *)s;
+ struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s;
if (sync->bo)
drm_intel_bo_unreference(sync->bo);
}
static void
-intel_fence_sync(struct gl_context *ctx, struct gl_sync_object *s,
+intel_gl_fence_sync(struct gl_context *ctx, struct gl_sync_object *s,
GLenum condition, GLbitfield flags)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_sync_object *sync = (struct intel_sync_object *)s;
+ struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s;
assert(condition == GL_SYNC_GPU_COMMANDS_COMPLETE);
intel_batchbuffer_emit_mi_flush(intel);
intel_flush(ctx);
}
-static void intel_client_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+static void
+intel_gl_client_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
GLbitfield flags, GLuint64 timeout)
{
- struct intel_sync_object *sync = (struct intel_sync_object *)s;
+ struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s;
if (sync->bo && drm_intel_gem_bo_wait(sync->bo, timeout) == 0) {
s->StatusFlag = 1;
* any batchbuffers coming after this waitsync will naturally not occur until
* the previous one is done.
*/
-static void intel_server_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+static void
+intel_gl_server_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
GLbitfield flags, GLuint64 timeout)
{
}
-static void intel_check_sync(struct gl_context *ctx, struct gl_sync_object *s)
+static void
+intel_gl_check_sync(struct gl_context *ctx, struct gl_sync_object *s)
{
- struct intel_sync_object *sync = (struct intel_sync_object *)s;
+ struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s;
if (sync->bo && !drm_intel_bo_busy(sync->bo)) {
drm_intel_bo_unreference(sync->bo);
}
}
-void intel_init_syncobj_functions(struct dd_function_table *functions)
+void
+intel_init_syncobj_functions(struct dd_function_table *functions)
{
- functions->NewSyncObject = intel_new_sync_object;
- functions->DeleteSyncObject = intel_delete_sync_object;
- functions->FenceSync = intel_fence_sync;
- functions->CheckSync = intel_check_sync;
- functions->ClientWaitSync = intel_client_wait_sync;
- functions->ServerWaitSync = intel_server_wait_sync;
+ functions->NewSyncObject = intel_gl_new_sync_object;
+ functions->DeleteSyncObject = intel_gl_delete_sync_object;
+ functions->FenceSync = intel_gl_fence_sync;
+ functions->CheckSync = intel_gl_check_sync;
+ functions->ClientWaitSync = intel_gl_client_wait_sync;
+ functions->ServerWaitSync = intel_gl_server_wait_sync;
}