[Intel-gfx] [Patch 0/3]: [DRM/I915] : Sync the mode validation for INTERLACE/DBLSCAN
Eric Anholt
eric at anholt.net
Fri Mar 20 20:45:55 CET 2009
On Fri, 2009-03-20 at 14:10 +0800, yakui_zhao wrote:
> Subject: [DRM/I915]: Sync the mode validation for INTERLACE/DBLSCAN
> From: Zhao Yakui <yakui.zhao at intel.com>
>
> Sync the mode validation for INTERLACE/DBLSCAN
> This covers:
> Check whether the INTERLACE/DBLSCAN is supported by output device. If
> not, the mode containing the flag of INTERLACE/DBLSCAN will be marked
> as unsupported.
Please fix the style here.
> Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
> ---
> drivers/gpu/drm/drm_crtc_helper.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> Index: linux-2.6/drivers/gpu/drm/drm_crtc_helper.c
> ===================================================================
> --- linux-2.6.orig/drivers/gpu/drm/drm_crtc_helper.c 2009-03-20 11:47:32.000000000 +0800
> +++ linux-2.6/drivers/gpu/drm/drm_crtc_helper.c 2009-03-20 13:36:22.000000000 +0800
> @@ -41,6 +41,23 @@
> 968, 1056, 0, 600, 601, 605, 628, 0,
> DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> };
missing return here
> +static void drm_mode_validate_flag(struct drm_connector *connector,
> + int flags)
align the indentation of this line to the open paren
> +{
> + struct drm_display_mode *mode, *t;
> + if (flags == (DRM_MODE_FLAG_DBLSCAN |
> + DRM_MODE_FLAG_INTERLACE))
gratuitous newline to unaligned indentation
> + return ;
no space between return and ;
> + list_for_each_entry_safe(mode, t, &connector->modes, head) {
> + if (mode->flags & DRM_MODE_FLAG_INTERLACE &&
> + !(flags & DRM_MODE_FLAG_INTERLACE))
> + mode->status = MODE_NO_INTERLACE;
> + if (mode->flags & DRM_MODE_FLAG_DBLSCAN &&
> + !(flags & DRM_MODE_FLAG_DBLSCAN))
> + mode->status = MODE_NO_DBLESCAN;
> + }
> +}
>
> /**
> * drm_helper_probe_connector_modes - get complete set of display modes
> @@ -96,6 +113,14 @@
> if (maxX && maxY)
> drm_mode_validate_size(dev, &connector->modes, maxX,
> maxY, 0);
> + {
> + int flags = (connector->interlace_allowed ?
> + DRM_MODE_FLAG_INTERLACE : 0) |
> + (connector->doublescan_allowed ?
> + DRM_MODE_FLAG_DBLSCAN : 0);
declare your variable at the top of the function, don't start a new
block to declare it. Also, use some if ()s instead of a long wrapped
line with two ternary operators.
> + drm_mode_validate_flag(connector, flags);
> +
> + }
> list_for_each_entry_safe(mode, t, &connector->modes, head) {
> if (mode->status == MODE_OK)
> mode->status = connector_funcs->mode_valid(connector,
>
>
--
Eric Anholt
eric at anholt.net eric.anholt at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090320/67ff936f/attachment.sig>
More information about the Intel-gfx
mailing list