]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - jacinto7_multimedia/ti-img-encode-decode.git/log
jacinto7_multimedia/ti-img-encode-decode.git
3 years agoencoder: Expand Ctrl API master
David Huang [Mon, 22 Mar 2021 01:25:27 +0000 (20:25 -0500)]
encoder: Expand Ctrl API

Expand Ctrl API for finer control over encoding parameters.
Updated firmware for compatibility with programming the
INTRA_PRED_MODES register.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agotimmlib: decoder: increase max channels to 8
David Huang [Fri, 19 Mar 2021 16:56:37 +0000 (11:56 -0500)]
timmlib: decoder: increase max channels to 8

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoencoder: Fix hang on Page Fault
David Huang [Thu, 18 Mar 2021 14:33:24 +0000 (09:33 -0500)]
encoder: Fix hang on Page Fault

Remove prints fron ISR context, and change Event call to use 0 timeout
since this exists within ISR context.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoencoder/decoder: Fix Klocwork issues
David Huang [Fri, 30 Oct 2020 08:33:25 +0000 (03:33 -0500)]
encoder/decoder: Fix Klocwork issues

Fix static analysis revealed issues. This included removing the concept
of use_secure_fw_upload since this is currently an unsupported feature
with incomplete code

Signed-off-by: David Huang <d-huang@ti.com>
3 years ago[TIOVX-1003] Adding mutex to fix a customer reported issue
Lucas Weaver [Fri, 4 Sep 2020 13:20:01 +0000 (08:20 -0500)]
[TIOVX-1003] Adding mutex to fix a customer reported issue

3 years agotimmlib: encoder: Update ENUM name
David Huang [Mon, 31 Aug 2020 17:21:40 +0000 (12:21 -0500)]
timmlib: encoder: Update ENUM name

Update name within enum to be consistent

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoencoder: initialize stack variable to avoid undefined variable issues
Sunita Nadampalli [Tue, 1 Sep 2020 03:25:30 +0000 (22:25 -0500)]
encoder: initialize stack variable to avoid undefined variable issues

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
3 years agoencoder: added support for 2 slice encoding as configurable
Sunita Nadampalli [Mon, 31 Aug 2020 04:13:58 +0000 (23:13 -0500)]
encoder: added support for 2 slice encoding as configurable
 mode

This patch adds 2 slice encoding mode and is configurable.
In order to enable 2 slice encoding, application has to
set nslices = 2 and provide a valid address for 2nd coded package during
process call.
For default 1 slice encoding, application has to set
nslices = 1, and provide NULL for 2nd coded package
during the process call.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
3 years agoencoder: fix mmu leak for encoder input and output buffers
Sunita Nadampalli [Mon, 31 Aug 2020 03:53:39 +0000 (22:53 -0500)]
encoder: fix mmu leak for encoder input and output buffers

This patch fixes mmu leak for input and output buffers by
calling mmau unmap call for all the registered buffers.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
3 years agoencoder: added support for ocm ram allocation for above mb params
Sunita Nadampalli [Fri, 21 Aug 2020 23:34:08 +0000 (18:34 -0500)]
encoder: added support for ocm ram allocation for above mb params

This patch adds support for allocating above mb params from
either ocm ram or from DDR. OCM RAM is used if application
provides it during encoder init (one time initialization).
Vision apps/application framework is expected to provide the
ram pool base address and size (either 0, 32KB or 64KB).
Encoder driver will split the ram into two chunks and enable
max of two instancesbe to use it for above mb params, rest of
the channels have to use the default ddr allocation for
above mb params.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
3 years agotimmlib: encoder/decoder: Add Ctrl API
David Huang [Thu, 30 Jul 2020 19:41:52 +0000 (14:41 -0500)]
timmlib: encoder/decoder: Add Ctrl API

Add Ctrl API to enable user configuration of additional parameters
at Create time.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoencoder: Improve Encoded Output
David Huang [Wed, 15 Jul 2020 07:27:30 +0000 (02:27 -0500)]
encoder: Improve Encoded Output

