All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Panizzo <maramaopercheseimorto@gmail.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: HansVerkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] soc_mediabus: export a useful method to obtain the number of samples that makes up a pixel format
Date: Wed, 12 Jan 2011 12:16:19 +0100	[thread overview]
Message-ID: <1294830979.2576.48.camel@realization> (raw)
In-Reply-To: <1294830836.2576.46.camel@realization>


Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---
 drivers/media/video/soc_mediabus.c |   14 ++++++++++++++
 include/media/soc_mediabus.h       |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c
index 9139121..5bba424 100644
--- a/drivers/media/video/soc_mediabus.c
+++ b/drivers/media/video/soc_mediabus.c
@@ -132,6 +132,20 @@ static const struct soc_mbus_pixelfmt mbus_fmt[] = {
 	},
 };
 
+s32 soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf)
+{
+	switch (mf->packing) {
+	case SOC_MBUS_PACKING_NONE:
+	case SOC_MBUS_PACKING_EXTEND16:
+		return 1;
+	case SOC_MBUS_PACKING_2X8_PADHI:
+	case SOC_MBUS_PACKING_2X8_PADLO:
+		return 2;
+	}
+	return -EINVAL;
+}
+EXPORT_SYMBOL(soc_mbus_samples_per_pixel);
+
 s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
 {
 	switch (mf->packing) {
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index 037cd7b..f21cbd0 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -61,5 +61,6 @@ struct soc_mbus_pixelfmt {
 const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
 	enum v4l2_mbus_pixelcode code);
 s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
+s32 soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf);
 
 #endif
-- 
1.7.1




  reply	other threads:[~2011-01-12 11:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28 17:18 [PATCH 1/3] soc_camera: Add the ability to bind regulators to soc_camedra devices Alberto Panizzo
2010-11-28 17:24 ` [PATCH 2/3] mx3_camera: Support correctly the YUV222 and BAYER configurations of CSI Alberto Panizzo
2010-11-28 17:26   ` [PATCH 3/3] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor Alberto Panizzo
2010-12-01 23:32     ` Guennadi Liakhovetski
2010-12-02 10:33       ` Alberto Panizzo
2010-12-02 14:53       ` [PATCH v2] " Alberto Panizzo
2010-11-30 14:25   ` [PATCH 2/3] mx3_camera: Support correctly the YUV222 and BAYER configurations of CSI Alberto Panizzo
2010-11-30 14:31     ` Guennadi Liakhovetski
2010-11-30 14:39       ` Alberto Panizzo
2010-12-01 18:54   ` Guennadi Liakhovetski
2010-12-18 16:24     ` Guennadi Liakhovetski
2010-12-30 19:38       ` Guennadi Liakhovetski
2011-01-03 11:46         ` Alberto Panizzo
2011-01-03 17:33         ` Alberto Panizzo
2011-01-03 19:37           ` Guennadi Liakhovetski
2011-01-03 22:07             ` Alberto Panizzo
2011-01-11 17:29               ` Alberto Panizzo
2011-01-12 11:13               ` [PATCH 0/2] Fix the way mx3_camera manage non 8-bpp pixel formats Alberto Panizzo
2011-01-12 11:16                 ` Alberto Panizzo [this message]
2011-01-12 11:20                 ` [PATCH 2/2] Fix capture issues for non 8-bit per " Alberto Panizzo
2011-01-15 21:35                   ` Guennadi Liakhovetski
2011-01-17  9:41                     ` Alberto Panizzo
2011-01-17  9:52                     ` [PATCH 2/2 v2] " Alberto Panizzo
2011-01-03 16:06     ` [PATCH 2/3] mx3_camera: Support correctly the YUV222 and BAYER configurations of CSI Alberto Panizzo
2011-01-03 16:24       ` Guennadi Liakhovetski
2010-11-28 19:05 ` [PATCH 1/3] soc_camera: Add the ability to bind regulators to soc_camedra devices Guennadi Liakhovetski
2010-11-29  9:34   ` Alberto Panizzo
2010-11-29 15:51     ` Mark Brown
2010-11-30 10:45       ` Alberto Panizzo
2010-11-30 11:05         ` Mark Brown
2010-11-29 15:44   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294830979.2576.48.camel@realization \
    --to=maramaopercheseimorto@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.