c8c7ed99 | 19-Jun-2023 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: Implement get_frame_desc for camera-rx
CAL uses get_frame_desc to get the VC and DT for the incoming CSI-2 stream, but does it in a bit hacky way. Clean this up by implementing .get_
media: ti: cal: Implement get_frame_desc for camera-rx
CAL uses get_frame_desc to get the VC and DT for the incoming CSI-2 stream, but does it in a bit hacky way. Clean this up by implementing .get_frame_desc to camera-rx, and calling that from cal.c.
No functional change intended.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
e7bbe653 | 19-Jun-2023 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: Use subdev state
Change TI CAL driver to use subdev state. No functional changes (intended).
This allows us to get rid of the 'formats' field, as the formats are kept in the state,
media: ti: cal: Use subdev state
Change TI CAL driver to use subdev state. No functional changes (intended).
This allows us to get rid of the 'formats' field, as the formats are kept in the state, and also the 'mutex' as we already have state locking.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
2633288a | 19-Jun-2023 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: Fix cal_camerarx_create() error handling
We don't do a proper job at freeing resources in cal_camerarx_create's error paths.
Fix these, and also switch the phy allcation from kzallo
media: ti: cal: Fix cal_camerarx_create() error handling
We don't do a proper job at freeing resources in cal_camerarx_create's error paths.
Fix these, and also switch the phy allcation from kzalloc to devm_kzalloc to simplify the code further.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
e3a69496 | 15-Feb-2023 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: Prefer designated initializers over memset for subdev pad ops
Structures passed to subdev pad operations are all zero-initialized, but not always with the same kind of code constructs. While
media: Prefer designated initializers over memset for subdev pad ops
Structures passed to subdev pad operations are all zero-initialized, but not always with the same kind of code constructs. While most drivers used designated initializers, which zero all the fields that are not specified, when declaring variables, some use memset(). Those two methods lead to the same end result, and, depending on compiler optimizations, may even be completely equivalent, but they're not consistent.
Improve coding style consistency by using designated initializers instead of calling memset(). Where applicable, also move the variables to inner scopes of for loops to ensure correct initialization in all iterations.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com> # For am437x Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
d91105e0 | 26-Apr-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: fix wdma irq for metadata
CAL HW interrupts are inherently racy. If we get both start and end interrupts, we don't know what has happened: did the DMA for a single frame start and en
media: ti: cal: fix wdma irq for metadata
CAL HW interrupts are inherently racy. If we get both start and end interrupts, we don't know what has happened: did the DMA for a single frame start and end, or did one frame end and a new frame start?
Usually for normal pixel frames we get the interrupts separately. If we do get both, we have to guess. The assumption in the code is that the active vertical area is larger than the blanking vertical area, and thus it is more likely that we get the end of the old frame and the start of a new frame.
However, for embedded data, which is only a few lines high, we always get both interrupts. Here the assumption is that we get both for the same frame.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
0872dc04 | 26-Apr-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: combine wdma irq handling
Instead of handling the WDMA START and END interrupts separately, we need to handle both at the same time to better manage the inherent race conditions rela
media: ti: cal: combine wdma irq handling
Instead of handling the WDMA START and END interrupts separately, we need to handle both at the same time to better manage the inherent race conditions related to CAL interrupts.
Change the code so that we have a single function, cal_irq_handle_wdma(), which gets two booleans, start and end, as parameters, which allows us to manage the race conditions in the following patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
ebdb28a5 | 26-Apr-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: use CSI-2 frame number for seq number
The userspace needs a way to match received metadata buffers to pixel data buffers. The obvious way to do this is to use the CSI-2 frame number,
media: ti: cal: use CSI-2 frame number for seq number
The userspace needs a way to match received metadata buffers to pixel data buffers. The obvious way to do this is to use the CSI-2 frame number, as both the metadata and the pixel data have the same frame number as they come from the same frame.
However, we don't have means to convey the frame number to userspace. We do have the 'sequence' field, which with a few tricks can be used for this purpose.
To achieve this, track the frame number for each virtual channel and increase the sequence for each virtual channel by frame-number - previous-frame-number, also taking into account the eventual wrap of the CSI-2 frame number. If the CSI-2 peripheral does not support frame numbers, CAL increases the frame number register by one each frame.
This way we get a monotonically increasing sequence number which is common to all streams using the same virtual channel.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
b1b93d36 | 26-Apr-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: ti: cal: rename sd_state to state
Rename 'sd_state' parameters to 'state'. There are no other states, so there is no ambiguity.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com
media: ti: cal: rename sd_state to state
Rename 'sd_state' parameters to 'state'. There are no other states, so there is no ambiguity.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|