mbox series

[v1,0/9] media: vimc improvements

Message ID 20240424235741.17093-1-laurent.pinchart@ideasonboard.com (mailing list archive)
Headers show
Series media: vimc improvements | expand

Message

Laurent Pinchart April 24, 2024, 11:57 p.m. UTC
Hello,

This patch series cleans up and improves the vimc driver, with the end
goal of converting it to the V4L2 subdev active state API. The goal of
this exercise is to make the API used by a virtual test driver, to
increase test coverage.

The series starts with 4 random cleanups, to avoid unnecessary
iterations (1/9), constify structures (2/9 and 3/9) and rename a
weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
internal_ops initialization to prepare for the switch to the active
state API. The remaining patches (6/9 to 9/9) convert the vimc entities
to the new API one by one.

The result has been tested using the libcamera unit tests, which make
extensive use of the vimc driver, as well as with v4l2-compliance. The
latter reports 4 errors, but they occur already with the latest stage
master branch.

Laurent Pinchart (9):
  media: vimc: Don't iterate over single pad
  media: vimc: Constify vimc_ent_type structures
  media: vimc: Constify the ent_config array
  media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad
  media: vimc: Centralize subdev internal_ops initialization
  media: vimc: Initialize subdev active state
  media: vimc: sensor: Use subdev active state
  media: vimc: debayer: Use subdev active state
  media: vimc: scaler: Use subdev active state

 .../media/test-drivers/vimc/vimc-capture.c    |   2 +-
 drivers/media/test-drivers/vimc/vimc-common.c |  25 ++-
 drivers/media/test-drivers/vimc/vimc-common.h |  14 +-
 drivers/media/test-drivers/vimc/vimc-core.c   |   2 +-
 .../media/test-drivers/vimc/vimc-debayer.c    | 197 ++++++++----------
 drivers/media/test-drivers/vimc/vimc-lens.c   |   5 +-
 drivers/media/test-drivers/vimc/vimc-scaler.c | 134 +++++-------
 drivers/media/test-drivers/vimc/vimc-sensor.c | 125 +++++------
 8 files changed, 236 insertions(+), 268 deletions(-)


base-commit: e42a204f0519a2540f1507ac2798be2aeaa76bee

Comments

Laurent Pinchart May 5, 2024, 8:36 p.m. UTC | #1
Hello,

On Thu, Apr 25, 2024 at 02:57:32AM +0300, Laurent Pinchart wrote:
> Hello,
> 
> This patch series cleans up and improves the vimc driver, with the end
> goal of converting it to the V4L2 subdev active state API. The goal of
> this exercise is to make the API used by a virtual test driver, to
> increase test coverage.
> 
> The series starts with 4 random cleanups, to avoid unnecessary
> iterations (1/9), constify structures (2/9 and 3/9) and rename a
> weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
> internal_ops initialization to prepare for the switch to the active
> state API. The remaining patches (6/9 to 9/9) convert the vimc entities
> to the new API one by one.
> 
> The result has been tested using the libcamera unit tests, which make
> extensive use of the vimc driver, as well as with v4l2-compliance. The
> latter reports 4 errors, but they occur already with the latest stage
> master branch.

Any comment about this patch series ? Shuah, do you plan to give it a
look ? If you don't have much time for vimc these days that's OK, I can
work with Kieran to get the patches reviewed.

On a related note, I would like to modify the MC pipeline of the vimc
driver to make it look more like a real ISP. This would help with unit
testing and compliance testing in libcamera. I briefly discussed this
with Hans on IRC who had no objection. If anyone has any issue or
concern with this plan, I would appreciate if you could let me know.

> Laurent Pinchart (9):
>   media: vimc: Don't iterate over single pad
>   media: vimc: Constify vimc_ent_type structures
>   media: vimc: Constify the ent_config array
>   media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad
>   media: vimc: Centralize subdev internal_ops initialization
>   media: vimc: Initialize subdev active state
>   media: vimc: sensor: Use subdev active state
>   media: vimc: debayer: Use subdev active state
>   media: vimc: scaler: Use subdev active state
> 
>  .../media/test-drivers/vimc/vimc-capture.c    |   2 +-
>  drivers/media/test-drivers/vimc/vimc-common.c |  25 ++-
>  drivers/media/test-drivers/vimc/vimc-common.h |  14 +-
>  drivers/media/test-drivers/vimc/vimc-core.c   |   2 +-
>  .../media/test-drivers/vimc/vimc-debayer.c    | 197 ++++++++----------
>  drivers/media/test-drivers/vimc/vimc-lens.c   |   5 +-
>  drivers/media/test-drivers/vimc/vimc-scaler.c | 134 +++++-------
>  drivers/media/test-drivers/vimc/vimc-sensor.c | 125 +++++------
>  8 files changed, 236 insertions(+), 268 deletions(-)
> 
> 
> base-commit: e42a204f0519a2540f1507ac2798be2aeaa76bee
Shuah Khan May 28, 2024, 3:49 p.m. UTC | #2
On 5/5/24 14:36, Laurent Pinchart wrote:
> Hello,
> 
> On Thu, Apr 25, 2024 at 02:57:32AM +0300, Laurent Pinchart wrote:
>> Hello,
>>
>> This patch series cleans up and improves the vimc driver, with the end
>> goal of converting it to the V4L2 subdev active state API. The goal of
>> this exercise is to make the API used by a virtual test driver, to
>> increase test coverage.
>>
>> The series starts with 4 random cleanups, to avoid unnecessary
>> iterations (1/9), constify structures (2/9 and 3/9) and rename a
>> weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
>> internal_ops initialization to prepare for the switch to the active
>> state API. The remaining patches (6/9 to 9/9) convert the vimc entities
>> to the new API one by one.
>>
>> The result has been tested using the libcamera unit tests, which make
>> extensive use of the vimc driver, as well as with v4l2-compliance. The
>> latter reports 4 errors, but they occur already with the latest stage
>> master branch.
> 
> Any comment about this patch series ? Shuah, do you plan to give it a
> look ? If you don't have much time for vimc these days that's OK, I can
> work with Kieran to get the patches reviewed.
> 

Sorry for the delay. I will take a look and apply them for the next
release.

> On a related note, I would like to modify the MC pipeline of the vimc
> driver to make it look more like a real ISP. This would help with unit
> testing and compliance testing in libcamera. I briefly discussed this
> with Hans on IRC who had no objection. If anyone has any issue or
> concern with this plan, I would appreciate if you could let me know.
> 

I am good with the plan.

thanks,
-- Shuah
Shuah Khan May 30, 2024, 7:34 p.m. UTC | #3
On 4/24/24 17:57, Laurent Pinchart wrote:
> Hello,
> 
> This patch series cleans up and improves the vimc driver, with the end
> goal of converting it to the V4L2 subdev active state API. The goal of
> this exercise is to make the API used by a virtual test driver, to
> increase test coverage.
> 
> The series starts with 4 random cleanups, to avoid unnecessary
> iterations (1/9), constify structures (2/9 and 3/9) and rename a
> weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
> internal_ops initialization to prepare for the switch to the active
> state API. The remaining patches (6/9 to 9/9) convert the vimc entities
> to the new API one by one.
> 
> The result has been tested using the libcamera unit tests, which make
> extensive use of the vimc driver, as well as with v4l2-compliance. The
> latter reports 4 errors, but they occur already with the latest stage
> master branch.
> 
> Laurent Pinchart (9):
>    media: vimc: Don't iterate over single pad
Please drop the first patch.

>    media: vimc: Constify vimc_ent_type structures
>    media: vimc: Constify the ent_config array
>    media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad
>    media: vimc: Centralize subdev internal_ops initialization
>    media: vimc: Initialize subdev active state
>    media: vimc: sensor: Use subdev active state
>    media: vimc: debayer: Use subdev active state
>    media: vimc: scaler: Use subdev active state
> 
>   .../media/test-drivers/vimc/vimc-capture.c    |   2 +-
>   drivers/media/test-drivers/vimc/vimc-common.c |  25 ++-
>   drivers/media/test-drivers/vimc/vimc-common.h |  14 +-
>   drivers/media/test-drivers/vimc/vimc-core.c   |   2 +-
>   .../media/test-drivers/vimc/vimc-debayer.c    | 197 ++++++++----------
>   drivers/media/test-drivers/vimc/vimc-lens.c   |   5 +-
>   drivers/media/test-drivers/vimc/vimc-scaler.c | 134 +++++-------
>   drivers/media/test-drivers/vimc/vimc-sensor.c | 125 +++++------
>   8 files changed, 236 insertions(+), 268 deletions(-)
> 
> 
> base-commit: e42a204f0519a2540f1507ac2798be2aeaa76bee

Others look good to me. I can apply them all for 6.11-rc1.
Please send v2 without the first patch if others depend
on it.

thanks,
-- Shuah
Shuah Khan June 20, 2024, 3:59 p.m. UTC | #4
On 4/24/24 17:57, Laurent Pinchart wrote:
> Hello,
> 
> This patch series cleans up and improves the vimc driver, with the end
> goal of converting it to the V4L2 subdev active state API. The goal of
> this exercise is to make the API used by a virtual test driver, to
> increase test coverage.
> 
> The series starts with 4 random cleanups, to avoid unnecessary
> iterations (1/9), constify structures (2/9 and 3/9) and rename a
> weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
> internal_ops initialization to prepare for the switch to the active
> state API. The remaining patches (6/9 to 9/9) convert the vimc entities
> to the new API one by one.
> 
> The result has been tested using the libcamera unit tests, which make
> extensive use of the vimc driver, as well as with v4l2-compliance. The
> latter reports 4 errors, but they occur already with the latest stage
> master branch.
> 
> Laurent Pinchart (9):
>    media: vimc: Don't iterate over single pad
>    media: vimc: Constify vimc_ent_type structures
>    media: vimc: Constify the ent_config array
>    media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad
>    media: vimc: Centralize subdev internal_ops initialization
>    media: vimc: Initialize subdev active state
>    media: vimc: sensor: Use subdev active state
>    media: vimc: debayer: Use subdev active state
>    media: vimc: scaler: Use subdev active state
> 

Thank you. Applied the series to

https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=vimc

I will send pull request to Mauro in a week.

thanks,
-- Shuah
Laurent Pinchart June 20, 2024, 4:09 p.m. UTC | #5
On Thu, Jun 20, 2024 at 09:59:31AM -0600, Shuah Khan wrote:
> On 4/24/24 17:57, Laurent Pinchart wrote:
> > Hello,
> > 
> > This patch series cleans up and improves the vimc driver, with the end
> > goal of converting it to the V4L2 subdev active state API. The goal of
> > this exercise is to make the API used by a virtual test driver, to
> > increase test coverage.
> > 
> > The series starts with 4 random cleanups, to avoid unnecessary
> > iterations (1/9), constify structures (2/9 and 3/9) and rename a
> > weirdly-named enum (4/9). Patch 5/9 then centralizes the subdev
> > internal_ops initialization to prepare for the switch to the active
> > state API. The remaining patches (6/9 to 9/9) convert the vimc entities
> > to the new API one by one.
> > 
> > The result has been tested using the libcamera unit tests, which make
> > extensive use of the vimc driver, as well as with v4l2-compliance. The
> > latter reports 4 errors, but they occur already with the latest stage
> > master branch.
> > 
> > Laurent Pinchart (9):
> >    media: vimc: Don't iterate over single pad
> >    media: vimc: Constify vimc_ent_type structures
> >    media: vimc: Constify the ent_config array
> >    media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad
> >    media: vimc: Centralize subdev internal_ops initialization
> >    media: vimc: Initialize subdev active state
> >    media: vimc: sensor: Use subdev active state
> >    media: vimc: debayer: Use subdev active state
> >    media: vimc: scaler: Use subdev active state
> > 
> 
> Thank you. Applied the series to
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=vimc
> 
> I will send pull request to Mauro in a week.

Thank you Shuah. Much appreciated.