Improved default encoded output, based on settings for 1920x1080 stream.

Main Changes include:
1. Change default RC mode to VBR
2. Automatically calculate QP values
3. Default to I&P frame encoding
4. Correctly calculate initial_level

sVBR RC mode is also useable with these changes.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoosal: tirtos: Check before deleting task
David Huang [Sat, 13 Jun 2020 14:15:53 +0000 (09:15 -0500)]
osal: tirtos: Check before deleting task

Check if tasks are automatically deleted before
manually deleting them

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoUpdate Interupt ID for MCU2_0
David Huang [Thu, 14 May 2020 14:09:12 +0000 (09:09 -0500)]
Update Interupt ID for MCU2_0

To migrate the tirtos drivers from MCU2_1 to MCU2_0,
update the IRQ IDs for encoder and decoder driver.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agodriver: encoder: Free resources in topaz_process_message
David Huang [Tue, 28 Apr 2020 21:59:06 +0000 (16:59 -0500)]
driver: encoder: Free resources in topaz_process_message

Free the current_el and current_el->data memory at the end of
topaz_process_message to fix memory leak.

Signed-off-by: David Huang <d-huang@ti.com>
3 years agoosal: tirtos: osa_queue: Fix semaphore cleanup
David Huang [Thu, 23 Apr 2020 23:45:31 +0000 (18:45 -0500)]
osal: tirtos: osa_queue: Fix semaphore cleanup

On queue deletion, fix semaphore deletion failure due to
incorrect address passed.

Signed-off-by: David Huang <d-huang@ti.com>
4 years agotimmlib: doxygen fixes for interface files
Sunita Nadampalli [Tue, 4 Feb 2020 19:24:32 +0000 (13:24 -0600)]
timmlib: doxygen fixes for interface files

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agotimmlib: encoder: KW fixes for critical and error scenarios
Sunita Nadampalli [Thu, 23 Jan 2020 19:28:52 +0000 (13:28 -0600)]
timmlib: encoder: KW fixes for critical and error scenarios

This patch fixes KW critical and error issues from encoder
driver.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agolinux: encoder/decoder: Removed hard coded CROSS_COMPILE in Makefile
David Huang [Wed, 22 Jan 2020 22:52:09 +0000 (16:52 -0600)]
linux: encoder/decoder: Removed hard coded CROSS_COMPILE in Makefile

Use the variable $(CROSS_COMPILE) instead of hard coding
aarch64linux-gnu- as the cross compiler in Makefiles.

Signed-off-by: David Huang <d-huang@ti.com>
4 years agolinux: encoder: fix compilation issue with debug mode
Sunita Nadampalli [Tue, 21 Jan 2020 18:10:30 +0000 (12:10 -0600)]
linux: encoder: fix compilation issue with debug mode

This patch fixes debug mode variable definition scope issue and also
fixes the makefile for profiling mode flag.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agoRevert "encoder: Fix kernel debug warning for DMA-API"
Angela Stegmaier [Mon, 20 Jan 2020 23:05:54 +0000 (17:05 -0600)]
Revert "encoder: Fix kernel debug warning for DMA-API"

This reverts commit f5c1c28e74c3ef4e1a018a37ae999e08388b635c.

4 years agotimmlib: encoder: Add support for memory leak dump on destory and deinit
Sunita Nadampalli [Mon, 20 Jan 2020 20:45:32 +0000 (14:45 -0600)]
timmlib: encoder: Add support for memory leak dump on destory and deinit

This patch adds dump of any leaked memory during the stream encoding.
The list of all outstanding memory allocations are dumped during
the stream destory and during the encoder driver de-init. The logic is
kept under DEBUG_OSA_MEM and has been disabled by default.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agotirtos: encoder: Fix mutex usage issue
Sunita Nadampalli [Mon, 20 Jan 2020 20:32:00 +0000 (14:32 -0600)]
tirtos: encoder: Fix mutex usage issue

This patch fixes logic issue with using the driver mutex
and also cleans up unused contenxt variables.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodriver: encoder: Add support for encoder performance profiling
Sunita Nadampalli [Mon, 20 Jan 2020 20:28:17 +0000 (14:28 -0600)]
driver: encoder: Add support for encoder performance profiling

Latency profiling support has been added for encoder firmware
level as well as driver level.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodriver: encoder: Add support for dynamic slice map calculation
Sunita Nadampalli [Mon, 20 Jan 2020 19:34:25 +0000 (13:34 -0600)]
driver: encoder: Add support for dynamic slice map calculation

Hardcoded slice map is replaced with dynamic calculation and
all the required slice and pipe parameters are set correctly.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agolinux: encoder: Makefile update to add memory tracking feature for debug
Sunita Nadampalli [Mon, 20 Jan 2020 19:32:00 +0000 (13:32 -0600)]
linux: encoder: Makefile update to add memory tracking feature for debug

This patch adds DEBUG_OSA_MEM debug option to encoder makefile. This
feature is kept disabled by default and expected to be enabled only
for debug purpose.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agolinux: decoder: Reset EOS state and cleanup internal lists for V4L2 Plugin restart...
Sunita Nadampalli [Mon, 20 Jan 2020 19:30:34 +0000 (13:30 -0600)]
linux: decoder: Reset EOS state and cleanup internal lists for V4L2 Plugin restart to work

Reset the eos state, buf mapping state and also the internal lists
to bring the module back to proper initial state to restart decoding.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agoencoder: tirtos: H264 encoder driver support has been added
Sunita Nadampalli [Wed, 8 Jan 2020 18:12:40 +0000 (12:12 -0600)]
encoder: tirtos: H264 encoder driver support has been added

This patch enables H.264 encoder driver for TIRTOS SDK, and enbales
co-existance of encoder and decoder drivers.

Main changes include
1. Encoder timmlib addition
2. Additional OSAL files required for encoder driver
3. Decoder changes to co-exist with encoder driver

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: 1st set of fixes for Klocwork reported warning issues
Gaviraju D B [Tue, 22 Oct 2019 12:09:46 +0000 (17:39 +0530)]
decoder: 1st set of fixes for Klocwork reported warning issues

    This patch fixes multiple warnings reported by Klockwork
    static analysis tool. No functionality change introduced
    with these fixes.

Signed-off-by: Gaviraju D B <x1046101@ti.com>
4 years agodecoder: fix kernel crash during linux bootup
Amit Makani [Tue, 5 Nov 2019 11:37:27 +0000 (17:07 +0530)]
decoder: fix kernel crash during linux bootup

- This issue occurs when firmware binary is not present
  in the rootfs so adding condition to check if firmware
  is present or not.

Signed-off-by: Amit Makani <amit.makani@ti.com>
4 years agodecoder: fix error recovery test for VDEC_ERROR_SR_ERROR
Amit Makani [Tue, 5 Nov 2019 11:31:58 +0000 (17:01 +0530)]
decoder: fix error recovery test for VDEC_ERROR_SR_ERROR

- VDEC_ERROR_SR_ERROR is for emulating software shift register error
  now by setting zero to fw_error_value in sysfs will generate error.

Signed-off-by: Amit Makani <amit.makani@ti.com>
4 years agodecoder: 4th set of fixes for Klocwork reported critical issues
Sunita Nadampalli [Fri, 18 Oct 2019 14:29:56 +0000 (09:29 -0500)]
decoder: 4th set of fixes for Klocwork reported critical issues

This patch fixes multiple issues reported by Klockwork
static analysis tool. No functionality change introduced
with these fixes.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: 3rd set of fixes for Klocwork reported critical issues
Sunita Nadampalli [Wed, 16 Oct 2019 17:42:34 +0000 (12:42 -0500)]
decoder: 3rd set of fixes for Klocwork reported critical issues

