diff options
author | Daniel Stone <daniels@collabora.com> | 2015-03-19 00:33:02 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-23 11:22:30 -0400 |
commit | 54270952e9a83aebf31d16ded28e6757fdf8c88b (patch) | |
tree | 8fb4faede55572a36a012b7645efb7294b0f9af0 | |
parent | f3af5c7ddd9af8a466a725c6ba8ae2414aa19113 (diff) |
drm: mode: Allow NULL modes for equality check
Since we're now using mode == NULL to represent disabled, it's not
wholly surprising that we'd want to compare NULL modes.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 53885968bdaf..213b11ea69b5 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -903,6 +903,12 @@ EXPORT_SYMBOL(drm_mode_duplicate); | |||
903 | */ | 903 | */ |
904 | bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) | 904 | bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) |
905 | { | 905 | { |
906 | if (!mode1 && !mode2) | ||
907 | return true; | ||
908 | |||
909 | if (!mode1 || !mode2) | ||
910 | return false; | ||
911 | |||
906 | /* do clock check convert to PICOS so fb modes get matched | 912 | /* do clock check convert to PICOS so fb modes get matched |
907 | * the same */ | 913 | * the same */ |
908 | if (mode1->clock && mode2->clock) { | 914 | if (mode1->clock && mode2->clock) { |