[Libva] [PATCH] libva: new flags for vaPutSurface() to distinguish pixmap from window

Gwenole Beauchesne gbeauchesne at splitted-desktop.com
Wed Jun 30 01:22:25 PDT 2010


Hi,

On Tue, 29 Jun 2010, Xiang, Haihao wrote:

> Meanwhile render pixmap directly.

I once tried TFP on Ironlake. It used to work on Ubuntu/lucid-RC without 
other changes. This no longer works nowadays because Ubuntu/lucid final 
dropped support for GLX 1.3.

That said, I don't think this patch is useful. Normally, a VA driver will 
know whether the drawable is a Pixmap or a Window, since it's generally 
tied to the X driver. In our drivers, I use a function (e.g. is_pixmap()) 
to check for that.

I mean, do_drawable_hash() can also use such a function, if we can't know 
that from the X driver. How is the Moorestown driver working on this side?

BTW, here is the function I use. There surely is a better one though.

// X error trap
static int x11_error_code = 0;
static int (*old_error_handler)(Display *, XErrorEvent *);

static int error_handler(Display *dpy, XErrorEvent *error)
{
     x11_error_code = error->error_code;
     return 0;
}

void x11_trap_errors(void)
{
     x11_error_code    = 0;
     old_error_handler = XSetErrorHandler(error_handler);
}

int x11_untrap_errors(void)
{
     XSetErrorHandler(old_error_handler);
     return x11_error_code;
}

static int is_window(Display *dpy, Drawable drawable)
{
     XWindowAttributes wattr;

     x11_trap_errors();
     XGetWindowAttributes(dpy, drawable, &wattr);
     return x11_untrap_errors() == 0;
}

Regards,
Gwenole.


More information about the Libva mailing list