Comment 18 for bug 1842194

Revision history for this message
geppo61 (icjtqr-gmail) wrote : Re: [Bug 1842194] Re: Wrong colors in eeschema objects with kicad 5.1 on PPC64

First question:
common/gal/color4d.cpp
method: LegacyMix( COLOR4D aColor)
candidate.r = ( (unsigned)( 255.0 * r ) | (unsigned)( 255.0 * aColor.r ) )
/ 255.0,
...

I do not know the logics behind this calculation to have a such OR, but are
those values stored in a fixed endianness way? I see NO shift, so I am
supposing the values of that r or aColor.r are fixed in a word aligned way.
Can be cause the issue in Big Endian systems? Little endian: RGBA
BigEndian: ABGR

EDA_COLOR_T COLOR4D::GetNearestLegacyColor( const COLOR4D &aColor )
unsigned int colorInt = aColor.ToU32();

Is this function ToU32 endianness aware?

Other file:
common/gal/cairo/cairo_compositor.cpp

unsigned int CAIRO_COMPOSITOR::CreateBuffer()

cairo_image_surface_create_for_data( ... ) has the CAIRO_FORMAT_ARGB32
format. Can someone confirm it is working in a big endian environment? Or
even better: what software I can use to check out this behaviour in Ubuntu
16.04 LTS?

same issue on the Resize() function:
cairo_format_stride_for_width( CAIRO_FORMAT_ARGB32 )

Other file:
common/cairo/cario_gal.cpp

void CAIRO_GAL::endDrawing()

pixman_image_create_bits( PIXMAN_r8g8b8...) Is this format workable in a
big endian system?

Please if someone can drive me on what can be changed for working on PPC
BE, please write it here.
So I can recompile the 5.1.4 and retry again the eeschema,

Thanks,
Gianluca

On Thu, Sep 12, 2019 at 8:32 PM Gianluca Renzi <email address hidden> wrote:

