Re: [PATCH v16 01/13] davinci vpbe: V4L2 display driver for DM644X SoC

2011-04-26 Thread Vladimir Pantelic

Manjunath Hadli wrote:

This is the display driver for Texas Instruments's DM644X family
SoC. This patch contains the main implementation of the driver with the
V4L2 interface. The driver implements the streaming model with
support for both kernel allocated buffers and user pointers. It also
implements all of the necessary IOCTLs necessary and supported by the
video display device.


is there any hope/chance to make this share code with the omap v4l2
driver in drivers/media/video/omap?

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

2010-04-07 Thread Vladimir Pantelic

hvaib...@ti.com wrote:

From: Vaibhav Hiremathhvaib...@ti.com

Features Supported -
1. Provides V4L2 user interface for the video pipelines of DSS
2. Basic streaming working on LCD, DVI and TV.
3. Works on latest DSS2 library from Tomi
4. Support for various pixel formats like YUV, UYVY, RGB32, RGB24,
   RGB565
5. Supports Alpha blending.
6. Supports Color keying both source and destination.
7. Supports rotation.
8. Supports cropping.
9. Supports Background color setting.
10. Allocated buffers to only needed size

Signed-off-by: Vaibhav Hiremathhvaib...@ti.com


snip


diff --git a/drivers/media/video/omap/omap_voutlib.c 
b/drivers/media/video/omap/omap_voutlib.c
new file mode 100644
index 000..05c0e17
--- /dev/null
+++ b/drivers/media/video/omap/omap_voutlib.c
@@ -0,0 +1,258 @@
+/*
+ * omap_voutlib.c
+ *
+ * Copyright (C) 2005-2010 Texas Instruments.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ *
+ * Based on the OMAP2 camera driver
+ * Video-for-Linux (Version 2) camera capture driver for
+ * the OMAP24xx camera controller.
+ *
+ * Author: Andy Lowe (sou...@mvista.com)
+ *
+ * Copyright (C) 2004 MontaVista Software, Inc.
+ * Copyright (C) 2010 Texas Instruments.
+ *
+ */
+
+#includelinux/module.h
+#includelinux/errno.h
+#includelinux/kernel.h
+#includelinux/types.h
+#includelinux/videodev2.h
+
+MODULE_AUTHOR(Texas Instruments);
+MODULE_DESCRIPTION(OMAP Video library);
+MODULE_LICENSE(GPL);
+
+/* Return the default overlay cropping rectangle in crop given the image
+ * size in pix and the video display size in fbuf.  The default
+ * cropping rectangle is the largest rectangle no larger than the capture size
+ * that will fit on the display.  The default cropping rectangle is centered in
+ * the image.  All dimensions and offsets are rounded down to even numbers.
+ */
+void omap_vout_default_crop(struct v4l2_pix_format *pix,
+ struct v4l2_framebuffer *fbuf, struct v4l2_rect *crop)
+{
+   crop-width = (pix-width  fbuf-fmt.width) ?
+   pix-width : fbuf-fmt.width;
+   crop-height = (pix-height  fbuf-fmt.height) ?
+   pix-height : fbuf-fmt.height;
+   crop-width= ~1;
+   crop-height= ~1;
+   crop-left = ((pix-width - crop-width)  1)  ~1;
+   crop-top = ((pix-height - crop-height)  1)  ~1;
+}
+EXPORT_SYMBOL_GPL(omap_vout_default_crop);
+
+/* Given a new render window in new_win, adjust the window to the
+ * nearest supported configuration.  The adjusted window parameters are
+ * returned in new_win.
+ * Returns zero if succesful, or -EINVAL if the requested window is
+ * impossible and cannot reasonably be adjusted.
+ */
+int omap_vout_try_window(struct v4l2_framebuffer *fbuf,
+   struct v4l2_window *new_win)
+{
+   struct v4l2_rect try_win;
+
+   /* make a working copy of the new_win rectangle */
+   try_win = new_win-w;
+
+   /* adjust the preview window so it fits on the display by clipping any
+* offscreen areas
+*/
+   if (try_win.left  0) {
+   try_win.width += try_win.left;
+   try_win.left = 0;
+   }
+   if (try_win.top  0) {
+   try_win.height += try_win.top;
+   try_win.top = 0;
+   }
+   try_win.width = (try_win.width  fbuf-fmt.width) ?
+   try_win.width : fbuf-fmt.width;
+   try_win.height = (try_win.height  fbuf-fmt.height) ?
+   try_win.height : fbuf-fmt.height;
+   if (try_win.left + try_win.width  fbuf-fmt.width)
+   try_win.width = fbuf-fmt.width - try_win.left;
+   if (try_win.top + try_win.height  fbuf-fmt.height)
+   try_win.height = fbuf-fmt.height - try_win.top;
+   try_win.width= ~1;
+   try_win.height= ~1;
+
+   if (try_win.width= 0 || try_win.height= 0)
+   return -EINVAL;
+
+   /* We now have a valid preview window, so go with it */
+   new_win-w = try_win;
+   new_win-field = V4L2_FIELD_ANY;
+   return 0;
+}
+EXPORT_SYMBOL_GPL(omap_vout_try_window);
+
+/* Given a new render window in new_win, adjust the window to the
+ * nearest supported configuration.  The image cropping window in crop
+ * will also be adjusted if necessary.  Preference is given to keeping the
+ * the window as close to the requested configuration as possible.  If
+ * successful, new_win, vout-win, and crop are updated.
+ * Returns zero if succesful, or -EINVAL if the requested preview window is
+ * impossible and cannot reasonably be adjusted.
+ */
+int omap_vout_new_window(struct v4l2_rect *crop,
+   struct v4l2_window *win, struct v4l2_framebuffer *fbuf,
+   struct v4l2_window *new_win)
+{
+   int err;
+
+   err = omap_vout_try_window(fbuf, new_win);
+   if 

Re: RFC: V4L - Support for video timings at the input/output interface

2009-09-15 Thread Vladimir Pantelic

Karicheri, Muralidharan wrote:

snip

Open issues
---

1.How to handle an HDMI transmitter? It can be put in two different modes: DVI 
compatible
or HDMI compatible. Some of the choices are
a) enumerate them as two different outputs when enumerating.
 b) adding a status bit on the input.
 c) change it using a control

2. Detecting whether there is an analog or digital signal on an DVI-I input:
a) add new status field value for v4l2_input ?
   #define  V4L2_IN_ST_DVI_ANALOG_DETECTED0x1000
   #define  V4L2_IN_ST_DVI_DITIGITAL_DETECTED 0x2000

3. Detecting an EDID.
a) adding a status field in v4l2_output and two new ioctls that can
  set the EDID for an input or retrieve it for an output. It should
  also be added as an input/output capability.

4. ATSC bits in v4l2_std_id: how are they used? Are they used at all for
that matter?


6. HDMI requires additional investigation. HDMI defines a whole bunch of
infoframe fields. Most of these can probably be exported as controls?? Is
HDMI audio handled by alsa?


7. how does this interface/co-exist with something like DSS2 on the omap3?

who will own e.g. HDMI setup, DSS2 or V4L2?

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html