Hi Mauro,
On Mon, Oct 12, 2015 at 09:26:04PM -0300, Mauro Carvalho Chehab wrote:
Em Tue, 13 Oct 2015 01:25:35 +0300 Sakari Ailus sakari.ailus@iki.fi escreveu:
Hi Mauro,
On Mon, Oct 12, 2015 at 01:43:32PM -0300, Mauro Carvalho Chehab wrote:
Instead of abusing MEDIA_ENT_T_V4L2_SUBDEV, initialize new subdev entities as MEDIA_ENT_T_UNKNOWN.
Change-Id: I294ee20f49b6c40dd95339d6730d90fa85b0dea9 Signed-off-by: Mauro Carvalho Chehab mchehab@osg.samsung.com Acked-by: Hans Verkuil hans.verkuil@cisco.com
drivers/media/media-device.c | 6 ++++++ drivers/media/v4l2-core/v4l2-subdev.c | 2 +- include/uapi/linux/media.h | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 659507bce63f..134fe7510195 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -435,6 +435,12 @@ int __must_check media_device_register_entity(struct media_device *mdev, { int i;
- if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN ||
entity->type == MEDIA_ENT_T_UNKNOWN)
dev_warn(mdev->dev,
"Entity type for entity %s was not initialized!\n",
entity->name);
I don't think I'd warn about MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN --- there are entities that do not fall into any category of existing functions. For instance image signal processors have such; they are hardware specific and often their functionality is somewhat so as well. Some of them perform a variety of functions (image processing algorithms) but I doubt it'd make sense to start e.g. listing those until we have any standardised interface for them.
The two entities in smiapp don't have a specific function either. Adding a new one (scaler) might make sense for the two, but I think I'd leave that out from this set.
IMHO, if the entity function is really unknown, it shouldn't even be at the graph in the first place, as an unknown entity can't be controlled.
These used to be just "sub-devices" without a type that 1) did not fall into any existing category and 2) was not generic enough to warrant adding a specific type for them. I don't think that has really changed with functions.
So, I think we should either add a new function for those entities, for them to be used on userspace, or simply remove them, if they won't be used on userspace, because they aren't documented.
What kind of "function" could you use for e.g. OMAP3ISP CCDC or preview blocks?
The issue is that for the user to meaningfully use the devices, one has to know exactly what they are. The fact they do "image processing" for instance is not really useful alone.
Flash devices, for instance, have a well defined control interface. The fact that a device can do scaling or cropping can be found querying the selections. Besides, a sensor sub-device could be capable of scaling or cropping as well.