Explorar el Código

video-driver: Move three functions to msm_vidc_power.c

Move __lut, __compression_ratio and __dump functions
form venus_hfi.c to msm_vidc_power.c where they belongs.

Change-Id: Iafabf1c61a9602ea9b2c067663e46e12b88266b8
Signed-off-by: Stanimir Varbanov <[email protected]>
Stanimir Varbanov hace 3 años
padre
commit
2b1146d5cd
Se han modificado 2 ficheros con 67 adiciones y 67 borrados
  1. 67 0
      driver/vidc/src/msm_vidc_power.c
  2. 0 67
      driver/vidc/src/venus_hfi.c

+ 67 - 0
driver/vidc/src/msm_vidc_power.c

@@ -22,6 +22,73 @@
 #define MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO (1 << 16)
 #define MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO (5 << 16)
 
+/**
+ * Utility function to enforce some of our assumptions.  Spam calls to this
+ * in hotspots in code to double check some of the assumptions that we hold.
+ */
+struct lut const *__lut(int width, int height, int fps)
+{
+	int frame_size = height * width, c = 0;
+
+	do {
+		if (LUT[c].frame_size >= frame_size && LUT[c].frame_rate >= fps)
+			return &LUT[c];
+	} while (++c < ARRAY_SIZE(LUT));
+
+	return &LUT[ARRAY_SIZE(LUT) - 1];
+}
+
+fp_t __compression_ratio(struct lut const *entry, int bpp)
+{
+	int c = 0;
+
+	for (c = 0; c < COMPRESSION_RATIO_MAX; ++c) {
+		if (entry->compression_ratio[c].bpp == bpp)
+			return entry->compression_ratio[c].ratio;
+	}
+
+	WARN(true, "Shouldn't be here, LUT possibly corrupted?\n");
+	return FP_ZERO; /* impossible */
+}
+
+
+void __dump(struct dump dump[], int len)
+{
+	int c = 0;
+
+	for (c = 0; c < len; ++c) {
+		char format_line[128] = "", formatted_line[128] = "";
+
+		if (dump[c].val == DUMP_HEADER_MAGIC) {
+			snprintf(formatted_line, sizeof(formatted_line), "%s\n",
+					 dump[c].key);
+		} else {
+			bool fp_format = !strcmp(dump[c].format, DUMP_FP_FMT);
+
+			if (!fp_format) {
+				snprintf(format_line, sizeof(format_line),
+						 "    %-35s: %s\n", dump[c].key,
+						 dump[c].format);
+				snprintf(formatted_line, sizeof(formatted_line),
+						 format_line, dump[c].val);
+			} else {
+				size_t integer_part, fractional_part;
+
+				integer_part = fp_int(dump[c].val);
+				fractional_part = fp_frac(dump[c].val);
+				snprintf(formatted_line, sizeof(formatted_line),
+						 "    %-35s: %zd + %zd/%zd\n",
+						 dump[c].key, integer_part,
+						 fractional_part,
+						 fp_frac_base());
+
+
+			}
+		}
+		d_vpr_b("%s", formatted_line);
+	}
+}
+
 u64 msm_vidc_max_freq(struct msm_vidc_inst *inst)
 {
 	struct msm_vidc_core* core;

+ 0 - 67
driver/vidc/src/venus_hfi.c

@@ -41,73 +41,6 @@ extern struct msm_vidc_core *g_core;
 static int __resume(struct msm_vidc_core *core);
 static int __suspend(struct msm_vidc_core *core);
 
-/**
- * Utility function to enforce some of our assumptions.  Spam calls to this
- * in hotspots in code to double check some of the assumptions that we hold.
- */
-struct lut const *__lut(int width, int height, int fps)
-{
-	int frame_size = height * width, c = 0;
-
-	do {
-		if (LUT[c].frame_size >= frame_size && LUT[c].frame_rate >= fps)
-			return &LUT[c];
-	} while (++c < ARRAY_SIZE(LUT));
-
-	return &LUT[ARRAY_SIZE(LUT) - 1];
-}
-
-fp_t __compression_ratio(struct lut const *entry, int bpp)
-{
-	int c = 0;
-
-	for (c = 0; c < COMPRESSION_RATIO_MAX; ++c) {
-		if (entry->compression_ratio[c].bpp == bpp)
-			return entry->compression_ratio[c].ratio;
-	}
-
-	WARN(true, "Shouldn't be here, LUT possibly corrupted?\n");
-	return FP_ZERO; /* impossible */
-}
-
-
-void __dump(struct dump dump[], int len)
-{
-	int c = 0;
-
-	for (c = 0; c < len; ++c) {
-		char format_line[128] = "", formatted_line[128] = "";
-
-		if (dump[c].val == DUMP_HEADER_MAGIC) {
-			snprintf(formatted_line, sizeof(formatted_line), "%s\n",
-					 dump[c].key);
-		} else {
-			bool fp_format = !strcmp(dump[c].format, DUMP_FP_FMT);
-
-			if (!fp_format) {
-				snprintf(format_line, sizeof(format_line),
-						 "    %-35s: %s\n", dump[c].key,
-						 dump[c].format);
-				snprintf(formatted_line, sizeof(formatted_line),
-						 format_line, dump[c].val);
-			} else {
-				size_t integer_part, fractional_part;
-
-				integer_part = fp_int(dump[c].val);
-				fractional_part = fp_frac(dump[c].val);
-				snprintf(formatted_line, sizeof(formatted_line),
-						 "    %-35s: %zd + %zd/%zd\n",
-						 dump[c].key, integer_part,
-						 fractional_part,
-						 fp_frac_base());
-
-
-			}
-		}
-		d_vpr_b("%s", formatted_line);
-	}
-}
-
 static void __fatal_error(bool fatal)
 {
 	WARN_ON(fatal);