summaryrefslogtreecommitdiff
path: root/drivers/media/platform/am437x/am437x-vpfe.h
diff options
context:
space:
mode:
authorBenoit Parrot <bparrot@ti.com>2019-09-20 14:05:49 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-01 16:12:52 -0300
commit0512ccba072a6c2517d2926009eb223ad163f413 (patch)
tree22028d6421414a6eb6e74d29bb686fca0305cc13 /drivers/media/platform/am437x/am437x-vpfe.h
parent13aa21cfe92ce9ebb51824029d89f19c33f81419 (diff)
media: am437x-vpfe: Use a per instance format array instead of a static one
Using a statically defined format array would cause issue when multiple vpfe instance would be connected to sub-device of different capabilities. We need to use an instance based array instead to properly maintain a per port/instance format list. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/am437x/am437x-vpfe.h')
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/media/platform/am437x/am437x-vpfe.h b/drivers/media/platform/am437x/am437x-vpfe.h
index 2dde09780215..6c7bcb837f4e 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.h
+++ b/drivers/media/platform/am437x/am437x-vpfe.h
@@ -215,6 +215,37 @@ struct vpfe_ccdc {
u32 ccdc_ctx[VPFE_REG_END / sizeof(u32)];
};
+/*
+ * struct bus_format - VPFE bus format information
+ * width: Bits per pixel (when transferred over a bus)
+ * bpp: Bytes per pixel (when stored in memory)
+ */
+struct bus_format {
+ unsigned int width;
+ unsigned int bpp;
+};
+
+/*
+ * struct vpfe_fmt - VPFE media bus format information
+ * fourcc: V4L2 pixel format code
+ * code: V4L2 media bus format code
+ * l: 10 bit bus format info
+ * s: 8 bit bus format info
+ */
+struct vpfe_fmt {
+ u32 fourcc;
+ u32 code;
+ struct bus_format l;
+ struct bus_format s;
+};
+
+/*
+ * When formats[] is modified make sure to adjust this value also.
+ * Expect compile time warnings if VPFE_NUM_FORMATS is smaller then
+ * the number of elements in formats[].
+ */
+#define VPFE_NUM_FORMATS 10
+
struct vpfe_device {
/* V4l2 specific parameters */
/* Identifies video device for this channel */
@@ -252,6 +283,9 @@ struct vpfe_device {
struct v4l2_format fmt;
/* Used to store current bytes per pixel based on current format */
unsigned int bpp;
+ struct vpfe_fmt *active_fmt[VPFE_NUM_FORMATS];
+ unsigned int num_active_fmt;
+
/*
* used when IMP is chained to store the crop window which
* is different from the image window