summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-29 14:21:31 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-07-29 14:21:31 +0200
commit970daea4d440da41ce49936061a56b312d995525 (patch)
tree529d9619777f694af6a23d75103ea5be843b4df7
parent7d6982c2b69eda3ed31fd95335f14f2d6c9b6119 (diff)
Add Image_Export vfunc drm_state
-rw-r--r--i965_drv_video/i965_drv_video.c20
-rw-r--r--va/va_drmcommon.h5
2 files changed, 25 insertions, 0 deletions
diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c
index 38d078a..6bad312 100644
--- a/i965_drv_video/i965_drv_video.c
+++ b/i965_drv_video/i965_drv_video.c
@@ -2522,6 +2522,23 @@ i965_UnlockSurface(
return vaStatus;
}
+VAStatus
+i965_Image_Export( VADriverContextP ctx, VAImageID image,
+ unsigned int *name, unsigned int *pitch)
+{
+ struct i965_driver_data *i965 = i965_driver_data(ctx);
+ struct object_image *obj_image = IMAGE(image);
+
+ if (!obj_image)
+ return VA_STATUS_ERROR_INVALID_IMAGE;
+
+ dri_bo_flink(obj_image->bo, name);
+ *pitch = obj_image->image.width;
+ *pitch = /* 4 * */ obj_image->image.pitches[0];
+
+ return VA_STATUS_SUCCESS;
+}
+
VAStatus
VA_DRIVER_INIT_FUNC( VADriverContextP ctx )
{
@@ -2618,6 +2635,9 @@ VA_DRIVER_INIT_FUNC( VADriverContextP ctx )
sizeof(struct object_subpic),
SUBPIC_ID_OFFSET);
assert(result == 0);
+
+ struct drm_state *drm_state = (struct drm_state *)ctx->drm_state;
+ drm_state->image_export = i965_Image_Export;
return i965_Init(ctx);
}
diff --git a/va/va_drmcommon.h b/va/va_drmcommon.h
index f43b6b0..136735d 100644
--- a/va/va_drmcommon.h
+++ b/va/va_drmcommon.h
@@ -53,6 +53,11 @@ struct drm_state
void (*swapBuffer)(VADriverContextP ctx, struct drm_drawable *drm_drawable);
union drm_buffer *(*getRenderingBuffer)(VADriverContextP ctx, struct drm_drawable *drm_drawable);
#endif
+
+ /* To be implemented by the driver */
+ VAStatus (*image_export)(VADriverContextP ctx, VAImageID image,
+ unsigned int *name, unsigned int *pitch);
+
};
#endif /* _VA_DRMCOMMON_H_ */