From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Gorinov Date: Wed, 14 Mar 2018 11:29:48 -0700 Subject: [U-Boot] efi_loader: Allow width smaller than buffer stride in efi_gop Blt() In-Reply-To: <246c6d31-2b29-85e7-0324-ad9bb799af3a@gmx.de> References: <20180314033112.GA23386@intel.com> <246c6d31-2b29-85e7-0324-ad9bb799af3a@gmx.de> Message-ID: <1521052188.38672.57.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de 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.