aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-09-25 11:45:27 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-01 01:45:30 -0400
commitf2ecf2e3bc01868f244fc6ba9cf8fe5d8446db5b (patch)
treecf3548691aa74cb8b3142e16059a19bdfcd4a169 /drivers/gpu/drm
parent4eed4a0a4ac31830b4c328739cabb69721584bfc (diff)
drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes
When scanning out a stereo mode, the AVI infoframe vic field has to be the underlyng 2D VIC. Before that commit, we weren't matching the CEA mode because of the extra stereo flag and then were setting the VIC field in the AVI infoframe to 0. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_edid.c4
-rw-r--r--drivers/gpu/drm/drm_modes.c18
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 0bae76d40f28..48f1746f67d8 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2404,7 +2404,7 @@ u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
2404 2404
2405 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) || 2405 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
2406 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) && 2406 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) &&
2407 drm_mode_equal_no_clocks(to_match, cea_mode)) 2407 drm_mode_equal_no_clocks_no_stereo(to_match, cea_mode))
2408 return mode + 1; 2408 return mode + 1;
2409 } 2409 }
2410 return 0; 2410 return 0;
@@ -2453,7 +2453,7 @@ static u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match)
2453 2453
2454 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) || 2454 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
2455 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) && 2455 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) &&
2456 drm_mode_equal_no_clocks(to_match, hdmi_mode)) 2456 drm_mode_equal_no_clocks_no_stereo(to_match, hdmi_mode))
2457 return mode + 1; 2457 return mode + 1;
2458 } 2458 }
2459 return 0; 2459 return 0;
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index fc2adb62b757..c2cb2c80f945 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -830,12 +830,16 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ
830 } else if (mode1->clock != mode2->clock) 830 } else if (mode1->clock != mode2->clock)
831 return false; 831 return false;
832 832
833 return drm_mode_equal_no_clocks(mode1, mode2); 833 if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) !=
834 (mode2->flags & DRM_MODE_FLAG_3D_MASK))
835 return false;
836
837 return drm_mode_equal_no_clocks_no_stereo(mode1, mode2);
834} 838}
835EXPORT_SYMBOL(drm_mode_equal); 839EXPORT_SYMBOL(drm_mode_equal);
836 840
837/** 841/**
838 * drm_mode_equal_no_clocks - test modes for equality 842 * drm_mode_equal_no_clocks_no_stereo - test modes for equality
839 * @mode1: first mode 843 * @mode1: first mode
840 * @mode2: second mode 844 * @mode2: second mode
841 * 845 *
@@ -843,12 +847,13 @@ EXPORT_SYMBOL(drm_mode_equal);
843 * None. 847 * None.
844 * 848 *
845 * Check to see if @mode1 and @mode2 are equivalent, but 849 * Check to see if @mode1 and @mode2 are equivalent, but
846 * don't check the pixel clocks. 850 * don't check the pixel clocks nor the stereo layout.
847 * 851 *
848 * RETURNS: 852 * RETURNS:
849 * True if the modes are equal, false otherwise. 853 * True if the modes are equal, false otherwise.
850 */ 854 */
851bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) 855bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
856 const struct drm_display_mode *mode2)
852{ 857{
853 if (mode1->hdisplay == mode2->hdisplay && 858 if (mode1->hdisplay == mode2->hdisplay &&
854 mode1->hsync_start == mode2->hsync_start && 859 mode1->hsync_start == mode2->hsync_start &&
@@ -860,12 +865,13 @@ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct
860 mode1->vsync_end == mode2->vsync_end && 865 mode1->vsync_end == mode2->vsync_end &&
861 mode1->vtotal == mode2->vtotal && 866 mode1->vtotal == mode2->vtotal &&
862 mode1->vscan == mode2->vscan && 867 mode1->vscan == mode2->vscan &&
863 mode1->flags == mode2->flags) 868 (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) ==
869 (mode2->flags & ~DRM_MODE_FLAG_3D_MASK))
864 return true; 870 return true;
865 871
866 return false; 872 return false;
867} 873}
868EXPORT_SYMBOL(drm_mode_equal_no_clocks); 874EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
869 875
870/** 876/**
871 * drm_mode_validate_size - make sure modes adhere to size constraints 877 * drm_mode_validate_size - make sure modes adhere to size constraints