Home | History | Annotate | Download | only in src

Lines Matching refs:obj_context

1054     object_context_p obj_context = CONTEXT(contextID);
1055 CHECK_ALLOCATION(obj_context);
1059 MEMSET_OBJECT(obj_context, struct object_context_s);
1061 obj_context->driver_data = driver_data;
1062 obj_context->current_render_target = NULL;
1063 obj_context->ec_target = NULL;
1064 obj_context->ec_candidate = NULL;
1065 obj_context->is_oold = driver_data->is_oold;
1066 obj_context->context_id = contextID;
1067 obj_context->config_id = config_id;
1068 obj_context->picture_width = picture_width;
1069 obj_context->picture_height = picture_height;
1070 obj_context->num_render_targets = num_render_targets;
1071 obj_context->msvdx_scaling = 0;
1073 obj_context->msvdx_frame_end = 0;
1077 obj_context->modular_drm = 1;
1082 obj_context->scaling_width = 0;
1083 obj_context->scaling_height = 0;
1084 obj_context->render_targets = (VASurfaceID *) calloc(1, num_render_targets * sizeof(VASurfaceID));
1085 if (obj_context->render_targets == NULL) {
1089 object_heap_free(&driver_data->context_heap, (object_base_p) obj_context);
1095 obj_context->num_buffers = 10;
1096 obj_context->buffer_list = (object_buffer_p *) calloc(1, sizeof(object_buffer_p) * obj_context->num_buffers);
1097 if (obj_context->buffer_list == NULL) {
1101 free(obj_context->render_targets);
1102 object_heap_free(&driver_data->context_heap, (object_base_p) obj_context);
1107 memset(obj_context->buffers_unused, 0, sizeof(obj_context->buffers_unused));
1108 memset(obj_context->buffers_unused_count, 0, sizeof(obj_context->buffers_unused_count));
1109 memset(obj_context->buffers_unused_tail, 0, sizeof(obj_context->buffers_unused_tail));
1110 memset(obj_context->buffers_active, 0, sizeof(obj_context->buffers_active));
1150 obj_context->render_targets[i] = render_targets[i];
1155 obj_context->msvdx_tile = psb__tile_stride_log2_512(obj_surface->width);
1160 obj_context->msvdx_tile = psb__tile_stride_log2_256(obj_context->picture_width);
1162 obj_context->msvdx_tile = psb__tile_stride_log2_256(obj_surface->width);
1177 obj_context->va_flags = flag;
1178 obj_context->format_vtable = obj_config->format_vtable;
1179 obj_context->format_data = NULL;
1182 vaStatus = obj_context->format_vtable->createContext(obj_context, obj_config);
1187 obj_context->context_id = -1;
1188 obj_context->config_id = -1;
1189 obj_context->picture_width = 0;
1190 obj_context->picture_height = 0;
1191 free(obj_context->render_targets);
1192 free(obj_context->buffer_list);
1193 obj_context->num_buffers = 0;
1194 obj_context->render_targets = NULL;
1195 obj_context->num_render_targets = 0;
1196 obj_context->va_flags = 0;
1197 object_heap_free(&driver_data->context_heap, (object_base_p) obj_context);
1204 obj_context->pnw_cmdbuf_list[i] = NULL;
1209 obj_context->tng_cmdbuf_list[i] = NULL;
1215 obj_context->vsp_cmdbuf_list[i] = NULL;
1220 obj_context->cmdbuf_list[i] = NULL;
1228 if (IS_MRFL(obj_context->driver_data))
1232 if (IS_MFLD(obj_context->driver_data))
1240 else if (IS_MRFL(obj_context->driver_data))
1257 if (IS_MRFL(obj_context->driver_data))
1258 vaStatus = tng_cmdbuf_create(obj_context, driver_data, (tng_cmdbuf_p)cmdbuf);
1261 if (IS_MFLD(obj_context->driver_data))
1262 vaStatus = pnw_cmdbuf_create(obj_context, driver_data, (pnw_cmdbuf_p)cmdbuf);
1266 vaStatus = psb_cmdbuf_create(obj_context, driver_data, (psb_cmdbuf_p)cmdbuf);
1268 else if (IS_MRFL(obj_context->driver_data))
1269 vaStatus = vsp_cmdbuf_create(obj_context, driver_data, (vsp_cmdbuf_p)cmdbuf);
1273 vaStatus = psb_cmdbuf_create(obj_context, driver_data, (psb_cmdbuf_p)cmdbuf);
1290 if (IS_MRFL(obj_context->driver_data))
1291 obj_context->tng_cmdbuf_list[i] = (tng_cmdbuf_p)cmdbuf;
1294 if (IS_MFLD(obj_context->driver_data))
1295 obj_context->pnw_cmdbuf_list[i] = (pnw_cmdbuf_p)cmdbuf;
1299 obj_context->cmdbuf_list[i] = (psb_cmdbuf_p)cmdbuf;
1301 else if (IS_MRFL(obj_context->driver_data))
1302 obj_context->vsp_cmdbuf_list[i] = (vsp_cmdbuf_p)cmdbuf;
1306 obj_context->cmdbuf_list[i] = (psb_cmdbuf_p)cmdbuf;
1309 obj_context->cmdbuf_current = -1;
1310 obj_context->cmdbuf = NULL;
1311 obj_context->pnw_cmdbuf = NULL;
1312 obj_context->tng_cmdbuf = NULL;
1314 obj_context->vsp_cmdbuf = NULL;
1316 obj_context->frame_count = 0;
1317 obj_context->slice_count = 0;
1318 obj_context->msvdx_context = ((driver_data->msvdx_context_base & 0xff0000) >> 16) |
1321 obj_context->msvdx_context = ((driver_data->drm_fd & 0xf) << 4) |
1324 obj_context->profile = obj_config->profile;
1325 obj_context->entry_point = obj_config->entrypoint;
1333 if (obj_context->pnw_cmdbuf_list[i]) {
1334 pnw_cmdbuf_destroy(obj_context->pnw_cmdbuf_list[i]);
1335 free(obj_context->pnw_cmdbuf_list[i]);
1336 obj_context->pnw_cmdbuf_list[i] = NULL;
1340 if (obj_context->tng_cmdbuf_list[i]) {
1341 tng_cmdbuf_destroy(obj_context->tng_cmdbuf_list[i]);
1342 free(obj_context->tng_cmdbuf_list[i]);
1343 obj_context->tng_cmdbuf_list[i] = NULL;
1346 if (obj_context->cmdbuf_list[i]) {
1347 psb_cmdbuf_destroy(obj_context->cmdbuf_list[i]);
1348 free(obj_context->cmdbuf_list[i]);
1349 obj_context->cmdbuf_list[i] = NULL;
1352 if (obj_context->vsp_cmdbuf_list[i]) {
1353 vsp_cmdbuf_destroy(obj_context->vsp_cmdbuf_list[i]);
1354 free(obj_context->vsp_cmdbuf_list[i]);
1355 obj_context->vsp_cmdbuf_list[i] = NULL;
1360 obj_context->cmdbuf = NULL;
1362 obj_context->vsp_cmdbuf = NULL;
1365 obj_context->context_id = -1;
1366 obj_context->config_id = -1;
1367 obj_context->picture_width = 0;
1368 obj_context->picture_height = 0;
1369 free(obj_context->render_targets);
1370 free(obj_context->buffer_list);
1371 obj_context->num_buffers = 0;
1372 obj_context->render_targets = NULL;
1373 obj_context->num_render_targets = 0;
1374 obj_context->va_flags = 0;
1375 object_heap_free(&driver_data->context_heap, (object_base_p) obj_context);
1377 obj_context->ctp_type = (((obj_config->profile << 8) |
1382 obj_context->ctp_type = (((obj_config->profile << 8) |
1386 obj_context->ctp_type |= ((obj_context->msvdx_tile & 0xff) << 16);
1393 obj_context->ctp_type |= (width_in_mb << 32);
1397 int ret = psb_new_context(driver_data, obj_context->ctp_type | driver_data->protected);
1417 static VAStatus psb__allocate_BO_buffer(psb_driver_data_p driver_data, object_context_p __maybe_unused obj_context, object_buffer_p obj_buffer, int size, unsigned char *data, VABufferType type)
1529 object_context_p obj_context = obj_buffer->context;
1541 obj_buffer->last_used = obj_context->frame_count;
1542 if (obj_context->buffers_unused_tail[type]) {
1543 obj_buffer->pptr_prev_next = &(obj_context->buffers_unused_tail[type]->ptr_next);
1545 obj_buffer->pptr_prev_next = &(obj_context->buffers_unused[type]);
1548 obj_context->buffers_unused_tail[type] = obj_buffer;
1549 obj_context->buffers_unused_count[type]++;
1552 buffer_type_to_string(obj_buffer->type), obj_context->buffers_unused_count[type]);
1567 static void psb__destroy_context(psb_driver_data_p driver_data, object_context_p obj_context)
1571 if (obj_context->entry_point == VAEntrypointEncSlice)
1576 obj_context->format_vtable->destroyContext(obj_context);
1580 obj_buffer = obj_context->buffers_active[i];
1585 obj_buffer = obj_context->buffers_unused[i];
1590 obj_context->buffers_unused_count[i] = 0;
1594 if (obj_context->pnw_cmdbuf_list[i]) {
1595 pnw_cmdbuf_destroy(obj_context->pnw_cmdbuf_list[i]);
1596 free(obj_context->pnw_cmdbuf_list[i]);
1597 obj_context->pnw_cmdbuf_list[i] = NULL;
1603 if (obj_context->tng_cmdbuf_list[i]) {
1604 tng_cmdbuf_destroy(obj_context->tng_cmdbuf_list[i]);
1605 free(obj_context->tng_cmdbuf_list[i]);
1606 obj_context->tng_cmdbuf_list[i] = NULL;
1612 if (obj_context->vsp_cmdbuf_list[i]) {
1613 vsp_cmdbuf_destroy(obj_context->vsp_cmdbuf_list[i]);
1614 free(obj_context->vsp_cmdbuf_list[i]);
1615 obj_context->vsp_cmdbuf_list[i] = NULL;
1621 if (obj_context->cmdbuf_list[i]) {
1622 psb_cmdbuf_destroy(obj_context->cmdbuf_list[i]);
1623 free(obj_context->cmdbuf_list[i]);
1624 obj_context->cmdbuf_list[i] = NULL;
1627 obj_context->cmdbuf = NULL;
1629 obj_context->vsp_cmdbuf = NULL;
1632 obj_context->context_id = -1;
1633 obj_context->config_id = -1;
1634 obj_context->picture_width = 0;
1635 obj_context->picture_height = 0;
1636 if (obj_context->render_targets)
1637 free(obj_context->render_targets);
1638 obj_context->render_targets = NULL;
1639 obj_context->num_render_targets = 0;
1640 obj_context->va_flags = 0;
1642 obj_context->current_render_target = NULL;
1643 obj_context->ec_target = NULL;
1644 obj_context->ec_candidate = NULL;
1645 if (obj_context->buffer_list)
1646 free(obj_context->buffer_list);
1647 obj_context->num_buffers = 0;
1649 object_heap_free(&driver_data->context_heap, (object_base_p) obj_context);
1662 object_context_p obj_context = CONTEXT(context);
1663 CHECK_CONTEXT(obj_context);
1665 psb__destroy_context(driver_data, obj_context);
1673 object_context_p obj_context, /* in */
1694 obj_buffer = obj_context ? obj_context->buffers_unused[type] : NULL;
1695 unused_count = obj_context ? obj_context->buffers_unused_count[type] : 0;
1727 } else if ((obj_buffer->last_used == obj_context->frame_count) && (unused_count < MAX_UNUSED_BUFFERS)) {
1731 } else if (obj_context->frame_count - obj_buffer->last_used < 5) {
1744 obj_context->buffers_unused[type] = obj_buffer->ptr_next;
1745 if (obj_context->buffers_unused[type]) {
1746 obj_context->buffers_unused[type]->pptr_prev_next = &(obj_context->buffers_unused[type]);
1747 ASSERT(obj_context->buffers_unused_tail[type] != obj_buffer);
1749 ASSERT(obj_context->buffers_unused_tail[type] == obj_buffer);
1750 obj_context->buffers_unused_tail[type] = 0;
1752 obj_context->buffers_unused_count[type]--;
1756 ASSERT(obj_context == obj_buffer->context);
1771 obj_buffer->context = obj_context;
1773 if (obj_context) {
1775 obj_buffer->ptr_next = obj_context->buffers_active[type];
1779 obj_buffer->pptr_prev_next = &(obj_context->buffers_active[type]);
1794 vaStatus = psb__allocate_BO_buffer(driver_data, obj_context,obj_buffer, size * num_elements, data, obj_buffer->type);
1902 object_context_p obj_context = CONTEXT(context);
1903 CHECK_CONTEXT(obj_context);
1906 vaStatus = psb__CreateBuffer(driver_data, obj_context, type, size, num_elements, data, buf_desc);
2036 object_context_p obj_context;
2040 obj_context = CONTEXT(context);
2041 CHECK_CONTEXT(obj_context);
2044 ASSERT(obj_context->current_render_target == NULL);
2049 obj_context->current_render_surface_id = render_target;
2050 obj_context->current_render_target = obj_surface;
2051 obj_context->slice_count = 0;
2053 obj_config = CONFIG(obj_context->config_id);
2064 vaStatus = obj_context->format_vtable->beginPicture(obj_context);
2073 psb_RecalcAlternativeOutput(obj_context);
2080 if (obj_context->interlaced_stream || driver_data->disable_msvdx_rotate) {
2082 obj_context->msvdx_rotate = 0;
2083 for (i = 0; i < obj_context->num_render_targets; i++) {
2084 object_surface_p obj_surface = SURFACE(obj_context->render_targets[i]);
2092 obj_context->msvdx_rotate = driver_data->msvdx_rotate_want;
2099 SET_SURFACE_INFO_rotate(obj_surface->psb_surface, obj_context->msvdx_rotate);
2101 if (CONTEXT_SCALING(obj_context) && obj_config->entrypoint != VAEntrypointEncSlice)
2102 if(VA_STATUS_SUCCESS != psb_CreateScalingSurface(obj_context, obj_surface)) {
2103 obj_context->msvdx_scaling = 0;
2107 if (CONTEXT_ROTATE(obj_context)) {
2112 vaStatus = psb_CreateRotateSurface(obj_context, obj_surface, obj_context->msvdx_rotate);
2115 obj_context->msvdx_rotate = 0;
2116 vaStatus = psb_DestroyRotateBuffer(obj_context, obj_surface);
2120 vaStatus = psb_CreateRotateSurface(obj_context, obj_surface, obj_context->msvdx_rotate);
2127 obj_surface->share_info->surface_rotate = VAROTATION2HAL(obj_context->msvdx_rotate);
2144 vaStatus = psb_buffer_create(obj_context->driver_data,
2155 obj_context->is_oold = driver_data->is_oold;
2158 render_target, obj_context->frame_count);
2159 psb__trace_message("------Trace frame %d------\n", obj_context->frame_count);
2175 object_context_p obj_context;
2179 obj_context = CONTEXT(context);
2180 CHECK_CONTEXT(obj_context);
2186 ASSERT(obj_context->current_render_target != NULL);
2188 if (num_buffers > obj_context->num_buffers) {
2189 free(obj_context->buffer_list);
2191 obj_context->buffer_list = (object_buffer_p *) calloc(1, sizeof(object_buffer_p) * num_buffers);
2192 if (obj_context->buffer_list == NULL) {
2194 obj_context->num_buffers = 0;
2197 obj_context->num_buffers = num_buffers;
2199 buffer_list = obj_context->buffer_list;
2214 vaStatus = obj_context->format_vtable->renderPicture(obj_context, buffer_list, num_buffers);
2238 object_context_p obj_context;
2240 obj_context = CONTEXT(context);
2241 CHECK_CONTEXT(obj_context);
2243 vaStatus = obj_context->format_vtable->endPicture(obj_context);
2245 drv_debug_msg(VIDEO_DEBUG_GENERAL, "---EndPicture for frame %d --\n", obj_context->frame_count);
2247 obj_context->current_render_target = NULL;
2248 obj_context->frame_count++;
2250 psb__trace_message("FrameCount = %03d\n", obj_context->frame_count);
2251 drv_debug_msg(VIDEO_DEBUG_GENERAL, "FrameCount = %03d\n", obj_context->frame_count);
2255 //psb_SyncSurface(ctx, obj_context->current_render_surface_id);
2267 object_context_p obj_context;
2279 obj_context = CONTEXT(obj_surface->context_id);
2280 if (NULL == obj_context) /* not associate with a context */
2283 obj_config = CONFIG(obj_context->config_id);
2323 object_context_p obj_context = NULL;
2331 obj_context = CONTEXT(obj_surface->context_id);
2332 if (obj_context) {
2333 obj_config = CONFIG(obj_context->config_id);
2364 (obj_context->msvdx_rotate == VA_ROTATION_90 || obj_context->msvdx_rotate == VA_ROTATION_270) &&
2423 object_context_p obj_context = NULL;
2434 obj_context = CONTEXT(obj_surface->context_id);
2435 CHECK_CONTEXT(obj_context);
2437 (obj_context->msvdx_rotate == VA_ROTATION_90 || obj_context->msvdx_rotate == VA_ROTATION_270) &&
2995 object_context_p obj_context;
3002 obj_context = (object_context_p) object_heap_first(&driver_data->context_heap, &iter);
3003 while (obj_context) {
3004 drv_debug_msg(VIDEO_DEBUG_INIT, "vaTerminate: contextID %08x still allocated, destroying\n", obj_context->base.id);
3005 psb__destroy_context(driver_data, obj_context);
3006 obj_context = (object_context_p) object_heap_next(&driver_data->context_heap, &iter);