RDK Documentation (Open Sourced RDK Components)
dsMgr.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt 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 
22 /**
23 * @defgroup iarmmgrs
24 * @{
25 * @defgroup dsmgr
26 * @{
27 **/
28 
29 
30 #include <stdio.h>
31 #include <string.h>
32 #include <unistd.h>
33 #include <fcntl.h>
34 #include <string.h>
35 #include <stdlib.h>
36 #include <time.h>
37 #include <pthread.h>
38 #include <sys/types.h>
39 #include <sys/stat.h>
40 
41 
42 #include "libIARM.h"
43 #include "libIBusDaemon.h"
44 #include "dsMgrInternal.h"
45 #include "libIBus.h"
46 #include "iarmUtil.h"
47 
48 #include "sysMgr.h"
49 
50 #include "dsMgr.h"
51 #include "dsUtl.h"
52 #include "dsError.h"
53 #include "dsTypes.h"
54 #include "dsRpc.h"
55 #include "dsVideoPort.h"
56 #include "dsVideoResolutionSettings.h"
57 #include "dsDisplay.h"
58 #include "dsAudioSettings.h"
59 #include "dsAudio.h"
60 #include "safec_lib.h"
61 #include "rfcapi.h"
62 #include "dsMgrPwrEventListener.h"
63 
64 extern IARM_Result_t _dsSetResolution(void *arg);
65 extern IARM_Result_t _dsGetResolution(void *arg);
66 extern IARM_Result_t _dsInitResolution(void *arg);
67 extern IARM_Result_t _dsGetAudioPort(void *arg);
68 extern IARM_Result_t _dsGetStereoMode(void *arg);
69 extern IARM_Result_t _dsSetStereoMode(void *arg);
70 extern IARM_Result_t _dsGetEDID(void *arg);
71 extern IARM_Result_t _dsGetEDIDBytes(void *arg);
72 extern IARM_Result_t _dsGetVideoPort(void *arg);
73 extern IARM_Result_t _dsIsDisplayConnected(void *arg);
74 extern IARM_Result_t _dsGetStereoAuto(void *arg);
75 extern IARM_Result_t _dsIsDisplaySurround(void *arg);
76 extern IARM_Result_t _dsGetForceDisable4K(void *arg);
77 extern IARM_Result_t _dsSetBackgroundColor(void *arg);
78 extern IARM_Result_t _dsGetIgnoreEDIDStatus(void *arg);
79 extern bool isComponentPortPresent();
80 
81 extern bool dsGetHDMIDDCLineStatus(void);
82 static int _SetVideoPortResolution();
83 static int _SetResolution(intptr_t* handle,dsVideoPortType_t PortType);
84 static void _EventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
85 static IARM_Result_t _SysModeChange(void *arg);
86 static void dumpHdmiEdidInfo(dsDisplayEDID_t* pedidData);
87 static int iTuneReady = 0;
88 static dsDisplayEvent_t edisplayEventStatus = dsDISPLAY_EVENT_MAX;
89 static pthread_t edsHDMIHPDThreadID; // HDMI HPD - HDMI Hot Plug detect events
90 static pthread_mutex_t tdsMutexLock;
91 static pthread_cond_t tdsMutexCond;
92 static void* _DSMgrResnThreadFunc(void *arg);
93 static void _setAudioMode();
94 void _setEASAudioMode();
95 static int iResnCount = 5;
96 static int iInitResnFlag = 0;
97 static bool bHDCPAuthenticated = false;
98 static bool bPwrMgeRFCEnabled = false;
99 IARM_Bus_Daemon_SysMode_t isEAS = IARM_BUS_SYS_MODE_NORMAL; // Default is Normal Mode
100 
101 #define RFC_PWRMGR2 "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Power.PwrMgr2.Enable"
102 
103 /*DSMgr Glib variables */
104 /* For glib APIs*/
105 #include <glib.h>
106 GMainLoop *dsMgr_Gloop = NULL;
107 static gboolean heartbeatMsg(gpointer data);
108 static gboolean _SetResolutionHandler(gpointer data);
109 static guint hotplug_event_src = 0;
110 static gboolean dumpEdidOnChecksumDiff(gpointer data);
111 static bool IsIgnoreEdid_gs = false;
112 
113 static intptr_t getVideoPortHandle(_dsVideoPortType_t port)
114 {
115  /* Get the HDMI Video Port Parameter */
116  dsVideoPortGetHandleParam_t vidPortParam;
117  memset(&vidPortParam, 0, sizeof(vidPortParam));
118  vidPortParam.type = port;
119  vidPortParam.index = 0;
120  _dsGetVideoPort(&vidPortParam);
121  return vidPortParam.handle;
122 }
123 
124 static bool isHDMIConnected()
125 {
126  /* Get the Display connection status */
128  memset(&ConParam, 0, sizeof(ConParam));
129  ConParam.handle = getVideoPortHandle(dsVIDEOPORT_TYPE_HDMI);
130  _dsIsDisplayConnected(&ConParam);
131  return ConParam.connected;
132 }
133 
134 IARM_Result_t DSMgr_Start()
135 {
136  FILE *fDSCtrptr = NULL;
138 
139 
140  setvbuf(stdout, NULL, _IOLBF, 0);
141  INT_INFO("Entering [%s] - [%s] - disabling io redirect buf \r\n", __FUNCTION__, IARM_BUS_DSMGR_NAME);
142 
143  /* Register with IARM Libs and Connect */
144  IARM_Bus_Init(IARM_BUS_DSMGR_NAME);
147 
148  /*Initialize the DS Manager - DS Srv and DS HAL */
149  dsMgr_init();
150 
151  iInitResnFlag = 1;
152  dsEdidIgnoreParam_t ignoreEdidParam;
153  memset(&ignoreEdidParam,0,sizeof(ignoreEdidParam));
154  ignoreEdidParam.handle = dsVIDEOPORT_TYPE_HDMI;
155  _dsGetIgnoreEDIDStatus(&ignoreEdidParam);
156  IsIgnoreEdid_gs = ignoreEdidParam.ignoreEDID;
157  __TIMESTAMP();printf("ResOverride DSMgr_Start IsIgnoreEdid_gs: %d\n", IsIgnoreEdid_gs);
158  /*Register the Events */
159  IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME,IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE,_EventHandler);
160  IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG,_EventHandler);
161  IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDCP_STATUS,_EventHandler);
162 
163  /*Register EAS handler so that we can ensure audio settings for EAS */
164  IARM_Bus_RegisterCall(IARM_BUS_COMMON_API_SysModeChange, _SysModeChange);
165 
166  RFC_ParamData_t rfcParam;
167  WDMP_STATUS status = getRFCParameter("dsMgr", RFC_PWRMGR2, &rfcParam);
168  if(strncmp(rfcParam.value, "true",4) == 0)
169  {
170  bPwrMgeRFCEnabled= true;
171  __TIMESTAMP(); printf("dsMgr:RFC PwrMgr2 feature enabled \r\n");
172  }
173 
174  if(bPwrMgeRFCEnabled)
175  {
176  /*Refactored dsMGR code*/
177  initPwrEventListner();
178  }
179  /* Create Thread for listening Hot Plug events */
180  pthread_mutex_init (&tdsMutexLock, NULL);
181  pthread_cond_init (&tdsMutexCond, NULL);
182  pthread_create (&edsHDMIHPDThreadID, NULL, _DSMgrResnThreadFunc, NULL);
183 
184  /* Read the HDMI DDC Line delay to be introduced
185  * for setting the resolution
186  * The DDC line is used for EDID and HDCP Negotiation
187  */
188  fDSCtrptr = fopen("/opt/ddcDelay","r");
189  if (NULL != fDSCtrptr)
190  {
191  if(0 > fscanf(fDSCtrptr,"%d",&iResnCount))
192  {
193  INT_INFO("Error: fscanf on ddcDelay failed");
194  }
195  fclose (fDSCtrptr);
196  }
197  __TIMESTAMP(); printf("Retry DS manager Resolution count is iResnCount = %d \r\n",iResnCount);
198 
199 
200  IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, &tuneReadyParam, sizeof(tuneReadyParam));
201  __TIMESTAMP(); printf("Tune Ready Status on start up is %d \r\n",tuneReadyParam.TuneReadyStatus.state);
202 
203  /* Read the Tune Ready status on startup and update the tune ready flag */
204  if(1 == tuneReadyParam.TuneReadyStatus.state)
205  {
206  iTuneReady = 1;
207  }
208 
209  /* Create Main loop for DS Manager */
210  dsMgr_Gloop = g_main_loop_new ( NULL , FALSE );
211  if(dsMgr_Gloop != NULL){
212  g_timeout_add_seconds (300 , heartbeatMsg , dsMgr_Gloop);
213  }
214  else {
215  INT_INFO("Fails to Create a main Loop for [%s] \r\n",IARM_BUS_DSMGR_NAME);
216  }
217 
218  if(!isHDMIConnected())
219  {
220  __TIMESTAMP();printf("HDMI not connected at bootup -Schedule a handler to set the resolution .. \r\n");
221  _SetVideoPortResolution();
222  }
223  return IARM_RESULT_SUCCESS;
224 }
225 
226 IARM_Result_t DSMgr_Loop()
227 {
228 
229  /* DS Mgr loop */
230  if(dsMgr_Gloop)
231  {
232  g_main_loop_run (dsMgr_Gloop);
233  g_main_loop_unref(dsMgr_Gloop);
234  }
235  return IARM_RESULT_SUCCESS;
236 }
237 
238 static gboolean heartbeatMsg(gpointer data)
239 {
240  time_t curr = 0;
241  time(&curr);
242  INT_INFO("I-ARM BUS DS Mgr: HeartBeat at %s\r\n", ctime(&curr));
243  return TRUE;
244 }
245 
246 IARM_Result_t DSMgr_Stop()
247 {
248 
249  if(dsMgr_Gloop)
250  {
251  g_main_loop_quit(dsMgr_Gloop);
252  }
253 
255  IARM_Bus_Term();
256  pthread_mutex_destroy (&tdsMutexLock);
257  pthread_cond_destroy (&tdsMutexCond);
258 
259  return IARM_RESULT_SUCCESS;
260 }
261 
262 /**
263  * @fn static IARM_Result_t _SysModeChange(void *arg){
264  * @brief This function is a event handler which returns current system
265  * mode using IARM. It returns mode as "NORMAL", "WAREHOUSE","EAS" or "UNKNOWN".
266  *
267  * @param[in] void pointer to void, containing IARM_Bus_CommonAPI_SysModeChange_Param_t data.
268  *
269  * @return variable of IARM_Result_t type.
270  * @retval IARM_RESULT_SUCCESS On function completion.
271  */
272 static IARM_Result_t _SysModeChange(void *arg)
273 {
274  IARM_Bus_CommonAPI_SysModeChange_Param_t *param = (IARM_Bus_CommonAPI_SysModeChange_Param_t *)arg;
275  IARM_Bus_Daemon_SysMode_t isNextEAS = IARM_BUS_SYS_MODE_NORMAL;
276 
277  __TIMESTAMP();printf("[DSMgr] Recvd Sysmode Change::New mode --> %d,Old mode --> %d",param->newMode,param->oldMode);
278 
279  if ((param->newMode == IARM_BUS_SYS_MODE_EAS) ||
280  (param->newMode == IARM_BUS_SYS_MODE_NORMAL))
281  {
282  isNextEAS = param->newMode;
283  }
284  else
285  {
286  /* Do not process any other mode change as of now for DS Manager.. */
287  return IARM_RESULT_SUCCESS;
288  }
289 
290  if ((isEAS == IARM_BUS_SYS_MODE_EAS) && (isNextEAS == IARM_BUS_SYS_MODE_NORMAL) ) {
291  isEAS = IARM_BUS_SYS_MODE_NORMAL;
292  _setAudioMode();
293  }
294  else if ((isEAS == IARM_BUS_SYS_MODE_NORMAL) && (isNextEAS == IARM_BUS_SYS_MODE_EAS) ) {
295  /*
296  * Change the Audio Mode to Stereo if Current Audio Setting is Paasthrough
297  */
298  isEAS = IARM_BUS_SYS_MODE_EAS;
299  _setEASAudioMode();
300 
301  }
302  else {
303  /* no op for no mode change */
304  }
305  return IARM_RESULT_SUCCESS;
306 }
307 
308 static void setBGColor(dsVideoBackgroundColor_t color)
309 {
310  /* Get the HDMI Video Port Parameter */
311  dsVideoPortGetHandleParam_t vidPortParam;
312  memset(&vidPortParam, 0, sizeof(vidPortParam));
313  vidPortParam.type = dsVIDEOPORT_TYPE_HDMI;
314  vidPortParam.index = 0;
315  _dsGetVideoPort(&vidPortParam);
316  vidPortParam.handle;
317 
318  if(vidPortParam.handle != NULL)
319  {
320  dsSetBackgroundColorParam_t setBGColorParam;
321  memset(&setBGColorParam, 0, sizeof(setBGColorParam));
322  setBGColorParam.color = color;
323  setBGColorParam.handle= vidPortParam.handle;
324  _dsSetBackgroundColor(&setBGColorParam);
325  }
326 }
327 
328 
329 /*Event Handler for DS Manager And Sys Manager Events */
330 static void _EventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
331 {
332  /*Handle only Sys Manager Events */
333  if (strcmp(owner, IARM_BUS_SYSMGR_NAME) == 0)
334  {
335  /* Only handle state events */
336  if (eventId != IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE) return;
337  // __TIMESTAMP();printf("_sysMgrEventHandler invoked in DS Manager\r\n");
339  IARM_Bus_SYSMgr_SystemState_t stateId = sysEventData->data.systemStates.stateId;
340  int state = sysEventData->data.systemStates.state;
341  __TIMESTAMP();printf("_sysEventHandler invoked for stateid %d of state %d \r\n", stateId, state);
342  switch(stateId) {
343  case IARM_BUS_SYSMGR_SYSSTATE_TUNEREADY:
344  __TIMESTAMP();printf("Tune Ready Evenets in DS Manager \r\n");
345 
346  if (0 == iTuneReady)
347  {
348  iTuneReady = 1;
349 
350  /* Set audio mode from persistent */
351  _setAudioMode();
352 
353  /* Un-block the Resolution Settings Thread */
354  pthread_mutex_lock(&tdsMutexLock);
355  pthread_cond_signal(&tdsMutexCond);
356  pthread_mutex_unlock(&tdsMutexLock);
357  }
358  break;
359  default:
360  break;
361  }
362  }else if (strcmp(owner,IARM_BUS_DSMGR_NAME) == 0)
363  {
364  switch (eventId) {
366  {
367 
369 
370  __TIMESTAMP();printf("[DsMgr] Got HDMI %s Event \r\n",(eventData->data.hdmi_hpd.event == dsDISPLAY_EVENT_CONNECTED ? "Connect" : "Disconnect"));
371 
372  setBGColor(dsVIDEO_BGCOLOR_NONE);
373 
374  /* Un-Block the Resolution Settings Thread */
375  pthread_mutex_lock(&tdsMutexLock);
376  edisplayEventStatus = ((eventData->data.hdmi_hpd.event == dsDISPLAY_EVENT_CONNECTED) ? dsDISPLAY_EVENT_CONNECTED : dsDISPLAY_EVENT_DISCONNECTED);
377  pthread_cond_signal(&tdsMutexCond);
378  pthread_mutex_unlock(&tdsMutexLock);
379 
380  }
381  break;
383  {
385  IARM_Bus_SYSMgr_EventData_t HDCPeventData;
386  int status = eventData->data.hdmi_hdcp.hdcpStatus;
387  //__TIMESTAMP();printf("%s: IARM_BUS_DSMGR_EVENT_HDCP_STATUS event status :%d \r\n",__FUNCTION__, status);
388 
389  /* HDCP is enabled */
390  HDCPeventData.data.systemStates.stateId = IARM_BUS_SYSMGR_SYSSTATE_HDCP_ENABLED;
391  HDCPeventData.data.systemStates.state = 1;
392  if (status == dsHDCP_STATUS_AUTHENTICATED )
393  {
394  __TIMESTAMP();printf("Changed status to HDCP Authentication Pass !!!!!!!! ..\r\n");
395  HDCPeventData.data.systemStates.state = 1;
396  bHDCPAuthenticated = true;
397  __TIMESTAMP();printf("HDCP success - Removed hotplug_event_src Time source %d and set resolution immediately \r\n",hotplug_event_src);
398  if(hotplug_event_src)
399  {
400  g_source_remove(hotplug_event_src);
401  hotplug_event_src = 0;
402  }
403  setBGColor(dsVIDEO_BGCOLOR_NONE);
404  if (!IsIgnoreEdid_gs) {
405  _SetVideoPortResolution();
406  }
407  g_timeout_add_seconds((guint)1,dumpEdidOnChecksumDiff,NULL);
408  }
409  else if (status == dsHDCP_STATUS_AUTHENTICATIONFAILURE )
410  {
411  __TIMESTAMP();printf("Changed status to HDCP Authentication Fail !!!!!!!! ..\r\n");
412  HDCPeventData.data.systemStates.state = 0;
413  setBGColor(dsVIDEO_BGCOLOR_BLUE);
414  bHDCPAuthenticated = false;
415  if (!IsIgnoreEdid_gs) {
416  _SetVideoPortResolution();
417  }
418  g_timeout_add_seconds((guint)1,dumpEdidOnChecksumDiff,NULL);
419  }
420 
421  IARM_Bus_BroadcastEvent(IARM_BUS_SYSMGR_NAME, (IARM_EventId_t) IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, (void *)&HDCPeventData, sizeof(HDCPeventData));
422 
423  }
424  break;
425  default:
426  break;
427  }
428  }
429 }
430 
431 /* Set Video resolution on HDMI Hot Plug or Tune Ready events */
432 static int _SetVideoPortResolution()
433 {
434  intptr_t _hdmihandle = 0;
435  intptr_t _comphandle = 0;
436  bool connected=false;
437  int iCount = 0;
438 
439 
440  __TIMESTAMP(); printf("%s:Enter \r\n",__FUNCTION__);
441 
442  _hdmihandle = getVideoPortHandle(dsVIDEOPORT_TYPE_HDMI);
443  if(_hdmihandle != NULL)
444  {
445 
446  usleep(100*1000); //wait for 100 milli seconds
447 
448 
449  /*
450  * Check for HDMI DDC Line when HDMI is connected.
451  */
452  connected = isHDMIConnected();
453  if(iInitResnFlag && connected)
454  {
455 
456  #ifdef _INIT_RESN_SETTINGS
457  /*Wait for iResnCount*/
458  while(iCount < iResnCount)
459  {
460  sleep(1); //wait for 1 sec
461  if (dsGetHDMIDDCLineStatus())
462  {
463  break;
464  }
465  __TIMESTAMP(); printf ("Waiting for HDMI DDC Line to be ready for resolution Change...\r\n");
466  iCount++;
467  }
468  #endif
469  }
470 
471  /*Set HDMI Resolution if Connected else COomponent or Composite Resolution */
472  if(connected){
473 
474  __TIMESTAMP(); printf("Setting HDMI resolution.......... \r\n");
476  }
477  else {
478  _comphandle = getVideoPortHandle(dsVIDEOPORT_TYPE_COMPONENT);
479 
480  if (NULL != _comphandle)
481  {
482  __TIMESTAMP();printf("Setting Component/Composite Resolution.......... \r\n");
484  }
485  else
486  {
487  __TIMESTAMP();printf("%s: NULL Handle for component\r\n",__FUNCTION__);
488 
489  intptr_t _compositehandle = getVideoPortHandle(dsVIDEOPORT_TYPE_BB);
490 
491  if (NULL != _compositehandle)
492  {
493  __TIMESTAMP();printf("Setting BB Composite Resolution.......... \r\n");
494  _SetResolution(&_compositehandle,dsVIDEOPORT_TYPE_BB);
495  }
496  else
497  {
498  __TIMESTAMP();printf("%s: NULL Handle for Composite \r\n",__FUNCTION__);
499  intptr_t _rfhandle = getVideoPortHandle(dsVIDEOPORT_TYPE_RF);
500  if (NULL != _rfhandle)
501  {
502  __TIMESTAMP();printf("Setting RF Resolution.......... \r\n");
504  }
505  else
506  {
507  __TIMESTAMP();printf("%s: NULL Handle for RF \r\n",__FUNCTION__);
508  }
509  }
510  }
511 
512  }
513  }
514  else
515  {
516  __TIMESTAMP();printf("%s: NULL Handle for HDMI \r\n",__FUNCTION__);
517  }
518  __TIMESTAMP();printf("%s:Exit \r\n",__FUNCTION__);
519  return 0;
520 }
521 
522 /**
523  * @brief This Function does following :
524  * Read Persisted resolution
525  * Verify Persisted resolution with Platform and EDID resolution
526  * If fails set best EDID resolution supported by platform
527  * If fails Default to 720P
528  * If 720p is not supported by TV , Default to 480p
529  * @param void pointer Device Handle
530  * * @param Connection Status
531  ** @return void pointer (NULL)
532  */
533 static int _SetResolution(intptr_t* handle,dsVideoPortType_t PortType)
534 {
535  errno_t rc = -1;
536  intptr_t _displayHandle = 0;
537  int numResolutions = 0,i=0;
538  intptr_t _handle = *handle;
539  bool IsValidResolution = false;
542  dsVideoPortResolution_t *setResn = NULL;
543  dsDisplayEDID_t edidData;
544  dsDisplayGetEDIDParam_t Edidparam;
545  /*
546  * Default Resolution Compatible check is false - Do not Force compatible resolution on startup
547  */
548  Setparam.forceCompatible = false;
549 
550  /*Initialize the struct*/
551  memset(&edidData, 0, sizeof(edidData));
552 
553  /* Return if Handle is NULL */
554  if (_handle == NULL)
555  {
556  __TIMESTAMP();printf("_SetResolution - Got NULL Handle ..\r\n");
557  return 0;
558  }
559 
560  /*Get the User Persisted Resolution Based on Handle */
561  memset(&Getparam,0,sizeof(Getparam));
562  Getparam.handle = _handle;
563  Getparam.toPersist = true;
564  _dsGetResolution(&Getparam);
565  dsVideoPortResolution_t *presolution = &Getparam.resolution;
566  __TIMESTAMP();printf("Got User Persisted Resolution - %s..\r\n",presolution->name);
567 
568 
569  if (PortType == dsVIDEOPORT_TYPE_HDMI) {
570  /*Get The Display Handle */
571  dsGetDisplay(dsVIDEOPORT_TYPE_HDMI, 0, &_displayHandle);
572  if (_displayHandle)
573  {
574  /* Get the EDID Display Handle */
575  memset(&Edidparam,0,sizeof(Edidparam));
576  Edidparam.handle = _displayHandle;
577  _dsGetEDID(&Edidparam);
578  rc = memcpy_s(&edidData,sizeof(edidData), &Edidparam.edid, sizeof(Edidparam.edid));
579  if(rc!=EOK)
580  {
581  ERR_CHK(rc);
582  }
583  dumpHdmiEdidInfo(&edidData);
584  numResolutions = edidData.numOfSupportedResolution;
585  __TIMESTAMP();printf("numResolutions is %d \r\n",numResolutions);
586 
587  /* If HDMI is connected and Low power Mode.
588  The TV might not Transmit the EDID information
589  Change the Resolution in Next Hot plug
590  DO not set the Resolution if TV is in DVI mode.
591  */
592  if ((0 == numResolutions) || (!(edidData.hdmiDeviceType)))
593  {
594 
595  __TIMESTAMP();printf("Do not Set Resolution..The HDMI is not Ready !! \r\n");
596  __TIMESTAMP();printf("numResolutions = %d edidData.hdmiDeviceType = %d !! \r\n",numResolutions,edidData.hdmiDeviceType);
597  return 0;
598  }
599 
600  /*
601  * Check if Persisted Resolution matches with
602  * TV Resolution list
603  */
604  for (i = 0; i < numResolutions; i++)
605  {
606  setResn = &(edidData.suppResolutionList[i]);
607  printf("presolution->name : %s, resolution->name : %s\r\n",presolution->name,setResn->name);
608  if ((strcmp(presolution->name,setResn->name) == 0 ))
609  {
610  __TIMESTAMP();printf("Breaking..Got Platform Resolution - %s..\r\n",setResn->name);
611  IsValidResolution = true;
612  Setparam.forceCompatible = true;
613  break;
614  }
615  }
616  /*
617  * The Persisted Resolution Does not matches with TV resolution list
618  * Set the Best Resolution Supported by TV and Platform
619  */
620  if (false == IsValidResolution)
621  {
622  /* Set the Best Resolution Supported by TV and Platform*/
623  for (i = numResolutions-1; i >= 0; i--)
624  {
625  setResn = &(edidData.suppResolutionList[i]);
626  int pNumResolutions = dsUTL_DIM(kResolutions);
627  for (int j = pNumResolutions-1; j >=0; j--)
628  {
629  dsVideoPortResolution_t *pfResolution = &kResolutions[j];
630  if (0 == (strcmp(pfResolution->name,setResn->name)))
631  {
632  __TIMESTAMP();printf("[DsMgr] Set Best TV Supported Resolution %s \r\n",pfResolution->name);
633  IsValidResolution = true;
634  break;
635  }
636  }
637  if (IsValidResolution)
638  {
639  break;
640  }
641  }
642  }
643  /*
644  * The Persisted Resolution Does not matches with TV and Platform
645  * Resolution List
646  * Force PLatform Default Resolution
647  */
648  if (false == IsValidResolution)
649  {
650  /* Check if the Default platform resolution is supported by Platfrom resolution List i.e 720p */
651  dsVideoPortResolution_t *defaultResn;
652  defaultResn = &kResolutions[kDefaultResIndex];
653  for (i = 0; i < numResolutions; i++)
654  {
655  setResn = &(edidData.suppResolutionList[i]);
656  //printf("\n presolution->name : %s, resolution->name : %s\n",defaultResn->name,setResn->name);
657  if ((strcmp(defaultResn->name,setResn->name) == 0 ))
658  {
659  IsValidResolution = true;
660  __TIMESTAMP();printf("Breaking..Got Default Platform Resolution - %s..\r\n",setResn->name);
661  break;
662  }
663  }
664  }
665 
666  if (false == IsValidResolution)
667  {
668  /*Take 480p as resolution if both above cases fail */
669  for (i = 0; i < numResolutions; i++)
670  {
671  setResn = &(edidData.suppResolutionList[i]);
672  if ((strcmp("480p",setResn->name) == 0 ))
673  {
674  __TIMESTAMP();printf("Breaking..Default to 480p Resolution - %s..\r\n",setResn->name);
675  IsValidResolution = true;
676  break;
677  }
678  }
679  }
680 
681  if (false == IsValidResolution)
682  {
683  /* Boot with the Resolution Supported by TV and Platform*/
684  for (i = 0; i < numResolutions; i++)
685  {
686  setResn = &(edidData.suppResolutionList[i]);
687  size_t numResolutions = dsUTL_DIM(kResolutions);
688  for (size_t j = 0; j < numResolutions; j++)
689  {
690  dsVideoPortResolution_t *pfResolution = &kResolutions[j];
691  if (0 == (strcmp(pfResolution->name,setResn->name)))
692  {
693  __TIMESTAMP();printf("[DsMgr] Boot with TV Supported Resolution %s \r\n",pfResolution->name);
694  IsValidResolution = true;
695  break;
696  }
697  }
698  }
699  }
700  }
701  }
702  else if (PortType == dsVIDEOPORT_TYPE_COMPONENT || PortType == dsVIDEOPORT_TYPE_BB || PortType == dsVIDEOPORT_TYPE_RF)
703  {
704  /* Set the Component / Composite Resolution */
705  numResolutions = dsUTL_DIM(kResolutions);
706  for (i = 0; i < numResolutions; i++)
707  {
708  setResn = &kResolutions[i];
709  if ((strcmp(presolution->name,setResn->name) == 0 ))
710  {
711  __TIMESTAMP();printf("Breaking..Got Platform Resolution - %s..\r\n",setResn->name);
712  IsValidResolution = true;
713  break;
714  }
715  }
716  }
717  /* If the Persisted Resolution settings does not matches with Platform Resolution -
718  Force Default on Component/Composite
719  This is to keep upward compatible and if we intend to
720  remove any resolution from Dynamic Resolution List
721  */
722  if(false == IsValidResolution)
723  {
724  setResn = &kResolutions[kDefaultResIndex];
725  }
726 
727  /* Set The Video Port Resolution in Requested Handle */
728  Setparam.handle = _handle;
729  Setparam.toPersist = false;
730 
731  /* If 4K support is disabled and last known resolution is 4K, default to 720p (aka default resolution) */
732  dsForceDisable4KParam_t res_4K_override;
733  memset(&res_4K_override, 0, sizeof(res_4K_override));
734  _dsGetForceDisable4K((void *) &res_4K_override);
735  if(true == res_4K_override.disable)
736  {
737  if(0 == strncmp(presolution->name, "2160", 4))
738  {
739  __TIMESTAMP();printf("User persisted 4K resolution. Now limiting to default (720p?) as 4K support is now disabled.\n");
740  setResn = &kResolutions[kDefaultResIndex];
741  }
742  }
743 
744  Setparam.resolution = *setResn;
745 
746  /* Call during Init*/
747  #ifdef _INIT_RESN_SETTINGS
748  if(0 == iInitResnFlag)
749  {
750  printf("Init Platform Resolution - %s..\r\n",setResn->name);
751  _dsInitResolution(&Setparam);
752  return 0 ;
753  }
754  #endif
755 
756  _dsSetResolution(&Setparam);
757  return 0 ;
758 }
759 
760 /**
761  * @brief Thread entry fuction to post Resolution on Hot Plug and Tune ready Events
762  *
763  * This functions changes the device resolution on Hot Plug and Tune ready Events
764  *
765  * @param void pointer (NULL)
766  *
767  * @return void pointer (NULL)
768  */
769 static void* _DSMgrResnThreadFunc(void *arg)
770 {
771 
772  /* Loop */
773  while (1)
774  {
775  __TIMESTAMP(); printf ("_DSMgrResnThreadFunc... wait for for HDMI or Tune Ready Events \r\n");
776 
777  /*Wait for the Event*/
778  pthread_mutex_lock(&tdsMutexLock);
779  pthread_cond_wait(&tdsMutexCond, &tdsMutexLock);
780  pthread_mutex_unlock(&tdsMutexLock);
781 
782  __TIMESTAMP();printf("%s: Setting Resolution On:: HDMI %s Event with TuneReady status = %d \r\n",__FUNCTION__, (edisplayEventStatus == dsDISPLAY_EVENT_CONNECTED ? "Connect" : "Disconnect"),iTuneReady);
783 
784 
785  //On hot plug event , Remove event source
786  if(hotplug_event_src)
787  {
788  g_source_remove(hotplug_event_src);
789  __TIMESTAMP();printf("Removed Hot Plug Event Time source %d \r\n",hotplug_event_src);
790  hotplug_event_src = 0;
791  }
792 
793  /*Set the Resolution only on HDMI Hot plug Connect and Tune Ready events */
794  if((1 == iTuneReady) && (dsDISPLAY_EVENT_CONNECTED == edisplayEventStatus)) {
795  /*Set Video Output Port Resolution */
796  if(bHDCPAuthenticated)
797  {
798  _SetVideoPortResolution();
799  }
800  /* Set audio mode on HDMI hot plug */
801  _setAudioMode();
802  }/*Set the Resolution only on HDMI Hot plug - Disconnect and Tune Ready event */
803  else if((1 == iTuneReady) && (dsDISPLAY_EVENT_DISCONNECTED == edisplayEventStatus)) {
804  /* * To avoid reoslution settings of HDMI hot plug when TV goes from power OFF to ON condition
805  * Delay the setting of resolution by 5 sec. This will help to filter out un-necessary
806  * resolution settings on HDMI hot plug.
807  */
808  bHDCPAuthenticated = false;
809  if(isComponentPortPresent())
810  {
811  hotplug_event_src = g_timeout_add_seconds((guint)5,_SetResolutionHandler,dsMgr_Gloop);
812  __TIMESTAMP();printf("Schedule a handler to set the resolution after 5 sec for %d time src.. \r\n",hotplug_event_src);
813  }
814  }
815 
816  }
817  return arg;
818 }
819 
820 
821 static gboolean _SetResolutionHandler(gpointer data)
822 {
823  __TIMESTAMP();printf("Set Video Resolution after delayed time .. \r\n");
824  _SetVideoPortResolution();
825  hotplug_event_src = 0;
826  return FALSE;
827 }
828 
829 
830 void _setEASAudioMode()
831 {
832 
833  if (isEAS != IARM_BUS_SYS_MODE_EAS) {
834  __TIMESTAMP();printf("EAS Not In progress..Do not Modify Audio \r\n");
835  return;
836  }
837 
838  dsAudioGetHandleParam_t getHandle;
840  int numPorts, i = 0;
841 
842  numPorts = dsUTL_DIM(kSupportedPortTypes);
843  for (i=0; i < numPorts; i++)
844  {
845  const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i];
846  memset(&getHandle, 0, sizeof(getHandle));
847  getHandle.type = *audioPort;
848  getHandle.index = 0;
849  _dsGetAudioPort (&getHandle);
850 
851  memset(&setMode, 0, sizeof(setMode));
852  setMode.handle = getHandle.handle;
853  setMode.toPersist = false;
854  _dsGetStereoMode(&setMode);
855 
856  if (setMode.mode == dsAUDIO_STEREO_PASSTHRU) {
857  /* In EAS, fallsback to Stereo */
858  setMode.mode = dsAUDIO_STEREO_STEREO;
859  }
860 
861  __TIMESTAMP();printf("EAS Audio mode for audio port %d is : %d \r\n",getHandle.type, setMode.mode);
862  setMode.toPersist = false;
863  _dsSetStereoMode (&setMode);
864  }
865 }
866 /**
867  * @brief Local function to get and set audio mode
868  *
869  * This functions gets the audio mode from persistent and sets it
870  *
871  * @param NULL
872  *
873  * @return NULL
874  */
875 static void _setAudioMode()
876 {
877  if (isEAS == IARM_BUS_SYS_MODE_EAS) {
878  __TIMESTAMP();printf("EAS In progress..Do not Modify Audio \r\n");
879  return;
880  }
881 
882  dsAudioGetHandleParam_t getHandle;
884  int numPorts, i = 0;
885 
886  numPorts = dsUTL_DIM(kSupportedPortTypes);
887  for (i=0; i < numPorts; i++)
888  {
889  const dsAudioPortType_t *audioPort = &kSupportedPortTypes[i];
890  memset(&getHandle, 0, sizeof(getHandle));
891  getHandle.type = *audioPort;
892  getHandle.index = 0;
893  _dsGetAudioPort (&getHandle);
894 
895  memset(&setMode, 0, sizeof(setMode));
896  setMode.handle = getHandle.handle;
897  setMode.toPersist = true;
898  _dsGetStereoMode(&setMode);
899  if (getHandle.type == dsAUDIOPORT_TYPE_SPDIF) {
900  }
901  else if (getHandle.type == dsAUDIOPORT_TYPE_HDMI) {
902  //check if it is connected
903  intptr_t vHandle = 0;
904  int autoMode = 0;
905  bool connected = 0;
906  bool IsSurround = false;
907  {
909  memset(&param, 0, sizeof(param));
910  param.type = dsVIDEOPORT_TYPE_HDMI;
911  param.index = 0;
912  _dsGetVideoPort(&param);
913  vHandle = param.handle;
914  //printf("Audio port has HDMI handle\r\n");
915  }
916  {
918  memset(&param, 0, sizeof(param));
919  param.handle = vHandle;
920  _dsIsDisplayConnected(&param);
921  connected = param.connected;
922  //printf("Audio port HDMI is connected to sink %d\r\n", connected);
923  }
924 
925  if (!(connected)) {
926  __TIMESTAMP();printf("HDMI Not Connected ..Do not Set Audio on HDMI !!! \r\n");
927  continue;
928  }
929 
930  {
932  memset(&param, 0, sizeof(param));
933  param.handle = getHandle.handle;
934  _dsGetStereoAuto(&param);
935  autoMode = param.autoMode;
936  //printf("Audio port HDMI is Auto mode %d\r\n", autoMode);
937  }
938 
939  //printf("Audio port HDMI %d is connected %d Auto mode %d\r\n", vHandle, connected, autoMode);
940  if (autoMode) {
941  /* If auto, then force surround */
942  setMode.mode = dsAUDIO_STEREO_SURROUND;
943  }
944 
945  if (0) /* Do not enforce surround protection, let HAL do it*/
946  {
948  param.handle = vHandle;
949  param.surround = false;
950  _dsIsDisplaySurround(&param);
951  IsSurround = param.surround;
952  }
953  else
954  {
955  IsSurround = true;
956  }
957  if (!(IsSurround)) {
958  /* If Surround not supported , then force Stereo */
959  setMode.mode = dsAUDIO_STEREO_STEREO;
960  __TIMESTAMP();printf("Surround mode not Supported on HDMI ..Set Stereo \r\n");
961  }
962  }
963  __TIMESTAMP();printf("Audio mode for audio port %d is : %d \r\n",getHandle.type, setMode.mode);
964  setMode.toPersist = false;
965  _dsSetStereoMode (&setMode);
966  }
967 }
968 
969 /* This functions Dump the HDMI EDID Information of the box.
970  *
971  * @param NULL
972  *
973  * @return NULL
974  */
975 static void dumpHdmiEdidInfo(dsDisplayEDID_t* pedidData)
976 {
977  __TIMESTAMP();printf("Connected HDMI Display Device Info !!!!!\r\n");
978 
979  if (NULL == pedidData) {
980  __TIMESTAMP(); printf("Received EDID is NULL \r\n");
981  return;
982  }
983 
984  if(pedidData->monitorName)
985  printf("HDMI Monitor Name is %s \r\n",pedidData->monitorName);
986  printf("HDMI Manufacturing ID is %d \r\n",pedidData->serialNumber);
987  printf("HDMI Product Code is %d \r\n",pedidData->productCode);
988  printf("HDMI Device Type is %s \r\n",pedidData->hdmiDeviceType?"HDMI":"DVI");
989  printf("HDMI Sink Device %s a Repeater \r\n",pedidData->isRepeater?"is":"is not");
990  printf("HDMI Physical Address is %d:%d:%d:%d \r\n",pedidData->physicalAddressA,
991  pedidData->physicalAddressB,pedidData->physicalAddressC,pedidData->physicalAddressD);
992 }
993 
994 
995 static gboolean dumpEdidOnChecksumDiff(gpointer data) {
996  __TIMESTAMP();printf("dumpEdidOnChecksumDiff HDMI-EDID Dump>>>>>>>>>>>>>>\r\n");
997  intptr_t _displayHandle = 0;
998  dsGetDisplay(dsVIDEOPORT_TYPE_HDMI, 0, &_displayHandle);
999  if (_displayHandle) {
1000  int length = 0;
1001  dsDisplayGetEDIDBytesParam_t EdidBytesParam;
1002  static int cached_EDID_checksum = 0;
1003  int current_EDID_checksum = 0;
1004  memset(&EdidBytesParam,0,sizeof(EdidBytesParam));
1005  EdidBytesParam.handle = _displayHandle;
1006  _dsGetEDIDBytes(&EdidBytesParam);
1007  length = EdidBytesParam.length;
1008 
1009  if((length > 0) && (length <= 512)) {
1010  unsigned char* edidBytes = EdidBytesParam.bytes;
1011  for (int i = 0; i < (length / 128); i++)
1012  current_EDID_checksum += edidBytes[(i+1)*128 - 1];
1013 
1014  if((cached_EDID_checksum == 0) || (current_EDID_checksum != cached_EDID_checksum)) {
1015  cached_EDID_checksum = current_EDID_checksum;
1016  __TIMESTAMP();printf("HDMI-EDID Dump BEGIN>>>>>>>>>>>>>>\r\n");
1017  for (int i = 0; i < length; i++) {
1018  if (i % 16 == 0) {
1019  printf("\r\n");
1020  }
1021  if (i % 128 == 0) {
1022  printf("\r\n");
1023  }
1024  printf("%02X ", edidBytes[i]);
1025  }
1026  printf("\nHDMI-EDID Dump END>>>>>>>>>>>>>>\r\n");
1027  }
1028  }
1029  }
1030  return false;
1031 }
1032 
1033 /** @} */
1034 /** @} */
_dsAudioSetStereoAutoParam_t
Definition: dsRpc.h:330
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
_dsVideoPortIsDisplaySurroundParam_t
Definition: dsRpc.h:542
dsDISPLAY_EVENT_DISCONNECTED
@ dsDISPLAY_EVENT_DISCONNECTED
Display disconnected event.
Definition: dsDisplay.h:52
dsHDCP_STATUS_AUTHENTICATED
@ dsHDCP_STATUS_AUTHENTICATED
Definition: dsTypes.h:416
_dsAudioSetStereoModeParam_t
Definition: dsRpc.h:323
sysMgr.h
IARM-Bus Sys Manager Public API.
_dsDisplayEDID_t::hdmiDeviceType
bool hdmiDeviceType
Definition: dsTypes.h:906
_dsDisplayGetEDIDParam_t
Definition: dsRpc.h:602
IARM_BUS_SYSMGR_NAME
#define IARM_BUS_SYSMGR_NAME
Definition: sysMgr.h:110
dsVIDEOPORT_TYPE_HDMI
@ dsVIDEOPORT_TYPE_HDMI
Definition: dsTypes.h:441
_SetResolution
static int _SetResolution(intptr_t *handle, dsVideoPortType_t PortType)
This Function does following : Read Persisted resolution Verify Persisted resolution with Platform an...
Definition: dsMgr.c:533
_dsVideoPortGetHandleParam_t
Definition: dsRpc.h:503
dsAudioPortType_t
enum _dsAudioPortType_t dsAudioPortType_t
dsMgrPwrEventListener.h
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
dsTypes.h
Device Settings HAL types.
_dsVideoPortSetResolutionParam_t
Definition: dsRpc.h:560
dsVideoPortType_t
enum _dsVideoPortType_t dsVideoPortType_t
dsAUDIO_STEREO_STEREO
@ dsAUDIO_STEREO_STEREO
Definition: dsTypes.h:376
dsVideoPort.h
_dsDisplayEDID_t::physicalAddressC
uint8_t physicalAddressC
Definition: dsTypes.h:910
IARM_Bus_RegisterEvent
IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId)
This API is used to register all the events that are published by the application.
IARM_Bus_RegisterEventHandler
IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
This API register to listen to event and provide the callback function for event notification....
Definition: iarmMgrMocks.cpp:43
dsError.h
Device Settings HAL error codes.
_IARM_Bus_SYSMgr_GetSystemStates_Param_t
Definition: sysMgr.h:299
IARM_Bus_RegisterCall
IARM_Result_t IARM_Bus_RegisterCall(const char *methodName, IARM_BusCall_t handler)
This API is used to register an RPC method that can be invoked by other applications.
dsVIDEO_BGCOLOR_BLUE
@ dsVIDEO_BGCOLOR_BLUE
Definition: dsTypes.h:533
_dsVideoPortGetResolutionParam_t
Definition: dsRpc.h:553
dsGetDisplay
dsError_t dsGetDisplay(dsVideoPortType_t vType, int index, intptr_t *handle)
Get the handle of a display device.
Definition: dsDisplay.c:65
_DSMgrResnThreadFunc
static void * _DSMgrResnThreadFunc(void *arg)
Thread entry fuction to post Resolution on Hot Plug and Tune ready Events.
Definition: dsMgr.c:769
_dsAudioGetHandleParam_t
Definition: dsRpc.h:302
dsUtl.h
Device Settings HAL utilities.
IARM_BUS_DSMGR_EVENT_HDCP_STATUS
@ IARM_BUS_DSMGR_EVENT_HDCP_STATUS
Definition: dsMgr.h:52
dsVIDEOPORT_TYPE_RF
@ dsVIDEOPORT_TYPE_RF
Definition: dsTypes.h:435
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
_dsDisplayEDID_t::monitorName
char monitorName[14]
Definition: dsTypes.h:914
dsVIDEOPORT_TYPE_BB
@ dsVIDEOPORT_TYPE_BB
Definition: dsTypes.h:436
_dsEdidIgnoreParam_t
Definition: dsRpc.h:341
dsAUDIO_STEREO_SURROUND
@ dsAUDIO_STEREO_SURROUND
Definition: dsTypes.h:377
dsVideoBackgroundColor_t
enum _dsVideoBackgroundColor_t dsVideoBackgroundColor_t
_dsDisplayEDID_t::numOfSupportedResolution
int32_t numOfSupportedResolution
Definition: dsTypes.h:912
_IARM_BUS_SYSMgr_EventData_t
Definition: sysMgr.h:229
_dsDisplayGetEDIDBytesParam_t
Definition: dsRpc.h:613
IARM_Bus_BroadcastEvent
IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *data, size_t len)
This API is used to publish an Asynchronous event to all IARM client registered for this perticular e...
_dsVideoPortIsDisplayConnectedParam_t
Definition: dsRpc.h:537
libIBus.h
RDK IARM-Bus API Declarations.
_dsDisplayEDID_t::physicalAddressA
uint8_t physicalAddressA
Definition: dsTypes.h:908
_dsVideoPortType_t
_dsVideoPortType_t
Definition: dsTypes.h:434
dsAUDIOPORT_TYPE_SPDIF
@ dsAUDIOPORT_TYPE_SPDIF
Definition: dsTypes.h:168
dsDISPLAY_EVENT_CONNECTED
@ dsDISPLAY_EVENT_CONNECTED
Display connected event.
Definition: dsDisplay.h:51
dsDisplay.h
_dsDisplayEDID_t
Defines the structure that is used to get the EDID information of the video display.
Definition: dsTypes.h:901
dsAUDIO_STEREO_PASSTHRU
@ dsAUDIO_STEREO_PASSTHRU
Definition: dsTypes.h:378
_setAudioMode
static void _setAudioMode()
Local function to get and set audio mode.
Definition: dsMgr.c:875
dsForceDisable4KParam_t
Definition: dsRpc.h:844
_dsVideoPortResolution_t
Structure that defines video port resolution settings of output video device.
Definition: dsTypes.h:642
dsAudio.h
_dsSetBackgroundColorParam_t
Definition: dsRpc.h:532
_dsDisplayEDID_t::productCode
int32_t productCode
Definition: dsTypes.h:902
_dsVideoPortResolution_t::name
char name[32]
Definition: dsTypes.h:643
dsVIDEO_BGCOLOR_NONE
@ dsVIDEO_BGCOLOR_NONE
Definition: dsTypes.h:535
_dsDisplayEDID_t::physicalAddressB
uint8_t physicalAddressB
Definition: dsTypes.h:909
IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
@ IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
Definition: dsMgr.h:50
IARM_BUS_DSMGR_EVENT_MAX
@ IARM_BUS_DSMGR_EVENT_MAX
Definition: dsMgr.h:75
_dsDisplayEDID_t::isRepeater
bool isRepeater
Definition: dsTypes.h:907
dsVIDEOPORT_TYPE_COMPONENT
@ dsVIDEOPORT_TYPE_COMPONENT
Definition: dsTypes.h:440
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
dsHDCP_STATUS_AUTHENTICATIONFAILURE
@ dsHDCP_STATUS_AUTHENTICATIONFAILURE
Definition: dsTypes.h:417
_dsDisplayEDID_t::suppResolutionList
dsVideoPortResolution_t suppResolutionList[64 *dsVIDEO_SSMODE_MAX]
Definition: dsTypes.h:913
dsUTL_DIM
#define dsUTL_DIM(arr)
Device Settings general Array dimension calculation inline definition.
Definition: dsUtl.h:85
_dsDisplayEDID_t::physicalAddressD
uint8_t physicalAddressD
Definition: dsTypes.h:911
_SysModeChange
static IARM_Result_t _SysModeChange(void *arg)
This function is a event handler which returns current system mode using IARM. It returns mode as "NO...
Definition: dsMgr.c:272
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38
TRUE
#define TRUE
Defines for TRUE/FALSE/ENABLE flags.
Definition: wifi_common_hal.h:199
_dsDisplayEDID_t::serialNumber
int32_t serialNumber
Definition: dsTypes.h:903
_DSMgr_EventData_t
Definition: dsMgr.h:81
dsAUDIOPORT_TYPE_HDMI
@ dsAUDIOPORT_TYPE_HDMI
Definition: dsTypes.h:167
dsMgrInternal.h
IARM_BUS_SYSMGR_API_GetSystemStates
#define IARM_BUS_SYSMGR_API_GetSystemStates
Definition: sysMgr.h:284