[edk2] [Patch] BaseTools: Fix a bug for Mixed Pcd value display in the report

Yonghong Zhu posted 1 patch 7 years, 3 months ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/AutoGen/AutoGen.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
[edk2] [Patch] BaseTools: Fix a bug for Mixed Pcd value display in the report
Posted by Yonghong Zhu 7 years, 3 months ago
the case is that override the mixed pcd value in DSC [Components]
section, the value display in the report is incorrect.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index cd30894..8293672 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -2333,12 +2333,22 @@ class PlatformAutoGen(AutoGen):
 
         # override PCD settings with module specific setting
         if Module in self.Platform.Modules:
             PlatformModule = self.Platform.Modules[str(Module)]
             for Key  in PlatformModule.Pcds:
+                Flag = False
                 if Key in Pcds:
-                    self._OverridePcd(Pcds[Key], PlatformModule.Pcds[Key], Module)
+                    ToPcd = Pcds[Key]
+                    Flag = True
+                elif Key in GlobalData.MixedPcd:
+                    for PcdItem in GlobalData.MixedPcd[Key]:
+                        if PcdItem in Pcds:
+                            ToPcd = Pcds[PcdItem]
+                            Flag = True
+                            break
+                if Flag:
+                    self._OverridePcd(ToPcd, PlatformModule.Pcds[Key], Module)
         return Pcds.values()
 
     ## Resolve library names to library modules
     #
     # (for Edk.x modules)
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] BaseTools: Fix a bug for Mixed Pcd value display in the report
Posted by Gao, Liming 7 years, 3 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Sunday, September 10, 2017 4:26 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fix a bug for Mixed Pcd value display in the report
>
>the case is that override the mixed pcd value in DSC [Components]
>section, the value display in the report is incorrect.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index cd30894..8293672 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -2333,12 +2333,22 @@ class PlatformAutoGen(AutoGen):
>
>         # override PCD settings with module specific setting
>         if Module in self.Platform.Modules:
>             PlatformModule = self.Platform.Modules[str(Module)]
>             for Key  in PlatformModule.Pcds:
>+                Flag = False
>                 if Key in Pcds:
>-                    self._OverridePcd(Pcds[Key], PlatformModule.Pcds[Key], Module)
>+                    ToPcd = Pcds[Key]
>+                    Flag = True
>+                elif Key in GlobalData.MixedPcd:
>+                    for PcdItem in GlobalData.MixedPcd[Key]:
>+                        if PcdItem in Pcds:
>+                            ToPcd = Pcds[PcdItem]
>+                            Flag = True
>+                            break
>+                if Flag:
>+                    self._OverridePcd(ToPcd, PlatformModule.Pcds[Key], Module)
>         return Pcds.values()
>
>     ## Resolve library names to library modules
>     #
>     # (for Edk.x modules)
>--
>2.6.1.windows.1

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