Xserver doesn't support XvPutImage to Pixmap?
Shengquan Yuan
shengquan.yuan at gmail.com
Thu Apr 2 00:59:35 PDT 2009
Hi,
I tried to use XvPutImage to draw into a pixmap, but it always returns
error. After tracing into Xserver, I found function
hw/xfree86/common/xf86xv.c:xf86XVPutImage checks whether the drawable
is WINDOW, if not, it returns BadAlloc directly, see bellow code:
> static int
> xf86XVPutImage(
> ClientPtr client,
> DrawablePtr pDraw,
> XvPortPtr pPort,
> GCPtr pGC,
> INT16 src_x, INT16 src_y,
> CARD16 src_w, CARD16 src_h,
> INT16 drw_x, INT16 drw_y,
> CARD16 drw_w, CARD16 drw_h,
> XvImagePtr format,
> unsigned char* data,
> Bool sync,
> CARD16 width, CARD16 height
> ){
> XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
> ScreenPtr pScreen;
> RegionRec WinRegion;
> RegionRec ClipRegion;
> BoxRec WinBox;
> int ret = Success;
> Bool clippedAway = FALSE;
>
> if (pDraw->type != DRAWABLE_WINDOW)
> => return BadAlloc;
I also looked at Xvideo implementation in Xserver video driver, and it
looks like texture video supports rendering into a pixmap:
> if (pDraw->type == DRAWABLE_WINDOW)
> pPriv->pPixmap = (*pScreen->GetWindowPixmap)((WindowPtr)pDraw);
> else
> pPriv->pPixmap = (PixmapPtr)pDraw;
>
> #ifdef USE_EXA
> if (info->useEXA) {
> /* Force the pixmap into framebuffer so we can draw to it. */
> exaMoveInPixmap(pPriv->pPixmap);
> }
> #endif
>
I am wondering what's the reason that Xserver returns failure directly
when XvPutImage drawing into a pixmap?
Thanks
Austin
More information about the xorg-devel
mailing list