hardware: samsung_slsi: libcamera2: support wb exif info

This patch is to fix a bug that whitebalance info of EXIF
is not proper. Handling AE and AWB lock are changed due to
these parameter were separated from AE and AWB mode

Change-Id: Id5c906fb80e714813531de78238196e3e97bfee9
Signed-off-by: Younghwan Joo <yhwan.joo@samsung.com>
diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp
index cbde870..c9b93f0 100644
--- a/libcamera2/ExynosCameraHWInterface2.cpp
+++ b/libcamera2/ExynosCameraHWInterface2.cpp
@@ -618,7 +618,7 @@
     CheckCompleted(i);
 }
 
-void    RequestManager::UpdateIspParameters(struct camera2_shot_ext *shot_ext, int frameCnt)
+void    RequestManager::UpdateIspParameters(struct camera2_shot_ext *shot_ext, int frameCnt, ctl_request_info_t *ctl_info)
 {
     int index, targetStreamIndex;
     struct camera2_shot_ext * request_shot;
@@ -654,6 +654,23 @@
     shot_ext->shot.ctl.scaler.cropRegion[1] = request_shot->shot.ctl.scaler.cropRegion[1];
     shot_ext->shot.ctl.scaler.cropRegion[2] = request_shot->shot.ctl.scaler.cropRegion[2];
 
+    // mapping flash UI mode from aeMode
+    if (request_shot->shot.ctl.aa.aeMode >= AA_AEMODE_ON) {
+        ctl_info->flash.i_flashMode = request_shot->shot.ctl.aa.aeMode;
+        request_shot->shot.ctl.aa.aeMode = AA_AEMODE_ON;
+    }
+    // mapping awb UI mode form awbMode
+    ctl_info->awb.i_awbMode = request_shot->shot.ctl.aa.awbMode;
+
+    // Apply ae/awb lock or unlock
+    if ((request_shot->ae_lock == AEMODE_LOCK_ON)) {
+        request_shot->shot.ctl.aa.aeMode = AA_AEMODE_LOCKED;
+    }
+
+    if ((request_shot->awb_lock == AWBMODE_LOCK_ON)) {
+        request_shot->shot.ctl.aa.awbMode = AA_AWBMODE_LOCKED;
+    }
+
     if (m_lastAaMode == request_shot->shot.ctl.aa.mode) {
         shot_ext->shot.ctl.aa.mode = (enum aa_mode)(0);
     }
@@ -2833,7 +2850,7 @@
         if (matchedFrameCnt != -1) {
             frameTime = systemTime();
             m_requestManager->RegisterTimestamp(matchedFrameCnt, &frameTime);
-            m_requestManager->UpdateIspParameters(shot_ext, matchedFrameCnt);
+            m_requestManager->UpdateIspParameters(shot_ext, matchedFrameCnt, &m_ctlInfo);
 
             // Mapping Flash UI mode from aeMode
             if (shot_ext->shot.ctl.aa.aeMode >= AA_AEMODE_ON) {
@@ -5267,7 +5284,7 @@
         exifInfo->flash = EXIF_DEF_FLASH;
 
     //3 White Balance
-    if (dm->aa.awbMode == AA_AWBMODE_WB_AUTO)
+    if (m_ctlInfo.awb.i_awbMode == AA_AWBMODE_WB_AUTO)
         exifInfo->white_balance = EXIF_WB_AUTO;
     else
         exifInfo->white_balance = EXIF_WB_MANUAL;