Commit f0ced5ed authored by Zhenyu Wang's avatar Zhenyu Wang

xvmc: store XvMCContext pointer instead of context_id in internal ctx list

parent 216ad739
......@@ -84,7 +84,7 @@ static void intel_xvmc_free_context(XID id)
intel_xvmc_context_ptr pre = p;
while(p) {
if (p->id == id) {
if (p->context->context_id == id) {
if (p == xvmc_driver->ctx_list)
xvmc_driver->ctx_list = p->next;
else
......@@ -105,7 +105,7 @@ intel_xvmc_context_ptr intel_xvmc_find_context(XID id)
intel_xvmc_context_ptr p = xvmc_driver->ctx_list;
while(p) {
if (p->id == id)
if (p->context->context_id == id)
return p;
p = p->next;
}
......@@ -231,8 +231,6 @@ Status XvMCCreateContext(Display *display, XvPortID port,
XVMC_ERR("Intel XvMC context create fail\n");
return BadAlloc;
}
/* context_id is alloc in _xvmc_create_context */
intel_ctx->id = context->context_id;
ret = uniDRIQueryDirectRenderingCapable(display, screen,
&isCapable);
......@@ -287,6 +285,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
xvmc_driver->driHwLock = (drmLock *)&pSAREA->lock;
pthread_mutex_init(&xvmc_driver->ctxmutex, NULL);
/* context_id is alloc in _xvmc_create_context */
if (!uniDRICreateContext(display, screen, NULL,
context->context_id,
&intel_ctx->hw_context)) {
......
......@@ -100,7 +100,7 @@ extern Status _xvmc_destroy_subpicture(Display *dpy,
XvMCSubpicture *subpicture);
typedef struct _intel_xvmc_context {
XID id; /* context id to X system */
XvMCContext *context;
drm_context_t hw_context; /* context id to kernel drm */
struct _intel_xvmc_context *next;
} intel_xvmc_context_t, *intel_xvmc_context_ptr;
......
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