Low performance of XRRGetScreenInfo

Ren, Zhaohan zhaohan.ren at intel.com
Thu Apr 2 00:28:35 PDT 2009


Hi All
I wrote some code using libXrandr to check the current screen rotation state

int CheckRotationState(Display * x11_dpy) {
    Rotation current_rotation;
    XRRScreenConfiguration *scrn_cfg;
    scrn_cfg = XRRGetScreenInfo(x11_dpy, DefaultRootWindow(x11_dpy));
    XRRConfigCurrentConfiguration (scrn_cfg, &current_rotation);
    XRRFreeScreenConfigInfo(scrn_cfg);
    return current_rotation;
}

CheckRotationState is put ahead of XvPutImage,  that is to say every time I want to display an image, I will firstly check the screen rotation state. If the return value of CheckRotationState is RR_Rotate_0(There isn't any rotation), I will use hardware overlay to display video, or I will use textured blit way. But I found the performance degraded a lot after add CheckRotationState. Seems that XRRGetScreenInfo consumes much time. I tried another interface XRRRotations, but can only get the cached information, not the current rotation state.
Does anyone have some good idea about how to get the screen rotation state from the Server efficiently?

Best Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20090402/b991c686/attachment.htm 


More information about the xorg-devel mailing list