This patch fixes multiple issues reported by Klockwork
static analysis tool. No functionality change introduced
with these fixes.

Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Megharaj A G <megharaj@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agoDecoder: RTOS driver profiling support is added.
Sunita Nadampalli [Tue, 15 Oct 2019 22:17:08 +0000 (17:17 -0500)]
Decoder: RTOS driver profiling support is added.

RTOS mm lib profiler is added with compile time enable/disable control
with ENABLE_PROFILE config flag. the feature is disabled by default.
This patch also removes un-used variable from "struct vxd_return"

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Amai Prashanth Kumar <prashanth.amai@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: 2nd set of Fixes for Klocwork reported critical issues
Sunita Nadampalli [Tue, 15 Oct 2019 19:13:26 +0000 (14:13 -0500)]
decoder: 2nd set of Fixes for Klocwork reported critical issues

This patch fixes multiple issues reported by Klockwork
static analysis tool. No functionality change introduced
with these fixes.

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: rtos: remove unnecessary buffer mapped trace
Sunita Nadampalli [Tue, 15 Oct 2019 03:09:35 +0000 (22:09 -0500)]
decoder: rtos: remove unnecessary buffer mapped trace

For OpenVX framework, bufprepare gets called every time along
with process. This is a valid scenario for OpenVX and not an
error, so the "buffer is already mapped" trace should not
come as an error trace.

This trace is commented out because it will come for every frame
decode otherwise.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agotimmlib: Decoder: comments added to make zero warnings during doxygen build
Sunita Nadampalli [Mon, 14 Oct 2019 19:48:02 +0000 (14:48 -0500)]
timmlib: Decoder: comments added to make zero warnings during doxygen build

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: Fixes for Klocwork reported critical issues
Sunita Nadampalli [Mon, 14 Oct 2019 16:24:16 +0000 (11:24 -0500)]
decoder: Fixes for Klocwork reported critical issues

This patch fixes multiple issues reported by Klockwork
static analysis tool. No functionality change introduced
with these fixes.

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Megharaj A G <megharaj@ti.com>
Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Amai Prashanth Kumar <prashanth.amai@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: Fix trace level for informative traces
Sunita Nadampalli [Mon, 14 Oct 2019 16:14:43 +0000 (11:14 -0500)]
decoder: Fix trace level for informative traces

This patch fixes informative level traces to be under
OSA_PR_INFO category. This is required to avoid unwanted
traces for every decode run.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: tirtos: makefile: enable REDUCED_DPB_NO_PIC_REORDERING config
Sunita Nadampalli [Mon, 14 Oct 2019 16:10:58 +0000 (11:10 -0500)]
decoder: tirtos: makefile: enable REDUCED_DPB_NO_PIC_REORDERING config

This config flag is enabled to avoid one frame delay for display callback
for I-frame only streams decoding. Since tirtos decoder driver is used for
I-frame only stream decoding, this config flag is enabled by default.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: rtos: remove unnecessary buffer mapped trace
Angela Stegmaier [Fri, 11 Oct 2019 19:08:31 +0000 (14:08 -0500)]
decoder: rtos: remove unnecessary buffer mapped trace

For OpenVX framework, bufprepare gets called every time along
with process. This is a valid scenario for OpenVX and not an
error, so the "buffer is already mapped" trace should not
come as an error trace.

This trace is commented out because it will come for every frame
decode otherwise.

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: rtos: Add multi-planar support
Gaviraju D B [Fri, 11 Oct 2019 16:50:56 +0000 (22:20 +0530)]
decoder: rtos: Add multi-planar support

This patch adds multi-planar support.

The following changes are also included:

- Memory-leak patch applied for RTOS testing
- glue layer Error recovery patch is added
- check condition is added to know the MM buffer is 4K aligned or not

Signed-off-by: Gaviraju D B <x1046101@ti.com>
4 years agoencoder/decoder: Fix lockdep warnings
Angela Stegmaier [Tue, 24 Sep 2019 21:29:40 +0000 (16:29 -0500)]
encoder/decoder: Fix lockdep warnings

Kernel lockdep throws warnings for seemingly nested locking
of mutexes, even though the mutexes are not the same.

