aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/test-drivers/vimc/vimc-common.c
AgeCommit message (Collapse)AuthorFilesLines
2024-06-26media: vimc: Initialize subdev active stateLaurent Pinchart1-1/+22
Finalize subdev initialization for all subdevs that provide a .init_state() operation. This creates an active state for all those subdevs, which subsequent patches will use to simplify the implementation of individual vimc entities. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-26media: vimc: Centralize subdev internal_ops initializationLaurent Pinchart1-0/+2
Initialize the subdev internal_ops field in the vimc_ent_sd_register() function. This handles the internal ops the same way as the subdev ops, and prepares for moving to the V4L2 subdev active state API. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-12media: Zero-initialize all structures passed to subdev pad operationsLaurent Pinchart1-4/+4
Several drivers call subdev pad operations, passing structures that are not fully zeroed. While the drivers initialize the fields they care about explicitly, this results in reserved fields having uninitialized values. Future kernel API changes that make use of those fields thus risk breaking proper driver operation in ways that could be hard to detect. To avoid this, make the code more robust by zero-initializing all the structures passed to subdev pad operation. Maintain a consistent coding style by preferring designated initializers (which zero-initialize all the fields that are not specified) over memset() where possible, and make variable declarations local to inner scopes where applicable. One notable exception to this rule is in the ipu3 driver, where a memset() is needed as the structure is not a local variable but a function parameter provided by the caller. Not all fields of those structures can be initialized when declaring the variables, as the values for those fields are computed later in the code. Initialize the 'which' field in all cases, and other fields when the variable declaration is so close to the v4l2_subdev_call() call that it keeps all the context easily visible when reading the code, to avoid hindering readability. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Shuah Khan <[email protected]> # For vimc Reviewed-by: Lad Prabhakar <[email protected]> # For am437x Acked-by: Sakari Ailus <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> # For drivers/staging/media/imx/ Signed-off-by: Hans Verkuil <[email protected]>
2020-05-05media: vimc: Add missing {RGB,BGR,GBR}888 media bus codesNícolas F. R. A. Prado1-2/+14
Add missing RGB888_*, BGR888_* and GBR888_* media bus codes in the vimc_pix_map_list. Since there is no GBR24 pixelformat, use the RGB24 pixelformat for MEDIA_BUS_FMT_GBR888_1X24. Acked-by: Helen Koike <[email protected]> Co-developed-by: Vitor Massaru Iha <[email protected]> Signed-off-by: Vitor Massaru Iha <[email protected]> Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-05-05media: vimc: Support multiple media bus codes for each pixelformatNícolas F. R. A. Prado1-26/+45
Change vimc_pix_map_list to allow multiple media bus codes to map to the same pixelformat, making it possible to add media bus codes for which there are no pixelformat. Acked-by: Helen Koike <[email protected]> Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: fix sparse warning: const u32 -> u32] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>