summaryrefslogtreecommitdiffstats
path: root/drivers/media/test-drivers/vimc/vimc-core.c
AgeCommit message (Collapse)AuthorFilesLines
2022-11-25media: vimc: Fix wrong function called when vimc_init() failsChen Zhongjin1-1/+1
In vimc_init(), when platform_driver_register(&vimc_pdrv) fails, platform_driver_unregister(&vimc_pdrv) is wrongly called rather than platform_device_unregister(&vimc_pdev), which causes kernel warning: Unexpected driver unregister! WARNING: CPU: 1 PID: 14517 at drivers/base/driver.c:270 driver_unregister+0x8f/0xb0 RIP: 0010:driver_unregister+0x8f/0xb0 Call Trace: <TASK> vimc_init+0x7d/0x1000 [vimc] do_one_initcall+0xd0/0x4e0 do_init_module+0x1cf/0x6b0 load_module+0x65c2/0x7820 Fixes: 4a29b7090749 ("[media] vimc: Subdevices as modules") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-27media: vimc: wrong pointer is used with PTR_ERRHans Verkuil1-1/+1
Fix smatch warning: drivers/media/test-drivers/vimc/vimc-core.c:214 vimc_create_links() warn: passing a valid pointer to 'PTR_ERR' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-15media: vimc: use data link entities enum to index the ent_config arrayDaniel Oakley1-11/+11
Future additions to the ent_config[] could break the association between the index of the struct vimc_ent_config entries in the ent_config[] array, and the index defined by the enum proposed in the previous patch. Using designated initializers solves this by linking the 2 together clearly in code and prevents the array not reflecting the enum. There is no functional change intended. Suggested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Oakley <daniel.oakley@ideasonboard.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-15media: vimc: enumerate data link entities for clarityDaniel Oakley1-8/+28
The data_links array was hard to read and understand. By implementing enumerated vimc data link entities, clarity has been improved when defining data_links. This therefore should help new programmers to understand the codebase better. There is no functional change intended. Suggested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Oakley <daniel.oakley@ideasonboard.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-15media: vimc: expand the names of vimc entity typesDaniel Oakley1-11/+11
When introducing the lens controller, it became apparent that the vimc entity type names were hard to understand, e.g. vimc_len_type refers to the lens. The names of the vimc entity types have been expanded to make the code easier to understand. There is no functional change intended. Suggested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Oakley <daniel.oakley@ideasonboard.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-15media: vimc: add ancillary lensYunke Cao1-20/+66
Add lens to vimc driver and link them with sensors using ancillary links. Provides an example of ancillary link usage.The lens supports FOCUS_ABSOLUTE control. Test example: With default vimc topology > media-ctl -p Media controller API version 5.18.0 ... - entity 28: Lens A (0 pad, 0 link) type V4L2 subdev subtype Lens flags 0 device node name /dev/v4l-subdev6 - entity 29: Lens B (0 pad, 0 link) type V4L2 subdev subtype Lens flags 0 device node name /dev/v4l-subdev7 > v4l2-ctl -d /dev/v4l-subdev7 -C focus_absolute focus_absolute: 0 Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Yunke Cao <yunkec@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-16media: vimc: Add support for contiguous DMA buffersLaurent Pinchart1-0/+10
The vimc driver is used for testing purpose, and some test use cases involve sharing buffers with a consumer device. Consumers often require DMA contiguous memory, which vimc doesn't currently support. This leads in the best case to usage of bounce buffers, which is very slow, and in the worst case in a complete failure. Add support for the dma-contig allocator in vimc to support those use cases properly. The allocator is selected through a new "allocator" module parameter, which defaults to vmalloc. [hverkuil: add missing 'select VIDEOBUF2_DMA_CONFIG' to Kconfig] Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2020-07-19media: vimc: Add a control to display info on test imageKaaira Gupta1-0/+10
Add a control in VIMC to display information such as the correct order of colors for a given test pattern, counter, brightness, hue, saturation, contrast, width and height at sensor over test image. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Acked-by: Helen Koike <helen.koike@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-16media: media/test_drivers: rename to test-driversHans Verkuil1-0/+369
We never use _ in directory names in the media subsystem, so rename to test-drivers instead for consistency. Also update MAINTAINERS with the new path. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>