Xserver doesn't support XvPutImage to Pixmap?

Yuan Austin shengquan.yuan at gmail.com
Fri Apr 10 02:30:34 PDT 2009


On Thu, Apr 2, 2009 at 3:59 PM, Shengquan Yuan <shengquan.yuan at gmail.com> wrote:
> 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 tried to comment above two lines, then XvPutImage can draw into a
pixmap. I am not sure if it has side effect.

I also tried intel driver on a 945G platform, since intel driver is
using UXA architecture, and bellow  "exaMoveInPixmap" won't be called,
this hacking doesn't work.

>
> 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 mailing list