summaryrefslogtreecommitdiff
path: root/isp/stats.h
diff options
context:
space:
mode:
Diffstat (limited to 'isp/stats.h')
-rw-r--r--isp/stats.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/isp/stats.h b/isp/stats.h
index fb6c26a..f68d4fa 100644
--- a/isp/stats.h
+++ b/isp/stats.h
@@ -27,6 +27,11 @@
struct omap3_isp_device;
+enum omap3_isp_stat_engine {
+ OMAP3_ISP_STAT_AEWB = 1 << 0,
+ OMAP3_ISP_STAT_HIST = 1 << 1,
+};
+
/*
* struct omap3_isp_aewb_stats - OMAP3 ISP AEWB statistics
* @npix: Total number of accumulated pixels
@@ -52,15 +57,28 @@ struct omap3_isp_aewb_stats {
};
/*
+ * struct omap3_isp_histogram_stats - OMAP3 ISP histogram statistics
+ * @nbins: Number of bins in the histogram
+ * @bins: Array of histogram frequency data
+ *
+ * Each bin entry is stored on 32 bits but limited to 20 bits.
+ */
+struct omap3_isp_histogram_stats {
+ unsigned int nbins;
+ uint32_t *bins;
+};
+
+/*
* omap3_isp_stats_enable - Enable or disable the statistics engine
* @isp: The ISP device
- * @enable: Whether to enable to disable the statistics engine
+ * @which: The statistics engine(s) to enable
*
- * The statistics engine must be enabled prior to starting the video stream.
- * When enabled, it statistics will be computed for every frame and delivered
- * through the ISP aewb_ready() callback.
+ * The statistics engines must be enabled prior to starting the video stream.
+ * When enabled, statistics will be computed for every frame and delivered
+ * through the ISP aewb_ready() and histogram_ready() callbacks.
*/
-void omap3_isp_stats_enable(struct omap3_isp_device *isp, bool enable);
+void omap3_isp_stats_enable(struct omap3_isp_device *isp,
+ enum omap3_isp_stat_engine which);
/*
* omap3_isp_stats_get_format - Get frame format at the statistics engine input
@@ -72,6 +90,7 @@ void omap3_isp_stats_enable(struct omap3_isp_device *isp, bool enable);
*/
int omap3_isp_stats_get_format(struct omap3_isp_device *isp,
struct v4l2_mbus_framefmt *format);
+
/*
* omap3_isp_aewb_configure - Configure the AEWB statistics engine
* @isp: The ISP device
@@ -81,4 +100,12 @@ int omap3_isp_stats_get_format(struct omap3_isp_device *isp,
int omap3_isp_aewb_configure(struct omap3_isp_device *isp, struct v4l2_rect *rect,
unsigned int saturation);
+/*
+ * omap3_isp_histogram_configure - Configure the histogram statistics engine
+ * @isp: The ISP device
+ * @rect: The region of interest, relative to the sensor output frame size
+ */
+int omap3_isp_histogram_configure(struct omap3_isp_device *isp,
+ struct v4l2_rect *rect);
+
#endif