summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 11191ed)
raw | patch | inline | side by side (from parent 1: 11191ed)
author | Saurabh Bipin Chandra <a0131926@ti.com> | |
Thu, 5 Sep 2013 17:33:07 +0000 (23:03 +0530) | ||
committer | Saurabh Bipin Chandra <a0131926@ti.com> | |
Thu, 5 Sep 2013 17:35:42 +0000 (23:05 +0530) |
This patch adds XDAIS, FC headers included by
the codec header files and makes necessary build
changes to include them.
Change-Id: I6de3988291e6f4fa229b47a119431d83be1025c2
Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
the codec header files and makes necessary build
changes to include them.
Change-Id: I6de3988291e6f4fa229b47a119431d83be1025c2
Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
common.mk | patch | blob | history | |
packages/framework_components/Makefile.am | [new file with mode: 0644] | patch | blob |
packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h | [new file with mode: 0644] | patch | blob |
packages/xdais/ti/xdais/ires.h | [new file with mode: 0644] | patch | blob |
packages/xdais/ti/xdais/ires_common.h | [new file with mode: 0644] | patch | blob |
test_qnx/dce_enc_test/common.mk | patch | blob | history | |
test_qnx/dce_test/common.mk | patch | blob | history |
diff --git a/common.mk b/common.mk
index 5b0ed0cb8b5edf9f4164006cfd8f6a8d7b043ac4..007db8ecd289b127f2f32ee8540b74c567d898ce 100644 (file)
--- a/common.mk
+++ b/common.mk
EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/ivahd_codecs\r
EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdais\r
EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/xdctools\r
+EXTRA_INCVPATH += $(PROJECT_ROOT)/packages/framework_components\r
\r
EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr\r
EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/ti/syslink/\r
diff --git a/packages/framework_components/Makefile.am b/packages/framework_components/Makefile.am
--- /dev/null
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+pkg_includedir = $(includedir)/dce
+
+nobase_pkg_include_HEADERS = ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
diff --git a/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h b/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * Copyright 2013 by Texas Instruments Incorporated.
+ *
+ */
+
+/*
+ * Copyright (c) 2012 - 2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/**
+ * @file ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h
+ *
+ * @brief IRES PROTOCOL HDVICP2 Interface Definitions -
+ * Allows algorithms to request and receive handles representing
+ * the HDVICP2 resource.
+ */
+
+/**
+ * @addtogroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 IRES HDVICP2 Protocol
+ *
+ * Allows algorithms to request and receive handles representing
+ * HDVICP2 resources.
+ */
+
+#ifndef ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_
+#define ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_
+
+/** @ingroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 */
+/*@{*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ti/xdais/xdas.h>
+#include <ti/xdais/ires_common.h>
+#include <ti/xdais/ires.h>
+
+/**
+ * @brief Name used to describe this protocol
+ */
+#define IRES_HDVICP2_PROTOCOLNAME "ti.sdo.fc.ires.hdvicp.hdvicp2"
+
+/**
+ * @brief HDVICP2 module name
+ *
+ * @remarks This name can be passed to Diags_setMask() to enable/disable
+ * logging for this module. For example,
+ * Diags_setMask(HDVICP2_MODNAME"+EX1234567");
+ * enables all Log statements in this module.
+ *
+ * @remarks Diags_setMask() must be called after initialization to take
+ * effect.
+ */
+#define HDVICP2_MODNAME "ti.sdo.fc.ires.hdvicp2"
+
+
+/**
+ * @brief Used to specify the resource required in the protocol args,
+ * resource manager will return
+ * an HDVICP2 resource that is available to the scratch group.
+ */
+#define IRES_HDVICP2_ID_ANY -2
+
+/**
+ * @brief Used to specify the resource required for protocol args, late acquire
+ * implies that no resource is to be returned right now, resource will be
+ * acquired later in the process call, using the acquire fxn returned
+ * via the IRES_HDVICP2_Handle.
+ */
+#define IRES_HDVICP2_ID_LATE_ACQUIRE -1
+
+/**
+ * @brief Invalid address
+ *
+ * @remarks Indicates the address returned in the IRES_HDVICP2_Handle
+ * is not yet valid, and should not be used.
+ */
+#define IRES_HDVICP2_INVALID_ADDR 0xFFFFFFFF
+
+/**
+ * @brief Wait forever (never timeout)
+ *
+ * @remarks Used to indicate to IRES_HDVICP2_Obj::wait() that the call
+ * should never timeout.
+ */
+#define IRES_HDVICP2_TIMEOUTFOREVER ((UInt)(-1))
+
+/**
+ * @brief Unknown late acquire argument.
+ *
+ * @remarks This definition should be used when a particular algorithm
+ * doesn't have an application-provided late acquire argument.
+ * The codec should supply IRES_HDVICP2_UNKNOWNLATEACQUIREARG
+ * as the argument to acquire() in this case.
+ *
+ * @sa XDM_CmdId::XDM_SETLATEACQUIREARG
+ */
+#define IRES_HDVICP2_UNKNOWNLATEACQUIREARG (-1)
+
+/*
+ * Note, we wrap the PROTOCOLVERSION in an ifdef so the
+ * resource managers and algs get this version data placed in their object
+ * files. Apps, which include rman.h, will have this 'NOPROTOCOLREV' defined.
+ */
+#ifndef ti_sdo_fc_ires_NOPROTOCOLREV
+
+/**
+ * @brief Protocol Revision for this resource
+ */
+static IRES_ProtocolRevision IRES_HDVICP2_PROTOCOLREVISION = { 1, 0, 0 };
+
+#endif
+
+/**
+ * @brief Handle to "logical" resource
+ */
+typedef struct IRES_HDVICP2_Obj *IRES_HDVICP2_Handle;
+
+
+/**
+ * @brief Timeout value to be used by implementation of
+ * IRES_HDVICP2_Handle:wait function
+ */
+extern unsigned int ti_sdo_fc_ires_hdvicp_HDVICP2_timeoutVal;
+
+/**
+ * @brief
+ */
+typedef IRES_YieldArgs (*ti_sdo_fc_ires_hdvicp_HDVICP2_GetYieldArgsFxn)
+ (Int scratchId);
+
+/**
+ * @brief
+ */
+typedef Void (*ti_sdo_fc_ires_hdvicp_HDVICP2_YieldFxn)
+ (IRES_YieldResourceType resource, IRES_YieldContextHandle ctxt,
+ IRES_YieldArgs args);
+
+
+
+/**
+ * @brief HDVICP2 Protocol Arguments definition.
+ */
+typedef struct IRES_HDVICP2_ProtocolArgs {
+
+ IRES_ProtocolArgs base; /**< Base protocol Args */
+ XDAS_Int32 id; /**< HDVICP2 resource being requested.
+ *
+ * @remarks Could be 0, 1, 2,
+ * IRES_HDVICP2_ID_ANY or
+ * IRES_HDVICP2_ID_LATE_ACQUIRE.
+ */
+} IRES_HDVICP2_ProtocolArgs;
+
+/**
+ * @brief Callback function signature, used by the IRES_HDVICP2_
+ * Handle's configure function
+ */
+typedef void (*IRES_HDVICP2_CallbackFxn)(IALG_Handle handle, Void *args);
+
+/**
+ * @brief Describes the status/history of the HDVICP2 unit that is
+ * returned by the acquire call. This information can be
+ * used by the codec to avoid reloading the data memory or
+ * the program memory in the HDVICP2.
+ *
+ * @enumWarning
+ */
+typedef enum IRES_HDVICP2_Status {
+ SAMECODEC = 0, /**< Same codec was granted this unit, last time */
+ SAMECODECTYPE = 1, /**< Different codec, but of the same codec class
+ was granted this unit last time */
+ DIFFERENTCODEC = 2 /**< Completely different codec ran last time */
+} IRES_HDVICP2_Status;
+
+
+/**
+ * @brief IRES_HDVICP2_Obj extends the generic IRES_Obj structure
+ * that is returned back to the algorithm requesting the
+ * resource.
+ */
+typedef struct IRES_HDVICP2_Obj {
+
+ IRES_Obj ires; /**< Base IRES_Obj struct */
+ Void *info; /**< Reserved for future use */
+ XDAS_Int32 id; /**< HDVICP2 id granted
+ *
+ * @remark Could be 0, 1, 2, or
+ * LATE_ACQUIRE
+ */
+ XDAS_Void *registerBaseAddress; /**< Register space base address of the
+ * HDVICP2 being granted
+ */
+ XDAS_Void *memoryBaseAddress; /**< Memory space base address of the
+ * HDVICP2 being granted
+ */
+ XDAS_Void *resetControlAddress; /**< HDVICP reset controller address
+ *
+ * @remarks bit 0 -> ICONT1 reset,
+ * bit 1 -> ICONT2 reset
+ */
+
+ /**
+ * @brief Acquire the HDVICP2 resource.
+ *
+ * @remarks This call acquires the HDVICP resource which the alg may
+ * (or may not) have specifically requested.
+ *
+ * @remarks The returned @c hdvicp2Status indicates the status of
+ * the particular HDVICP2 unit that is returned.
+ * @sa IRES_HDVICP2_Status
+ *
+ * @remarks The @c configurationId argument is a codec specified
+ * parameter that is both an input and output parameter. It
+ * specifies the mode in which this particular HDVICP2 was
+ * used last time, and the mode in which it will be
+ * used this time.
+ *
+ * @remarks This API takes a @c yieldContext as argument, as it may
+ * yield the processor to higher priority codecs in the
+ * system.
+ *
+ * @remarks @c lateAcquireId is an optionally framework supplied
+ * parameter (sometimes provided via an XDM control() call
+ * setting the XDM_SETLATEACQUIREARG. If not supplied, the
+ * codec should pass the value
+ * #IRES_HDVICP2_UNKNOWNLATEACQUIREARG.
+ *
+ * @sa IRES_HDVICP2_UNKNOWNLATEACQUIREARG
+ */
+ XDAS_Void (*acquire)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle,
+ IRES_YieldContext *yieldCtxt, XDAS_UInt32 *hdvicp2Status,
+ XDAS_UInt32 *configurationId, XDAS_Int32 lateAcquireArg);
+
+ /**
+ * @brief Release the HDVICP2 resource.
+ *
+ * @remarks This makes the resource available for use by other algorithms.
+ */
+ XDAS_Void (*release)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle);
+
+ /**
+ * @brief Reacquire the HDVICP2 resource recent released.
+ *
+ * @returns XDAS_TRUE The resource was not yet acquired by another
+ * algorithm, and the resource handle is still
+ * valid.
+ * @returns XDAS_FALSE The resource is no longer available and has been
+ * deactivated.
+ */
+ XDAS_UInt32 (*reacquireIfOwner)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle);
+
+ /**
+ * @brief Register a callback function with a HDVICP2 instance.
+ *
+ * @remarks The callback is invoked when an interrupt fires after
+ * processing data.
+ *
+ * @remarks It is the algorithm's responsibility to configure the HDVICP2
+ * to process data and fire the interrupt when done.
+ */
+ XDAS_Void (*configure)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle,
+ IRES_HDVICP2_CallbackFxn cbFunctionPtr, XDAS_Void *cbArgs);
+
+ /**
+ * @brief Wait until the HDVICP2 is done processing and then return.
+ *
+ * @remarks This is a blocking call, unless a positive timeout value
+ * is configured, inwhich case the call returns after timeout.
+ *
+ * @remarks This function is passed a yieldContext, and will relinquish
+ * the processor while it waits for the HDVICP2 to finish the
+ * processing and return from wait.
+ *
+ * @returns XDAS_TRUE Success
+ * @returns XDAS_FALSE Failure/Timeout
+ */
+ XDAS_UInt32 (*wait)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle,
+ IRES_YieldContext *yieldCtxt);
+
+ /**
+ * @brief Processing has completed.
+ *
+ * @remarks This is called from within the interrupt handler function when
+ * processing completes, and is used to unblock the wait() API.
+ *
+ * @remarks Typically, this is called from within the algortihm's callback
+ * function (see acquire() call).
+ */
+ XDAS_Void (*done)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle);
+ /**
+ * @brief Reset the HDVICP2.
+ *
+ * @remarks This can be called by the algorithm to "reset" the HDVICP2, and
+ * is usually called when an acquired HDVICP2 is "dirty", i.e, it
+ * requires both program/data reload.
+ *
+ * @remarks It works off a configured maximum reset cycle delay.
+ *
+ * @returns XDAS_TRUE Success
+ * @returns XDAS_FALSE Failure
+ */
+ XDAS_UInt32 (*reset)(IALG_Handle algHandle,
+ struct IRES_HDVICP2_Obj *hdvicpHandle);
+
+} IRES_HDVICP2_Obj;
+
+
+/**
+ * @brief HDVICP2 Register Layout
+ */
+typedef struct IRES_HDVICP2_RegisterLayer {
+
+ int size;
+ /* TBD */
+} IRES_HDVICP2_RegisterLayer;
+
+/**
+ * @brief Static Resource Properties
+ */
+typedef struct IRES_HDVICP2_Properties {
+
+ int size;
+ IRES_HDVICP2_RegisterLayer *globalRegs; /* Register layer of HDVICP2 */
+} IRES_HDVICP2_Properties;
+
+typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_GetHdvicp2Fxn)
+ (XDAS_Int32 *Id, IALG_Handle alg, IRES_HDVICP2_Handle handle);
+
+typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_FreeHdvicp2Fxn)
+ (XDAS_Int32 Id, IALG_Handle alg, IRES_HDVICP2_Handle handle);
+
+#ifdef __cplusplus
+}
+#endif /* extern "C" */
+
+/*@}*/
+
+#endif
+/*
+ * @(#) ti.sdo.fc.ires.hdvicp; 1, 0, 1,1; 6-12-2013 19:57:33; /db/atree/library/trees/fc/fc-t09/src/ xlibrary
+
+ */
+
diff --git a/packages/xdais/ti/xdais/ires.h b/packages/xdais/ti/xdais/ires.h
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2006-2012, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/**
+ * @file ti/xdais/ires.h
+ *
+ * @brief IRES Interface Definitions - Allows algorithms to
+ * request and receive handles representing private logical
+ * resources.
+ */
+
+/**
+ * @defgroup DSPIRES IRES
+ *
+ * The IRES interface enables algorithms to request and
+ * receive handles representing private logical resources.
+ */
+#ifndef IRES_
+#define IRES_
+
+/** @ingroup DSPIRES */
+/*@{*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ires_common.h"
+
+typedef enum IRES_YieldResourceType {
+ IRES_ALL = 0, /**< Yielding all resources held by the
+ * algorithm.
+ */
+ IRES_SCRATCHMEMORY, /**< Yielding all scratch memory
+ * resources held by the algorithm.
+ */
+ IRES_SCRATCHDMA, /**< Yielding all IDMA3 resources held
+ * by the algorithm.
+ */
+ IRES_RESOURCEHANDLE /**< Yielding IRES resource handle only.
+ */
+
+} IRES_YieldResourceType;
+
+typedef Void (*IRES_ContextSaveFxn)(IALG_Handle algHandle, Void *contextArgs);
+typedef Void (*IRES_ContextRestoreFxn)
+ (IALG_Handle algHandle, Void *contextArgs);
+
+/**
+ * @brief Specifies the algorithm specific handles
+ * and context save & restore function pointers and arguments
+ * that the framework will call during a context switch.
+ */
+typedef struct IRES_YieldContext {
+
+ /**
+ * Handle of the algorithm instance issuing the "yield".
+ */
+ IALG_Handle algHandle;
+
+ /**
+ * Optional resource handle that may be used to yield a particular
+ * IRES resource.
+ * May be NULL when some other resource or ALL resources associated
+ * with an algorithm are to be yielded.
+ */
+ IRES_Handle resourceHandle;
+
+ /**
+ * The 'contextSave' function is implemented by the 'yielding' algorithm
+ * instance and must be called by the framework whenever the 'yield'
+ * results in a context switch.
+ * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must
+ * be considered in volatile state during a 'yield' call, and must be
+ * re-initialized and activated following any context switch.
+ * The 'contextSave' function must save any volatile state information in
+ * its persistent memory that it needs in the subsequent 'contextRestore'
+ * function call to re-initialize and activate its scratch resources.
+ */
+ IRES_ContextSaveFxn contextSave;
+
+ /**
+ * The 'contextRestore' function is implemented by the 'yielding' algorithm
+ * instance and must be called by the framework following a context switch
+ * which occured as a result of the 'yield', prior to returning from the
+ * framework supplied 'yield-function'.
+ *
+ * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must
+ * be considered in volatile state during a 'yield' call, and must be
+ * re-initialized and activated following any context swith.
+ * The 'contextRestore' function uses the saved context information in
+ * the preceeding 'contextSave' call to re-initialize and activate its
+ * scratch resources.
+ */
+ IRES_ContextRestoreFxn contextRestore;
+
+ /**
+ * The arguments that must be passed when calling the 'contextSave()'
+ * and 'contextRestore()' functions.
+ * The algorithm instance calling the 'yield function' optionally
+ * supplies any 'contextArgs' that it wants the framework to passed to the
+ * 'contextSave()' and 'contextRestore()' functions.
+ */
+ Void *contextArgs;
+
+} IRES_YieldContext;
+
+
+typedef IRES_YieldContext *IRES_YieldContextHandle;
+typedef Void *IRES_YieldArgs;
+
+/**
+ * @brief The 'yield function' pointer and 'yield arguments' are supplied
+ * to an algorithm during its IRES interface 'initialization'.
+ * The algorithm optionally calls the yield function during its
+ * 'process' stages for co-operative multi-tasking and pre-emption
+ * by a higher priority algorithm.
+ *
+ * An operating system level context switch may occur during the
+ * yield call. Whenever a context switch occurs, all
+ * scratch resources owned by the yielding algorithm must be
+ * context saved prior to the context switch and restored and
+ * initialized prior to 'resumption' by the framework/application.
+ * The 'yielding' algorithm must supply the IRES_YieldContext and
+ * the 'yield arguments' it received during IRES initialization.
+ * The framework calls the context save & restore functions
+ * provided by the yielding algorithm's IRES_YieldContext.
+ */
+typedef Void (*IRES_YieldFxn)(IRES_YieldResourceType resourceType,
+ IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
+
+/**
+ * @brief These fxns are used to query/grant the resources requested
+ * by the algorithm at initialization time, and to change these
+ * resources at runtime. All these fxns are implemented by the
+ * algorithm, and called by the client of the algorithm.
+ */
+typedef struct IRES_Fxns {
+
+ /**
+ * @brief Unique pointer that identifies the module implementing this
+ * interface.
+ */
+ Void *implementationId;
+
+ /**
+ * @brief Query function to obtain the list of IRES resources requested
+ * by the algorithm instance.
+ */
+ IRES_Status (*getResourceDescriptors)(IALG_Handle handle,
+ IRES_ResourceDescriptor *resourceDescriptors);
+
+ /**
+ * @brief Query function to obtain the number of IRES resources
+ * requested by the algorithm instance, which is also the number
+ * of resource descriptors that must be passed to the
+ * getResourceDescriptors() function.
+ *
+ */
+ Int32 (*numResourceDescriptors)(IALG_Handle handle);
+
+ /**
+ * @brief Assignment function to grant the algorithm instance the list
+ * of IRES resources it requested. The algorithm can initialize
+ * internal instance memory with resource information, but may not
+ * use or access the resource state until the resource is
+ * activated via the activateResource call.
+ *
+ * @remark Version of the resource handle being granted is updated in
+ * the resourceDescriptor, and may be different from the one
+ * requested.
+ */
+ IRES_Status (*initResources)(IALG_Handle handle,
+ IRES_ResourceDescriptor *resourceDescriptor,
+ IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs);
+
+ /**
+ * @brief Re-assignment function to grant the algorithm instance
+ * a list of "modified" IRES resources.
+ * The algorithm may choose to not support the re-assignment and
+ * indicate this by returning failure.
+ * In case of success the algorithm updates its internal state
+ * to reflect the new resource information, but may not
+ * use or access the resource state until the resource is
+ * activated via the activateResource call.
+ */
+ IRES_Status (*reinitResources)(IALG_Handle handle,
+ IRES_ResourceDescriptor *resourceDescriptor,
+ IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs);
+
+ /**
+ * @brief Deinitialization function to revoke back the resources
+ * that have been granted to the algorithm instance.
+ */
+ IRES_Status (*deinitResources)(IALG_Handle handle,
+ IRES_ResourceDescriptor *resourceDescriptor);
+
+ /**
+ * @brief Resource Activation call to grant the algorithm instance
+ * exclusive access to the potentially shared resource.
+ * Algorithm can now access, initialize and or restore from a
+ * previous context saved during deactivation to use the resource.
+ * Each resource must be activated individually to give the
+ * framework optimization opportunities by tracking and deciding
+ * which resources truely require activation.
+ */
+ IRES_Status (*activateResource)(IALG_Handle handle,
+ IRES_Handle resourceHandle);
+
+ /**
+ * @brief Resource Activation call to grant the algorithm instance
+ * exclusive access to all resources it acquired via IRES.
+ * Algorithm can now access, initialize and or restore from a
+ * previous context saved during deactivation to use the resources.
+ */
+ IRES_Status (*activateAllResources)(IALG_Handle handle);
+
+ /**
+ * @brief Resource Deactivation call to revoke the algorithm instance's
+ * exclusive access to the potentially shared resource.
+ * Algorithm must save any context that is needed to restore the
+ * state during the next resource activation call.
+ */
+ IRES_Status (*deactivateResource)(IALG_Handle handle,
+ IRES_Handle resourceHandle);
+
+ /**
+ * @brief Resource Deactivation call to revoke the algorithm instance's
+ * exclusive access to ALL shared resources.
+ * Algorithm must save any context that is needed to restore the
+ * state during the next resource activation call.
+ */
+ IRES_Status (*deactivateAllResources)(IALG_Handle handle);
+
+} IRES_Fxns;
+
+/*@}*/
+
+
+#ifdef __cplusplus
+}
+#endif /* extern "C" */
+
+
+#endif /* IRES_ */
+
diff --git a/packages/xdais/ti/xdais/ires_common.h b/packages/xdais/ti/xdais/ires_common.h
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2006-2012, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/**
+ * @file ti/xdais/ires_common.h
+ *
+ * @brief IRES Resource Protocol Definitions - IRES Resource
+ */
+
+#ifndef IRES_COMMON_
+#define IRES_COMMON_
+
+/** @ingroup DSPIRES */
+/*@{*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ialg.h"
+
+
+/**
+ * @brief IRES_Status defines the standard error and success codes
+ * returned by IRES APIs.
+ */
+typedef enum IRES_Status {
+ IRES_OK = 0, /**< Success */
+ IRES_EALG = 1, /**< Error in algorithm IRES_Fxns functions */
+ IRES_EEXISTS = 2, /**< Error, already exists */
+ IRES_EFAIL = 3, /**< Generic Error Message */
+ IRES_EINIT = 4, /**< Error, already initialized */
+ IRES_ENOINIT = 5, /**< Error, not initialized */
+ IRES_ENOMEM = 6, /**< Error, not enough memory */
+ IRES_ENORESOURCE = 7, /**< Error, resource unavailable*/
+ IRES_ENOTFOUND = 8 /**< Error, not found */
+} IRES_Status;
+
+/**
+ * @brief Protocol revision type.
+ * Used to ensure the given 'protocol' revision can be validated.
+ */
+typedef struct IRES_ProtocolRevision {
+ unsigned int Major;
+ unsigned int Source;
+ unsigned int Radius; /* Using unsigned int here to support
+ * xdc/std.h as well as tistdtypes.h
+ */
+} IRES_ProtocolRevision;
+
+
+/**
+ * @brief Mode in which resources can be requested.
+ */
+typedef enum IRES_RequestMode {
+ IRES_SCRATCH, /**< Indicates that resource requested
+ * can be shared with other
+ * algorithms in the same group.
+ */
+ IRES_PERSISTENT, /**< Indicates that resource requested
+ * for allocation exclusively for
+ * this algorithm.
+ */
+ IRES_LATEACQUIRE /**< Indicates that resource requested
+ * will not be granted immediately, but
+ * afterwards. Specific IRES APIs will need
+ * to be called, to ensure that a particular
+ * algorithm is the only user of these
+ * resources.
+ */
+} IRES_RequestMode;
+
+
+/**
+ * @brief Abstract Protocol Arguments structure definition.
+ * Actual arguments passed by the algorithm to request a resource
+ * from a specific IRES Protocol will extend and supply the
+ * concrete definitions.
+ */
+typedef struct IRES_ProtocolArgs {
+
+ Int32 size; /**< Size of this structure. */
+ IRES_RequestMode mode; /**< Resource request mode.
+ *
+ * @sa IRES_RequestMode
+ */
+} IRES_ProtocolArgs;
+
+/**
+ * @brief Descriptor to Logical Resource.
+ */
+typedef struct IRES_ResourceDescriptor {
+
+ /**
+ * String containing the package name to identify the resource.
+ */
+ String resourceName;
+
+ /**
+ * @brief Pointer to the Resource Protocol Arguments.
+ *
+ * @remark The Resource Manager selects the appropriate resource protocol
+ * based on the supplied @c resourceName, and uses the protocol to
+ * construct the IRES Resource Handle.
+ */
+ struct IRES_ProtocolArgs *protocolArgs;
+
+ /**
+ * @brief The revision of the IRES_ResourceProtocol Interface expected
+ * by the client algorithm.
+ *
+ * @remark Depending on the resource manager implementation,
+ * the returned resource may/may not coincide with the version
+ * being requested. Resource manager will update this field with
+ * the version of the handle it returns (and supports).
+ */
+ IRES_ProtocolRevision *revision;
+
+ /**
+ * The handle to the object representing the requested resource.
+ * The handle is initially set to 'null' by the requesting algorithm.
+ * The 'resource manager' allocates the resource and constructs the
+ * handle.
+ */
+ struct IRES_Obj *handle;
+
+} IRES_ResourceDescriptor;
+
+/**
+ * @brief Abstract Resource Properties structure/pointer definition.
+ * Actual resource protocol will supply the concrete property
+ * definitions.
+ * The list of attributes for the actual resource will expose the
+ * relevant features that needs to be known to a client to use the
+ * resource, such as: resource register base addresses and offsets,
+ * critical register and memory region addresses, ...
+ */
+typedef struct IRES_Properties {
+ Int32 size; /**< Size of this structure. */
+} IRES_Properties;
+
+/**
+ * @brief IRES_Obj holds the private state associated with each
+ * logical resource.
+ */
+typedef struct IRES_Obj {
+
+ /**
+ * Indicates if the resource has been allocated as persistent.
+ */
+ Int32 persistent;
+
+ /**
+ * Obtain the static properties associated with this resource
+ * This could include information like the register layer of the
+ * device etc.
+ */
+ Void (*getStaticProperties)(struct IRES_Obj *resourceHandle,
+ IRES_Properties *resourceProperties);
+
+} IRES_Obj;
+
+/**
+ * @brief Handle to "logical" resource
+ */
+typedef struct IRES_Obj *IRES_Handle;
+
+
+
+#ifdef __cplusplus
+}
+#endif /* extern "C" */
+
+/*@}*/
+
+#endif /* IRES_COMMON_ */
+
index 5a79898f926cb9d590b4d83eb8774bd302d06dd0..5e30a14ac688e4ea92fafe291b148e41213f1eb1 100644 (file)
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools
+EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/framework_components
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../
EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr
index 3d9c9dd49754254a41a3586ed027f8a674897aa5..2c83573404cb06c275438a71a2bb2d8cc11d265d 100644 (file)
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/ivahd_codecs
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdais
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/xdctools
+EXTRA_INCVPATH += $(PROJECT_ROOT)/../../packages/framework_components
EXTRA_INCVPATH += $(PROJECT_ROOT)/../../
EXTRA_INCVPATH += $(IPCHEADERS)/usr/include/memmgr