[Intel-gfx] [PATCH] i915: Modify for pineview lvds sync polarity

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 15 16:07:33 CET 2010


I was going to apply this and fix it up, but got stuck at git-am ;-)

On Tue, 14 Dec 2010 11:38:34 -0800, bfreed at chromium.org wrote:
> +		/* Only tested on pineview, should work on IS_9XX */
Yes, according to the docs I've checked so far, this is true for all
chipsets (and sharing the same bits).

> +		if (IS_PINEVIEW(dev)) {
> +			/* Set sync polarity for case when vbios did not */
> +			char curhs, curvs, newhs, newvs;
> +			curhs = (lvds & LVDS_HSYNC_POLARITY) ? '-' : '+';
> +			curvs = (lvds & LVDS_VSYNC_POLARITY) ? '-' : '+';
> +			newhs = (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ?
> +				'-' : '+';
> +			newvs = (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) ?
> +				'-' : '+';

This unusual block of code sticks out like a sore thumb. (Admittedly, the
whole of intel_display.c is ugly, but we want to try and improve it over
time ;-)

int lvds_sync = 0;
if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
	lvds_sync |= LVDS_HSYNC_POLARITY;
if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
	lvds_sync |= LVDS_VSYNC_POLARITY;
if (lvds & (LVDS_HSYNC_POLARITY | LVDS_VSYNC_POLARITY) != lvds_sync) {
	char flags[2] = "-+";
	DRM_INFO("Changing LVDS panel from (%chsync, %cvsync) to "
	         "(%chsync, %cvsync)\n",
		 flags[!(lvds & LVDS_HSYNC_POLARITY)],
		 flags[!(lvds & LVDS_VSYNC_POLARITY)],
		 flags[!(lvds_sync & LVDS_HSYNC_POLARITY)],
		 flags[!(lvds_sync & LVDS_VSYNC_POLARITY)]);
	lvds &= ~(LVDS_HSYNC_POLARITY | LVDS_VSYNC_POLARITY);
	lvds |= lvds_sync;
}
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list