Fix the warnings by replacing the mutex_lock calls with
mutex_lock_nested calls.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoosal: time: Don't allocate memory for timespec
Angela Stegmaier [Tue, 24 Sep 2019 21:23:02 +0000 (16:23 -0500)]
osal: time: Don't allocate memory for timespec

This fixes the following kernel debug warning:

   BUG: sleeping function called from invalid context at mm/slab.h:422

This patch removes the need to allocation by defining
a new structure "struct osa_timespec", which is different
for each OS. This structure can be used in the common
code and it will use the OS-specific definition.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoencoder: Fix kernel debug warning for DMA-API
Angela Stegmaier [Tue, 24 Sep 2019 21:18:33 +0000 (16:18 -0500)]
encoder: Fix kernel debug warning for DMA-API

This patch fixes the following warning thrown from DMA-API
debugging:

    img_enc 4200000.video-encoder: DMA-API: device driver syncs DMA memory with different direction

Memory mapping is fixed to be bi-directional, because the API is
generic and can be used for communication in either direction.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoencoder/decoder: fix incorrect handle use in mutex_destroy
Angela Stegmaier [Tue, 24 Sep 2019 21:16:10 +0000 (16:16 -0500)]
encoder/decoder: fix incorrect handle use in mutex_destroy

A few places were using the wrong handle to the call. This patch
fixes it to pass the correct value.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: Reproduce firmware non responsiveness through sysfs
Megharaj A G [Tue, 17 Sep 2019 13:36:07 +0000 (19:06 +0530)]
decoder: Reproduce firmware non responsiveness through sysfs

Add sysfs entry ability to reproduce the firmware unresponsive
error case.

Signed-off-by: Megharaj A G <megharaj@ti.com>
4 years agodecoder: Add resource leak debugging
Angela Stegmaier [Tue, 17 Sep 2019 20:50:01 +0000 (15:50 -0500)]
decoder: Add resource leak debugging

Add code to track the allocations and frees through
the osa_mem module. By default, the memory debug tracking
is disabled in the makefile. To enable, set DEBUG_OSA_MEM
to "y":

DEBUG_OSA_MEM=y

When osa_mem debug tracing is enabled, whenever a handle
is closed or the module is removed, debug traces will print
showing outstanding allocations.

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: add missing cleanup of allocations
Angela Stegmaier [Thu, 29 Aug 2019 20:24:58 +0000 (15:24 -0500)]
decoder: add missing cleanup of allocations

Fix some missing allocation cleanups in release/shutdown path.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: fix crash when error recovery occurs
Amit Makani [Wed, 18 Sep 2019 12:41:29 +0000 (18:11 +0530)]
decoder: fix crash when error recovery occurs

Signed-off-by: Amit Makani <amit.makani@ti.com>
4 years agoencoder: linux: Fix rt-linux build
Angela Stegmaier [Wed, 11 Sep 2019 18:11:24 +0000 (13:11 -0500)]
encoder: linux: Fix rt-linux build

This patch fixes the following build issues seen in rt-linux builds:

 linux/encoder/vxe_v4l2.c: In function 'soft_thread_irq':
 linux/encoder/vxe_v4l2.c:1599:10: error: 'IRQ_HANDLED' undeclared (first use in this function); did you mean 'OSA_IRQ_HANDLED'?
    return IRQ_HANDLED;
           ^~~~~~~~~~~
           OSA_IRQ_HANDLED
 linux/encoder/vxe_v4l2.c:1599:10: note: each undeclared identifier is reported only once for each function it appears in
 linux/encoder/vxe_v4l2.c:1601:9: error: 'IRQ_NONE' undeclared (first use in this function); did you mean 'WBI_NONE'?
   return IRQ_NONE;
          ^~~~~~~~
          WBI_NONE
 linux/encoder/vxe_v4l2.c: In function 'vxe_enc_probe':
 linux/encoder/vxe_v4l2.c:1677:3: error: implicit declaration of function 'free_irq'; did you mean 'free_uid'? [-Werror=implicit-function-declaration]
    free_irq(module_irq, &vxe->topaz_dev_ctx);
    ^~~~~~~~
    free_uid
 linux/encoder/vxe_v4l2.c: In function 'soft_thread_irq':
 linux/encoder/vxe_v4l2.c:1602:1: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoDecoder: Delayed work-queue is implemented with Timer API MM_DEC_Create
