diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-25 14:11:14 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-03-25 15:27:32 -0400 |
commit | 21d40d37eca86872f2bf0af995809ebdef25c9d9 (patch) | |
tree | b9626f936392f223fa7d001de38213a177bfe7fd /drivers/gpu/drm/i915/intel_sdvo.c | |
parent | 5e64499f3d39c633de49320e399479642c2b1743 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 572 |
1 files changed, 286 insertions, 286 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 48daee5c9c63..ea6de3b14954 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -161,18 +161,18 @@ struct intel_sdvo_priv { | |||
161 | }; | 161 | }; |
162 | 162 | ||
163 | static bool | 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 | * Writes the SDVOB or SDVOC with the given value, but always writes both | 167 | * Writes the SDVOB or SDVOC with the given value, but always writes both |
168 | * SDVOB and SDVOC to work around apparent hardware issues (according to | 168 | * SDVOB and SDVOC to work around apparent hardware issues (according to |
169 | * comments in the BIOS). | 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 | struct drm_i915_private *dev_priv = dev->dev_private; | 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 | u32 bval = val, cval = val; | 176 | u32 bval = val, cval = val; |
177 | int i; | 177 | int i; |
178 | 178 | ||
@@ -195,10 +195,10 @@ static void intel_sdvo_write_sdvox(struct intel_output *intel_output, u32 val) | |||
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 | u8 *ch) | 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 | u8 out_buf[2]; | 202 | u8 out_buf[2]; |
203 | u8 buf[2]; | 203 | u8 buf[2]; |
204 | int ret; | 204 | int ret; |
@@ -221,7 +221,7 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr, | |||
221 | out_buf[0] = addr; | 221 | out_buf[0] = addr; |
222 | out_buf[1] = 0; | 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 | *ch = buf[0]; | 226 | *ch = buf[0]; |
227 | return true; | 227 | return true; |
@@ -231,10 +231,10 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr, | |||
231 | return false; | 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 | u8 ch) | 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 | u8 out_buf[2]; | 238 | u8 out_buf[2]; |
239 | struct i2c_msg msgs[] = { | 239 | struct i2c_msg msgs[] = { |
240 | { | 240 | { |
@@ -248,7 +248,7 @@ static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr, | |||
248 | out_buf[0] = addr; | 248 | out_buf[0] = addr; |
249 | out_buf[1] = ch; | 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 | return true; | 253 | return true; |
254 | } | 254 | } |
@@ -355,10 +355,10 @@ static const struct _sdvo_cmd_name { | |||
355 | #define SDVO_NAME(dev_priv) ((dev_priv)->output_device == SDVOB ? "SDVOB" : "SDVOC") | 355 | #define SDVO_NAME(dev_priv) ((dev_priv)->output_device == SDVOB ? "SDVOB" : "SDVOC") |
356 | #define SDVO_PRIV(output) ((struct intel_sdvo_priv *) (output)->dev_priv) | 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 | void *args, int args_len) | 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 | int i; | 362 | int i; |
363 | 363 | ||
364 | DRM_DEBUG_KMS("%s: W: %02X ", | 364 | DRM_DEBUG_KMS("%s: W: %02X ", |
@@ -378,19 +378,19 @@ static void intel_sdvo_debug_write(struct intel_output *intel_output, u8 cmd, | |||
378 | DRM_LOG_KMS("\n"); | 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 | void *args, int args_len) | 382 | void *args, int args_len) |
383 | { | 383 | { |
384 | int i; | 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 | for (i = 0; i < args_len; i++) { | 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 | ((u8*)args)[i]); | 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 | static const char *cmd_status_names[] = { | 396 | static const char *cmd_status_names[] = { |
@@ -403,11 +403,11 @@ static const char *cmd_status_names[] = { | |||
403 | "Scaling not supported" | 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 | void *response, int response_len, | 407 | void *response, int response_len, |
408 | u8 status) | 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 | int i; | 411 | int i; |
412 | 412 | ||
413 | DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(sdvo_priv)); | 413 | DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(sdvo_priv)); |
@@ -422,7 +422,7 @@ static void intel_sdvo_debug_response(struct intel_output *intel_output, | |||
422 | DRM_LOG_KMS("\n"); | 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 | void *response, int response_len) | 426 | void *response, int response_len) |
427 | { | 427 | { |
428 | int i; | 428 | int i; |
@@ -432,16 +432,16 @@ static u8 intel_sdvo_read_response(struct intel_output *intel_output, | |||
432 | while (retry--) { | 432 | while (retry--) { |
433 | /* Read the command response */ | 433 | /* Read the command response */ |
434 | for (i = 0; i < response_len; i++) { | 434 | for (i = 0; i < response_len; i++) { |
435 | intel_sdvo_read_byte(intel_output, | 435 | intel_sdvo_read_byte(intel_encoder, |
436 | SDVO_I2C_RETURN_0 + i, | 436 | SDVO_I2C_RETURN_0 + i, |
437 | &((u8 *)response)[i]); | 437 | &((u8 *)response)[i]); |
438 | } | 438 | } |
439 | 439 | ||
440 | /* read the return status */ | 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 | &status); | 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 | status); | 445 | status); |
446 | if (status != SDVO_CMD_STATUS_PENDING) | 446 | if (status != SDVO_CMD_STATUS_PENDING) |
447 | return status; | 447 | return status; |
@@ -469,10 +469,10 @@ static int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode) | |||
469 | * another I2C transaction after issuing the DDC bus switch, it will be | 469 | * another I2C transaction after issuing the DDC bus switch, it will be |
470 | * switched to the internal SDVO register. | 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 | u8 target) | 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 | u8 out_buf[2], cmd_buf[2], ret_value[2], ret; | 476 | u8 out_buf[2], cmd_buf[2], ret_value[2], ret; |
477 | struct i2c_msg msgs[] = { | 477 | struct i2c_msg msgs[] = { |
478 | { | 478 | { |
@@ -496,10 +496,10 @@ static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, | |||
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 | &target, 1); | 500 | &target, 1); |
501 | /* write the DDC switch command argument */ | 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 | out_buf[0] = SDVO_I2C_OPCODE; | 504 | out_buf[0] = SDVO_I2C_OPCODE; |
505 | out_buf[1] = SDVO_CMD_SET_CONTROL_BUS_SWITCH; | 505 | out_buf[1] = SDVO_CMD_SET_CONTROL_BUS_SWITCH; |
@@ -508,7 +508,7 @@ static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, | |||
508 | ret_value[0] = 0; | 508 | ret_value[0] = 0; |
509 | ret_value[1] = 0; | 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 | if (ret != 3) { | 512 | if (ret != 3) { |
513 | /* failure in I2C transfer */ | 513 | /* failure in I2C transfer */ |
514 | DRM_DEBUG_KMS("I2c transfer returned %d\n", ret); | 514 | DRM_DEBUG_KMS("I2c transfer returned %d\n", ret); |
@@ -522,7 +522,7 @@ static void intel_sdvo_set_control_bus_switch(struct intel_output *intel_output, | |||
522 | return; | 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 | struct intel_sdvo_set_target_input_args targets = {0}; | 527 | struct intel_sdvo_set_target_input_args targets = {0}; |
528 | u8 status; | 528 | u8 status; |
@@ -533,10 +533,10 @@ static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool | |||
533 | if (target_1) | 533 | if (target_1) |
534 | targets.target_1 = 1; | 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 | sizeof(targets)); | 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 | return (status == SDVO_CMD_STATUS_SUCCESS); | 541 | return (status == SDVO_CMD_STATUS_SUCCESS); |
542 | } | 542 | } |
@@ -547,13 +547,13 @@ static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool | |||
547 | * This function is making an assumption about the layout of the response, | 547 | * This function is making an assumption about the layout of the response, |
548 | * which should be checked against the docs. | 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 | struct intel_sdvo_get_trained_inputs_response response; | 552 | struct intel_sdvo_get_trained_inputs_response response; |
553 | u8 status; | 553 | u8 status; |
554 | 554 | ||
555 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_TRAINED_INPUTS, NULL, 0); | 555 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_TRAINED_INPUTS, NULL, 0); |
556 | status = intel_sdvo_read_response(intel_output, &response, sizeof(response)); | 556 | status = intel_sdvo_read_response(intel_encoder, &response, sizeof(response)); |
557 | if (status != SDVO_CMD_STATUS_SUCCESS) | 557 | if (status != SDVO_CMD_STATUS_SUCCESS) |
558 | return false; | 558 | return false; |
559 | 559 | ||
@@ -562,29 +562,29 @@ static bool intel_sdvo_get_trained_inputs(struct intel_output *intel_output, boo | |||
562 | return true; | 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 | u16 *outputs) | 566 | u16 *outputs) |
567 | { | 567 | { |
568 | u8 status; | 568 | u8 status; |
569 | 569 | ||
570 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ACTIVE_OUTPUTS, NULL, 0); | 570 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_OUTPUTS, NULL, 0); |
571 | status = intel_sdvo_read_response(intel_output, outputs, sizeof(*outputs)); | 571 | status = intel_sdvo_read_response(intel_encoder, outputs, sizeof(*outputs)); |
572 | 572 | ||
573 | return (status == SDVO_CMD_STATUS_SUCCESS); | 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 | u16 outputs) | 577 | u16 outputs) |
578 | { | 578 | { |
579 | u8 status; | 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 | sizeof(outputs)); | 582 | sizeof(outputs)); |
583 | status = intel_sdvo_read_response(intel_output, NULL, 0); | 583 | status = intel_sdvo_read_response(intel_encoder, NULL, 0); |
584 | return (status == SDVO_CMD_STATUS_SUCCESS); | 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 | int mode) | 588 | int mode) |
589 | { | 589 | { |
590 | u8 status, state = SDVO_ENCODER_STATE_ON; | 590 | u8 status, state = SDVO_ENCODER_STATE_ON; |
@@ -604,24 +604,24 @@ static bool intel_sdvo_set_encoder_power_state(struct intel_output *intel_output | |||
604 | break; | 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 | sizeof(state)); | 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 | return (status == SDVO_CMD_STATUS_SUCCESS); | 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 | int *clock_min, | 615 | int *clock_min, |
616 | int *clock_max) | 616 | int *clock_max) |
617 | { | 617 | { |
618 | struct intel_sdvo_pixel_clock_range clocks; | 618 | struct intel_sdvo_pixel_clock_range clocks; |
619 | u8 status; | 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 | NULL, 0); | 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 | if (status != SDVO_CMD_STATUS_SUCCESS) | 626 | if (status != SDVO_CMD_STATUS_SUCCESS) |
627 | return false; | 627 | return false; |
@@ -633,31 +633,31 @@ static bool intel_sdvo_get_input_pixel_clock_range(struct intel_output *intel_ou | |||
633 | return true; | 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 | u16 outputs) | 637 | u16 outputs) |
638 | { | 638 | { |
639 | u8 status; | 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 | sizeof(outputs)); | 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 | return (status == SDVO_CMD_STATUS_SUCCESS); | 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 | struct intel_sdvo_dtd *dtd) | 649 | struct intel_sdvo_dtd *dtd) |
650 | { | 650 | { |
651 | u8 status; | 651 | u8 status; |
652 | 652 | ||
653 | intel_sdvo_write_cmd(intel_output, cmd, NULL, 0); | 653 | intel_sdvo_write_cmd(intel_encoder, cmd, NULL, 0); |
654 | status = intel_sdvo_read_response(intel_output, &dtd->part1, | 654 | status = intel_sdvo_read_response(intel_encoder, &dtd->part1, |
655 | sizeof(dtd->part1)); | 655 | sizeof(dtd->part1)); |
656 | if (status != SDVO_CMD_STATUS_SUCCESS) | 656 | if (status != SDVO_CMD_STATUS_SUCCESS) |
657 | return false; | 657 | return false; |
658 | 658 | ||
659 | intel_sdvo_write_cmd(intel_output, cmd + 1, NULL, 0); | 659 | intel_sdvo_write_cmd(intel_encoder, cmd + 1, NULL, 0); |
660 | status = intel_sdvo_read_response(intel_output, &dtd->part2, | 660 | status = intel_sdvo_read_response(intel_encoder, &dtd->part2, |
661 | sizeof(dtd->part2)); | 661 | sizeof(dtd->part2)); |
662 | if (status != SDVO_CMD_STATUS_SUCCESS) | 662 | if (status != SDVO_CMD_STATUS_SUCCESS) |
663 | return false; | 663 | return false; |
@@ -665,54 +665,54 @@ static bool intel_sdvo_get_timing(struct intel_output *intel_output, u8 cmd, | |||
665 | return true; | 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 | struct intel_sdvo_dtd *dtd) | 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 | SDVO_CMD_GET_INPUT_TIMINGS_PART1, dtd); | 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 | struct intel_sdvo_dtd *dtd) | 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 | SDVO_CMD_GET_OUTPUT_TIMINGS_PART1, dtd); | 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 | struct intel_sdvo_dtd *dtd) | 683 | struct intel_sdvo_dtd *dtd) |
684 | { | 684 | { |
685 | u8 status; | 685 | u8 status; |
686 | 686 | ||
687 | intel_sdvo_write_cmd(intel_output, cmd, &dtd->part1, sizeof(dtd->part1)); | 687 | intel_sdvo_write_cmd(intel_encoder, cmd, &dtd->part1, sizeof(dtd->part1)); |
688 | status = intel_sdvo_read_response(intel_output, NULL, 0); | 688 | status = intel_sdvo_read_response(intel_encoder, NULL, 0); |
689 | if (status != SDVO_CMD_STATUS_SUCCESS) | 689 | if (status != SDVO_CMD_STATUS_SUCCESS) |
690 | return false; | 690 | return false; |
691 | 691 | ||
692 | intel_sdvo_write_cmd(intel_output, cmd + 1, &dtd->part2, sizeof(dtd->part2)); | 692 | intel_sdvo_write_cmd(intel_encoder, cmd + 1, &dtd->part2, sizeof(dtd->part2)); |
693 | status = intel_sdvo_read_response(intel_output, NULL, 0); | 693 | status = intel_sdvo_read_response(intel_encoder, NULL, 0); |
694 | if (status != SDVO_CMD_STATUS_SUCCESS) | 694 | if (status != SDVO_CMD_STATUS_SUCCESS) |
695 | return false; | 695 | return false; |
696 | 696 | ||
697 | return true; | 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 | struct intel_sdvo_dtd *dtd) | 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 | SDVO_CMD_SET_INPUT_TIMINGS_PART1, dtd); | 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 | struct intel_sdvo_dtd *dtd) | 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 | SDVO_CMD_SET_OUTPUT_TIMINGS_PART1, dtd); | 711 | SDVO_CMD_SET_OUTPUT_TIMINGS_PART1, dtd); |
712 | } | 712 | } |
713 | 713 | ||
714 | static bool | 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 | uint16_t clock, | 716 | uint16_t clock, |
717 | uint16_t width, | 717 | uint16_t width, |
718 | uint16_t height) | 718 | uint16_t height) |
@@ -741,7 +741,7 @@ intel_sdvo_create_preferred_input_timing(struct intel_output *output, | |||
741 | return true; | 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 | struct intel_sdvo_dtd *dtd) | 745 | struct intel_sdvo_dtd *dtd) |
746 | { | 746 | { |
747 | bool status; | 747 | bool status; |
@@ -765,12 +765,12 @@ static bool intel_sdvo_get_preferred_input_timing(struct intel_output *output, | |||
765 | return false; | 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 | u8 response, status; | 770 | u8 response, status; |
771 | 771 | ||
772 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_CLOCK_RATE_MULT, NULL, 0); | 772 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_CLOCK_RATE_MULT, NULL, 0); |
773 | status = intel_sdvo_read_response(intel_output, &response, 1); | 773 | status = intel_sdvo_read_response(intel_encoder, &response, 1); |
774 | 774 | ||
775 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 775 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
776 | DRM_DEBUG_KMS("Couldn't get SDVO clock rate multiplier\n"); | 776 | DRM_DEBUG_KMS("Couldn't get SDVO clock rate multiplier\n"); |
@@ -782,12 +782,12 @@ static int intel_sdvo_get_clock_rate_mult(struct intel_output *intel_output) | |||
782 | return response; | 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 | u8 status; | 787 | u8 status; |
788 | 788 | ||
789 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); | 789 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); |
790 | status = intel_sdvo_read_response(intel_output, NULL, 0); | 790 | status = intel_sdvo_read_response(intel_encoder, NULL, 0); |
791 | if (status != SDVO_CMD_STATUS_SUCCESS) | 791 | if (status != SDVO_CMD_STATUS_SUCCESS) |
792 | return false; | 792 | return false; |
793 | 793 | ||
@@ -876,7 +876,7 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode, | |||
876 | mode->flags |= DRM_MODE_FLAG_PVSYNC; | 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 | struct intel_sdvo_encode *encode) | 880 | struct intel_sdvo_encode *encode) |
881 | { | 881 | { |
882 | uint8_t status; | 882 | uint8_t status; |
@@ -891,7 +891,7 @@ static bool intel_sdvo_get_supp_encode(struct intel_output *output, | |||
891 | return true; | 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 | uint8_t status; | 896 | uint8_t status; |
897 | 897 | ||
@@ -901,7 +901,7 @@ static bool intel_sdvo_set_encode(struct intel_output *output, uint8_t mode) | |||
901 | return (status == SDVO_CMD_STATUS_SUCCESS); | 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 | uint8_t mode) | 905 | uint8_t mode) |
906 | { | 906 | { |
907 | uint8_t status; | 907 | uint8_t status; |
@@ -913,7 +913,7 @@ static bool intel_sdvo_set_colorimetry(struct intel_output *output, | |||
913 | } | 913 | } |
914 | 914 | ||
915 | #if 0 | 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 | int i, j; | 918 | int i, j; |
919 | uint8_t set_buf_index[2]; | 919 | uint8_t set_buf_index[2]; |
@@ -943,7 +943,7 @@ static void intel_sdvo_dump_hdmi_buf(struct intel_output *output) | |||
943 | } | 943 | } |
944 | #endif | 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 | uint8_t *data, int8_t size, uint8_t tx_rate) | 947 | uint8_t *data, int8_t size, uint8_t tx_rate) |
948 | { | 948 | { |
949 | uint8_t set_buf_index[2]; | 949 | uint8_t set_buf_index[2]; |
@@ -1033,7 +1033,7 @@ struct dip_infoframe { | |||
1033 | } __attribute__ ((packed)) u; | 1033 | } __attribute__ ((packed)) u; |
1034 | } __attribute__((packed)); | 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 | struct drm_display_mode * mode) | 1037 | struct drm_display_mode * mode) |
1038 | { | 1038 | { |
1039 | struct dip_infoframe avi_if = { | 1039 | struct dip_infoframe avi_if = { |
@@ -1048,7 +1048,7 @@ static void intel_sdvo_set_avi_infoframe(struct intel_output *output, | |||
1048 | SDVO_HBUF_TX_VSYNC); | 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 | struct intel_sdvo_tv_format format; | 1054 | struct intel_sdvo_tv_format format; |
@@ -1078,7 +1078,7 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
1078 | struct drm_display_mode *mode, | 1078 | struct drm_display_mode *mode, |
1079 | struct drm_display_mode *adjusted_mode) | 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 | struct intel_sdvo_priv *dev_priv = output->dev_priv; | 1082 | struct intel_sdvo_priv *dev_priv = output->dev_priv; |
1083 | 1083 | ||
1084 | if (dev_priv->is_tv) { | 1084 | if (dev_priv->is_tv) { |
@@ -1181,7 +1181,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
1181 | struct drm_i915_private *dev_priv = dev->dev_private; | 1181 | struct drm_i915_private *dev_priv = dev->dev_private; |
1182 | struct drm_crtc *crtc = encoder->crtc; | 1182 | struct drm_crtc *crtc = encoder->crtc; |
1183 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 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 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; | 1185 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; |
1186 | u32 sdvox = 0; | 1186 | u32 sdvox = 0; |
1187 | int sdvo_pixel_multiply; | 1187 | int sdvo_pixel_multiply; |
@@ -1305,19 +1305,19 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | |||
1305 | { | 1305 | { |
1306 | struct drm_device *dev = encoder->dev; | 1306 | struct drm_device *dev = encoder->dev; |
1307 | struct drm_i915_private *dev_priv = dev->dev_private; | 1307 | struct drm_i915_private *dev_priv = dev->dev_private; |
1308 | struct intel_output *intel_output = enc_to_intel_output(encoder); | 1308 | struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder); |
1309 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1309 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1310 | u32 temp; | 1310 | u32 temp; |
1311 | 1311 | ||
1312 | if (mode != DRM_MODE_DPMS_ON) { | 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 | if (0) | 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 | if (mode == DRM_MODE_DPMS_OFF) { | 1317 | if (mode == DRM_MODE_DPMS_OFF) { |
1318 | temp = I915_READ(sdvo_priv->output_device); | 1318 | temp = I915_READ(sdvo_priv->output_device); |
1319 | if ((temp & SDVO_ENABLE) != 0) { | 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 | } else { | 1323 | } else { |
@@ -1327,11 +1327,11 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | |||
1327 | 1327 | ||
1328 | temp = I915_READ(sdvo_priv->output_device); | 1328 | temp = I915_READ(sdvo_priv->output_device); |
1329 | if ((temp & SDVO_ENABLE) == 0) | 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 | for (i = 0; i < 2; i++) | 1331 | for (i = 0; i < 2; i++) |
1332 | intel_wait_for_vblank(dev); | 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 | &input2); | 1335 | &input2); |
1336 | 1336 | ||
1337 | 1337 | ||
@@ -1345,8 +1345,8 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | |||
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | if (0) | 1347 | if (0) |
1348 | intel_sdvo_set_encoder_power_state(intel_output, mode); | 1348 | intel_sdvo_set_encoder_power_state(intel_encoder, mode); |
1349 | intel_sdvo_set_active_outputs(intel_output, sdvo_priv->controlled_output); | 1349 | intel_sdvo_set_active_outputs(intel_encoder, sdvo_priv->controlled_output); |
1350 | } | 1350 | } |
1351 | return; | 1351 | return; |
1352 | } | 1352 | } |
@@ -1355,22 +1355,22 @@ static void intel_sdvo_save(struct drm_connector *connector) | |||
1355 | { | 1355 | { |
1356 | struct drm_device *dev = connector->dev; | 1356 | struct drm_device *dev = connector->dev; |
1357 | struct drm_i915_private *dev_priv = dev->dev_private; | 1357 | struct drm_i915_private *dev_priv = dev->dev_private; |
1358 | struct intel_output *intel_output = to_intel_output(connector); | 1358 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1359 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1359 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1360 | int o; | 1360 | int o; |
1361 | 1361 | ||
1362 | sdvo_priv->save_sdvo_mult = intel_sdvo_get_clock_rate_mult(intel_output); | 1362 | sdvo_priv->save_sdvo_mult = intel_sdvo_get_clock_rate_mult(intel_encoder); |
1363 | intel_sdvo_get_active_outputs(intel_output, &sdvo_priv->save_active_outputs); | 1363 | intel_sdvo_get_active_outputs(intel_encoder, &sdvo_priv->save_active_outputs); |
1364 | 1364 | ||
1365 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { | 1365 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { |
1366 | intel_sdvo_set_target_input(intel_output, true, false); | 1366 | intel_sdvo_set_target_input(intel_encoder, true, false); |
1367 | intel_sdvo_get_input_timing(intel_output, | 1367 | intel_sdvo_get_input_timing(intel_encoder, |
1368 | &sdvo_priv->save_input_dtd_1); | 1368 | &sdvo_priv->save_input_dtd_1); |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { | 1371 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { |
1372 | intel_sdvo_set_target_input(intel_output, false, true); | 1372 | intel_sdvo_set_target_input(intel_encoder, false, true); |
1373 | intel_sdvo_get_input_timing(intel_output, | 1373 | intel_sdvo_get_input_timing(intel_encoder, |
1374 | &sdvo_priv->save_input_dtd_2); | 1374 | &sdvo_priv->save_input_dtd_2); |
1375 | } | 1375 | } |
1376 | 1376 | ||
@@ -1379,8 +1379,8 @@ static void intel_sdvo_save(struct drm_connector *connector) | |||
1379 | u16 this_output = (1 << o); | 1379 | u16 this_output = (1 << o); |
1380 | if (sdvo_priv->caps.output_flags & this_output) | 1380 | if (sdvo_priv->caps.output_flags & this_output) |
1381 | { | 1381 | { |
1382 | intel_sdvo_set_target_output(intel_output, this_output); | 1382 | intel_sdvo_set_target_output(intel_encoder, this_output); |
1383 | intel_sdvo_get_output_timing(intel_output, | 1383 | intel_sdvo_get_output_timing(intel_encoder, |
1384 | &sdvo_priv->save_output_dtd[o]); | 1384 | &sdvo_priv->save_output_dtd[o]); |
1385 | } | 1385 | } |
1386 | } | 1386 | } |
@@ -1394,60 +1394,60 @@ static void intel_sdvo_save(struct drm_connector *connector) | |||
1394 | static void intel_sdvo_restore(struct drm_connector *connector) | 1394 | static void intel_sdvo_restore(struct drm_connector *connector) |
1395 | { | 1395 | { |
1396 | struct drm_device *dev = connector->dev; | 1396 | struct drm_device *dev = connector->dev; |
1397 | struct intel_output *intel_output = to_intel_output(connector); | 1397 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1398 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1398 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1399 | int o; | 1399 | int o; |
1400 | int i; | 1400 | int i; |
1401 | bool input1, input2; | 1401 | bool input1, input2; |
1402 | u8 status; | 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 | for (o = SDVO_OUTPUT_FIRST; o <= SDVO_OUTPUT_LAST; o++) | 1406 | for (o = SDVO_OUTPUT_FIRST; o <= SDVO_OUTPUT_LAST; o++) |
1407 | { | 1407 | { |
1408 | u16 this_output = (1 << o); | 1408 | u16 this_output = (1 << o); |
1409 | if (sdvo_priv->caps.output_flags & this_output) { | 1409 | if (sdvo_priv->caps.output_flags & this_output) { |
1410 | intel_sdvo_set_target_output(intel_output, this_output); | 1410 | intel_sdvo_set_target_output(intel_encoder, this_output); |
1411 | intel_sdvo_set_output_timing(intel_output, &sdvo_priv->save_output_dtd[o]); | 1411 | intel_sdvo_set_output_timing(intel_encoder, &sdvo_priv->save_output_dtd[o]); |
1412 | } | 1412 | } |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { | 1415 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { |
1416 | intel_sdvo_set_target_input(intel_output, true, false); | 1416 | intel_sdvo_set_target_input(intel_encoder, true, false); |
1417 | intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_1); | 1417 | intel_sdvo_set_input_timing(intel_encoder, &sdvo_priv->save_input_dtd_1); |
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { | 1420 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { |
1421 | intel_sdvo_set_target_input(intel_output, false, true); | 1421 | intel_sdvo_set_target_input(intel_encoder, false, true); |
1422 | intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_2); | 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 | if (sdvo_priv->is_tv) { | 1427 | if (sdvo_priv->is_tv) { |
1428 | /* XXX: Restore TV format/enhancements. */ | 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 | if (sdvo_priv->save_SDVOX & SDVO_ENABLE) | 1433 | if (sdvo_priv->save_SDVOX & SDVO_ENABLE) |
1434 | { | 1434 | { |
1435 | for (i = 0; i < 2; i++) | 1435 | for (i = 0; i < 2; i++) |
1436 | intel_wait_for_vblank(dev); | 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 | if (status == SDVO_CMD_STATUS_SUCCESS && !input1) | 1438 | if (status == SDVO_CMD_STATUS_SUCCESS && !input1) |
1439 | DRM_DEBUG_KMS("First %s output reported failure to " | 1439 | DRM_DEBUG_KMS("First %s output reported failure to " |
1440 | "sync\n", SDVO_NAME(sdvo_priv)); | 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 | static int intel_sdvo_mode_valid(struct drm_connector *connector, | 1446 | static int intel_sdvo_mode_valid(struct drm_connector *connector, |
1447 | struct drm_display_mode *mode) | 1447 | struct drm_display_mode *mode) |
1448 | { | 1448 | { |
1449 | struct intel_output *intel_output = to_intel_output(connector); | 1449 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1450 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1450 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1451 | 1451 | ||
1452 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | 1452 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) |
1453 | return MODE_NO_DBLESCAN; | 1453 | return MODE_NO_DBLESCAN; |
@@ -1472,12 +1472,12 @@ static int intel_sdvo_mode_valid(struct drm_connector *connector, | |||
1472 | return MODE_OK; | 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 | u8 status; | 1477 | u8 status; |
1478 | 1478 | ||
1479 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_DEVICE_CAPS, NULL, 0); | 1479 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_DEVICE_CAPS, NULL, 0); |
1480 | status = intel_sdvo_read_response(intel_output, caps, sizeof(*caps)); | 1480 | status = intel_sdvo_read_response(intel_encoder, caps, sizeof(*caps)); |
1481 | if (status != SDVO_CMD_STATUS_SUCCESS) | 1481 | if (status != SDVO_CMD_STATUS_SUCCESS) |
1482 | return false; | 1482 | return false; |
1483 | 1483 | ||
@@ -1487,12 +1487,12 @@ static bool intel_sdvo_get_capabilities(struct intel_output *intel_output, struc | |||
1487 | struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB) | 1487 | struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB) |
1488 | { | 1488 | { |
1489 | struct drm_connector *connector = NULL; | 1489 | struct drm_connector *connector = NULL; |
1490 | struct intel_output *iout = NULL; | 1490 | struct intel_encoder *iout = NULL; |
1491 | struct intel_sdvo_priv *sdvo; | 1491 | struct intel_sdvo_priv *sdvo; |
1492 | 1492 | ||
1493 | /* find the sdvo connector */ | 1493 | /* find the sdvo connector */ |
1494 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 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 | if (iout->type != INTEL_OUTPUT_SDVO) | 1497 | if (iout->type != INTEL_OUTPUT_SDVO) |
1498 | continue; | 1498 | continue; |
@@ -1514,16 +1514,16 @@ int intel_sdvo_supports_hotplug(struct drm_connector *connector) | |||
1514 | { | 1514 | { |
1515 | u8 response[2]; | 1515 | u8 response[2]; |
1516 | u8 status; | 1516 | u8 status; |
1517 | struct intel_output *intel_output; | 1517 | struct intel_encoder *intel_encoder; |
1518 | DRM_DEBUG_KMS("\n"); | 1518 | DRM_DEBUG_KMS("\n"); |
1519 | 1519 | ||
1520 | if (!connector) | 1520 | if (!connector) |
1521 | return 0; | 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); | 1525 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); |
1526 | status = intel_sdvo_read_response(intel_output, &response, 2); | 1526 | status = intel_sdvo_read_response(intel_encoder, &response, 2); |
1527 | 1527 | ||
1528 | if (response[0] !=0) | 1528 | if (response[0] !=0) |
1529 | return 1; | 1529 | return 1; |
@@ -1535,30 +1535,30 @@ void intel_sdvo_set_hotplug(struct drm_connector *connector, int on) | |||
1535 | { | 1535 | { |
1536 | u8 response[2]; | 1536 | u8 response[2]; |
1537 | u8 status; | 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); | 1540 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); |
1541 | intel_sdvo_read_response(intel_output, &response, 2); | 1541 | intel_sdvo_read_response(intel_encoder, &response, 2); |
1542 | 1542 | ||
1543 | if (on) { | 1543 | if (on) { |
1544 | intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); | 1544 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); |
1545 | status = intel_sdvo_read_response(intel_output, &response, 2); | 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 | } else { | 1548 | } else { |
1549 | response[0] = 0; | 1549 | response[0] = 0; |
1550 | response[1] = 0; | 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); | 1554 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); |
1555 | intel_sdvo_read_response(intel_output, &response, 2); | 1555 | intel_sdvo_read_response(intel_encoder, &response, 2); |
1556 | } | 1556 | } |
1557 | 1557 | ||
1558 | static bool | 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 | int caps = 0; | 1562 | int caps = 0; |
1563 | 1563 | ||
1564 | if (sdvo_priv->caps.output_flags & | 1564 | if (sdvo_priv->caps.output_flags & |
@@ -1592,11 +1592,11 @@ static struct drm_connector * | |||
1592 | intel_find_analog_connector(struct drm_device *dev) | 1592 | intel_find_analog_connector(struct drm_device *dev) |
1593 | { | 1593 | { |
1594 | struct drm_connector *connector; | 1594 | struct drm_connector *connector; |
1595 | struct intel_output *intel_output; | 1595 | struct intel_encoder *intel_encoder; |
1596 | 1596 | ||
1597 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 1597 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
1598 | intel_output = to_intel_output(connector); | 1598 | intel_encoder = to_intel_encoder(connector); |
1599 | if (intel_output->type == INTEL_OUTPUT_ANALOG) | 1599 | if (intel_encoder->type == INTEL_OUTPUT_ANALOG) |
1600 | return connector; | 1600 | return connector; |
1601 | } | 1601 | } |
1602 | return NULL; | 1602 | return NULL; |
@@ -1621,16 +1621,16 @@ intel_analog_is_connected(struct drm_device *dev) | |||
1621 | enum drm_connector_status | 1621 | enum drm_connector_status |
1622 | intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | 1622 | intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) |
1623 | { | 1623 | { |
1624 | struct intel_output *intel_output = to_intel_output(connector); | 1624 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1625 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1625 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1626 | enum drm_connector_status status = connector_status_connected; | 1626 | enum drm_connector_status status = connector_status_connected; |
1627 | struct edid *edid = NULL; | 1627 | struct edid *edid = NULL; |
1628 | 1628 | ||
1629 | edid = drm_get_edid(&intel_output->base, | 1629 | edid = drm_get_edid(&intel_encoder->base, |
1630 | intel_output->ddc_bus); | 1630 | intel_encoder->ddc_bus); |
1631 | 1631 | ||
1632 | /* This is only applied to SDVO cards with multiple outputs */ | 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 | uint8_t saved_ddc, temp_ddc; | 1634 | uint8_t saved_ddc, temp_ddc; |
1635 | saved_ddc = sdvo_priv->ddc_bus; | 1635 | saved_ddc = sdvo_priv->ddc_bus; |
1636 | temp_ddc = sdvo_priv->ddc_bus >> 1; | 1636 | temp_ddc = sdvo_priv->ddc_bus >> 1; |
@@ -1640,8 +1640,8 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | |||
1640 | */ | 1640 | */ |
1641 | while(temp_ddc > 1) { | 1641 | while(temp_ddc > 1) { |
1642 | sdvo_priv->ddc_bus = temp_ddc; | 1642 | sdvo_priv->ddc_bus = temp_ddc; |
1643 | edid = drm_get_edid(&intel_output->base, | 1643 | edid = drm_get_edid(&intel_encoder->base, |
1644 | intel_output->ddc_bus); | 1644 | intel_encoder->ddc_bus); |
1645 | if (edid) { | 1645 | if (edid) { |
1646 | /* | 1646 | /* |
1647 | * When we can get the EDID, maybe it is the | 1647 | * When we can get the EDID, maybe it is the |
@@ -1660,8 +1660,8 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | |||
1660 | */ | 1660 | */ |
1661 | if (edid == NULL && | 1661 | if (edid == NULL && |
1662 | sdvo_priv->analog_ddc_bus && | 1662 | sdvo_priv->analog_ddc_bus && |
1663 | !intel_analog_is_connected(intel_output->base.dev)) | 1663 | !intel_analog_is_connected(intel_encoder->base.dev)) |
1664 | edid = drm_get_edid(&intel_output->base, | 1664 | edid = drm_get_edid(&intel_encoder->base, |
1665 | sdvo_priv->analog_ddc_bus); | 1665 | sdvo_priv->analog_ddc_bus); |
1666 | if (edid != NULL) { | 1666 | if (edid != NULL) { |
1667 | /* Don't report the output as connected if it's a DVI-I | 1667 | /* Don't report the output as connected if it's a DVI-I |
@@ -1676,7 +1676,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) | |||
1676 | } | 1676 | } |
1677 | 1677 | ||
1678 | kfree(edid); | 1678 | kfree(edid); |
1679 | intel_output->base.display_info.raw_edid = NULL; | 1679 | intel_encoder->base.display_info.raw_edid = NULL; |
1680 | 1680 | ||
1681 | } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) | 1681 | } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) |
1682 | status = connector_status_disconnected; | 1682 | status = connector_status_disconnected; |
@@ -1688,16 +1688,16 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect | |||
1688 | { | 1688 | { |
1689 | uint16_t response; | 1689 | uint16_t response; |
1690 | u8 status; | 1690 | u8 status; |
1691 | struct intel_output *intel_output = to_intel_output(connector); | 1691 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1692 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 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 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); | 1695 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); |
1696 | if (sdvo_priv->is_tv) { | 1696 | if (sdvo_priv->is_tv) { |
1697 | /* add 30ms delay when the output type is SDVO-TV */ | 1697 | /* add 30ms delay when the output type is SDVO-TV */ |
1698 | mdelay(30); | 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 | DRM_DEBUG_KMS("SDVO response %d %d\n", response & 0xff, response >> 8); | 1702 | DRM_DEBUG_KMS("SDVO response %d %d\n", response & 0xff, response >> 8); |
1703 | 1703 | ||
@@ -1707,10 +1707,10 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect | |||
1707 | if (response == 0) | 1707 | if (response == 0) |
1708 | return connector_status_disconnected; | 1708 | return connector_status_disconnected; |
1709 | 1709 | ||
1710 | if (intel_sdvo_multifunc_encoder(intel_output) && | 1710 | if (intel_sdvo_multifunc_encoder(intel_encoder) && |
1711 | sdvo_priv->attached_output != response) { | 1711 | sdvo_priv->attached_output != response) { |
1712 | if (sdvo_priv->controlled_output != response && | 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 | return connector_status_unknown; | 1714 | return connector_status_unknown; |
1715 | sdvo_priv->attached_output = response; | 1715 | sdvo_priv->attached_output = response; |
1716 | } | 1716 | } |
@@ -1719,12 +1719,12 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect | |||
1719 | 1719 | ||
1720 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) | 1720 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) |
1721 | { | 1721 | { |
1722 | struct intel_output *intel_output = to_intel_output(connector); | 1722 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1723 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1723 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1724 | int num_modes; | 1724 | int num_modes; |
1725 | 1725 | ||
1726 | /* set the bus switch and get the modes */ | 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 | * Mac mini hack. On this device, the DVI-I connector shares one DDC | 1730 | * Mac mini hack. On this device, the DVI-I connector shares one DDC |
@@ -1734,17 +1734,17 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) | |||
1734 | */ | 1734 | */ |
1735 | if (num_modes == 0 && | 1735 | if (num_modes == 0 && |
1736 | sdvo_priv->analog_ddc_bus && | 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 | struct i2c_adapter *digital_ddc_bus; | 1738 | struct i2c_adapter *digital_ddc_bus; |
1739 | 1739 | ||
1740 | /* Switch to the analog ddc bus and try that | 1740 | /* Switch to the analog ddc bus and try that |
1741 | */ | 1741 | */ |
1742 | digital_ddc_bus = intel_output->ddc_bus; | 1742 | digital_ddc_bus = intel_encoder->ddc_bus; |
1743 | intel_output->ddc_bus = sdvo_priv->analog_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,7 +1815,7 @@ struct drm_display_mode sdvo_tv_modes[] = { | |||
1815 | 1815 | ||
1816 | static void intel_sdvo_get_tv_modes(struct drm_connector *connector) | 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 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; | 1819 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; |
1820 | struct intel_sdvo_sdtv_resolution_request tv_res; | 1820 | struct intel_sdvo_sdtv_resolution_request tv_res; |
1821 | uint32_t reply = 0, format_map = 0; | 1821 | uint32_t reply = 0, format_map = 0; |
@@ -1857,9 +1857,9 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector) | |||
1857 | 1857 | ||
1858 | static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | 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 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | 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 | struct drm_display_mode *newmode; | 1863 | struct drm_display_mode *newmode; |
1864 | 1864 | ||
1865 | /* | 1865 | /* |
@@ -1867,7 +1867,7 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | |||
1867 | * Assume that the preferred modes are | 1867 | * Assume that the preferred modes are |
1868 | * arranged in priority order. | 1868 | * arranged in priority order. |
1869 | */ | 1869 | */ |
1870 | intel_ddc_get_modes(intel_output); | 1870 | intel_ddc_get_modes(intel_encoder); |
1871 | if (list_empty(&connector->probed_modes) == false) | 1871 | if (list_empty(&connector->probed_modes) == false) |
1872 | goto end; | 1872 | goto end; |
1873 | 1873 | ||
@@ -1896,7 +1896,7 @@ end: | |||
1896 | 1896 | ||
1897 | static int intel_sdvo_get_modes(struct drm_connector *connector) | 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 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; | 1900 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; |
1901 | 1901 | ||
1902 | if (sdvo_priv->is_tv) | 1902 | if (sdvo_priv->is_tv) |
@@ -1914,8 +1914,8 @@ static int intel_sdvo_get_modes(struct drm_connector *connector) | |||
1914 | static | 1914 | static |
1915 | void intel_sdvo_destroy_enhance_property(struct drm_connector *connector) | 1915 | void intel_sdvo_destroy_enhance_property(struct drm_connector *connector) |
1916 | { | 1916 | { |
1917 | struct intel_output *intel_output = to_intel_output(connector); | 1917 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1918 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1918 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1919 | struct drm_device *dev = connector->dev; | 1919 | struct drm_device *dev = connector->dev; |
1920 | 1920 | ||
1921 | if (sdvo_priv->is_tv) { | 1921 | if (sdvo_priv->is_tv) { |
@@ -1952,13 +1952,13 @@ void intel_sdvo_destroy_enhance_property(struct drm_connector *connector) | |||
1952 | 1952 | ||
1953 | static void intel_sdvo_destroy(struct drm_connector *connector) | 1953 | static void intel_sdvo_destroy(struct drm_connector *connector) |
1954 | { | 1954 | { |
1955 | struct intel_output *intel_output = to_intel_output(connector); | 1955 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1956 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1956 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1957 | 1957 | ||
1958 | if (intel_output->i2c_bus) | 1958 | if (intel_encoder->i2c_bus) |
1959 | intel_i2c_destroy(intel_output->i2c_bus); | 1959 | intel_i2c_destroy(intel_encoder->i2c_bus); |
1960 | if (intel_output->ddc_bus) | 1960 | if (intel_encoder->ddc_bus) |
1961 | intel_i2c_destroy(intel_output->ddc_bus); | 1961 | intel_i2c_destroy(intel_encoder->ddc_bus); |
1962 | if (sdvo_priv->analog_ddc_bus) | 1962 | if (sdvo_priv->analog_ddc_bus) |
1963 | intel_i2c_destroy(sdvo_priv->analog_ddc_bus); | 1963 | intel_i2c_destroy(sdvo_priv->analog_ddc_bus); |
1964 | 1964 | ||
@@ -1976,7 +1976,7 @@ static void intel_sdvo_destroy(struct drm_connector *connector) | |||
1976 | drm_sysfs_connector_remove(connector); | 1976 | drm_sysfs_connector_remove(connector); |
1977 | drm_connector_cleanup(connector); | 1977 | drm_connector_cleanup(connector); |
1978 | 1978 | ||
1979 | kfree(intel_output); | 1979 | kfree(intel_encoder); |
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | static int | 1982 | static int |
@@ -1984,9 +1984,9 @@ intel_sdvo_set_property(struct drm_connector *connector, | |||
1984 | struct drm_property *property, | 1984 | struct drm_property *property, |
1985 | uint64_t val) | 1985 | uint64_t val) |
1986 | { | 1986 | { |
1987 | struct intel_output *intel_output = to_intel_output(connector); | 1987 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
1988 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1988 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
1989 | struct drm_encoder *encoder = &intel_output->enc; | 1989 | struct drm_encoder *encoder = &intel_encoder->enc; |
1990 | struct drm_crtc *crtc = encoder->crtc; | 1990 | struct drm_crtc *crtc = encoder->crtc; |
1991 | int ret = 0; | 1991 | int ret = 0; |
1992 | bool changed = false; | 1992 | bool changed = false; |
@@ -2094,8 +2094,8 @@ intel_sdvo_set_property(struct drm_connector *connector, | |||
2094 | sdvo_priv->cur_brightness = temp_value; | 2094 | sdvo_priv->cur_brightness = temp_value; |
2095 | } | 2095 | } |
2096 | if (cmd) { | 2096 | if (cmd) { |
2097 | intel_sdvo_write_cmd(intel_output, cmd, &temp_value, 2); | 2097 | intel_sdvo_write_cmd(intel_encoder, cmd, &temp_value, 2); |
2098 | status = intel_sdvo_read_response(intel_output, | 2098 | status = intel_sdvo_read_response(intel_encoder, |
2099 | NULL, 0); | 2099 | NULL, 0); |
2100 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2100 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2101 | DRM_DEBUG_KMS("Incorrect SDVO command \n"); | 2101 | DRM_DEBUG_KMS("Incorrect SDVO command \n"); |
@@ -2190,7 +2190,7 @@ intel_sdvo_select_ddc_bus(struct intel_sdvo_priv *dev_priv) | |||
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | static bool | 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 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; | 2195 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; |
2196 | uint8_t status; | 2196 | uint8_t status; |
@@ -2204,42 +2204,42 @@ intel_sdvo_get_digital_encoding_mode(struct intel_output *output) | |||
2204 | return true; | 2204 | return true; |
2205 | } | 2205 | } |
2206 | 2206 | ||
2207 | static struct intel_output * | 2207 | static struct intel_encoder * |
2208 | intel_sdvo_chan_to_intel_output(struct intel_i2c_chan *chan) | 2208 | intel_sdvo_chan_to_intel_encoder(struct intel_i2c_chan *chan) |
2209 | { | 2209 | { |
2210 | struct drm_device *dev = chan->drm_dev; | 2210 | struct drm_device *dev = chan->drm_dev; |
2211 | struct drm_connector *connector; | 2211 | struct drm_connector *connector; |
2212 | struct intel_output *intel_output = NULL; | 2212 | struct intel_encoder *intel_encoder = NULL; |
2213 | 2213 | ||
2214 | list_for_each_entry(connector, | 2214 | list_for_each_entry(connector, |
2215 | &dev->mode_config.connector_list, head) { | 2215 | &dev->mode_config.connector_list, head) { |
2216 | if (to_intel_output(connector)->ddc_bus == &chan->adapter) { | 2216 | if (to_intel_encoder(connector)->ddc_bus == &chan->adapter) { |
2217 | intel_output = to_intel_output(connector); | 2217 | intel_encoder = to_intel_encoder(connector); |
2218 | break; | 2218 | break; |
2219 | } | 2219 | } |
2220 | } | 2220 | } |
2221 | return intel_output; | 2221 | return intel_encoder; |
2222 | } | 2222 | } |
2223 | 2223 | ||
2224 | static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap, | 2224 | static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap, |
2225 | struct i2c_msg msgs[], int num) | 2225 | struct i2c_msg msgs[], int num) |
2226 | { | 2226 | { |
2227 | struct intel_output *intel_output; | 2227 | struct intel_encoder *intel_encoder; |
2228 | struct intel_sdvo_priv *sdvo_priv; | 2228 | struct intel_sdvo_priv *sdvo_priv; |
2229 | struct i2c_algo_bit_data *algo_data; | 2229 | struct i2c_algo_bit_data *algo_data; |
2230 | const struct i2c_algorithm *algo; | 2230 | const struct i2c_algorithm *algo; |
2231 | 2231 | ||
2232 | algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data; | 2232 | algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data; |
2233 | intel_output = | 2233 | intel_encoder = |
2234 | intel_sdvo_chan_to_intel_output( | 2234 | intel_sdvo_chan_to_intel_encoder( |
2235 | (struct intel_i2c_chan *)(algo_data->data)); | 2235 | (struct intel_i2c_chan *)(algo_data->data)); |
2236 | if (intel_output == NULL) | 2236 | if (intel_encoder == NULL) |
2237 | return -EINVAL; | 2237 | return -EINVAL; |
2238 | 2238 | ||
2239 | sdvo_priv = intel_output->dev_priv; | 2239 | sdvo_priv = intel_encoder->dev_priv; |
2240 | algo = intel_output->i2c_bus->algo; | 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 | return algo->master_xfer(i2c_adap, msgs, num); | 2243 | return algo->master_xfer(i2c_adap, msgs, num); |
2244 | } | 2244 | } |
2245 | 2245 | ||
@@ -2304,15 +2304,15 @@ static struct dmi_system_id intel_sdvo_bad_tv[] = { | |||
2304 | }; | 2304 | }; |
2305 | 2305 | ||
2306 | static bool | 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; | 2309 | struct drm_connector *connector = &intel_encoder->base; |
2310 | struct drm_encoder *encoder = &intel_output->enc; | 2310 | struct drm_encoder *encoder = &intel_encoder->enc; |
2311 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 2311 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
2312 | bool ret = true, registered = false; | 2312 | bool ret = true, registered = false; |
2313 | 2313 | ||
2314 | sdvo_priv->is_tv = false; | 2314 | sdvo_priv->is_tv = false; |
2315 | intel_output->needs_tv_clock = false; | 2315 | intel_encoder->needs_tv_clock = false; |
2316 | sdvo_priv->is_lvds = false; | 2316 | sdvo_priv->is_lvds = false; |
2317 | 2317 | ||
2318 | if (device_is_registered(&connector->kdev)) { | 2318 | if (device_is_registered(&connector->kdev)) { |
@@ -2330,16 +2330,16 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2330 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; | 2330 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; |
2331 | connector->connector_type = DRM_MODE_CONNECTOR_DVID; | 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 | &sdvo_priv->encode) && | 2334 | &sdvo_priv->encode) && |
2335 | intel_sdvo_get_digital_encoding_mode(intel_output) && | 2335 | intel_sdvo_get_digital_encoding_mode(intel_encoder) && |
2336 | sdvo_priv->is_hdmi) { | 2336 | sdvo_priv->is_hdmi) { |
2337 | /* enable hdmi encoding mode if supported */ | 2337 | /* enable hdmi encoding mode if supported */ |
2338 | intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI); | 2338 | intel_sdvo_set_encode(intel_encoder, SDVO_ENCODE_HDMI); |
2339 | intel_sdvo_set_colorimetry(intel_output, | 2339 | intel_sdvo_set_colorimetry(intel_encoder, |
2340 | SDVO_COLORIMETRY_RGB256); | 2340 | SDVO_COLORIMETRY_RGB256); |
2341 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; | 2341 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; |
2342 | intel_output->clone_mask = | 2342 | intel_encoder->clone_mask = |
2343 | (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | | 2343 | (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | |
2344 | (1 << INTEL_ANALOG_CLONE_BIT); | 2344 | (1 << INTEL_ANALOG_CLONE_BIT); |
2345 | } | 2345 | } |
@@ -2350,21 +2350,21 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2350 | encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; | 2350 | encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; |
2351 | connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; | 2351 | connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; |
2352 | sdvo_priv->is_tv = true; | 2352 | sdvo_priv->is_tv = true; |
2353 | intel_output->needs_tv_clock = true; | 2353 | intel_encoder->needs_tv_clock = true; |
2354 | intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; | 2354 | intel_encoder->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; |
2355 | } else if (flags & SDVO_OUTPUT_RGB0) { | 2355 | } else if (flags & SDVO_OUTPUT_RGB0) { |
2356 | 2356 | ||
2357 | sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; | 2357 | sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; |
2358 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; | 2358 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; |
2359 | connector->connector_type = DRM_MODE_CONNECTOR_VGA; | 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 | (1 << INTEL_ANALOG_CLONE_BIT); | 2361 | (1 << INTEL_ANALOG_CLONE_BIT); |
2362 | } else if (flags & SDVO_OUTPUT_RGB1) { | 2362 | } else if (flags & SDVO_OUTPUT_RGB1) { |
2363 | 2363 | ||
2364 | sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; | 2364 | sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; |
2365 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; | 2365 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; |
2366 | connector->connector_type = DRM_MODE_CONNECTOR_VGA; | 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 | (1 << INTEL_ANALOG_CLONE_BIT); | 2368 | (1 << INTEL_ANALOG_CLONE_BIT); |
2369 | } else if (flags & SDVO_OUTPUT_CVBS0) { | 2369 | } else if (flags & SDVO_OUTPUT_CVBS0) { |
2370 | 2370 | ||
@@ -2372,15 +2372,15 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2372 | encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; | 2372 | encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; |
2373 | connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; | 2373 | connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; |
2374 | sdvo_priv->is_tv = true; | 2374 | sdvo_priv->is_tv = true; |
2375 | intel_output->needs_tv_clock = true; | 2375 | intel_encoder->needs_tv_clock = true; |
2376 | intel_output->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; | 2376 | intel_encoder->clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; |
2377 | } else if (flags & SDVO_OUTPUT_LVDS0) { | 2377 | } else if (flags & SDVO_OUTPUT_LVDS0) { |
2378 | 2378 | ||
2379 | sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0; | 2379 | sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0; |
2380 | encoder->encoder_type = DRM_MODE_ENCODER_LVDS; | 2380 | encoder->encoder_type = DRM_MODE_ENCODER_LVDS; |
2381 | connector->connector_type = DRM_MODE_CONNECTOR_LVDS; | 2381 | connector->connector_type = DRM_MODE_CONNECTOR_LVDS; |
2382 | sdvo_priv->is_lvds = true; | 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 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | 2384 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); |
2385 | } else if (flags & SDVO_OUTPUT_LVDS1) { | 2385 | } else if (flags & SDVO_OUTPUT_LVDS1) { |
2386 | 2386 | ||
@@ -2388,7 +2388,7 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2388 | encoder->encoder_type = DRM_MODE_ENCODER_LVDS; | 2388 | encoder->encoder_type = DRM_MODE_ENCODER_LVDS; |
2389 | connector->connector_type = DRM_MODE_CONNECTOR_LVDS; | 2389 | connector->connector_type = DRM_MODE_CONNECTOR_LVDS; |
2390 | sdvo_priv->is_lvds = true; | 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 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | 2392 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); |
2393 | } else { | 2393 | } else { |
2394 | 2394 | ||
@@ -2401,7 +2401,7 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2401 | bytes[0], bytes[1]); | 2401 | bytes[0], bytes[1]); |
2402 | ret = false; | 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 | if (ret && registered) | 2406 | if (ret && registered) |
2407 | ret = drm_sysfs_connector_add(connector) == 0 ? true : false; | 2407 | ret = drm_sysfs_connector_add(connector) == 0 ? true : false; |
@@ -2413,18 +2413,18 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags) | |||
2413 | 2413 | ||
2414 | static void intel_sdvo_tv_create_property(struct drm_connector *connector) | 2414 | static void intel_sdvo_tv_create_property(struct drm_connector *connector) |
2415 | { | 2415 | { |
2416 | struct intel_output *intel_output = to_intel_output(connector); | 2416 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
2417 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 2417 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
2418 | struct intel_sdvo_tv_format format; | 2418 | struct intel_sdvo_tv_format format; |
2419 | uint32_t format_map, i; | 2419 | uint32_t format_map, i; |
2420 | uint8_t status; | 2420 | uint8_t status; |
2421 | 2421 | ||
2422 | intel_sdvo_set_target_output(intel_output, | 2422 | intel_sdvo_set_target_output(intel_encoder, |
2423 | sdvo_priv->controlled_output); | 2423 | sdvo_priv->controlled_output); |
2424 | 2424 | ||
2425 | intel_sdvo_write_cmd(intel_output, | 2425 | intel_sdvo_write_cmd(intel_encoder, |
2426 | SDVO_CMD_GET_SUPPORTED_TV_FORMATS, NULL, 0); | 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 | &format, sizeof(format)); | 2428 | &format, sizeof(format)); |
2429 | if (status != SDVO_CMD_STATUS_SUCCESS) | 2429 | if (status != SDVO_CMD_STATUS_SUCCESS) |
2430 | return; | 2430 | return; |
@@ -2462,16 +2462,16 @@ static void intel_sdvo_tv_create_property(struct drm_connector *connector) | |||
2462 | 2462 | ||
2463 | static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | 2463 | static void intel_sdvo_create_enhance_property(struct drm_connector *connector) |
2464 | { | 2464 | { |
2465 | struct intel_output *intel_output = to_intel_output(connector); | 2465 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); |
2466 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 2466 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; |
2467 | struct intel_sdvo_enhancements_reply sdvo_data; | 2467 | struct intel_sdvo_enhancements_reply sdvo_data; |
2468 | struct drm_device *dev = connector->dev; | 2468 | struct drm_device *dev = connector->dev; |
2469 | uint8_t status; | 2469 | uint8_t status; |
2470 | uint16_t response, data_value[2]; | 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 | NULL, 0); | 2473 | NULL, 0); |
2474 | status = intel_sdvo_read_response(intel_output, &sdvo_data, | 2474 | status = intel_sdvo_read_response(intel_encoder, &sdvo_data, |
2475 | sizeof(sdvo_data)); | 2475 | sizeof(sdvo_data)); |
2476 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2476 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2477 | DRM_DEBUG_KMS(" incorrect response is returned\n"); | 2477 | DRM_DEBUG_KMS(" incorrect response is returned\n"); |
@@ -2487,18 +2487,18 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2487 | * property | 2487 | * property |
2488 | */ | 2488 | */ |
2489 | if (sdvo_data.overscan_h) { | 2489 | if (sdvo_data.overscan_h) { |
2490 | intel_sdvo_write_cmd(intel_output, | 2490 | intel_sdvo_write_cmd(intel_encoder, |
2491 | SDVO_CMD_GET_MAX_OVERSCAN_H, NULL, 0); | 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 | &data_value, 4); | 2493 | &data_value, 4); |
2494 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2494 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2495 | DRM_DEBUG_KMS("Incorrect SDVO max " | 2495 | DRM_DEBUG_KMS("Incorrect SDVO max " |
2496 | "h_overscan\n"); | 2496 | "h_overscan\n"); |
2497 | return; | 2497 | return; |
2498 | } | 2498 | } |
2499 | intel_sdvo_write_cmd(intel_output, | 2499 | intel_sdvo_write_cmd(intel_encoder, |
2500 | SDVO_CMD_GET_OVERSCAN_H, NULL, 0); | 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 | &response, 2); | 2502 | &response, 2); |
2503 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2503 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2504 | DRM_DEBUG_KMS("Incorrect SDVO h_overscan\n"); | 2504 | DRM_DEBUG_KMS("Incorrect SDVO h_overscan\n"); |
@@ -2528,18 +2528,18 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2528 | data_value[0], data_value[1], response); | 2528 | data_value[0], data_value[1], response); |
2529 | } | 2529 | } |
2530 | if (sdvo_data.overscan_v) { | 2530 | if (sdvo_data.overscan_v) { |
2531 | intel_sdvo_write_cmd(intel_output, | 2531 | intel_sdvo_write_cmd(intel_encoder, |
2532 | SDVO_CMD_GET_MAX_OVERSCAN_V, NULL, 0); | 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 | &data_value, 4); | 2534 | &data_value, 4); |
2535 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2535 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2536 | DRM_DEBUG_KMS("Incorrect SDVO max " | 2536 | DRM_DEBUG_KMS("Incorrect SDVO max " |
2537 | "v_overscan\n"); | 2537 | "v_overscan\n"); |
2538 | return; | 2538 | return; |
2539 | } | 2539 | } |
2540 | intel_sdvo_write_cmd(intel_output, | 2540 | intel_sdvo_write_cmd(intel_encoder, |
2541 | SDVO_CMD_GET_OVERSCAN_V, NULL, 0); | 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 | &response, 2); | 2543 | &response, 2); |
2544 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2544 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2545 | DRM_DEBUG_KMS("Incorrect SDVO v_overscan\n"); | 2545 | DRM_DEBUG_KMS("Incorrect SDVO v_overscan\n"); |
@@ -2569,17 +2569,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2569 | data_value[0], data_value[1], response); | 2569 | data_value[0], data_value[1], response); |
2570 | } | 2570 | } |
2571 | if (sdvo_data.position_h) { | 2571 | if (sdvo_data.position_h) { |
2572 | intel_sdvo_write_cmd(intel_output, | 2572 | intel_sdvo_write_cmd(intel_encoder, |
2573 | SDVO_CMD_GET_MAX_POSITION_H, NULL, 0); | 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 | &data_value, 4); | 2575 | &data_value, 4); |
2576 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2576 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2577 | DRM_DEBUG_KMS("Incorrect SDVO Max h_pos\n"); | 2577 | DRM_DEBUG_KMS("Incorrect SDVO Max h_pos\n"); |
2578 | return; | 2578 | return; |
2579 | } | 2579 | } |
2580 | intel_sdvo_write_cmd(intel_output, | 2580 | intel_sdvo_write_cmd(intel_encoder, |
2581 | SDVO_CMD_GET_POSITION_H, NULL, 0); | 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 | &response, 2); | 2583 | &response, 2); |
2584 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2584 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2585 | DRM_DEBUG_KMS("Incorrect SDVO get h_postion\n"); | 2585 | DRM_DEBUG_KMS("Incorrect SDVO get h_postion\n"); |
@@ -2600,17 +2600,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2600 | data_value[0], data_value[1], response); | 2600 | data_value[0], data_value[1], response); |
2601 | } | 2601 | } |
2602 | if (sdvo_data.position_v) { | 2602 | if (sdvo_data.position_v) { |
2603 | intel_sdvo_write_cmd(intel_output, | 2603 | intel_sdvo_write_cmd(intel_encoder, |
2604 | SDVO_CMD_GET_MAX_POSITION_V, NULL, 0); | 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 | &data_value, 4); | 2606 | &data_value, 4); |
2607 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2607 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2608 | DRM_DEBUG_KMS("Incorrect SDVO Max v_pos\n"); | 2608 | DRM_DEBUG_KMS("Incorrect SDVO Max v_pos\n"); |
2609 | return; | 2609 | return; |
2610 | } | 2610 | } |
2611 | intel_sdvo_write_cmd(intel_output, | 2611 | intel_sdvo_write_cmd(intel_encoder, |
2612 | SDVO_CMD_GET_POSITION_V, NULL, 0); | 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 | &response, 2); | 2614 | &response, 2); |
2615 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2615 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2616 | DRM_DEBUG_KMS("Incorrect SDVO get v_postion\n"); | 2616 | DRM_DEBUG_KMS("Incorrect SDVO get v_postion\n"); |
@@ -2633,17 +2633,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2633 | } | 2633 | } |
2634 | if (sdvo_priv->is_tv) { | 2634 | if (sdvo_priv->is_tv) { |
2635 | if (sdvo_data.saturation) { | 2635 | if (sdvo_data.saturation) { |
2636 | intel_sdvo_write_cmd(intel_output, | 2636 | intel_sdvo_write_cmd(intel_encoder, |
2637 | SDVO_CMD_GET_MAX_SATURATION, NULL, 0); | 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 | &data_value, 4); | 2639 | &data_value, 4); |
2640 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2640 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2641 | DRM_DEBUG_KMS("Incorrect SDVO Max sat\n"); | 2641 | DRM_DEBUG_KMS("Incorrect SDVO Max sat\n"); |
2642 | return; | 2642 | return; |
2643 | } | 2643 | } |
2644 | intel_sdvo_write_cmd(intel_output, | 2644 | intel_sdvo_write_cmd(intel_encoder, |
2645 | SDVO_CMD_GET_SATURATION, NULL, 0); | 2645 | SDVO_CMD_GET_SATURATION, NULL, 0); |
2646 | status = intel_sdvo_read_response(intel_output, | 2646 | status = intel_sdvo_read_response(intel_encoder, |
2647 | &response, 2); | 2647 | &response, 2); |
2648 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2648 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2649 | DRM_DEBUG_KMS("Incorrect SDVO get sat\n"); | 2649 | DRM_DEBUG_KMS("Incorrect SDVO get sat\n"); |
@@ -2665,17 +2665,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2665 | data_value[0], data_value[1], response); | 2665 | data_value[0], data_value[1], response); |
2666 | } | 2666 | } |
2667 | if (sdvo_data.contrast) { | 2667 | if (sdvo_data.contrast) { |
2668 | intel_sdvo_write_cmd(intel_output, | 2668 | intel_sdvo_write_cmd(intel_encoder, |
2669 | SDVO_CMD_GET_MAX_CONTRAST, NULL, 0); | 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 | &data_value, 4); | 2671 | &data_value, 4); |
2672 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2672 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2673 | DRM_DEBUG_KMS("Incorrect SDVO Max contrast\n"); | 2673 | DRM_DEBUG_KMS("Incorrect SDVO Max contrast\n"); |
2674 | return; | 2674 | return; |
2675 | } | 2675 | } |
2676 | intel_sdvo_write_cmd(intel_output, | 2676 | intel_sdvo_write_cmd(intel_encoder, |
2677 | SDVO_CMD_GET_CONTRAST, NULL, 0); | 2677 | SDVO_CMD_GET_CONTRAST, NULL, 0); |
2678 | status = intel_sdvo_read_response(intel_output, | 2678 | status = intel_sdvo_read_response(intel_encoder, |
2679 | &response, 2); | 2679 | &response, 2); |
2680 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2680 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2681 | DRM_DEBUG_KMS("Incorrect SDVO get contrast\n"); | 2681 | DRM_DEBUG_KMS("Incorrect SDVO get contrast\n"); |
@@ -2696,17 +2696,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2696 | data_value[0], data_value[1], response); | 2696 | data_value[0], data_value[1], response); |
2697 | } | 2697 | } |
2698 | if (sdvo_data.hue) { | 2698 | if (sdvo_data.hue) { |
2699 | intel_sdvo_write_cmd(intel_output, | 2699 | intel_sdvo_write_cmd(intel_encoder, |
2700 | SDVO_CMD_GET_MAX_HUE, NULL, 0); | 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 | &data_value, 4); | 2702 | &data_value, 4); |
2703 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2703 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2704 | DRM_DEBUG_KMS("Incorrect SDVO Max hue\n"); | 2704 | DRM_DEBUG_KMS("Incorrect SDVO Max hue\n"); |
2705 | return; | 2705 | return; |
2706 | } | 2706 | } |
2707 | intel_sdvo_write_cmd(intel_output, | 2707 | intel_sdvo_write_cmd(intel_encoder, |
2708 | SDVO_CMD_GET_HUE, NULL, 0); | 2708 | SDVO_CMD_GET_HUE, NULL, 0); |
2709 | status = intel_sdvo_read_response(intel_output, | 2709 | status = intel_sdvo_read_response(intel_encoder, |
2710 | &response, 2); | 2710 | &response, 2); |
2711 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2711 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2712 | DRM_DEBUG_KMS("Incorrect SDVO get hue\n"); | 2712 | DRM_DEBUG_KMS("Incorrect SDVO get hue\n"); |
@@ -2729,17 +2729,17 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) | |||
2729 | } | 2729 | } |
2730 | if (sdvo_priv->is_tv || sdvo_priv->is_lvds) { | 2730 | if (sdvo_priv->is_tv || sdvo_priv->is_lvds) { |
2731 | if (sdvo_data.brightness) { | 2731 | if (sdvo_data.brightness) { |
2732 | intel_sdvo_write_cmd(intel_output, | 2732 | intel_sdvo_write_cmd(intel_encoder, |
2733 | SDVO_CMD_GET_MAX_BRIGHTNESS, NULL, 0); | 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 | &data_value, 4); | 2735 | &data_value, 4); |
2736 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2736 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2737 | DRM_DEBUG_KMS("Incorrect SDVO Max bright\n"); | 2737 | DRM_DEBUG_KMS("Incorrect SDVO Max bright\n"); |
2738 | return; | 2738 | return; |
2739 | } | 2739 | } |
2740 | intel_sdvo_write_cmd(intel_output, | 2740 | intel_sdvo_write_cmd(intel_encoder, |
2741 | SDVO_CMD_GET_BRIGHTNESS, NULL, 0); | 2741 | SDVO_CMD_GET_BRIGHTNESS, NULL, 0); |
2742 | status = intel_sdvo_read_response(intel_output, | 2742 | status = intel_sdvo_read_response(intel_encoder, |
2743 | &response, 2); | 2743 | &response, 2); |
2744 | if (status != SDVO_CMD_STATUS_SUCCESS) { | 2744 | if (status != SDVO_CMD_STATUS_SUCCESS) { |
2745 | DRM_DEBUG_KMS("Incorrect SDVO get brigh\n"); | 2745 | DRM_DEBUG_KMS("Incorrect SDVO get brigh\n"); |
@@ -2768,40 +2768,40 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2768 | { | 2768 | { |
2769 | struct drm_i915_private *dev_priv = dev->dev_private; | 2769 | struct drm_i915_private *dev_priv = dev->dev_private; |
2770 | struct drm_connector *connector; | 2770 | struct drm_connector *connector; |
2771 | struct intel_output *intel_output; | 2771 | struct intel_encoder *intel_encoder; |
2772 | struct intel_sdvo_priv *sdvo_priv; | 2772 | struct intel_sdvo_priv *sdvo_priv; |
2773 | 2773 | ||
2774 | u8 ch[0x40]; | 2774 | u8 ch[0x40]; |
2775 | int i; | 2775 | int i; |
2776 | 2776 | ||
2777 | intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); | 2777 | intel_encoder = kcalloc(sizeof(struct intel_encoder)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); |
2778 | if (!intel_output) { | 2778 | if (!intel_encoder) { |
2779 | return false; | 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 | sdvo_priv->output_device = output_device; | 2783 | sdvo_priv->output_device = output_device; |
2784 | 2784 | ||
2785 | intel_output->dev_priv = sdvo_priv; | 2785 | intel_encoder->dev_priv = sdvo_priv; |
2786 | intel_output->type = INTEL_OUTPUT_SDVO; | 2786 | intel_encoder->type = INTEL_OUTPUT_SDVO; |
2787 | 2787 | ||
2788 | /* setup the DDC bus. */ | 2788 | /* setup the DDC bus. */ |
2789 | if (output_device == SDVOB) | 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 | else | 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 | goto err_inteloutput; | 2795 | goto err_inteloutput; |
2796 | 2796 | ||
2797 | sdvo_priv->slave_addr = intel_sdvo_get_slave_addr(dev, output_device); | 2797 | sdvo_priv->slave_addr = intel_sdvo_get_slave_addr(dev, output_device); |
2798 | 2798 | ||
2799 | /* Save the bit-banging i2c functionality for use by the DDC wrapper */ | 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 | /* Read the regs to test if we can talk to the device */ | 2802 | /* Read the regs to test if we can talk to the device */ |
2803 | for (i = 0; i < 0x40; i++) { | 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 | DRM_DEBUG_KMS("No SDVO device found on SDVO%c\n", | 2805 | DRM_DEBUG_KMS("No SDVO device found on SDVO%c\n", |
2806 | output_device == SDVOB ? 'B' : 'C'); | 2806 | output_device == SDVOB ? 'B' : 'C'); |
2807 | goto err_i2c; | 2807 | goto err_i2c; |
@@ -2810,27 +2810,27 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2810 | 2810 | ||
2811 | /* setup the DDC bus. */ | 2811 | /* setup the DDC bus. */ |
2812 | if (output_device == SDVOB) { | 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 | sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, | 2814 | sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, |
2815 | "SDVOB/VGA DDC BUS"); | 2815 | "SDVOB/VGA DDC BUS"); |
2816 | dev_priv->hotplug_supported_mask |= SDVOB_HOTPLUG_INT_STATUS; | 2816 | dev_priv->hotplug_supported_mask |= SDVOB_HOTPLUG_INT_STATUS; |
2817 | } else { | 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 | sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, | 2819 | sdvo_priv->analog_ddc_bus = intel_i2c_create(dev, GPIOA, |
2820 | "SDVOC/VGA DDC BUS"); | 2820 | "SDVOC/VGA DDC BUS"); |
2821 | dev_priv->hotplug_supported_mask |= SDVOC_HOTPLUG_INT_STATUS; | 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 | goto err_i2c; | 2825 | goto err_i2c; |
2826 | 2826 | ||
2827 | /* Wrap with our custom algo which switches to DDC mode */ | 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 | /* In default case sdvo lvds is false */ | 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 | sdvo_priv->caps.output_flags) != true) { | 2834 | sdvo_priv->caps.output_flags) != true) { |
2835 | DRM_DEBUG_KMS("SDVO output failed to setup on SDVO%c\n", | 2835 | DRM_DEBUG_KMS("SDVO output failed to setup on SDVO%c\n", |
2836 | output_device == SDVOB ? 'B' : 'C'); | 2836 | output_device == SDVOB ? 'B' : 'C'); |
@@ -2838,7 +2838,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | 2840 | ||
2841 | connector = &intel_output->base; | 2841 | connector = &intel_encoder->base; |
2842 | drm_connector_init(dev, connector, &intel_sdvo_connector_funcs, | 2842 | drm_connector_init(dev, connector, &intel_sdvo_connector_funcs, |
2843 | connector->connector_type); | 2843 | connector->connector_type); |
2844 | 2844 | ||
@@ -2847,12 +2847,12 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2847 | connector->doublescan_allowed = 0; | 2847 | connector->doublescan_allowed = 0; |
2848 | connector->display_info.subpixel_order = SubPixelHorizontalRGB; | 2848 | connector->display_info.subpixel_order = SubPixelHorizontalRGB; |
2849 | 2849 | ||
2850 | drm_encoder_init(dev, &intel_output->enc, | 2850 | drm_encoder_init(dev, &intel_encoder->enc, |
2851 | &intel_sdvo_enc_funcs, intel_output->enc.encoder_type); | 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 | if (sdvo_priv->is_tv) | 2856 | if (sdvo_priv->is_tv) |
2857 | intel_sdvo_tv_create_property(connector); | 2857 | intel_sdvo_tv_create_property(connector); |
2858 | 2858 | ||
@@ -2864,9 +2864,9 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2864 | intel_sdvo_select_ddc_bus(sdvo_priv); | 2864 | intel_sdvo_select_ddc_bus(sdvo_priv); |
2865 | 2865 | ||
2866 | /* Set the input timing to the screen. Assume always input 0. */ | 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 | &sdvo_priv->pixel_clock_min, | 2870 | &sdvo_priv->pixel_clock_min, |
2871 | &sdvo_priv->pixel_clock_max); | 2871 | &sdvo_priv->pixel_clock_max); |
2872 | 2872 | ||
@@ -2893,12 +2893,12 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) | |||
2893 | err_i2c: | 2893 | err_i2c: |
2894 | if (sdvo_priv->analog_ddc_bus != NULL) | 2894 | if (sdvo_priv->analog_ddc_bus != NULL) |
2895 | intel_i2c_destroy(sdvo_priv->analog_ddc_bus); | 2895 | intel_i2c_destroy(sdvo_priv->analog_ddc_bus); |
2896 | if (intel_output->ddc_bus != NULL) | 2896 | if (intel_encoder->ddc_bus != NULL) |
2897 | intel_i2c_destroy(intel_output->ddc_bus); | 2897 | intel_i2c_destroy(intel_encoder->ddc_bus); |
2898 | if (intel_output->i2c_bus != NULL) | 2898 | if (intel_encoder->i2c_bus != NULL) |
2899 | intel_i2c_destroy(intel_output->i2c_bus); | 2899 | intel_i2c_destroy(intel_encoder->i2c_bus); |
2900 | err_inteloutput: | 2900 | err_inteloutput: |
2901 | kfree(intel_output); | 2901 | kfree(intel_encoder); |
2902 | 2902 | ||
2903 | return false; | 2903 | return false; |
2904 | } | 2904 | } |