Browse Source

Merge "video: driver: use static const at possible places"

qctecmdr 3 years ago
parent
commit
d7658b1aee

+ 1 - 1
driver/platform/diwali/src/msm_vidc_diwali.c

@@ -4883,7 +4883,7 @@ static struct msm_vidc_efuse_data efuse_data_diwali[] = {
 	EFUSE_ENTRY(0x221C8118, 4, 0x80, 0x6, SKU_VERSION),
 	EFUSE_ENTRY(0x221C8118, 4, 0x80, 0x6, SKU_VERSION),
 };
 };
 
 
-static struct msm_vidc_platform_data diwali_data = {
+static const struct msm_vidc_platform_data diwali_data = {
 	.core_data = core_data_diwali_v0,
 	.core_data = core_data_diwali_v0,
 	.core_data_size = ARRAY_SIZE(core_data_diwali_v0),
 	.core_data_size = ARRAY_SIZE(core_data_diwali_v0),
 	.instance_data = instance_data_diwali_v0,
 	.instance_data = instance_data_diwali_v0,

+ 1 - 1
driver/platform/kalama/src/msm_vidc_kalama.c

@@ -1828,7 +1828,7 @@ static u32 bus_bw_nrt[] = {
 	11000000,
 	11000000,
 };
 };
 
 
-static struct msm_vidc_platform_data kalama_data = {
+static const struct msm_vidc_platform_data kalama_data = {
 	.core_data = core_data_kalama,
 	.core_data = core_data_kalama,
 	.core_data_size = ARRAY_SIZE(core_data_kalama),
 	.core_data_size = ARRAY_SIZE(core_data_kalama),
 	.instance_data = instance_data_kalama,
 	.instance_data = instance_data_kalama,

+ 1 - 1
driver/platform/waipio/src/msm_vidc_waipio.c

@@ -1694,7 +1694,7 @@ static u32 bus_bw_nrt[] = {
 	11000000,
 	11000000,
 };
 };
 
 
-static struct msm_vidc_platform_data waipio_data = {
+static const struct msm_vidc_platform_data waipio_data = {
 	.core_data = core_data_waipio,
 	.core_data = core_data_waipio,
 	.core_data_size = ARRAY_SIZE(core_data_waipio),
 	.core_data_size = ARRAY_SIZE(core_data_waipio),
 	.instance_data = instance_data_waipio,
 	.instance_data = instance_data_waipio,

+ 6 - 6
driver/vidc/src/msm_vdec.c

@@ -1245,7 +1245,7 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
 	u32 payload[32] = {0};
 	u32 payload[32] = {0};
 	u32 i, count = 0;
 	u32 i, count = 0;
 	struct msm_vidc_inst_capability *capability;
 	struct msm_vidc_inst_capability *capability;
-	const u32 metadata_input_list[] = {
+	static const u32 metadata_input_list[] = {
 		INPUT_META_OUTBUF_FENCE,
 		INPUT_META_OUTBUF_FENCE,
 		/*
 		/*
 		 * when fence enabled, client needs output buffer_tag
 		 * when fence enabled, client needs output buffer_tag
@@ -1253,7 +1253,7 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
 		 */
 		 */
 		META_OUTPUT_BUF_TAG,
 		META_OUTPUT_BUF_TAG,
 	};
 	};
-	const u32 metadata_output_list[] = {
+	static const u32 metadata_output_list[] = {
 		META_BITSTREAM_RESOLUTION,
 		META_BITSTREAM_RESOLUTION,
 		META_CROP_OFFSETS,
 		META_CROP_OFFSETS,
 		META_DPB_MISR,
 		META_DPB_MISR,
@@ -1325,10 +1325,10 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
 	u32 payload[32] = {0};
 	u32 payload[32] = {0};
 	u32 i, count = 0;
 	u32 i, count = 0;
 	struct msm_vidc_inst_capability *capability;
 	struct msm_vidc_inst_capability *capability;
-	const u32 metadata_input_list[] = {
+	static const u32 metadata_input_list[] = {
 		META_BUF_TAG,
 		META_BUF_TAG,
 	};
 	};
-	const u32 metadata_output_list[] = {
+	static const u32 metadata_output_list[] = {
 		META_OUTPUT_BUF_TAG,
 		META_OUTPUT_BUF_TAG,
 	};
 	};
 
 
@@ -1382,10 +1382,10 @@ static int msm_vdec_set_delivery_mode_property(struct msm_vidc_inst *inst,
 	u32 payload[32] = {0};
 	u32 payload[32] = {0};
 	u32 i, count = 0;
 	u32 i, count = 0;
 	struct msm_vidc_inst_capability *capability;
 	struct msm_vidc_inst_capability *capability;
-	const u32 property_output_list[] = {
+	static const u32 property_output_list[] = {
 		INPUT_META_OUTBUF_FENCE,
 		INPUT_META_OUTBUF_FENCE,
 	};
 	};
-	const u32 property_input_list[] = {};
+	static const u32 property_input_list[] = {};
 
 
 	if (!inst || !inst->capabilities) {
 	if (!inst || !inst->capabilities) {
 		d_vpr_e("%s: invalid params\n", __func__);
 		d_vpr_e("%s: invalid params\n", __func__);

+ 1 - 1
driver/vidc/src/msm_vidc_memory.c

@@ -584,7 +584,7 @@ struct msm_vidc_type_size_name {
 	char                     *name;
 	char                     *name;
 };
 };
 
 
-static struct msm_vidc_type_size_name buftype_size_name_arr[] = {
+static const struct msm_vidc_type_size_name buftype_size_name_arr[] = {
 	{MSM_MEM_POOL_BUFFER,     sizeof(struct msm_vidc_buffer),     "MSM_MEM_POOL_BUFFER"     },
 	{MSM_MEM_POOL_BUFFER,     sizeof(struct msm_vidc_buffer),     "MSM_MEM_POOL_BUFFER"     },
 	{MSM_MEM_POOL_MAP,        sizeof(struct msm_vidc_map),        "MSM_MEM_POOL_MAP"        },
 	{MSM_MEM_POOL_MAP,        sizeof(struct msm_vidc_map),        "MSM_MEM_POOL_MAP"        },
 	{MSM_MEM_POOL_ALLOC,      sizeof(struct msm_vidc_alloc),      "MSM_MEM_POOL_ALLOC"      },
 	{MSM_MEM_POOL_ALLOC,      sizeof(struct msm_vidc_alloc),      "MSM_MEM_POOL_ALLOC"      },

+ 9 - 9
driver/vidc/src/venus_hfi_response.c

@@ -1056,7 +1056,7 @@ static int msm_vidc_check_meta_buffers(struct msm_vidc_inst *inst)
 	int i;
 	int i;
 	struct msm_vidc_buffers *buffers;
 	struct msm_vidc_buffers *buffers;
 	struct msm_vidc_buffer *buf;
 	struct msm_vidc_buffer *buf;
-	const enum msm_vidc_buffer_type buffer_type[] = {
+	static const enum msm_vidc_buffer_type buffer_type[] = {
 		MSM_VIDC_BUF_INPUT,
 		MSM_VIDC_BUF_INPUT,
 		MSM_VIDC_BUF_OUTPUT,
 		MSM_VIDC_BUF_OUTPUT,
 	};
 	};
@@ -1086,7 +1086,7 @@ static int handle_dequeue_buffers(struct msm_vidc_inst *inst)
 	struct msm_vidc_buffers *buffers;
 	struct msm_vidc_buffers *buffers;
 	struct msm_vidc_buffer *buf;
 	struct msm_vidc_buffer *buf;
 	struct msm_vidc_buffer *dummy;
 	struct msm_vidc_buffer *dummy;
-	const enum msm_vidc_buffer_type buffer_type[] = {
+	static const enum msm_vidc_buffer_type buffer_type[] = {
 		MSM_VIDC_BUF_INPUT_META,
 		MSM_VIDC_BUF_INPUT_META,
 		MSM_VIDC_BUF_INPUT,
 		MSM_VIDC_BUF_INPUT,
 		MSM_VIDC_BUF_OUTPUT_META,
 		MSM_VIDC_BUF_OUTPUT_META,
@@ -1194,12 +1194,12 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
 	struct hfi_buffer *buffer;
 	struct hfi_buffer *buffer;
 	u32 hfi_handle_size = 0;
 	u32 hfi_handle_size = 0;
 	const struct msm_vidc_hfi_buffer_handle *hfi_handle_arr = NULL;
 	const struct msm_vidc_hfi_buffer_handle *hfi_handle_arr = NULL;
-	const struct msm_vidc_hfi_buffer_handle enc_input_hfi_handle[] = {
+	static const struct msm_vidc_hfi_buffer_handle enc_input_hfi_handle[] = {
 		{HFI_BUFFER_METADATA,       handle_input_metadata_buffer      },
 		{HFI_BUFFER_METADATA,       handle_input_metadata_buffer      },
 		{HFI_BUFFER_RAW,            handle_input_buffer               },
 		{HFI_BUFFER_RAW,            handle_input_buffer               },
 		{HFI_BUFFER_VPSS,           handle_release_internal_buffer    },
 		{HFI_BUFFER_VPSS,           handle_release_internal_buffer    },
 	};
 	};
-	const struct msm_vidc_hfi_buffer_handle enc_output_hfi_handle[] = {
+	static const struct msm_vidc_hfi_buffer_handle enc_output_hfi_handle[] = {
 		{HFI_BUFFER_METADATA,       handle_output_metadata_buffer     },
 		{HFI_BUFFER_METADATA,       handle_output_metadata_buffer     },
 		{HFI_BUFFER_BITSTREAM,      handle_output_buffer              },
 		{HFI_BUFFER_BITSTREAM,      handle_output_buffer              },
 		{HFI_BUFFER_BIN,            handle_release_internal_buffer    },
 		{HFI_BUFFER_BIN,            handle_release_internal_buffer    },
@@ -1209,7 +1209,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
 		{HFI_BUFFER_ARP,            handle_release_internal_buffer    },
 		{HFI_BUFFER_ARP,            handle_release_internal_buffer    },
 		{HFI_BUFFER_DPB,            handle_release_internal_buffer    },
 		{HFI_BUFFER_DPB,            handle_release_internal_buffer    },
 	};
 	};
-	const struct msm_vidc_hfi_buffer_handle dec_input_hfi_handle[] = {
+	static const struct msm_vidc_hfi_buffer_handle dec_input_hfi_handle[] = {
 		{HFI_BUFFER_METADATA,       handle_input_metadata_buffer      },
 		{HFI_BUFFER_METADATA,       handle_input_metadata_buffer      },
 		{HFI_BUFFER_BITSTREAM,      handle_input_buffer               },
 		{HFI_BUFFER_BITSTREAM,      handle_input_buffer               },
 		{HFI_BUFFER_BIN,            handle_release_internal_buffer    },
 		{HFI_BUFFER_BIN,            handle_release_internal_buffer    },
@@ -1218,7 +1218,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
 		{HFI_BUFFER_LINE,           handle_release_internal_buffer    },
 		{HFI_BUFFER_LINE,           handle_release_internal_buffer    },
 		{HFI_BUFFER_PERSIST,        handle_release_internal_buffer    },
 		{HFI_BUFFER_PERSIST,        handle_release_internal_buffer    },
 	};
 	};
-	const struct msm_vidc_hfi_buffer_handle dec_output_hfi_handle[] = {
+	static const struct msm_vidc_hfi_buffer_handle dec_output_hfi_handle[] = {
 		{HFI_BUFFER_METADATA,       handle_output_metadata_buffer     },
 		{HFI_BUFFER_METADATA,       handle_output_metadata_buffer     },
 		{HFI_BUFFER_RAW,            handle_output_buffer              },
 		{HFI_BUFFER_RAW,            handle_output_buffer              },
 		{HFI_BUFFER_DPB,            handle_release_internal_buffer    },
 		{HFI_BUFFER_DPB,            handle_release_internal_buffer    },
@@ -1352,7 +1352,7 @@ static int handle_session_command(struct msm_vidc_inst *inst,
 	struct hfi_packet *pkt)
 	struct hfi_packet *pkt)
 {
 {
 	int i, rc;
 	int i, rc;
-	const struct msm_vidc_hfi_packet_handle hfi_pkt_handle[] = {
+	static const struct msm_vidc_hfi_packet_handle hfi_pkt_handle[] = {
 		{HFI_CMD_OPEN,              handle_session_open               },
 		{HFI_CMD_OPEN,              handle_session_open               },
 		{HFI_CMD_CLOSE,             handle_session_close              },
 		{HFI_CMD_CLOSE,             handle_session_close              },
 		{HFI_CMD_START,             handle_session_start              },
 		{HFI_CMD_START,             handle_session_start              },
@@ -1633,7 +1633,7 @@ static int handle_system_response(struct msm_vidc_core *core,
 	struct hfi_packet *packet;
 	struct hfi_packet *packet;
 	u8 *pkt, *start_pkt;
 	u8 *pkt, *start_pkt;
 	int i, j;
 	int i, j;
-	const struct msm_vidc_core_hfi_range be[] = {
+	static const struct msm_vidc_core_hfi_range be[] = {
 		{HFI_SYSTEM_ERROR_BEGIN,   HFI_SYSTEM_ERROR_END,   handle_system_error     },
 		{HFI_SYSTEM_ERROR_BEGIN,   HFI_SYSTEM_ERROR_END,   handle_system_error     },
 		{HFI_PROP_BEGIN,           HFI_PROP_END,           handle_system_property  },
 		{HFI_PROP_BEGIN,           HFI_PROP_END,           handle_system_property  },
 		{HFI_CMD_BEGIN,            HFI_CMD_END,            handle_system_init      },
 		{HFI_CMD_BEGIN,            HFI_CMD_END,            handle_system_init      },
@@ -1680,7 +1680,7 @@ static int __handle_session_response(struct msm_vidc_inst *inst,
 	u8 *pkt, *start_pkt;
 	u8 *pkt, *start_pkt;
 	bool dequeue = false;
 	bool dequeue = false;
 	int i, j;
 	int i, j;
-	const struct msm_vidc_inst_hfi_range be[] = {
+	static const struct msm_vidc_inst_hfi_range be[] = {
 		{HFI_SESSION_ERROR_BEGIN,  HFI_SESSION_ERROR_END,  handle_session_error    },
 		{HFI_SESSION_ERROR_BEGIN,  HFI_SESSION_ERROR_END,  handle_session_error    },
 		{HFI_INFORMATION_BEGIN,    HFI_INFORMATION_END,    handle_session_info     },
 		{HFI_INFORMATION_BEGIN,    HFI_INFORMATION_END,    handle_session_info     },
 		{HFI_PROP_BEGIN,           HFI_PROP_END,           handle_session_property },
 		{HFI_PROP_BEGIN,           HFI_PROP_END,           handle_session_property },