Commit a0058369 authored by Daniel Vetter's avatar Daniel Vetter

XvMC: kill intel_xvmc_command

We only passed around and actually used the gem handle. Don't
need a struct for one field alone ...
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 79fe4caa
......@@ -63,14 +63,7 @@ struct intel_xvmc_hw_context {
/* Intel private XvMC command to DDX driver */
struct intel_xvmc_command {
unsigned int command;
unsigned int ctxNo;
unsigned int srfNo;
unsigned int subPicNo;
unsigned int flags;
unsigned int real_id;
uint32_t handle;
unsigned int pad[5];
};
#ifdef _INTEL_XVMC_SERVER_
......
......@@ -1495,8 +1495,7 @@ I830PutImageTextured(ScrnInfoPtr scrn,
if (xvmc_passthrough(id)) {
int size;
struct intel_xvmc_command *cmd
= (struct intel_xvmc_command *)buf;
uint32_t *gem_handle = (uint32_t *)buf;
i830_free_video_buffers(adaptor_priv);
......@@ -1512,7 +1511,7 @@ I830PutImageTextured(ScrnInfoPtr scrn,
adaptor_priv->buf =
drm_intel_bo_gem_create_from_name(intel->bufmgr,
"xvmc surface",
cmd->handle);
*gem_handle);
} else {
if (!i830_copy_video_data(scrn, adaptor_priv, width, height,
&dstPitch, &dstPitch2,
......
......@@ -1302,12 +1302,11 @@ static int i915_xvmc_mc_put_surface(Display * display, XvMCSurface * surface,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, struct intel_xvmc_command *data)
int flags, uint32_t *gem_handle)
{
i915XvMCContext *pI915XvMC;
i915XvMCSurface *pI915Surface;
i915XvMCSubpicture *pI915SubPic;
uint32_t handle = 0;
if (!(pI915Surface = surface->privData))
return XvMCBadSurface;
......@@ -1317,16 +1316,7 @@ static int i915_xvmc_mc_put_surface(Display * display, XvMCSurface * surface,
PPTHREAD_MUTEX_LOCK();
drm_intel_bo_flink(pI915Surface->bo, &handle);
data->command = INTEL_XVMC_COMMAND_DISPLAY;
data->ctxNo = pI915XvMC->ctxno;
data->srfNo = pI915Surface->srfNo;
pI915SubPic = pI915Surface->privSubPic;
data->subPicNo = (!pI915SubPic ? 0 : pI915SubPic->srfNo);
data->real_id = FOURCC_YV12;
data->flags = flags;
data->handle = handle;
drm_intel_bo_flink(pI915Surface->bo, gem_handle);
PPTHREAD_MUTEX_UNLOCK();
......
......@@ -882,13 +882,11 @@ static Status put_surface(Display * display, XvMCSurface * surface,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, struct intel_xvmc_command *data)
int flags, uint32_t *gem_handle)
{
struct i965_xvmc_surface *private_surface = surface->privData;
uint32_t handle = 0;
drm_intel_bo_flink(private_surface->bo, &handle);
data->handle = handle;
drm_intel_bo_flink(private_surface->bo, gem_handle);
return Success;
}
......
......@@ -547,7 +547,7 @@ _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context,
intel_surf->image = XvCreateImage(display, context->port,
FOURCC_XVMC,
(char *)&intel_surf->data,
(char *) &intel_surf->gem_handle,
surface->width, surface->height);
if (!intel_surf->image) {
XVMC_ERR("Can't create XvImage for surface\n");
......@@ -555,7 +555,6 @@ _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context,
intel_xvmc_free_surface(surface->surface_id);
return BadAlloc;
}
intel_surf->image->data = (char *)&intel_surf->data;
ret =
(xvmc_driver->create_surface) (display, context, surface,
......@@ -785,7 +784,8 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface,
/* fill intel_surf->data */
ret = (xvmc_driver->put_surface) (display, surface, draw, srcx, srcy,
srcw, srch, destx, desty, destw,
desth, flags, &intel_surf->data);
desth, flags,
&intel_surf->gem_handle);
if (ret) {
XVMC_ERR("put surface fail\n");
return ret;
......
......@@ -114,7 +114,7 @@ typedef struct _intel_xvmc_surface {
GC gc;
Bool gc_init;
Drawable last_draw;
struct intel_xvmc_command data;
uint32_t gem_handle;
struct _intel_xvmc_surface *next;
} intel_xvmc_surface_t, *intel_xvmc_surface_ptr;
......@@ -191,7 +191,7 @@ typedef struct _intel_xvmc_driver {
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, struct intel_xvmc_command * data);
int flags, uint32_t *gem_handle);
Status(*get_surface_status) (Display * display, XvMCSurface * surface,
int *stat);
......
......@@ -1050,13 +1050,11 @@ static Status put_surface(Display * display, XvMCSurface * surface,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, struct intel_xvmc_command *data)
int flags, uint32_t *gem_handle)
{
struct i965_xvmc_surface *private_surface = surface->privData;
uint32_t handle;
drm_intel_bo_flink(private_surface->bo, &handle);
data->handle = handle;
drm_intel_bo_flink(private_surface->bo, gem_handle);
return Success;
}
......
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