Hi Manjunath,Ok. I looked into this, and found that the structure needed to pass
On Friday 27 July 2012 05:49:24 Hadli, Manjunath wrote:On Thu, Jul 26, 2012 at 05:55:31, Laurent Pinchart wrote:You can set several parameters using a single ioctl, much likeOn Tuesday 17 July 2012 10:43:54 Hadli, Manjunath wrote:The version may not be required. Will remove it.On Sun, Jul 15, 2012 at 18:16:25, Laurent Pinchart wrote:[snip]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@xxxxxx>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@xxxxxx>
And what's the point of the application setting the version field ? HowThe application is responsible for filling this info. He would enumerate+Private IOCTLsWho is responsible for filling this field, the application or the
+==============
+
+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
driver ?
the capabilities first and set them using S_PARAM/G_PARAM.
does the driver use it ?
I feel if we implement direct IOCTLS there might be many of them. To makeWhy don't you implement something similar toThere are a lot of tiny modules in the previewer/resizer which are+ * @len: Length of the module config structureWhat is module_id for ? What does param point to ?
+ * @module_id: Module id
+ * @param: pointer to module config parameter.
enumerated as individual modules. The param points to the parameter set
that the module expects to be set.
VPFE_CMD_S_CCDC_RAW_PARAMS/VPFE_CMD_G_CCDC_RAW_PARAMS instead ?
sure than independent of the number of internal modules present, having the
same IOCTL used for all modules is a good idea.
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.
ditto.
My point wasn't that you shouldn't expose all device features, but that youWill remove.Let's first decide whether a version field is needed at all :-)It could be integer. It is generally a fixed point num, and easy to read+ */Is there a need to express the version as a string instead of an
+ struct prev_module_param {
+ char version[IMP_MAX_NAME_SIZE];
integer ?
it as a string than an integer. Can I keep it as a string?
Ditto.Why don't you implement something similar toConfig is setting which is required for a subdev to function based on+ unsigned short len;What's the difference between parameters and configuration ? What does
+ unsigned short module_id;
+ void *param;
+ };
+
+2: IOCTL: PREV_S_CONFIG/PREV_G_CONFIG
+Description:
+ Sets/Gets the configuration required by the previewer channel
+Parameter:
+ /**
+ * struct prev_channel_config - structure for configuring the
previewer
channel
+ * @len: Length of the user configuration
+ * @config: pointer to either single shot config or continuous
+ */
+ struct prev_channel_config {
+ unsigned short len;
+ void *config;
+ };
config point to ?
what it is set for (single shot/continuous.) common to all platforms.
Parameters are the settings for individual small sub-ips which might be
slightly different from one platform to another. Config points to
prev_single_shot_config or prev_continuous_config currently defined in
linux/dm3656ipipe.h. I think we will move it to a common location.
VPFE_CMD_S_CCDC_RAW_PARAMS/VPFE_CMD_G_CCDC_RAW_PARAMS here as well (same
for the resizer configuration ioctls) ?
Not exposing the full functionality might not be an option. The driver getsI totally agree with you on this, the tiny sub-blocks should not beThe number of these sub-Ips are quite a few in DM365 and Dm355, having a+Enumerating internal modules is exactly what the MC API was designed
+3: IOCTL: PREV_ENUM_CAP
+Description:
+ Queries the modules available in the image processor for preview
the
+ input image.
+Parameter:
+ /**
+ * struct prev_cap - structure to enumerate capabilities of
previewer
+ * @index: application use this to iterate over the available
modules
+ * @version: version of the preview module
+ * @module_id: module id
+ * @control: control operation allowed in continuous mode? 1 -
allowed, 0
- not allowed
+ * @path: path on which the module is sitting
+ * @module_name: module name
+ */
+ struct prev_cap {
+ unsigned short index;
+ char version[IMP_MAX_NAME_SIZE];
+ unsigned short module_id;
+ char control;
+ enum imp_data_paths path;
+ char module_name[IMP_MAX_NAME_SIZE];
+ };
for.
Why do you reimplement that using private ioctls ?
lot of them In a way that may be bewildering to the end-user to be able
to connect them quickly and properly. But overall, these are nothing
but exposed subips of what we call as CCDC,Previewer and Resizer.It
Made a lot of logical sense to keep it that way, give a default
configuration for everything, and if at all the user wants the fine
grain config control, be able to give (mainly for the configurations-
not so much for connections). In most of the cases the param IOTCLs are
only used for fine-tuning the image and not expected to be used as a
regular flow of a normal application. I do not think there could be any
justification for making all these nitty gritty which keep changing for
each IPs as part of regular V4L2 IOCTLs. In future, if there is a common
theme that emerges, we could definitely relook into this.
exposed as through the MC API. However, I would go one step further : I
wouldn't expose them through a private ioctl either. What would a
userspace application do with this information that it couldn't do with
just the entity name and its revision number ?
used by different kinds of users. Some might want to use only the basic
features, but many would like to have the full control in terms of setting
all the parameters. Since IPIPE is so much about tuning, not having a fine
grain control on its parameters is not an option.
don't need userspace to be able to dynamically enumerate the content of the
entity. Applications need to use your private ioctls so they know what
hardware they deal with. Knowing the entity name (and possibly revision)
should be enough.
Sure. Like we agreed, will send a separate patch for this.
ccdc[snip]
+5: IOCTL: VPFE_CMD_S_CCDC_RAW_PARAMS/VPFE_CMD_G_CCDC_RAW_PARAMS
+Description:
+ Sets/Gets the CCDC parameter
+Parameter:
+ /**
+ * struct ccdc_config_params_raw - structure for configuring
If you have hardware that can generate data in a given width, it needs a mediaThe specific fields here have the control of specifying the datawidth from 9That's correct.In that case only gain has to be taken out as a generic IOCTL. SinceparamsCan't you use subdev V4L2 controls for gains ?
+ * @linearize: linearization parameters for image sensor data
input
+ * @df_csc: data formatter or CSC
+ * @dfc: defect Pixel Correction (DFC) configuration
+ * @bclamp: Black/Digital Clamp configuration
+ * @gain_offset: Gain, offset adjustments
that is is The parameter which could be taken out of this big structure
The media bus format contains information about the data width, so I thinkOK.+ * @culling: CullingShouldn't color patterns be computed automatically by the driver based
+ * @pred: predictor for DPCM compression
+ * @horz_offset: horizontal offset for Gain/LSC/DFC
+ * @vert_offset: vertical offset for Gain/LSC/DFC
+ * @col_pat_field0: color pattern for field 0
+ * @col_pat_field1: color pattern for field 1
on
the media bus pixel code ?
Do you want to define new MBUS formats for these?+ * @data_size: data size from 8 to 16 bitsDitto, this should probably be computed automatically.
+ * @data_shift: data shift applied before storing to SDRAM
those fields are redundant.
bits to 16 bits. Did you want us to implement media bus format for all
these variations?
bus format, yes. Just don't add media bus formats for widths that are not
implemented in any hardware.
Thanks and Regards,
Just to make sure we do not get held up, I will send a separate patch onengine
mediabus formats for these variations for review. In the mean time, we will
go ahead with this.
[snip]Ok.+ * @test_pat_gen: enable input test pattern generationYou could use a subdev V4L2 control for that.
+ */
+ struct ccdc_config_params_raw {
+ struct ccdc_linearize linearize;
+ struct ccdc_df_csc df_csc;
+ struct ccdc_dfc dfc;
+ struct ccdc_black_clamp bclamp;
+ struct ccdc_gain_offsets_adj gain_offset;
+ struct ccdc_cul culling;
+ enum ccdc_dpcm_predictor pred;
+ unsigned short horz_offset;
+ unsigned short vert_offset;
+ struct ccdc_col_pat col_pat_field0;
+ struct ccdc_col_pat col_pat_field1;
+ enum ccdc_data_size data_size;
+ enum ccdc_datasft data_shift;
+ unsigned char test_pat_gen;
+ };
+
+7: IOCTL: AF_GET_STAT
+Description:
+ Copy the entire statistics located in application buffer
+ to user space from the AF engine
+Parameter:
+ /**
+ * struct af_statdata - structure to get statistics from AF
OK.I will. Let us get the current driver in. In the meantime I will do some[snip]Sure we can take it up sometime later.+ * @buffer: pointer to bufferThe OMAP3 ISP driver also needs to export statistics data to
+ * @buf_length: length of buffer
+ */
+ struct af_statdata {
+ void *buffer;
+ int buf_length;
+ };
userspace. We should design a common API here.
OK, but then please start a discussion on the mailing list about thisYes, we can discuss about it to make it common. I would prefer we get+9: IOCTL: AEW_GET_STATSame comment as for AF_GET_STAT.
+Description:
+ Copy the entire statistics located in application buffer
+ to user space from the AEW engine
+Parameter:
+ /**
+ * struct aew_statdata - structure to get statistics from AEW
engine
+ * @buffer: pointer to buffer
+ * @buf_length: length of buffer
+ */
+ struct aew_statdata {
+ void *buffer;
+ int buf_length;
+ };
this driver in and make amends when you are doing it for OMAP.
topic (CC'ing David Cohen as he might be interested).
analysis and send an RFC.
If possible, I would request for your ACK on this patch and driver.I can't ack this before we solve the PREV_ENUM_CAP, PREV_[GS]_PARAM and
PREV_[GS]_CONFIG issue.