media: Remove redundant pm_runtime_mark_last_busy() callspm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend() and pm_request_autosuspend() now include a callto
media: Remove redundant pm_runtime_mark_last_busy() callspm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),pm_runtime_autosuspend() and pm_request_autosuspend() now include a callto pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call topm_runtime_mark_last_busy().Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Acked-by: Thierry Reding <treding@nvidia.com> (tegra-vde/h264.c)Acked-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> (alvium-csi2.c)Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> (iris_hfi_queue.c)Reviewed-by: Sean Young <sean@mess.org>Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> (imx219.c)Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
media: pisp_be: Use clamp() and define max sizesUse the clamp() function from minmax.h and provide a define for the maxsizes as they will be used in subsequent patches.Reviewed-by: Daniel Scally
media: pisp_be: Use clamp() and define max sizesUse the clamp() function from minmax.h and provide a define for the maxsizes as they will be used in subsequent patches.Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: pisp_be: Fix pm_runtime underrun in probeDuring the probe() routine, the PiSP BE driver needs to power up theinterface in order to identify and initialize the hardware.The driver resumes
media: pisp_be: Fix pm_runtime underrun in probeDuring the probe() routine, the PiSP BE driver needs to power up theinterface in order to identify and initialize the hardware.The driver resumes the interface by calling thepispbe_runtime_resume() function directly, without goingthrough the pm_runtime helpers, but later suspends it by callingpm_runtime_put_autosuspend().This causes a PM usage count imbalance at probe time, notified by theruntime_pm framework with the below message in the system log: pispbe 1000880000.pisp_be: Runtime PM usage count underflow!Fix this by resuming the interface using the pm runtime helpers insteadof calling the resume function directly and use the pm_runtime frameworkin the probe() error path. While at it, remove manual suspend of theinterface in the remove() function. The driver cannot be unloaded if inuse, so simply disable runtime pm.To simplify the implementation, make the driver depend on PM as theRPI5 platform where the ISP is integrated in uses the PM framework bydefault.Fixes: 12187bd5d4f8 ("media: raspberrypi: Add support for PiSP BE")Cc: stable@vger.kernel.orgTested-by: Naushir Patuck <naush@raspberrypi.com>Reviewed-by: Naushir Patuck <naush@raspberrypi.com>Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: pisp_be: Split jobs creation and schedulingCurrently the 'pispbe_schedule()' function does two things:1) Tries to assemble a job by inspecting all the video node queues to make sure all
media: pisp_be: Split jobs creation and schedulingCurrently 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 available2) Submit the job to the hardwareThe pispbe_schedule() function is called at:- video device start_streaming() time- video device qbuf() time- irq handlerAs assembling a job requires inspecting all queues, it is a rathertime consuming operation which is better not run in IRQ context.To avoid executing the time consuming job creation in interruptcontext split the job creation and job scheduling in two distinctoperations. When a well-formed job is created, append it to thenewly introduced 'pispbe->job_queue' where it will be dequeued fromby the scheduling routine.As the per-node 'ready_queue' buffer list is only accessed in vb2 opscallbacks, protected by the node->queue_lock mutex, it is not necessaryto guard it with a dedicated spinlock so drop it. Also use thespin_lock_irq() variant in all functions not called from an IRQ contextwhere the spin_lock_irqsave() version was used.Reviewed-by: Naushir Patuck <naush@raspberrypi.com>Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: pisp_be: Remove config validation from schedule()The config parameters buffer is already validated inpisp_be_validate_config() at .buf_prepare() time.However some of the same validations
media: pisp_be: Remove config validation from schedule()The config parameters buffer is already validated inpisp_be_validate_config() at .buf_prepare() time.However some of the same validations are also performed atpispbe_schedule() time. In particular the function checks that:1) config.num_tiles is valid2) At least one of the BAYER or RGB input is enabledThe input config validation is already performed inpisp_be_validate_config() and while job.hw_enables is modified bypispbe_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_enableFor this reasons there is no need to repeat the check atpispbe_schedule() time.The num_tiles validation can be moved to pisp_be_validate_config() aswell. As num_tiles is a u32 it can'be be < 0, so change the sanitycheck accordingly.Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Reviewed-by: Naushir Patuck <naush@raspberrypi.com>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: pisp_be: Drop reference to non-existing functionA comment in the pisp_be driver references thepispbe_schedule_internal() function which doesn't exist.Drop it.Reviewed-by: Laurent Pincha
media: pisp_be: Drop reference to non-existing functionA comment in the pisp_be driver references thepispbe_schedule_internal() function which doesn't exist.Drop it.Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Reviewed-by: Naushir Patuck <naush@raspberrypi.com>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: platform: drop vb2_ops_wait_prepare/finishSince commit 88785982a19d ("media: vb2: use lock if wait_prepare/finishare NULL") it is no longer needed to set the wait_prepare/finishvb2_ops cal
media: platform: drop vb2_ops_wait_prepare/finishSince commit 88785982a19d ("media: vb2: use lock if wait_prepare/finishare NULL") it is no longer needed to set the wait_prepare/finishvb2_ops callbacks as long as the lock field in vb2_queue is set.Since the vb2_ops_wait_prepare/finish callbacks already rely on that field,we can safely drop these callbacks.This simplifies the code and this is a step towards the goal of deletingthese callbacks.Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> # for meson-ge2dAcked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
media: Switch back to struct platform_driver::remove()After commit 0edb555a65d1 ("platform: Make platform_driver::remove()return void") .remove() is (again) the right callback to implement forpla
media: Switch back to struct platform_driver::remove()After commit 0edb555a65d1 ("platform: Make platform_driver::remove()return void") .remove() is (again) the right callback to implement forplatform drivers.Convert all platform drivers below drivers/media to use .remove(), withthe eventual goal to drop struct platform_driver::remove_new(). As.remove() and .remove_new() have the same prototypes, conversion is doneby just changing the structure member name in the driver initializer.Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
media: pisp_be: add missing wait_prepare/finish opsWithout these ops the v4l2-compliance blocking wait test will fail.These ops are required to ensure that when VIDIOC_DQBUF has towait for buffer
media: pisp_be: add missing wait_prepare/finish opsWithout these ops the v4l2-compliance blocking wait test will fail.These ops are required to ensure that when VIDIOC_DQBUF has towait for buffers to arrive, the queue lock is correctly releasedand retaken. Otherwise the wait for a buffer would block all otherqueue ioctls.Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>Acked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
media: raspberrypi: VIDEO_RASPBERRYPI_PISP_BE should depend on ARCH_BCM2835Currently, the Raspberry Pi PiSP Backend (BE) ISP is only present on theBroadcom BCM2712-based Raspberry Pi 5. Hence add
media: raspberrypi: VIDEO_RASPBERRYPI_PISP_BE should depend on ARCH_BCM2835Currently, the Raspberry Pi PiSP Backend (BE) ISP is only present on theBroadcom BCM2712-based Raspberry Pi 5. Hence add a dependency onARCH_BCM2835, to prevent asking the user about this driver whenconfiguring a kernel without Broadcom BCM2835 family support. Thedependency can be relaxed if/when the encoder appears on other SoCfamilies.Fixes: 12187bd5d4f8 ("media: raspberrypi: Add support for PiSP BE")Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>Acked-by: FLorian Fainelli <florian.fainelli@broadcom.com>Acked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
media: raspberrypi: Switch to remove_newThe remove callback's return value is about to change from int to void,this is done by commit 0edb555a65d1 ("platform: Makeplatform_driver::remove() return
media: raspberrypi: Switch to remove_newThe remove callback's return value is about to change from int to void,this is done by commit 0edb555a65d1 ("platform: Makeplatform_driver::remove() return void"). Prepare for merging the patch byswitching the PiSP driver from remove to remove_new callback.Fixes: 12187bd5d4f8 ("media: raspberrypi: Add support for PiSP BE")Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>Acked-by: Naushir Patuck <naush@raspberrypi.com>Acked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
media: raspberrypi: Add support for PiSP BEAdd support for the Raspberry Pi PiSP Back End.The driver has been upported from the Raspberry Pi kernel at revisionf74893f8a0c2 ("drivers: media: pisp
media: raspberrypi: Add support for PiSP BEAdd support for the Raspberry Pi PiSP Back End.The driver has been upported from the Raspberry Pi kernel at revisionf74893f8a0c2 ("drivers: media: pisp_be: Update seqeuence numbers of thebuffers").The ISP documentation is available at:https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdfSigned-off-by: David Plowman <david.plowman@raspberrypi.com>Signed-off-by: Naushir Patuck <naush@raspberrypi.com>Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.org>Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>[hverkuil: drop dev_err after platform_get_irq to fix a coccinelle check]