public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] media: pisp-be: Split jobs creation and scheduling
@ 2024-09-02 11:24 Jacopo Mondi
  2024-09-02 11:24 ` [PATCH v4 1/4] media: pisp_be: Drop reference to non-existing function Jacopo Mondi
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jacopo Mondi @ 2024-09-02 11:24 UTC (permalink / raw)
  To: Naushir Patuck, Nick Hollinghurst, David Plowman, Dave Stevenson,
	Laurent Pinchart
  Cc: Jacopo Mondi, linux-media

v3->v4:
- Expand commit message in 2/4 to explain why removing validation in schedule()
  is safe
- Drop ready_lock spinlock
- Use non _irqsave version of safe_guard(spinlock
- Support !CONFIG_PM in 4/4 by calling the enable/disable routines directly
  and adjust pm_runtime usage as suggested by Laurent

v2->v3:
- Mark pispbe_runtime_resume() as __maybe_unused
- Add fixes tags where appropriate

v1->v2:
- Add two patches to address Laurent's comments separately
- use scoped_guard() when possible
- Add patch to fix runtime_pm imbalance

Currently the 'pispbe_schedule()' function does two things:

1) Tries to assemble a job by inspecting all the video node queues
   to make sure all the required buffers are available
2) Submit the job to the hardware

The pispbe_schedule() function is called at:

- video device start_streaming() time
- video device qbuf() time
- irq handler

As assembling a job requires inspecting all queues, it is a rather
time consuming operation which is better not run in IRQ context.

To avoid executing the time consuming job creation in interrupt
context, split the job creation and job scheduling in two distinct
operations. When a well-formed job is created, append it to the
newly introduced 'pispbe->job_queue' where it will be dequeued from
by the scheduling routine.

At start_streaming() and qbuf() time immediately try to schedule a job
if one has been created as the irq handler routine is only called when
a job has completed, and we can't solely rely on it for scheduling new
jobs.

Jacopo Mondi (4):
  media: pisp_be: Drop reference to non-existing function
  media: pisp_be: Remove config validation from schedule()
  media: pisp-be: Split jobs creation and scheduling
  media: pisp_be: Fix pm_runtime underrun in probe

 .../platform/raspberrypi/pisp_be/pisp_be.c    | 190 +++++++++---------
 1 file changed, 93 insertions(+), 97 deletions(-)

--
2.45.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-09-04 10:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 11:24 [PATCH v4 0/4] media: pisp-be: Split jobs creation and scheduling Jacopo Mondi
2024-09-02 11:24 ` [PATCH v4 1/4] media: pisp_be: Drop reference to non-existing function Jacopo Mondi
2024-09-02 22:42   ` Laurent Pinchart
2024-09-02 11:24 ` [PATCH v4 2/4] media: pisp_be: Remove config validation from schedule() Jacopo Mondi
2024-09-02 23:07   ` Laurent Pinchart
2024-09-02 11:24 ` [PATCH v4 3/4] media: pisp-be: Split jobs creation and scheduling Jacopo Mondi
2024-09-03 12:19   ` Laurent Pinchart
2024-09-04  7:21     ` Jacopo Mondi
2024-09-04  7:53       ` Laurent Pinchart
2024-09-04  8:35         ` Jacopo Mondi
2024-09-04 10:41           ` Laurent Pinchart
2024-09-02 11:24 ` [PATCH v4 4/4] media: pisp_be: Fix pm_runtime underrun in probe Jacopo Mondi
2024-09-02 23:13   ` Laurent Pinchart
2024-09-03  6:18     ` Jacopo Mondi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox