Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-media@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: Re: [PATCH v1 1/9] media: vimc: Don't iterate over single pad
Date: Thu, 30 May 2024 23:21:53 +0300	[thread overview]
Message-ID: <20240530202153.GA23937@pendragon.ideasonboard.com> (raw)
In-Reply-To: <339ab149-6cfc-498e-9650-e72e7e2cd039@linuxfoundation.org>

On Thu, May 30, 2024 at 02:18:05PM -0600, Shuah Khan wrote:
> On 5/30/24 13:45, Laurent Pinchart wrote:
> > On Thu, May 30, 2024 at 01:27:53PM -0600, Shuah Khan wrote:
> >> On 4/24/24 17:57, Laurent Pinchart wrote:
> >>> The .init_state() operations of the debayer and sensor entities iterate
> >>> over the entity's pads. In practice, the iteration covers a single pad
> >>> only. Access the pad directly and remove the loops.
> >>
> >> I am not seeing much of a reason to do this. This code is good
> >> even when num_pads change.
> >>
> >> Don't change the loops.
> > 
> > Why so ? Beside the fact that the loop wastes some CPU cycles, the
> > current code implies that there would be multiple source pads, which is
> > confusing for the reader. I think the result of this patch is both
> > improved efficiency and improved readability.
> 
> It is currently flexible and if and when more pads get added,
> there is no need to change it. I am not concerned about the
> efficiency on this test driver. Also people use the test
> driver as a sample.

If pad gets added, we don't know yet if the code will work as-is.
Chances are it will need to change anyway. I don't think it's a good
idea to prepare for a situation that we can't foresee without having
good reasons to make assumptions.

I have plans to refactor the vimc driver exteensively, changing how the
different entities behave, to bring it closer to how a real inline ISP
is architectured. The .init_state() functions will likely be rewritten
completely.

I agree with the sample argument, and that's one more reason why I think
this patch does the right thing :-)

> Please leave it the way it is.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-05-30 20:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 23:57 [PATCH v1 0/9] media: vimc improvements Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 1/9] media: vimc: Don't iterate over single pad Laurent Pinchart
2024-05-30 19:27   ` Shuah Khan
2024-05-30 19:45     ` Laurent Pinchart
2024-05-30 20:18       ` Shuah Khan
2024-05-30 20:21         ` Laurent Pinchart [this message]
2024-05-30 20:58           ` Shuah Khan
2024-06-20 10:47           ` Hans Verkuil
2024-06-20 13:00             ` Sakari Ailus
2024-06-20 15:33               ` Shuah Khan
2024-06-20 13:01   ` Sakari Ailus
2024-04-24 23:57 ` [PATCH v1 2/9] media: vimc: Constify vimc_ent_type structures Laurent Pinchart
2024-05-30 19:28   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 3/9] media: vimc: Constify the ent_config array Laurent Pinchart
2024-05-30 19:29   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 4/9] media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad Laurent Pinchart
2024-05-30 19:29   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 5/9] media: vimc: Centralize subdev internal_ops initialization Laurent Pinchart
2024-05-30 19:31   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 6/9] media: vimc: Initialize subdev active state Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 7/9] media: vimc: sensor: Use " Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 8/9] media: vimc: debayer: " Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 9/9] media: vimc: scaler: " Laurent Pinchart
2024-05-05 20:36 ` [PATCH v1 0/9] media: vimc improvements Laurent Pinchart
2024-05-28 15:49   ` Shuah Khan
2024-05-30 19:34 ` Shuah Khan
2024-06-20 15:59 ` Shuah Khan
2024-06-20 16:09   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240530202153.GA23937@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox