Commit 7a705081 authored by Zhenyu Wang's avatar Zhenyu Wang

xvmc: formalize surface type definition

We should also carefully select surface type id.
parent 0283d22f
......@@ -47,6 +47,13 @@
#define XVMC_I945_MPEG2_VLD 0x04
#define XVMC_I965_MPEG2_VLD 0x08
/* supported surface types */
enum {
SURFACE_TYPE_MPEG2_MPML = FOURCC_XVMC, /* mpeg2 MP@ML */
SURFACE_TYPE_MPEG1_MPML, /* mpeg1 MP@ML */
SURFACE_TYPE_MAX
};
/* common header for context private */
struct hwmc_buffer
{
......
......@@ -111,7 +111,7 @@ static XF86MCImageIDList yv12_subpicture_list =
static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface =
{
FOURCC_YV12,
SURFACE_TYPE_MPEG2_MPML,
XVMC_CHROMA_FORMAT_420,
0,
720,
......@@ -127,7 +127,7 @@ static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface =
static XF86MCSurfaceInfoRec i915_YV12_mpg1_surface =
{
FOURCC_YV12,
SURFACE_TYPE_MPEG1_MPML,
XVMC_CHROMA_FORMAT_420,
0,
720,
......
......@@ -1850,9 +1850,8 @@ static int i915_xvmc_mc_render_surface(Display *display, XvMCContext *context,
if (!(privTarget = target_surface->privData))
return XvMCBadSurface;
/* Test For YV12 Surface */
if (context->surface_type_id != FOURCC_YV12) {
XVMC_ERR("HWMC only possible on YV12 Surfaces.");
if (context->surface_type_id >= SURFACE_TYPE_MAX) {
XVMC_ERR("Unsupprted surface_type_id %d.", context->surface_type_id);
return BadValue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment