public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg: Add missing sourceX for Blt
@ 2019-09-16 14:21 Gris87
  2019-09-16 20:57 ` Ni, Ray
  0 siblings, 1 reply; 4+ messages in thread
From: Gris87 @ 2019-09-16 14:21 UTC (permalink / raw)
  To: devel; +Cc: Gris87, Ruiyu Ni

There is no sourceX offset in case when
Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor.
We are copying most left pixels instead of copying required rectangle.

Signed-off-by: Gris87 <Gris87@yandex.ru>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
---
 MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
index 47c5326e99..ff7979c962 100644
--- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
+++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
@@ -504,7 +504,7 @@ FrameBufferBltLibBufferToVideo (
     Destination = Configure->FrameBuffer + Offset;
 
     if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
-      Source = (UINT8 *) BltBuffer + (SrcY * Delta);
+      Source = (UINT8 *) BltBuffer + (SrcY * Delta) + SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
     } else {
       for (IndexX = 0; IndexX < Width; IndexX++) {
         Blt =
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdeModulePkg: Add missing sourceX for Blt
  2019-09-16 14:21 [PATCH] MdeModulePkg: Add missing sourceX for Blt Gris87
@ 2019-09-16 20:57 ` Ni, Ray
  2019-09-17  6:59   ` Gao, Zhichao
  0 siblings, 1 reply; 4+ messages in thread
From: Ni, Ray @ 2019-09-16 20:57 UTC (permalink / raw)
  To: Gao, Zhichao; +Cc: Gris87, devel@edk2.groups.io

+ Zhichao for review.

> -----Original Message-----
> From: Gris87 <Gris87@yandex.ru>
> Sent: Monday, September 16, 2019 7:22 AM
> To: devel@edk2.groups.io
> Cc: Gris87 <Gris87@yandex.ru>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] MdeModulePkg: Add missing sourceX for Blt
> 
> There is no sourceX offset in case when
> Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor.
> We are copying most left pixels instead of copying required rectangle.
> 
> Signed-off-by: Gris87 <Gris87@yandex.ru>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> ---
>  MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> index 47c5326e99..ff7979c962 100644
> --- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> +++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> @@ -504,7 +504,7 @@ FrameBufferBltLibBufferToVideo (
>      Destination = Configure->FrameBuffer + Offset;
> 
>      if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
> -      Source = (UINT8 *) BltBuffer + (SrcY * Delta);
> +      Source = (UINT8 *) BltBuffer + (SrcY * Delta) + SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
>      } else {
>        for (IndexX = 0; IndexX < Width; IndexX++) {
>          Blt =
> --
> 2.19.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdeModulePkg: Add missing sourceX for Blt
  2019-09-16 20:57 ` Ni, Ray
@ 2019-09-17  6:59   ` Gao, Zhichao
  2019-09-25  4:44     ` [edk2-devel] " Wu, Hao A
  0 siblings, 1 reply; 4+ messages in thread
From: Gao, Zhichao @ 2019-09-17  6:59 UTC (permalink / raw)
  To: Ni, Ray; +Cc: Gris87, devel@edk2.groups.io

It is a bug in the blt interface. I have tested it with OvmfPkgX64.
Here is the simple test step:
1. Change BootLogoLib.c line 213:
        Status = GraphicsOutput->Blt (
                                   GraphicsOutput,
                                   Blt,
                                   EfiBltBufferToVideo,
                                   0,
                                   0,
                                   (UINTN) DestX,
                                   (UINTN) DestY,
                                   Image.Width,
                                   Image.Height,
                                   Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
                                   );
==>
        Status = GraphicsOutput->Blt (
                                   GraphicsOutput,
                                   Blt,
                                   EfiBltBufferToVideo,
                                   20,
                                   20,
                                   (UINTN) DestX,
                                   (UINTN) DestY,
                                   Image.Width - 20,
                                   Image.Height - 20,
                                   Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
                                   );
2. build OvmfpkgX64 image and boot thru Qemu.
3. view the logo.
The logo shows incorrect. It should show at the (20, 20), but the result is (0, 20).
Apply this patch, then the result is expected, i.e. it showed at (20, 20) of the logo.bmp.

Tested-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>

