On Tue, 2009-03-03 at 18:08 +0800, yakui_zhao wrote:
> Subject: Patch DRM/I915: Add the load-detection for crt detect
> From: Zhao Yakui <[email protected]>
>  
>     Add the load-detection for crt detect
> 
> Signed-off-by: Zhao Yakui <[email protected]>
> ---
>  drivers/gpu/drm/i915/intel_crt.c |  136 
> ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 133 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
> ===================================================================
> --- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c   2009-03-03 
> 18:01:04.000000000 +0800
> +++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c        2009-03-03 
> 18:01:12.000000000 +0800
> @@ -217,9 +217,120 @@
>       return intel_ddc_probe(intel_output);
>  }
>  
> +/*
> + * Detects CRT presence by checking for load.
> + *
> + * Requires that the current pipe's DPLL is active.  This will cause flicker
> + * on the CRT, so it should not be used while the display is being used.  
> Only
> + * color (not monochrome) displays are detected.
> + *
> + * return TRUE if CRT is connected.
> + * return FALSE if CRT is disconnected.
> + */
> +static bool intel_crt_detect_load(struct intel_crtc *intel_crtc,
> +                                     struct intel_output *intel_output)
> +{
> +     struct drm_encoder *encoder = &intel_output->enc;
> +     struct drm_device *drm_dev = encoder->dev;

Everywhere else in the drm, this is called struct drm_device *dev.
Please follow that.

> +     struct drm_i915_private *dev_priv = drm_dev->dev_private;
> +     u32     save_bclrpat, save_vtotal, vtotal, vactive, vsample, vblank,
> +             vblank_start, vblank_end, dsl;
> +     u8      st00;
> +     int     bclrpat_reg, pipeconf_reg, pipe_dsl_reg, vtotal_reg,
> +             vblank_reg, vsync_reg, pipe;
> +     bool    present;
> +

This is unusual formatting of your variables.  For the following lines,
just start a new declaration:
+       u32 save_bclrpat, save_vtotal, vtotal, vactive, vsample, vblank,
+       u32 vblank_start, vblank_end, dsl;

> +     pipe = intel_crtc->pipe;
> +     if (pipe == 0) {
> +             bclrpat_reg = BCLRPAT_A;
> +             vtotal_reg = VTOTAL_A;
> +             vblank_reg = VBLANK_A;
> +             vsync_reg = VSYNC_A;
> +             pipeconf_reg = PIPEACONF;
> +             pipe_dsl_reg = PIPEADSL;
> +     } else {
> +             bclrpat_reg = BCLRPAT_B;
> +             vtotal_reg = VTOTAL_B;
> +             vblank_reg = VBLANK_B;
> +             vsync_reg = VSYNC_B;
> +             pipeconf_reg = PIPEBCONF;
> +             pipe_dsl_reg = PIPEBDSL;
> +     }
> +     save_bclrpat = I915_READ(bclrpat_reg);
> +     save_vtotal = I915_READ(vtotal_reg);
> +     vblank = I915_READ(vblank_reg);
> +
> +     vtotal = ((save_vtotal >> 16) & 0xfff) + 1;
> +     vactive = (save_vtotal & 0x7ff) + 1;
> +
> +     vblank_start = (vblank & 0xfff) + 1;
> +     vblank_end = ((vblank >> 16) & 0xfff) + 1;
> +
> +     /* Set the border color to purple. */
> +     I915_WRITE(bclrpat_reg, 0x500050);
> +     if (IS_I9XX(drm_dev)) {
> +             u32 pipeconf = I915_READ(pipeconf_reg);
> +             I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
> +             st00 = I915_READ8(VGA_MSR_WRITE);
> +             present = (st00 & (1 << 4)) != 0;
> +             I915_WRITE(pipeconf_reg, pipeconf);
> +     } else {
> +             bool restore_vblank = false;
> +             int count, detect;
> +             /* If there isn't any border,add some.Yes,this will flicker */

More spaces:
/* If there isn't any border, add some.  Yes, this will flicker */

and a newline between variables and code is appreciated.

> @@ -228,11 +339,30 @@
>                       return connector_status_disconnected;
>       }
>  
> -     if (intel_crt_detect_ddc(connector))
> -             return connector_status_connected;
> +     intel_output = to_intel_output(connector);
> +     drm_crtc = intel_get_load_detect_pipe(intel_output, NULL,
> +                     &dpms_mode);

Indent this guy into lining up with the other arguments.

-- 
Eric Anholt
[email protected]                         [email protected]


Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to