> On Thu, Sep 12, 2019 at 7:50 PM Seth Hillbrand <
> <email address hidden>> wrote:
>
>> @geppo61-
>>
>> You can assign yourself as the owner of this bug at the top under
>> "Assigned To" and set the status to "In Progress" if you are working on
>> it.
>>
>> Here is a good getting started document:
>> http://kicad-pcb.org/contribute/developers/
>>
>> You can also join the developer's mailing list
>> https://launchpad.net/~kicad-developers
>>
>> As the professional EDA userbase for PPC64 is extremely small, fixing
>> this bug will require someone such as yourself to craft, test and submit
>> a patch that fixes the coloring issue. You should feel free to ask
>> questions on the mailing list about the technical details of the KiCad
>> project as you begin to work on this.
>>
>>
> I had already committed a patch for build Kicad 5.x and 6.x for ppc, so
> far I know how to build a patch. ;-P
>
>
>
>> For reference, the Graphics Abstraction Layer (GAL) is where you will
>> want to look. This is in /common/gal and /include/gal in the codebase.
>>
>>
> So GAL stuff has all the drawing primitives to build up a Cairo Canvas?
>
> I just looked at the diff between 5.0 and 5.1 and there are huge
> differences... It will be a very long night...
>
>
>
>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1842194
>>
>> Title:
>> Wrong colors in eeschema objects with kicad 5.1 on PPC64
>>
>> Status in KiCad:
>> Incomplete
>>
>> Bug description:
>> Building from source 5.1 or downloading from ppa:js-reynaud/kicad-5.1
>> when opening a schematics with eeschema the output of the object colors is
>> completely reversed. It seems a bigendian/littleendian wrong or missing
>> conversion. RGB to BGR. The Blue is Red, the Red is Blue and the green is
>> Ok. All other colors in between are messy. Only eeschema to my knowledge.
>> pcbnew seems to work ok
>> Other stuff I do not tested yet.
>> Jean-Samuel Reynaud knows the issue.
>>
>> Application: KiCad
>> Version: 5.1.4, release build
>> Libraries:
>> wxWidgets 3.1
>> libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.11 libidn/1.32 librtmp/2.3
>> Platform: Linux 4.4.0-159-powerpc64-smp ppc64, 64 bit, Big endian, wxGTK
>> Build Info:
>> wxWidgets: 3.1.0 (wchar_t,wx containers) GTK+ 2.24
>> Boost: 1.58.0
>> OpenCASCADE Community Edition: 6.8.0
>> Curl: 7.47.0
>> Compiler: GCC 6.3.0 with C++ ABI 1010
>>
>> Build settings:
>> USE_WX_GRAPHICS_CONTEXT=OFF
>> USE_WX_OVERLAY=OFF
>> KICAD_SCRIPTING=ON
>> KICAD_SCRIPTING_MODULES=ON
>> KICAD_SCRIPTING_PYTHON3=OFF
>> KICAD_SCRIPTING_WXPYTHON=ON
>> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
>> KICAD_SCRIPTING_ACTION_MENU=ON
>> BUILD_GITHUB_PLUGIN=ON
>> KICAD_USE_OCE=ON
>> KICAD_USE_OCC=OFF
>> KICAD_SPICE=ON
>>
>> Version 5.0.2 build from source has no color issue.
>>
>> Application: kicad
>> Version: (5.0.2-25-g24ab814-dirty), release build
>> Libraries:
>> wxWidgets 3.0.2
>> libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.11 libidn/1.32 librtmp/2.3
>> Platform: Linux 4.4.0-159-powerpc64-smp ppc64, 64 bit, Big endian, wxGTK
>> Build Info:
>> wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+
>> 2.24
>> Boost: 1.58.0
>> OpenCASCADE Community Edition: 6.8.0
>> Curl: 7.47.0
>> Compiler: GCC 6.3.0 with C++ ABI 1010
>>
>> Build settings:
>> USE_WX_GRAPHICS_CONTEXT=OFF
>> USE_WX_OVERLAY=OFF
>> KICAD_SCRIPTING=ON
>> KICAD_SCRIPTING_MODULES=ON
>> KICAD_SCRIPTING_WXPYTHON=ON
>> KICAD_SCRIPTING_ACTION_MENU=ON
>> BUILD_GITHUB_PLUGIN=ON
>> KICAD_USE_OCE=ON
>> KICAD_USE_OCC=OFF
>> KICAD_SPICE=ON
>>
>> wxWidget 3.0 or 3.1 is not a problem, because using the compiled
>> version from PPA I have the same issue.
>>
>> Application: KiCad
>> Version: 5.1.4-e60b266~84~ubuntu16.04.1, release build
>> Libraries:
>> wxWidgets 3.0.2
>> libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.11 libidn/1.32 librtmp/2.3
>> Platform: Linux 4.4.0-159-powerpc64-smp ppc64, 64 bit, Big endian, wxGTK
>> Build Info:
>> wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+
>> 2.24
>> Boost: 1.58.0
>> OpenCASCADE Community Edition: 6.8.0
>> Curl: 7.47.0
>> Compiler: GCC 5.4.0 with C++ ABI 1009
>>
>> Build settings:
>> USE_WX_GRAPHICS_CONTEXT=OFF
>> USE_WX_OVERLAY=OFF
>> KICAD_SCRIPTING=ON
>> KICAD_SCRIPTING_MODULES=ON
>> KICAD_SCRIPTING_PYTHON3=OFF
>> KICAD_SCRIPTING_WXPYTHON=ON
>> KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
>> KICAD_SCRIPTING_ACTION_MENU=ON
>> BUILD_GITHUB_PLUGIN=ON
>> KICAD_USE_OCE=ON
>> KICAD_USE_OCC=OFF
>> KICAD_SPICE=ON
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/kicad/+bug/1842194/+subscriptions
>>
>
>
> --
> Ciao e buona giornata.
>
> "GP! In mezzo al campo stai proprio schifoso!"
> Coach M.Russo
>

--
Ciao e buona giornata.

"GP! In mezzo al campo stai proprio schifoso!"
Coach M.Russo