enum vmode_e mode;
int ret = 0;
+ vout_trim_string(name);
VOUTPR("vout2: vmode set to %s\n", name);
if (strcmp(name, local_name) == 0) {
static int set_vout2_init_mode(void)
{
- enum vmode_e vmode = VMODE_NULL;
+ enum vmode_e vmode = nulldisp_vinfo.mode;
int ret = 0;
ret = set_current_vmode2(vmode);
if (ret) {
VOUTERR("vout2: init mode null set error\n");
} else {
- snprintf(vout2_mode, VMODE_NAME_LEN_MAX, "null");
+ snprintf(local_name, VMODE_NAME_LEN_MAX, nulldisp_vinfo.name);
+ snprintf(vout2_mode, VMODE_NAME_LEN_MAX, nulldisp_vinfo.name);
VOUTPR("vout2: init mode %s set ok\n", vout2_mode);
}
}
EXPORT_SYMBOL(get_invalid_vinfo);
+void vout_trim_string(char *str)
+{
+ char *start, *end;
+ int len;
+
+ if (str == NULL)
+ return;
+
+ len = strlen(str);
+ if ((str[len-1] == '\n') || (str[len-1] == '\r')) {
+ len--;
+ str[len] = '\0';
+ }
+
+ start = str;
+ end = str + len - 1;
+ while (*start && (*start == ' '))
+ start++;
+ while (*end && (*end == ' '))
+ *end-- = '\0';
+ strcpy(str, start);
+}
+EXPORT_SYMBOL(vout_trim_string);
+
struct vout_module_s *vout_func_get_vout_module(void)
{
return &vout_module;
extern int get_hpd_state(void);
#endif
extern int vout_get_hpd_state(void);
+extern void vout_trim_string(char *str);
extern struct vinfo_s *get_invalid_vinfo(int index);
extern struct vout_module_s *vout_func_get_vout_module(void);
enum vmode_e mode;
int ret = 0;
+ vout_trim_string(name);
VOUTPR("vmode set to %s\n", name);
if (strcmp(name, local_name) == 0) {
* convert to vmode when vout sever registered
*/
snprintf(vout_mode_uboot, VMODE_NAME_LEN_MAX, "%s", str);
+ vout_trim_string(vout_mode_uboot);
VOUTPR("%s\n", str);
}