Re: [spice-server PATCH v1 4/12] mjpeg_encoder: fix alignment warnings (pixel_converter)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 
> > Hi,
> > 
> > On Wed, Aug 12, 2015 at 01:45:52PM +0200, Christophe Fergeau wrote:
> > > On Wed, Aug 12, 2015 at 07:01:40AM -0400, Frediano Ziglio wrote:
> > > > Not sure about it. Lines came from spice_bitmap_get_line. This
> > > > function assume that bitmap data is split among chunks each containing
> > > > some lines (always full lines). If chunk->data is allocated using
> > > > malloc or similar SHOULD (not 100% sure) be 4 bytes aligned so in our
> > > > cases (8, 16, 24 or 32 bit images) should be aligned enough.
> > > >
> > > > All the casts unfortunately came from the fact we compute based on
> > > > pixel bytes to make it generic so we use uint8_t* but clang complaints
> > > > (well, that's why there are explicit casts, to make compiler aware we
> > > > know we are doing the right thing).
> > >
> > > Ah well, I mixed src_ptr and dest when taking a look ;) dest is
> > > definitely not aligned, but only byte accesses are done on it so it does
> > > not matter.
> > > All of your explanation belongs in the commit log though, so that we
> > > remember what was our reasoning at the time if this turns out to be a
> > > problem in the future.
> > 
> > Sure, I can put Frediano's explanation on the commit log. I'm trying to
> > figure out a few things unrelated to this series but I'll resend it
> > again soon.
> > 
> > Thanks for taking time to review it,
> >   toso
> > 
> > >
> > > Christophe
> > 
> > 
> 
> There is still one missing thing to check, that chunk->data is correctly
> aligned!
> 

Looking at code looks like these chunks came from the virtual machine.
So the question is... why should the virtual machine give use some
not-pixel align data?
I would put a large comment to state that we assume VM send aligned data,
would be stupid for the VM to not align it!

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]