> -----Original Message-----
> From: Ni, Ray
> Sent: Tuesday, September 17, 2019 4:57 AM
> To: Gao, Zhichao <zhichao.gao@intel.com>
> Cc: Gris87 <Gris87@yandex.ru>; devel@edk2.groups.io
> Subject: RE: [PATCH] MdeModulePkg: Add missing sourceX for Blt
> 
> + Zhichao for review.
> 
> > -----Original Message-----
> > From: Gris87 <Gris87@yandex.ru>
> > Sent: Monday, September 16, 2019 7:22 AM
> > To: devel@edk2.groups.io
> > Cc: Gris87 <Gris87@yandex.ru>; Ni, Ray <ray.ni@intel.com>
> > Subject: [PATCH] MdeModulePkg: Add missing sourceX for Blt
> >
> > There is no sourceX offset in case when
> > Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor.
> > We are copying most left pixels instead of copying required rectangle.
> >
> > Signed-off-by: Gris87 <Gris87@yandex.ru>
> > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > ---
> >  MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > index 47c5326e99..ff7979c962 100644
> > --- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > +++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > @@ -504,7 +504,7 @@ FrameBufferBltLibBufferToVideo (
> >      Destination = Configure->FrameBuffer + Offset;
> >
> >      if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor)
> {
> > -      Source = (UINT8 *) BltBuffer + (SrcY * Delta);
> > +      Source = (UINT8 *) BltBuffer + (SrcY * Delta) + SourceX * sizeof
> (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> >      } else {
> >        for (IndexX = 0; IndexX < Width; IndexX++) {
> >          Blt =
> > --
> > 2.19.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH] MdeModulePkg: Add missing sourceX for Blt
  2019-09-17  6:59   ` Gao, Zhichao
@ 2019-09-25  4:44     ` Wu, Hao A
  0 siblings, 0 replies; 4+ messages in thread
From: Wu, Hao A @ 2019-09-25  4:44 UTC (permalink / raw)
  To: devel@edk2.groups.io, Gao, Zhichao, Ni, Ray; +Cc: Gris87

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Gao, Zhichao
> Sent: Tuesday, September 17, 2019 3:00 PM
> To: Ni, Ray
> Cc: Gris87; devel@edk2.groups.io
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg: Add missing sourceX for
> Blt
> 
> It is a bug in the blt interface. I have tested it with OvmfPkgX64.
> Here is the simple test step:
> 1. Change BootLogoLib.c line 213:
>         Status = GraphicsOutput->Blt (
>                                    GraphicsOutput,
>                                    Blt,
>                                    EfiBltBufferToVideo,
>                                    0,
>                                    0,
>                                    (UINTN) DestX,
>                                    (UINTN) DestY,
>                                    Image.Width,
>                                    Image.Height,
>                                    Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
>                                    );
> ==>
>         Status = GraphicsOutput->Blt (
>                                    GraphicsOutput,
>                                    Blt,
>                                    EfiBltBufferToVideo,
>                                    20,
>                                    20,
>                                    (UINTN) DestX,
>                                    (UINTN) DestY,
>                                    Image.Width - 20,
>                                    Image.Height - 20,
>                                    Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
>                                    );
> 2. build OvmfpkgX64 image and boot thru Qemu.
> 3. view the logo.
> The logo shows incorrect. It should show at the (20, 20), but the result is (0,
> 20).
> Apply this patch, then the result is expected, i.e. it showed at (20, 20) of the
> logo.bmp.
> 
> Tested-by: Zhichao Gao <zhichao.gao@intel.com>
> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>


The patch has been pushed via commit 96301aadc1.

Best Regards,
Hao Wu


> 
> > -----Original Message-----
> > From: Ni, Ray
> > Sent: Tuesday, September 17, 2019 4:57 AM
> > To: Gao, Zhichao <zhichao.gao@intel.com>
> > Cc: Gris87 <Gris87@yandex.ru>; devel@edk2.groups.io
> > Subject: RE: [PATCH] MdeModulePkg: Add missing sourceX for Blt
> >
> > + Zhichao for review.
> >
> > > -----Original Message-----
> > > From: Gris87 <Gris87@yandex.ru>
> > > Sent: Monday, September 16, 2019 7:22 AM
> > > To: devel@edk2.groups.io
> > > Cc: Gris87 <Gris87@yandex.ru>; Ni, Ray <ray.ni@intel.com>
> > > Subject: [PATCH] MdeModulePkg: Add missing sourceX for Blt
> > >
> > > There is no sourceX offset in case when
> > > Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor.
> > > We are copying most left pixels instead of copying required rectangle.
> > >
> > > Signed-off-by: Gris87 <Gris87@yandex.ru>
> > > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > > ---
> > >  MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git
> a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > > b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > > index 47c5326e99..ff7979c962 100644
> > > --- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > > +++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
> > > @@ -504,7 +504,7 @@ FrameBufferBltLibBufferToVideo (
> > >      Destination = Configure->FrameBuffer + Offset;
> > >
> > >      if (Configure->PixelFormat ==
> PixelBlueGreenRedReserved8BitPerColor)
> > {
> > > -      Source = (UINT8 *) BltBuffer + (SrcY * Delta);
> > > +      Source = (UINT8 *) BltBuffer + (SrcY * Delta) + SourceX * sizeof
> > (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> > >      } else {
> > >        for (IndexX = 0; IndexX < Width; IndexX++) {
> > >          Blt =
> > > --
> > > 2.19.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-25  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-16 14:21 [PATCH] MdeModulePkg: Add missing sourceX for Blt Gris87
2019-09-16 20:57 ` Ni, Ray
2019-09-17  6:59   ` Gao, Zhichao
2019-09-25  4:44     ` [edk2-devel] " Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox