-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
media: pisp-be: Split jobs creation and scheduling #6302
Open
jmondi
wants to merge
4
commits into
raspberrypi:rpi-6.6.y
Choose a base branch
from
jmondi:pispbe/split-jobs-handling
base: rpi-6.6.y
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Sep 4, 2024
-
media: pisp_be: Drop reference to non-existing function
A comment in the pisp_be driver references the pispbe_schedule_internal() function which doesn't exist. Drop it. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
Jacopo Mondi committedSep 4, 2024 Configuration menu - View commit details
-
Copy full SHA for 3d0623d - Browse repository at this point
Copy the full SHA 3d0623dView commit details -
media: pisp_be: Remove config validation from schedule()
The config parameters buffer is already validated in pisp_be_validate_config() at .buf_prepare() time. However some of the same validations are also performed at pispbe_schedule() time. In particular the function checks that: 1) config.num_tiles is valid 2) At least one of the BAYER or RGB input is enabled The input config validation is already performed in pisp_be_validate_config() and while job.hw_enables is modified by pispbe_xlate_addrs(), the function only resets the input masks if - there is no input buffer available, but pispbe_prepare_job() fails before calling pispbe_xlate_addrs() in this case - bayer_enable is 0, but in this case rgb_enable is valid as guaranteed by pisp_be_validate_config() - only outputs are reset in rgb_enable For this reasons there is no need to repeat the check at pispbe_schedule() time. The num_tiles validation can be moved to pisp_be_validate_config() as well. As num_tiles is a u32 it can'be be < 0, so change the sanity check accordingly. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
Jacopo Mondi committedSep 4, 2024 Configuration menu - View commit details
-
Copy full SHA for e6ab8e2 - Browse repository at this point
Copy the full SHA e6ab8e2View commit details -
media: pisp_be: Split jobs creation and scheduling
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 the 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. As the per-node 'ready_queue' buffer list is only accessed in vb2 ops callbacks, protected by a mutex, it is not necessary to guard it with a dedicated spinlock so drop it. Also use the spin_lock_irq() variant in all functions not called from an IRQ context where the spin_lock_irqsave() version was used. Signed-off-by: Jacopo Mondi <[email protected]>
Jacopo Mondi committedSep 4, 2024 Configuration menu - View commit details
-
Copy full SHA for 0ea92dc - Browse repository at this point
Copy the full SHA 0ea92dcView commit details -
media: pisp_be: Fix pm_runtime underrun in probe
During the probe() routine, the driver needs to power up the interface in order to identify and initialize the hardware and it later suspends it at the end of probe(). The driver erroneously resumes the interface by calling the pispbe_runtime_resume() function directly but suspends it by calling pm_runtime_put_autosuspend(). This causes a PM usage count imbalance at probe time, notified by the runtime_pm framework with the below message in the system log: pispbe 1000880000.pisp_be: Runtime PM usage count underflow! Fix this by suspending the interface using pm_runtime_idle() which doesn't decrease the pm_runtime usage count and inform the PM framework that the device is active by calling pm_runtime_set_active(). Adjust the pispbe_remove() function as well to disable the pm_runtime in the correct order. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> --- v4->v5: - Indent with tabs :/ v3->v4: - Instead of using pm_runtime for resuming, suspend using pm_runtime_idle() to support !CONFIG_PM v2->v3: - Mark pispbe_runtime_resume() as __maybe_unused as reported by the kernel test robot <[email protected]>
Jacopo Mondi committedSep 4, 2024 Configuration menu - View commit details
-
Copy full SHA for 775912b - Browse repository at this point
Copy the full SHA 775912bView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.