diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-04-06 13:19:46 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-07-16 13:08:52 +0200 |
commit | b3618bd07f55f8cc0a5b3831ab0fcac2b60de153 (patch) | |
tree | c35efcd450f8a497e09faa0c9bcd0ffb39e4115a | |
parent | 4a7b7a16225c255f24fa72c881b8a29a53982718 (diff) |
API: backend: rename VADriverContext.dri_state to drm_state.
VADriverContext.drm_state holds data structures derived from struct
drm_state, thus also including struct dri_state for VA/X11 drivers.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r-- | va/android/va_android.cpp | 10 | ||||
-rw-r--r-- | va/va_backend.h | 17 | ||||
-rw-r--r-- | va/x11/dri1_util.c | 4 | ||||
-rw-r--r-- | va/x11/dri2_util.c | 4 | ||||
-rw-r--r-- | va/x11/va_dricommon.c | 10 | ||||
-rw-r--r-- | va/x11/va_x11.c | 6 |
6 files changed, 32 insertions, 19 deletions
diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp index 92f1e60..b811afc 100644 --- a/va/android/va_android.cpp +++ b/va/android/va_android.cpp @@ -95,10 +95,10 @@ static void va_DisplayContextDestroy ( return; /* close the open-ed DRM fd */ - dri_state = (struct dri_state *)pDisplayContext->pDriverContext->dri_state; + dri_state = (struct dri_state *)pDisplayContext->pDriverContext->drm_state; close(dri_state->base.fd); - free(pDisplayContext->pDriverContext->dri_state); + free(pDisplayContext->pDriverContext->drm_state); free(pDisplayContext->pDriverContext); free(pDisplayContext); } @@ -110,7 +110,7 @@ static VAStatus va_DisplayContextGetDriverName ( ) { VADriverContextP ctx = pDisplayContext->pDriverContext; - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; char *driver_name_env; int vendor_id, device_id; @@ -149,7 +149,7 @@ static VAStatus va_DisplayContextGetDriverName ( ) { VADriverContextP ctx = pDisplayContext->pDriverContext; - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; char *driver_name_env; int vendor_id, device_id; int i = 0; @@ -227,7 +227,7 @@ VADisplay vaGetDisplay ( pDisplayContext->vaIsValid = va_DisplayContextIsValid; pDisplayContext->vaDestroy = va_DisplayContextDestroy; pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName; - pDriverContext->dri_state = dri_state; + pDriverContext->drm_state = dri_state; dpy = (VADisplay)pDisplayContext; } else diff --git a/va/va_backend.h b/va/va_backend.h index c92be53..1e04a9c 100644 --- a/va/va_backend.h +++ b/va/va_backend.h @@ -450,8 +450,21 @@ struct VADriverContext const char *str_vendor; void *handle; /* dlopen handle */ - - void *dri_state; + + /** + * \brief DRM state. + * + * This field holds driver specific data for DRM-based + * drivers. This structure is allocated from libva with + * calloc(). Do not deallocate from within VA driver + * implementations. + * + * All structures shall be derived from struct drm_state. So, for + * instance, this field holds a dri_state structure for VA/X11 + * drivers that use the DRM protocol. + */ + void *drm_state; + void *glx; /* opaque for GLX code */ /** diff --git a/va/x11/dri1_util.c b/va/x11/dri1_util.c index 0b87e24..d3da81b 100644 --- a/va/x11/dri1_util.c +++ b/va/x11/dri1_util.c @@ -59,7 +59,7 @@ dri1GetRenderingBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) static void dri1Close(VADriverContextP ctx) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; free_drawable_hashtable(ctx); VA_DRIDestroyContext(ctx->native_dpy, ctx->x11_screen, dri_state->hwContextID); @@ -73,7 +73,7 @@ dri1Close(VADriverContextP ctx) Bool isDRI1Connected(VADriverContextP ctx, char **driver_name) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int direct_capable; int driver_major; int driver_minor; diff --git a/va/x11/dri2_util.c b/va/x11/dri2_util.c index 47f663a..0a2ac45 100644 --- a/va/x11/dri2_util.c +++ b/va/x11/dri2_util.c @@ -164,7 +164,7 @@ dri2GetRenderingBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) void dri2Close(VADriverContextP ctx) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; free_drawable_hashtable(ctx); @@ -175,7 +175,7 @@ dri2Close(VADriverContextP ctx) Bool isDRI2Connected(VADriverContextP ctx, char **driver_name) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int major, minor; int error_base; int event_base; diff --git a/va/x11/va_dricommon.c b/va/x11/va_dricommon.c index 6816b0f..c0cbbcc 100644 --- a/va/x11/va_dricommon.c +++ b/va/x11/va_dricommon.c @@ -61,7 +61,7 @@ is_window(Display *dpy, Drawable drawable) static struct dri_drawable * do_drawable_hash(VADriverContextP ctx, XID drawable) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int index = drawable % DRAWABLE_HASH_SZ; struct dri_drawable *dri_drawable = dri_state->drawable_hash[index]; @@ -83,7 +83,7 @@ do_drawable_hash(VADriverContextP ctx, XID drawable) void free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int i = 0; while (i++ < DRAWABLE_HASH_SZ) { @@ -97,7 +97,7 @@ free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable) void free_drawable_hashtable(VADriverContextP ctx) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; int i; struct dri_drawable *dri_drawable, *prev; @@ -123,7 +123,7 @@ dri_get_drawable(VADriverContextP ctx, XID drawable) void dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; dri_state->swapBuffer(ctx, dri_drawable); } @@ -131,7 +131,7 @@ dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) union dri_buffer * dri_get_rendering_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) { - struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; + struct dri_state *dri_state = (struct dri_state *)ctx->drm_state; return dri_state->getRenderingBuffer(ctx, dri_drawable); } diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index 86b040a..f81e30a 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -63,12 +63,12 @@ static void va_DisplayContextDestroy ( return; ctx = pDisplayContext->pDriverContext; - dri_state = ctx->dri_state; + dri_state = ctx->drm_state; if (dri_state && dri_state->close) dri_state->close(ctx); - free(pDisplayContext->pDriverContext->dri_state); + free(pDisplayContext->pDriverContext->drm_state); free(pDisplayContext->pDriverContext); free(pDisplayContext); } @@ -190,7 +190,7 @@ VADisplay vaGetDisplay ( pDisplayContext->vaDestroy = va_DisplayContextDestroy; pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName; pDisplayContext->opaque = NULL; - pDriverContext->dri_state = dri_state; + pDriverContext->drm_state = dri_state; dpy = (VADisplay)pDisplayContext; } else |