[Spice-devel] [PATCH spice-common] canvas-base: Do not attempt useless cast on stride adjustment

Frediano Ziglio fziglio at redhat.com
Wed Jun 21 12:19:42 UTC 2017


> 
> On 06/21/2017 10:41 AM, Christophe Fergeau wrote:
> > On Tue, Jun 20, 2017 at 08:39:44PM +0300, Uri Lublin wrote:
> >> On 06/20/2017 04:52 PM, Frediano Ziglio wrote:
> >>> memmove already deal with any alignment so there's no
> >>> reason to have row byte pointer cast to uint32_t.
> >>
> >> Hi Frediano,
> >>
> >> I think the code has no problem with memmove itself, but
> >> with the pointer used later being not-aligned (but only for
> >> non-x86 arch ?).
> > 
> > "later" ? The only uses of dest_aligned/dest_misaligned in this function
> > are as args to memmove, for which alignment does not matter.
> 
> With "later" I meant the callers of canvas_fix_alignment, and
> likely "later" pixman.
> The image is going to get accessed by pixman that probably
> expects rows to be aligned, which is why the bits are memmove'd.
> 
> SPICE_ALIGNED_CAST can verify (if configured for it) that the
> pointer is indeed aligned.
> 
> Uri.
> 

The image is allocated by pixman itself in the way pixman want it.
The code is there to fix alignment from network which has no padding
for rows.

Frediano


More information about the Spice-devel mailing list