[Intel-gfx] [PATCH 18/37] drm/i915: Remove the potential SDVO programming error
Chris Wilson
chris at chris-wilson.co.uk
Wed Mar 10 23:45:05 CET 2010
Adjust the function to eliminating the potential programming error.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_sdvo.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 872a0ae..dc94b4c 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -522,16 +522,12 @@ static bool intel_sdvo_set_control_bus_switch(struct intel_output *intel_output,
return true;
}
-static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_0, bool target_1)
+static bool intel_sdvo_set_target_input(struct intel_output *intel_output, bool target_1)
{
struct intel_sdvo_set_target_input_args targets = {0};
u8 status;
- if (target_0 && target_1)
- return SDVO_CMD_STATUS_NOTSUPP;
-
- if (target_1)
- targets.target_1 = 1;
+ targets.target_1 = !! target_1;
status = SDVO_CMD_STATUS_READ_FAILED;
if (intel_sdvo_write_cmd(intel_output, SDVO_CMD_SET_TARGET_INPUT,
@@ -1108,8 +1104,8 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
return false;
/* Set the input timing to the screen. Assume always input 0. */
- intel_sdvo_set_target_input(output, true, false);
-
+ if (!intel_sdvo_set_target_input(output, false))
+ return false;
if (!intel_sdvo_create_preferred_input_timing(output,
mode->clock / 10,
@@ -1200,7 +1196,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
}
/* Set the input timing to the screen. Assume always input 0. */
- intel_sdvo_set_target_input(output, true, false);
+ if (!intel_sdvo_set_target_input(output, false))
+ return;
if (sdvo_priv->is_tv) {
if (!intel_sdvo_set_tv_format(output))
@@ -1338,13 +1335,13 @@ static void intel_sdvo_save(struct drm_connector *connector)
intel_sdvo_get_active_outputs(intel_output, &sdvo_priv->save_active_outputs);
if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) {
- intel_sdvo_set_target_input(intel_output, true, false);
+ intel_sdvo_set_target_input(intel_output, false);
intel_sdvo_get_input_timing(intel_output,
&sdvo_priv->save_input_dtd_1);
}
if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) {
- intel_sdvo_set_target_input(intel_output, false, true);
+ intel_sdvo_set_target_input(intel_output, true);
intel_sdvo_get_input_timing(intel_output,
&sdvo_priv->save_input_dtd_2);
}
@@ -1388,12 +1385,12 @@ static void intel_sdvo_restore(struct drm_connector *connector)
}
if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) {
- intel_sdvo_set_target_input(intel_output, true, false);
+ intel_sdvo_set_target_input(intel_output, false);
intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_1);
}
if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) {
- intel_sdvo_set_target_input(intel_output, false, true);
+ intel_sdvo_set_target_input(intel_output, true);
intel_sdvo_set_input_timing(intel_output, &sdvo_priv->save_input_dtd_2);
}
@@ -2899,7 +2896,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
intel_sdvo_select_ddc_bus(sdvo_priv);
/* Set the input timing to the screen. Assume always input 0. */
- if (!intel_sdvo_set_target_input(intel_output, true, false))
+ if (!intel_sdvo_set_target_input(intel_output, false))
goto err_i2c;
if (!intel_sdvo_get_input_pixel_clock_range(intel_output,
--
1.7.0
More information about the Intel-gfx
mailing list