Gaviraju D B [Tue, 10 Sep 2019 09:01:00 +0000 (14:31 +0530)]
Decoder: Delayed work-queue is implemented with Timer API MM_DEC_Create

- one bug fix wrt bytesperline calculation TIRTOS
- compiler warnings fixed after MJPEG merge

Signed-off-by: Gaviraju D B <x1046101@ti.com>
4 years agodecoder: linux: Use dma-contig memops for capture buffer allocation
Sunita Nadampalli [Mon, 9 Sep 2019 19:57:01 +0000 (14:57 -0500)]
decoder: linux: Use dma-contig memops for capture buffer allocation

The video decoder hardware does not need contiguous memory for
capture buffers, but for optimal performance for playback to display,
contiguous buffers should be used.

This patch adds a compilation flag to enable allocation of capture
buffers from contiguous memory. The flag is set to enabled by default,
but can be disabled from command line at compile time:

To disable:
    CAPTURE_CONTIG_ALLOC=n

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: Error recovery support has been added
Sunita Nadampalli [Mon, 9 Sep 2019 19:53:04 +0000 (14:53 -0500)]
decoder: Error recovery support has been added

This patch decoder implements error recovery feature
for firmware faults, driver faults, and HW hang scenarios.
The erro scenario is notified to application and
provides recovery from erro scenario by reloading the firmware
image into D5520 core. This feature has been tested with Linux
driver.

Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Megharaj A G <megharaj@ti.com>
4 years agodecoder: MJPEG Decoder support has been added
Sunita Nadampalli [Mon, 9 Sep 2019 19:50:19 +0000 (14:50 -0500)]
decoder: MJPEG Decoder support has been added

This patch implements MJPEG decoding support, and
multiplanar format support (420p and 422p) needed by
D5520MP2 JPEG Decoder. This has been verified in Linux
driver context.

Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: TI RTOS decoder support has been added
Sunita Nadampalli [Mon, 9 Sep 2019 19:46:10 +0000 (14:46 -0500)]
decoder: TI RTOS decoder support has been added

This patch implements H264 decoder support on
TI RTOS: sysbios. The driver supports single
and multi-channel H264 decoding for NV12, 8-bit content.

Signed-off-by: Shiju Sivasankaran <shiju@ti.com>
Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Amai Prashanth Kumar <prashanth.amai@ti.com>
4 years agodriver/encoder: VXE384MP2 encoder driver support has been added
Sunita Nadampalli [Mon, 9 Sep 2019 19:35:51 +0000 (14:35 -0500)]
driver/encoder: VXE384MP2 encoder driver support has been added

This patch adds implementation of H264 encoder using VXE384MP2
core. This patch supports Linux driver and provides common
encoder driver baseline for RTOS encoder.
Supported features are:
1. H264 I & P frame encoding
2. 8-bit content
3. NV12 format
4. configurable bitrate

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoosal: add abstraction for atomic, event, string and regio.
Sunita Nadampalli [Mon, 9 Sep 2019 19:33:38 +0000 (14:33 -0500)]
osal: add abstraction for atomic, event, string and regio.

New OSAL primitive abstraction has been implemented to enable
encoder driver.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodriver/common: move generic modules from decoder to common
Sunita Nadampalli [Mon, 9 Sep 2019 19:30:11 +0000 (14:30 -0500)]
driver/common: move generic modules from decoder to common

To enable encoder driver along with decoder, some of the generic
utility files have been moved from decoder folder to common.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: Debug instrumentation has been added
Sunita Nadampalli [Mon, 9 Sep 2019 19:23:54 +0000 (14:23 -0500)]
decoder: Debug instrumentation has been added

