[Pixman] performance of bilinear_interpolation

Maksim Lin maks at manichord.com
Tue Oct 8 22:52:30 PDT 2013


After some advice from Siarhei on irc to check that SSE2 was being
enabled, I've been doing some more debugging on this and have made a
little bit more progress.

As mentioned before, I'm using Firefox for Android for x86 and having
applied the patch from bugzilla to bring firefoxes bundled version of
pixman upto 0.30.2 and then applying Siarhei's patch that adds
scaled_bilinear_scanline_sse2_x888_8888_SRC()

I Added logging output in pixman-x86.c to:
#ifdef USE_SSE2
    if (!_pixman_disabled ("sse2") && have_feature (SSE2_BITS)) {
        imp = _pixman_implementation_create_sse2 (imp);
        __android_log_print(ANDROID_LOG_DEBUG,"MAKS", "using SSE2 impl");
    }
#endif

and that gives me log output that confirms SSE is being detected and
enabled on my current test device (I've switched to testing on N270
netbook for now).

But I also see that scaled_bilinear_scanline_sse2_x888_8888_SRC() is
never called by adding log output to its start:

static force_inline void
scaled_bilinear_scanline_sse2_x888_8888_SRC (uint32_t *       dst,
                         const uint32_t * mask,
                         const uint32_t * src_top,
                         const uint32_t * src_bottom,
                         int32_t          w,
                         int              wt,
                         int              wb,
                         pixman_fixed_t   vx_,
                         pixman_fixed_t   unit_x_,
                         pixman_fixed_t   max_vx,
                         pixman_bool_t    zero_src)
{
    __android_log_print(ANDROID_LOG_DEBUG,"MAKS",
"scaled_bilinear_scanline_sse2_x888_8888_SRC");


and also strangely (compared to profiler traces for arm devices) I'm
*not* seeing bits_image_fetch_bilinear_affine being called either:

static force_inline void
bits_image_fetch_bilinear_affine (pixman_image_t * image,
                  int              offset,
                  int              line,
                  int              width,
                  uint32_t *       buffer,
                  const uint32_t * mask,

                  convert_pixel_t    convert_pixel,
                  pixman_format_code_t    format,
                  pixman_repeat_t    repeat_mode)
{
    __android_log_print(ANDROID_LOG_DEBUG,"MAKS", "bilinear_fetch");

I also added logging to the lookup function:

void
_pixman_implementation_lookup_composite (pixman_implementation_t  *toplevel,
                     pixman_op_t               op,
                     pixman_format_code_t      src_format,
                     uint32_t                  src_flags,
                     pixman_format_code_t      mask_format,
                     uint32_t                  mask_flags,
                     pixman_format_code_t      dest_format,
                     uint32_t                  dest_flags,
                     pixman_implementation_t **out_imp,
                     pixman_composite_func_t  *out_func)
{
    __android_log_print(ANDROID_LOG_DEBUG,"MAKS", "lookup composite
op:%d src:%d flags: %d", op, src_format, src_flags);

and this gives results while running my test html content as
10-09 05:41:24.990  4507  4535 D MAKS    : lookup composite op:1
src:537004168 flags: 42461943
10-09 05:41:24.990  4507  4535 D MAKS    : lookup composite op:1
src:537036936 flags: 42420863
10-09 05:41:24.990  4507  4535 D MAKS    : lookup composite op:1
src:537004168 flags: 42461943
10-09 05:41:25.000  4507  4535 D MAKS    : lookup composite op:1
src:537036936 flags: 42420863
10-09 05:41:25.000  4507  4535 D MAKS    : lookup composite op:1
src:537004168 flags: 42461943
10-09 05:41:25.470  4507  4535 D MAKS    : lookup composite op:1
src:537004168 flags: 42429183

repeated (alot) though I'm not sure if thats helpful and I wasn't sure
if I could use the out_func function pointer to figure out which
function was being returned?

I hoping that based on this, someone could give me further pointers on
where i can look to figure out why the sse2 optimised function is not
getting called?

thanks,
Maks.

On Mon, Oct 7, 2013 at 10:28 PM, Maksim Lin <maks at manichord.com> wrote:
> Hi
>
> Sorry I should have mentioned that after applying the patch, I compiled
> fennec for x86 and am testing on a sandybridge i5 PC, running android-x86
> (built from src from android-x86.org).
>
> Thanks,
> Maks.
>
> On 7 Oct 2013 16:07, "xunxun" <xunxun1982 at gmail.com> wrote:
>>
>> 于 2013/10/7 星期一 13:00, Maksim Lin 写道:
>>>
>>> Thanks xunxun!
>>> that was very helpful and let me get Siarhei's patch to compile with a
>>> recent snapshot of the code from mozilla-central repo.
>>>
>>> I've updated the bug report with my results:
>>> https://bugzilla.mozilla.org/show_bug.cgi?id=911882#c25
>>>
>>> but basically they are that I don't see any improvement in watch the
>>> automated slideshow
>>
>> Can you try the patch on x86 platform?
>>>
>>> (the one the runs after a few seconds with no
>>> interaction from user) with my test content though I think this is
>>> most likely due to me doing something wrong in modifying the patch to
>>> compile with the 20.2 version of pixman that you ported into firefox
>>> with your patch.
>>>
>>> I posted my code to the bug report if case some one would have any
>>> ideas on where I could have gone wrong.
>>>
>>> thanks,
>>> Maks.
>>>
>>> On Thu, Oct 3, 2013 at 5:17 PM, xunxun <xunxun1982 at gmail.com> wrote:
>>>>
>>>> On Thu, Oct 3, 2013 at 1:14 PM, Maksim Lin <maks at manichord.com> wrote:
>>>>>
>>>>>
>>>> I have posted a pixman update to 0.30.2 patch.
>>>> https://bugzilla.mozilla.org/show_bug.cgi?id=870258
>>>>
>>>> You can try the patch first, and then use the latest one.
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> xunxun
>>
>>
>>
>> --
>> Best Regards,
>> xunxun


More information about the Pixman mailing list