All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Manju <manjunath.hadli@ti.com>
Cc: "davinci-linux-open-source@linux.davincidsp.com" 
	<davinci-linux-open-source@linux.davincidsp.com>,
	LMML <linux-media@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Landley <rob@landley.net>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	David Cohen <david.a.cohen@linux.intel.com>
Subject: Re: [PATCH] [media] davinci: vpfe: Add documentation
Date: Thu, 02 Aug 2012 23:25:43 +0200	[thread overview]
Message-ID: <8508926.WDmbUJmVgK@avalon> (raw)
In-Reply-To: <50178D17.8030504@ti.com>

Hi Manjunath,

On Tuesday 31 July 2012 13:15:27 Manju wrote:
> On Friday 27 July 2012 04:19 PM, Laurent Pinchart wrote:
> > On Friday 27 July 2012 05:49:24 Hadli, Manjunath wrote:
> >> On Thu, Jul 26, 2012 at 05:55:31, Laurent Pinchart wrote:
> >>> On Tuesday 17 July 2012 10:43:54 Hadli, Manjunath wrote:
> >>>> On Sun, Jul 15, 2012 at 18:16:25, Laurent Pinchart wrote:
> >>>>> On Wednesday 11 July 2012 21:09:26 Manjunath Hadli wrote:
> >>>>>> Add documentation on the Davinci VPFE driver. Document the subdevs,
> >>>>>> and private IOTCLs the driver implements
> >>>>>> 
> >>>>>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> >>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> >>> 
> >>> [snip]
> >>> 
> >>>>>> +Private IOCTLs
> >>>>>> +==============
> >>>>>> +
> >>>>>> +The Davinci Video processing Front End (VPFE) driver supports
> >>>>>> standard V4L2
> >>>>>> +IOCTLs and controls where possible and practical. Much of the
> >>>>>> functions provided
> >>>>>> +by the VPFE, however, does not fall under the standard IOCTLs.
> >>>>>> +
> >>>>>> +In general, there is a private ioctl for configuring each of the
> >>>>>> blocks
> >>>>>> +containing hardware-dependent functions.
> >>>>>> +
> >>>>>> +The following private IOCTLs are supported:
> >>>>>> +
> >>>>>> +1: IOCTL: PREV_S_PARAM/PREV_G_PARAM
> >>>>>> +Description:
> >>>>>> +	Sets/Gets the parameters required by the previewer module
> >>>>>> +Parameter:
> >>>>>> +	/**
> >>>>>> +	 * struct prev_module_param- structure to configure preview
> >>>>>> modules
> >>>>>> +	 * @version: Version of the preview module
> >>>>> 
> >>>>> Who is responsible for filling this field, the application or the
> >>>>> driver ?
> >>>> 
> >>>> The application is responsible for filling this info. He would
> >>>> enumerate the capabilities first and  set them using S_PARAM/G_PARAM.
> >>> 
> >>> And what's the point of the application setting the version field ? How
> >>> does the driver use it ?
> >> 
> >> The version may not be required. Will remove it.
> >> 
> >>>>>> +	 * @len: Length of the module config structure
> >>>>>> +	 * @module_id: Module id
> >>>>>> +	 * @param: pointer to module config parameter.
> >>>>> 
> >>>>> What is module_id for ? What does param point to ?
> >>>> 
> >>>> There are a lot of tiny modules in the previewer/resizer which are
> >>>> enumerated as individual modules. The param points to the parameter set
> >>>> that the module expects to be set.
> >>> 
> >>> Why don't you implement something similar to
> >>> VPFE_CMD_S_CCDC_RAW_PARAMS/VPFE_CMD_G_CCDC_RAW_PARAMS instead ?
> >> 
> >> I feel if we implement direct IOCTLS there might be many of them. To make
> >> sure than independent of the number of internal modules present, having
> >> the
> >> same IOCTL used for all modules is a good idea.
> > 
> > You can set several parameters using a single ioctl, much like
> > VPFE_CMD_S_CCDC_RAW_PARAMS does. You don't need one ioctl per parameter.
> > 
> > PREV_ENUM_CAP, PREV_[GS]_PARAM and PREV_[GS]_CONFIG are essentially
> > reinventing V4L2 controls, and I don't think that's a good idea.
> 
> Ok. I looked into this, and found that the structure needed to pass
> all the parameters is going to be huge. just to avoid a big structure
> from the user space, I propose:
> 
> Having a union of structures and a parameter identifying the structure.
> 
> In that way, we will remove the enumeration and all the other
> things except for a SET and GET, much like the CCDC_RAW_PARAMS
> like you suggested. So essentially we will have only 2 IOCTLS for setting
> the private params/configs and remove the rest.  I hope that was your
> point and this proposal will solve it?

What about something like the following structure, from the OMAP3 ISP driver ?

struct omap3isp_prev_update_config {
        __u32 update;
        __u32 flag;
        __u32 shading_shift;
        struct omap3isp_prev_luma __user *luma;
        struct omap3isp_prev_hmed __user *hmed;
        struct omap3isp_prev_cfa __user *cfa;
        struct omap3isp_prev_csup __user *csup;
        struct omap3isp_prev_wbal __user *wbal;
        struct omap3isp_prev_blkadj __user *blkadj;
        struct omap3isp_prev_rgbtorgb __user *rgb2rgb;
        struct omap3isp_prev_csc __user *csc;
        struct omap3isp_prev_yclimit __user *yclimit;
        struct omap3isp_prev_dcor __user *dcor;
        struct omap3isp_prev_nf __user *nf;
        struct omap3isp_prev_gtables __user *gamma;
};

I'll probably have more comments when I'll see the complete list of parameters 
you need to expose.

> >>>>>> +	 */
> >>>>>> +	struct prev_module_param {
> >>>>>> +		char version[IMP_MAX_NAME_SIZE];
> >>>>> 
> >>>>> Is there a need to express the version as a string instead of an
> >>>>> integer ?
> >>>> 
> >>>> It could be integer. It is generally a fixed point num, and easy to
> >>>> read
> >>>> it as a string than an integer. Can I keep it as a string?
> >>> 
> >>> Let's first decide whether a version field is needed at all :-)
> >> 
> >> Will remove.
> >> 
> >>>>>> +		unsigned short len;
> >>>>>> +		unsigned short module_id;
> >>>>>> +		void *param;
> >>>>>> +	};

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-08-02 21:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1342021166-6092-1-git-send-email-manjunath.hadli@ti.com>
2012-07-15 12:46 ` [PATCH] [media] davinci: vpfe: Add documentation Laurent Pinchart
2012-07-17 10:43   ` Hadli, Manjunath
2012-07-17 10:43     ` Hadli, Manjunath
2012-07-26  0:12     ` Laurent Pinchart
2012-07-26  0:12       ` Laurent Pinchart
2012-07-26  0:13       ` Laurent Pinchart
2012-07-26  0:25     ` Laurent Pinchart
2012-07-26  0:25       ` Laurent Pinchart
2012-07-27  5:49       ` Hadli, Manjunath
2012-07-27  5:49         ` Hadli, Manjunath
2012-07-27 10:49         ` Laurent Pinchart
2012-07-27 10:49           ` Laurent Pinchart
2012-07-31  7:45           ` Manju
2012-07-31  7:45             ` Manju
2012-08-02 21:25             ` Laurent Pinchart [this message]
2012-08-02 21:25               ` Laurent Pinchart
2012-08-02  0:07 ` Sakari Ailus
2012-08-09  3:43   ` Manjunath Hadli
2012-08-16 16:23     ` Sakari Ailus
2012-08-22  8:56       ` Manjunath Hadli
2012-09-01 17:25         ` Sakari Ailus
2012-09-01 17:26           ` Sakari Ailus
2012-09-04  6:14           ` Manjunath Hadli
2012-08-29 14:41       ` Prabhakar Lad
2012-09-01  9:57         ` Sakari Ailus
2012-09-01 14:22           ` Laurent Pinchart
2012-09-01 14:53             ` Prabhakar Lad
2012-09-01 16:11               ` Sakari Ailus
2012-09-02  3:03                 ` Laurent Pinchart
2012-09-02  8:44             ` Hans Verkuil
2012-08-16 13:10 ` Rob Landley
2012-08-16 13:24   ` Prabhakar Lad

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=8508926.WDmbUJmVgK@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=david.a.cohen@linux.intel.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=manjunath.hadli@ti.com \
    --cc=mchehab@infradead.org \
    --cc=rob@landley.net \
    /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.