VASurfaceID *surfaces) /* out */
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- int i;
+ int i,j;
VAStatus vaStatus = VA_STATUS_SUCCESS;
/* We only support one format */
surfaces[i] = surfaceID;
obj_surface->status = VASurfaceReady;
- obj_surface->subpic = VA_INVALID_ID;
obj_surface->orig_width = width;
obj_surface->orig_height = height;
obj_surface->height = ALIGN(height, 32);
}
+ obj_surface->subpic_render_idx = 0;
+ for(j = 0; j < I965_MAX_SUBPIC_SUM; j++){
+ obj_surface->subpic[j] = VA_INVALID_ID;
+ }
+
obj_surface->flags = SURFACE_REFERENCED;
obj_surface->fourcc = 0;
obj_surface->bo = NULL;
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_subpic *obj_subpic = SUBPIC(subpicture);
- int i;
+ int i, j;
obj_subpic->src_rect.x = src_x;
obj_subpic->src_rect.y = src_y;
struct object_surface *obj_surface = SURFACE(target_surfaces[i]);
if (!obj_surface)
return VA_STATUS_ERROR_INVALID_SURFACE;
- obj_surface->subpic = subpicture;
+
+ for(j = 0; j < I965_MAX_SUBPIC_SUM; j ++){
+ if(obj_surface->subpic[j] == VA_INVALID_ID){
+ obj_surface->subpic[j] = subpicture;
+ break;
+ }
+ }
+
+ if(j == I965_MAX_SUBPIC_SUM){
+ return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
+ }
+
}
return VA_STATUS_SUCCESS;
}
int num_surfaces)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- int i;
+ int i, j;
for (i = 0; i < num_surfaces; i++) {
struct object_surface *obj_surface = SURFACE(target_surfaces[i]);
if (!obj_surface)
return VA_STATUS_ERROR_INVALID_SURFACE;
- if (obj_surface->subpic == subpicture)
- obj_surface->subpic = VA_INVALID_ID;
+
+ for(j = 0; j < I965_MAX_SUBPIC_SUM; j ++){
+ if(obj_surface->subpic[j] == subpicture){
+ obj_surface->subpic[j] = VA_INVALID_ID;
+ break;
+ }
+ }
+
+ if(j == I965_MAX_SUBPIC_SUM){
+ return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
+ }
}
return VA_STATUS_SUCCESS;
}
#define I965_MAX_CONFIG_ATTRIBUTES 10
#define I965_MAX_IMAGE_FORMATS 3
#define I965_MAX_SUBPIC_FORMATS 6
+#define I965_MAX_SUBPIC_SUM 4
#define INTEL_STR_DRIVER_VENDOR "Intel"
#define INTEL_STR_DRIVER_NAME "i965"
{
struct object_base base;
VASurfaceStatus status;
- VASubpictureID subpic;
+ VASubpictureID subpic[I965_MAX_SUBPIC_SUM];
+ unsigned int subpic_render_idx;
+
int width;
int height;
int size;
unsigned int pp_flag = 0;
bool new_region = false;
uint32_t name;
- int ret;
+ int i, ret;
/* Currently don't support DRI1 */
if (!VA_CHECK_DRM_AUTH_TYPE(ctx, VA_DRM_AUTH_DRI2))
intel_render_put_surface(ctx, surface, src_rect, dst_rect, pp_flag);
- if(obj_surface->subpic != VA_INVALID_ID) {
- intel_render_put_subpicture(ctx, surface, src_rect, dst_rect);
+ for(i = 0; i < I965_MAX_SUBPIC_SUM; i++){
+ if(obj_surface->subpic[i] != VA_INVALID_ID) {
+ obj_surface->subpic_render_idx = i;
+ intel_render_put_subpicture(ctx, surface, src_rect, dst_rect);
+ }
}
dri_vtable->swap_buffer(ctx, dri_drawable);
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_surface *obj_surface = SURFACE(surface);
dri_bo *subpic_region;
- struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
+ unsigned int index = obj_surface->subpic_render_idx;
+ struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic[index]);
struct object_image *obj_image = IMAGE(obj_subpic->image);
assert(obj_surface);
assert(obj_surface->bo);
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_surface *obj_surface = SURFACE(surface);
- struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
+ unsigned int index = obj_surface->subpic_render_idx;
+ struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic[index]);
float tex_coords[4], vid_coords[4];
VARectangle dst_rect;
float *constant_buffer;
float global_alpha = 1.0;
struct object_surface *obj_surface = SURFACE(surface);
+ unsigned int index = obj_surface->subpic_render_idx;
- if(obj_surface->subpic != VA_INVALID_ID){
- struct object_subpic *obj_subpic= SUBPIC(obj_surface->subpic);
+ if(obj_surface->subpic[index] != VA_INVALID_ID){
+ struct object_subpic *obj_subpic= SUBPIC(obj_surface->subpic[index]);
if(obj_subpic->flags & VA_SUBPICTURE_GLOBAL_ALPHA){
global_alpha = obj_subpic->global_alpha;
}
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch = i965->batch;
struct object_surface *obj_surface = SURFACE(surface);
- struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
+ unsigned int index = obj_surface->subpic_render_idx;
+ struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic[index]);
assert(obj_subpic);
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch = i965->batch;
struct object_surface *obj_surface = SURFACE(surface);
- struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
+ unsigned int index = obj_surface->subpic_render_idx;
+ struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic[index]);
assert(obj_subpic);
gen6_render_initialize(ctx);
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch = i965->batch;
struct object_surface *obj_surface = SURFACE(surface);
- struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
+ unsigned int index = obj_surface->subpic_render_idx;
+ struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic[index]);
assert(obj_subpic);
gen7_render_initialize(ctx);