Hi, Yes, that's a good point. If dfb_convert_to_rgbxxx() can take care of more palette formats, it's much better to concern the palette formats before invoking it. But now only update_screen invokes this function for X11 backend. And I add this patch for the test application df_fire. You can see the related code bellow in the upstream's code, it's doing the same thing. case 16: if (surface->config.format == DSPF_LUT8) { int width = rect.w; int height = rect.h; const u8 *src8 = src; u16 *dst16 = dst; CorePalette *palette = surface->palette; int x; while (height--) {
for (x=0; x<width; x++) { DFBColor color = palette->entries[src8[x]]; dst16[x] = PIXEL_RGB16( color.r, color.g, color.b ); } src8 += lock->pitch; dst16 += ximage->bytes_per_line / 2; } } else { dfb_convert_to_rgb16( surface->config.format, src, lock->pitch, surface->config.size.h, dst, ximage->bytes_per_line, rect.w, rect.h ); } break; ----------- *^_^* Many thanks & Best Regards Zhao Juan -----Original Message----- From: directfb-dev-boun...@directfb.org [mailto:directfb-dev-boun...@directfb.org] On Behalf Of Andre DRASZIK Sent: Tuesday, April 06, 2010 11:11 PM To: directfb-dev Subject: Re: [directfb-dev] [PATCH] Fix LUT8 convert to rgb32 error Hi, On Fri, 2010-04-02 at 09:04 +0800, Zhao, Juan J wrote: > No. It is much better to resolve it upper. Better, I am not sure, probably easier - yes :-) > Because if we want to fix dfb_convert_to rgb32(), we need to add one > interface to it to tell it "palette" information. And if we do this, not only > dfb_convert_to_rgb32, but also other dfb_convert_to_xxxx should do this. Yes, and if such a change was made, all code that uses dfb_convert_to_rgb32() etc. can automatically profit from that change. Otherwise, each and every place would probably need a fix similar to your patch... Now, I am not sure how many other places there are that use dfb_convert_to_rgbXX() and if it matters for these cases. Indeed having it in the x11 system module would help to not increase the DirectFB library size if you don't care about LUT8 of course. Btw, what about the other palette formats, I assume they would need similar treatment? It was just a thought... Cheers, Andre' > ----------- > *^_^* > Many thanks & Best Regards > Zhao Juan > > -----Original Message----- > From: directfb-dev-boun...@directfb.org > [mailto:directfb-dev-boun...@directfb.org] On Behalf Of Andre DRASZIK > Sent: Thursday, April 01, 2010 10:53 PM > To: directfb-dev > Subject: Re: [directfb-dev] [PATCH] Fix LUT8 convert to rgb32 error > > Hi, > > shouldn't dfb_convert_to_rgb32() be fixed instead? > > Cheers, > Andre' > > > On Thu, 2010-03-25 at 13:34 +0800, Zhao, Juan J wrote: > > Attached is a patch for DirectFB based on tip commit: > > 3a9360cb003f605be22134b54eeeee1858d727bd. > > DSPF_LUT8 pixel format is not correctly handling in update_screen in > > system/x11/primary.c. And this caused error message "[unsupported > > format]***[convert.c:987 in dfb_convert_to_rgb32()]" when running demos > > such as df_fire. > > > > ---- > > *^_^* > > Many thanks & Best Regards > > Juan Zhao > > _______________________________________________ > > directfb-dev mailing list > > directfb-dev@directfb.org > > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev > > > _______________________________________________ > directfb-dev mailing list > directfb-dev@directfb.org > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev > _______________________________________________ > directfb-dev mailing list > directfb-dev@directfb.org > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev