@@ -102,6 +102,16 @@ static enum platform_inst_fw_cap_type iris_get_cap_id(u32 id)
102102 return PROFILE_AV1 ;
103103 case V4L2_CID_MPEG_VIDEO_AV1_LEVEL :
104104 return LEVEL_AV1 ;
105+ case V4L2_CID_ROTATE :
106+ return ROTATION ;
107+ case V4L2_CID_HFLIP :
108+ return HFLIP ;
109+ case V4L2_CID_VFLIP :
110+ return VFLIP ;
111+ case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE :
112+ return IR_TYPE ;
113+ case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD :
114+ return IR_PERIOD ;
105115 default :
106116 return INST_FW_CAP_MAX ;
107117 }
@@ -193,6 +203,16 @@ static u32 iris_get_v4l2_id(enum platform_inst_fw_cap_type cap_id)
193203 return V4L2_CID_MPEG_VIDEO_AV1_PROFILE ;
194204 case LEVEL_AV1 :
195205 return V4L2_CID_MPEG_VIDEO_AV1_LEVEL ;
206+ case ROTATION :
207+ return V4L2_CID_ROTATE ;
208+ case HFLIP :
209+ return V4L2_CID_HFLIP ;
210+ case VFLIP :
211+ return V4L2_CID_VFLIP ;
212+ case IR_TYPE :
213+ return V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE ;
214+ case IR_PERIOD :
215+ return V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD ;
196216 default :
197217 return 0 ;
198218 }
@@ -901,6 +921,81 @@ int iris_set_qp_range(struct iris_inst *inst, enum platform_inst_fw_cap_type cap
901921 & range , sizeof (range ));
902922}
903923
924+ int iris_set_rotation (struct iris_inst * inst , enum platform_inst_fw_cap_type cap_id )
925+ {
926+ const struct iris_hfi_command_ops * hfi_ops = inst -> core -> hfi_ops ;
927+ u32 hfi_id = inst -> fw_caps [cap_id ].hfi_id ;
928+ u32 hfi_val ;
929+
930+ switch (inst -> fw_caps [cap_id ].value ) {
931+ case 0 :
932+ hfi_val = HFI_ROTATION_NONE ;
933+ return 0 ;
934+ case 90 :
935+ hfi_val = HFI_ROTATION_90 ;
936+ break ;
937+ case 180 :
938+ hfi_val = HFI_ROTATION_180 ;
939+ break ;
940+ case 270 :
941+ hfi_val = HFI_ROTATION_270 ;
942+ break ;
943+ default :
944+ return - EINVAL ;
945+ }
946+
947+ return hfi_ops -> session_set_property (inst , hfi_id ,
948+ HFI_HOST_FLAGS_NONE ,
949+ iris_get_port_info (inst , cap_id ),
950+ HFI_PAYLOAD_U32 ,
951+ & hfi_val , sizeof (u32 ));
952+ }
953+
954+ int iris_set_flip (struct iris_inst * inst , enum platform_inst_fw_cap_type cap_id )
955+ {
956+ const struct iris_hfi_command_ops * hfi_ops = inst -> core -> hfi_ops ;
957+ u32 hfi_id = inst -> fw_caps [cap_id ].hfi_id ;
958+ u32 hfi_val = HFI_DISABLE_FLIP ;
959+
960+ if (inst -> fw_caps [HFLIP ].value )
961+ hfi_val |= HFI_HORIZONTAL_FLIP ;
962+
963+ if (inst -> fw_caps [VFLIP ].value )
964+ hfi_val |= HFI_VERTICAL_FLIP ;
965+
966+ return hfi_ops -> session_set_property (inst , hfi_id ,
967+ HFI_HOST_FLAGS_NONE ,
968+ iris_get_port_info (inst , cap_id ),
969+ HFI_PAYLOAD_U32_ENUM ,
970+ & hfi_val , sizeof (u32 ));
971+ }
972+
973+ int iris_set_ir_period (struct iris_inst * inst , enum platform_inst_fw_cap_type cap_id )
974+ {
975+ const struct iris_hfi_command_ops * hfi_ops = inst -> core -> hfi_ops ;
976+ struct vb2_queue * q = v4l2_m2m_get_dst_vq (inst -> m2m_ctx );
977+ u32 ir_period = inst -> fw_caps [cap_id ].value ;
978+ u32 ir_type = 0 ;
979+
980+ if (inst -> fw_caps [IR_TYPE ].value ==
981+ V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM ) {
982+ if (vb2_is_streaming (q ))
983+ return 0 ;
984+ ir_type = HFI_PROP_IR_RANDOM_PERIOD ;
985+ } else if (inst -> fw_caps [IR_TYPE ].value ==
986+ V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC ) {
987+ ir_type = HFI_PROP_IR_CYCLIC_PERIOD ;
988+ } else {
989+ return - EINVAL ;
990+ }
991+
992+ return hfi_ops -> session_set_property (inst , ir_type ,
993+ HFI_HOST_FLAGS_NONE ,
994+ iris_get_port_info (inst , cap_id ),
995+ HFI_PAYLOAD_U32 ,
996+ & ir_period , sizeof (u32 ));
997+ }
998+
904999int iris_set_properties (struct iris_inst * inst , u32 plane )
9051000{
9061001 const struct iris_hfi_command_ops * hfi_ops = inst -> core -> hfi_ops ;
0 commit comments