Detailed debug/info/error tracing has been added
to be able to debug video driver issues.
The logs are controlled via compile time kernel config:
DEBUG_DECODER_DRIVER.
by default, the config is disabled.
In order to collect the traces, the driver needs to be
rebuilt with this config enabled.
This is critical to isolate the issue between Host side
driver vs D5520MP2 Firmware.

Signed-off-by: Amit Makani <amit.makani@ti.com>
4 years agodecoder: Added negotiation for video resolution and reference buffer count
Sunita Nadampalli [Mon, 9 Sep 2019 19:20:02 +0000 (14:20 -0500)]
decoder: Added negotiation for video resolution and reference buffer count

In order to optimize the buffer requirements for decode use case,
support has been added to dynamically query the buffer size and
count requirements for any given video stream.

Signed-off-by: Nikki Shah <a0226721@ti.com>
4 years agodecoder: separate V4L2 node implementation from common driver
Sunita Nadampalli [Mon, 9 Sep 2019 19:15:52 +0000 (14:15 -0500)]
decoder: separate V4L2 node implementation from common driver

To make common driver OS agnostic, some of the interface logic
has been split between common driver and linux specific.
And moved all Linux specific implementation from decoder folder
to linux/decoder.

Signed-off-by: Amit Makani <amit.makani@ti.com>
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agoosal: Interrupt, platform, workque and page alloc abstraction fixes
Sunita Nadampalli [Mon, 9 Sep 2019 19:10:34 +0000 (14:10 -0500)]
osal: Interrupt, platform, workque and page alloc abstraction fixes

In order to support TI RTOS driver along with Linux,
OSAL interface headers are updated to meet TIRTOS
requirements.

Signed-off-by: Gaviraju D B <x1046101@ti.com>
Signed-off-by: Shiju Sivasankaran <shiju@ti.com>
4 years agodecoder: directory structure update to enable common driver model
Sunita Nadampalli [Mon, 9 Sep 2019 18:54:39 +0000 (13:54 -0500)]
decoder: directory structure update to enable common driver model

Linux driver code is re-organized to separate low level driver code
from Linux V4L2 node. This provides baseline for RTOS decoder driver
and Linux/RTOS encoder drivers going to be added in the future.
Below is the brief descritpion about different directories the driver
will be organised into. This patch adds basic folders, and the remaining
will be added in future patches:

driver: OS agnostic driver code for both decoders and encoders
driver/decoder: Core Decoder driver
driver/common: utility modules common between decoder and encoder drivers
driver/encoder: Core Encoder driver

linux/decoder: Linux OS specifc decoder sources/headers and makefiles
linux/encoder: Linux OS specifc encoder sources/headers and makefiles

tirtos/decoder: TI RTOS decoder specific files
tirtos/encoder: TI RTOS encoder specific files

timmlib/decoder: TI MM lib decoder interface files
timmlib/encoder: TI MM lin encoder interface files

osal/inc: OS abstraction header definitions
osal/src/linux: Linux OSAL implementation files
osal/src/tirtos: TI RTOS OSAL implementation files

Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
4 years agodecoder: fix spinlock_rt expected expression error
Angela Stegmaier [Mon, 1 Jul 2019 20:42:06 +0000 (15:42 -0500)]
decoder: fix spinlock_rt expected expression error

The following error is being thrown in rt-linux builds.
This patch fixes the error by removing the un-needed
return from a void function. After fixing this error
a typecheck error is thrown due to no casting of the flags.
Also added casting of the flags to fix that error as well.

In file included from ./include/linux/spinlock.h:317,
                 from osal/src/linux/osa_spin.c:18:
