summaryrefslogtreecommitdiff
path: root/drivers/staging/media/tegra-vde
AgeCommit message (Collapse)Author
2020-03-05media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()Dmitry Osipenko
There is a new devm_platform_ioremap_resource_byname() helper in the kernel now, which helps to make code cleaner a tad by replacing few "boilerplate" lines of code with a single line. Let's utilize that new helper in the VDE driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: staging: tegra-vde: Use __maybe_unused attribute instead of ifdefDmitry Osipenko
Replace #ifdef with __maybe_unused attribute just to keep code cleaner a tad. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: staging: tegra-vde: Sort headers alphabeticallyDmitry Osipenko
Keep the alphabetical order for consistency. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-08media: staging: tegra-vde: Select IOVA unconditionally in KconfigDmitry Osipenko
There were several reports of building failures due to IOVA being selected inconsistently by different drivers. All drivers that are using IOVA API should select it unconditionally in order to avoid the compilation problems, tegra-vde is one of those drivers. Link: https://patchwork.kernel.org/patch/11057831/ Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-08-07media: staging: tegra-vde: Fix build errorYueHaibing
If IOMMU_SUPPORT is not set, and COMPILE_TEST is y, IOMMU_IOVA may be set to m. So building will fails: drivers/staging/media/tegra-vde/iommu.o: In function `tegra_vde_iommu_map': iommu.c:(.text+0x41): undefined reference to `alloc_iova' iommu.c:(.text+0x56): undefined reference to `__free_iova' Select IOMMU_IOVA while COMPILE_TEST is set to fix this. Reported-by: Hulk Robot <hulkci@huawei.com> Suggested-by: Dmitry Osipenko <digetx@gmail.com> Fixes: b301f8de1925 ("media: staging: media: tegra-vde: Add IOMMU support") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-24media: staging: media: tegra-vde: Defer dmabuf's unmappingDmitry Osipenko
Frequent IOMMU remappings take about 50% of CPU usage because there is quite a lot to remap. Defer dmabuf's unmapping by 5 seconds in order to mitigate the mapping overhead which goes away completely and driver works as fast as in a case of a disabled IOMMU. The case of a disabled IOMMU should also benefit a tad from the caching since CPU cache maintenance that happens on dmabuf's attaching takes some resources. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-24media: staging: media: tegra-vde: Add IOMMU supportDmitry Osipenko
All Tegra's could provide memory isolation for the video decoder hardware using IOMMU, it is also required for Tegra30+ in order to handle sparse dmabuf's which GPU exports in a default kernel configuration. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: media: tegra-vde: Manually pack UAPI structuresDmitry Osipenko
The __packed macro isn't available in userspace with the kernel headers. Checkpatch asks to use the macro, which is unwanted in a case of a UAPI header. There is no much benefit in a tight packing of the structures, hence let's pack them manually to cleanup things a tad. Note that there is no old-stable userspace that will suffer from this change, hence it's fine to change the ABI. In a result also more space is reserved for a possible future expansion of the UAPI as it was already shown that more fields will be needed for a later SoC generations. Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: media: tegra-vde: Remove BIT() macro from UAPI headerDmitry Osipenko
The BIT macro isn't available in userspace. Checkpatch complains about shifts being used instead of the macro and people are starting to send patches without realizing that it's a UAPI header file. Hence let's replace the BIT macro with a hex values to make everyone happy. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-03staging: media: tegra-vde: add proper SPDX identifiers on file that did not ↵Greg Kroah-Hartman
have it. There was a single file for the tegra-vde driver that did not have SPDX identifiers on it, so fix that up. At the same time, remove the "free form" text that specified the license of the file, as that is impossible for any tool to properly parse. Cc: Dmitry Osipenko <digetx@gmail.com> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-media@vger.kernel.org Cc: linux-tegra@vger.kernel.org Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-26staging: tegra-vde: remove unnecessary boilerplate license identifier textJules Irenge
Remove unnecessary boilerplate license identifier text. Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-26staging: tegra-vde: Add SPDX GPL-2.0+ license identifier to fix checkpatch ↵Jules Irenge
warning Add the SPDX GPL-2.0+ license identifier to fix checkpatch.pl warning "WARNING: Missing or malformed SPDX-License-Identifier tag in line 1" Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-28Merge tag 'staging-4.21-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO driver updates from Greg KH: "Here is the big staging and iio driver pull request for 4.21-rc1. Lots and lots of tiny patches here, nothing major at all. Which is good, tiny cleanups is nice to see. No new huge driver removal or addition, this release cycle, although there are lots of good IIO driver changes, addtions, and movement from staging into the "real" part of the kernel, which is always great. Full details are in the shortlog, and all of these have been in linux-next for a while with no reported issues" * tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (553 commits) staging: mt7621-mmc: Correct spelling mistakes in comments staging: wilc1000: fix missing read_write setting when reading data mt7621-mmc: char * array declaration might be better as static const mt7621-mmc: return statement in void function unnecessary mt7621-mmc: Alignment should match open parenthesis mt7621-mmc: Removed unnecessary blank lines mt7621-mmc: Fix some coding style issues staging: android: ashmem: doc: Fix spelling staging: rtl8188eu: cleanup brace coding style issues staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c staging: rtl8188eu: change return type of is_basicrate() to bool staging: rtl8188eu: simplify null array initializations staging: rtl8188eu: change order of declarations to improve readability staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c staging: rtl8188eu: constify some arrays staging: rtl8188eu: convert unsigned char arrays to u8 staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c ...
2018-12-07media: staging: tegra-vde: Replace debug messages with trace pointsDmitry Osipenko
Trace points are much more efficient than debug messages for intensive tracing and could be conveniently enabled / disabled dynamically, hence let's replace debug messages with the trace points. This also makes code a bit cleaner. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-08media: staging: tegra-vde: print long unsigned using %lu format specifierColin Ian King
The frame.flags & FLAG_B_FRAME is promoted to a long unsigned because of the use of the BIT() macro when defining FLAG_B_FRAME and causing a build warning. Fix this by using the %lu format specifer. Cleans up warning: drivers/staging/media/tegra-vde/tegra-vde.c:267:5: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat] Fixes: 42e764d05712 ("staging: tegravde: replace bit assignment with macro") Cc: Ioannis Valasakis <code@wizofe.uk> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: tegravde: replace bit assignment with macroIoannis Valasakis
Replace the bit assignment with the preferred BIT macro. Reported by checkpatch. Signed-off-by: Ioannis Valasakis <code@wizofe.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05media: staging: tegra-vde: Reset VDE regardless of memory client resetting ↵Dmitry Osipenko
failure A failed memory client reset doesn't prevent VDE from resetting, hence reset VDE regardless of preceding memory client resetting failure. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-28media: staging: tegra-vde: Reset memory clientDmitry Osipenko
DMA requests must be blocked before resetting VDE HW, otherwise it is possible to get a memory corruption or a machine hang. Use the reset control provided by the Memory Controller to block DMA before resetting the VDE HW. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: staging: tegra-vde: Correct included headerDmitry Osipenko
This is Open Firmware driver, hence 'of_device.h' should be included instead of 'platform_device.h'. Right now OF headers happen to be included indirectly and this may break in the future, so let's correct the header. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: staging: tegra-vde: Do not handle spurious interruptsDmitry Osipenko
Do not handle interrupts if we haven't asked for them, potentially that could happen if HW wasn't programmed properly. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: staging: tegra-vde: Correct minimum size of U/V planesDmitry Osipenko
Stride of U/V planes must be aligned to 16 bytes (2 macroblocks). This needs to be taken into account, otherwise it is possible to get a silent memory corruption if dmabuf size is less than the size of decoded video frame. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: staging: tegra-vde: Silence some of checkpatch warningsDmitry Osipenko
Make all strings single line to make them grep'able and add a comment to the memory barrier. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: staging: tegra-vde: Align bitstream size to 16KDmitry Osipenko
I've noticed that decoding fails sometime if size of bitstream buffer isn't aligned to 16K, probably because HW fetches data from memory in a 16K granularity and if the last chunk of data isn't aligned, HW reads garbage data beyond the dmabuf and tries to parse it. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-01-23media: staging: tegra-vde: select DMA_SHARED_BUFFERArnd Bergmann
Without CONFIG_DMA_SHARED_BUFFER we run into a link error for the dma_buf_* APIs: ERROR: "dma_buf_map_attachment" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_attach" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_get" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_put" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_detach" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! ERROR: "dma_buf_unmap_attachment" [drivers/staging/media/tegra-vde/tegra-vde.ko] undefined! Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-14media: staging: media: Introduce NVIDIA Tegra video decoder driverDmitry Osipenko
NVIDIA Tegra20/30/114/124/132 SoC's have video decoder engine that supports standard set of video formats like H.264 / MPEG-4 / WMV / VC1. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>