Commit df718a77 authored by Zhenyu Wang's avatar Zhenyu Wang

xvmc: add xvmc decoder type string

parent a03a758d
......@@ -142,8 +142,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
}
comm = (struct _intel_xvmc_common *)priv_data;
XVMC_INFO("hw xvmc type %d", comm->type);
//XXX: how to handle different driver types
if (xvmc_driver == NULL || xvmc_driver->type != comm->type) {
switch (comm->type) {
case XVMC_I915_MPEG2_MC:
......@@ -158,17 +157,15 @@ Status XvMCCreateContext(Display *display, XvPortID port,
priv_data = NULL;
return BadValue;
}
} else {
XVMC_ERR("wrong hw xvmc type returned\n");
free(priv_data);
priv_data = NULL;
return BadValue;
}
if (xvmc_driver == NULL || xvmc_driver->type != comm->type) {
XVMC_ERR("fail to load xvmc driver for type %d\n", comm->type);
return BadValue;
}
XVMC_INFO("decoder type is %s", intel_xvmc_decoder_string(comm->type));
xvmc_driver->sarea_size = comm->sarea_size;
xvmc_driver->batchbuffer.handle = comm->batchbuffer.handle;
xvmc_driver->batchbuffer.offset = comm->batchbuffer.offset;
......
......@@ -60,18 +60,18 @@
#define XVMC_ERR(s, arg...) \
do { \
fprintf(stderr, "intel_xvmc err: " s "\n", ##arg); \
fprintf(stderr, "[intel_xvmc] err: " s "\n", ##arg); \
} while (0)
#define XVMC_INFO(s, arg...) \
do { \
fprintf(stderr, "intel_xvmc info: " s "\n", ##arg); \
fprintf(stderr, "[intel_xvmc] info: " s "\n", ##arg); \
} while (0)
#define XVMC_DBG(s, arg...) \
do { \
if (DEBUG) \
fprintf(stderr, "intel_xvmc debug: " s "\n", ##arg); \
fprintf(stderr, "[intel_xvmc] debug: " s "\n", ##arg); \
} while (0)
/* Subpicture fourcc */
......@@ -213,4 +213,20 @@ extern struct _intel_xvmc_driver *xvmc_driver;
extern void LOCK_HARDWARE(drm_context_t);
extern void UNLOCK_HARDWARE(drm_context_t);
static inline const char* intel_xvmc_decoder_string(int flag)
{
switch (flag) {
case XVMC_I915_MPEG2_MC:
return "i915/945 MPEG2 MC decoder";
case XVMC_I965_MPEG2_MC:
return "i965 MPEG2 MC decoder";
case XVMC_I945_MPEG2_VLD:
return "i945 MPEG2 VLD decoder";
case XVMC_I965_MPEG2_VLD:
return "i965 MPEG2 VLD decoder";
default:
return "Unknown decoder";
}
}
#endif
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