Permalink
Browse files

Fix for 'Failed to add service'

Switch to new libCEC compatible CEC service. Note: this breaks compatibility with existing CEC service
  • Loading branch information...
1 parent ead4b82 commit d535b28c272ac49de85bd4212c86668671f49dbd @popcornmix popcornmix committed Jul 28, 2012
Showing with 380 additions and 52 deletions.
  1. BIN boot/arm128_start.elf
  2. BIN boot/arm192_start.elf
  3. BIN boot/arm224_start.elf
  4. BIN boot/arm240_start.elf
  5. BIN boot/start.elf
  6. BIN hardfp/opt/vc/bin/edidparser
  7. BIN hardfp/opt/vc/bin/tvservice
  8. +23 −1 hardfp/opt/vc/include/interface/vmcs_host/vc_cec.h
  9. +77 −4 hardfp/opt/vc/include/interface/vmcs_host/vc_cecservice.h
  10. +70 −2 hardfp/opt/vc/include/interface/vmcs_host/vc_cecservice_defs.h
  11. +4 −6 hardfp/opt/vc/include/interface/vmcs_host/vc_sdtv.h
  12. +13 −8 hardfp/opt/vc/include/interface/vmcs_host/vc_tvservice.h
  13. +3 −5 hardfp/opt/vc/include/interface/vmcs_host/vc_tvservice_defs.h
  14. BIN hardfp/opt/vc/lib/libEGL_static.a
  15. BIN hardfp/opt/vc/lib/libGLESv2_static.a
  16. BIN hardfp/opt/vc/lib/libbcm_host.so
  17. BIN hardfp/opt/vc/lib/libkhrn_client.a
  18. BIN hardfp/opt/vc/lib/libkhrn_static.a
  19. BIN hardfp/opt/vc/lib/libvcfiled_check.a
  20. BIN hardfp/opt/vc/lib/libvchostif.a
  21. BIN hardfp/opt/vc/lib/libvmcs_rpc_client.a
  22. BIN opt/vc/bin/edidparser
  23. BIN opt/vc/bin/tvservice
  24. +23 −1 opt/vc/include/interface/vmcs_host/vc_cec.h
  25. +77 −4 opt/vc/include/interface/vmcs_host/vc_cecservice.h
  26. +70 −2 opt/vc/include/interface/vmcs_host/vc_cecservice_defs.h
  27. +4 −6 opt/vc/include/interface/vmcs_host/vc_sdtv.h
  28. +13 −8 opt/vc/include/interface/vmcs_host/vc_tvservice.h
  29. +3 −5 opt/vc/include/interface/vmcs_host/vc_tvservice_defs.h
  30. BIN opt/vc/lib/libEGL_static.a
  31. BIN opt/vc/lib/libGLESv2_static.a
  32. BIN opt/vc/lib/libbcm_host.so
  33. BIN opt/vc/lib/libkhrn_client.a
  34. BIN opt/vc/lib/libkhrn_static.a
  35. BIN opt/vc/lib/libvcfiled_check.a
  36. BIN opt/vc/lib/libvchostif.a
  37. BIN opt/vc/lib/libvmcs_rpc_client.a
View
BIN boot/arm128_start.elf
Binary file not shown.
View
BIN boot/arm192_start.elf
Binary file not shown.
View
BIN boot/arm224_start.elf
Binary file not shown.
View
BIN boot/arm240_start.elf
Binary file not shown.
View
BIN boot/start.elf
Binary file not shown.
View
BIN hardfp/opt/vc/bin/edidparser
Binary file not shown.
View
BIN hardfp/opt/vc/bin/tvservice
Binary file not shown.
View
24 hardfp/opt/vc/include/interface/vmcs_host/vc_cec.h
@@ -25,10 +25,18 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC related constants - shared by both host and vc.
+/*
+ * CEC related constants - shared by both host and vc.
+ */
#ifndef _VC_CEC_H_
#define _VC_CEC_H_
+
+#ifndef STRINGIFY
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+#endif
+
//Broadcast address and TV logical address
#define CEC_BROADCAST_ADDR 0x0F
#define CEC_TV_ADDRESS 0x00
@@ -482,4 +490,18 @@ typedef void (*CEC_CALLBACK_T)(void *client_p, uint32_t reason, uint32_t param1,
#define CEC_CB_OPCODE(x) (((x) >> 8) & 0xFF) /** Get the opcode from first parameter */
#define CEC_CB_OPERAND1(x) (((x) >> 16) & 0xFF) /** Get the button code from <User Control Pressed> or the first operand of the opcode */
#define CEC_CB_OPERAND2(x) (((x) >> 24) & 0xFF) /** Get the second operand of opcode */
+
+//CEC service return code
+typedef enum {
+ VC_CEC_SUCCESS = 0, /** OK */
+ VC_CEC_ERROR_NO_ACK = 1, /** No acknowledgement */
+ VC_CEC_ERROR_SHUTDOWN = 2, /** In the process of shutting down */
+ VC_CEC_ERROR_BUSY = 3, /** block is busy */
+ VC_CEC_ERROR_NO_LA = 4, /** No logical address */
+ VC_CEC_ERROR_NO_PA = 5, /** No physical address */
+ VC_CEC_ERROR_NO_TOPO = 6, /** No topology */
+ VC_CEC_ERROR_INVALID_FOLLOWER = 7, /** Invalid follower */
+ VC_CEC_ERROR_INVALID_ARGUMENT = 8 /** Invalid arguments */
+} VC_CEC_ERROR_T;
+
#endif
View
81 hardfp/opt/vc/include/interface/vmcs_host/vc_cecservice.h
@@ -25,9 +25,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC service host API,
-// See vc_cec.h and vc_cecservice_defs.h for related constants
-
+/*
+ * CEC service host API,
+ * See vc_cec.h and vc_cecservice_defs.h for related constants
+ */
#ifndef _VC_CECSERVICE_H_
#define _VC_CECSERVICE_H_
@@ -43,6 +44,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This API defines the controls for CEC. HDMI must be powered on before
* CEC is available (subject to CEC support in TV).
*
+ * In general, a zero return value indicates success; a negative return
+ * value indicates error in VCHI layer; a positive return value indicates
+ * alternative return value from the server
*/
/**
@@ -298,7 +302,8 @@ VCHPRE_ int VCHPOST_ vc_cec_get_vendor_id(const CEC_AllDevices_T logical_address
*
* @param logical address
*
- * @return the default device type
+ * @return the default device type, if there is any error, the return device
+ * type will be CEC_DeviceType_Invalid
*
************************************************************/
VCHPRE_ CEC_DEVICE_TYPE_T VCHPOST_ vc_cec_device_type(const CEC_AllDevices_T logical_address);
@@ -320,6 +325,74 @@ VCHPRE_ int VCHPOST_ vc_cec_param2message( const uint32_t reason, const uint32_t
const uint32_t param2, const uint32_t param3,
const uint32_t param4, VC_CEC_MESSAGE_T *message);
+//Extra API if CEC is running in passive mode
+//If CEC is not in passive mode the following 3 functions always
+//return failure
+/**
+ * <DFN> vc_cec_poll_address </DFN> sets and polls a particular address to find out
+ * its availability in the CEC network. Only available when CEC is running in passive
+ * mode. The host can only call this function during logical address allocation stage.
+ *
+ * @param logical address to try
+ *
+ * @return 0 if poll is successful (address is occupied)
+ * >0 if poll is unsuccessful (Error code is in VC_CEC_ERROR_T in vc_cec.h)
+ * <0 VCHI errors
+ */
+VCHPRE_ int VCHPOST_ vc_cec_poll_address(const CEC_AllDevices_T logical_address);
+
+/**
+ * <DFN> vc_cec_set_logical_address </DFN> sets the logical address, device type
+ * and vendor ID to be in use. Only available when CEC is running in passive
+ * mode. It is the responsibility of the host to make sure the logical address
+ * is actually free to be used. Physical address will be what is read from EDID.
+ *
+ * @param logical address
+ *
+ * @param device type
+ *
+ * @param vendor ID
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_set_logical_address(const CEC_AllDevices_T logical_address,
+ const CEC_DEVICE_TYPE_T device_type,
+ const uint32_t vendor_id);
+
+/**
+ * <DFN> vc_cec_add_device </DFN> adds a new device to topology.
+ * Only available when CEC is running in passive mode. Device will be
+ * automatically removed from topology if a failed xmit is detected.
+ * If last_device is true, it will trigger a topology computation
+ * (and may trigger a topology callback).
+ *
+ * @param logical address
+ *
+ * @param physical address
+ *
+ * @param device type
+ *
+ * @param true if this is the last device, false otherwise
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_add_device(const CEC_AllDevices_T logical_address,
+ const uint16_t physical_address,
+ const CEC_DEVICE_TYPE_T device_type,
+ bool_t last_device);
+
+/**
+ * <DFN> vc_cec_set_passive </DFN> enables and disables passive mode.
+ * Call this function first (with VC_TRUE as the argument) to enable
+ * passive mode before calling any of the above passive API functions
+ *
+ * @param TRUE to enable passive mode, FALSE to disable
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_set_passive(bool_t enabled);
+
+
//API for some common CEC messages
/**
* Functions beginning with vc_cec_send_xxx make it easier for the
View
72 hardfp/opt/vc/include/interface/vmcs_host/vc_cecservice_defs.h
@@ -25,13 +25,38 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC service command enumeration.
+/*
+ * CEC service command enumeration and parameter types.
+ */
+
+/**
+ * \file
+ * This file contains definition shared by host side and
+ * Videocore side CEC service:
+ *
+ * In general, a zero return value indicates success of the function
+ * A non-zero value indicates VCHI error
+ * A positive value indicates alternative return value (for some functions).
+ *
+ */
+
#ifndef _VC_CECSERVICE_DEFS_H_
#define _VC_CECSERVICE_DEFS_H_
#include "vcinclude/common.h"
+#include "interface/vcos/vcos.h"
+#include "interface/vcos/vcos_logging.h"
#include "interface/vchi/message_drivers/message.h"
+//CEC VCOS logging stuff
+#define CECHOST_LOG_CATEGORY (&cechost_log_category)
+#define vc_cec_log_trace(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_TRACE, __VA_ARGS__)
+#define vc_cec_log_warn(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_WARN, __VA_ARGS__)
+#define vc_cec_log_error(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_ERROR, __VA_ARGS__)
+#define vc_cec_log_info(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__)
+extern VCOS_LOG_CAT_T cechost_log_category; //The actual object lives in CEC host side service code
+
+#define VC_CECSERVICE_VER 1
#define CECSERVICE_MSGFIFO_SIZE 1024
#define CECSERVICE_CLIENT_NAME MAKE_FOURCC("CECS")
#define CECSERVICE_NOTIFY_NAME MAKE_FOURCC("CECN")
@@ -51,6 +76,14 @@ typedef enum {
VC_CEC_SET_OSD_NAME,
VC_CEC_GET_PHYSICAL_ADDR,
VC_CEC_GET_VENDOR_ID,
+
+ //The following 3 commands are used when CEC middleware is
+ //running in passive mode (i.e. it does not allocate
+ //logical address automatically)
+ VC_CEC_POLL_ADDR,
+ VC_CEC_SET_LOGICAL_ADDR,
+ VC_CEC_ADD_DEVICE,
+ VC_CEC_SET_PASSIVE,
//Add more commands here
VC_CEC_END_OF_LIST
} VC_CEC_CMD_CODE_T;
@@ -111,4 +144,39 @@ typedef struct {
//Parameter: logical address (CEC_AllDevices_T sent as uint32_t)
//Reply: (uint32_t vendor id)
-#endif
+//POLL_LOGICAL_ADDR (only for passive mode)
+//Used by host to test a logical address to see if it is available for use
+//Only available if CEC is compiled in passive mode and while the host
+//is testing the availability of a logical address
+//Parameter: logical address
+//Reply:
+
+//SET_LOGICAL_ADDR [(only for passive mode) This will be changed when we support multiple logical addresses]
+//Set the logical address used
+//Only available if CEC is compiled in passive mode
+//Parameter: logical address, device type, vendor ID
+//Reply: (int32_t - zero means success, non-zero otherwise)
+//This function will result in a VC_CEC_LOGICAL_ADDR callback
+typedef struct {
+ uint32_t logical_address;
+ uint32_t device_type;
+ uint32_t vendor_id;
+} CEC_SET_LOGICAL_ADDR_PARAM_T;
+
+//ADD_DEVICE (only for passive mode)
+//Only available if CEC is compiled in passive mode
+//Parameter: logical address, physical address, device type, last device?
+//Reply: (int32_t - zero means success, non-zero otherwise)
+typedef struct {
+ uint32_t logical_address; /**<logical address */
+ uint32_t physical_address; /**<16-bit packed physical address in big endian */
+ uint32_t device_type; /**<CEC_DEVICE_TYPE_T */
+ uint32_t last_device; /**<True (non-zero) or false (zero) */
+} CEC_ADD_DEVICE_PARAM_T;
+
+//SET PASSIVE (only for passive mode)
+//Enable/disable passive mode
+//Parameter: non-zero to enable passive mode, zero to disable
+//Reply: (int32_t - zero means success, non-zero otherwise, non zero will be VCHI errors)
+
+#endif //#ifndef _VC_CECSERVICE_DEFS_H_
View
10 hardfp/opt/vc/include/interface/vmcs_host/vc_sdtv.h
@@ -25,14 +25,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// SDTV common host header for TV service
-
+/*
+ * SDTV common host header for TV service
+ */
+
#ifndef _VC_SDTV_H_
#define _VC_SDTV_H_
-//If this is defined, we can't use VEC. Make sure this file is not included
-#ifdef PLATFORM_NO_VEC
-#error "No VEC present for SDTV!"
-#endif
/** Different SDTV modes */
/** colour */
View
21 hardfp/opt/vc/include/interface/vmcs_host/vc_tvservice.h
@@ -25,10 +25,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TV service host API,
-// See vc_hdmi.h for HDMI related constants
-// See vc_sdtv.h for SDTV related constants
-
+/*
+ * TV service host API,
+ * See vc_hdmi.h for HDMI related constants
+ * See vc_sdtv.h for SDTV related constants
+ */
#ifndef _VC_TVSERVICE_H_
#define _VC_TVSERVICE_H_
@@ -38,9 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "interface/vchi/vchi.h"
#include "interface/vmcs_host/vc_tvservice_defs.h"
#include "interface/vmcs_host/vc_hdmi.h"
-#ifndef PLATFORM_NO_VEC
#include "interface/vmcs_host/vc_sdtv.h"
-#endif
/**
* \file
@@ -206,7 +205,6 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height
*/
VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit(HDMI_MODE_T mode, HDMI_RES_GROUP_T group, uint32_t code);
-#ifndef PLATFORM_NO_VEC
/**
* <DFN>vc_tv_sdtv_power_on</DFN> is used to turn on analogue TV. HDMI will
* automatically be powered off if on.
@@ -219,7 +217,6 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit(HDMI_MODE_T mode, HDMI_RES_GRO
*
*/
VCHPRE_ int VCHPOST_ vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options);
-#endif
/**
* <DFN>vc_tv_power_off</DFN> is used to turn off either analogue or HDMI output.
@@ -452,4 +449,12 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_ddc_read(uint32_t offset, uint32_t length, uint8
* @param attached non-zero if the TV is attached or zero for unplugged.
*/
VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_attached(uint32_t attached);
+
+/**
+ * Converts the notification reason to a string.
+ *
+ * @param reason is the notification reason
+ * @return The notification reason as a string.
+ */
+VCHPRE_ const char* vc_tv_notifcation_name(VC_HDMI_NOTIFY_T reason);
#endif
View
8 hardfp/opt/vc/include/interface/vmcs_host/vc_tvservice_defs.h
@@ -25,7 +25,9 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TV service command enumeration
+/*
+ * TV service command enumeration and parameter types.
+ */
#ifndef _VC_TVSERVICE_DEFS_H_
#define _VC_TVSERVICE_DEFS_H_
@@ -45,9 +47,7 @@ typedef enum {
VC_TV_HDMI_ON_PREFERRED,
VC_TV_HDMI_ON_BEST,
VC_TV_HDMI_ON_EXPLICIT,
- #ifndef PLATFORM_NO_VEC
VC_TV_SDTV_ON,
- #endif
VC_TV_OFF,
VC_TV_QUERY_SUPPORTED_MODES,
VC_TV_QUERY_MODE_SUPPORT,
@@ -123,15 +123,13 @@ typedef struct {
uint32_t mode;
} TV_HDMI_ON_EXPLICIT_PARAM_T;
-#ifndef PLATFORM_NO_VEC
//SDTV_ON
//Parameters: SDTV mode, aspect ratio
//Reply: Same as above
typedef struct {
uint32_t mode;
uint32_t aspect;
} TV_SDTV_ON_PARAM_T;
-#endif
//TV_OFF
//Parameters: none
View
BIN hardfp/opt/vc/lib/libEGL_static.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libGLESv2_static.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libbcm_host.so
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libkhrn_client.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libkhrn_static.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libvcfiled_check.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libvchostif.a
Binary file not shown.
View
BIN hardfp/opt/vc/lib/libvmcs_rpc_client.a
Binary file not shown.
View
BIN opt/vc/bin/edidparser
Binary file not shown.
View
BIN opt/vc/bin/tvservice
Binary file not shown.
View
24 opt/vc/include/interface/vmcs_host/vc_cec.h
@@ -25,10 +25,18 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC related constants - shared by both host and vc.
+/*
+ * CEC related constants - shared by both host and vc.
+ */
#ifndef _VC_CEC_H_
#define _VC_CEC_H_
+
+#ifndef STRINGIFY
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+#endif
+
//Broadcast address and TV logical address
#define CEC_BROADCAST_ADDR 0x0F
#define CEC_TV_ADDRESS 0x00
@@ -482,4 +490,18 @@ typedef void (*CEC_CALLBACK_T)(void *client_p, uint32_t reason, uint32_t param1,
#define CEC_CB_OPCODE(x) (((x) >> 8) & 0xFF) /** Get the opcode from first parameter */
#define CEC_CB_OPERAND1(x) (((x) >> 16) & 0xFF) /** Get the button code from <User Control Pressed> or the first operand of the opcode */
#define CEC_CB_OPERAND2(x) (((x) >> 24) & 0xFF) /** Get the second operand of opcode */
+
+//CEC service return code
+typedef enum {
+ VC_CEC_SUCCESS = 0, /** OK */
+ VC_CEC_ERROR_NO_ACK = 1, /** No acknowledgement */
+ VC_CEC_ERROR_SHUTDOWN = 2, /** In the process of shutting down */
+ VC_CEC_ERROR_BUSY = 3, /** block is busy */
+ VC_CEC_ERROR_NO_LA = 4, /** No logical address */
+ VC_CEC_ERROR_NO_PA = 5, /** No physical address */
+ VC_CEC_ERROR_NO_TOPO = 6, /** No topology */
+ VC_CEC_ERROR_INVALID_FOLLOWER = 7, /** Invalid follower */
+ VC_CEC_ERROR_INVALID_ARGUMENT = 8 /** Invalid arguments */
+} VC_CEC_ERROR_T;
+
#endif
View
81 opt/vc/include/interface/vmcs_host/vc_cecservice.h
@@ -25,9 +25,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC service host API,
-// See vc_cec.h and vc_cecservice_defs.h for related constants
-
+/*
+ * CEC service host API,
+ * See vc_cec.h and vc_cecservice_defs.h for related constants
+ */
#ifndef _VC_CECSERVICE_H_
#define _VC_CECSERVICE_H_
@@ -43,6 +44,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This API defines the controls for CEC. HDMI must be powered on before
* CEC is available (subject to CEC support in TV).
*
+ * In general, a zero return value indicates success; a negative return
+ * value indicates error in VCHI layer; a positive return value indicates
+ * alternative return value from the server
*/
/**
@@ -298,7 +302,8 @@ VCHPRE_ int VCHPOST_ vc_cec_get_vendor_id(const CEC_AllDevices_T logical_address
*
* @param logical address
*
- * @return the default device type
+ * @return the default device type, if there is any error, the return device
+ * type will be CEC_DeviceType_Invalid
*
************************************************************/
VCHPRE_ CEC_DEVICE_TYPE_T VCHPOST_ vc_cec_device_type(const CEC_AllDevices_T logical_address);
@@ -320,6 +325,74 @@ VCHPRE_ int VCHPOST_ vc_cec_param2message( const uint32_t reason, const uint32_t
const uint32_t param2, const uint32_t param3,
const uint32_t param4, VC_CEC_MESSAGE_T *message);
+//Extra API if CEC is running in passive mode
+//If CEC is not in passive mode the following 3 functions always
+//return failure
+/**
+ * <DFN> vc_cec_poll_address </DFN> sets and polls a particular address to find out
+ * its availability in the CEC network. Only available when CEC is running in passive
+ * mode. The host can only call this function during logical address allocation stage.
+ *
+ * @param logical address to try
+ *
+ * @return 0 if poll is successful (address is occupied)
+ * >0 if poll is unsuccessful (Error code is in VC_CEC_ERROR_T in vc_cec.h)
+ * <0 VCHI errors
+ */
+VCHPRE_ int VCHPOST_ vc_cec_poll_address(const CEC_AllDevices_T logical_address);
+
+/**
+ * <DFN> vc_cec_set_logical_address </DFN> sets the logical address, device type
+ * and vendor ID to be in use. Only available when CEC is running in passive
+ * mode. It is the responsibility of the host to make sure the logical address
+ * is actually free to be used. Physical address will be what is read from EDID.
+ *
+ * @param logical address
+ *
+ * @param device type
+ *
+ * @param vendor ID
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_set_logical_address(const CEC_AllDevices_T logical_address,
+ const CEC_DEVICE_TYPE_T device_type,
+ const uint32_t vendor_id);
+
+/**
+ * <DFN> vc_cec_add_device </DFN> adds a new device to topology.
+ * Only available when CEC is running in passive mode. Device will be
+ * automatically removed from topology if a failed xmit is detected.
+ * If last_device is true, it will trigger a topology computation
+ * (and may trigger a topology callback).
+ *
+ * @param logical address
+ *
+ * @param physical address
+ *
+ * @param device type
+ *
+ * @param true if this is the last device, false otherwise
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_add_device(const CEC_AllDevices_T logical_address,
+ const uint16_t physical_address,
+ const CEC_DEVICE_TYPE_T device_type,
+ bool_t last_device);
+
+/**
+ * <DFN> vc_cec_set_passive </DFN> enables and disables passive mode.
+ * Call this function first (with VC_TRUE as the argument) to enable
+ * passive mode before calling any of the above passive API functions
+ *
+ * @param TRUE to enable passive mode, FALSE to disable
+ *
+ * @return 0 if successful, non-zero otherwise
+ */
+VCHPRE_ int VCHPOST_ vc_cec_set_passive(bool_t enabled);
+
+
//API for some common CEC messages
/**
* Functions beginning with vc_cec_send_xxx make it easier for the
View
72 opt/vc/include/interface/vmcs_host/vc_cecservice_defs.h
@@ -25,13 +25,38 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// CEC service command enumeration.
+/*
+ * CEC service command enumeration and parameter types.
+ */
+
+/**
+ * \file
+ * This file contains definition shared by host side and
+ * Videocore side CEC service:
+ *
+ * In general, a zero return value indicates success of the function
+ * A non-zero value indicates VCHI error
+ * A positive value indicates alternative return value (for some functions).
+ *
+ */
+
#ifndef _VC_CECSERVICE_DEFS_H_
#define _VC_CECSERVICE_DEFS_H_
#include "vcinclude/common.h"
+#include "interface/vcos/vcos.h"
+#include "interface/vcos/vcos_logging.h"
#include "interface/vchi/message_drivers/message.h"
+//CEC VCOS logging stuff
+#define CECHOST_LOG_CATEGORY (&cechost_log_category)
+#define vc_cec_log_trace(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_TRACE, __VA_ARGS__)
+#define vc_cec_log_warn(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_WARN, __VA_ARGS__)
+#define vc_cec_log_error(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_ERROR, __VA_ARGS__)
+#define vc_cec_log_info(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__)
+extern VCOS_LOG_CAT_T cechost_log_category; //The actual object lives in CEC host side service code
+
+#define VC_CECSERVICE_VER 1
#define CECSERVICE_MSGFIFO_SIZE 1024
#define CECSERVICE_CLIENT_NAME MAKE_FOURCC("CECS")
#define CECSERVICE_NOTIFY_NAME MAKE_FOURCC("CECN")
@@ -51,6 +76,14 @@ typedef enum {
VC_CEC_SET_OSD_NAME,
VC_CEC_GET_PHYSICAL_ADDR,
VC_CEC_GET_VENDOR_ID,
+
+ //The following 3 commands are used when CEC middleware is
+ //running in passive mode (i.e. it does not allocate
+ //logical address automatically)
+ VC_CEC_POLL_ADDR,
+ VC_CEC_SET_LOGICAL_ADDR,
+ VC_CEC_ADD_DEVICE,
+ VC_CEC_SET_PASSIVE,
//Add more commands here
VC_CEC_END_OF_LIST
} VC_CEC_CMD_CODE_T;
@@ -111,4 +144,39 @@ typedef struct {
//Parameter: logical address (CEC_AllDevices_T sent as uint32_t)
//Reply: (uint32_t vendor id)
-#endif
+//POLL_LOGICAL_ADDR (only for passive mode)
+//Used by host to test a logical address to see if it is available for use
+//Only available if CEC is compiled in passive mode and while the host
+//is testing the availability of a logical address
+//Parameter: logical address
+//Reply:
+
+//SET_LOGICAL_ADDR [(only for passive mode) This will be changed when we support multiple logical addresses]
+//Set the logical address used
+//Only available if CEC is compiled in passive mode
+//Parameter: logical address, device type, vendor ID
+//Reply: (int32_t - zero means success, non-zero otherwise)
+//This function will result in a VC_CEC_LOGICAL_ADDR callback
+typedef struct {
+ uint32_t logical_address;
+ uint32_t device_type;
+ uint32_t vendor_id;
+} CEC_SET_LOGICAL_ADDR_PARAM_T;
+
+//ADD_DEVICE (only for passive mode)
+//Only available if CEC is compiled in passive mode
+//Parameter: logical address, physical address, device type, last device?
+//Reply: (int32_t - zero means success, non-zero otherwise)
+typedef struct {
+ uint32_t logical_address; /**<logical address */
+ uint32_t physical_address; /**<16-bit packed physical address in big endian */
+ uint32_t device_type; /**<CEC_DEVICE_TYPE_T */
+ uint32_t last_device; /**<True (non-zero) or false (zero) */
+} CEC_ADD_DEVICE_PARAM_T;
+
+//SET PASSIVE (only for passive mode)
+//Enable/disable passive mode
+//Parameter: non-zero to enable passive mode, zero to disable
+//Reply: (int32_t - zero means success, non-zero otherwise, non zero will be VCHI errors)
+
+#endif //#ifndef _VC_CECSERVICE_DEFS_H_
View
10 opt/vc/include/interface/vmcs_host/vc_sdtv.h
@@ -25,14 +25,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// SDTV common host header for TV service
-
+/*
+ * SDTV common host header for TV service
+ */
+
#ifndef _VC_SDTV_H_
#define _VC_SDTV_H_
-//If this is defined, we can't use VEC. Make sure this file is not included
-#ifdef PLATFORM_NO_VEC
-#error "No VEC present for SDTV!"
-#endif
/** Different SDTV modes */
/** colour */
View
21 opt/vc/include/interface/vmcs_host/vc_tvservice.h
@@ -25,10 +25,11 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TV service host API,
-// See vc_hdmi.h for HDMI related constants
-// See vc_sdtv.h for SDTV related constants
-
+/*
+ * TV service host API,
+ * See vc_hdmi.h for HDMI related constants
+ * See vc_sdtv.h for SDTV related constants
+ */
#ifndef _VC_TVSERVICE_H_
#define _VC_TVSERVICE_H_
@@ -38,9 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "interface/vchi/vchi.h"
#include "interface/vmcs_host/vc_tvservice_defs.h"
#include "interface/vmcs_host/vc_hdmi.h"
-#ifndef PLATFORM_NO_VEC
#include "interface/vmcs_host/vc_sdtv.h"
-#endif
/**
* \file
@@ -206,7 +205,6 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height
*/
VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit(HDMI_MODE_T mode, HDMI_RES_GROUP_T group, uint32_t code);
-#ifndef PLATFORM_NO_VEC
/**
* <DFN>vc_tv_sdtv_power_on</DFN> is used to turn on analogue TV. HDMI will
* automatically be powered off if on.
@@ -219,7 +217,6 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit(HDMI_MODE_T mode, HDMI_RES_GRO
*
*/
VCHPRE_ int VCHPOST_ vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options);
-#endif
/**
* <DFN>vc_tv_power_off</DFN> is used to turn off either analogue or HDMI output.
@@ -452,4 +449,12 @@ VCHPRE_ int VCHPOST_ vc_tv_hdmi_ddc_read(uint32_t offset, uint32_t length, uint8
* @param attached non-zero if the TV is attached or zero for unplugged.
*/
VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_attached(uint32_t attached);
+
+/**
+ * Converts the notification reason to a string.
+ *
+ * @param reason is the notification reason
+ * @return The notification reason as a string.
+ */
+VCHPRE_ const char* vc_tv_notifcation_name(VC_HDMI_NOTIFY_T reason);
#endif
View
8 opt/vc/include/interface/vmcs_host/vc_tvservice_defs.h
@@ -25,7 +25,9 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TV service command enumeration
+/*
+ * TV service command enumeration and parameter types.
+ */
#ifndef _VC_TVSERVICE_DEFS_H_
#define _VC_TVSERVICE_DEFS_H_
@@ -45,9 +47,7 @@ typedef enum {
VC_TV_HDMI_ON_PREFERRED,
VC_TV_HDMI_ON_BEST,
VC_TV_HDMI_ON_EXPLICIT,
- #ifndef PLATFORM_NO_VEC
VC_TV_SDTV_ON,
- #endif
VC_TV_OFF,
VC_TV_QUERY_SUPPORTED_MODES,
VC_TV_QUERY_MODE_SUPPORT,
@@ -123,15 +123,13 @@ typedef struct {
uint32_t mode;
} TV_HDMI_ON_EXPLICIT_PARAM_T;
-#ifndef PLATFORM_NO_VEC
//SDTV_ON
//Parameters: SDTV mode, aspect ratio
//Reply: Same as above
typedef struct {
uint32_t mode;
uint32_t aspect;
} TV_SDTV_ON_PARAM_T;
-#endif
//TV_OFF
//Parameters: none
View
BIN opt/vc/lib/libEGL_static.a
Binary file not shown.
View
BIN opt/vc/lib/libGLESv2_static.a
Binary file not shown.
View
BIN opt/vc/lib/libbcm_host.so
Binary file not shown.
View
BIN opt/vc/lib/libkhrn_client.a
Binary file not shown.
View
BIN opt/vc/lib/libkhrn_static.a
Binary file not shown.
View
BIN opt/vc/lib/libvcfiled_check.a
Binary file not shown.
View
BIN opt/vc/lib/libvchostif.a
Binary file not shown.
View
BIN opt/vc/lib/libvmcs_rpc_client.a
Binary file not shown.

0 comments on commit d535b28

Please sign in to comment.