public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
@ 2016-12-05  1:56 Ruiyu Ni
  2016-12-06 11:17 ` Wang, Sunny (HPS SW)
  2016-12-07  0:52 ` Dong, Eric
  0 siblings, 2 replies; 3+ messages in thread
From: Ruiyu Ni @ 2016-12-05  1:56 UTC (permalink / raw)
  To: edk2-devel; +Cc: Eric Dong, Chao B Zhang

PlatformBootManagerBeforeConsole() might want to display UI
and ReadKeyStroke() call from UI depends on this event
to connect ConIn so BdsDxe initializes this event before
PlatformBootManagerBeforeConsole().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 98b3931..b5e6ef6 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -874,6 +874,23 @@ BdsEntry (
     );
 
   //
+  // Initialize ConnectConIn event before calling platform code.
+  //
+  if (PcdGetBool (PcdConInConnectOnDemand)) {
+    Status = gBS->CreateEventEx (
+                    EVT_NOTIFY_SIGNAL,
+                    TPL_CALLBACK,
+                    BdsDxeOnConnectConInCallBack,
+                    NULL,
+                    &gConnectConInEventGuid,
+                    &gConnectConInEvent
+                    );
+    if (EFI_ERROR (Status)) {
+      gConnectConInEvent = NULL;
+    }
+  }
+
+  //
   // Do the platform init, can be customized by OEM/IBV
   // Possible things that can be done in PlatformBootManagerBeforeConsole:
   // > Update console variable: 1. include hot-plug devices; 2. Clear ConIn and add SOL for AMT
