[U-Boot] efi_loader: Allow width smaller than buffer stride in efi_gop Blt()

Ivan Gorinov ivan.gorinov at intel.com
Wed Mar 14 18:29:48 UTC 2018


On Wed, 2018-03-14 at 18:21 +0100, Heinrich Schuchardt wrote:

@@ -87,7 +93,7 @@ efi_status_t EFIAPI gop_blt(struct efi_gop *this, void
> > *buffer,
> >  		for (i = 0; i < height; i++) {
> >  			u32 *dest = fb + ((i + dy)  * line_len32) +
> >  					 (dx * sizeof(u32));
> > -			u32 *src = buffer + ((i + sy)  * line_len32) +
> > +			u32 *src = buffer + ((i + sy) * buffer_stride) +
> >  					 (sx * sizeof(u32));
> >  
> >  			/* Same color format, just memcpy */
> > @@ -102,7 +108,7 @@ efi_status_t EFIAPI gop_blt(struct efi_gop *this, void
> > *buffer,
> >  		for (i = 0; i < height; i++) {
> >  			u16 *dest = fb + ((i + dy)  * line_len16) +
> >  					 (dx * sizeof(u16));
> > -			u32 *src = buffer + ((i + sy)  * line_len32) +
> > +			u32 *src = buffer + ((i + sy) * buffer_stride) +
> If delta cannot be divided by 4 a misaligned access error will occur on
> arm64.

This is unlikely because EFI spec allows only 32-bit pixel data in BLT buffer,
regardless of actual video frame buffer pixel format.



More information about the U-Boot mailing list