Rev 4104 | Rev 5060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4104 | Rev 4560 | ||
---|---|---|---|
Line 703... | Line 703... | ||
703 | EXPORT_SYMBOL(drm_mode_vrefresh); |
703 | EXPORT_SYMBOL(drm_mode_vrefresh); |
Line 704... | Line 704... | ||
704 | 704 | ||
705 | /** |
705 | /** |
706 | * drm_mode_set_crtcinfo - set CRTC modesetting parameters |
706 | * drm_mode_set_crtcinfo - set CRTC modesetting parameters |
707 | * @p: mode |
707 | * @p: mode |
708 | * @adjust_flags: unused? (FIXME) |
708 | * @adjust_flags: a combination of adjustment flags |
709 | * |
709 | * |
710 | * LOCKING: |
710 | * LOCKING: |
711 | * None. |
711 | * None. |
712 | * |
712 | * |
- | 713 | * Setup the CRTC modesetting parameters for @p, adjusting if necessary. |
|
- | 714 | * |
|
- | 715 | * - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of |
|
- | 716 | * interlaced modes. |
|
- | 717 | * - The CRTC_STEREO_DOUBLE flag can be used to compute the timings for |
|
- | 718 | * buffers containing two eyes (only adjust the timings when needed, eg. for |
|
713 | * Setup the CRTC modesetting parameters for @p, adjusting if necessary. |
719 | * "frame packing" or "side by side full"). |
714 | */ |
720 | */ |
715 | void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags) |
721 | void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags) |
716 | { |
722 | { |
717 | if ((p == NULL) || ((p->type & DRM_MODE_TYPE_CRTC_C) == DRM_MODE_TYPE_BUILTIN)) |
723 | if ((p == NULL) || ((p->type & DRM_MODE_TYPE_CRTC_C) == DRM_MODE_TYPE_BUILTIN)) |
Line -... | Line 724... | ||
- | 724 | return; |
|
718 | return; |
725 | |
719 | 726 | p->crtc_clock = p->clock; |
|
720 | p->crtc_hdisplay = p->hdisplay; |
727 | p->crtc_hdisplay = p->hdisplay; |
721 | p->crtc_hsync_start = p->hsync_start; |
728 | p->crtc_hsync_start = p->hsync_start; |
722 | p->crtc_hsync_end = p->hsync_end; |
729 | p->crtc_hsync_end = p->hsync_end; |
Line 748... | Line 755... | ||
748 | p->crtc_vsync_start *= p->vscan; |
755 | p->crtc_vsync_start *= p->vscan; |
749 | p->crtc_vsync_end *= p->vscan; |
756 | p->crtc_vsync_end *= p->vscan; |
750 | p->crtc_vtotal *= p->vscan; |
757 | p->crtc_vtotal *= p->vscan; |
751 | } |
758 | } |
Line -... | Line 759... | ||
- | 759 | ||
- | 760 | if (adjust_flags & CRTC_STEREO_DOUBLE) { |
|
- | 761 | unsigned int layout = p->flags & DRM_MODE_FLAG_3D_MASK; |
|
- | 762 | ||
- | 763 | switch (layout) { |
|
- | 764 | case DRM_MODE_FLAG_3D_FRAME_PACKING: |
|
- | 765 | p->crtc_clock *= 2; |
|
- | 766 | p->crtc_vdisplay += p->crtc_vtotal; |
|
- | 767 | p->crtc_vsync_start += p->crtc_vtotal; |
|
- | 768 | p->crtc_vsync_end += p->crtc_vtotal; |
|
- | 769 | p->crtc_vtotal += p->crtc_vtotal; |
|
- | 770 | break; |
|
- | 771 | } |
|
- | 772 | } |
|
752 | 773 | ||
753 | p->crtc_vblank_start = min(p->crtc_vsync_start, p->crtc_vdisplay); |
774 | p->crtc_vblank_start = min(p->crtc_vsync_start, p->crtc_vdisplay); |
754 | p->crtc_vblank_end = max(p->crtc_vsync_end, p->crtc_vtotal); |
775 | p->crtc_vblank_end = max(p->crtc_vsync_end, p->crtc_vtotal); |
755 | p->crtc_hblank_start = min(p->crtc_hsync_start, p->crtc_hdisplay); |
776 | p->crtc_hblank_start = min(p->crtc_hsync_start, p->crtc_hdisplay); |
756 | p->crtc_hblank_end = max(p->crtc_hsync_end, p->crtc_htotal); |
777 | p->crtc_hblank_end = max(p->crtc_hsync_end, p->crtc_htotal); |
Line 826... | Line 847... | ||
826 | if (KHZ2PICOS(mode1->clock) != KHZ2PICOS(mode2->clock)) |
847 | if (KHZ2PICOS(mode1->clock) != KHZ2PICOS(mode2->clock)) |
827 | return false; |
848 | return false; |
828 | } else if (mode1->clock != mode2->clock) |
849 | } else if (mode1->clock != mode2->clock) |
829 | return false; |
850 | return false; |
Line -... | Line 851... | ||
- | 851 | ||
- | 852 | if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) != |
|
- | 853 | (mode2->flags & DRM_MODE_FLAG_3D_MASK)) |
|
- | 854 | return false; |
|
830 | 855 | ||
831 | return drm_mode_equal_no_clocks(mode1, mode2); |
856 | return drm_mode_equal_no_clocks_no_stereo(mode1, mode2); |
832 | } |
857 | } |
Line 833... | Line 858... | ||
833 | EXPORT_SYMBOL(drm_mode_equal); |
858 | EXPORT_SYMBOL(drm_mode_equal); |
834 | 859 | ||
835 | /** |
860 | /** |
836 | * drm_mode_equal_no_clocks - test modes for equality |
861 | * drm_mode_equal_no_clocks_no_stereo - test modes for equality |
837 | * @mode1: first mode |
862 | * @mode1: first mode |
838 | * @mode2: second mode |
863 | * @mode2: second mode |
839 | * |
864 | * |
840 | * LOCKING: |
865 | * LOCKING: |
841 | * None. |
866 | * None. |
842 | * |
867 | * |
843 | * Check to see if @mode1 and @mode2 are equivalent, but |
868 | * Check to see if @mode1 and @mode2 are equivalent, but |
844 | * don't check the pixel clocks. |
869 | * don't check the pixel clocks nor the stereo layout. |
845 | * |
870 | * |
846 | * RETURNS: |
871 | * RETURNS: |
847 | * True if the modes are equal, false otherwise. |
872 | * True if the modes are equal, false otherwise. |
- | 873 | */ |
|
848 | */ |
874 | bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, |
849 | bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) |
875 | const struct drm_display_mode *mode2) |
850 | { |
876 | { |
851 | if (mode1->hdisplay == mode2->hdisplay && |
877 | if (mode1->hdisplay == mode2->hdisplay && |
852 | mode1->hsync_start == mode2->hsync_start && |
878 | mode1->hsync_start == mode2->hsync_start && |
Line 856... | Line 882... | ||
856 | mode1->vdisplay == mode2->vdisplay && |
882 | mode1->vdisplay == mode2->vdisplay && |
857 | mode1->vsync_start == mode2->vsync_start && |
883 | mode1->vsync_start == mode2->vsync_start && |
858 | mode1->vsync_end == mode2->vsync_end && |
884 | mode1->vsync_end == mode2->vsync_end && |
859 | mode1->vtotal == mode2->vtotal && |
885 | mode1->vtotal == mode2->vtotal && |
860 | mode1->vscan == mode2->vscan && |
886 | mode1->vscan == mode2->vscan && |
861 | mode1->flags == mode2->flags) |
887 | (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) == |
- | 888 | (mode2->flags & ~DRM_MODE_FLAG_3D_MASK)) |
|
862 | return true; |
889 | return true; |
Line 863... | Line 890... | ||
863 | 890 | ||
864 | return false; |
891 | return false; |
865 | } |
892 | } |
Line 866... | Line 893... | ||
866 | EXPORT_SYMBOL(drm_mode_equal_no_clocks); |
893 | EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); |
867 | 894 | ||
868 | /** |
895 | /** |
869 | * drm_mode_validate_size - make sure modes adhere to size constraints |
896 | * drm_mode_validate_size - make sure modes adhere to size constraints |