976
976
EXPORT_SYMBOL(drm_mode_connector_list_update);
979
* drm_mode_parse_command_line_for_connector - parse command line for connector
980
* @mode_option - per connector mode option
981
* @connector - connector to parse line for
983
* This parses the connector specific then generic command lines for
984
* modes and options to configure the connector.
986
* This uses the same parameters as the fb modedb.c, except for extra
987
* <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
989
* enable/enable Digital/disable bit at the end
991
bool drm_mode_parse_command_line_for_connector(const char *mode_option,
992
struct drm_connector *connector,
993
struct drm_cmdline_mode *mode)
996
unsigned int namelen;
997
int res_specified = 0, bpp_specified = 0, refresh_specified = 0;
998
unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0;
999
int yres_specified = 0, cvt = 0, rb = 0, interlace = 0, margins = 0;
1001
enum drm_connector_force force = DRM_FORCE_UNSPECIFIED;
1005
mode_option = fb_mode_option;
1009
mode->specified = false;
1014
namelen = strlen(name);
1015
for (i = namelen-1; i >= 0; i--) {
1019
if (!refresh_specified && !bpp_specified &&
1021
refresh = simple_strtol(&name[i+1], NULL, 10);
1022
refresh_specified = 1;
1030
if (!bpp_specified && !yres_specified) {
1031
bpp = simple_strtol(&name[i+1], NULL, 10);
1039
if (!yres_specified) {
1040
yres = simple_strtol(&name[i+1], NULL, 10);
1047
if (!yres_specified)
1063
force = DRM_FORCE_ON;
1066
if ((connector->connector_type != DRM_MODE_CONNECTOR_DVII) &&
1067
(connector->connector_type != DRM_MODE_CONNECTOR_HDMIB))
1068
force = DRM_FORCE_ON;
1070
force = DRM_FORCE_ON_DIGITAL;
1073
force = DRM_FORCE_OFF;
1079
if (i < 0 && yres_specified) {
1080
xres = simple_strtol(name, NULL, 10);
1084
if (res_specified) {
1085
mode->specified = true;
1090
if (refresh_specified) {
1091
mode->refresh_specified = true;
1092
mode->refresh = refresh;
1095
if (bpp_specified) {
1096
mode->bpp_specified = true;
1099
mode->rb = rb ? true : false;
1100
mode->cvt = cvt ? true : false;
1101
mode->interlace = interlace ? true : false;
1102
mode->force = force;
1106
EXPORT_SYMBOL(drm_mode_parse_command_line_for_connector);
1108
struct drm_display_mode *
1109
drm_mode_create_from_cmdline_mode(struct drm_device *dev,
1110
struct drm_cmdline_mode *cmd)
1112
struct drm_display_mode *mode;
1115
mode = drm_cvt_mode(dev,
1116
cmd->xres, cmd->yres,
1117
cmd->refresh_specified ? cmd->refresh : 60,
1118
cmd->rb, cmd->interlace,
1121
mode = drm_gtf_mode(dev,
1122
cmd->xres, cmd->yres,
1123
cmd->refresh_specified ? cmd->refresh : 60,
1129
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
1132
EXPORT_SYMBOL(drm_mode_create_from_cmdline_mode);