[Libva] CPU usage regression

gimli gimli at dark-green.com
Thu Jun 9 09:37:59 PDT 2011


On Thu, 9 Jun 2011 16:26:55 +0800, "Yuan, Shengquan"
<shengquan.yuan at gmail.com> wrote:
> On Wed, Jun 8, 2011 at 6:00 PM, gimli <gimli at dark-green.com> wrote:
>> I was hitting a performance regression in libva on ILK and SNA.
>> Did a bisect of the git changes and found the root cause.
>> In commit 0d97d088493f2b62dd1b55df26f26775eb20d85c
>>
>> diff --git a/va/x11/va_dri2.c b/va/x11/va_dri2.c
>> index 4915651..8e9f304 100644
>> --- a/va/x11/va_dri2.c
>> +++ b/va/x11/va_dri2.c
>> @@ -340,9 +340,9 @@ void VA_DRI2SwapBuffers(Display *dpy, XID drawable,
>> CARD64 target_msc,
>> req->drawable = drawable;
>> load_swap_req(req, target_msc, divisor, remainder);
>>
>> -    _XReply(dpy, (xReply *)&rep, 0, xFalse);
>> +    _XSend(dpy, NULL, 0);
> 
> The original intent of changing from _XReply to _XSend is that with
> _XSend  we can gain some FPS.
> 
> Are you saying it will increase CPU usage? I understand _XReplay waits
> until Xserver returns the result, and
> _XSend just sends the request, is that true?

Yes it increases CPU usage. When starting a stream the CPU usage is low.
Let it play for around 30 minutes and you see the usage is growing. I do
not think that _XSend is correct. IIRC the Mesa DRI2 code uses also
_XReplay. 

> Thanks
> -Austin
> 
>>
>> -    *count = vals_to_card64(rep.swap_lo, rep.swap_hi);
>> +    *count = 0;
>>
>> UnlockDisplay(dpy);
>> SyncHandle();
>>
>> This is causing in a running application a permanent growing of the CPU
>> usage.
>> The attached patch revert this to the old behavior where the CPU usage
>> remains constant.
>>
>> Signed-off-by: Edgar Hucek <gimli at dark-green.com>


More information about the Libva mailing list