Commit 446d2183 authored by Chris Wilson's avatar Chris Wilson

drm/i915/overlay: Tidy update_pfit_vscale_ratio()

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7340ea7d
...@@ -937,19 +937,20 @@ static void update_pfit_vscale_ratio(struct intel_overlay *overlay) ...@@ -937,19 +937,20 @@ static void update_pfit_vscale_ratio(struct intel_overlay *overlay)
{ {
struct drm_device *dev = overlay->dev; struct drm_device *dev = overlay->dev;
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
u32 ratio;
u32 pfit_control = I915_READ(PFIT_CONTROL); u32 pfit_control = I915_READ(PFIT_CONTROL);
u32 ratio;
/* XXX: This is not the same logic as in the xorg driver, but more in /* XXX: This is not the same logic as in the xorg driver, but more in
* line with the intel documentation for the i965 */ * line with the intel documentation for the i965
if (!IS_I965G(dev) && (pfit_control & VERT_AUTO_SCALE)) { */
ratio = I915_READ(PFIT_AUTO_RATIOS) >> PFIT_VERT_SCALE_SHIFT; if (!IS_I965G(dev)) {
} else { /* on i965 use the PGM reg to read out the autoscaler values */ if (pfit_control & VERT_AUTO_SCALE)
ratio = I915_READ(PFIT_PGM_RATIOS); ratio = I915_READ(PFIT_AUTO_RATIOS);
if (IS_I965G(dev))
ratio >>= PFIT_VERT_SCALE_SHIFT_965;
else else
ratio = I915_READ(PFIT_PGM_RATIOS);
ratio >>= PFIT_VERT_SCALE_SHIFT; ratio >>= PFIT_VERT_SCALE_SHIFT;
} else { /* on i965 use the PGM reg to read out the autoscaler values */
ratio = I915_READ(PFIT_PGM_RATIOS) >> PFIT_VERT_SCALE_SHIFT_965;
} }
overlay->pfit_vscale_ratio = ratio; overlay->pfit_vscale_ratio = ratio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment