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