aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authoryakui_zhao <yakui.zhao@intel.com>2009-04-01 23:52:12 -0400
committerDave Airlie <airlied@redhat.com>2009-04-02 19:21:31 -0400
commit6714977b45279c3a0b0ec2bc937284d9f116752f (patch)
tree3f8c5850b5ec2c2737a8aacfe9a2eeb00514cbb4 /drivers/gpu
parent16456c872e4e3d674dde73f9bdf3f69c0d95e070 (diff)
drm: sync the mode validation for INTERLACE/DBLSCAN
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. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1c3a8c557140..4c93b7b8560f 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -42,6 +42,26 @@ static struct drm_display_mode std_modes[] = {
42 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, 42 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
43}; 43};
44 44
45static void drm_mode_validate_flag(struct drm_connector *connector,
46 int flags)
47{
48 struct drm_display_mode *mode, *t;
49
50 if (flags == (DRM_MODE_FLAG_DBLSCAN | DRM_MODE_FLAG_INTERLACE))
51 return;
52
53 list_for_each_entry_safe(mode, t, &connector->modes, head) {
54 if ((mode->flags & DRM_MODE_FLAG_INTERLACE) &&
55 !(flags & DRM_MODE_FLAG_INTERLACE))
56 mode->status = MODE_NO_INTERLACE;
57 if ((mode->flags & DRM_MODE_FLAG_DBLSCAN) &&
58 !(flags & DRM_MODE_FLAG_DBLSCAN))
59 mode->status = MODE_NO_DBLESCAN;
60 }
61
62 return;
63}
64
45/** 65/**
46 * drm_helper_probe_connector_modes - get complete set of display modes 66 * drm_helper_probe_connector_modes - get complete set of display modes
47 * @dev: DRM device 67 * @dev: DRM device
@@ -72,6 +92,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
72 struct drm_connector_helper_funcs *connector_funcs = 92 struct drm_connector_helper_funcs *connector_funcs =
73 connector->helper_private; 93 connector->helper_private;
74 int count = 0; 94 int count = 0;
95 int mode_flags = 0;
75 96
76 DRM_DEBUG("%s\n", drm_get_connector_name(connector)); 97 DRM_DEBUG("%s\n", drm_get_connector_name(connector));
77 /* set all modes to the unverified state */ 98 /* set all modes to the unverified state */
@@ -96,6 +117,13 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
96 if (maxX && maxY) 117 if (maxX && maxY)
97 drm_mode_validate_size(dev, &connector->modes, maxX, 118 drm_mode_validate_size(dev, &connector->modes, maxX,
98 maxY, 0); 119 maxY, 0);
120
121 if (connector->interlace_allowed)
122 mode_flags |= DRM_MODE_FLAG_INTERLACE;
123 if (connector->doublescan_allowed)
124 mode_flags |= DRM_MODE_FLAG_DBLSCAN;
125 drm_mode_validate_flag(connector, mode_flags);
126
99 list_for_each_entry_safe(mode, t, &connector->modes, head) { 127 list_for_each_entry_safe(mode, t, &connector->modes, head) {
100 if (mode->status == MODE_OK) 128 if (mode->status == MODE_OK)
101 mode->status = connector_funcs->mode_valid(connector, 129 mode->status = connector_funcs->mode_valid(connector,