@@ -905,21 +922,9 @@ BdsEntry (
   if (PcdGetBool (PcdConInConnectOnDemand)) {
     EfiBootManagerConnectConsoleVariable (ConOut);
     EfiBootManagerConnectConsoleVariable (ErrOut);
-
     //
-    // Initialize ConnectConIn event
+    // Do not connect ConIn devices when lazy ConIn feature is ON.
     //
-    Status = gBS->CreateEventEx (
-                    EVT_NOTIFY_SIGNAL,
-                    TPL_CALLBACK,
-                    BdsDxeOnConnectConInCallBack,
-                    NULL,
-                    &gConnectConInEventGuid,
-                    &gConnectConInEvent
-                    );
-    if (EFI_ERROR (Status)) {
-      gConnectConInEvent = NULL;
-    }
   } else {
     EfiBootManagerConnectAllDefaultConsoles ();
   }
-- 
2.9.0.windows.1



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

* Re: [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
  2016-12-05  1:56 [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier Ruiyu Ni
@ 2016-12-06 11:17 ` Wang, Sunny (HPS SW)
  2016-12-07  0:52 ` Dong, Eric
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Sunny (HPS SW) @ 2016-12-06 11:17 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel@lists.01.org
  Cc: Eric Dong, Chao B Zhang, Wang, Sunny (HPS SW)

Looks good to me. 
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Monday, December 05, 2016 9:57 AM
To: edk2-devel@lists.01.org
Cc: Eric Dong <eric.dong@intel.com>; Chao B Zhang <chao.b.zhang@intel.com>
Subject: [edk2] [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier

PlatformBootManagerBeforeConsole() might want to display UI and ReadKeyStroke() call from UI depends on this event to connect ConIn so BdsDxe initializes this event before PlatformBootManagerBeforeConsole().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 98b3931..b5e6ef6 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -874,6 +874,23 @@ BdsEntry (
     );
 
   //
+  // Initialize ConnectConIn event before calling platform code.
+  //
+  if (PcdGetBool (PcdConInConnectOnDemand)) {
+    Status = gBS->CreateEventEx (
+                    EVT_NOTIFY_SIGNAL,
+                    TPL_CALLBACK,
+                    BdsDxeOnConnectConInCallBack,
+                    NULL,
+                    &gConnectConInEventGuid,
+                    &gConnectConInEvent
+                    );
+    if (EFI_ERROR (Status)) {
+      gConnectConInEvent = NULL;
+    }
+  }
+
+  //
   // Do the platform init, can be customized by OEM/IBV
   // Possible things that can be done in PlatformBootManagerBeforeConsole:
   // > Update console variable: 1. include hot-plug devices; 2. Clear ConIn and add SOL for AMT @@ -905,21 +922,9 @@ BdsEntry (
   if (PcdGetBool (PcdConInConnectOnDemand)) {
     EfiBootManagerConnectConsoleVariable (ConOut);
     EfiBootManagerConnectConsoleVariable (ErrOut);
-
     //
-    // Initialize ConnectConIn event
+    // Do not connect ConIn devices when lazy ConIn feature is ON.
     //
-    Status = gBS->CreateEventEx (
-                    EVT_NOTIFY_SIGNAL,
-                    TPL_CALLBACK,
-                    BdsDxeOnConnectConInCallBack,
-                    NULL,
-                    &gConnectConInEventGuid,
-                    &gConnectConInEvent
-                    );
-    if (EFI_ERROR (Status)) {
-      gConnectConInEvent = NULL;
-    }
   } else {
     EfiBootManagerConnectAllDefaultConsoles ();
   }
--
2.9.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
  2016-12-05  1:56 [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier Ruiyu Ni
  2016-12-06 11:17 ` Wang, Sunny (HPS SW)
@ 2016-12-07  0:52 ` Dong, Eric
  1 sibling, 0 replies; 3+ messages in thread
From: Dong, Eric @ 2016-12-07  0:52 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Zhang, Chao B

Reviewed-by: Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Monday, December 05, 2016 9:57 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Zhang, Chao B
> Subject: [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
> 
> PlatformBootManagerBeforeConsole() might want to display UI
> and ReadKeyStroke() call from UI depends on this event
> to connect ConIn so BdsDxe initializes this event before
> PlatformBootManagerBeforeConsole().
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Chao B Zhang <chao.b.zhang@intel.com>
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 98b3931..b5e6ef6 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -874,6 +874,23 @@ BdsEntry (
>      );
> 
>    //
> +  // Initialize ConnectConIn event before calling platform code.
> +  //
> +  if (PcdGetBool (PcdConInConnectOnDemand)) {
> +    Status = gBS->CreateEventEx (
> +                    EVT_NOTIFY_SIGNAL,
> +                    TPL_CALLBACK,
> +                    BdsDxeOnConnectConInCallBack,
> +                    NULL,
> +                    &gConnectConInEventGuid,
> +                    &gConnectConInEvent
> +                    );
> +    if (EFI_ERROR (Status)) {
> +      gConnectConInEvent = NULL;
> +    }
> +  }
> +
> +  //
>    // Do the platform init, can be customized by OEM/IBV
>    // Possible things that can be done in PlatformBootManagerBeforeConsole:
>    // > Update console variable: 1. include hot-plug devices; 2. Clear ConIn and add SOL for AMT
> @@ -905,21 +922,9 @@ BdsEntry (
>    if (PcdGetBool (PcdConInConnectOnDemand)) {
>      EfiBootManagerConnectConsoleVariable (ConOut);
>      EfiBootManagerConnectConsoleVariable (ErrOut);
> -
>      //
> -    // Initialize ConnectConIn event
> +    // Do not connect ConIn devices when lazy ConIn feature is ON.
>      //
> -    Status = gBS->CreateEventEx (
> -                    EVT_NOTIFY_SIGNAL,
> -                    TPL_CALLBACK,
> -                    BdsDxeOnConnectConInCallBack,
> -                    NULL,
> -                    &gConnectConInEventGuid,
> -                    &gConnectConInEvent
> -                    );
> -    if (EFI_ERROR (Status)) {
> -      gConnectConInEvent = NULL;
> -    }
>    } else {
>      EfiBootManagerConnectAllDefaultConsoles ();
>    }
> --
> 2.9.0.windows.1



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

end of thread, other threads:[~2016-12-07  0:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05  1:56 [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier Ruiyu Ni
2016-12-06 11:17 ` Wang, Sunny (HPS SW)
2016-12-07  0:52 ` Dong, Eric

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