Эх сурвалжийг харах

video: driver: fix roi metadata size calculation

lcu_size shouldn't be changed by shift op, it is still
needed in alignment calculation.

Change-Id: I3c0ebfaee84389926ba3e191d901006065598182
Signed-off-by: Jiajia Cong <[email protected]>
Jiajia Cong 1 жил өмнө
parent
commit
d9fe02d49a

+ 4 - 3
driver/variant/iris2/inc/hfi_buffer_iris2.h

@@ -892,10 +892,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define SIZE_ROI_METADATA_ENC(size_roi, frame_width, frame_height, lcu_size)\
 	do { \
 		HFI_U32 width_in_lcus = 0, height_in_lcus = 0, n_shift = 0;    \
-		while (lcu_size && !(lcu_size & 0x1)) { \
+		HFI_U32 n_lcu_size = lcu_size;              \
+		while (n_lcu_size && !(n_lcu_size & 0x1)) { \
 			n_shift++;                          \
-			lcu_size = lcu_size >> 1;          \
-		}                                      \
+			n_lcu_size = n_lcu_size >> 1;       \
+		}                                           \
 		width_in_lcus = (frame_width + (lcu_size - 1)) >> n_shift; \
 		height_in_lcus = (frame_height + (lcu_size - 1)) >> n_shift;  \
 		size_roi = (((width_in_lcus + 7) >> 3) << 3) * \

+ 4 - 3
driver/variant/iris3/inc/hfi_buffer_iris3.h

@@ -1222,10 +1222,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define SIZE_ROI_METADATA_ENC(size_roi, frame_width, frame_height, lcu_size)\
 	do { \
 		HFI_U32 width_in_lcus = 0, height_in_lcus = 0, n_shift = 0;    \
-		while (lcu_size && !(lcu_size & 0x1)) { \
+		HFI_U32 n_lcu_size = lcu_size;              \
+		while (n_lcu_size && !(n_lcu_size & 0x1)) { \
 			n_shift++;                          \
-			lcu_size = lcu_size >> 1;          \
-		}                                      \
+			n_lcu_size = n_lcu_size >> 1;       \
+		}                                           \
 		width_in_lcus = (frame_width + (lcu_size - 1)) >> n_shift; \
 		height_in_lcus = (frame_height + (lcu_size - 1)) >> n_shift;  \
 		size_roi = (((width_in_lcus + 7) >> 3) << 3) * \

+ 4 - 3
driver/variant/iris33/inc/hfi_buffer_iris33.h

@@ -1222,10 +1222,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define SIZE_ROI_METADATA_ENC(size_roi, frame_width, frame_height, lcu_size)\
 	do { \
 		HFI_U32 width_in_lcus = 0, height_in_lcus = 0, n_shift = 0;    \
-		while (lcu_size && !(lcu_size & 0x1)) { \
+		HFI_U32 n_lcu_size = lcu_size;              \
+		while (n_lcu_size && !(n_lcu_size & 0x1)) { \
 			n_shift++;                          \
-			lcu_size = lcu_size >> 1;          \
-		}                                      \
+			n_lcu_size = n_lcu_size >> 1;       \
+		}                                           \
 		width_in_lcus = (frame_width + (lcu_size - 1)) >> n_shift; \
 		height_in_lcus = (frame_height + (lcu_size - 1)) >> n_shift;  \
 		size_roi = (((width_in_lcus + 7) >> 3) << 3) * \