diff options
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 04fa6f1808d1..faa79df02648 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -506,7 +506,7 @@ drm_gtf_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh, | |||
506 | } | 506 | } |
507 | EXPORT_SYMBOL(drm_gtf_mode); | 507 | EXPORT_SYMBOL(drm_gtf_mode); |
508 | 508 | ||
509 | #if IS_ENABLED(CONFIG_VIDEOMODE) | 509 | #ifdef CONFIG_VIDEOMODE_HELPERS |
510 | int drm_display_mode_from_videomode(const struct videomode *vm, | 510 | int drm_display_mode_from_videomode(const struct videomode *vm, |
511 | struct drm_display_mode *dmode) | 511 | struct drm_display_mode *dmode) |
512 | { | 512 | { |
@@ -523,26 +523,25 @@ int drm_display_mode_from_videomode(const struct videomode *vm, | |||
523 | dmode->clock = vm->pixelclock / 1000; | 523 | dmode->clock = vm->pixelclock / 1000; |
524 | 524 | ||
525 | dmode->flags = 0; | 525 | dmode->flags = 0; |
526 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 526 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; | 527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; |
528 | else if (vm->dmt_flags & VESA_DMT_HSYNC_LOW) | 528 | else if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW) |
529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; | 529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; |
530 | if (vm->dmt_flags & VESA_DMT_VSYNC_HIGH) | 530 | if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) |
531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; | 531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; |
532 | else if (vm->dmt_flags & VESA_DMT_VSYNC_LOW) | 532 | else if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW) |
533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; | 533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; |
534 | if (vm->data_flags & DISPLAY_FLAGS_INTERLACED) | 534 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) |
535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; | 535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; |
536 | if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN) | 536 | if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) |
537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; | 537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; |
538 | drm_mode_set_name(dmode); | 538 | drm_mode_set_name(dmode); |
539 | 539 | ||
540 | return 0; | 540 | return 0; |
541 | } | 541 | } |
542 | EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); | 542 | EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); |
543 | #endif | ||
544 | 543 | ||
545 | #if IS_ENABLED(CONFIG_OF_VIDEOMODE) | 544 | #ifdef CONFIG_OF |
546 | /** | 545 | /** |
547 | * of_get_drm_display_mode - get a drm_display_mode from devicetree | 546 | * of_get_drm_display_mode - get a drm_display_mode from devicetree |
548 | * @np: device_node with the timing specification | 547 | * @np: device_node with the timing specification |
@@ -572,7 +571,8 @@ int of_get_drm_display_mode(struct device_node *np, | |||
572 | return 0; | 571 | return 0; |
573 | } | 572 | } |
574 | EXPORT_SYMBOL_GPL(of_get_drm_display_mode); | 573 | EXPORT_SYMBOL_GPL(of_get_drm_display_mode); |
575 | #endif | 574 | #endif /* CONFIG_OF */ |
575 | #endif /* CONFIG_VIDEOMODE_HELPERS */ | ||
576 | 576 | ||
577 | /** | 577 | /** |
578 | * drm_mode_set_name - set the name on a mode | 578 | * drm_mode_set_name - set the name on a mode |
@@ -848,6 +848,26 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ | |||
848 | } else if (mode1->clock != mode2->clock) | 848 | } else if (mode1->clock != mode2->clock) |
849 | return false; | 849 | return false; |
850 | 850 | ||
851 | return drm_mode_equal_no_clocks(mode1, mode2); | ||
852 | } | ||
853 | EXPORT_SYMBOL(drm_mode_equal); | ||
854 | |||
855 | /** | ||
856 | * drm_mode_equal_no_clocks - test modes for equality | ||
857 | * @mode1: first mode | ||
858 | * @mode2: second mode | ||
859 | * | ||
860 | * LOCKING: | ||
861 | * None. | ||
862 | * | ||
863 | * Check to see if @mode1 and @mode2 are equivalent, but | ||
864 | * don't check the pixel clocks. | ||
865 | * | ||
866 | * RETURNS: | ||
867 | * True if the modes are equal, false otherwise. | ||
868 | */ | ||
869 | bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) | ||
870 | { | ||
851 | if (mode1->hdisplay == mode2->hdisplay && | 871 | if (mode1->hdisplay == mode2->hdisplay && |
852 | mode1->hsync_start == mode2->hsync_start && | 872 | mode1->hsync_start == mode2->hsync_start && |
853 | mode1->hsync_end == mode2->hsync_end && | 873 | mode1->hsync_end == mode2->hsync_end && |
@@ -863,7 +883,7 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ | |||
863 | 883 | ||
864 | return false; | 884 | return false; |
865 | } | 885 | } |
866 | EXPORT_SYMBOL(drm_mode_equal); | 886 | EXPORT_SYMBOL(drm_mode_equal_no_clocks); |
867 | 887 | ||
868 | /** | 888 | /** |
869 | * drm_mode_validate_size - make sure modes adhere to size constraints | 889 | * drm_mode_validate_size - make sure modes adhere to size constraints |