aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-23 09:14:15 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-13 07:48:39 -0400
commit63951385052f7974155fa38f962f0f4e9847f90a (patch)
tree3dcfa46b90b55c3ed6ae7097e824da416f3eef96 /drivers/gpu/drm/drm_modes.c
parent3ec0db819315c765b3c7bbf7e9dee2fe1f186f47 (diff)
drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.c
There's not really any value in stating that no locking is needed. And even if the comment is useful, a check for the right mutex at the beginning of the function is better since that can't be ingored as easily as a bit of documentation. Note that drm_mode_probed_add in drm_crtc.c is also changed, the next patch will move this into drm_modes.c v2: Don't add locking WARN_ONs where it is not strictly required (i.e. the two functions to validate/prune mode lists). Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c59
1 files changed, 2 insertions, 57 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 4892194937f3..be86fed30fda 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -42,9 +42,6 @@
42 * drm_mode_debug_printmodeline - print a mode to dmesg 42 * drm_mode_debug_printmodeline - print a mode to dmesg
43 * @mode: mode to print 43 * @mode: mode to print
44 * 44 *
45 * LOCKING:
46 * none.
47 *
48 * Describe @mode using DRM_DEBUG. 45 * Describe @mode using DRM_DEBUG.
49 */ 46 */
50void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) 47void drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
@@ -69,9 +66,6 @@ EXPORT_SYMBOL(drm_mode_debug_printmodeline);
69 * @interlaced:Whether the interlace is supported 66 * @interlaced:Whether the interlace is supported
70 * @margins: whether to add margins or not 67 * @margins: whether to add margins or not
71 * 68 *
72 * LOCKING:
73 * none.
74 *
75 * return the modeline based on CVT algorithm 69 * return the modeline based on CVT algorithm
76 * 70 *
77 * This function is called to generate the modeline based on CVT algorithm 71 * This function is called to generate the modeline based on CVT algorithm
@@ -294,9 +288,6 @@ EXPORT_SYMBOL(drm_cvt_mode);
294 * @GTF_K: extended GTF formula parameters 288 * @GTF_K: extended GTF formula parameters
295 * @GTF_2J: extended GTF formula parameters 289 * @GTF_2J: extended GTF formula parameters
296 * 290 *
297 * LOCKING.
298 * none.
299 *
300 * return the modeline based on full GTF algorithm. 291 * return the modeline based on full GTF algorithm.
301 * 292 *
302 * GTF feature blocks specify C and J in multiples of 0.5, so we pass them 293 * GTF feature blocks specify C and J in multiples of 0.5, so we pass them
@@ -479,9 +470,6 @@ EXPORT_SYMBOL(drm_gtf_mode_complex);
479 * @interlaced :whether the interlace is supported 470 * @interlaced :whether the interlace is supported
480 * @margins :whether the margin is supported 471 * @margins :whether the margin is supported
481 * 472 *
482 * LOCKING.
483 * none.
484 *
485 * return the modeline based on GTF algorithm 473 * return the modeline based on GTF algorithm
486 * 474 *
487 * This function is to create the modeline based on the GTF algorithm. 475 * This function is to create the modeline based on the GTF algorithm.
@@ -584,9 +572,6 @@ EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
584 * drm_mode_set_name - set the name on a mode 572 * drm_mode_set_name - set the name on a mode
585 * @mode: name will be set in this mode 573 * @mode: name will be set in this mode
586 * 574 *
587 * LOCKING:
588 * None.
589 *
590 * Set the name of @mode to a standard format. 575 * Set the name of @mode to a standard format.
591 */ 576 */
592void drm_mode_set_name(struct drm_display_mode *mode) 577void drm_mode_set_name(struct drm_display_mode *mode)
@@ -603,9 +588,6 @@ EXPORT_SYMBOL(drm_mode_set_name);
603 * drm_mode_width - get the width of a mode 588 * drm_mode_width - get the width of a mode
604 * @mode: mode 589 * @mode: mode
605 * 590 *
606 * LOCKING:
607 * None.
608 *
609 * Return @mode's width (hdisplay) value. 591 * Return @mode's width (hdisplay) value.
610 * 592 *
611 * FIXME: is this needed? 593 * FIXME: is this needed?
@@ -624,9 +606,6 @@ EXPORT_SYMBOL(drm_mode_width);
624 * drm_mode_height - get the height of a mode 606 * drm_mode_height - get the height of a mode
625 * @mode: mode 607 * @mode: mode
626 * 608 *
627 * LOCKING:
628 * None.
629 *
630 * Return @mode's height (vdisplay) value. 609 * Return @mode's height (vdisplay) value.
631 * 610 *
632 * FIXME: is this needed? 611 * FIXME: is this needed?
@@ -643,9 +622,6 @@ EXPORT_SYMBOL(drm_mode_height);
643/** drm_mode_hsync - get the hsync of a mode 622/** drm_mode_hsync - get the hsync of a mode
644 * @mode: mode 623 * @mode: mode
645 * 624 *
646 * LOCKING:
647 * None.
648 *
649 * Return @modes's hsync rate in kHz, rounded to the nearest int. 625 * Return @modes's hsync rate in kHz, rounded to the nearest int.
650 */ 626 */
651int drm_mode_hsync(const struct drm_display_mode *mode) 627int drm_mode_hsync(const struct drm_display_mode *mode)
@@ -670,9 +646,6 @@ EXPORT_SYMBOL(drm_mode_hsync);
670 * drm_mode_vrefresh - get the vrefresh of a mode 646 * drm_mode_vrefresh - get the vrefresh of a mode
671 * @mode: mode 647 * @mode: mode
672 * 648 *
673 * LOCKING:
674 * None.
675 *
676 * Return @mode's vrefresh rate in Hz or calculate it if necessary. 649 * Return @mode's vrefresh rate in Hz or calculate it if necessary.
677 * 650 *
678 * FIXME: why is this needed? shouldn't vrefresh be set already? 651 * FIXME: why is this needed? shouldn't vrefresh be set already?
@@ -713,9 +686,6 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
713 * @p: mode 686 * @p: mode
714 * @adjust_flags: a combination of adjustment flags 687 * @adjust_flags: a combination of adjustment flags
715 * 688 *
716 * LOCKING:
717 * None.
718 *
719 * Setup the CRTC modesetting parameters for @p, adjusting if necessary. 689 * Setup the CRTC modesetting parameters for @p, adjusting if necessary.
720 * 690 *
721 * - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of 691 * - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of
@@ -790,9 +760,6 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
790 * @dst: mode to overwrite 760 * @dst: mode to overwrite
791 * @src: mode to copy 761 * @src: mode to copy
792 * 762 *
793 * LOCKING:
794 * None.
795 *
796 * Copy an existing mode into another mode, preserving the object id and 763 * Copy an existing mode into another mode, preserving the object id and
797 * list head of the destination mode. 764 * list head of the destination mode.
798 */ 765 */
@@ -812,9 +779,6 @@ EXPORT_SYMBOL(drm_mode_copy);
812 * @dev: drm_device to allocate the duplicated mode for 779 * @dev: drm_device to allocate the duplicated mode for
813 * @mode: mode to duplicate 780 * @mode: mode to duplicate
814 * 781 *
815 * LOCKING:
816 * None.
817 *
818 * Just allocate a new mode, copy the existing mode into it, and return 782 * Just allocate a new mode, copy the existing mode into it, and return
819 * a pointer to it. Used to create new instances of established modes. 783 * a pointer to it. Used to create new instances of established modes.
820 */ 784 */
@@ -838,9 +802,6 @@ EXPORT_SYMBOL(drm_mode_duplicate);
838 * @mode1: first mode 802 * @mode1: first mode
839 * @mode2: second mode 803 * @mode2: second mode
840 * 804 *
841 * LOCKING:
842 * None.
843 *
844 * Check to see if @mode1 and @mode2 are equivalent. 805 * Check to see if @mode1 and @mode2 are equivalent.
845 * 806 *
846 * RETURNS: 807 * RETURNS:
@@ -869,9 +830,6 @@ EXPORT_SYMBOL(drm_mode_equal);
869 * @mode1: first mode 830 * @mode1: first mode
870 * @mode2: second mode 831 * @mode2: second mode
871 * 832 *
872 * LOCKING:
873 * None.
874 *
875 * Check to see if @mode1 and @mode2 are equivalent, but 833 * Check to see if @mode1 and @mode2 are equivalent, but
876 * don't check the pixel clocks nor the stereo layout. 834 * don't check the pixel clocks nor the stereo layout.
877 * 835 *
@@ -907,9 +865,6 @@ EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
907 * @maxY: maximum height 865 * @maxY: maximum height
908 * @maxPitch: max pitch 866 * @maxPitch: max pitch
909 * 867 *
910 * LOCKING:
911 * Caller must hold a lock protecting @mode_list.
912 *
913 * The DRM device (@dev) has size and pitch limits. Here we validate the 868 * The DRM device (@dev) has size and pitch limits. Here we validate the
914 * modes we probed for @dev against those limits and set their status as 869 * modes we probed for @dev against those limits and set their status as
915 * necessary. 870 * necessary.
@@ -939,9 +894,6 @@ EXPORT_SYMBOL(drm_mode_validate_size);
939 * @mode_list: list of modes to check 894 * @mode_list: list of modes to check
940 * @verbose: be verbose about it 895 * @verbose: be verbose about it
941 * 896 *
942 * LOCKING:
943 * Caller must hold a lock protecting @mode_list.
944 *
945 * Once mode list generation is complete, a caller can use this routine to 897 * Once mode list generation is complete, a caller can use this routine to
946 * remove invalid modes from a mode list. If any of the modes have a 898 * remove invalid modes from a mode list. If any of the modes have a
947 * status other than %MODE_OK, they are removed from @mode_list and freed. 899 * status other than %MODE_OK, they are removed from @mode_list and freed.
@@ -971,9 +923,6 @@ EXPORT_SYMBOL(drm_mode_prune_invalid);
971 * @lh_a: list_head for first mode 923 * @lh_a: list_head for first mode
972 * @lh_b: list_head for second mode 924 * @lh_b: list_head for second mode
973 * 925 *
974 * LOCKING:
975 * None.
976 *
977 * Compare two modes, given by @lh_a and @lh_b, returning a value indicating 926 * Compare two modes, given by @lh_a and @lh_b, returning a value indicating
978 * which is better. 927 * which is better.
979 * 928 *
@@ -1007,9 +956,6 @@ static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head
1007 * drm_mode_sort - sort mode list 956 * drm_mode_sort - sort mode list
1008 * @mode_list: list to sort 957 * @mode_list: list to sort
1009 * 958 *
1010 * LOCKING:
1011 * Caller must hold a lock protecting @mode_list.
1012 *
1013 * Sort @mode_list by favorability, putting good modes first. 959 * Sort @mode_list by favorability, putting good modes first.
1014 */ 960 */
1015void drm_mode_sort(struct list_head *mode_list) 961void drm_mode_sort(struct list_head *mode_list)
@@ -1022,9 +968,6 @@ EXPORT_SYMBOL(drm_mode_sort);
1022 * drm_mode_connector_list_update - update the mode list for the connector 968 * drm_mode_connector_list_update - update the mode list for the connector
1023 * @connector: the connector to update 969 * @connector: the connector to update
1024 * 970 *
1025 * LOCKING:
1026 * Caller must hold a lock protecting @mode_list.
1027 *
1028 * This moves the modes from the @connector probed_modes list 971 * This moves the modes from the @connector probed_modes list
1029 * to the actual mode list. It compares the probed mode against the current 972 * to the actual mode list. It compares the probed mode against the current
1030 * list and only adds different modes. All modes unverified after this point 973 * list and only adds different modes. All modes unverified after this point
@@ -1036,6 +979,8 @@ void drm_mode_connector_list_update(struct drm_connector *connector)
1036 struct drm_display_mode *pmode, *pt; 979 struct drm_display_mode *pmode, *pt;
1037 int found_it; 980 int found_it;
1038 981
982 WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex));
983
1039 list_for_each_entry_safe(pmode, pt, &connector->probed_modes, 984 list_for_each_entry_safe(pmode, pt, &connector->probed_modes,
1040 head) { 985 head) {
1041 found_it = 0; 986 found_it = 0;