Rev 4104 | Rev 5060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4104 | Rev 4560 | ||
---|---|---|---|
Line 411... | Line 411... | ||
411 | #define SDVO_NAME(svdo) ((svdo)->is_sdvob ? "SDVOB" : "SDVOC") |
411 | #define SDVO_NAME(svdo) ((svdo)->is_sdvob ? "SDVOB" : "SDVOC") |
Line 412... | Line 412... | ||
412 | 412 | ||
413 | static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, |
413 | static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, |
414 | const void *args, int args_len) |
414 | const void *args, int args_len) |
415 | { |
415 | { |
- | 416 | int i, pos = 0; |
|
- | 417 | #define BUF_LEN 256 |
|
- | 418 | char buffer[BUF_LEN]; |
|
- | 419 | ||
- | 420 | #define BUF_PRINT(args...) \ |
|
- | 421 | pos += snprintf(buffer + pos, max_t(int, BUF_LEN - pos, 0), args) |
|
Line 416... | Line -... | ||
416 | int i; |
- | |
417 | - | ||
418 | DRM_DEBUG_KMS("%s: W: %02X ", |
422 | |
419 | SDVO_NAME(intel_sdvo), cmd); |
423 | |
- | 424 | for (i = 0; i < args_len; i++) { |
|
420 | for (i = 0; i < args_len; i++) |
425 | BUF_PRINT("%02X ", ((u8 *)args)[i]); |
421 | DRM_LOG_KMS("%02X ", ((u8 *)args)[i]); |
426 | } |
- | 427 | for (; i < 8; i++) { |
|
422 | for (; i < 8; i++) |
428 | BUF_PRINT(" "); |
423 | DRM_LOG_KMS(" "); |
429 | } |
424 | for (i = 0; i < ARRAY_SIZE(sdvo_cmd_names); i++) { |
430 | for (i = 0; i < ARRAY_SIZE(sdvo_cmd_names); i++) { |
425 | if (cmd == sdvo_cmd_names[i].cmd) { |
431 | if (cmd == sdvo_cmd_names[i].cmd) { |
426 | DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name); |
432 | BUF_PRINT("(%s)", sdvo_cmd_names[i].name); |
427 | break; |
433 | break; |
428 | } |
434 | } |
429 | } |
435 | } |
- | 436 | if (i == ARRAY_SIZE(sdvo_cmd_names)) { |
|
430 | if (i == ARRAY_SIZE(sdvo_cmd_names)) |
437 | BUF_PRINT("(%02X)", cmd); |
- | 438 | } |
|
- | 439 | BUG_ON(pos >= BUF_LEN - 1); |
|
- | 440 | #undef BUF_PRINT |
|
- | 441 | #undef BUF_LEN |
|
431 | DRM_LOG_KMS("(%02X)", cmd); |
442 | |
Line 432... | Line 443... | ||
432 | DRM_LOG_KMS("\n"); |
443 | DRM_DEBUG_KMS("%s: W: %02X %s\n", SDVO_NAME(intel_sdvo), cmd, buffer); |
433 | } |
444 | } |
434 | 445 | ||
Line 510... | Line 521... | ||
510 | static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, |
521 | static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, |
511 | void *response, int response_len) |
522 | void *response, int response_len) |
512 | { |
523 | { |
513 | u8 retry = 15; /* 5 quick checks, followed by 10 long checks */ |
524 | u8 retry = 15; /* 5 quick checks, followed by 10 long checks */ |
514 | u8 status; |
525 | u8 status; |
515 | int i; |
526 | int i, pos = 0; |
- | 527 | #define BUF_LEN 256 |
|
- | 528 | char buffer[BUF_LEN]; |
|
Line 516... | Line -... | ||
516 | - | ||
Line 517... | Line 529... | ||
517 | DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(intel_sdvo)); |
529 | |
518 | 530 | ||
519 | /* |
531 | /* |
520 | * The documentation states that all commands will be |
532 | * The documentation states that all commands will be |
Line 549... | Line 561... | ||
549 | SDVO_I2C_CMD_STATUS, |
561 | SDVO_I2C_CMD_STATUS, |
550 | &status)) |
562 | &status)) |
551 | goto log_fail; |
563 | goto log_fail; |
552 | } |
564 | } |
Line -... | Line 565... | ||
- | 565 | ||
- | 566 | #define BUF_PRINT(args...) \ |
|
- | 567 | pos += snprintf(buffer + pos, max_t(int, BUF_LEN - pos, 0), args) |
|
553 | 568 | ||
554 | if (status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP) |
569 | if (status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP) |
555 | DRM_LOG_KMS("(%s)", cmd_status_names[status]); |
570 | BUF_PRINT("(%s)", cmd_status_names[status]); |
556 | else |
571 | else |
Line 557... | Line 572... | ||
557 | DRM_LOG_KMS("(??? %d)", status); |
572 | BUF_PRINT("(??? %d)", status); |
558 | 573 | ||
Line 559... | Line 574... | ||
559 | if (status != SDVO_CMD_STATUS_SUCCESS) |
574 | if (status != SDVO_CMD_STATUS_SUCCESS) |
560 | goto log_fail; |
575 | goto log_fail; |
561 | 576 | ||
562 | /* Read the command response */ |
577 | /* Read the command response */ |
563 | for (i = 0; i < response_len; i++) { |
578 | for (i = 0; i < response_len; i++) { |
564 | if (!intel_sdvo_read_byte(intel_sdvo, |
579 | if (!intel_sdvo_read_byte(intel_sdvo, |
565 | SDVO_I2C_RETURN_0 + i, |
580 | SDVO_I2C_RETURN_0 + i, |
566 | &((u8 *)response)[i])) |
581 | &((u8 *)response)[i])) |
567 | goto log_fail; |
582 | goto log_fail; |
- | 583 | BUF_PRINT(" %02X", ((u8 *)response)[i]); |
|
- | 584 | } |
|
- | 585 | BUG_ON(pos >= BUF_LEN - 1); |
|
- | 586 | #undef BUF_PRINT |
|
568 | DRM_LOG_KMS(" %02X", ((u8 *)response)[i]); |
587 | #undef BUF_LEN |
Line 569... | Line 588... | ||
569 | } |
588 | |
570 | DRM_LOG_KMS("\n"); |
589 | DRM_DEBUG_KMS("%s: R: %s\n", SDVO_NAME(intel_sdvo), buffer); |
571 | return true; |
590 | return true; |
572 | 591 | ||
Line 573... | Line 592... | ||
573 | log_fail: |
592 | log_fail: |
574 | DRM_LOG_KMS("... failed\n"); |
593 | DRM_DEBUG_KMS("%s: R: ... failed\n", SDVO_NAME(intel_sdvo)); |
Line 931... | Line 950... | ||
931 | } |
950 | } |
932 | #endif |
951 | #endif |
Line 933... | Line 952... | ||
933 | 952 | ||
934 | static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, |
953 | static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, |
935 | unsigned if_index, uint8_t tx_rate, |
954 | unsigned if_index, uint8_t tx_rate, |
936 | uint8_t *data, unsigned length) |
955 | const uint8_t *data, unsigned length) |
937 | { |
956 | { |
938 | uint8_t set_buf_index[2] = { if_index, 0 }; |
957 | uint8_t set_buf_index[2] = { if_index, 0 }; |
939 | uint8_t hbuf_size, tmp[8]; |
958 | uint8_t hbuf_size, tmp[8]; |
Line 1066... | Line 1085... | ||
1066 | return true; |
1085 | return true; |
1067 | } |
1086 | } |
Line 1068... | Line 1087... | ||
1068 | 1087 | ||
1069 | static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_config) |
1088 | static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_config) |
1070 | { |
1089 | { |
1071 | unsigned dotclock = pipe_config->adjusted_mode.clock; |
1090 | unsigned dotclock = pipe_config->port_clock; |
Line 1072... | Line 1091... | ||
1072 | struct dpll *clock = &pipe_config->dpll; |
1091 | struct dpll *clock = &pipe_config->dpll; |
1073 | 1092 | ||
1074 | /* SDVO TV has fixed PLL values depend on its clock range, |
1093 | /* SDVO TV has fixed PLL values depend on its clock range, |
Line 1131... | Line 1150... | ||
1131 | /* Make the CRTC code factor in the SDVO pixel multiplier. The |
1150 | /* Make the CRTC code factor in the SDVO pixel multiplier. The |
1132 | * SDVO device will factor out the multiplier during mode_set. |
1151 | * SDVO device will factor out the multiplier during mode_set. |
1133 | */ |
1152 | */ |
1134 | pipe_config->pixel_multiplier = |
1153 | pipe_config->pixel_multiplier = |
1135 | intel_sdvo_get_pixel_multiplier(adjusted_mode); |
1154 | intel_sdvo_get_pixel_multiplier(adjusted_mode); |
1136 | adjusted_mode->clock *= pipe_config->pixel_multiplier; |
- | |
Line 1137... | Line 1155... | ||
1137 | 1155 | ||
1138 | if (intel_sdvo->color_range_auto) { |
1156 | if (intel_sdvo->color_range_auto) { |
1139 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ |
1157 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ |
1140 | /* FIXME: This bit is only valid when using TMDS encoding and 8 |
1158 | /* FIXME: This bit is only valid when using TMDS encoding and 8 |
Line 1215... | Line 1233... | ||
1215 | 1233 | ||
1216 | if (intel_sdvo->is_tv && |
1234 | if (intel_sdvo->is_tv && |
1217 | !intel_sdvo_set_tv_format(intel_sdvo)) |
1235 | !intel_sdvo_set_tv_format(intel_sdvo)) |
Line 1218... | Line -... | ||
1218 | return; |
- | |
1219 | - | ||
1220 | /* We have tried to get input timing in mode_fixup, and filled into |
- | |
1221 | * adjusted_mode. |
1236 | return; |
1222 | */ |
- | |
Line 1223... | Line 1237... | ||
1223 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); |
1237 | |
1224 | input_dtd.part1.clock /= crtc->config.pixel_multiplier; |
1238 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); |
1225 | 1239 | ||
1226 | if (intel_sdvo->is_tv || intel_sdvo->is_lvds) |
1240 | if (intel_sdvo->is_tv || intel_sdvo->is_lvds) |
Line 1328... | Line 1342... | ||
1328 | struct drm_device *dev = encoder->base.dev; |
1342 | struct drm_device *dev = encoder->base.dev; |
1329 | struct drm_i915_private *dev_priv = dev->dev_private; |
1343 | struct drm_i915_private *dev_priv = dev->dev_private; |
1330 | struct intel_sdvo *intel_sdvo = to_sdvo(encoder); |
1344 | struct intel_sdvo *intel_sdvo = to_sdvo(encoder); |
1331 | struct intel_sdvo_dtd dtd; |
1345 | struct intel_sdvo_dtd dtd; |
1332 | int encoder_pixel_multiplier = 0; |
1346 | int encoder_pixel_multiplier = 0; |
- | 1347 | int dotclock; |
|
1333 | u32 flags = 0, sdvox; |
1348 | u32 flags = 0, sdvox; |
1334 | u8 val; |
1349 | u8 val; |
1335 | bool ret; |
1350 | bool ret; |
Line 1336... | Line 1351... | ||
1336 | 1351 | ||
Line 1366... | Line 1381... | ||
1366 | pipe_config->pixel_multiplier = |
1381 | pipe_config->pixel_multiplier = |
1367 | ((sdvox & SDVO_PORT_MULTIPLY_MASK) |
1382 | ((sdvox & SDVO_PORT_MULTIPLY_MASK) |
1368 | >> SDVO_PORT_MULTIPLY_SHIFT) + 1; |
1383 | >> SDVO_PORT_MULTIPLY_SHIFT) + 1; |
1369 | } |
1384 | } |
Line -... | Line 1385... | ||
- | 1385 | ||
- | 1386 | dotclock = pipe_config->port_clock / pipe_config->pixel_multiplier; |
|
- | 1387 | ||
- | 1388 | if (HAS_PCH_SPLIT(dev)) |
|
- | 1389 | ironlake_check_encoder_dotclock(pipe_config, dotclock); |
|
- | 1390 | ||
- | 1391 | pipe_config->adjusted_mode.crtc_clock = dotclock; |
|
1370 | 1392 | ||
1371 | /* Cross check the port pixel multiplier with the sdvo encoder state. */ |
1393 | /* Cross check the port pixel multiplier with the sdvo encoder state. */ |
1372 | if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, |
1394 | if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, |
1373 | &val, 1)) { |
1395 | &val, 1)) { |
1374 | switch (val) { |
1396 | switch (val) { |
Line 1512... | Line 1534... | ||
1512 | } |
1534 | } |
Line 1513... | Line 1535... | ||
1513 | 1535 | ||
1514 | intel_modeset_check_state(connector->dev); |
1536 | intel_modeset_check_state(connector->dev); |
Line -... | Line 1537... | ||
- | 1537 | } |
|
1515 | } |
1538 | |
1516 | 1539 | static enum drm_mode_status |
|
1517 | static int intel_sdvo_mode_valid(struct drm_connector *connector, |
1540 | intel_sdvo_mode_valid(struct drm_connector *connector, |
1518 | struct drm_display_mode *mode) |
1541 | struct drm_display_mode *mode) |
Line 1519... | Line 1542... | ||
1519 | { |
1542 | { |
Line 1768... | Line 1791... | ||
1768 | 1791 | ||
1769 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) |
1792 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) |
1770 | { |
1793 | { |
Line -... | Line 1794... | ||
- | 1794 | struct edid *edid; |
|
- | 1795 | ||
- | 1796 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
|
1771 | struct edid *edid; |
1797 | connector->base.id, drm_get_connector_name(connector)); |
1772 | 1798 | ||
Line 1773... | Line 1799... | ||
1773 | /* set the bus switch and get the modes */ |
1799 | /* set the bus switch and get the modes */ |
1774 | edid = intel_sdvo_get_edid(connector); |
1800 | edid = intel_sdvo_get_edid(connector); |
Line 1863... | Line 1889... | ||
1863 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1889 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1864 | struct intel_sdvo_sdtv_resolution_request tv_res; |
1890 | struct intel_sdvo_sdtv_resolution_request tv_res; |
1865 | uint32_t reply = 0, format_map = 0; |
1891 | uint32_t reply = 0, format_map = 0; |
1866 | int i; |
1892 | int i; |
Line -... | Line 1893... | ||
- | 1893 | ||
- | 1894 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
|
- | 1895 | connector->base.id, drm_get_connector_name(connector)); |
|
1867 | 1896 | ||
1868 | /* Read the list of supported input resolutions for the selected TV |
1897 | /* Read the list of supported input resolutions for the selected TV |
1869 | * format. |
1898 | * format. |
1870 | */ |
1899 | */ |
1871 | format_map = 1 << intel_sdvo->tv_format_index; |
1900 | format_map = 1 << intel_sdvo->tv_format_index; |
Line 1897... | Line 1926... | ||
1897 | { |
1926 | { |
1898 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1927 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1899 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
1928 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
1900 | struct drm_display_mode *newmode; |
1929 | struct drm_display_mode *newmode; |
Line -... | Line 1930... | ||
- | 1930 | ||
- | 1931 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
|
- | 1932 | connector->base.id, drm_get_connector_name(connector)); |
|
1901 | 1933 | ||
1902 | /* |
1934 | /* |
1903 | * Fetch modes from VBT. For SDVO prefer the VBT mode since some |
1935 | * Fetch modes from VBT. For SDVO prefer the VBT mode since some |
1904 | * SDVO->LVDS transcoders can't cope with the EDID mode. |
1936 | * SDVO->LVDS transcoders can't cope with the EDID mode. |
1905 | */ |
1937 | */ |
Line 1928... | Line 1960... | ||
1928 | 1960 | ||
1929 | intel_sdvo->is_lvds = true; |
1961 | intel_sdvo->is_lvds = true; |
1930 | break; |
1962 | break; |
1931 | } |
1963 | } |
1932 | } |
- | |
1933 | 1964 | } |
|
Line 1934... | Line 1965... | ||
1934 | } |
1965 | } |
1935 | 1966 | ||
1936 | static int intel_sdvo_get_modes(struct drm_connector *connector) |
1967 | static int intel_sdvo_get_modes(struct drm_connector *connector) |
Line 1996... | Line 2027... | ||
1996 | if (intel_sdvo_connector->tv_format) |
2027 | if (intel_sdvo_connector->tv_format) |
1997 | drm_property_destroy(connector->dev, |
2028 | drm_property_destroy(connector->dev, |
1998 | intel_sdvo_connector->tv_format); |
2029 | intel_sdvo_connector->tv_format); |
Line 1999... | Line 2030... | ||
1999 | 2030 | ||
2000 | intel_sdvo_destroy_enhance_property(connector); |
- | |
2001 | drm_sysfs_connector_remove(connector); |
2031 | intel_sdvo_destroy_enhance_property(connector); |
2002 | drm_connector_cleanup(connector); |
2032 | drm_connector_cleanup(connector); |
2003 | kfree(intel_sdvo_connector); |
2033 | kfree(intel_sdvo_connector); |
Line 2004... | Line 2034... | ||
2004 | } |
2034 | } |
Line 2392... | Line 2422... | ||
2392 | struct drm_connector *connector; |
2422 | struct drm_connector *connector; |
2393 | struct intel_encoder *intel_encoder = to_intel_encoder(encoder); |
2423 | struct intel_encoder *intel_encoder = to_intel_encoder(encoder); |
2394 | struct intel_connector *intel_connector; |
2424 | struct intel_connector *intel_connector; |
2395 | struct intel_sdvo_connector *intel_sdvo_connector; |
2425 | struct intel_sdvo_connector *intel_sdvo_connector; |
Line -... | Line 2426... | ||
- | 2426 | ||
- | 2427 | DRM_DEBUG_KMS("initialising DVI device %d\n", device); |
|
2396 | 2428 | ||
2397 | intel_sdvo_connector = kzalloc(sizeof(struct intel_sdvo_connector), GFP_KERNEL); |
2429 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); |
2398 | if (!intel_sdvo_connector) |
2430 | if (!intel_sdvo_connector) |
Line 2399... | Line 2431... | ||
2399 | return false; |
2431 | return false; |
2400 | 2432 | ||
Line 2440... | Line 2472... | ||
2440 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2472 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2441 | struct drm_connector *connector; |
2473 | struct drm_connector *connector; |
2442 | struct intel_connector *intel_connector; |
2474 | struct intel_connector *intel_connector; |
2443 | struct intel_sdvo_connector *intel_sdvo_connector; |
2475 | struct intel_sdvo_connector *intel_sdvo_connector; |
Line -... | Line 2476... | ||
- | 2476 | ||
- | 2477 | DRM_DEBUG_KMS("initialising TV type %d\n", type); |
|
2444 | 2478 | ||
2445 | intel_sdvo_connector = kzalloc(sizeof(struct intel_sdvo_connector), GFP_KERNEL); |
2479 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); |
2446 | if (!intel_sdvo_connector) |
2480 | if (!intel_sdvo_connector) |
Line 2447... | Line 2481... | ||
2447 | return false; |
2481 | return false; |
2448 | 2482 | ||
Line 2465... | Line 2499... | ||
2465 | goto err; |
2499 | goto err; |
Line 2466... | Line 2500... | ||
2466 | 2500 | ||
Line 2467... | Line 2501... | ||
2467 | return true; |
2501 | return true; |
- | 2502 | ||
2468 | 2503 | err: |
|
2469 | err: |
2504 | drm_sysfs_connector_remove(connector); |
2470 | intel_sdvo_destroy(connector); |
2505 | intel_sdvo_destroy(connector); |
Line 2471... | Line 2506... | ||
2471 | return false; |
2506 | return false; |
Line 2477... | Line 2512... | ||
2477 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2512 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2478 | struct drm_connector *connector; |
2513 | struct drm_connector *connector; |
2479 | struct intel_connector *intel_connector; |
2514 | struct intel_connector *intel_connector; |
2480 | struct intel_sdvo_connector *intel_sdvo_connector; |
2515 | struct intel_sdvo_connector *intel_sdvo_connector; |
Line -... | Line 2516... | ||
- | 2516 | ||
- | 2517 | DRM_DEBUG_KMS("initialising analog device %d\n", device); |
|
2481 | 2518 | ||
2482 | intel_sdvo_connector = kzalloc(sizeof(struct intel_sdvo_connector), GFP_KERNEL); |
2519 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); |
2483 | if (!intel_sdvo_connector) |
2520 | if (!intel_sdvo_connector) |
Line 2484... | Line 2521... | ||
2484 | return false; |
2521 | return false; |
2485 | 2522 | ||
Line 2508... | Line 2545... | ||
2508 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2545 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
2509 | struct drm_connector *connector; |
2546 | struct drm_connector *connector; |
2510 | struct intel_connector *intel_connector; |
2547 | struct intel_connector *intel_connector; |
2511 | struct intel_sdvo_connector *intel_sdvo_connector; |
2548 | struct intel_sdvo_connector *intel_sdvo_connector; |
Line -... | Line 2549... | ||
- | 2549 | ||
- | 2550 | DRM_DEBUG_KMS("initialising LVDS device %d\n", device); |
|
2512 | 2551 | ||
2513 | intel_sdvo_connector = kzalloc(sizeof(struct intel_sdvo_connector), GFP_KERNEL); |
2552 | intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL); |
2514 | if (!intel_sdvo_connector) |
2553 | if (!intel_sdvo_connector) |
Line 2515... | Line 2554... | ||
2515 | return false; |
2554 | return false; |
2516 | 2555 | ||
Line 2532... | Line 2571... | ||
2532 | goto err; |
2571 | goto err; |
Line 2533... | Line 2572... | ||
2533 | 2572 | ||
Line 2534... | Line 2573... | ||
2534 | return true; |
2573 | return true; |
- | 2574 | ||
2535 | 2575 | err: |
|
2536 | err: |
2576 | drm_sysfs_connector_remove(connector); |
2537 | intel_sdvo_destroy(connector); |
2577 | intel_sdvo_destroy(connector); |
Line 2538... | Line 2578... | ||
2538 | return false; |
2578 | return false; |
Line 2603... | Line 2643... | ||
2603 | struct drm_device *dev = intel_sdvo->base.base.dev; |
2643 | struct drm_device *dev = intel_sdvo->base.base.dev; |
2604 | struct drm_connector *connector, *tmp; |
2644 | struct drm_connector *connector, *tmp; |
Line 2605... | Line 2645... | ||
2605 | 2645 | ||
2606 | list_for_each_entry_safe(connector, tmp, |
2646 | list_for_each_entry_safe(connector, tmp, |
2607 | &dev->mode_config.connector_list, head) { |
2647 | &dev->mode_config.connector_list, head) { |
- | 2648 | if (intel_attached_encoder(connector) == &intel_sdvo->base) { |
|
2608 | if (intel_attached_encoder(connector) == &intel_sdvo->base) |
2649 | drm_sysfs_connector_remove(connector); |
2609 | intel_sdvo_destroy(connector); |
2650 | intel_sdvo_destroy(connector); |
2610 | } |
2651 | } |
- | 2652 | } |
|
Line 2611... | Line 2653... | ||
2611 | } |
2653 | } |
2612 | 2654 | ||
2613 | static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, |
2655 | static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, |
2614 | struct intel_sdvo_connector *intel_sdvo_connector, |
2656 | struct intel_sdvo_connector *intel_sdvo_connector, |
Line 2874... | Line 2916... | ||
2874 | { |
2916 | { |
2875 | struct drm_i915_private *dev_priv = dev->dev_private; |
2917 | struct drm_i915_private *dev_priv = dev->dev_private; |
2876 | struct intel_encoder *intel_encoder; |
2918 | struct intel_encoder *intel_encoder; |
2877 | struct intel_sdvo *intel_sdvo; |
2919 | struct intel_sdvo *intel_sdvo; |
2878 | int i; |
2920 | int i; |
2879 | intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL); |
2921 | intel_sdvo = kzalloc(sizeof(*intel_sdvo), GFP_KERNEL); |
2880 | if (!intel_sdvo) |
2922 | if (!intel_sdvo) |
2881 | return false; |
2923 | return false; |
Line 2882... | Line 2924... | ||
2882 | 2924 | ||
2883 | intel_sdvo->sdvo_reg = sdvo_reg; |
2925 | intel_sdvo->sdvo_reg = sdvo_reg; |