]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SetupBrowserDxe: Do not reconnect driver with form-update
authorWalon Li <walon.li@hpe.com>
Wed, 20 May 2020 04:24:47 +0000 (12:24 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 10 Jun 2020 04:25:47 +0000 (04:25 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2701

Recording to the spec, the reconnect is activated upon exiting of the
formset or the browser. Exiting is by user but form-browser internal
logic. That means the reconnection is only happened when user press
ESC or _EXIT action to exit form.
Driver callback may update HII form dynamically so form-browser needs
to refresh its internal data. It's not exiting formset for user
exactly and they didn't know what happened. So use a flag to record
that and do not reconnect driver if updated by callback.

Signed-off-by: Walon Li <walon.li@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index bafee4c61292e574612b722e9d12adba610c6d75..7f85873730b7cb945a89098500803d11e5ff9582 100644 (file)
@@ -19,6 +19,7 @@ LIST_ENTRY         mRefreshEventList = INITIALIZE_LIST_HEAD_VARIABLE (mRefreshEv
 UINT16             mCurFakeQestId;\r
 FORM_DISPLAY_ENGINE_FORM gDisplayFormData;\r
 BOOLEAN            mFinishRetrieveCall = FALSE;\r
+BOOLEAN            mDynamicFormUpdated = FALSE;\r
 \r
 /**\r
   Check whether the ConfigAccess protocol is available.\r
@@ -1762,6 +1763,7 @@ FormUpdateNotify (
   )\r
 {\r
   mHiiPackageListUpdated = TRUE;\r
+  mDynamicFormUpdated = TRUE;\r
 \r
   return EFI_SUCCESS;\r
 }\r
index 82067b541c9dafc66e2a16f09ea5f7d24d3218ad..f936a4b8e8b667e2a3ce576eefac432516642b1a 100644 (file)
@@ -68,6 +68,7 @@ extern EFI_GUID        mCurrentFormSetGuid;
 extern EFI_HII_HANDLE  mCurrentHiiHandle;\r
 extern UINT16          mCurrentFormId;\r
 extern FORM_DISPLAY_ENGINE_FORM gDisplayFormData;\r
+extern BOOLEAN         mDynamicFormUpdated;\r
 \r
 /**\r
   Create a menu with specified formset GUID and form ID, and add it as a child\r
@@ -536,6 +537,7 @@ SendForm (
       }\r
       Selection->FormSet = FormSet;\r
       mSystemLevelFormSet = FormSet;\r
+      mDynamicFormUpdated = FALSE;\r
 \r
       //\r
       // Display this formset\r
@@ -547,7 +549,11 @@ SendForm (
       gCurrentSelection = NULL;\r
       mSystemLevelFormSet = NULL;\r
 \r
-      if (gFlagReconnect || gCallbackReconnect) {\r
+      //\r
+      // If callback update form dynamically, it's not exiting of the formset for user so system do not reconnect driver hanlde\r
+      // this time.\r
+      //\r
+      if (!mDynamicFormUpdated && (gFlagReconnect || gCallbackReconnect)) {\r
         RetVal = ReconnectController (FormSet->DriverHandle);\r
         if (!RetVal) {\r
           PopupErrorMessage(BROWSER_RECONNECT_FAIL, NULL, NULL, NULL);\r