Device Settings HAL 0.2.0
 
Loading...
Searching...
No Matches
dsDisplay.h
Go to the documentation of this file.
1/*
2 * If not stated otherwise in this file or this component's LICENSE file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2016 RDK Management
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18*/
19
20/**
21 * @file dsDisplay.h
22 *
23 * @par Document
24 * Document reference.
25 *
26 * @par Open Issues (in no particular order)
27 * -# None
28 *
29 * @par Assumptions
30 * -# None
31 *
32 * @par Abbreviations
33 * - cb: Callback function (suffix).
34 * - DS: Device Settings.
35 * - HAL: Hardware Abstraction Layer.
36 * - EDID: Extended Display Identification Data.
37 * - HDMI: High-Definition Multimedia Interface
38 * - DVI: Digital Visual Interface
39 * - EDID: Extended Display Identification Data
40 * - HDCP: High-bandwidth Digital Content Protection
41 * - SoC: System on chip
42 *
43 * @par Implementation Notes
44 * -# None
45 *
46 */
47
48/**
49 * @addtogroup HPK Hardware Porting Kit
50 * @{
51 * @par The Hardware Porting Kit
52 * HPK is the next evolution of the well-defined Hardware Abstraction Layer
53 * (HAL), but augmented with more comprehensive documentation and test suites
54 * that OEM or SOC vendors can use to self-certify their ports before taking
55 * them to RDKM for validation or to an operator for final integration and
56 * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC
57 * vendor to self-certify their own Video Accelerator devices, with minimal RDKM
58 * assistance.
59 *
60 */
61
62/** @addtogroup Device_Settings Device Settings Module
63 * @{
64 */
65
66/**@addtogroup Device_Settings_HAL Device Settings HAL
67 * @par Application API Specification
68 * Described herein are the DeviceSettings HAL types and functions that are part of
69 * the Display subsystem. The Display subsystem manages display-specific HAL operations.
70 * @{
71 */
72
73/** @defgroup dsDisplay_HAL DS Display HAL
74 * @{
75 * @par Application API Specification
76 * dsDisplay HAL provides an interface for managing the display related settings of device settings module
77 */
78
79/** @defgroup DSHAL_DISPLAY_API DS Display HAL Public APIs
80 *
81 * @{
82 */
83
84#ifndef _DS_VIDEODISPLAY_H_
85#define _DS_VIDEODISPLAY_H_
86
87#include "dsError.h"
88#include "dsTypes.h"
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
94 /**
95 * @enum _dsDisplayEvent_t
96 * @brief This enumeration defines standard display event types.
97 * @note Appropriate events can be added based on requirement.
98 */
99typedef enum _dsDisplayEvent_t {
100 dsDISPLAY_EVENT_CONNECTED = 0, ///< Display connected event
101 dsDISPLAY_EVENT_DISCONNECTED, ///< Display disconnected event
102 dsDISPLAY_RXSENSE_ON, ///< Rx Sense ON event
103 dsDISPLAY_RXSENSE_OFF, ///< Rx Sense OFF event
104 dsDISPLAY_HDCPPROTOCOL_CHANGE, ///< HDCP Protocol Version Change event
105 dsDISPLAY_EVENT_MAX ///< Display max event
107
108/**
109 * @brief Callback function used to notify display related events to the caller.
110 *
111 * This callback is triggered whenever there is a display related change and it is notified to the caller.
112 *
113 * @param[in] handle - Handle of the display device
114 * @param[in] event - Display event. Please refer ::dsDisplayEvent_t
115 * @param[in] eventData - Data associated with the event(optional parameter)
116 * eventData contains additional information such as HPD status when a display is connected/disconnected
117 *
118 * @return None
119 *
120 * @pre dsRegisterDisplayEventCallback()
121 */
122typedef void (*dsDisplayEventCallback_t)(intptr_t handle, dsDisplayEvent_t event,
123 void* eventData/*Optional*/);
124
125/**
126 * @brief Initializes the DS Display sub-system.
127 *
128 * This function initializes all required resources for Display sub-system and
129 * is required to be called before the other APIs in this module. Also this function
130 * needs to initialize all the required device handles for the different display ports and
131 * the number of connected devices for each display port.
132 *
133 * @return dsError_t - Status
134 * @retval dsERR_NONE - Success
135 * @retval dsERR_GENERAL - Underlying undefined platform error
136 *
137 * @warning This API is Not thread safe
138 *
139 * @see dsDisplayTerm()
140 *
141 */
143
144/**
145 * @brief Gets the handle of connected display device.
146 *
147 * This function is used to get the handle(as created in dsDisplayInit()) for the connected display device
148 * corresponding to the specified video port.
149 *
150 * @param[in] vType - Type of video port. Please refer ::dsVideoPortType_t
151 * @param[in] index - Index of the video port. (Index of the port must be 0 if not specified)
152 * Max index is platform specific. Min value is 0.
153 * @param[out] handle - Pointer to hold the handle of display device corresponding
154 * to specified video port
155 *
156 * @return dsError_t - Status
157 * @retval dsERR_NONE - Success
158 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
159 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
160 * @retval dsERR_GENERAL - Underlying undefined platform error
161 *
162 * @pre dsDisplayInit() must be called before calling this API
163 *
164 * @warning This API is Not thread safe
165 *
166 */
167
168 dsError_t dsGetDisplay(dsVideoPortType_t vType, int index, intptr_t *handle);
169
170/**
171 * @brief Gets the EDID information from the specified display device.
172 *
173 * This function gets the EDID information from the HDMI/DVI display corresponding to
174 * the specified display device handle.
175 *
176 * @param[in] handle - Handle of the display device
177 * @param[out] edid - EDID info of the specified display device. Please refer ::dsDisplayEDID_t
178 *
179 * @return dsError_t - Status
180 * @retval dsERR_NONE - Success
181 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
182 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
183 * @retval dsERR_GENERAL - Underlying undefined platform error
184 *
185 * @pre dsDisplayInit() and dsGetDisplay() must be called before calling this API
186 *
187 * @warning This API is Not thread safe
188 *
189 */
190
191dsError_t dsGetEDID(intptr_t handle, dsDisplayEDID_t *edid);
192
193/**
194 * @brief Gets the EDID buffer and EDID length of connected display device.
195 *
196 * This function is used to get the EDID buffer and EDID size of the connected display corresponding to
197 * the specified display device handle.
198 *
199 * @param[in] handle - Handle of the display device
200 * @param[out] edid - Pointer to raw EDID buffer
201 * @param[out] length - length of the EDID buffer data. Min value is 0
202 *
203 * @note Caller is responsible for allocating memory for edid( please refer ::MAX_EDID_BYTES_LEN ) and freeing the EDID buffer
204 *
205 * @return dsError_t - Status
206 * @retval dsERR_NONE - Success
207 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
208 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
209 * @retval dsERR_GENERAL - Underlying undefined platform error
210 *
211 * @pre dsDisplayInit() and dsGetDisplay() must be called before calling this API
212 *
213 * @warning This API is Not thread safe
214 *
215 */
216
217dsError_t dsGetEDIDBytes(intptr_t handle, unsigned char **edid, int *length);
218
219/**
220 * @brief Gets the aspect ratio of connected display device.
221 *
222 * This function returns the aspect ratio of the display corresponding to the
223 * specified display device handle.
224 *
225 * @param[in] handle - Handle of the display device
226 * @param[out] aspectRatio - Current aspect ratio of the specified display device
227 * Please refer ::dsVideoAspectRatio_t
228 *
229 * @return dsError_t - Status
230 * @retval dsERR_NONE - Success
231 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
232 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
233 * @retval dsERR_GENERAL - Underlying undefined platform error
234 *
235 * @pre dsDisplayInit() and dsGetDisplay() must be called before calling this API
236 *
237 * @warning This API is Not thread safe
238 *
239 */
240
242
243/**
244 * @brief Terminates the display sub-system.
245 *
246 * This function resets any data structures used within Display sub-system,
247 * and releases all the resources allocated during the init function.
248 *
249 * @return dsError_t - Status
250 * @retval dsERR_NONE - Success
251 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
252 * @retval dsERR_GENERAL - Underlying undefined platform error
253 *
254 * @pre dsDisplayInit() must be called before calling this API
255 *
256 * @warning This API is Not thread safe
257 *
258 * @see dsDisplayInit()
259 *
260 */
262
263/**
264 * @brief Callback registration for display related events.
265 *
266 * This function registers a callback for display events corresponding to
267 * the specified display device handle.
268 *
269 * @note Caller should install at most one callback function per handle.
270 * Multiple listeners are supported at Caller layer and thus not
271 * required in HAL implementation.
272 *
273 * @param[in] handle - Handle of the display device
274 * @param[in] cb - Display Event callback function. Please refer ::dsDisplayEventCallback_t
275 *
276 * @return dsError_t - Status
277 * @retval dsERR_NONE - Success
278 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
279 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
280 * @retval dsERR_GENERAL - Underlying undefined platform error
281 *
282 * @pre dsDisplayInit() and dsGetDisplay() must be called before calling this API
283 *
284 * @warning This API is Not thread safe
285 *
286 * @see dsDisplayEventCallback_t()
287 *
288 */
290
291#ifdef __cplusplus
292}
293#endif
294#endif /* _DS_VIDEODISPLAY_H_ */
295
296/** @} */ // End of DSHAL DISPLAY API
297/** @} */ // End of DS Display HAL
298/** @} */ // End of Device Settings HAL
299/** @} */ // End of Device Settings Module
300/** @} */ // End of HPK
Device Settings HAL error codes.
HAL types.
dsError_t dsGetEDIDBytes(intptr_t handle, unsigned char **edid, int *length)
Gets the EDID buffer and EDID length of connected display device.
dsError_t dsRegisterDisplayEventCallback(intptr_t handle, dsDisplayEventCallback_t cb)
Callback registration for display related events.
dsError_t dsGetDisplay(dsVideoPortType_t vType, int index, intptr_t *handle)
Gets the handle of connected display device.
dsError_t dsDisplayTerm()
Terminates the display sub-system.
_dsDisplayEvent_t
This enumeration defines standard display event types.
Definition dsDisplay.h:99
dsError_t dsGetEDID(intptr_t handle, dsDisplayEDID_t *edid)
Gets the EDID information from the specified display device.
void(* dsDisplayEventCallback_t)(intptr_t handle, dsDisplayEvent_t event, void *eventData)
Callback function used to notify display related events to the caller.
Definition dsDisplay.h:122
dsError_t dsDisplayInit()
Initializes the DS Display sub-system.
enum _dsDisplayEvent_t dsDisplayEvent_t
dsError_t dsGetDisplayAspectRatio(intptr_t handle, dsVideoAspectRatio_t *aspectRatio)
Gets the aspect ratio of connected display device.
@ dsDISPLAY_RXSENSE_ON
Rx Sense ON event.
Definition dsDisplay.h:102
@ dsDISPLAY_EVENT_CONNECTED
Display connected event
Definition dsDisplay.h:100
@ dsDISPLAY_EVENT_DISCONNECTED
Display disconnected event
Definition dsDisplay.h:101
@ dsDISPLAY_HDCPPROTOCOL_CHANGE
HDCP Protocol Version Change event.
Definition dsDisplay.h:104
@ dsDISPLAY_EVENT_MAX
Display max event.
Definition dsDisplay.h:105
@ dsDISPLAY_RXSENSE_OFF
Rx Sense OFF event.
Definition dsDisplay.h:103
dsError_t
Device Settings API Error return codes.
Definition dsError.h:100
enum _dsVideoAspectRatio_t dsVideoAspectRatio_t
This enumeration defines all of the standard video aspect ratios.
enum _dsVideoPortType_t dsVideoPortType_t
This enumeration defines all of the standard type of Video ports.
Structure for the EDID display.
Definition dsTypes.h:844