From 4a604e5b68c28dccf42eec9f97b3905c185b749f Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Thu, 8 Apr 2010 22:14:19 +0800 Subject: [PATCH] drm/i915: Get the output pixel clock range of SDVO device Signed-off-by: Zhao Yakui --- drivers/gpu/drm/i915/intel_sdvo.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 48daee5..d2bac7e 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -2764,6 +2764,27 @@ static void intel_sdvo_create_enhance_property(struct drm_connector *connector) return; } +static void intel_sdvo_get_output_pixel_clock_range(struct intel_output *intel_output) +{ + struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; + struct intel_sdvo_pixel_clock_range clocks; + u8 status; + + intel_sdvo_set_target_output(intel_output, sdvo_priv->controlled_output); + + intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_OUTPUT_PIXEL_CLOCK_RANGE, + NULL, 0); + + status = intel_sdvo_read_response(intel_output, &clocks, sizeof(clocks)); + + if (status != SDVO_CMD_STATUS_SUCCESS) + return ; + + /* Convert the values from units of 10 kHz to kHz. */ + printk("output clock range of SDVO device is %d-%dKHz\n", + clocks.min * 10, clocks.max * 10); + return; +} bool intel_sdvo_init(struct drm_device *dev, int output_device) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -2870,6 +2891,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device) &sdvo_priv->pixel_clock_min, &sdvo_priv->pixel_clock_max); + intel_sdvo_get_output_pixel_clock_range(intel_output); DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " "clock range %dMHz - %dMHz, " -- 1.5.4.5