drm/i915: Rename intel_output to intel_encoder.

The intel_output naming is inherited from the UMS code, which had a
structure of screen -> CRTC -> output. The DRM code has an additional
notion of encoder/connector, so the structure is screen -> CRTC ->
encoder -> connector. This is a useful structure for SDVO encoders
which can support multiple connectors (each of which requires
different programming in the one encoder and could be connected to
different CRTCs), or for DVI-I, where multiple encoders feed into the
connector for whether it's used for digital or analog. Most of our
code is encoder-related, so transition it to talking about encoders
before we start trying to distinguish connectors.

This patch is produced by sed s/intel_output/intel_encoder/ over the
driver.

Signed-off-by: Eric Anholt <eric@anholt.net>

+663 -663
+3 -3
drivers/gpu/drm/i915/i915_irq.c
··· 259 259 260 260 if (mode_config->num_connector) { 261 261 list_for_each_entry(connector, &mode_config->connector_list, head) { 262 - struct intel_output *intel_output = to_intel_output(connector); 262 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 263 263 264 - if (intel_output->hot_plug) 265 - (*intel_output->hot_plug) (intel_output); 264 + if (intel_encoder->hot_plug) 265 + (*intel_encoder->hot_plug) (intel_encoder); 266 266 } 267 267 } 268 268 /* Just fire off a uevent and let userspace tell us what to do */
+34 -34
drivers/gpu/drm/i915/intel_crt.c
··· 246 246 247 247 static bool intel_crt_detect_ddc(struct drm_connector *connector) 248 248 { 249 - struct intel_output *intel_output = to_intel_output(connector); 249 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 250 250 251 251 /* CRT should always be at 0, but check anyway */ 252 - if (intel_output->type != INTEL_OUTPUT_ANALOG) 252 + if (intel_encoder->type != INTEL_OUTPUT_ANALOG) 253 253 return false; 254 254 255 - return intel_ddc_probe(intel_output); 255 + return intel_ddc_probe(intel_encoder); 256 256 } 257 257 258 258 static enum drm_connector_status 259 - intel_crt_load_detect(struct drm_crtc *crtc, struct intel_output *intel_output) 259 + intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder) 260 260 { 261 - struct drm_encoder *encoder = &intel_output->enc; 261 + struct drm_encoder *encoder = &intel_encoder->enc; 262 262 struct drm_device *dev = encoder->dev; 263 263 struct drm_i915_private *dev_priv = dev->dev_private; 264 264 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); ··· 386 386 static enum drm_connector_status intel_crt_detect(struct drm_connector *connector) 387 387 { 388 388 struct drm_device *dev = connector->dev; 389 - struct intel_output *intel_output = to_intel_output(connector); 390 - struct drm_encoder *encoder = &intel_output->enc; 389 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 390 + struct drm_encoder *encoder = &intel_encoder->enc; 391 391 struct drm_crtc *crtc; 392 392 int dpms_mode; 393 393 enum drm_connector_status status; ··· 404 404 405 405 /* for pre-945g platforms use load detect */ 406 406 if (encoder->crtc && encoder->crtc->enabled) { 407 - status = intel_crt_load_detect(encoder->crtc, intel_output); 407 + status = intel_crt_load_detect(encoder->crtc, intel_encoder); 408 408 } else { 409 - crtc = intel_get_load_detect_pipe(intel_output, 409 + crtc = intel_get_load_detect_pipe(intel_encoder, 410 410 NULL, &dpms_mode); 411 411 if (crtc) { 412 - status = intel_crt_load_detect(crtc, intel_output); 413 - intel_release_load_detect_pipe(intel_output, dpms_mode); 412 + status = intel_crt_load_detect(crtc, intel_encoder); 413 + intel_release_load_detect_pipe(intel_encoder, dpms_mode); 414 414 } else 415 415 status = connector_status_unknown; 416 416 } ··· 420 420 421 421 static void intel_crt_destroy(struct drm_connector *connector) 422 422 { 423 - struct intel_output *intel_output = to_intel_output(connector); 423 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 424 424 425 - intel_i2c_destroy(intel_output->ddc_bus); 425 + intel_i2c_destroy(intel_encoder->ddc_bus); 426 426 drm_sysfs_connector_remove(connector); 427 427 drm_connector_cleanup(connector); 428 428 kfree(connector); ··· 431 431 static int intel_crt_get_modes(struct drm_connector *connector) 432 432 { 433 433 int ret; 434 - struct intel_output *intel_output = to_intel_output(connector); 434 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 435 435 struct i2c_adapter *ddcbus; 436 436 struct drm_device *dev = connector->dev; 437 437 438 438 439 - ret = intel_ddc_get_modes(intel_output); 439 + ret = intel_ddc_get_modes(intel_encoder); 440 440 if (ret || !IS_G4X(dev)) 441 441 goto end; 442 442 443 - ddcbus = intel_output->ddc_bus; 443 + ddcbus = intel_encoder->ddc_bus; 444 444 /* Try to probe digital port for output in DVI-I -> VGA mode. */ 445 - intel_output->ddc_bus = 445 + intel_encoder->ddc_bus = 446 446 intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D"); 447 447 448 - if (!intel_output->ddc_bus) { 449 - intel_output->ddc_bus = ddcbus; 448 + if (!intel_encoder->ddc_bus) { 449 + intel_encoder->ddc_bus = ddcbus; 450 450 dev_printk(KERN_ERR, &connector->dev->pdev->dev, 451 451 "DDC bus registration failed for CRTDDC_D.\n"); 452 452 goto end; 453 453 } 454 454 /* Try to get modes by GPIOD port */ 455 - ret = intel_ddc_get_modes(intel_output); 455 + ret = intel_ddc_get_modes(intel_encoder); 456 456 intel_i2c_destroy(ddcbus); 457 457 458 458 end: ··· 505 505 void intel_crt_init(struct drm_device *dev) 506 506 { 507 507 struct drm_connector *connector; 508 - struct intel_output *intel_output; 508 + struct intel_encoder *intel_encoder; 509 509 struct drm_i915_private *dev_priv = dev->dev_private; 510 510 u32 i2c_reg; 511 511 512 - intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); 513 - if (!intel_output) 512 + intel_encoder = kzalloc(sizeof(struct intel_encoder), GFP_KERNEL); 513 + if (!intel_encoder) 514 514 return; 515 515 516 - connector = &intel_output->base; 517 - drm_connector_init(dev, &intel_output->base, 516 + connector = &intel_encoder->base; 517 + drm_connector_init(dev, &intel_encoder->base, 518 518 &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); 519 519 520 - drm_encoder_init(dev, &intel_output->enc, &intel_crt_enc_funcs, 520 + drm_encoder_init(dev, &intel_encoder->enc, &intel_crt_enc_funcs, 521 521 DRM_MODE_ENCODER_DAC); 522 522 523 - drm_mode_connector_attach_encoder(&intel_output->base, 524 - &intel_output->enc); 523 + drm_mode_connector_attach_encoder(&intel_encoder->base, 524 + &intel_encoder->enc); 525 525 526 526 /* Set up the DDC bus. */ 527 527 if (HAS_PCH_SPLIT(dev)) ··· 532 532 if (dev_priv->crt_ddc_bus != 0) 533 533 i2c_reg = dev_priv->crt_ddc_bus; 534 534 } 535 - intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); 536 - if (!intel_output->ddc_bus) { 535 + intel_encoder->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); 536 + if (!intel_encoder->ddc_bus) { 537 537 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " 538 538 "failed.\n"); 539 539 return; 540 540 } 541 541 542 - intel_output->type = INTEL_OUTPUT_ANALOG; 543 - intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 542 + intel_encoder->type = INTEL_OUTPUT_ANALOG; 543 + intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 544 544 (1 << INTEL_ANALOG_CLONE_BIT) | 545 545 (1 << INTEL_SDVO_LVDS_CLONE_BIT); 546 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 546 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 547 547 connector->interlace_allowed = 0; 548 548 connector->doublescan_allowed = 0; 549 549 550 - drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); 550 + drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); 551 551 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); 552 552 553 553 drm_sysfs_connector_add(connector);
+23 -23
drivers/gpu/drm/i915/intel_display.c
··· 746 746 list_for_each_entry(l_entry, &mode_config->connector_list, head) { 747 747 if (l_entry->encoder && 748 748 l_entry->encoder->crtc == crtc) { 749 - struct intel_output *intel_output = to_intel_output(l_entry); 750 - if (intel_output->type == type) 749 + struct intel_encoder *intel_encoder = to_intel_encoder(l_entry); 750 + if (intel_encoder->type == type) 751 751 return true; 752 752 } 753 753 } ··· 2942 2942 drm_vblank_pre_modeset(dev, pipe); 2943 2943 2944 2944 list_for_each_entry(connector, &mode_config->connector_list, head) { 2945 - struct intel_output *intel_output = to_intel_output(connector); 2945 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 2946 2946 2947 2947 if (!connector->encoder || connector->encoder->crtc != crtc) 2948 2948 continue; 2949 2949 2950 - switch (intel_output->type) { 2950 + switch (intel_encoder->type) { 2951 2951 case INTEL_OUTPUT_LVDS: 2952 2952 is_lvds = true; 2953 2953 break; 2954 2954 case INTEL_OUTPUT_SDVO: 2955 2955 case INTEL_OUTPUT_HDMI: 2956 2956 is_sdvo = true; 2957 - if (intel_output->needs_tv_clock) 2957 + if (intel_encoder->needs_tv_clock) 2958 2958 is_tv = true; 2959 2959 break; 2960 2960 case INTEL_OUTPUT_DVO: ··· 3049 3049 struct drm_connector *edp; 3050 3050 target_clock = mode->clock; 3051 3051 edp = intel_pipe_get_output(crtc); 3052 - intel_edp_link_config(to_intel_output(edp), 3052 + intel_edp_link_config(to_intel_encoder(edp), 3053 3053 &lane, &link_bw); 3054 3054 } else { 3055 3055 /* DP over FDI requires target mode clock ··· 3669 3669 704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC), 3670 3670 }; 3671 3671 3672 - struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output, 3672 + struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, 3673 3673 struct drm_display_mode *mode, 3674 3674 int *dpms_mode) 3675 3675 { 3676 3676 struct intel_crtc *intel_crtc; 3677 3677 struct drm_crtc *possible_crtc; 3678 3678 struct drm_crtc *supported_crtc =NULL; 3679 - struct drm_encoder *encoder = &intel_output->enc; 3679 + struct drm_encoder *encoder = &intel_encoder->enc; 3680 3680 struct drm_crtc *crtc = NULL; 3681 3681 struct drm_device *dev = encoder->dev; 3682 3682 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; ··· 3728 3728 } 3729 3729 3730 3730 encoder->crtc = crtc; 3731 - intel_output->base.encoder = encoder; 3732 - intel_output->load_detect_temp = true; 3731 + intel_encoder->base.encoder = encoder; 3732 + intel_encoder->load_detect_temp = true; 3733 3733 3734 3734 intel_crtc = to_intel_crtc(crtc); 3735 3735 *dpms_mode = intel_crtc->dpms_mode; ··· 3754 3754 return crtc; 3755 3755 } 3756 3756 3757 - void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_mode) 3757 + void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpms_mode) 3758 3758 { 3759 - struct drm_encoder *encoder = &intel_output->enc; 3759 + struct drm_encoder *encoder = &intel_encoder->enc; 3760 3760 struct drm_device *dev = encoder->dev; 3761 3761 struct drm_crtc *crtc = encoder->crtc; 3762 3762 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 3763 3763 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 3764 3764 3765 - if (intel_output->load_detect_temp) { 3765 + if (intel_encoder->load_detect_temp) { 3766 3766 encoder->crtc = NULL; 3767 - intel_output->base.encoder = NULL; 3768 - intel_output->load_detect_temp = false; 3767 + intel_encoder->base.encoder = NULL; 3768 + intel_encoder->load_detect_temp = false; 3769 3769 crtc->enabled = drm_helper_crtc_in_use(crtc); 3770 3770 drm_helper_disable_unused_functions(dev); 3771 3771 } ··· 4398 4398 int entry = 0; 4399 4399 4400 4400 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 4401 - struct intel_output *intel_output = to_intel_output(connector); 4402 - if (type_mask & intel_output->clone_mask) 4401 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 4402 + if (type_mask & intel_encoder->clone_mask) 4403 4403 index_mask |= (1 << entry); 4404 4404 entry++; 4405 4405 } ··· 4494 4494 intel_tv_init(dev); 4495 4495 4496 4496 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 4497 - struct intel_output *intel_output = to_intel_output(connector); 4498 - struct drm_encoder *encoder = &intel_output->enc; 4497 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 4498 + struct drm_encoder *encoder = &intel_encoder->enc; 4499 4499 4500 - encoder->possible_crtcs = intel_output->crtc_mask; 4500 + encoder->possible_crtcs = intel_encoder->crtc_mask; 4501 4501 encoder->possible_clones = intel_connector_clones(dev, 4502 - intel_output->clone_mask); 4502 + intel_encoder->clone_mask); 4503 4503 } 4504 4504 } 4505 4505 ··· 4977 4977 */ 4978 4978 struct drm_encoder *intel_best_encoder(struct drm_connector *connector) 4979 4979 { 4980 - struct intel_output *intel_output = to_intel_output(connector); 4980 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 4981 4981 4982 - return &intel_output->enc; 4982 + return &intel_encoder->enc; 4983 4983 } 4984 4984 4985 4985 /*
+128 -128
drivers/gpu/drm/i915/intel_dp.c
··· 54 54 uint8_t link_bw; 55 55 uint8_t lane_count; 56 56 uint8_t dpcd[4]; 57 - struct intel_output *intel_output; 57 + struct intel_encoder *intel_encoder; 58 58 struct i2c_adapter adapter; 59 59 struct i2c_algo_dp_aux_data algo; 60 60 }; 61 61 62 62 static void 63 - intel_dp_link_train(struct intel_output *intel_output, uint32_t DP, 63 + intel_dp_link_train(struct intel_encoder *intel_encoder, uint32_t DP, 64 64 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]); 65 65 66 66 static void 67 - intel_dp_link_down(struct intel_output *intel_output, uint32_t DP); 67 + intel_dp_link_down(struct intel_encoder *intel_encoder, uint32_t DP); 68 68 69 69 void 70 - intel_edp_link_config (struct intel_output *intel_output, 70 + intel_edp_link_config (struct intel_encoder *intel_encoder, 71 71 int *lane_num, int *link_bw) 72 72 { 73 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 73 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 74 74 75 75 *lane_num = dp_priv->lane_count; 76 76 if (dp_priv->link_bw == DP_LINK_BW_1_62) ··· 80 80 } 81 81 82 82 static int 83 - intel_dp_max_lane_count(struct intel_output *intel_output) 83 + intel_dp_max_lane_count(struct intel_encoder *intel_encoder) 84 84 { 85 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 85 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 86 86 int max_lane_count = 4; 87 87 88 88 if (dp_priv->dpcd[0] >= 0x11) { ··· 98 98 } 99 99 100 100 static int 101 - intel_dp_max_link_bw(struct intel_output *intel_output) 101 + intel_dp_max_link_bw(struct intel_encoder *intel_encoder) 102 102 { 103 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 103 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 104 104 int max_link_bw = dp_priv->dpcd[1]; 105 105 106 106 switch (max_link_bw) { ··· 126 126 /* I think this is a fiction */ 127 127 static int 128 128 intel_dp_link_required(struct drm_device *dev, 129 - struct intel_output *intel_output, int pixel_clock) 129 + struct intel_encoder *intel_encoder, int pixel_clock) 130 130 { 131 131 struct drm_i915_private *dev_priv = dev->dev_private; 132 132 133 - if (IS_eDP(intel_output)) 133 + if (IS_eDP(intel_encoder)) 134 134 return (pixel_clock * dev_priv->edp_bpp) / 8; 135 135 else 136 136 return pixel_clock * 3; ··· 140 140 intel_dp_mode_valid(struct drm_connector *connector, 141 141 struct drm_display_mode *mode) 142 142 { 143 - struct intel_output *intel_output = to_intel_output(connector); 144 - int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output)); 145 - int max_lanes = intel_dp_max_lane_count(intel_output); 143 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 144 + int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_encoder)); 145 + int max_lanes = intel_dp_max_lane_count(intel_encoder); 146 146 147 - if (intel_dp_link_required(connector->dev, intel_output, mode->clock) 147 + if (intel_dp_link_required(connector->dev, intel_encoder, mode->clock) 148 148 > max_link_clock * max_lanes) 149 149 return MODE_CLOCK_HIGH; 150 150 ··· 208 208 } 209 209 210 210 static int 211 - intel_dp_aux_ch(struct intel_output *intel_output, 211 + intel_dp_aux_ch(struct intel_encoder *intel_encoder, 212 212 uint8_t *send, int send_bytes, 213 213 uint8_t *recv, int recv_size) 214 214 { 215 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 215 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 216 216 uint32_t output_reg = dp_priv->output_reg; 217 - struct drm_device *dev = intel_output->base.dev; 217 + struct drm_device *dev = intel_encoder->base.dev; 218 218 struct drm_i915_private *dev_priv = dev->dev_private; 219 219 uint32_t ch_ctl = output_reg + 0x10; 220 220 uint32_t ch_data = ch_ctl + 4; ··· 229 229 * and would like to run at 2MHz. So, take the 230 230 * hrawclk value and divide by 2 and use that 231 231 */ 232 - if (IS_eDP(intel_output)) 232 + if (IS_eDP(intel_encoder)) 233 233 aux_clock_divider = 225; /* eDP input clock at 450Mhz */ 234 234 else if (HAS_PCH_SPLIT(dev)) 235 235 aux_clock_divider = 62; /* IRL input clock fixed at 125Mhz */ ··· 312 312 313 313 /* Write data to the aux channel in native mode */ 314 314 static int 315 - intel_dp_aux_native_write(struct intel_output *intel_output, 315 + intel_dp_aux_native_write(struct intel_encoder *intel_encoder, 316 316 uint16_t address, uint8_t *send, int send_bytes) 317 317 { 318 318 int ret; ··· 329 329 memcpy(&msg[4], send, send_bytes); 330 330 msg_bytes = send_bytes + 4; 331 331 for (;;) { 332 - ret = intel_dp_aux_ch(intel_output, msg, msg_bytes, &ack, 1); 332 + ret = intel_dp_aux_ch(intel_encoder, msg, msg_bytes, &ack, 1); 333 333 if (ret < 0) 334 334 return ret; 335 335 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) ··· 344 344 345 345 /* Write a single byte to the aux channel in native mode */ 346 346 static int 347 - intel_dp_aux_native_write_1(struct intel_output *intel_output, 347 + intel_dp_aux_native_write_1(struct intel_encoder *intel_encoder, 348 348 uint16_t address, uint8_t byte) 349 349 { 350 - return intel_dp_aux_native_write(intel_output, address, &byte, 1); 350 + return intel_dp_aux_native_write(intel_encoder, address, &byte, 1); 351 351 } 352 352 353 353 /* read bytes from a native aux channel */ 354 354 static int 355 - intel_dp_aux_native_read(struct intel_output *intel_output, 355 + intel_dp_aux_native_read(struct intel_encoder *intel_encoder, 356 356 uint16_t address, uint8_t *recv, int recv_bytes) 357 357 { 358 358 uint8_t msg[4]; ··· 371 371 reply_bytes = recv_bytes + 1; 372 372 373 373 for (;;) { 374 - ret = intel_dp_aux_ch(intel_output, msg, msg_bytes, 374 + ret = intel_dp_aux_ch(intel_encoder, msg, msg_bytes, 375 375 reply, reply_bytes); 376 376 if (ret == 0) 377 377 return -EPROTO; ··· 397 397 struct intel_dp_priv *dp_priv = container_of(adapter, 398 398 struct intel_dp_priv, 399 399 adapter); 400 - struct intel_output *intel_output = dp_priv->intel_output; 400 + struct intel_encoder *intel_encoder = dp_priv->intel_encoder; 401 401 uint16_t address = algo_data->address; 402 402 uint8_t msg[5]; 403 403 uint8_t reply[2]; ··· 436 436 } 437 437 438 438 for (;;) { 439 - ret = intel_dp_aux_ch(intel_output, 439 + ret = intel_dp_aux_ch(intel_encoder, 440 440 msg, msg_bytes, 441 441 reply, reply_bytes); 442 442 if (ret < 0) { ··· 464 464 } 465 465 466 466 static int 467 - intel_dp_i2c_init(struct intel_output *intel_output, const char *name) 467 + intel_dp_i2c_init(struct intel_encoder *intel_encoder, const char *name) 468 468 { 469 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 469 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 470 470 471 471 DRM_DEBUG_KMS("i2c_init %s\n", name); 472 472 dp_priv->algo.running = false; ··· 479 479 strncpy (dp_priv->adapter.name, name, sizeof(dp_priv->adapter.name) - 1); 480 480 dp_priv->adapter.name[sizeof(dp_priv->adapter.name) - 1] = '\0'; 481 481 dp_priv->adapter.algo_data = &dp_priv->algo; 482 - dp_priv->adapter.dev.parent = &intel_output->base.kdev; 482 + dp_priv->adapter.dev.parent = &intel_encoder->base.kdev; 483 483 484 484 return i2c_dp_aux_add_bus(&dp_priv->adapter); 485 485 } ··· 488 488 intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, 489 489 struct drm_display_mode *adjusted_mode) 490 490 { 491 - struct intel_output *intel_output = enc_to_intel_output(encoder); 492 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 491 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 492 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 493 493 int lane_count, clock; 494 - int max_lane_count = intel_dp_max_lane_count(intel_output); 495 - int max_clock = intel_dp_max_link_bw(intel_output) == DP_LINK_BW_2_7 ? 1 : 0; 494 + int max_lane_count = intel_dp_max_lane_count(intel_encoder); 495 + int max_clock = intel_dp_max_link_bw(intel_encoder) == DP_LINK_BW_2_7 ? 1 : 0; 496 496 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 }; 497 497 498 498 for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { 499 499 for (clock = 0; clock <= max_clock; clock++) { 500 500 int link_avail = intel_dp_link_clock(bws[clock]) * lane_count; 501 501 502 - if (intel_dp_link_required(encoder->dev, intel_output, mode->clock) 502 + if (intel_dp_link_required(encoder->dev, intel_encoder, mode->clock) 503 503 <= link_avail) { 504 504 dp_priv->link_bw = bws[clock]; 505 505 dp_priv->lane_count = lane_count; ··· 561 561 struct intel_dp_m_n m_n; 562 562 563 563 /* 564 - * Find the lane count in the intel_output private 564 + * Find the lane count in the intel_encoder private 565 565 */ 566 566 list_for_each_entry(connector, &mode_config->connector_list, head) { 567 - struct intel_output *intel_output = to_intel_output(connector); 568 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 567 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 568 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 569 569 570 570 if (!connector->encoder || connector->encoder->crtc != crtc) 571 571 continue; 572 572 573 - if (intel_output->type == INTEL_OUTPUT_DISPLAYPORT) { 573 + if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT) { 574 574 lane_count = dp_priv->lane_count; 575 575 break; 576 576 } ··· 625 625 intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, 626 626 struct drm_display_mode *adjusted_mode) 627 627 { 628 - struct intel_output *intel_output = enc_to_intel_output(encoder); 629 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 630 - struct drm_crtc *crtc = intel_output->enc.crtc; 628 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 629 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 630 + struct drm_crtc *crtc = intel_encoder->enc.crtc; 631 631 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 632 632 633 633 dp_priv->DP = (DP_LINK_TRAIN_OFF | ··· 666 666 if (intel_crtc->pipe == 1) 667 667 dp_priv->DP |= DP_PIPEB_SELECT; 668 668 669 - if (IS_eDP(intel_output)) { 669 + if (IS_eDP(intel_encoder)) { 670 670 /* don't miss out required setting for eDP */ 671 671 dp_priv->DP |= DP_PLL_ENABLE; 672 672 if (adjusted_mode->clock < 200000) ··· 701 701 static void 702 702 intel_dp_dpms(struct drm_encoder *encoder, int mode) 703 703 { 704 - struct intel_output *intel_output = enc_to_intel_output(encoder); 705 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 706 - struct drm_device *dev = intel_output->base.dev; 704 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 705 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 706 + struct drm_device *dev = intel_encoder->base.dev; 707 707 struct drm_i915_private *dev_priv = dev->dev_private; 708 708 uint32_t dp_reg = I915_READ(dp_priv->output_reg); 709 709 710 710 if (mode != DRM_MODE_DPMS_ON) { 711 711 if (dp_reg & DP_PORT_EN) { 712 - intel_dp_link_down(intel_output, dp_priv->DP); 713 - if (IS_eDP(intel_output)) 712 + intel_dp_link_down(intel_encoder, dp_priv->DP); 713 + if (IS_eDP(intel_encoder)) 714 714 ironlake_edp_backlight_off(dev); 715 715 } 716 716 } else { 717 717 if (!(dp_reg & DP_PORT_EN)) { 718 - intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration); 719 - if (IS_eDP(intel_output)) 718 + intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); 719 + if (IS_eDP(intel_encoder)) 720 720 ironlake_edp_backlight_on(dev); 721 721 } 722 722 } ··· 728 728 * link status information 729 729 */ 730 730 static bool 731 - intel_dp_get_link_status(struct intel_output *intel_output, 731 + intel_dp_get_link_status(struct intel_encoder *intel_encoder, 732 732 uint8_t link_status[DP_LINK_STATUS_SIZE]) 733 733 { 734 734 int ret; 735 735 736 - ret = intel_dp_aux_native_read(intel_output, 736 + ret = intel_dp_aux_native_read(intel_encoder, 737 737 DP_LANE0_1_STATUS, 738 738 link_status, DP_LINK_STATUS_SIZE); 739 739 if (ret != DP_LINK_STATUS_SIZE) ··· 751 751 static void 752 752 intel_dp_save(struct drm_connector *connector) 753 753 { 754 - struct intel_output *intel_output = to_intel_output(connector); 755 - struct drm_device *dev = intel_output->base.dev; 754 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 755 + struct drm_device *dev = intel_encoder->base.dev; 756 756 struct drm_i915_private *dev_priv = dev->dev_private; 757 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 757 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 758 758 759 759 dp_priv->save_DP = I915_READ(dp_priv->output_reg); 760 - intel_dp_aux_native_read(intel_output, DP_LINK_BW_SET, 760 + intel_dp_aux_native_read(intel_encoder, DP_LINK_BW_SET, 761 761 dp_priv->save_link_configuration, 762 762 sizeof (dp_priv->save_link_configuration)); 763 763 } ··· 824 824 } 825 825 826 826 static void 827 - intel_get_adjust_train(struct intel_output *intel_output, 827 + intel_get_adjust_train(struct intel_encoder *intel_encoder, 828 828 uint8_t link_status[DP_LINK_STATUS_SIZE], 829 829 int lane_count, 830 830 uint8_t train_set[4]) ··· 941 941 } 942 942 943 943 static bool 944 - intel_dp_set_link_train(struct intel_output *intel_output, 944 + intel_dp_set_link_train(struct intel_encoder *intel_encoder, 945 945 uint32_t dp_reg_value, 946 946 uint8_t dp_train_pat, 947 947 uint8_t train_set[4], 948 948 bool first) 949 949 { 950 - struct drm_device *dev = intel_output->base.dev; 950 + struct drm_device *dev = intel_encoder->base.dev; 951 951 struct drm_i915_private *dev_priv = dev->dev_private; 952 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 952 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 953 953 int ret; 954 954 955 955 I915_WRITE(dp_priv->output_reg, dp_reg_value); ··· 957 957 if (first) 958 958 intel_wait_for_vblank(dev); 959 959 960 - intel_dp_aux_native_write_1(intel_output, 960 + intel_dp_aux_native_write_1(intel_encoder, 961 961 DP_TRAINING_PATTERN_SET, 962 962 dp_train_pat); 963 963 964 - ret = intel_dp_aux_native_write(intel_output, 964 + ret = intel_dp_aux_native_write(intel_encoder, 965 965 DP_TRAINING_LANE0_SET, train_set, 4); 966 966 if (ret != 4) 967 967 return false; ··· 970 970 } 971 971 972 972 static void 973 - intel_dp_link_train(struct intel_output *intel_output, uint32_t DP, 973 + intel_dp_link_train(struct intel_encoder *intel_encoder, uint32_t DP, 974 974 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]) 975 975 { 976 - struct drm_device *dev = intel_output->base.dev; 976 + struct drm_device *dev = intel_encoder->base.dev; 977 977 struct drm_i915_private *dev_priv = dev->dev_private; 978 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 978 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 979 979 uint8_t train_set[4]; 980 980 uint8_t link_status[DP_LINK_STATUS_SIZE]; 981 981 int i; ··· 986 986 int tries; 987 987 988 988 /* Write the link configuration data */ 989 - intel_dp_aux_native_write(intel_output, 0x100, 989 + intel_dp_aux_native_write(intel_encoder, 0x100, 990 990 link_configuration, DP_LINK_CONFIGURATION_SIZE); 991 991 992 992 DP |= DP_PORT_EN; ··· 1000 1000 uint32_t signal_levels = intel_dp_signal_levels(train_set[0], dp_priv->lane_count); 1001 1001 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; 1002 1002 1003 - if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_1, 1003 + if (!intel_dp_set_link_train(intel_encoder, DP | DP_LINK_TRAIN_PAT_1, 1004 1004 DP_TRAINING_PATTERN_1, train_set, first)) 1005 1005 break; 1006 1006 first = false; 1007 1007 /* Set training pattern 1 */ 1008 1008 1009 1009 udelay(100); 1010 - if (!intel_dp_get_link_status(intel_output, link_status)) 1010 + if (!intel_dp_get_link_status(intel_encoder, link_status)) 1011 1011 break; 1012 1012 1013 1013 if (intel_clock_recovery_ok(link_status, dp_priv->lane_count)) { ··· 1032 1032 voltage = train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; 1033 1033 1034 1034 /* Compute new train_set as requested by target */ 1035 - intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set); 1035 + intel_get_adjust_train(intel_encoder, link_status, dp_priv->lane_count, train_set); 1036 1036 } 1037 1037 1038 1038 /* channel equalization */ ··· 1044 1044 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; 1045 1045 1046 1046 /* channel eq pattern */ 1047 - if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_2, 1047 + if (!intel_dp_set_link_train(intel_encoder, DP | DP_LINK_TRAIN_PAT_2, 1048 1048 DP_TRAINING_PATTERN_2, train_set, 1049 1049 false)) 1050 1050 break; 1051 1051 1052 1052 udelay(400); 1053 - if (!intel_dp_get_link_status(intel_output, link_status)) 1053 + if (!intel_dp_get_link_status(intel_encoder, link_status)) 1054 1054 break; 1055 1055 1056 1056 if (intel_channel_eq_ok(link_status, dp_priv->lane_count)) { ··· 1063 1063 break; 1064 1064 1065 1065 /* Compute new train_set as requested by target */ 1066 - intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set); 1066 + intel_get_adjust_train(intel_encoder, link_status, dp_priv->lane_count, train_set); 1067 1067 ++tries; 1068 1068 } 1069 1069 1070 1070 I915_WRITE(dp_priv->output_reg, DP | DP_LINK_TRAIN_OFF); 1071 1071 POSTING_READ(dp_priv->output_reg); 1072 - intel_dp_aux_native_write_1(intel_output, 1072 + intel_dp_aux_native_write_1(intel_encoder, 1073 1073 DP_TRAINING_PATTERN_SET, DP_TRAINING_PATTERN_DISABLE); 1074 1074 } 1075 1075 1076 1076 static void 1077 - intel_dp_link_down(struct intel_output *intel_output, uint32_t DP) 1077 + intel_dp_link_down(struct intel_encoder *intel_encoder, uint32_t DP) 1078 1078 { 1079 - struct drm_device *dev = intel_output->base.dev; 1079 + struct drm_device *dev = intel_encoder->base.dev; 1080 1080 struct drm_i915_private *dev_priv = dev->dev_private; 1081 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1081 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1082 1082 1083 1083 DRM_DEBUG_KMS("\n"); 1084 1084 1085 - if (IS_eDP(intel_output)) { 1085 + if (IS_eDP(intel_encoder)) { 1086 1086 DP &= ~DP_PLL_ENABLE; 1087 1087 I915_WRITE(dp_priv->output_reg, DP); 1088 1088 POSTING_READ(dp_priv->output_reg); ··· 1095 1095 1096 1096 udelay(17000); 1097 1097 1098 - if (IS_eDP(intel_output)) 1098 + if (IS_eDP(intel_encoder)) 1099 1099 DP |= DP_LINK_TRAIN_OFF; 1100 1100 I915_WRITE(dp_priv->output_reg, DP & ~DP_PORT_EN); 1101 1101 POSTING_READ(dp_priv->output_reg); ··· 1104 1104 static void 1105 1105 intel_dp_restore(struct drm_connector *connector) 1106 1106 { 1107 - struct intel_output *intel_output = to_intel_output(connector); 1108 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1107 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1108 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1109 1109 1110 1110 if (dp_priv->save_DP & DP_PORT_EN) 1111 - intel_dp_link_train(intel_output, dp_priv->save_DP, dp_priv->save_link_configuration); 1111 + intel_dp_link_train(intel_encoder, dp_priv->save_DP, dp_priv->save_link_configuration); 1112 1112 else 1113 - intel_dp_link_down(intel_output, dp_priv->save_DP); 1113 + intel_dp_link_down(intel_encoder, dp_priv->save_DP); 1114 1114 } 1115 1115 1116 1116 /* ··· 1123 1123 */ 1124 1124 1125 1125 static void 1126 - intel_dp_check_link_status(struct intel_output *intel_output) 1126 + intel_dp_check_link_status(struct intel_encoder *intel_encoder) 1127 1127 { 1128 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1128 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1129 1129 uint8_t link_status[DP_LINK_STATUS_SIZE]; 1130 1130 1131 - if (!intel_output->enc.crtc) 1131 + if (!intel_encoder->enc.crtc) 1132 1132 return; 1133 1133 1134 - if (!intel_dp_get_link_status(intel_output, link_status)) { 1135 - intel_dp_link_down(intel_output, dp_priv->DP); 1134 + if (!intel_dp_get_link_status(intel_encoder, link_status)) { 1135 + intel_dp_link_down(intel_encoder, dp_priv->DP); 1136 1136 return; 1137 1137 } 1138 1138 1139 1139 if (!intel_channel_eq_ok(link_status, dp_priv->lane_count)) 1140 - intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration); 1140 + intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); 1141 1141 } 1142 1142 1143 1143 static enum drm_connector_status 1144 1144 ironlake_dp_detect(struct drm_connector *connector) 1145 1145 { 1146 - struct intel_output *intel_output = to_intel_output(connector); 1147 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1146 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1147 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1148 1148 enum drm_connector_status status; 1149 1149 1150 1150 status = connector_status_disconnected; 1151 - if (intel_dp_aux_native_read(intel_output, 1151 + if (intel_dp_aux_native_read(intel_encoder, 1152 1152 0x000, dp_priv->dpcd, 1153 1153 sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd)) 1154 1154 { ··· 1167 1167 static enum drm_connector_status 1168 1168 intel_dp_detect(struct drm_connector *connector) 1169 1169 { 1170 - struct intel_output *intel_output = to_intel_output(connector); 1171 - struct drm_device *dev = intel_output->base.dev; 1170 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1171 + struct drm_device *dev = intel_encoder->base.dev; 1172 1172 struct drm_i915_private *dev_priv = dev->dev_private; 1173 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1173 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1174 1174 uint32_t temp, bit; 1175 1175 enum drm_connector_status status; 1176 1176 ··· 1209 1209 return connector_status_disconnected; 1210 1210 1211 1211 status = connector_status_disconnected; 1212 - if (intel_dp_aux_native_read(intel_output, 1212 + if (intel_dp_aux_native_read(intel_encoder, 1213 1213 0x000, dp_priv->dpcd, 1214 1214 sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd)) 1215 1215 { ··· 1221 1221 1222 1222 static int intel_dp_get_modes(struct drm_connector *connector) 1223 1223 { 1224 - struct intel_output *intel_output = to_intel_output(connector); 1225 - struct drm_device *dev = intel_output->base.dev; 1224 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1225 + struct drm_device *dev = intel_encoder->base.dev; 1226 1226 struct drm_i915_private *dev_priv = dev->dev_private; 1227 1227 int ret; 1228 1228 1229 1229 /* We should parse the EDID data and find out if it has an audio sink 1230 1230 */ 1231 1231 1232 - ret = intel_ddc_get_modes(intel_output); 1232 + ret = intel_ddc_get_modes(intel_encoder); 1233 1233 if (ret) 1234 1234 return ret; 1235 1235 1236 1236 /* if eDP has no EDID, try to use fixed panel mode from VBT */ 1237 - if (IS_eDP(intel_output)) { 1237 + if (IS_eDP(intel_encoder)) { 1238 1238 if (dev_priv->panel_fixed_mode != NULL) { 1239 1239 struct drm_display_mode *mode; 1240 1240 mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode); ··· 1248 1248 static void 1249 1249 intel_dp_destroy (struct drm_connector *connector) 1250 1250 { 1251 - struct intel_output *intel_output = to_intel_output(connector); 1251 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1252 1252 1253 - if (intel_output->i2c_bus) 1254 - intel_i2c_destroy(intel_output->i2c_bus); 1253 + if (intel_encoder->i2c_bus) 1254 + intel_i2c_destroy(intel_encoder->i2c_bus); 1255 1255 drm_sysfs_connector_remove(connector); 1256 1256 drm_connector_cleanup(connector); 1257 - kfree(intel_output); 1257 + kfree(intel_encoder); 1258 1258 } 1259 1259 1260 1260 static const struct drm_encoder_helper_funcs intel_dp_helper_funcs = { ··· 1290 1290 }; 1291 1291 1292 1292 void 1293 - intel_dp_hot_plug(struct intel_output *intel_output) 1293 + intel_dp_hot_plug(struct intel_encoder *intel_encoder) 1294 1294 { 1295 - struct intel_dp_priv *dp_priv = intel_output->dev_priv; 1295 + struct intel_dp_priv *dp_priv = intel_encoder->dev_priv; 1296 1296 1297 1297 if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) 1298 - intel_dp_check_link_status(intel_output); 1298 + intel_dp_check_link_status(intel_encoder); 1299 1299 } 1300 1300 1301 1301 void ··· 1303 1303 { 1304 1304 struct drm_i915_private *dev_priv = dev->dev_private; 1305 1305 struct drm_connector *connector; 1306 - struct intel_output *intel_output; 1306 + struct intel_encoder *intel_encoder; 1307 1307 struct intel_dp_priv *dp_priv; 1308 1308 const char *name = NULL; 1309 1309 1310 - intel_output = kcalloc(sizeof(struct intel_output) + 1310 + intel_encoder = kcalloc(sizeof(struct intel_encoder) + 1311 1311 sizeof(struct intel_dp_priv), 1, GFP_KERNEL); 1312 - if (!intel_output) 1312 + if (!intel_encoder) 1313 1313 return; 1314 1314 1315 - dp_priv = (struct intel_dp_priv *)(intel_output + 1); 1315 + dp_priv = (struct intel_dp_priv *)(intel_encoder + 1); 1316 1316 1317 - connector = &intel_output->base; 1317 + connector = &intel_encoder->base; 1318 1318 drm_connector_init(dev, connector, &intel_dp_connector_funcs, 1319 1319 DRM_MODE_CONNECTOR_DisplayPort); 1320 1320 drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs); 1321 1321 1322 1322 if (output_reg == DP_A) 1323 - intel_output->type = INTEL_OUTPUT_EDP; 1323 + intel_encoder->type = INTEL_OUTPUT_EDP; 1324 1324 else 1325 - intel_output->type = INTEL_OUTPUT_DISPLAYPORT; 1325 + intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; 1326 1326 1327 1327 if (output_reg == DP_B || output_reg == PCH_DP_B) 1328 - intel_output->clone_mask = (1 << INTEL_DP_B_CLONE_BIT); 1328 + intel_encoder->clone_mask = (1 << INTEL_DP_B_CLONE_BIT); 1329 1329 else if (output_reg == DP_C || output_reg == PCH_DP_C) 1330 - intel_output->clone_mask = (1 << INTEL_DP_C_CLONE_BIT); 1330 + intel_encoder->clone_mask = (1 << INTEL_DP_C_CLONE_BIT); 1331 1331 else if (output_reg == DP_D || output_reg == PCH_DP_D) 1332 - intel_output->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); 1332 + intel_encoder->clone_mask = (1 << INTEL_DP_D_CLONE_BIT); 1333 1333 1334 - if (IS_eDP(intel_output)) 1335 - intel_output->clone_mask = (1 << INTEL_EDP_CLONE_BIT); 1334 + if (IS_eDP(intel_encoder)) 1335 + intel_encoder->clone_mask = (1 << INTEL_EDP_CLONE_BIT); 1336 1336 1337 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 1337 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 1338 1338 connector->interlace_allowed = true; 1339 1339 connector->doublescan_allowed = 0; 1340 1340 1341 - dp_priv->intel_output = intel_output; 1341 + dp_priv->intel_encoder = intel_encoder; 1342 1342 dp_priv->output_reg = output_reg; 1343 1343 dp_priv->has_audio = false; 1344 1344 dp_priv->dpms_mode = DRM_MODE_DPMS_ON; 1345 - intel_output->dev_priv = dp_priv; 1345 + intel_encoder->dev_priv = dp_priv; 1346 1346 1347 - drm_encoder_init(dev, &intel_output->enc, &intel_dp_enc_funcs, 1347 + drm_encoder_init(dev, &intel_encoder->enc, &intel_dp_enc_funcs, 1348 1348 DRM_MODE_ENCODER_TMDS); 1349 - drm_encoder_helper_add(&intel_output->enc, &intel_dp_helper_funcs); 1349 + drm_encoder_helper_add(&intel_encoder->enc, &intel_dp_helper_funcs); 1350 1350 1351 - drm_mode_connector_attach_encoder(&intel_output->base, 1352 - &intel_output->enc); 1351 + drm_mode_connector_attach_encoder(&intel_encoder->base, 1352 + &intel_encoder->enc); 1353 1353 drm_sysfs_connector_add(connector); 1354 1354 1355 1355 /* Set up the DDC bus. */ ··· 1377 1377 break; 1378 1378 } 1379 1379 1380 - intel_dp_i2c_init(intel_output, name); 1380 + intel_dp_i2c_init(intel_encoder, name); 1381 1381 1382 - intel_output->ddc_bus = &dp_priv->adapter; 1383 - intel_output->hot_plug = intel_dp_hot_plug; 1382 + intel_encoder->ddc_bus = &dp_priv->adapter; 1383 + intel_encoder->hot_plug = intel_dp_hot_plug; 1384 1384 1385 1385 if (output_reg == DP_A) { 1386 1386 /* initialize panel mode from VBT if available for eDP */
+9 -9
drivers/gpu/drm/i915/intel_drv.h
··· 95 95 }; 96 96 97 97 98 - struct intel_output { 98 + struct intel_encoder { 99 99 struct drm_connector base; 100 100 101 101 struct drm_encoder enc; ··· 105 105 bool load_detect_temp; 106 106 bool needs_tv_clock; 107 107 void *dev_priv; 108 - void (*hot_plug)(struct intel_output *); 108 + void (*hot_plug)(struct intel_encoder *); 109 109 int crtc_mask; 110 110 int clone_mask; 111 111 }; ··· 152 152 }; 153 153 154 154 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) 155 - #define to_intel_output(x) container_of(x, struct intel_output, base) 156 - #define enc_to_intel_output(x) container_of(x, struct intel_output, enc) 155 + #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) 156 + #define enc_to_intel_encoder(x) container_of(x, struct intel_encoder, enc) 157 157 #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) 158 158 159 159 struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg, 160 160 const char *name); 161 161 void intel_i2c_destroy(struct i2c_adapter *adapter); 162 - int intel_ddc_get_modes(struct intel_output *intel_output); 163 - extern bool intel_ddc_probe(struct intel_output *intel_output); 162 + int intel_ddc_get_modes(struct intel_encoder *intel_encoder); 163 + extern bool intel_ddc_probe(struct intel_encoder *intel_encoder); 164 164 void intel_i2c_quirk_set(struct drm_device *dev, bool enable); 165 165 void intel_i2c_reset_gmbus(struct drm_device *dev); 166 166 ··· 175 175 void 176 176 intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, 177 177 struct drm_display_mode *adjusted_mode); 178 - extern void intel_edp_link_config (struct intel_output *, int *, int *); 178 + extern void intel_edp_link_config (struct intel_encoder *, int *, int *); 179 179 180 180 181 181 extern int intel_panel_fitter_pipe (struct drm_device *dev); ··· 191 191 struct drm_file *file_priv); 192 192 extern void intel_wait_for_vblank(struct drm_device *dev); 193 193 extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); 194 - extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output, 194 + extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, 195 195 struct drm_display_mode *mode, 196 196 int *dpms_mode); 197 - extern void intel_release_load_detect_pipe(struct intel_output *intel_output, 197 + extern void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, 198 198 int dpms_mode); 199 199 200 200 extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB);
+46 -46
drivers/gpu/drm/i915/intel_dvo.c
··· 79 79 static void intel_dvo_dpms(struct drm_encoder *encoder, int mode) 80 80 { 81 81 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 82 - struct intel_output *intel_output = enc_to_intel_output(encoder); 83 - struct intel_dvo_device *dvo = intel_output->dev_priv; 82 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 83 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 84 84 u32 dvo_reg = dvo->dvo_reg; 85 85 u32 temp = I915_READ(dvo_reg); 86 86 ··· 98 98 static void intel_dvo_save(struct drm_connector *connector) 99 99 { 100 100 struct drm_i915_private *dev_priv = connector->dev->dev_private; 101 - struct intel_output *intel_output = to_intel_output(connector); 102 - struct intel_dvo_device *dvo = intel_output->dev_priv; 101 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 102 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 103 103 104 104 /* Each output should probably just save the registers it touches, 105 105 * but for now, use more overkill. ··· 114 114 static void intel_dvo_restore(struct drm_connector *connector) 115 115 { 116 116 struct drm_i915_private *dev_priv = connector->dev->dev_private; 117 - struct intel_output *intel_output = to_intel_output(connector); 118 - struct intel_dvo_device *dvo = intel_output->dev_priv; 117 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 118 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 119 119 120 120 dvo->dev_ops->restore(dvo); 121 121 ··· 127 127 static int intel_dvo_mode_valid(struct drm_connector *connector, 128 128 struct drm_display_mode *mode) 129 129 { 130 - struct intel_output *intel_output = to_intel_output(connector); 131 - struct intel_dvo_device *dvo = intel_output->dev_priv; 130 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 131 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 132 132 133 133 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) 134 134 return MODE_NO_DBLESCAN; ··· 149 149 struct drm_display_mode *mode, 150 150 struct drm_display_mode *adjusted_mode) 151 151 { 152 - struct intel_output *intel_output = enc_to_intel_output(encoder); 153 - struct intel_dvo_device *dvo = intel_output->dev_priv; 152 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 153 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 154 154 155 155 /* If we have timings from the BIOS for the panel, put them in 156 156 * to the adjusted mode. The CRTC will be set up for this mode, ··· 185 185 struct drm_device *dev = encoder->dev; 186 186 struct drm_i915_private *dev_priv = dev->dev_private; 187 187 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 188 - struct intel_output *intel_output = enc_to_intel_output(encoder); 189 - struct intel_dvo_device *dvo = intel_output->dev_priv; 188 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 189 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 190 190 int pipe = intel_crtc->pipe; 191 191 u32 dvo_val; 192 192 u32 dvo_reg = dvo->dvo_reg, dvo_srcdim_reg; ··· 240 240 */ 241 241 static enum drm_connector_status intel_dvo_detect(struct drm_connector *connector) 242 242 { 243 - struct intel_output *intel_output = to_intel_output(connector); 244 - struct intel_dvo_device *dvo = intel_output->dev_priv; 243 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 244 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 245 245 246 246 return dvo->dev_ops->detect(dvo); 247 247 } 248 248 249 249 static int intel_dvo_get_modes(struct drm_connector *connector) 250 250 { 251 - struct intel_output *intel_output = to_intel_output(connector); 252 - struct intel_dvo_device *dvo = intel_output->dev_priv; 251 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 252 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 253 253 254 254 /* We should probably have an i2c driver get_modes function for those 255 255 * devices which will have a fixed set of modes determined by the chip 256 256 * (TV-out, for example), but for now with just TMDS and LVDS, 257 257 * that's not the case. 258 258 */ 259 - intel_ddc_get_modes(intel_output); 259 + intel_ddc_get_modes(intel_encoder); 260 260 if (!list_empty(&connector->probed_modes)) 261 261 return 1; 262 262 ··· 274 274 275 275 static void intel_dvo_destroy (struct drm_connector *connector) 276 276 { 277 - struct intel_output *intel_output = to_intel_output(connector); 278 - struct intel_dvo_device *dvo = intel_output->dev_priv; 277 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 278 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 279 279 280 280 if (dvo) { 281 281 if (dvo->dev_ops->destroy) ··· 285 285 /* no need, in i830_dvoices[] now */ 286 286 //kfree(dvo); 287 287 } 288 - if (intel_output->i2c_bus) 289 - intel_i2c_destroy(intel_output->i2c_bus); 290 - if (intel_output->ddc_bus) 291 - intel_i2c_destroy(intel_output->ddc_bus); 288 + if (intel_encoder->i2c_bus) 289 + intel_i2c_destroy(intel_encoder->i2c_bus); 290 + if (intel_encoder->ddc_bus) 291 + intel_i2c_destroy(intel_encoder->ddc_bus); 292 292 drm_sysfs_connector_remove(connector); 293 293 drm_connector_cleanup(connector); 294 - kfree(intel_output); 294 + kfree(intel_encoder); 295 295 } 296 296 297 297 #ifdef RANDR_GET_CRTC_INTERFACE ··· 299 299 { 300 300 struct drm_device *dev = connector->dev; 301 301 struct drm_i915_private *dev_priv = dev->dev_private; 302 - struct intel_output *intel_output = to_intel_output(connector); 303 - struct intel_dvo_device *dvo = intel_output->dev_priv; 302 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 303 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 304 304 int pipe = !!(I915_READ(dvo->dvo_reg) & SDVO_PIPE_B_SELECT); 305 305 306 306 return intel_pipe_to_crtc(pScrn, pipe); ··· 351 351 { 352 352 struct drm_device *dev = connector->dev; 353 353 struct drm_i915_private *dev_priv = dev->dev_private; 354 - struct intel_output *intel_output = to_intel_output(connector); 355 - struct intel_dvo_device *dvo = intel_output->dev_priv; 354 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 355 + struct intel_dvo_device *dvo = intel_encoder->dev_priv; 356 356 uint32_t dvo_reg = dvo->dvo_reg; 357 357 uint32_t dvo_val = I915_READ(dvo_reg); 358 358 struct drm_display_mode *mode = NULL; ··· 382 382 383 383 void intel_dvo_init(struct drm_device *dev) 384 384 { 385 - struct intel_output *intel_output; 385 + struct intel_encoder *intel_encoder; 386 386 struct intel_dvo_device *dvo; 387 387 struct i2c_adapter *i2cbus = NULL; 388 388 int ret = 0; 389 389 int i; 390 390 int encoder_type = DRM_MODE_ENCODER_NONE; 391 - intel_output = kzalloc (sizeof(struct intel_output), GFP_KERNEL); 392 - if (!intel_output) 391 + intel_encoder = kzalloc (sizeof(struct intel_encoder), GFP_KERNEL); 392 + if (!intel_encoder) 393 393 return; 394 394 395 395 /* Set up the DDC bus */ 396 - intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "DVODDC_D"); 397 - if (!intel_output->ddc_bus) 396 + intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOD, "DVODDC_D"); 397 + if (!intel_encoder->ddc_bus) 398 398 goto free_intel; 399 399 400 400 /* Now, try to find a controller */ 401 401 for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { 402 - struct drm_connector *connector = &intel_output->base; 402 + struct drm_connector *connector = &intel_encoder->base; 403 403 int gpio; 404 404 405 405 dvo = &intel_dvo_devices[i]; ··· 434 434 if (!ret) 435 435 continue; 436 436 437 - intel_output->type = INTEL_OUTPUT_DVO; 438 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 437 + intel_encoder->type = INTEL_OUTPUT_DVO; 438 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 439 439 switch (dvo->type) { 440 440 case INTEL_DVO_CHIP_TMDS: 441 - intel_output->clone_mask = 441 + intel_encoder->clone_mask = 442 442 (1 << INTEL_DVO_TMDS_CLONE_BIT) | 443 443 (1 << INTEL_ANALOG_CLONE_BIT); 444 444 drm_connector_init(dev, connector, ··· 447 447 encoder_type = DRM_MODE_ENCODER_TMDS; 448 448 break; 449 449 case INTEL_DVO_CHIP_LVDS: 450 - intel_output->clone_mask = 450 + intel_encoder->clone_mask = 451 451 (1 << INTEL_DVO_LVDS_CLONE_BIT); 452 452 drm_connector_init(dev, connector, 453 453 &intel_dvo_connector_funcs, ··· 462 462 connector->interlace_allowed = false; 463 463 connector->doublescan_allowed = false; 464 464 465 - intel_output->dev_priv = dvo; 466 - intel_output->i2c_bus = i2cbus; 465 + intel_encoder->dev_priv = dvo; 466 + intel_encoder->i2c_bus = i2cbus; 467 467 468 - drm_encoder_init(dev, &intel_output->enc, 468 + drm_encoder_init(dev, &intel_encoder->enc, 469 469 &intel_dvo_enc_funcs, encoder_type); 470 - drm_encoder_helper_add(&intel_output->enc, 470 + drm_encoder_helper_add(&intel_encoder->enc, 471 471 &intel_dvo_helper_funcs); 472 472 473 - drm_mode_connector_attach_encoder(&intel_output->base, 474 - &intel_output->enc); 473 + drm_mode_connector_attach_encoder(&intel_encoder->base, 474 + &intel_encoder->enc); 475 475 if (dvo->type == INTEL_DVO_CHIP_LVDS) { 476 476 /* For our LVDS chipsets, we should hopefully be able 477 477 * to dig the fixed panel mode out of the BIOS data. ··· 489 489 return; 490 490 } 491 491 492 - intel_i2c_destroy(intel_output->ddc_bus); 492 + intel_i2c_destroy(intel_encoder->ddc_bus); 493 493 /* Didn't find a chip, so tear down. */ 494 494 if (i2cbus != NULL) 495 495 intel_i2c_destroy(i2cbus); 496 496 free_intel: 497 - kfree(intel_output); 497 + kfree(intel_encoder); 498 498 }
+43 -43
drivers/gpu/drm/i915/intel_hdmi.c
··· 50 50 struct drm_i915_private *dev_priv = dev->dev_private; 51 51 struct drm_crtc *crtc = encoder->crtc; 52 52 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 53 - struct intel_output *intel_output = enc_to_intel_output(encoder); 54 - struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 53 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 54 + struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv; 55 55 u32 sdvox; 56 56 57 57 sdvox = SDVO_ENCODING_HDMI | ··· 73 73 { 74 74 struct drm_device *dev = encoder->dev; 75 75 struct drm_i915_private *dev_priv = dev->dev_private; 76 - struct intel_output *intel_output = enc_to_intel_output(encoder); 77 - struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 76 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 77 + struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv; 78 78 u32 temp; 79 79 80 80 temp = I915_READ(hdmi_priv->sdvox_reg); ··· 109 109 { 110 110 struct drm_device *dev = connector->dev; 111 111 struct drm_i915_private *dev_priv = dev->dev_private; 112 - struct intel_output *intel_output = to_intel_output(connector); 113 - struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 112 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 113 + struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv; 114 114 115 115 hdmi_priv->save_SDVOX = I915_READ(hdmi_priv->sdvox_reg); 116 116 } ··· 119 119 { 120 120 struct drm_device *dev = connector->dev; 121 121 struct drm_i915_private *dev_priv = dev->dev_private; 122 - struct intel_output *intel_output = to_intel_output(connector); 123 - struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 122 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 123 + struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv; 124 124 125 125 I915_WRITE(hdmi_priv->sdvox_reg, hdmi_priv->save_SDVOX); 126 126 POSTING_READ(hdmi_priv->sdvox_reg); ··· 150 150 static enum drm_connector_status 151 151 intel_hdmi_detect(struct drm_connector *connector) 152 152 { 153 - struct intel_output *intel_output = to_intel_output(connector); 154 - struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 153 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 154 + struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv; 155 155 struct edid *edid = NULL; 156 156 enum drm_connector_status status = connector_status_disconnected; 157 157 158 158 hdmi_priv->has_hdmi_sink = false; 159 - edid = drm_get_edid(&intel_output->base, 160 - intel_output->ddc_bus); 159 + edid = drm_get_edid(&intel_encoder->base, 160 + intel_encoder->ddc_bus); 161 161 162 162 if (edid) { 163 163 if (edid->input & DRM_EDID_INPUT_DIGITAL) { 164 164 status = connector_status_connected; 165 165 hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid); 166 166 } 167 - intel_output->base.display_info.raw_edid = NULL; 167 + intel_encoder->base.display_info.raw_edid = NULL; 168 168 kfree(edid); 169 169 } 170 170 ··· 173 173 174 174 static int intel_hdmi_get_modes(struct drm_connector *connector) 175 175 { 176 - struct intel_output *intel_output = to_intel_output(connector); 176 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 177 177 178 178 /* We should parse the EDID data and find out if it's an HDMI sink so 179 179 * we can send audio to it. 180 180 */ 181 181 182 - return intel_ddc_get_modes(intel_output); 182 + return intel_ddc_get_modes(intel_encoder); 183 183 } 184 184 185 185 static void intel_hdmi_destroy(struct drm_connector *connector) 186 186 { 187 - struct intel_output *intel_output = to_intel_output(connector); 187 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 188 188 189 - if (intel_output->i2c_bus) 190 - intel_i2c_destroy(intel_output->i2c_bus); 189 + if (intel_encoder->i2c_bus) 190 + intel_i2c_destroy(intel_encoder->i2c_bus); 191 191 drm_sysfs_connector_remove(connector); 192 192 drm_connector_cleanup(connector); 193 - kfree(intel_output); 193 + kfree(intel_encoder); 194 194 } 195 195 196 196 static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = { ··· 229 229 { 230 230 struct drm_i915_private *dev_priv = dev->dev_private; 231 231 struct drm_connector *connector; 232 - struct intel_output *intel_output; 232 + struct intel_encoder *intel_encoder; 233 233 struct intel_hdmi_priv *hdmi_priv; 234 234 235 - intel_output = kcalloc(sizeof(struct intel_output) + 235 + intel_encoder = kcalloc(sizeof(struct intel_encoder) + 236 236 sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL); 237 - if (!intel_output) 237 + if (!intel_encoder) 238 238 return; 239 - hdmi_priv = (struct intel_hdmi_priv *)(intel_output + 1); 239 + hdmi_priv = (struct intel_hdmi_priv *)(intel_encoder + 1); 240 240 241 - connector = &intel_output->base; 241 + connector = &intel_encoder->base; 242 242 drm_connector_init(dev, connector, &intel_hdmi_connector_funcs, 243 243 DRM_MODE_CONNECTOR_HDMIA); 244 244 drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs); 245 245 246 - intel_output->type = INTEL_OUTPUT_HDMI; 246 + intel_encoder->type = INTEL_OUTPUT_HDMI; 247 247 248 248 connector->interlace_allowed = 0; 249 249 connector->doublescan_allowed = 0; 250 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 250 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 251 251 252 252 /* Set up the DDC bus. */ 253 253 if (sdvox_reg == SDVOB) { 254 - intel_output->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT); 255 - intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB"); 254 + intel_encoder->clone_mask = (1 << INTEL_HDMIB_CLONE_BIT); 255 + intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB"); 256 256 dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS; 257 257 } else if (sdvox_reg == SDVOC) { 258 - intel_output->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT); 259 - intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC"); 258 + intel_encoder->clone_mask = (1 << INTEL_HDMIC_CLONE_BIT); 259 + intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC"); 260 260 dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS; 261 261 } else if (sdvox_reg == HDMIB) { 262 - intel_output->clone_mask = (1 << INTEL_HDMID_CLONE_BIT); 263 - intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOE, 262 + intel_encoder->clone_mask = (1 << INTEL_HDMID_CLONE_BIT); 263 + intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOE, 264 264 "HDMIB"); 265 265 dev_priv->hotplug_supported_mask |= HDMIB_HOTPLUG_INT_STATUS; 266 266 } else if (sdvox_reg == HDMIC) { 267 - intel_output->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT); 268 - intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOD, 267 + intel_encoder->clone_mask = (1 << INTEL_HDMIE_CLONE_BIT); 268 + intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOD, 269 269 "HDMIC"); 270 270 dev_priv->hotplug_supported_mask |= HDMIC_HOTPLUG_INT_STATUS; 271 271 } else if (sdvox_reg == HDMID) { 272 - intel_output->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT); 273 - intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOF, 272 + intel_encoder->clone_mask = (1 << INTEL_HDMIF_CLONE_BIT); 273 + intel_encoder->ddc_bus = intel_i2c_create(dev, PCH_GPIOF, 274 274 "HDMID"); 275 275 dev_priv->hotplug_supported_mask |= HDMID_HOTPLUG_INT_STATUS; 276 276 } 277 - if (!intel_output->ddc_bus) 277 + if (!intel_encoder->ddc_bus) 278 278 goto err_connector; 279 279 280 280 hdmi_priv->sdvox_reg = sdvox_reg; 281 - intel_output->dev_priv = hdmi_priv; 281 + intel_encoder->dev_priv = hdmi_priv; 282 282 283 - drm_encoder_init(dev, &intel_output->enc, &intel_hdmi_enc_funcs, 283 + drm_encoder_init(dev, &intel_encoder->enc, &intel_hdmi_enc_funcs, 284 284 DRM_MODE_ENCODER_TMDS); 285 - drm_encoder_helper_add(&intel_output->enc, &intel_hdmi_helper_funcs); 285 + drm_encoder_helper_add(&intel_encoder->enc, &intel_hdmi_helper_funcs); 286 286 287 - drm_mode_connector_attach_encoder(&intel_output->base, 288 - &intel_output->enc); 287 + drm_mode_connector_attach_encoder(&intel_encoder->base, 288 + &intel_encoder->enc); 289 289 drm_sysfs_connector_add(connector); 290 290 291 291 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written ··· 301 301 302 302 err_connector: 303 303 drm_connector_cleanup(connector); 304 - kfree(intel_output); 304 + kfree(intel_encoder); 305 305 306 306 return; 307 307 }
+32 -32
drivers/gpu/drm/i915/intel_lvds.c
··· 238 238 struct drm_i915_private *dev_priv = dev->dev_private; 239 239 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 240 240 struct drm_encoder *tmp_encoder; 241 - struct intel_output *intel_output = enc_to_intel_output(encoder); 242 - struct intel_lvds_priv *lvds_priv = intel_output->dev_priv; 241 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 242 + struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv; 243 243 u32 pfit_control = 0, pfit_pgm_ratios = 0; 244 244 int left_border = 0, right_border = 0, top_border = 0; 245 245 int bottom_border = 0; ··· 586 586 { 587 587 struct drm_device *dev = encoder->dev; 588 588 struct drm_i915_private *dev_priv = dev->dev_private; 589 - struct intel_output *intel_output = enc_to_intel_output(encoder); 590 - struct intel_lvds_priv *lvds_priv = intel_output->dev_priv; 589 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 590 + struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv; 591 591 592 592 /* 593 593 * The LVDS pin pair will already have been turned on in the ··· 634 634 static int intel_lvds_get_modes(struct drm_connector *connector) 635 635 { 636 636 struct drm_device *dev = connector->dev; 637 - struct intel_output *intel_output = to_intel_output(connector); 637 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 638 638 struct drm_i915_private *dev_priv = dev->dev_private; 639 639 int ret = 0; 640 640 641 - ret = intel_ddc_get_modes(intel_output); 641 + ret = intel_ddc_get_modes(intel_encoder); 642 642 643 643 if (ret) 644 644 return ret; ··· 714 714 static void intel_lvds_destroy(struct drm_connector *connector) 715 715 { 716 716 struct drm_device *dev = connector->dev; 717 - struct intel_output *intel_output = to_intel_output(connector); 717 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 718 718 struct drm_i915_private *dev_priv = dev->dev_private; 719 719 720 - if (intel_output->ddc_bus) 721 - intel_i2c_destroy(intel_output->ddc_bus); 720 + if (intel_encoder->ddc_bus) 721 + intel_i2c_destroy(intel_encoder->ddc_bus); 722 722 if (dev_priv->lid_notifier.notifier_call) 723 723 acpi_lid_notifier_unregister(&dev_priv->lid_notifier); 724 724 drm_sysfs_connector_remove(connector); ··· 731 731 uint64_t value) 732 732 { 733 733 struct drm_device *dev = connector->dev; 734 - struct intel_output *intel_output = 735 - to_intel_output(connector); 734 + struct intel_encoder *intel_encoder = 735 + to_intel_encoder(connector); 736 736 737 737 if (property == dev->mode_config.scaling_mode_property && 738 738 connector->encoder) { 739 739 struct drm_crtc *crtc = connector->encoder->crtc; 740 - struct intel_lvds_priv *lvds_priv = intel_output->dev_priv; 740 + struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv; 741 741 if (value == DRM_MODE_SCALE_NONE) { 742 742 DRM_DEBUG_KMS("no scaling not supported\n"); 743 743 return 0; ··· 967 967 void intel_lvds_init(struct drm_device *dev) 968 968 { 969 969 struct drm_i915_private *dev_priv = dev->dev_private; 970 - struct intel_output *intel_output; 970 + struct intel_encoder *intel_encoder; 971 971 struct drm_connector *connector; 972 972 struct drm_encoder *encoder; 973 973 struct drm_display_mode *scan; /* *modes, *bios_mode; */ ··· 995 995 gpio = PCH_GPIOC; 996 996 } 997 997 998 - intel_output = kzalloc(sizeof(struct intel_output) + 998 + intel_encoder = kzalloc(sizeof(struct intel_encoder) + 999 999 sizeof(struct intel_lvds_priv), GFP_KERNEL); 1000 - if (!intel_output) { 1000 + if (!intel_encoder) { 1001 1001 return; 1002 1002 } 1003 1003 1004 - connector = &intel_output->base; 1005 - encoder = &intel_output->enc; 1006 - drm_connector_init(dev, &intel_output->base, &intel_lvds_connector_funcs, 1004 + connector = &intel_encoder->base; 1005 + encoder = &intel_encoder->enc; 1006 + drm_connector_init(dev, &intel_encoder->base, &intel_lvds_connector_funcs, 1007 1007 DRM_MODE_CONNECTOR_LVDS); 1008 1008 1009 - drm_encoder_init(dev, &intel_output->enc, &intel_lvds_enc_funcs, 1009 + drm_encoder_init(dev, &intel_encoder->enc, &intel_lvds_enc_funcs, 1010 1010 DRM_MODE_ENCODER_LVDS); 1011 1011 1012 - drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 1013 - intel_output->type = INTEL_OUTPUT_LVDS; 1012 + drm_mode_connector_attach_encoder(&intel_encoder->base, &intel_encoder->enc); 1013 + intel_encoder->type = INTEL_OUTPUT_LVDS; 1014 1014 1015 - intel_output->clone_mask = (1 << INTEL_LVDS_CLONE_BIT); 1016 - intel_output->crtc_mask = (1 << 1); 1015 + intel_encoder->clone_mask = (1 << INTEL_LVDS_CLONE_BIT); 1016 + intel_encoder->crtc_mask = (1 << 1); 1017 1017 drm_encoder_helper_add(encoder, &intel_lvds_helper_funcs); 1018 1018 drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); 1019 1019 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 1020 1020 connector->interlace_allowed = false; 1021 1021 connector->doublescan_allowed = false; 1022 1022 1023 - lvds_priv = (struct intel_lvds_priv *)(intel_output + 1); 1024 - intel_output->dev_priv = lvds_priv; 1023 + lvds_priv = (struct intel_lvds_priv *)(intel_encoder + 1); 1024 + intel_encoder->dev_priv = lvds_priv; 1025 1025 /* create the scaling mode property */ 1026 1026 drm_mode_create_scaling_mode_property(dev); 1027 1027 /* 1028 1028 * the initial panel fitting mode will be FULL_SCREEN. 1029 1029 */ 1030 1030 1031 - drm_connector_attach_property(&intel_output->base, 1031 + drm_connector_attach_property(&intel_encoder->base, 1032 1032 dev->mode_config.scaling_mode_property, 1033 1033 DRM_MODE_SCALE_FULLSCREEN); 1034 1034 lvds_priv->fitting_mode = DRM_MODE_SCALE_FULLSCREEN; ··· 1043 1043 */ 1044 1044 1045 1045 /* Set up the DDC bus. */ 1046 - intel_output->ddc_bus = intel_i2c_create(dev, gpio, "LVDSDDC_C"); 1047 - if (!intel_output->ddc_bus) { 1046 + intel_encoder->ddc_bus = intel_i2c_create(dev, gpio, "LVDSDDC_C"); 1047 + if (!intel_encoder->ddc_bus) { 1048 1048 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " 1049 1049 "failed.\n"); 1050 1050 goto failed; ··· 1054 1054 * Attempt to get the fixed panel mode from DDC. Assume that the 1055 1055 * preferred mode is the right one. 1056 1056 */ 1057 - intel_ddc_get_modes(intel_output); 1057 + intel_ddc_get_modes(intel_encoder); 1058 1058 1059 1059 list_for_each_entry(scan, &connector->probed_modes, head) { 1060 1060 mutex_lock(&dev->mode_config.mutex); ··· 1132 1132 1133 1133 failed: 1134 1134 DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); 1135 - if (intel_output->ddc_bus) 1136 - intel_i2c_destroy(intel_output->ddc_bus); 1135 + if (intel_encoder->ddc_bus) 1136 + intel_i2c_destroy(intel_encoder->ddc_bus); 1137 1137 drm_connector_cleanup(connector); 1138 1138 drm_encoder_cleanup(encoder); 1139 - kfree(intel_output); 1139 + kfree(intel_encoder); 1140 1140 }
+11 -11
drivers/gpu/drm/i915/intel_modes.c
··· 33 33 * intel_ddc_probe 34 34 * 35 35 */ 36 - bool intel_ddc_probe(struct intel_output *intel_output) 36 + bool intel_ddc_probe(struct intel_encoder *intel_encoder) 37 37 { 38 38 u8 out_buf[] = { 0x0, 0x0}; 39 39 u8 buf[2]; ··· 53 53 } 54 54 }; 55 55 56 - intel_i2c_quirk_set(intel_output->base.dev, true); 57 - ret = i2c_transfer(intel_output->ddc_bus, msgs, 2); 58 - intel_i2c_quirk_set(intel_output->base.dev, false); 56 + intel_i2c_quirk_set(intel_encoder->base.dev, true); 57 + ret = i2c_transfer(intel_encoder->ddc_bus, msgs, 2); 58 + intel_i2c_quirk_set(intel_encoder->base.dev, false); 59 59 if (ret == 2) 60 60 return true; 61 61 ··· 68 68 * 69 69 * Fetch the EDID information from @connector using the DDC bus. 70 70 */ 71 - int intel_ddc_get_modes(struct intel_output *intel_output) 71 + int intel_ddc_get_modes(struct intel_encoder *intel_encoder) 72 72 { 73 73 struct edid *edid; 74 74 int ret = 0; 75 75 76 - intel_i2c_quirk_set(intel_output->base.dev, true); 77 - edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus); 78 - intel_i2c_quirk_set(intel_output->base.dev, false); 76 + intel_i2c_quirk_set(intel_encoder->base.dev, true); 77 + edid = drm_get_edid(&intel_encoder->base, intel_encoder->ddc_bus); 78 + intel_i2c_quirk_set(intel_encoder->base.dev, false); 79 79 if (edid) { 80 - drm_mode_connector_update_edid_property(&intel_output->base, 80 + drm_mode_connector_update_edid_property(&intel_encoder->base, 81 81 edid); 82 - ret = drm_add_edid_modes(&intel_output->base, edid); 83 - intel_output->base.display_info.raw_edid = NULL; 82 + ret = drm_add_edid_modes(&intel_encoder->base, edid); 83 + intel_encoder->base.display_info.raw_edid = NULL; 84 84 kfree(edid); 85 85 } 86 86
+286 -286
drivers/gpu/drm/i915/intel_sdvo.c
··· 161 161 }; 162 162 163 163 static bool 164 - intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags); 164 + intel_sdvo_output_setup(struct intel_encoder *intel_encoder, uint16_t flags); 165 165 166 166 /** 167 167 * Writes the SDVOB or SDVOC with the given value, but always writes both 168 168 * SDVOB and SDVOC to work around apparent hardware issues (according to 169 169 * comments in the BIOS). 170 170 */ 171 - static void intel_sdvo_write_sdvox(struct intel_output *intel_output, u32 val) 171 + static void intel_sdvo_write_sdvox(struct intel_encoder *intel_encoder, u32 val) 172 172 { 173 - struct drm_device *dev = intel_output->base.dev; 173 + struct drm_device *dev = intel_encoder->base.dev; 174 174 struct drm_i915_private *dev_priv = dev->dev_private; 175 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 175 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 176 176 u32 bval = val, cval = val; 177 177 int i; 178 178 ··· 195 195 } 196 196 } 197 197 198 - static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr, 198 + static bool intel_sdvo_read_byte(struct intel_encoder *intel_encoder, u8 addr, 199 199 u8 *ch) 200 200 { 201 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 201 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 202 202 u8 out_buf[2]; 203 203 u8 buf[2]; 204 204 int ret; ··· 221 221 out_buf[0] = addr; 222 222 out_buf[1] = 0; 223 223 224 - if ((ret = i2c_transfer(intel_output->i2c_bus, msgs, 2)) == 2) 224 + if ((ret = i2c_transfer(intel_encoder->i2c_bus, msgs, 2)) == 2) 225 225 { 226 226 *ch = buf[0]; 227 227 return true; ··· 231 231 return false; 232 232 } 233 233 234 - static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr, 234 + static bool intel_sdvo_write_byte(struct intel_encoder *intel_encoder, int addr, 235 235 u8 ch) 236 236 { 237 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 237 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 238 238 u8 out_buf[2]; 239 239 struct i2c_msg msgs[] = { 240 240 { ··· 248 248 out_buf[0] = addr; 249 249 out_buf[1] = ch; 250 250 251 - if (i2c_transfer(intel_output->i2c_bus, msgs, 1) == 1) 251 + if (i2c_transfer(intel_encoder->i2c_bus, msgs, 1) == 1) 252 252 { 253 253 return true; 254 254 } ··· 355 355 #define SDVO_NAME(dev_priv) ((dev_priv)->output_device == SDVOB ? "SDVOB" : "SDVOC") 356 356 #define SDVO_PRIV(output) ((struct intel_sdvo_priv *) (output)->dev_priv) 357 357 358 - static void intel_sdvo_debug_write(struct intel_output *intel_output, u8 cmd, 358 + static void intel_sdvo_debug_write(struct intel_encoder *intel_encoder, u8 cmd, 359 359 void *args, int args_len) 360 360 { 361 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 361 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 362 362 int i; 363 363 364 364 DRM_DEBUG_KMS("%s: W: %02X ", ··· 378 378 DRM_LOG_KMS("\n"); 379 379 } 380 380 381 - static void intel_sdvo_write_cmd(struct intel_output *intel_output, u8 cmd, 381 + static void intel_sdvo_write_cmd(struct intel_encoder *intel_encoder, u8 cmd, 382 382 void *args, int args_len) 383 383 { 384 384 int i; 385 385 386 - intel_sdvo_debug_write(intel_output, cmd, args, args_len); 386 + intel_sdvo_debug_write(intel_encoder, cmd, args, args_len); 387 387 388 388 for (i = 0; i < args_len; i++) { 389 - intel_sdvo_write_byte(intel_output, SDVO_I2C_ARG_0 - i, 389 + intel_sdvo_write_byte(intel_encoder, SDVO_I2C_ARG_0 - i, 390 390 ((u8*)args)[i]); 391 391 } 392 392 393 - intel_sdvo_write_byte(intel_output, SDVO_I2C_OPCODE, cmd); 393 + intel_sdvo_write_byte(intel_encoder, SDVO_I2C_OPCODE, cmd); 394 394 } 395 395 396 396 static const char *cmd_status_names[] = { ··· 403 403 "Scaling not supported" 404 404 }; 405 405 406 - static void intel_sdvo_debug_response(struct intel_output *intel_output, 406 + static void intel_sdvo_debug_response(struct intel_encoder *intel_encoder, 407 407 void *response, int response_len, 408 408 u8 status) 409 409 { 410 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 410 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 411 411 int i; 412 412 413 413 DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(sdvo_priv)); ··· 422 422 DRM_LOG_KMS("\n"); 423 423 } 424 424 425 - static u8 intel_sdvo_read_response(struct intel_output *intel_output, 425 + static u8 intel_sdvo_read_response(struct intel_encoder *intel_encoder, 426 426 void *response, int response_len) 427 427 { 428 428 int i; ··· 432 432 while (retry--) { 433 433 /* Read the command response */ 434 434 for (i = 0; i < response_len; i++) { 435 - intel_sdvo_read_byte(intel_output, 435 + intel_sdvo_read_byte(intel_encoder, 436 436 SDVO_I2C_RETURN_0 + i, 437 437 &((u8 *)response)[i]); 438 438 } 439 439 440 440 /* read the return status */ 441 - intel_sdvo_read_byte(intel_output, SDVO_I2C_CMD_STATUS, 441 + intel_sdvo_read_byte(intel_encoder, SDVO_I2C_CMD_STATUS, 442 442 &status); 443 443 444 - intel_sdvo_debug_response(intel_output, response, response_len, 444 + intel_sdvo_debug_response(intel_encoder, response, response_len, 445 445 status); 446 446 if (status != SDVO_CMD_STATUS_PENDING) 447 447 return status; ··· 469 469 * another I2C transaction after issuing the DDC bus switch, it will be 470 470 * switched to the internal SDVO register. 471 471 */ 472 - static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, 472 + static void intel_sdvo_set_control_bus_switch(struct intel_encoder *intel_encoder, 473 473 u8 target) 474 474 { 475 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 475 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 476 476 u8 out_buf[2], cmd_buf[2], ret_value[2], ret; 477 477 struct i2c_msg msgs[] = { 478 478 { ··· 496 496 }, 497 497 }; 498 498 499 - intel_sdvo_debug_write(intel_output, SDVO_CMD_SET_CONTROL_BUS_SWITCH, 499 + intel_sdvo_debug_write(intel_encoder, SDVO_CMD_SET_CONTROL_BUS_SWITCH, 500 500 &target, 1); 501 501 /* write the DDC switch command argument */ 502 - intel_sdvo_write_byte(intel_output, SDVO_I2C_ARG_0, target); 502 + intel_sdvo_write_byte(intel_encoder, SDVO_I2C_ARG_0, target); 503 503 504 504 out_buf[0] = SDVO_I2C_OPCODE; 505 505 out_buf[1] = SDVO_CMD_SET_CONTROL_BUS_SWITCH; ··· 508 508 ret_value[0] = 0; 509 509 ret_value[1] = 0; 510 510 511 - ret = i2c_transfer(intel_output->i2c_bus, msgs, 3); 511 + ret = i2c_transfer(intel_encoder->i2c_bus, msgs, 3); 512 512 if (ret != 3) { 513 513 /* failure in I2C transfer */ 514 514 DRM_DEBUG_KMS("I2c transfer returned %d\n", ret); ··· 522 522 return; 523 523 } 524 524 525 - static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1) 525 + static bool intel_sdvo_set_target_input(struct intel_encoder *intel_encoder, bool target_0, bool target_1) 526 526 { 527 527 struct intel_sdvo_set_target_input_args targets = {0}; 528 528 u8 status; ··· 533 533 if (target_1) 534 534 targets.target_1 = 1; 535 535 536 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_TARGET_INPUT, &targets, 536 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_TARGET_INPUT, &targets, 537 537 sizeof(targets)); 538 538 539 - status = intel_sdvo_read_response(intel_output, NULL, 0); 539 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 540 540 541 541 return (status == SDVO_CMD_STATUS_SUCCESS); 542 542 } ··· 547 547 * This function is making an assumption about the layout of the response, 548 548 * which should be checked against the docs. 549 549 */ 550 - static bool intel_sdvo_get_trained_inputs(struct intel_output *intel_output, bool *input_1, bool *input_2) 550 + static bool intel_sdvo_get_trained_inputs(struct intel_encoder *intel_encoder, bool *input_1, bool *input_2) 551 551 { 552 552 struct intel_sdvo_get_trained_inputs_response response; 553 553 u8 status; 554 554 555 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_TRAINED_INPUTS, NULL, 0); 556 - status = intel_sdvo_read_response(intel_output, &response, sizeof(response)); 555 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_TRAINED_INPUTS, NULL, 0); 556 + status = intel_sdvo_read_response(intel_encoder, &response, sizeof(response)); 557 557 if (status != SDVO_CMD_STATUS_SUCCESS) 558 558 return false; 559 559 ··· 562 562 return true; 563 563 } 564 564 565 - static bool intel_sdvo_get_active_outputs(struct intel_output *intel_output, 565 + static bool intel_sdvo_get_active_outputs(struct intel_encoder *intel_encoder, 566 566 u16 *outputs) 567 567 { 568 568 u8 status; 569 569 570 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ACTIVE_OUTPUTS, NULL, 0); 571 - status = intel_sdvo_read_response(intel_output, outputs, sizeof(*outputs)); 570 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_OUTPUTS, NULL, 0); 571 + status = intel_sdvo_read_response(intel_encoder, outputs, sizeof(*outputs)); 572 572 573 573 return (status == SDVO_CMD_STATUS_SUCCESS); 574 574 } 575 575 576 - static bool intel_sdvo_set_active_outputs(struct intel_output *intel_output, 576 + static bool intel_sdvo_set_active_outputs(struct intel_encoder *intel_encoder, 577 577 u16 outputs) 578 578 { 579 579 u8 status; 580 580 581 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_ACTIVE_OUTPUTS, &outputs, 581 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_ACTIVE_OUTPUTS, &outputs, 582 582 sizeof(outputs)); 583 - status = intel_sdvo_read_response(intel_output, NULL, 0); 583 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 584 584 return (status == SDVO_CMD_STATUS_SUCCESS); 585 585 } 586 586 587 - static bool intel_sdvo_set_encoder_power_state(struct intel_output *intel_output, 587 + static bool intel_sdvo_set_encoder_power_state(struct intel_encoder *intel_encoder, 588 588 int mode) 589 589 { 590 590 u8 status, state = SDVO_ENCODER_STATE_ON; ··· 604 604 break; 605 605 } 606 606 607 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_ENCODER_POWER_STATE, &state, 607 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_ENCODER_POWER_STATE, &state, 608 608 sizeof(state)); 609 - status = intel_sdvo_read_response(intel_output, NULL, 0); 609 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 610 610 611 611 return (status == SDVO_CMD_STATUS_SUCCESS); 612 612 } 613 613 614 - static bool intel_sdvo_get_input_pixel_clock_range(struct intel_output *intel_output, 614 + static bool intel_sdvo_get_input_pixel_clock_range(struct intel_encoder *intel_encoder, 615 615 int *clock_min, 616 616 int *clock_max) 617 617 { 618 618 struct intel_sdvo_pixel_clock_range clocks; 619 619 u8 status; 620 620 621 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE, 621 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_INPUT_PIXEL_CLOCK_RANGE, 622 622 NULL, 0); 623 623 624 - status = intel_sdvo_read_response(intel_output, &clocks, sizeof(clocks)); 624 + status = intel_sdvo_read_response(intel_encoder, &clocks, sizeof(clocks)); 625 625 626 626 if (status != SDVO_CMD_STATUS_SUCCESS) 627 627 return false; ··· 633 633 return true; 634 634 } 635 635 636 - static bool intel_sdvo_set_target_output(struct intel_output *intel_output, 636 + static bool intel_sdvo_set_target_output(struct intel_encoder *intel_encoder, 637 637 u16 outputs) 638 638 { 639 639 u8 status; 640 640 641 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_TARGET_OUTPUT, &outputs, 641 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_TARGET_OUTPUT, &outputs, 642 642 sizeof(outputs)); 643 643 644 - status = intel_sdvo_read_response(intel_output, NULL, 0); 644 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 645 645 return (status == SDVO_CMD_STATUS_SUCCESS); 646 646 } 647 647 648 - static bool intel_sdvo_get_timing(struct intel_output *intel_output, u8 cmd, 648 + static bool intel_sdvo_get_timing(struct intel_encoder *intel_encoder, u8 cmd, 649 649 struct intel_sdvo_dtd *dtd) 650 650 { 651 651 u8 status; 652 652 653 - intel_sdvo_write_cmd(intel_output, cmd, NULL, 0); 654 - status = intel_sdvo_read_response(intel_output, &dtd->part1, 653 + intel_sdvo_write_cmd(intel_encoder, cmd, NULL, 0); 654 + status = intel_sdvo_read_response(intel_encoder, &dtd->part1, 655 655 sizeof(dtd->part1)); 656 656 if (status != SDVO_CMD_STATUS_SUCCESS) 657 657 return false; 658 658 659 - intel_sdvo_write_cmd(intel_output, cmd + 1, NULL, 0); 660 - status = intel_sdvo_read_response(intel_output, &dtd->part2, 659 + intel_sdvo_write_cmd(intel_encoder, cmd + 1, NULL, 0); 660 + status = intel_sdvo_read_response(intel_encoder, &dtd->part2, 661 661 sizeof(dtd->part2)); 662 662 if (status != SDVO_CMD_STATUS_SUCCESS) 663 663 return false; ··· 665 665 return true; 666 666 } 667 667 668 - static bool intel_sdvo_get_input_timing(struct intel_output *intel_output, 668 + static bool intel_sdvo_get_input_timing(struct intel_encoder *intel_encoder, 669 669 struct intel_sdvo_dtd *dtd) 670 670 { 671 - return intel_sdvo_get_timing(intel_output, 671 + return intel_sdvo_get_timing(intel_encoder, 672 672 SDVO_CMD_GET_INPUT_TIMINGS_PART1, dtd); 673 673 } 674 674 675 - static bool intel_sdvo_get_output_timing(struct intel_output *intel_output, 675 + static bool intel_sdvo_get_output_timing(struct intel_encoder *intel_encoder, 676 676 struct intel_sdvo_dtd *dtd) 677 677 { 678 - return intel_sdvo_get_timing(intel_output, 678 + return intel_sdvo_get_timing(intel_encoder, 679 679 SDVO_CMD_GET_OUTPUT_TIMINGS_PART1, dtd); 680 680 } 681 681 682 - static bool intel_sdvo_set_timing(struct intel_output *intel_output, u8 cmd, 682 + static bool intel_sdvo_set_timing(struct intel_encoder *intel_encoder, u8 cmd, 683 683 struct intel_sdvo_dtd *dtd) 684 684 { 685 685 u8 status; 686 686 687 - intel_sdvo_write_cmd(intel_output, cmd, &dtd->part1, sizeof(dtd->part1)); 688 - status = intel_sdvo_read_response(intel_output, NULL, 0); 687 + intel_sdvo_write_cmd(intel_encoder, cmd, &dtd->part1, sizeof(dtd->part1)); 688 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 689 689 if (status != SDVO_CMD_STATUS_SUCCESS) 690 690 return false; 691 691 692 - intel_sdvo_write_cmd(intel_output, cmd + 1, &dtd->part2, sizeof(dtd->part2)); 693 - status = intel_sdvo_read_response(intel_output, NULL, 0); 692 + intel_sdvo_write_cmd(intel_encoder, cmd + 1, &dtd->part2, sizeof(dtd->part2)); 693 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 694 694 if (status != SDVO_CMD_STATUS_SUCCESS) 695 695 return false; 696 696 697 697 return true; 698 698 } 699 699 700 - static bool intel_sdvo_set_input_timing(struct intel_output *intel_output, 700 + static bool intel_sdvo_set_input_timing(struct intel_encoder *intel_encoder, 701 701 struct intel_sdvo_dtd *dtd) 702 702 { 703 - return intel_sdvo_set_timing(intel_output, 703 + return intel_sdvo_set_timing(intel_encoder, 704 704 SDVO_CMD_SET_INPUT_TIMINGS_PART1, dtd); 705 705 } 706 706 707 - static bool intel_sdvo_set_output_timing(struct intel_output *intel_output, 707 + static bool intel_sdvo_set_output_timing(struct intel_encoder *intel_encoder, 708 708 struct intel_sdvo_dtd *dtd) 709 709 { 710 - return intel_sdvo_set_timing(intel_output, 710 + return intel_sdvo_set_timing(intel_encoder, 711 711 SDVO_CMD_SET_OUTPUT_TIMINGS_PART1, dtd); 712 712 } 713 713 714 714 static bool 715 - intel_sdvo_create_preferred_input_timing(struct intel_output *output, 715 + intel_sdvo_create_preferred_input_timing(struct intel_encoder *output, 716 716 uint16_t clock, 717 717 uint16_t width, 718 718 uint16_t height) ··· 741 741 return true; 742 742 } 743 743 744 - static bool intel_sdvo_get_preferred_input_timing(struct intel_output *output, 744 + static bool intel_sdvo_get_preferred_input_timing(struct intel_encoder *output, 745 745 struct intel_sdvo_dtd *dtd) 746 746 { 747 747 bool status; ··· 765 765 return false; 766 766 } 767 767 768 - static int intel_sdvo_get_clock_rate_mult(struct intel_output *intel_output) 768 + static int intel_sdvo_get_clock_rate_mult(struct intel_encoder *intel_encoder) 769 769 { 770 770 u8 response, status; 771 771 772 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_CLOCK_RATE_MULT, NULL, 0); 773 - status = intel_sdvo_read_response(intel_output, &response, 1); 772 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_CLOCK_RATE_MULT, NULL, 0); 773 + status = intel_sdvo_read_response(intel_encoder, &response, 1); 774 774 775 775 if (status != SDVO_CMD_STATUS_SUCCESS) { 776 776 DRM_DEBUG_KMS("Couldn't get SDVO clock rate multiplier\n"); ··· 782 782 return response; 783 783 } 784 784 785 - static bool intel_sdvo_set_clock_rate_mult(struct intel_output *intel_output, u8 val) 785 + static bool intel_sdvo_set_clock_rate_mult(struct intel_encoder *intel_encoder, u8 val) 786 786 { 787 787 u8 status; 788 788 789 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); 790 - status = intel_sdvo_read_response(intel_output, NULL, 0); 789 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); 790 + status = intel_sdvo_read_response(intel_encoder, NULL, 0); 791 791 if (status != SDVO_CMD_STATUS_SUCCESS) 792 792 return false; 793 793 ··· 876 876 mode->flags |= DRM_MODE_FLAG_PVSYNC; 877 877 } 878 878 879 - static bool intel_sdvo_get_supp_encode(struct intel_output *output, 879 + static bool intel_sdvo_get_supp_encode(struct intel_encoder *output, 880 880 struct intel_sdvo_encode *encode) 881 881 { 882 882 uint8_t status; ··· 891 891 return true; 892 892 } 893 893 894 - static bool intel_sdvo_set_encode(struct intel_output *output, uint8_t mode) 894 + static bool intel_sdvo_set_encode(struct intel_encoder *output, uint8_t mode) 895 895 { 896 896 uint8_t status; 897 897 ··· 901 901 return (status == SDVO_CMD_STATUS_SUCCESS); 902 902 } 903 903 904 - static bool intel_sdvo_set_colorimetry(struct intel_output *output, 904 + static bool intel_sdvo_set_colorimetry(struct intel_encoder *output, 905 905 uint8_t mode) 906 906 { 907 907 uint8_t status; ··· 913 913 } 914 914 915 915 #if 0 916 - static void intel_sdvo_dump_hdmi_buf(struct intel_output *output) 916 + static void intel_sdvo_dump_hdmi_buf(struct intel_encoder *output) 917 917 { 918 918 int i, j; 919 919 uint8_t set_buf_index[2]; ··· 943 943 } 944 944 #endif 945 945 946 - static void intel_sdvo_set_hdmi_buf(struct intel_output *output, int index, 946 + static void intel_sdvo_set_hdmi_buf(struct intel_encoder *output, int index, 947 947 uint8_t *data, int8_t size, uint8_t tx_rate) 948 948 { 949 949 uint8_t set_buf_index[2]; ··· 1033 1033 } __attribute__ ((packed)) u; 1034 1034 } __attribute__((packed)); 1035 1035 1036 - static void intel_sdvo_set_avi_infoframe(struct intel_output *output, 1036 + static void intel_sdvo_set_avi_infoframe(struct intel_encoder *output, 1037 1037 struct drm_display_mode * mode) 1038 1038 { 1039 1039 struct dip_infoframe avi_if = { ··· 1048 1048 SDVO_HBUF_TX_VSYNC); 1049 1049 } 1050 1050 1051 - static void intel_sdvo_set_tv_format(struct intel_output *output) 1051 + static void intel_sdvo_set_tv_format(struct intel_encoder *output) 1052 1052 { 1053 1053 1054 1054 struct intel_sdvo_tv_format format; ··· 1078 1078 struct drm_display_mode *mode, 1079 1079 struct drm_display_mode *adjusted_mode) 1080 1080 { 1081 - struct intel_output *output = enc_to_intel_output(encoder); 1081 + struct intel_encoder *output = enc_to_intel_encoder(encoder); 1082 1082 struct intel_sdvo_priv *dev_priv = output->dev_priv; 1083 1083 1084 1084 if (dev_priv->is_tv) { ··· 1181 1181 struct drm_i915_private *dev_priv = dev->dev_private; 1182 1182 struct drm_crtc *crtc = encoder->crtc; 1183 1183 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 1184 - struct intel_output *output = enc_to_intel_output(encoder); 1184 + struct intel_encoder *output = enc_to_intel_encoder(encoder); 1185 1185 struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 1186 1186 u32 sdvox = 0; 1187 1187 int sdvo_pixel_multiply; ··· 1305 1305 { 1306 1306 struct drm_device *dev = encoder->dev; 1307 1307 struct drm_i915_private *dev_priv = dev->dev_private; 1308 - struct intel_output *intel_output = enc_to_intel_output(encoder); 1309 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1308 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 1309 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1310 1310 u32 temp; 1311 1311 1312 1312 if (mode != DRM_MODE_DPMS_ON) { 1313 - intel_sdvo_set_active_outputs(intel_output, 0); 1313 + intel_sdvo_set_active_outputs(intel_encoder, 0); 1314 1314 if (0) 1315 - intel_sdvo_set_encoder_power_state(intel_output, mode); 1315 + intel_sdvo_set_encoder_power_state(intel_encoder, mode); 1316 1316 1317 1317 if (mode == DRM_MODE_DPMS_OFF) { 1318 1318 temp = I915_READ(sdvo_priv->output_device); 1319 1319 if ((temp & SDVO_ENABLE) != 0) { 1320 - intel_sdvo_write_sdvox(intel_output, temp & ~SDVO_ENABLE); 1320 + intel_sdvo_write_sdvox(intel_encoder, temp & ~SDVO_ENABLE); 1321 1321 } 1322 1322 } 1323 1323 } else { ··· 1327 1327 1328 1328 temp = I915_READ(sdvo_priv->output_device); 1329 1329 if ((temp & SDVO_ENABLE) == 0) 1330 - intel_sdvo_write_sdvox(intel_output, temp | SDVO_ENABLE); 1330 + intel_sdvo_write_sdvox(intel_encoder, temp | SDVO_ENABLE); 1331 1331 for (i = 0; i < 2; i++) 1332 1332 intel_wait_for_vblank(dev); 1333 1333 1334 - status = intel_sdvo_get_trained_inputs(intel_output, &input1, 1334 + status = intel_sdvo_get_trained_inputs(intel_encoder, &input1, 1335 1335 &input2); 1336 1336 1337 1337 ··· 1345 1345 } 1346 1346 1347 1347 if (0) 1348 - intel_sdvo_set_encoder_power_state(intel_output, mode); 1349 - intel_sdvo_set_active_outputs(intel_output, sdvo_priv->controlled_output); 1348 + intel_sdvo_set_encoder_power_state(intel_encoder, mode); 1349 + intel_sdvo_set_active_outputs(intel_encoder, sdvo_priv->controlled_output); 1350 1350 } 1351 1351 return; 1352 1352 } ··· 1355 1355 { 1356 1356 struct drm_device *dev = connector->dev; 1357 1357 struct drm_i915_private *dev_priv = dev->dev_private; 1358 - struct intel_output *intel_output = to_intel_output(connector); 1359 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1358 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1359 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1360 1360 int o; 1361 1361 1362 - sdvo_priv->save_sdvo_mult = intel_sdvo_get_clock_rate_mult(intel_output); 1363 - intel_sdvo_get_active_outputs(intel_output, &sdvo_priv->save_active_outputs); 1362 + sdvo_priv->save_sdvo_mult = intel_sdvo_get_clock_rate_mult(intel_encoder); 1363 + intel_sdvo_get_active_outputs(intel_encoder, &sdvo_priv->save_active_outputs); 1364 1364 1365 1365 if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { 1366 - intel_sdvo_set_target_input(intel_output, true, false); 1367 - intel_sdvo_get_input_timing(intel_output, 1366 + intel_sdvo_set_target_input(intel_encoder, true, false); 1367 + intel_sdvo_get_input_timing(intel_encoder, 1368 1368 &sdvo_priv->save_input_dtd_1); 1369 1369 } 1370 1370 1371 1371 if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { 1372 - intel_sdvo_set_target_input(intel_output, false, true); 1373 - intel_sdvo_get_input_timing(intel_output, 1372 + intel_sdvo_set_target_input(intel_encoder, false, true); 1373 + intel_sdvo_get_input_timing(intel_encoder, 1374 1374 &sdvo_priv->save_input_dtd_2); 1375 1375 } 1376 1376 ··· 1379 1379 u16 this_output = (1 << o); 1380 1380 if (sdvo_priv->caps.output_flags & this_output) 1381 1381 { 1382 - intel_sdvo_set_target_output(intel_output, this_output); 1383 - intel_sdvo_get_output_timing(intel_output, 1382 + intel_sdvo_set_target_output(intel_encoder, this_output); 1383 + intel_sdvo_get_output_timing(intel_encoder, 1384 1384 &sdvo_priv->save_output_dtd[o]); 1385 1385 } 1386 1386 } ··· 1394 1394 static void intel_sdvo_restore(struct drm_connector *connector) 1395 1395 { 1396 1396 struct drm_device *dev = connector->dev; 1397 - struct intel_output *intel_output = to_intel_output(connector); 1398 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1397 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1398 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1399 1399 int o; 1400 1400 int i; 1401 1401 bool input1, input2; 1402 1402 u8 status; 1403 1403 1404 - intel_sdvo_set_active_outputs(intel_output, 0); 1404 + intel_sdvo_set_active_outputs(intel_encoder, 0); 1405 1405 1406 1406 for (o = SDVO_OUTPUT_FIRST; o <= SDVO_OUTPUT_LAST; o++) 1407 1407 { 1408 1408 u16 this_output = (1 << o); 1409 1409 if (sdvo_priv->caps.output_flags & this_output) { 1410 - intel_sdvo_set_target_output(intel_output, this_output); 1411 - intel_sdvo_set_output_timing(intel_output, &sdvo_priv->save_output_dtd[o]); 1410 + intel_sdvo_set_target_output(intel_encoder, this_output); 1411 + intel_sdvo_set_output_timing(intel_encoder, &sdvo_priv->save_output_dtd[o]); 1412 1412 } 1413 1413 } 1414 1414 1415 1415 if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { 1416 - intel_sdvo_set_target_input(intel_output, true, false); 1417 - intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_1); 1416 + intel_sdvo_set_target_input(intel_encoder, true, false); 1417 + intel_sdvo_set_input_timing(intel_encoder, &sdvo_priv->save_input_dtd_1); 1418 1418 } 1419 1419 1420 1420 if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { 1421 - intel_sdvo_set_target_input(intel_output, false, true); 1422 - intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_2); 1421 + intel_sdvo_set_target_input(intel_encoder, false, true); 1422 + intel_sdvo_set_input_timing(intel_encoder, &sdvo_priv->save_input_dtd_2); 1423 1423 } 1424 1424 1425 - intel_sdvo_set_clock_rate_mult(intel_output, sdvo_priv->save_sdvo_mult); 1425 + intel_sdvo_set_clock_rate_mult(intel_encoder, sdvo_priv->save_sdvo_mult); 1426 1426 1427 1427 if (sdvo_priv->is_tv) { 1428 1428 /* XXX: Restore TV format/enhancements. */ 1429 1429 } 1430 1430 1431 - intel_sdvo_write_sdvox(intel_output, sdvo_priv->save_SDVOX); 1431 + intel_sdvo_write_sdvox(intel_encoder, sdvo_priv->save_SDVOX); 1432 1432 1433 1433 if (sdvo_priv->save_SDVOX & SDVO_ENABLE) 1434 1434 { 1435 1435 for (i = 0; i < 2; i++) 1436 1436 intel_wait_for_vblank(dev); 1437 - status = intel_sdvo_get_trained_inputs(intel_output, &input1, &input2); 1437 + status = intel_sdvo_get_trained_inputs(intel_encoder, &input1, &input2); 1438 1438 if (status == SDVO_CMD_STATUS_SUCCESS && !input1) 1439 1439 DRM_DEBUG_KMS("First %s output reported failure to " 1440 1440 "sync\n", SDVO_NAME(sdvo_priv)); 1441 1441 } 1442 1442 1443 - intel_sdvo_set_active_outputs(intel_output, sdvo_priv->save_active_outputs); 1443 + intel_sdvo_set_active_outputs(intel_encoder, sdvo_priv->save_active_outputs); 1444 1444 } 1445 1445 1446 1446 static int intel_sdvo_mode_valid(struct drm_connector *connector, 1447 1447 struct drm_display_mode *mode) 1448 1448 { 1449 - struct intel_output *intel_output = to_intel_output(connector); 1450 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1449 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1450 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1451 1451 1452 1452 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) 1453 1453 return MODE_NO_DBLESCAN; ··· 1472 1472 return MODE_OK; 1473 1473 } 1474 1474 1475 - static bool intel_sdvo_get_capabilities(struct intel_output *intel_output, struct intel_sdvo_caps *caps) 1475 + static bool intel_sdvo_get_capabilities(struct intel_encoder *intel_encoder, struct intel_sdvo_caps *caps) 1476 1476 { 1477 1477 u8 status; 1478 1478 1479 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_DEVICE_CAPS, NULL, 0); 1480 - status = intel_sdvo_read_response(intel_output, caps, sizeof(*caps)); 1479 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_DEVICE_CAPS, NULL, 0); 1480 + status = intel_sdvo_read_response(intel_encoder, caps, sizeof(*caps)); 1481 1481 if (status != SDVO_CMD_STATUS_SUCCESS) 1482 1482 return false; 1483 1483 ··· 1487 1487 struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB) 1488 1488 { 1489 1489 struct drm_connector *connector = NULL; 1490 - struct intel_output *iout = NULL; 1490 + struct intel_encoder *iout = NULL; 1491 1491 struct intel_sdvo_priv *sdvo; 1492 1492 1493 1493 /* find the sdvo connector */ 1494 1494 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 1495 - iout = to_intel_output(connector); 1495 + iout = to_intel_encoder(connector); 1496 1496 1497 1497 if (iout->type != INTEL_OUTPUT_SDVO) 1498 1498 continue; ··· 1514 1514 { 1515 1515 u8 response[2]; 1516 1516 u8 status; 1517 - struct intel_output *intel_output; 1517 + struct intel_encoder *intel_encoder; 1518 1518 DRM_DEBUG_KMS("\n"); 1519 1519 1520 1520 if (!connector) 1521 1521 return 0; 1522 1522 1523 - intel_output = to_intel_output(connector); 1523 + intel_encoder = to_intel_encoder(connector); 1524 1524 1525 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); 1526 - status = intel_sdvo_read_response(intel_output, &response, 2); 1525 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); 1526 + status = intel_sdvo_read_response(intel_encoder, &response, 2); 1527 1527 1528 1528 if (response[0] !=0) 1529 1529 return 1; ··· 1535 1535 { 1536 1536 u8 response[2]; 1537 1537 u8 status; 1538 - struct intel_output *intel_output = to_intel_output(connector); 1538 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1539 1539 1540 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1541 - intel_sdvo_read_response(intel_output, &response, 2); 1540 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1541 + intel_sdvo_read_response(intel_encoder, &response, 2); 1542 1542 1543 1543 if (on) { 1544 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); 1545 - status = intel_sdvo_read_response(intel_output, &response, 2); 1544 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); 1545 + status = intel_sdvo_read_response(intel_encoder, &response, 2); 1546 1546 1547 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1547 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1548 1548 } else { 1549 1549 response[0] = 0; 1550 1550 response[1] = 0; 1551 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1551 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1552 1552 } 1553 1553 1554 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1555 - intel_sdvo_read_response(intel_output, &response, 2); 1554 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1555 + intel_sdvo_read_response(intel_encoder, &response, 2); 1556 1556 } 1557 1557 1558 1558 static bool 1559 - intel_sdvo_multifunc_encoder(struct intel_output *intel_output) 1559 + intel_sdvo_multifunc_encoder(struct intel_encoder *intel_encoder) 1560 1560 { 1561 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1561 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1562 1562 int caps = 0; 1563 1563 1564 1564 if (sdvo_priv->caps.output_flags & ··· 1592 1592 intel_find_analog_connector(struct drm_device *dev) 1593 1593 { 1594 1594 struct drm_connector *connector; 1595 - struct intel_output *intel_output; 1595 + struct intel_encoder *intel_encoder; 1596 1596 1597 1597 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 1598 - intel_output = to_intel_output(connector); 1599 - if (intel_output->type == INTEL_OUTPUT_ANALOG) 1598 + intel_encoder = to_intel_encoder(connector); 1599 + if (intel_encoder->type == INTEL_OUTPUT_ANALOG) 1600 1600 return connector; 1601 1601 } 1602 1602 return NULL; ··· 1621 1621 enum drm_connector_status 1622 1622 intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) 1623 1623 { 1624 - struct intel_output *intel_output = to_intel_output(connector); 1625 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1624 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1625 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1626 1626 enum drm_connector_status status = connector_status_connected; 1627 1627 struct edid *edid = NULL; 1628 1628 1629 - edid = drm_get_edid(&intel_output->base, 1630 - intel_output->ddc_bus); 1629 + edid = drm_get_edid(&intel_encoder->base, 1630 + intel_encoder->ddc_bus); 1631 1631 1632 1632 /* This is only applied to SDVO cards with multiple outputs */ 1633 - if (edid == NULL && intel_sdvo_multifunc_encoder(intel_output)) { 1633 + if (edid == NULL && intel_sdvo_multifunc_encoder(intel_encoder)) { 1634 1634 uint8_t saved_ddc, temp_ddc; 1635 1635 saved_ddc = sdvo_priv->ddc_bus; 1636 1636 temp_ddc = sdvo_priv->ddc_bus >> 1; ··· 1640 1640 */ 1641 1641 while(temp_ddc > 1) { 1642 1642 sdvo_priv->ddc_bus = temp_ddc; 1643 - edid = drm_get_edid(&intel_output->base, 1644 - intel_output->ddc_bus); 1643 + edid = drm_get_edid(&intel_encoder->base, 1644 + intel_encoder->ddc_bus); 1645 1645 if (edid) { 1646 1646 /* 1647 1647 * When we can get the EDID, maybe it is the ··· 1660 1660 */ 1661 1661 if (edid == NULL && 1662 1662 sdvo_priv->analog_ddc_bus && 1663 - !intel_analog_is_connected(intel_output->base.dev)) 1664 - edid = drm_get_edid(&intel_output->base, 1663 + !intel_analog_is_connected(intel_encoder->base.dev)) 1664 + edid = drm_get_edid(&intel_encoder->base, 1665 1665 sdvo_priv->analog_ddc_bus); 1666 1666 if (edid != NULL) { 1667 1667 /* Don't report the output as connected if it's a DVI-I ··· 1676 1676 } 1677 1677 1678 1678 kfree(edid); 1679 - intel_output->base.display_info.raw_edid = NULL; 1679 + intel_encoder->base.display_info.raw_edid = NULL; 1680 1680 1681 1681 } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) 1682 1682 status = connector_status_disconnected; ··· 1688 1688 { 1689 1689 uint16_t response; 1690 1690 u8 status; 1691 - struct intel_output *intel_output = to_intel_output(connector); 1692 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1691 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1692 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1693 1693 1694 - intel_sdvo_write_cmd(intel_output, 1694 + intel_sdvo_write_cmd(intel_encoder, 1695 1695 SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); 1696 1696 if (sdvo_priv->is_tv) { 1697 1697 /* add 30ms delay when the output type is SDVO-TV */ 1698 1698 mdelay(30); 1699 1699 } 1700 - status = intel_sdvo_read_response(intel_output, &response, 2); 1700 + status = intel_sdvo_read_response(intel_encoder, &response, 2); 1701 1701 1702 1702 DRM_DEBUG_KMS("SDVO response %d %d\n", response & 0xff, response >> 8); 1703 1703 ··· 1707 1707 if (response == 0) 1708 1708 return connector_status_disconnected; 1709 1709 1710 - if (intel_sdvo_multifunc_encoder(intel_output) && 1710 + if (intel_sdvo_multifunc_encoder(intel_encoder) && 1711 1711 sdvo_priv->attached_output != response) { 1712 1712 if (sdvo_priv->controlled_output != response && 1713 - intel_sdvo_output_setup(intel_output, response) != true) 1713 + intel_sdvo_output_setup(intel_encoder, response) != true) 1714 1714 return connector_status_unknown; 1715 1715 sdvo_priv->attached_output = response; 1716 1716 } ··· 1719 1719 1720 1720 static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) 1721 1721 { 1722 - struct intel_output *intel_output = to_intel_output(connector); 1723 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1722 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1723 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1724 1724 int num_modes; 1725 1725 1726 1726 /* set the bus switch and get the modes */ 1727 - num_modes = intel_ddc_get_modes(intel_output); 1727 + num_modes = intel_ddc_get_modes(intel_encoder); 1728 1728 1729 1729 /* 1730 1730 * Mac mini hack. On this device, the DVI-I connector shares one DDC ··· 1734 1734 */ 1735 1735 if (num_modes == 0 && 1736 1736 sdvo_priv->analog_ddc_bus && 1737 - !intel_analog_is_connected(intel_output->base.dev)) { 1737 + !intel_analog_is_connected(intel_encoder->base.dev)) { 1738 1738 struct i2c_adapter *digital_ddc_bus; 1739 1739 1740 1740 /* Switch to the analog ddc bus and try that 1741 1741 */ 1742 - digital_ddc_bus = intel_output->ddc_bus; 1743 - intel_output->ddc_bus = sdvo_priv->analog_ddc_bus; 1742 + digital_ddc_bus = intel_encoder->ddc_bus; 1743 + intel_encoder->ddc_bus = sdvo_priv->analog_ddc_bus; 1744 1744 1745 - (void) intel_ddc_get_modes(intel_output); 1745 + (void) intel_ddc_get_modes(intel_encoder); 1746 1746 1747 - intel_output->ddc_bus = digital_ddc_bus; 1747 + intel_encoder->ddc_bus = digital_ddc_bus; 1748 1748 } 1749 1749 } 1750 1750 ··· 1815 1815 1816 1816 static void intel_sdvo_get_tv_modes(struct drm_connector *connector) 1817 1817 { 1818 - struct intel_output *output = to_intel_output(connector); 1818 + struct intel_encoder *output = to_intel_encoder(connector); 1819 1819 struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 1820 1820 struct intel_sdvo_sdtv_resolution_request tv_res; 1821 1821 uint32_t reply = 0, format_map = 0; ··· 1857 1857 1858 1858 static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) 1859 1859 { 1860 - struct intel_output *intel_output = to_intel_output(connector); 1860 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1861 1861 struct drm_i915_private *dev_priv = connector->dev->dev_private; 1862 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1862 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1863 1863 struct drm_display_mode *newmode; 1864 1864 1865 1865 /* ··· 1867 1867 * Assume that the preferred modes are 1868 1868 * arranged in priority order. 1869 1869 */ 1870 - intel_ddc_get_modes(intel_output); 1870 + intel_ddc_get_modes(intel_encoder); 1871 1871 if (list_empty(&connector->probed_modes) == false) 1872 1872 goto end; 1873 1873 ··· 1896 1896 1897 1897 static int intel_sdvo_get_modes(struct drm_connector *connector) 1898 1898 { 1899 - struct intel_output *output = to_intel_output(connector); 1899 + struct intel_encoder *output = to_intel_encoder(connector); 1900 1900 struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 1901 1901 1902 1902 if (sdvo_priv->is_tv) ··· 1914 1914 static 1915 1915 void intel_sdvo_destroy_enhance_property(struct drm_connector *connector) 1916 1916 { 1917 - struct intel_output *intel_output = to_intel_output(connector); 1918 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1917 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1918 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1919 1919 struct drm_device *dev = connector->dev; 1920 1920 1921 1921 if (sdvo_priv->is_tv) { ··· 1952 1952 1953 1953 static void intel_sdvo_destroy(struct drm_connector *connector) 1954 1954 { 1955 - struct intel_output *intel_output = to_intel_output(connector); 1956 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1955 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1956 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1957 1957 1958 - if (intel_output->i2c_bus) 1959 - intel_i2c_destroy(intel_output->i2c_bus); 1960 - if (intel_output->ddc_bus) 1961 - intel_i2c_destroy(intel_output->ddc_bus); 1958 + if (intel_encoder->i2c_bus) 1959 + intel_i2c_destroy(intel_encoder->i2c_bus); 1960 + if (intel_encoder->ddc_bus) 1961 + intel_i2c_destroy(intel_encoder->ddc_bus); 1962 1962 if (sdvo_priv->analog_ddc_bus) 1963 1963 intel_i2c_destroy(sdvo_priv->analog_ddc_bus); 1964 1964 ··· 1976 1976 drm_sysfs_connector_remove(connector); 1977 1977 drm_connector_cleanup(connector); 1978 1978 1979 - kfree(intel_output); 1979 + kfree(intel_encoder); 1980 1980 } 1981 1981 1982 1982 static int ··· 1984 1984 struct drm_property *property, 1985 1985 uint64_t val) 1986 1986 { 1987 - struct intel_output *intel_output = to_intel_output(connector); 1988 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1989 - struct drm_encoder *encoder = &intel_output->enc; 1987 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1988 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 1989 + struct drm_encoder *encoder = &intel_encoder->enc; 1990 1990 struct drm_crtc *crtc = encoder->crtc; 1991 1991 int ret = 0; 1992 1992 bool changed = false; ··· 2094 2094 sdvo_priv->cur_brightness = temp_value; 2095 2095 } 2096 2096 if (cmd) { 2097 - intel_sdvo_write_cmd(intel_output, cmd, &temp_value, 2); 2098 - status = intel_sdvo_read_response(intel_output, 2097 + intel_sdvo_write_cmd(intel_encoder, cmd, &temp_value, 2); 2098 + status = intel_sdvo_read_response(intel_encoder, 2099 2099 NULL, 0); 2100 2100 if (status != SDVO_CMD_STATUS_SUCCESS) { 2101 2101 DRM_DEBUG_KMS("Incorrect SDVO command \n"); ··· 2190 2190 } 2191 2191 2192 2192 static bool 2193 - intel_sdvo_get_digital_encoding_mode(struct intel_output *output) 2193 + intel_sdvo_get_digital_encoding_mode(struct intel_encoder *output) 2194 2194 { 2195 2195 struct intel_sdvo_priv *sdvo_priv = output->dev_priv; 2196 2196 uint8_t status; ··· 2204 2204 return true; 2205 2205 } 2206 2206 2207 - static struct intel_output * 2208 - intel_sdvo_chan_to_intel_output(struct intel_i2c_chan *chan) 2207 + static struct intel_encoder * 2208 + intel_sdvo_chan_to_intel_encoder(struct intel_i2c_chan *chan) 2209 2209 { 2210 2210 struct drm_device *dev = chan->drm_dev; 2211 2211 struct drm_connector *connector; 2212 - struct intel_output *intel_output = NULL; 2212 + struct intel_encoder *intel_encoder = NULL; 2213 2213 2214 2214 list_for_each_entry(connector, 2215 2215 &dev->mode_config.connector_list, head) { 2216 - if (to_intel_output(connector)->ddc_bus == &chan->adapter) { 2217 - intel_output = to_intel_output(connector); 2216 + if (to_intel_encoder(connector)->ddc_bus == &chan->adapter) { 2217 + intel_encoder = to_intel_encoder(connector); 2218 2218 break; 2219 2219 } 2220 2220 } 2221 - return intel_output; 2221 + return intel_encoder; 2222 2222 } 2223 2223 2224 2224 static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap, 2225 2225 struct i2c_msg msgs[], int num) 2226 2226 { 2227 - struct intel_output *intel_output; 2227 + struct intel_encoder *intel_encoder; 2228 2228 struct intel_sdvo_priv *sdvo_priv; 2229 2229 struct i2c_algo_bit_data *algo_data; 2230 2230 const struct i2c_algorithm *algo; 2231 2231 2232 2232 algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data; 2233 - intel_output = 2234 - intel_sdvo_chan_to_intel_output( 2233 + intel_encoder = 2234 + intel_sdvo_chan_to_intel_encoder( 2235 2235 (struct intel_i2c_chan *)(algo_data->data)); 2236 - if (intel_output == NULL) 2236 + if (intel_encoder == NULL) 2237 2237 return -EINVAL; 2238 2238 2239 - sdvo_priv = intel_output->dev_priv; 2240 - algo = intel_output->i2c_bus->algo; 2239 + sdvo_priv = intel_encoder->dev_priv; 2240 + algo = intel_encoder->i2c_bus->algo; 2241 2241 2242 - intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus); 2242 + intel_sdvo_set_control_bus_switch(intel_encoder, sdvo_priv->ddc_bus); 2243 2243 return algo->master_xfer(i2c_adap, msgs, num); 2244 2244 } 2245 2245 ··· 2304 2304 }; 2305 2305 2306 2306 static bool 2307 - intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) 2307 + intel_sdvo_output_setup(struct intel_encoder *intel_encoder, uint16_t flags) 2308 2308 { 2309 - struct drm_connector *connector = &intel_output->base; 2310 - struct drm_encoder *encoder = &intel_output->enc; 2311 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 2309 + struct drm_connector *connector = &intel_encoder->base; 2310 + struct drm_encoder *encoder = &intel_encoder->enc; 2311 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 2312 2312 bool ret = true, registered = false; 2313 2313 2314 2314 sdvo_priv->is_tv = false; 2315 - intel_output->needs_tv_clock = false; 2315 + intel_encoder->needs_tv_clock = false; 2316 2316 sdvo_priv->is_lvds = false; 2317 2317 2318 2318 if (device_is_registered(&connector->kdev)) { ··· 2330 2330 encoder->encoder_type = DRM_MODE_ENCODER_TMDS; 2331 2331 connector->connector_type = DRM_MODE_CONNECTOR_DVID; 2332 2332 2333 - if (intel_sdvo_get_supp_encode(intel_output, 2333 + if (intel_sdvo_get_supp_encode(intel_encoder, 2334 2334 &sdvo_priv->encode) && 2335 - intel_sdvo_get_digital_encoding_mode(intel_output) && 2335 + intel_sdvo_get_digital_encoding_mode(intel_encoder) && 2336 2336 sdvo_priv->is_hdmi) { 2337 2337 /* enable hdmi encoding mode if supported */ 2338 - intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI); 2339 - intel_sdvo_set_colorimetry(intel_output, 2338 + intel_sdvo_set_encode(intel_encoder, SDVO_ENCODE_HDMI); 2339 + intel_sdvo_set_colorimetry(intel_encoder, 2340 2340 SDVO_COLORIMETRY_RGB256); 2341 2341 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; 2342 - intel_output->clone_mask = 2342 + intel_encoder->clone_mask = 2343 2343 (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 2344 2344 (1 << INTEL_ANALOG_CLONE_BIT); 2345 2345 } ··· 2350 2350 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; 2351 2351 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; 2352 2352 sdvo_priv->is_tv = true; 2353 - intel_output->needs_tv_clock = true; 2354 - intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; 2353 + intel_encoder->needs_tv_clock = true; 2354 + intel_encoder->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; 2355 2355 } else if (flags & SDVO_OUTPUT_RGB0) { 2356 2356 2357 2357 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; 2358 2358 encoder->encoder_type = DRM_MODE_ENCODER_DAC; 2359 2359 connector->connector_type = DRM_MODE_CONNECTOR_VGA; 2360 - intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 2360 + intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 2361 2361 (1 << INTEL_ANALOG_CLONE_BIT); 2362 2362 } else if (flags & SDVO_OUTPUT_RGB1) { 2363 2363 2364 2364 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; 2365 2365 encoder->encoder_type = DRM_MODE_ENCODER_DAC; 2366 2366 connector->connector_type = DRM_MODE_CONNECTOR_VGA; 2367 - intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 2367 + intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | 2368 2368 (1 << INTEL_ANALOG_CLONE_BIT); 2369 2369 } else if (flags & SDVO_OUTPUT_CVBS0) { 2370 2370 ··· 2372 2372 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; 2373 2373 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; 2374 2374 sdvo_priv->is_tv = true; 2375 - intel_output->needs_tv_clock = true; 2376 - intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; 2375 + intel_encoder->needs_tv_clock = true; 2376 + intel_encoder->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; 2377 2377 } else if (flags & SDVO_OUTPUT_LVDS0) { 2378 2378 2379 2379 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0; 2380 2380 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; 2381 2381 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; 2382 2382 sdvo_priv->is_lvds = true; 2383 - intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 2383 + intel_encoder->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 2384 2384 (1 << INTEL_SDVO_LVDS_CLONE_BIT); 2385 2385 } else if (flags & SDVO_OUTPUT_LVDS1) { 2386 2386 ··· 2388 2388 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; 2389 2389 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; 2390 2390 sdvo_priv->is_lvds = true; 2391 - intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 2391 + intel_encoder->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT) | 2392 2392 (1 << INTEL_SDVO_LVDS_CLONE_BIT); 2393 2393 } else { 2394 2394 ··· 2401 2401 bytes[0], bytes[1]); 2402 2402 ret = false; 2403 2403 } 2404 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 2404 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 2405 2405 2406 2406 if (ret && registered) 2407 2407 ret = drm_sysfs_connector_add(connector) == 0 ? true : false; ··· 2413 2413 2414 2414 static void intel_sdvo_tv_create_property(struct drm_connector *connector) 2415 2415 { 2416 - struct intel_output *intel_output = to_intel_output(connector); 2417 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 2416 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 2417 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 2418 2418 struct intel_sdvo_tv_format format; 2419 2419 uint32_t format_map, i; 2420 2420 uint8_t status; 2421 2421 2422 - intel_sdvo_set_target_output(intel_output, 2422 + intel_sdvo_set_target_output(intel_encoder, 2423 2423 sdvo_priv->controlled_output); 2424 2424 2425 - intel_sdvo_write_cmd(intel_output, 2425 + intel_sdvo_write_cmd(intel_encoder, 2426 2426 SDVO_CMD_GET_SUPPORTED_TV_FORMATS, NULL, 0); 2427 - status = intel_sdvo_read_response(intel_output, 2427 + status = intel_sdvo_read_response(intel_encoder, 2428 2428 &format, sizeof(format)); 2429 2429 if (status != SDVO_CMD_STATUS_SUCCESS) 2430 2430 return; ··· 2462 2462 2463 2463 static void intel_sdvo_create_enhance_property(struct drm_connector *connector) 2464 2464 { 2465 - struct intel_output *intel_output = to_intel_output(connector); 2466 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 2465 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 2466 + struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; 2467 2467 struct intel_sdvo_enhancements_reply sdvo_data; 2468 2468 struct drm_device *dev = connector->dev; 2469 2469 uint8_t status; 2470 2470 uint16_t response, data_value[2]; 2471 2471 2472 - intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, 2472 + intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, 2473 2473 NULL, 0); 2474 - status = intel_sdvo_read_response(intel_output, &sdvo_data, 2474 + status = intel_sdvo_read_response(intel_encoder, &sdvo_data, 2475 2475 sizeof(sdvo_data)); 2476 2476 if (status != SDVO_CMD_STATUS_SUCCESS) { 2477 2477 DRM_DEBUG_KMS(" incorrect response is returned\n"); ··· 2487 2487 * property 2488 2488 */ 2489 2489 if (sdvo_data.overscan_h) { 2490 - intel_sdvo_write_cmd(intel_output, 2490 + intel_sdvo_write_cmd(intel_encoder, 2491 2491 SDVO_CMD_GET_MAX_OVERSCAN_H, NULL, 0); 2492 - status = intel_sdvo_read_response(intel_output, 2492 + status = intel_sdvo_read_response(intel_encoder, 2493 2493 &data_value, 4); 2494 2494 if (status != SDVO_CMD_STATUS_SUCCESS) { 2495 2495 DRM_DEBUG_KMS("Incorrect SDVO max " 2496 2496 "h_overscan\n"); 2497 2497 return; 2498 2498 } 2499 - intel_sdvo_write_cmd(intel_output, 2499 + intel_sdvo_write_cmd(intel_encoder, 2500 2500 SDVO_CMD_GET_OVERSCAN_H, NULL, 0); 2501 - status = intel_sdvo_read_response(intel_output, 2501 + status = intel_sdvo_read_response(intel_encoder, 2502 2502 &response, 2); 2503 2503 if (status != SDVO_CMD_STATUS_SUCCESS) { 2504 2504 DRM_DEBUG_KMS("Incorrect SDVO h_overscan\n"); ··· 2528 2528 data_value[0], data_value[1], response); 2529 2529 } 2530 2530 if (sdvo_data.overscan_v) { 2531 - intel_sdvo_write_cmd(intel_output, 2531 + intel_sdvo_write_cmd(intel_encoder, 2532 2532 SDVO_CMD_GET_MAX_OVERSCAN_V, NULL, 0); 2533 - status = intel_sdvo_read_response(intel_output, 2533 + status = intel_sdvo_read_response(intel_encoder, 2534 2534 &data_value, 4); 2535 2535 if (status != SDVO_CMD_STATUS_SUCCESS) { 2536 2536 DRM_DEBUG_KMS("Incorrect SDVO max " 2537 2537 "v_overscan\n"); 2538 2538 return; 2539 2539 } 2540 - intel_sdvo_write_cmd(intel_output, 2540 + intel_sdvo_write_cmd(intel_encoder, 2541 2541 SDVO_CMD_GET_OVERSCAN_V, NULL, 0); 2542 - status = intel_sdvo_read_response(intel_output, 2542 + status = intel_sdvo_read_response(intel_encoder, 2543 2543 &response, 2); 2544 2544 if (status != SDVO_CMD_STATUS_SUCCESS) { 2545 2545 DRM_DEBUG_KMS("Incorrect SDVO v_overscan\n"); ··· 2569 2569 data_value[0], data_value[1], response); 2570 2570 } 2571 2571 if (sdvo_data.position_h) { 2572 - intel_sdvo_write_cmd(intel_output, 2572 + intel_sdvo_write_cmd(intel_encoder, 2573 2573 SDVO_CMD_GET_MAX_POSITION_H, NULL, 0); 2574 - status = intel_sdvo_read_response(intel_output, 2574 + status = intel_sdvo_read_response(intel_encoder, 2575 2575 &data_value, 4); 2576 2576 if (status != SDVO_CMD_STATUS_SUCCESS) { 2577 2577 DRM_DEBUG_KMS("Incorrect SDVO Max h_pos\n"); 2578 2578 return; 2579 2579 } 2580 - intel_sdvo_write_cmd(intel_output, 2580 + intel_sdvo_write_cmd(intel_encoder, 2581 2581 SDVO_CMD_GET_POSITION_H, NULL, 0); 2582 - status = intel_sdvo_read_response(intel_output, 2582 + status = intel_sdvo_read_response(intel_encoder, 2583 2583 &response, 2); 2584 2584 if (status != SDVO_CMD_STATUS_SUCCESS) { 2585 2585 DRM_DEBUG_KMS("Incorrect SDVO get h_postion\n"); ··· 2600 2600 data_value[0], data_value[1], response); 2601 2601 } 2602 2602 if (sdvo_data.position_v) { 2603 - intel_sdvo_write_cmd(intel_output, 2603 + intel_sdvo_write_cmd(intel_encoder, 2604 2604 SDVO_CMD_GET_MAX_POSITION_V, NULL, 0); 2605 - status = intel_sdvo_read_response(intel_output, 2605 + status = intel_sdvo_read_response(intel_encoder, 2606 2606 &data_value, 4); 2607 2607 if (status != SDVO_CMD_STATUS_SUCCESS) { 2608 2608 DRM_DEBUG_KMS("Incorrect SDVO Max v_pos\n"); 2609 2609 return; 2610 2610 } 2611 - intel_sdvo_write_cmd(intel_output, 2611 + intel_sdvo_write_cmd(intel_encoder, 2612 2612 SDVO_CMD_GET_POSITION_V, NULL, 0); 2613 - status = intel_sdvo_read_response(intel_output, 2613 + status = intel_sdvo_read_response(intel_encoder, 2614 2614 &response, 2); 2615 2615 if (status != SDVO_CMD_STATUS_SUCCESS) { 2616 2616 DRM_DEBUG_KMS("Incorrect SDVO get v_postion\n"); ··· 2633 2633 } 2634 2634 if (sdvo_priv->is_tv) { 2635 2635 if (sdvo_data.saturation) { 2636 - intel_sdvo_write_cmd(intel_output, 2636 + intel_sdvo_write_cmd(intel_encoder, 2637 2637 SDVO_CMD_GET_MAX_SATURATION, NULL, 0); 2638 - status = intel_sdvo_read_response(intel_output, 2638 + status = intel_sdvo_read_response(intel_encoder, 2639 2639 &data_value, 4); 2640 2640 if (status != SDVO_CMD_STATUS_SUCCESS) { 2641 2641 DRM_DEBUG_KMS("Incorrect SDVO Max sat\n"); 2642 2642 return; 2643 2643 } 2644 - intel_sdvo_write_cmd(intel_output, 2644 + intel_sdvo_write_cmd(intel_encoder, 2645 2645 SDVO_CMD_GET_SATURATION, NULL, 0); 2646 - status = intel_sdvo_read_response(intel_output, 2646 + status = intel_sdvo_read_response(intel_encoder, 2647 2647 &response, 2); 2648 2648 if (status != SDVO_CMD_STATUS_SUCCESS) { 2649 2649 DRM_DEBUG_KMS("Incorrect SDVO get sat\n"); ··· 2665 2665 data_value[0], data_value[1], response); 2666 2666 } 2667 2667 if (sdvo_data.contrast) { 2668 - intel_sdvo_write_cmd(intel_output, 2668 + intel_sdvo_write_cmd(intel_encoder, 2669 2669 SDVO_CMD_GET_MAX_CONTRAST, NULL, 0); 2670 - status = intel_sdvo_read_response(intel_output, 2670 + status = intel_sdvo_read_response(intel_encoder, 2671 2671 &data_value, 4); 2672 2672 if (status != SDVO_CMD_STATUS_SUCCESS) { 2673 2673 DRM_DEBUG_KMS("Incorrect SDVO Max contrast\n"); 2674 2674 return; 2675 2675 } 2676 - intel_sdvo_write_cmd(intel_output, 2676 + intel_sdvo_write_cmd(intel_encoder, 2677 2677 SDVO_CMD_GET_CONTRAST, NULL, 0); 2678 - status = intel_sdvo_read_response(intel_output, 2678 + status = intel_sdvo_read_response(intel_encoder, 2679 2679 &response, 2); 2680 2680 if (status != SDVO_CMD_STATUS_SUCCESS) { 2681 2681 DRM_DEBUG_KMS("Incorrect SDVO get contrast\n"); ··· 2696 2696 data_value[0], data_value[1], response); 2697 2697 } 2698 2698 if (sdvo_data.hue) { 2699 - intel_sdvo_write_cmd(intel_output, 2699 + intel_sdvo_write_cmd(intel_encoder, 2700 2700 SDVO_CMD_GET_MAX_HUE, NULL, 0); 2701 - status = intel_sdvo_read_response(intel_output, 2701 + status = intel_sdvo_read_response(intel_encoder, 2702 2702 &data_value, 4); 2703 2703 if (status != SDVO_CMD_STATUS_SUCCESS) { 2704 2704 DRM_DEBUG_KMS("Incorrect SDVO Max hue\n"); 2705 2705 return; 2706 2706 } 2707 - intel_sdvo_write_cmd(intel_output, 2707 + intel_sdvo_write_cmd(intel_encoder, 2708 2708 SDVO_CMD_GET_HUE, NULL, 0); 2709 - status = intel_sdvo_read_response(intel_output, 2709 + status = intel_sdvo_read_response(intel_encoder, 2710 2710 &response, 2); 2711 2711 if (status != SDVO_CMD_STATUS_SUCCESS) { 2712 2712 DRM_DEBUG_KMS("Incorrect SDVO get hue\n"); ··· 2729 2729 } 2730 2730 if (sdvo_priv->is_tv || sdvo_priv->is_lvds) { 2731 2731 if (sdvo_data.brightness) { 2732 - intel_sdvo_write_cmd(intel_output, 2732 + intel_sdvo_write_cmd(intel_encoder, 2733 2733 SDVO_CMD_GET_MAX_BRIGHTNESS, NULL, 0); 2734 - status = intel_sdvo_read_response(intel_output, 2734 + status = intel_sdvo_read_response(intel_encoder, 2735 2735 &data_value, 4); 2736 2736 if (status != SDVO_CMD_STATUS_SUCCESS) { 2737 2737 DRM_DEBUG_KMS("Incorrect SDVO Max bright\n"); 2738 2738 return; 2739 2739 } 2740 - intel_sdvo_write_cmd(intel_output, 2740 + intel_sdvo_write_cmd(intel_encoder, 2741 2741 SDVO_CMD_GET_BRIGHTNESS, NULL, 0); 2742 - status = intel_sdvo_read_response(intel_output, 2742 + status = intel_sdvo_read_response(intel_encoder, 2743 2743 &response, 2); 2744 2744 if (status != SDVO_CMD_STATUS_SUCCESS) { 2745 2745 DRM_DEBUG_KMS("Incorrect SDVO get brigh\n"); ··· 2768 2768 { 2769 2769 struct drm_i915_private *dev_priv = dev->dev_private; 2770 2770 struct drm_connector *connector; 2771 - struct intel_output *intel_output; 2771 + struct intel_encoder *intel_encoder; 2772 2772 struct intel_sdvo_priv *sdvo_priv; 2773 2773 2774 2774 u8 ch[0x40]; 2775 2775 int i; 2776 2776 2777 - intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); 2778 - if (!intel_output) { 2777 + intel_encoder = kcalloc(sizeof(struct intel_encoder)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); 2778 + if (!intel_encoder) { 2779 2779 return false; 2780 2780 } 2781 2781 2782 - sdvo_priv = (struct intel_sdvo_priv *)(intel_output + 1); 2782 + sdvo_priv = (struct intel_sdvo_priv *)(intel_encoder + 1); 2783 2783 sdvo_priv->output_device = output_device; 2784 2784 2785 - intel_output->dev_priv = sdvo_priv; 2786 - intel_output->type = INTEL_OUTPUT_SDVO; 2785 + intel_encoder->dev_priv = sdvo_priv; 2786 + intel_encoder->type = INTEL_OUTPUT_SDVO; 2787 2787 2788 2788 /* setup the DDC bus. */ 2789 2789 if (output_device == SDVOB) 2790 - intel_output->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB"); 2790 + intel_encoder->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB"); 2791 2791 else 2792 - intel_output->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC"); 2792 + intel_encoder->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC"); 2793 2793 2794 - if (!intel_output->i2c_bus) 2794 + if (!intel_encoder->i2c_bus) 2795 2795 goto err_inteloutput; 2796 2796 2797 2797 sdvo_priv->slave_addr = intel_sdvo_get_slave_addr(dev, output_device); 2798 2798 2799 2799 /* Save the bit-banging i2c functionality for use by the DDC wrapper */ 2800 - intel_sdvo_i2c_bit_algo.functionality = intel_output->i2c_bus->algo->functionality; 2800 + intel_sdvo_i2c_bit_algo.functionality = intel_encoder->i2c_bus->algo->functionality; 2801 2801 2802 2802 /* Read the regs to test if we can talk to the device */ 2803 2803 for (i = 0; i < 0x40; i++) { 2804 - if (!intel_sdvo_read_byte(intel_output, i, &ch[i])) { 2804 + if (!intel_sdvo_read_byte(intel_encoder, i, &ch[i])) { 2805 2805 DRM_DEBUG_KMS("No SDVO device found on SDVO%c\n", 2806 2806 output_device == SDVOB ? 'B' : 'C'); 2807 2807 goto err_i2c; ··· 2810 2810 2811 2811 /* setup the DDC bus. */ 2812 2812 if (output_device == SDVOB) { 2813 - intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS"); 2813 + intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS"); 2814 2814 sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, 2815 2815 "SDVOB/VGA DDC BUS"); 2816 2816 dev_priv->hotplug_supported_mask |= SDVOB_HOTPLUG_INT_STATUS; 2817 2817 } else { 2818 - intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS"); 2818 + intel_encoder->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS"); 2819 2819 sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, 2820 2820 "SDVOC/VGA DDC BUS"); 2821 2821 dev_priv->hotplug_supported_mask |= SDVOC_HOTPLUG_INT_STATUS; 2822 2822 } 2823 2823 2824 - if (intel_output->ddc_bus == NULL) 2824 + if (intel_encoder->ddc_bus == NULL) 2825 2825 goto err_i2c; 2826 2826 2827 2827 /* Wrap with our custom algo which switches to DDC mode */ 2828 - intel_output->ddc_bus->algo = &intel_sdvo_i2c_bit_algo; 2828 + intel_encoder->ddc_bus->algo = &intel_sdvo_i2c_bit_algo; 2829 2829 2830 2830 /* In default case sdvo lvds is false */ 2831 - intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps); 2831 + intel_sdvo_get_capabilities(intel_encoder, &sdvo_priv->caps); 2832 2832 2833 - if (intel_sdvo_output_setup(intel_output, 2833 + if (intel_sdvo_output_setup(intel_encoder, 2834 2834 sdvo_priv->caps.output_flags) != true) { 2835 2835 DRM_DEBUG_KMS("SDVO output failed to setup on SDVO%c\n", 2836 2836 output_device == SDVOB ? 'B' : 'C'); ··· 2838 2838 } 2839 2839 2840 2840 2841 - connector = &intel_output->base; 2841 + connector = &intel_encoder->base; 2842 2842 drm_connector_init(dev, connector, &intel_sdvo_connector_funcs, 2843 2843 connector->connector_type); 2844 2844 ··· 2847 2847 connector->doublescan_allowed = 0; 2848 2848 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 2849 2849 2850 - drm_encoder_init(dev, &intel_output->enc, 2851 - &intel_sdvo_enc_funcs, intel_output->enc.encoder_type); 2850 + drm_encoder_init(dev, &intel_encoder->enc, 2851 + &intel_sdvo_enc_funcs, intel_encoder->enc.encoder_type); 2852 2852 2853 - drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs); 2853 + drm_encoder_helper_add(&intel_encoder->enc, &intel_sdvo_helper_funcs); 2854 2854 2855 - drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 2855 + drm_mode_connector_attach_encoder(&intel_encoder->base, &intel_encoder->enc); 2856 2856 if (sdvo_priv->is_tv) 2857 2857 intel_sdvo_tv_create_property(connector); 2858 2858 ··· 2864 2864 intel_sdvo_select_ddc_bus(sdvo_priv); 2865 2865 2866 2866 /* Set the input timing to the screen. Assume always input 0. */ 2867 - intel_sdvo_set_target_input(intel_output, true, false); 2867 + intel_sdvo_set_target_input(intel_encoder, true, false); 2868 2868 2869 - intel_sdvo_get_input_pixel_clock_range(intel_output, 2869 + intel_sdvo_get_input_pixel_clock_range(intel_encoder, 2870 2870 &sdvo_priv->pixel_clock_min, 2871 2871 &sdvo_priv->pixel_clock_max); 2872 2872 ··· 2893 2893 err_i2c: 2894 2894 if (sdvo_priv->analog_ddc_bus != NULL) 2895 2895 intel_i2c_destroy(sdvo_priv->analog_ddc_bus); 2896 - if (intel_output->ddc_bus != NULL) 2897 - intel_i2c_destroy(intel_output->ddc_bus); 2898 - if (intel_output->i2c_bus != NULL) 2899 - intel_i2c_destroy(intel_output->i2c_bus); 2896 + if (intel_encoder->ddc_bus != NULL) 2897 + intel_i2c_destroy(intel_encoder->ddc_bus); 2898 + if (intel_encoder->i2c_bus != NULL) 2899 + intel_i2c_destroy(intel_encoder->i2c_bus); 2900 2900 err_inteloutput: 2901 - kfree(intel_output); 2901 + kfree(intel_encoder); 2902 2902 2903 2903 return false; 2904 2904 }
+48 -48
drivers/gpu/drm/i915/intel_tv.c
··· 921 921 { 922 922 struct drm_device *dev = connector->dev; 923 923 struct drm_i915_private *dev_priv = dev->dev_private; 924 - struct intel_output *intel_output = to_intel_output(connector); 925 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 924 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 925 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 926 926 int i; 927 927 928 928 tv_priv->save_TV_H_CTL_1 = I915_READ(TV_H_CTL_1); ··· 971 971 { 972 972 struct drm_device *dev = connector->dev; 973 973 struct drm_i915_private *dev_priv = dev->dev_private; 974 - struct intel_output *intel_output = to_intel_output(connector); 975 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 974 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 975 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 976 976 struct drm_crtc *crtc = connector->encoder->crtc; 977 977 struct intel_crtc *intel_crtc; 978 978 int i; ··· 1068 1068 } 1069 1069 1070 1070 static const struct tv_mode * 1071 - intel_tv_mode_find (struct intel_output *intel_output) 1071 + intel_tv_mode_find (struct intel_encoder *intel_encoder) 1072 1072 { 1073 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1073 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 1074 1074 1075 1075 return intel_tv_mode_lookup(tv_priv->tv_format); 1076 1076 } ··· 1078 1078 static enum drm_mode_status 1079 1079 intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) 1080 1080 { 1081 - struct intel_output *intel_output = to_intel_output(connector); 1082 - const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1081 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1082 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder); 1083 1083 1084 1084 /* Ensure TV refresh is close to desired refresh */ 1085 1085 if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) ··· 1095 1095 { 1096 1096 struct drm_device *dev = encoder->dev; 1097 1097 struct drm_mode_config *drm_config = &dev->mode_config; 1098 - struct intel_output *intel_output = enc_to_intel_output(encoder); 1099 - const struct tv_mode *tv_mode = intel_tv_mode_find (intel_output); 1098 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 1099 + const struct tv_mode *tv_mode = intel_tv_mode_find (intel_encoder); 1100 1100 struct drm_encoder *other_encoder; 1101 1101 1102 1102 if (!tv_mode) ··· 1121 1121 struct drm_i915_private *dev_priv = dev->dev_private; 1122 1122 struct drm_crtc *crtc = encoder->crtc; 1123 1123 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 1124 - struct intel_output *intel_output = enc_to_intel_output(encoder); 1125 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1126 - const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1124 + struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); 1125 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 1126 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder); 1127 1127 u32 tv_ctl; 1128 1128 u32 hctl1, hctl2, hctl3; 1129 1129 u32 vctl1, vctl2, vctl3, vctl4, vctl5, vctl6, vctl7; ··· 1360 1360 * \return false if TV is disconnected. 1361 1361 */ 1362 1362 static int 1363 - intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output) 1363 + intel_tv_detect_type (struct drm_crtc *crtc, struct intel_encoder *intel_encoder) 1364 1364 { 1365 - struct drm_encoder *encoder = &intel_output->enc; 1365 + struct drm_encoder *encoder = &intel_encoder->enc; 1366 1366 struct drm_device *dev = encoder->dev; 1367 1367 struct drm_i915_private *dev_priv = dev->dev_private; 1368 1368 unsigned long irqflags; ··· 1441 1441 */ 1442 1442 static void intel_tv_find_better_format(struct drm_connector *connector) 1443 1443 { 1444 - struct intel_output *intel_output = to_intel_output(connector); 1445 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1446 - const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1444 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1445 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 1446 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder); 1447 1447 int i; 1448 1448 1449 1449 if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) == ··· 1475 1475 { 1476 1476 struct drm_crtc *crtc; 1477 1477 struct drm_display_mode mode; 1478 - struct intel_output *intel_output = to_intel_output(connector); 1479 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1480 - struct drm_encoder *encoder = &intel_output->enc; 1478 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1479 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 1480 + struct drm_encoder *encoder = &intel_encoder->enc; 1481 1481 int dpms_mode; 1482 1482 int type = tv_priv->type; 1483 1483 ··· 1485 1485 drm_mode_set_crtcinfo(&mode, CRTC_INTERLACE_HALVE_V); 1486 1486 1487 1487 if (encoder->crtc && encoder->crtc->enabled) { 1488 - type = intel_tv_detect_type(encoder->crtc, intel_output); 1488 + type = intel_tv_detect_type(encoder->crtc, intel_encoder); 1489 1489 } else { 1490 - crtc = intel_get_load_detect_pipe(intel_output, &mode, &dpms_mode); 1490 + crtc = intel_get_load_detect_pipe(intel_encoder, &mode, &dpms_mode); 1491 1491 if (crtc) { 1492 - type = intel_tv_detect_type(crtc, intel_output); 1493 - intel_release_load_detect_pipe(intel_output, dpms_mode); 1492 + type = intel_tv_detect_type(crtc, intel_encoder); 1493 + intel_release_load_detect_pipe(intel_encoder, dpms_mode); 1494 1494 } else 1495 1495 type = -1; 1496 1496 } ··· 1525 1525 intel_tv_chose_preferred_modes(struct drm_connector *connector, 1526 1526 struct drm_display_mode *mode_ptr) 1527 1527 { 1528 - struct intel_output *intel_output = to_intel_output(connector); 1529 - const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1528 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1529 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder); 1530 1530 1531 1531 if (tv_mode->nbr_end < 480 && mode_ptr->vdisplay == 480) 1532 1532 mode_ptr->type |= DRM_MODE_TYPE_PREFERRED; ··· 1550 1550 intel_tv_get_modes(struct drm_connector *connector) 1551 1551 { 1552 1552 struct drm_display_mode *mode_ptr; 1553 - struct intel_output *intel_output = to_intel_output(connector); 1554 - const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); 1553 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1554 + const struct tv_mode *tv_mode = intel_tv_mode_find(intel_encoder); 1555 1555 int j, count = 0; 1556 1556 u64 tmp; 1557 1557 ··· 1604 1604 static void 1605 1605 intel_tv_destroy (struct drm_connector *connector) 1606 1606 { 1607 - struct intel_output *intel_output = to_intel_output(connector); 1607 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1608 1608 1609 1609 drm_sysfs_connector_remove(connector); 1610 1610 drm_connector_cleanup(connector); 1611 - kfree(intel_output); 1611 + kfree(intel_encoder); 1612 1612 } 1613 1613 1614 1614 ··· 1617 1617 uint64_t val) 1618 1618 { 1619 1619 struct drm_device *dev = connector->dev; 1620 - struct intel_output *intel_output = to_intel_output(connector); 1621 - struct intel_tv_priv *tv_priv = intel_output->dev_priv; 1622 - struct drm_encoder *encoder = &intel_output->enc; 1620 + struct intel_encoder *intel_encoder = to_intel_encoder(connector); 1621 + struct intel_tv_priv *tv_priv = intel_encoder->dev_priv; 1622 + struct drm_encoder *encoder = &intel_encoder->enc; 1623 1623 struct drm_crtc *crtc = encoder->crtc; 1624 1624 int ret = 0; 1625 1625 bool changed = false; ··· 1740 1740 { 1741 1741 struct drm_i915_private *dev_priv = dev->dev_private; 1742 1742 struct drm_connector *connector; 1743 - struct intel_output *intel_output; 1743 + struct intel_encoder *intel_encoder; 1744 1744 struct intel_tv_priv *tv_priv; 1745 1745 u32 tv_dac_on, tv_dac_off, save_tv_dac; 1746 1746 char **tv_format_names; ··· 1780 1780 (tv_dac_off & TVDAC_STATE_CHG_EN) != 0) 1781 1781 return; 1782 1782 1783 - intel_output = kzalloc(sizeof(struct intel_output) + 1783 + intel_encoder = kzalloc(sizeof(struct intel_encoder) + 1784 1784 sizeof(struct intel_tv_priv), GFP_KERNEL); 1785 - if (!intel_output) { 1785 + if (!intel_encoder) { 1786 1786 return; 1787 1787 } 1788 1788 1789 - connector = &intel_output->base; 1789 + connector = &intel_encoder->base; 1790 1790 1791 1791 drm_connector_init(dev, connector, &intel_tv_connector_funcs, 1792 1792 DRM_MODE_CONNECTOR_SVIDEO); 1793 1793 1794 - drm_encoder_init(dev, &intel_output->enc, &intel_tv_enc_funcs, 1794 + drm_encoder_init(dev, &intel_encoder->enc, &intel_tv_enc_funcs, 1795 1795 DRM_MODE_ENCODER_TVDAC); 1796 1796 1797 - drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 1798 - tv_priv = (struct intel_tv_priv *)(intel_output + 1); 1799 - intel_output->type = INTEL_OUTPUT_TVOUT; 1800 - intel_output->crtc_mask = (1 << 0) | (1 << 1); 1801 - intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT); 1802 - intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1)); 1803 - intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT); 1804 - intel_output->dev_priv = tv_priv; 1797 + drm_mode_connector_attach_encoder(&intel_encoder->base, &intel_encoder->enc); 1798 + tv_priv = (struct intel_tv_priv *)(intel_encoder + 1); 1799 + intel_encoder->type = INTEL_OUTPUT_TVOUT; 1800 + intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 1801 + intel_encoder->clone_mask = (1 << INTEL_TV_CLONE_BIT); 1802 + intel_encoder->enc.possible_crtcs = ((1 << 0) | (1 << 1)); 1803 + intel_encoder->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT); 1804 + intel_encoder->dev_priv = tv_priv; 1805 1805 tv_priv->type = DRM_MODE_CONNECTOR_Unknown; 1806 1806 1807 1807 /* BIOS margin values */ ··· 1812 1812 1813 1813 tv_priv->tv_format = kstrdup(tv_modes[initial_mode].name, GFP_KERNEL); 1814 1814 1815 - drm_encoder_helper_add(&intel_output->enc, &intel_tv_helper_funcs); 1815 + drm_encoder_helper_add(&intel_encoder->enc, &intel_tv_helper_funcs); 1816 1816 drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs); 1817 1817 connector->interlace_allowed = false; 1818 1818 connector->doublescan_allowed = false;