[media] v4l: omap4iss: Add description field to iss_format_info structure
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 9 Sep 2013 11:19:21 +0000 (08:19 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 11 Dec 2013 09:01:13 +0000 (07:01 -0200)
The field stores the format description in a human-readable form.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/staging/media/omap4iss/iss_video.c
drivers/staging/media/omap4iss/iss_video.h

index 7763b8dc9f6e36068bea38aeddd1d130310d4e8a..b4ffde87a4159f6fbca841c4cc72a78310627c12 100644 (file)
 static struct iss_format_info formats[] = {
        { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8,
          V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8,
-         V4L2_PIX_FMT_GREY, 8, },
+         V4L2_PIX_FMT_GREY, 8, "Greyscale 8 bpp", },
        { V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y10_1X10,
          V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y8_1X8,
-         V4L2_PIX_FMT_Y10, 10, },
+         V4L2_PIX_FMT_Y10, 10, "Greyscale 10 bpp", },
        { V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y10_1X10,
          V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y8_1X8,
-         V4L2_PIX_FMT_Y12, 12, },
+         V4L2_PIX_FMT_Y12, 12, "Greyscale 12 bpp", },
        { V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8,
          V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8,
-         V4L2_PIX_FMT_SBGGR8, 8, },
+         V4L2_PIX_FMT_SBGGR8, 8, "BGGR Bayer 8 bpp", },
        { V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8,
          V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8,
-         V4L2_PIX_FMT_SGBRG8, 8, },
+         V4L2_PIX_FMT_SGBRG8, 8, "GBRG Bayer 8 bpp", },
        { V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8,
          V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8,
-         V4L2_PIX_FMT_SGRBG8, 8, },
+         V4L2_PIX_FMT_SGRBG8, 8, "GRBG Bayer 8 bpp", },
        { V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8,
          V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8,
-         V4L2_PIX_FMT_SRGGB8, 8, },
+         V4L2_PIX_FMT_SRGGB8, 8, "RGGB Bayer 8 bpp", },
        { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8,
          V4L2_MBUS_FMT_SGRBG10_1X10, 0,
-         V4L2_PIX_FMT_SGRBG10DPCM8, 8, },
+         V4L2_PIX_FMT_SGRBG10DPCM8, 8, "GRBG Bayer 10 bpp DPCM8",  },
        { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10,
          V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR8_1X8,
-         V4L2_PIX_FMT_SBGGR10, 10, },
+         V4L2_PIX_FMT_SBGGR10, 10, "BGGR Bayer 10 bpp", },
        { V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10,
          V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG8_1X8,
-         V4L2_PIX_FMT_SGBRG10, 10, },
+         V4L2_PIX_FMT_SGBRG10, 10, "GBRG Bayer 10 bpp", },
        { V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG10_1X10,
          V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG8_1X8,
-         V4L2_PIX_FMT_SGRBG10, 10, },
+         V4L2_PIX_FMT_SGRBG10, 10, "GRBG Bayer 10 bpp", },
        { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10,
          V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB8_1X8,
-         V4L2_PIX_FMT_SRGGB10, 10, },
+         V4L2_PIX_FMT_SRGGB10, 10, "RGGB Bayer 10 bpp", },
        { V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR10_1X10,
          V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR8_1X8,
-         V4L2_PIX_FMT_SBGGR12, 12, },
+         V4L2_PIX_FMT_SBGGR12, 12, "BGGR Bayer 12 bpp", },
        { V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG10_1X10,
          V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG8_1X8,
-         V4L2_PIX_FMT_SGBRG12, 12, },
+         V4L2_PIX_FMT_SGBRG12, 12, "GBRG Bayer 12 bpp", },
        { V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG10_1X10,
          V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG8_1X8,
-         V4L2_PIX_FMT_SGRBG12, 12, },
+         V4L2_PIX_FMT_SGRBG12, 12, "GRBG Bayer 12 bpp", },
        { V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB10_1X10,
          V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB8_1X8,
-         V4L2_PIX_FMT_SRGGB12, 12, },
+         V4L2_PIX_FMT_SRGGB12, 12, "RGGB Bayer 12 bpp", },
        { V4L2_MBUS_FMT_UYVY8_1X16, V4L2_MBUS_FMT_UYVY8_1X16,
          V4L2_MBUS_FMT_UYVY8_1X16, 0,
-         V4L2_PIX_FMT_UYVY, 16, },
+         V4L2_PIX_FMT_UYVY, 16, "YUV 4:2:2 (UYVY)", },
        { V4L2_MBUS_FMT_YUYV8_1X16, V4L2_MBUS_FMT_YUYV8_1X16,
          V4L2_MBUS_FMT_YUYV8_1X16, 0,
-         V4L2_PIX_FMT_YUYV, 16, },
+         V4L2_PIX_FMT_YUYV, 16, "YUV 4:2:2 (YUYV)", },
        { V4L2_MBUS_FMT_YUYV8_1_5X8, V4L2_MBUS_FMT_YUYV8_1_5X8,
          V4L2_MBUS_FMT_YUYV8_1_5X8, 0,
-         V4L2_PIX_FMT_NV12, 8, },
+         V4L2_PIX_FMT_NV12, 8, "YUV 4:2:0 (NV12)", },
 };
 
 const struct iss_format_info *
index 35f14d84330bc4ac234dc31a55d1ff74c785d9b2..2c8d256a87c5d0cb8e8852e70ba0fc1ce1447509 100644 (file)
@@ -40,6 +40,7 @@ struct v4l2_pix_format;
  *     shifted to be 8 bits per pixel. =0 if format is not shiftable.
  * @pixelformat: V4L2 pixel format FCC identifier
  * @bpp: Bits per pixel
+ * @description: Human-readable format description
  */
 struct iss_format_info {
        enum v4l2_mbus_pixelcode code;
@@ -48,6 +49,7 @@ struct iss_format_info {
        enum v4l2_mbus_pixelcode flavor;
        u32 pixelformat;
        unsigned int bpp;
+       const char *description;
 };
 
 enum iss_pipeline_stream_state {