Skip to content

Commit f2ecf2e

Browse files
Damien Lespiaudanvet
authored andcommitted
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>
1 parent 4eed4a0 commit f2ecf2e

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

‎drivers/gpu/drm/drm_edid.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,7 @@ u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
24042404

24052405
if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
24062406
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))
24082408
return mode + 1;
24092409
}
24102410
return 0;
@@ -2453,7 +2453,7 @@ static u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match)
24532453

24542454
if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
24552455
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))
24572457
return mode + 1;
24582458
}
24592459
return 0;

‎drivers/gpu/drm/drm_modes.c‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -830,25 +830,30 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ
830830
} else if (mode1->clock != mode2->clock)
831831
return false;
832832

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);
834838
}
835839
EXPORT_SYMBOL(drm_mode_equal);
836840

837841
/**
838-
* drm_mode_equal_no_clocks - test modes for equality
842+
* drm_mode_equal_no_clocks_no_stereo - test modes for equality
839843
* @mode1: first mode
840844
* @mode2: second mode
841845
*
842846
* LOCKING:
843847
* None.
844848
*
845849
* 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.
847851
*
848852
* RETURNS:
849853
* True if the modes are equal, false otherwise.
850854
*/
851-
bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
855+
bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
856+
const struct drm_display_mode *mode2)
852857
{
853858
if (mode1->hdisplay == mode2->hdisplay &&
854859
mode1->hsync_start == mode2->hsync_start &&
@@ -860,12 +865,13 @@ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct
860865
mode1->vsync_end == mode2->vsync_end &&
861866
mode1->vtotal == mode2->vtotal &&
862867
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))
864870
return true;
865871

866872
return false;
867873
}
868-
EXPORT_SYMBOL(drm_mode_equal_no_clocks);
874+
EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
869875

870876
/**
871877
* drm_mode_validate_size - make sure modes adhere to size constraints

‎include/drm/drm_crtc.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ extern void drm_mode_config_reset(struct drm_device *dev);
989989
extern void drm_mode_config_cleanup(struct drm_device *dev);
990990
extern void drm_mode_set_name(struct drm_display_mode *mode);
991991
extern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
992-
extern bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
992+
extern bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
993993
extern int drm_mode_width(const struct drm_display_mode *mode);
994994
extern int drm_mode_height(const struct drm_display_mode *mode);
995995

0 commit comments

Comments
 (0)