summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add support for the single-planar V4L2 APImasterPaul Kocialkowski2018-09-0712-92/+267
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Register video format directly instead of tiled indicatorPaul Kocialkowski2018-09-076-21/+28
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Merge pull request #6 from tpetazzoni/creditsMaxime Ripard2018-09-051-0/+274
|\ | | | | Add CREDITS file
| * Add CREDITS fileThomas Petazzoni2018-09-041-0/+274
| | | | | | | | | | | | | | | | As promised by Bootlin's Kickstarter campaign, all contributors above 16 EUR would get their name in the CREDITS file. This commit implements the promised CREDITS file. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* | Merge pull request #4 from tpetazzoni/minor-doc-updatesMaxime Ripard2018-09-052-0/+3
|\ \ | |/ |/| Minor doc updates
| * Update AUTHORS file with Maxime and PaulThomas Petazzoni2018-09-021-0/+2
| | | | | | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
| * Update README.md to mention H265 supportThomas Petazzoni2018-09-021-0/+1
|/ | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* Add support for H265 decoding, including predictive framesPaul Kocialkowski2018-08-317-2/+488
| | | | | | | Some features are missing, such as scaling lists (quantization) and 10-bit output. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* media: Adapt for the latest Request APIPaul Kocialkowski2018-08-281-3/+3
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* mpeg2: Update to match latest definitionsPaul Kocialkowski2018-08-093-34/+48
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* request: Check required v4l2 capabilities after opening the video nodePaul Kocialkowski2018-08-061-5/+13
| | | | | | | | Since our use of the v4l2 API has some assumptions on the available userspace APIs, check the capabilities reported by the driver to make sure they are supported. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* v4l2: Add support for querying capabilitiesPaul Kocialkowski2018-08-062-0/+22
| | | | | | | | This adds a helper function to query v4l2 capabilities, returning either the device caps when available or the general device caps otherwise. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* Add support for MPEG2 quantization matricesPaul Kocialkowski2018-07-253-0/+42
| | | | | | | | This adds support for MPEG2 quantization matrices, which are optional given that fallback default matrices are used (on the kernel side) when no such matrix is provided. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* Remove stray empty template filePaul Kocialkowski2018-07-251-0/+0
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* Grab the base index when allocating buffers and mapping themPaul Kocialkowski2018-07-204-9/+20
| | | | | | | | | | | | | | Because there might be more than a single call to CreateSurfaces, we cannot assume that the index relative to the number of surfaces requested in a single call matches the v4l2 index. Grab the base index (as returned by the kernel) when allocating buffers and use it for memory mapping and addressing them in v4l2. This avoids memory-mapping the first (index 0) buffer multiple times in that scenario instead of the n-th allocated buffer (in the n-th call in the sequence). Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* surface: Avoid unitialized variable compiler warningPaul Kocialkowski2018-07-201-3/+2
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* context: Liberate output and capture buffers at ContextDestroyPaul Kocialkowski2018-07-201-3/+23
| | | | | | | | | | | | | The V4L2 API does not currently provide a way to liberate allocated buffers one by one (which would fit well with DestroySurfaces in VAAPI). Moreover, streaming needs to be off before liberating buffers is allowed. As a result, output an capture buffers can only be liberated when destroying the decoding context, all at once, such as implemented in this patch. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* v4l2: Introduce helper to request buffersPaul Kocialkowski2018-07-202-0/+22
| | | | | | | | | | Although this is not needed when using the combination of CREATE_BUFS and QUERYBUF V4L2 ioctls (as currently done) to allocate and prepare buffers, the REQBUF ioctl is useful to liberate the buffers after use. This introduces a helper for this purpose. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* Rename request_buffer helper to query_bufferPaul Kocialkowski2018-07-204-14/+14
| | | | | | | Since the V4L2 ioctl is called QUERYBUF, it makes more sense to call the associated function with the same name. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* surface: Remove duplicate request fd closePaul Kocialkowski2018-07-201-3/+0
| | | | | | This removes a duplicate conditional close of the request fd. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* Add support for QuerySurfaceAttributesPaul Kocialkowski2018-07-183-0/+81
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* surface: Add ExportSurfaceHandle support for dma-buf exportPaul Kocialkowski2018-07-183-0/+100
| | | | | | | This is the latest version of dma-buf export, that does support specifying DRM modifiers. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* fixup! buffer: Add Acquire/ReleaseBufferHandle support for dma-buf exportPaul Kocialkowski2018-07-181-8/+6
|
* fixup! v4l2: Add helper for exporting with dma-bufPaul Kocialkowski2018-07-181-2/+2
|
* buffer: Add Acquire/ReleaseBufferHandle support for dma-buf exportPaul Kocialkowski2018-07-183-1/+81
| | | | | | | This is the first version of dma-buf export, that does not support specifying a DRM modifier. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* request: Reorder BufferInfoPaul Kocialkowski2018-07-181-1/+1
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* buffer: Store derived surface id and buffer info for dma-buf exportPaul Kocialkowski2018-07-183-3/+9
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* image: Replace buffer ID with full VAImage structurePaul Kocialkowski2018-07-182-4/+4
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* v4l2: Add helper for exporting with dma-bufPaul Kocialkowski2018-07-182-0/+31
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* image: Mark unimplemented functions as suchPaul Kocialkowski2018-07-181-3/+3
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* surface: Add basic support for CreateSurfaces2Paul Kocialkowski2018-07-183-3/+21
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* tree: add the driver_data parameter to the IMAGE macro as wellMaxime Ripard2018-07-182-5/+4
| | | | | | | The IMAGE macro takes an implicit driver_data argument. In order to make it obvious that we need it, let's put it as an explicit parameter. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* README: Update supported codecsPaul Kocialkowski2018-07-171-2/+3
| | | | Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* libva: Change the vendor stringMaxime Ripard2018-07-171-1/+1
| | | | | | The vendor string needs to be updated to match the new name. Do so. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* libva: Change the environment variables nameMaxime Ripard2018-07-171-2/+2
| | | | | | | Change the environment variables for the media and video path to match the libva name. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* README: Update with the new nameMaxime Ripard2018-07-171-6/+9
| | | | | | Convert the README to the new name for the libva. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Rename the libva name for realMaxime Ripard2018-07-174-28/+28
| | | | | | Change the autotools files, and with them the name of the libva. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* buffer: Remove the sunxi_cedrus_destroy buffer prototypeMaxime Ripard2018-07-171-2/+0
| | | | | | That function isn't defined anywhere, remove its prototype. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Remove void * castsMaxime Ripard2018-07-177-49/+26
| | | | | | | void * can be assigned from and stored to any pointer type without any warning. Remove the explicit casts. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Rename cedrus_data to request_dataMaxime Ripard2018-07-1713-61/+61
| | | | | | | The cedrus_data structure carries the old name. In order to migrate to the new name, let's rename it to request_data. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Rename the header and definesMaxime Ripard2018-07-1715-36/+36
| | | | | | | | | | The sunxi_cedrus.h header contains a bunch of defines prefixed with SUNXI_CEDRUS. As part as the ongoing migration to a more generic name, change that prefix for V4L2_REQUEST, and the header file to request.h Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Rename the libva hooksMaxime Ripard2018-07-1716-362/+317
| | | | | | | As part of our renaming effort, Rename the libva hooks names to mention request instead of SunxiCedrus Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Change sunxi_cedrus_log for request_logMaxime Ripard2018-07-175-31/+27
| | | | | | | As part of the ongoing switch to a generic name, let's start with log function. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* h264: Don't set num_slices anymoreMaxime Ripard2018-07-174-2/+6
| | | | | | | | | | The num_slices parameter was improperly set to the number of reference frames, which is incorrect. Add a counter for the number of slices per surface, and set num_slices to that value. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* h264: Set PPS pic_init_qp_minus26 fieldMaxime Ripard2018-07-171-0/+1
| | | | | | The pic_init_qp_minus26 must be set but was not until now. Fix this. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* h264: Fix prediction weight tableMaxime Ripard2018-07-171-21/+38
| | | | | | | | | | | | | | | The current code sets the prediction weight table by doing a memcpy of the libva structure to the v4l2's structure. However, for the offset and weight parameters, libva's structure uses 16-bits integer, while v4l2 uses 8-bits, which obviously doesn't work well with memcpy. Create a function to copy those arrays and matrices instead that follows the algorithm defined in the H264 spec, and use it so that it works properly. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* h264: Implement local cache of the latest decoded picturesMaxime Ripard2018-07-174-36/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libva only provides the reference images needed to decode the current picture, but not the full DPB. However, some codecs need that whole DPB in order to decode a picture. For example, the Allwinner hardware codec has an internal SRAM, with each picture getting a slot in that SRAM, and during each decoding process, some metadata will then be generated from that SRAM content to a separate buffer. Therefore, each frames must be located at the same SRAM position each time so that the metadata are then re-used properly. However, since libva will only pass a few reference images, we can end up in a situation where multiple, subsequent, frames will have the same reference images set, but might all be used as reference later on and cannot therefore be located at the same position. And from a more theorical point of view, Linux expects a full blown DPB in its H264 control. In order to work around this, we can create a shadow of the DPB by simply maintaining a list of 16 decoded images, each associated with their VAPictureH264 and an age. This age is the last time we used that frame as reference. When a new picture is decoded, either we assign it to a free slot, or we reuse the slot from the frame that hasn't been used as a reference for the longest time. This is a much simpler approach than the one documented in the H264 spec, but this shouldn't really be a problem since we don't handle the reference frames ourselves, but just re-use the one from the libva, and taken from the bitstream before. As such, frames that are not supposed to be used for reference will not be anymore, their age will not increase, and therefore after a while we will garbage-collect their slot to store a much newer frame. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* h264: Pass the context to the sub-control functionsMaxime Ripard2018-07-171-4/+9
| | | | | | | Some functions setting the controls in the H264 code will need the context in order to access the DPB. Make sure that we pass it as an argument. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* codecs: pass the context to the controls function as wellMaxime Ripard2018-07-175-5/+13
| | | | | | | Some functions setting the controls will need the context in the future. Make sure that we provide it as an argument. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
* tree: Run clang-format to conform to the kernel coding styleMaxime Ripard2018-07-1728-383/+1063
| | | | | | | | | The coding style has been a bit erratic. Enforce the linux kernel coding style by reusing their .clang-format file, running clang-format on the source, and ignoring the few shortcomings that clang-format has at the moment (especially on aligning the define values). Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>