osal/src/linux/osa_spin.c: In function ‘osa_spin_unlock_irqrestore’:
./include/linux/spinlock_rt.h:121:2: error: expected expression before ‘do’
  do {      \
  ^~
osal/src/linux/osa_spin.c:68:12: note: in expansion of macro ‘spin_unlock_irqrestore’
     return spin_unlock_irqrestore(lock, flags);
            ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/spinlock_rt.h:121:2: warning: ‘return’ with a value, in function returning void
  do {      \
  ^~
osal/src/linux/osa_spin.c:68:12: note: in expansion of macro ‘spin_unlock_irqrestore’
     return spin_unlock_irqrestore(lock, flags);
            ^~~~~~~~~~~~~~~~~~~~~~
osal/src/linux/osa_spin.c:66:6: note: declared here
 void osa_spin_unlock_irqrestore(void *lock, uint64 flags)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: fix mutex_rt dereferencing void pointer error
Angela Stegmaier [Mon, 1 Jul 2019 20:43:54 +0000 (15:43 -0500)]
decoder: fix mutex_rt dereferencing void pointer error

The following error is thrown in rt-linux builds. This
patch fixes the error by casting the mutex_args.

In file included from ./include/linux/mutex.h:33,
                 from ./include/linux/notifier.h:14,
                 from ./include/linux/memory_hotplug.h:7,
                 from ./include/linux/mmzone.h:748,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/slab.h:15,
                 from osal/src/linux/osa_mutex.c:18:
osal/src/linux/osa_mutex.c: In function ‘osa_mutex_is_locked’:
./include/linux/mutex_rt.h:42:52: warning: dereferencing ‘void *’ pointer
 #define mutex_is_locked(l)  rt_mutex_is_locked(&(l)->lock)
                                                    ^~
osal/src/linux/osa_mutex.c:66:12: note: in expansion of macro ‘mutex_is_locked’
     return mutex_is_locked(mutex_args);
            ^~~~~~~~~~~~~~~
./include/linux/mutex_rt.h:42:52: error: request for member ‘lock’ in something not a structure or union
 #define mutex_is_locked(l)  rt_mutex_is_locked(&(l)->lock)
                                                    ^~
osal/src/linux/osa_mutex.c:66:12: note: in expansion of macro ‘mutex_is_locked’
     return mutex_is_locked(mutex_args);
            ^~~~~~~~~~~~~~~
osal/src/linux/osa_mutex.c:67:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: fix unused variable warnings
Angela Stegmaier [Mon, 1 Jul 2019 20:45:27 +0000 (15:45 -0500)]
decoder: fix unused variable warnings

This patch fixes the following unused variable warnings:

decoder/vxd_dec.c: In function ‘return_worker’:
decoder/vxd_dec.c:183:20: warning: unused variable ‘event’ [-Wunused-variable]
  struct v4l2_event event = {};
                    ^~~~~
decoder/vxd_dec.c:180:26: warning: unused variable ‘vb’ [-Wunused-variable]
  struct vb2_v4l2_buffer *vb;
                          ^~
decoder/vxd_dec.c:179:21: warning: unused variable ‘buf’ [-Wunused-variable]
  struct vxd_buffer *buf = NULL;
                     ^~~

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: fix left-hand operand of comma warnings
Angela Stegmaier [Mon, 1 Jul 2019 20:45:07 +0000 (15:45 -0500)]
decoder: fix left-hand operand of comma warnings

The following warning is being thrown in rt-linux builds
every time OSA_DEV_DBG, OSA_DEV_INFO, OSA_PR_DEBUG and
OSA_PR_INFO are used. This patch fixes the warnings.

decoder/vxd_core.c:125:22: warning: left-hand operand of comma expression has no effect [-Wunused-value]
  OSA_DEV_DBG(vxd->dev, "%s:%d\n", __func__, __LINE__);

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agodecoder: Add decoder firmware file
Angela Stegmaier [Thu, 20 Jun 2019 12:28:42 +0000 (07:28 -0500)]
decoder: Add decoder firmware file

Add the decoder firmware file and the associated LICENSE
file for the firmware.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
4 years agoInitial commit
Angela Stegmaier [Wed, 19 Jun 2019 17:55:30 +0000 (12:55 -0500)]
Initial commit

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>