const enum pipe_format *resource_formats;
struct pipe_video_buffer template;
struct pipe_resource templ;
- unsigned i, depth;
+ unsigned i, array_size;
assert(pipe);
if (!resource_formats)
return NULL;
- depth = tmpl->interlaced ? 2 : 1;
+ array_size = tmpl->interlaced ? 2 : 1;
template = *tmpl;
template.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
- template.height = align(tmpl->height / depth, VL_MACROBLOCK_HEIGHT);
+ template.height = align(tmpl->height / array_size, VL_MACROBLOCK_HEIGHT);
- vl_vide_buffer_template(&templ, &template, resource_formats[0], depth, PIPE_USAGE_STATIC, 0);
+ vl_video_buffer_template(&templ, &template, resource_formats[0], 1, array_size, PIPE_USAGE_STATIC, 0);
+ if (ctx->chip_class < EVERGREEN || tmpl->interlaced)
+ templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[0] = (struct r600_texture *)
pipe->screen->resource_create(pipe->screen, &templ);
if (!resources[0])
goto error;
if (resource_formats[1] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[1], depth, PIPE_USAGE_STATIC, 1);
+ vl_video_buffer_template(&templ, &template, resource_formats[1], 1, array_size, PIPE_USAGE_STATIC, 1);
+ if (ctx->chip_class < EVERGREEN || tmpl->interlaced)
+ templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[1] = (struct r600_texture *)
pipe->screen->resource_create(pipe->screen, &templ);
if (!resources[1])
}
if (resource_formats[2] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[2], depth, PIPE_USAGE_STATIC, 2);
+ vl_video_buffer_template(&templ, &template, resource_formats[2], 1, array_size, PIPE_USAGE_STATIC, 2);
+ if (ctx->chip_class < EVERGREEN || tmpl->interlaced)
+ templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[2] = (struct r600_texture *)
pipe->screen->resource_create(pipe->screen, &templ);
if (!resources[2])
pbs[i] = &resources[i]->resource.buf;
surfaces[i] = &resources[i]->surface;
-
- if (ctx->chip_class < EVERGREEN) {
- resources[i]->array_mode[0] = V_038000_ARRAY_LINEAR_ALIGNED;
- resources[i]->surface.level[0].mode = RADEON_SURF_MODE_LINEAR_ALIGNED;
- }
}
ruvd_join_surfaces(ctx->ws, templ.bind, pbs, surfaces);
resources[i]->resource.buf);
}
- template.height *= depth;
+ template.height *= array_size;
return vl_video_buffer_create_ex2(pipe, &template, (struct pipe_resource **)resources);
error:
struct r600_texture *luma = (struct r600_texture *)buf->resources[0];
struct r600_texture *chroma = (struct r600_texture *)buf->resources[1];
- msg->decode.dt_field_mode = buf->base.interlaced;
- msg->decode.dt_surf_tile_config |= RUVD_NUM_BANKS(eg_num_banks(rscreen->tiling_info.num_banks));
+ msg->body.decode.dt_field_mode = buf->base.interlaced;
+ msg->body.decode.dt_surf_tile_config |= RUVD_NUM_BANKS(eg_num_banks(rscreen->tiling_info.num_banks));
ruvd_set_dt_surfaces(msg, &luma->surface, &chroma->surface);
width, height, max_references, expect_chunked_decode,
ctx->ws, r600_uvd_set_dtb);
}
+
+int r600_uvd_get_video_param(struct pipe_screen *screen,
+ enum pipe_video_profile profile,
+ enum pipe_video_cap param)
+{
+ struct r600_screen *rscreen = (struct r600_screen *)screen;
+
+ /* No support for MPEG4 on UVD 2.x */
+ if (param == PIPE_VIDEO_CAP_SUPPORTED && rscreen->family < CHIP_CEDAR &&
+ u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG4)
+ return false;
+
+ return ruvd_get_video_param(screen, profile, param);
+}