summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/rockchip
Commit message (Collapse)AuthorAgeFilesLines
* media: platform: fix several typosMauro Carvalho Chehab2019-03-011-3/+3
| | | | | | | | | | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Houlong Wei <houlong.wei@mediatek.com> Reviewed-by: Yong Deng <yong.deng@magewell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: constify video_device structureJulia Lawall2018-11-231-1/+1
| | | | | | | | | | | The video_device structure is only copied into another structure, so it can be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: constify v4l2_m2m_ops structureJulia Lawall2018-11-231-1/+1
| | | | | | | | | | | The v4l2_m2m_ops structure can be const as it is only passed to v4l2_m2m_init whose parameter is const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab2018-09-111-3/+3
| | | | | | | | | | | The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Fix bad dma_free_attrs() parameterEzequiel Garcia2018-07-271-1/+1
| | | | | | | | | | | | In rga_remove(), dma_free_attrs is being passed the wrong cpu address, which triggers an exception if the driver is removed. Fix it. Tested on a RK3399 platform, with a bind/unbind cycle. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mem2mem: Make .job_abort optionalEzequiel Garcia2018-07-241-6/+0Star
| | | | | | | | | | | | | | Implementing job_abort() does not make sense on some drivers. This is not a problem, as the abort is not required to wait for the job to finish. Quite the opposite, drivers are encouraged not to wait. Demote v4l2_m2m_ops.job_abort from required to optional, and clean all drivers with dummy implementations. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Remove unrequired wait in .job_abortEzequiel Garcia2018-06-282-14/+1Star
| | | | | | | | | | | | | As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Jacob Chen <jacob-chen@iotwrt.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Fix broken .start_streamingEzequiel Garcia2018-06-281-22/+23
| | | | | | | | | | | | | | | | | | | | | | | Currently, rga_buf_start_streaming() is expecting pm_runtime_get_sync to return zero on success, which is wrong. As per the documentation, pm_runtime_get_sync increments the device's usage counter and return its result. This means it will typically return a positive integer on success and a negative error code. Therefore, rockchip-rga driver is currently unusable failing to start_streaming in most cases. Fix it and while here, cleanup the buffer return-to-core logic. Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Jacob Chen <jacob-chen@iotwrt.com> [hans.verkuil@cisco.com: fix line over 80 cols warning] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rga: Remove surplus name initializationAnton Leontiev2018-06-281-1/+0Star
| | | | | | | | Name is already initialized by assignment from rga_videodev. Signed-off-by: Anton Leontiev <scileont@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rca: declare formats var as staticMauro Carvalho Chehab2018-03-231-1/+1
| | | | | | | As warned: drivers/media/platform/rockchip/rga/rga.c:210:16: warning: symbol 'formats' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rockchip/rga: use 64-bit arithmetic instead of 32-bitGustavo A. R. Silva2018-02-261-1/+2
| | | | | | | | | | | | | | | Cast p to dma_addr_t in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type dma_addr_t (u64). The expression p << PAGE_SHIFT is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1458347 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rockchip/rga: annotate PM functions as __maybe_unusedArnd Bergmann2017-10-311-4/+2Star
| | | | | | | | | | | | | | | | | | | | | The newly added driver has incorrect #ifdef annotations on its PM functions, leading to a harmless compile-time warning when CONFIG_PM is disabled: drivers/media/platform/rockchip/rga/rga.c:760:13: error: 'rga_disable_clocks' defined but not used [-Werror=unused-function] static void rga_disable_clocks(struct rockchip_rga *rga) ^~~~~~~~~~~~~~~~~~ drivers/media/platform/rockchip/rga/rga.c:728:12: error: 'rga_enable_clocks' defined but not used [-Werror=unused-function] This removes the #ifdef and marks the functions as __maybe_unused, so gcc can silently drop all the unused code. Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rga: make some functions staticMauro Carvalho Chehab2017-10-172-2/+2
| | | | | | | | | | | drivers/media/platform/rockchip/rga/rga-hw.c:383:6: warning: no previous prototype for 'rga_cmd_set' [-Wmissing-prototypes] void rga_cmd_set(struct rga_ctx *ctx) ^~~~~~~~~~~ drivers/media/platform/rockchip/rga/rga.c:359:17: warning: no previous prototype for 'rga_fmt_find' [-Wmissing-prototypes] struct rga_fmt *rga_fmt_find(struct v4l2_format *f) ^~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rockchip/rga: v4l2 m2m supportJacob Chen2017-10-176-0/+2152
Rockchip RGA is a separate 2D raster graphic acceleration unit. It accelerates 2D graphics operations, such as point/line drawing, image scaling, rotation, BitBLT, alpha blending and image blur/sharpness The driver supports various operations from the rendering pipeline. - copy - fast solid color fill - rotation - flip - alpha blending The code in rga-hw.c is used to configure regs according to operations The code in rga-buf.c is used to create private mmu table for RGA. Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>