Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/irq: Make pipe unsigned and name consistent

Name all references to the pipe number (CRTC index) consistently to make
it easier to distinguish which is a pipe number and which is a pointer
to struct drm_crtc.

While at it also make all references to the pipe number unsigned because
there is no longer any reason why it should ever be negative.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Thierry Reding and committed by
Daniel Vetter
cc1ef118 7d1de851

+175 -173
+159 -157
drivers/gpu/drm/drm_irq.c
··· 43 43 #include <linux/export.h> 44 44 45 45 /* Access macro for slots in vblank timestamp ringbuffer. */ 46 - #define vblanktimestamp(dev, crtc, count) \ 47 - ((dev)->vblank[crtc].time[(count) % DRM_VBLANKTIME_RBSIZE]) 46 + #define vblanktimestamp(dev, pipe, count) \ 47 + ((dev)->vblank[pipe].time[(count) % DRM_VBLANKTIME_RBSIZE]) 48 48 49 49 /* Retry timestamp calculation up to 3 times to satisfy 50 50 * drm_timestamp_precision before giving up. ··· 57 57 #define DRM_REDUNDANT_VBLIRQ_THRESH_NS 1000000 58 58 59 59 static bool 60 - drm_get_last_vbltimestamp(struct drm_device *dev, int crtc, 60 + drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, 61 61 struct timeval *tvblank, unsigned flags); 62 62 63 63 static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ ··· 107 107 /** 108 108 * drm_update_vblank_count - update the master vblank counter 109 109 * @dev: DRM device 110 - * @crtc: counter to update 110 + * @pipe: counter to update 111 111 * 112 112 * Call back into the driver to update the appropriate vblank counter 113 113 * (specified by @crtc). Deal with wraparound, if it occurred, and ··· 120 120 * Note: caller must hold dev->vbl_lock since this reads & writes 121 121 * device vblank fields. 122 122 */ 123 - static void drm_update_vblank_count(struct drm_device *dev, int crtc) 123 + static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe) 124 124 { 125 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 125 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 126 126 u32 cur_vblank, diff; 127 127 bool rc; 128 128 struct timeval t_vblank; ··· 140 140 * corresponding vblank timestamp. 141 141 */ 142 142 do { 143 - cur_vblank = dev->driver->get_vblank_counter(dev, crtc); 144 - rc = drm_get_last_vbltimestamp(dev, crtc, &t_vblank, 0); 145 - } while (cur_vblank != dev->driver->get_vblank_counter(dev, crtc)); 143 + cur_vblank = dev->driver->get_vblank_counter(dev, pipe); 144 + rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, 0); 145 + } while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe)); 146 146 147 147 /* Deal with counter wrap */ 148 148 diff = cur_vblank - vblank->last; 149 149 if (cur_vblank < vblank->last) { 150 150 diff += dev->max_vblank_count + 1; 151 151 152 - DRM_DEBUG("last_vblank[%d]=0x%x, cur_vblank=0x%x => diff=0x%x\n", 153 - crtc, vblank->last, cur_vblank, diff); 152 + DRM_DEBUG("last_vblank[%u]=0x%x, cur_vblank=0x%x => diff=0x%x\n", 153 + pipe, vblank->last, cur_vblank, diff); 154 154 } 155 155 156 - DRM_DEBUG("updating vblank count on crtc %d, missed %d\n", 157 - crtc, diff); 156 + DRM_DEBUG("updating vblank count on crtc %u, missed %d\n", 157 + pipe, diff); 158 158 159 159 if (diff == 0) 160 160 return; ··· 167 167 if (!rc) 168 168 t_vblank = (struct timeval) {0, 0}; 169 169 170 - store_vblank(dev, crtc, diff, &t_vblank); 170 + store_vblank(dev, pipe, diff, &t_vblank); 171 171 } 172 172 173 173 /* ··· 176 176 * are preserved, even if there are any spurious vblank irq's after 177 177 * disable. 178 178 */ 179 - static void vblank_disable_and_save(struct drm_device *dev, int crtc) 179 + static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) 180 180 { 181 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 181 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 182 182 unsigned long irqflags; 183 183 u32 vblcount; 184 184 s64 diff_ns; ··· 206 206 * vblank interrupt is disabled. 207 207 */ 208 208 if (!vblank->enabled && 209 - drm_get_last_vbltimestamp(dev, crtc, &tvblank, 0)) { 210 - drm_update_vblank_count(dev, crtc); 209 + drm_get_last_vbltimestamp(dev, pipe, &tvblank, 0)) { 210 + drm_update_vblank_count(dev, pipe); 211 211 spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); 212 212 return; 213 213 } ··· 218 218 * hardware potentially runtime suspended. 219 219 */ 220 220 if (vblank->enabled) { 221 - dev->driver->disable_vblank(dev, crtc); 221 + dev->driver->disable_vblank(dev, pipe); 222 222 vblank->enabled = false; 223 223 } 224 224 ··· 235 235 * delayed gpu counter increment. 236 236 */ 237 237 do { 238 - vblank->last = dev->driver->get_vblank_counter(dev, crtc); 239 - vblrc = drm_get_last_vbltimestamp(dev, crtc, &tvblank, 0); 240 - } while (vblank->last != dev->driver->get_vblank_counter(dev, crtc) && (--count) && vblrc); 238 + vblank->last = dev->driver->get_vblank_counter(dev, pipe); 239 + vblrc = drm_get_last_vbltimestamp(dev, pipe, &tvblank, 0); 240 + } while (vblank->last != dev->driver->get_vblank_counter(dev, pipe) && (--count) && vblrc); 241 241 242 242 if (!count) 243 243 vblrc = 0; ··· 247 247 */ 248 248 vblcount = vblank->count; 249 249 diff_ns = timeval_to_ns(&tvblank) - 250 - timeval_to_ns(&vblanktimestamp(dev, crtc, vblcount)); 250 + timeval_to_ns(&vblanktimestamp(dev, pipe, vblcount)); 251 251 252 252 /* If there is at least 1 msec difference between the last stored 253 253 * timestamp and tvblank, then we are currently executing our ··· 262 262 * hope for the best. 263 263 */ 264 264 if (vblrc && (abs64(diff_ns) > 1000000)) 265 - store_vblank(dev, crtc, 1, &tvblank); 265 + store_vblank(dev, pipe, 1, &tvblank); 266 266 267 267 spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); 268 268 } ··· 271 271 { 272 272 struct drm_vblank_crtc *vblank = (void *)arg; 273 273 struct drm_device *dev = vblank->dev; 274 + unsigned int pipe = vblank->pipe; 274 275 unsigned long irqflags; 275 - int crtc = vblank->crtc; 276 276 277 277 if (!dev->vblank_disable_allowed) 278 278 return; 279 279 280 280 spin_lock_irqsave(&dev->vbl_lock, irqflags); 281 281 if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) { 282 - DRM_DEBUG("disabling vblank on crtc %d\n", crtc); 283 - vblank_disable_and_save(dev, crtc); 282 + DRM_DEBUG("disabling vblank on crtc %u\n", pipe); 283 + vblank_disable_and_save(dev, pipe); 284 284 } 285 285 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 286 286 } ··· 293 293 */ 294 294 void drm_vblank_cleanup(struct drm_device *dev) 295 295 { 296 - int crtc; 296 + unsigned int pipe; 297 297 298 298 /* Bail if the driver didn't call drm_vblank_init() */ 299 299 if (dev->num_crtcs == 0) 300 300 return; 301 301 302 - for (crtc = 0; crtc < dev->num_crtcs; crtc++) { 303 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 302 + for (pipe = 0; pipe < dev->num_crtcs; pipe++) { 303 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 304 304 305 305 WARN_ON(vblank->enabled && 306 306 drm_core_check_feature(dev, DRIVER_MODESET)); ··· 316 316 317 317 /** 318 318 * drm_vblank_init - initialize vblank support 319 - * @dev: drm_device 320 - * @num_crtcs: number of crtcs supported by @dev 319 + * @dev: DRM device 320 + * @num_crtcs: number of CRTCs supported by @dev 321 321 * 322 322 * This function initializes vblank support for @num_crtcs display pipelines. 323 323 * 324 324 * Returns: 325 325 * Zero on success or a negative error code on failure. 326 326 */ 327 - int drm_vblank_init(struct drm_device *dev, int num_crtcs) 327 + int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs) 328 328 { 329 - int i, ret = -ENOMEM; 329 + int ret = -ENOMEM; 330 + unsigned int i; 330 331 331 332 spin_lock_init(&dev->vbl_lock); 332 333 spin_lock_init(&dev->vblank_time_lock); ··· 342 341 struct drm_vblank_crtc *vblank = &dev->vblank[i]; 343 342 344 343 vblank->dev = dev; 345 - vblank->crtc = i; 344 + vblank->pipe = i; 346 345 init_waitqueue_head(&vblank->queue); 347 346 setup_timer(&vblank->disable_timer, vblank_disable_fn, 348 347 (unsigned long)vblank); ··· 625 624 if (mode->flags & DRM_MODE_FLAG_INTERLACE) 626 625 framedur_ns /= 2; 627 626 } else 628 - DRM_ERROR("crtc %d: Can't calculate constants, dotclock = 0!\n", 627 + DRM_ERROR("crtc %u: Can't calculate constants, dotclock = 0!\n", 629 628 crtc->base.id); 630 629 631 630 crtc->pixeldur_ns = pixeldur_ns; 632 631 crtc->linedur_ns = linedur_ns; 633 632 crtc->framedur_ns = framedur_ns; 634 633 635 - DRM_DEBUG("crtc %d: hwmode: htotal %d, vtotal %d, vdisplay %d\n", 634 + DRM_DEBUG("crtc %u: hwmode: htotal %d, vtotal %d, vdisplay %d\n", 636 635 crtc->base.id, mode->crtc_htotal, 637 636 mode->crtc_vtotal, mode->crtc_vdisplay); 638 - DRM_DEBUG("crtc %d: clock %d kHz framedur %d linedur %d, pixeldur %d\n", 637 + DRM_DEBUG("crtc %u: clock %d kHz framedur %d linedur %d, pixeldur %d\n", 639 638 crtc->base.id, dotclock, framedur_ns, 640 639 linedur_ns, pixeldur_ns); 641 640 } ··· 644 643 /** 645 644 * drm_calc_vbltimestamp_from_scanoutpos - precise vblank timestamp helper 646 645 * @dev: DRM device 647 - * @crtc: Which CRTC's vblank timestamp to retrieve 646 + * @pipe: index of CRTC whose vblank timestamp to retrieve 648 647 * @max_error: Desired maximum allowable error in timestamps (nanosecs) 649 648 * On return contains true maximum error of timestamp 650 649 * @vblank_time: Pointer to struct timeval which should receive the timestamp ··· 687 686 * DRM_VBLANKTIME_INVBL - Timestamp taken while scanout was in vblank interval. 688 687 * 689 688 */ 690 - int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, 689 + int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, 690 + unsigned int pipe, 691 691 int *max_error, 692 692 struct timeval *vblank_time, 693 693 unsigned flags, ··· 702 700 int framedur_ns, linedur_ns, pixeldur_ns, delta_ns, duration_ns; 703 701 bool invbl; 704 702 705 - if (crtc < 0 || crtc >= dev->num_crtcs) { 706 - DRM_ERROR("Invalid crtc %d\n", crtc); 703 + if (pipe >= dev->num_crtcs) { 704 + DRM_ERROR("Invalid crtc %u\n", pipe); 707 705 return -EINVAL; 708 706 } 709 707 ··· 722 720 * Happens during initial modesetting of a crtc. 723 721 */ 724 722 if (framedur_ns == 0) { 725 - DRM_DEBUG("crtc %d: Noop due to uninitialized mode.\n", crtc); 723 + DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe); 726 724 return -EAGAIN; 727 725 } 728 726 ··· 738 736 * Get vertical and horizontal scanout position vpos, hpos, 739 737 * and bounding timestamps stime, etime, pre/post query. 740 738 */ 741 - vbl_status = dev->driver->get_scanout_position(dev, crtc, flags, &vpos, 739 + vbl_status = dev->driver->get_scanout_position(dev, pipe, flags, &vpos, 742 740 &hpos, &stime, &etime); 743 741 744 742 /* Return as no-op if scanout query unsupported or failed. */ 745 743 if (!(vbl_status & DRM_SCANOUTPOS_VALID)) { 746 - DRM_DEBUG("crtc %d : scanoutpos query failed [%d].\n", 747 - crtc, vbl_status); 744 + DRM_DEBUG("crtc %u : scanoutpos query failed [%d].\n", 745 + pipe, vbl_status); 748 746 return -EIO; 749 747 } 750 748 ··· 758 756 759 757 /* Noisy system timing? */ 760 758 if (i == DRM_TIMESTAMP_MAXRETRIES) { 761 - DRM_DEBUG("crtc %d: Noisy timestamp %d us > %d us [%d reps].\n", 762 - crtc, duration_ns/1000, *max_error/1000, i); 759 + DRM_DEBUG("crtc %u: Noisy timestamp %d us > %d us [%d reps].\n", 760 + pipe, duration_ns/1000, *max_error/1000, i); 763 761 } 764 762 765 763 /* Return upper bound of timestamp precision error. */ ··· 792 790 etime = ktime_sub_ns(etime, delta_ns); 793 791 *vblank_time = ktime_to_timeval(etime); 794 792 795 - DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n", 796 - crtc, (int)vbl_status, hpos, vpos, 793 + DRM_DEBUG("crtc %u : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n", 794 + pipe, (int)vbl_status, hpos, vpos, 797 795 (long)tv_etime.tv_sec, (long)tv_etime.tv_usec, 798 796 (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, 799 797 duration_ns/1000, i); ··· 818 816 * drm_get_last_vbltimestamp - retrieve raw timestamp for the most recent 819 817 * vblank interval 820 818 * @dev: DRM device 821 - * @crtc: which CRTC's vblank timestamp to retrieve 819 + * @pipe: index of CRTC whose vblank timestamp to retrieve 822 820 * @tvblank: Pointer to target struct timeval which should receive the timestamp 823 821 * @flags: Flags to pass to driver: 824 822 * 0 = Default, ··· 835 833 * True if timestamp is considered to be very precise, false otherwise. 836 834 */ 837 835 static bool 838 - drm_get_last_vbltimestamp(struct drm_device *dev, int crtc, 836 + drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, 839 837 struct timeval *tvblank, unsigned flags) 840 838 { 841 839 int ret; ··· 845 843 846 844 /* Query driver if possible and precision timestamping enabled. */ 847 845 if (dev->driver->get_vblank_timestamp && (max_error > 0)) { 848 - ret = dev->driver->get_vblank_timestamp(dev, crtc, &max_error, 846 + ret = dev->driver->get_vblank_timestamp(dev, pipe, &max_error, 849 847 tvblank, flags); 850 848 if (ret > 0) 851 849 return true; ··· 862 860 /** 863 861 * drm_vblank_count - retrieve "cooked" vblank counter value 864 862 * @dev: DRM device 865 - * @crtc: which counter to retrieve 863 + * @pipe: index of CRTC for which to retrieve the counter 866 864 * 867 865 * Fetches the "cooked" vblank count value that represents the number of 868 866 * vblank events since the system was booted, including lost events due to ··· 873 871 * Returns: 874 872 * The software vblank counter. 875 873 */ 876 - u32 drm_vblank_count(struct drm_device *dev, int crtc) 874 + u32 drm_vblank_count(struct drm_device *dev, int pipe) 877 875 { 878 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 876 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 879 877 880 - if (WARN_ON(crtc >= dev->num_crtcs)) 878 + if (WARN_ON(pipe >= dev->num_crtcs)) 881 879 return 0; 882 880 883 881 return vblank->count; ··· 904 902 EXPORT_SYMBOL(drm_crtc_vblank_count); 905 903 906 904 /** 907 - * drm_vblank_count_and_time - retrieve "cooked" vblank counter value 908 - * and the system timestamp corresponding to that vblank counter value. 909 - * 905 + * drm_vblank_count_and_time - retrieve "cooked" vblank counter value and the 906 + * system timestamp corresponding to that vblank counter value. 910 907 * @dev: DRM device 911 - * @crtc: which counter to retrieve 908 + * @pipe: index of CRTC whose counter to retrieve 912 909 * @vblanktime: Pointer to struct timeval to receive the vblank timestamp. 913 910 * 914 911 * Fetches the "cooked" vblank count value that represents the number of ··· 915 914 * modesetting activity. Returns corresponding system timestamp of the time 916 915 * of the vblank interval that corresponds to the current vblank counter value. 917 916 */ 918 - u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, 917 + u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, 919 918 struct timeval *vblanktime) 920 919 { 921 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 920 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 922 921 u32 cur_vblank; 923 922 924 - if (WARN_ON(crtc >= dev->num_crtcs)) 923 + if (WARN_ON(pipe >= dev->num_crtcs)) 925 924 return 0; 926 925 927 926 /* ··· 932 931 do { 933 932 cur_vblank = vblank->count; 934 933 smp_rmb(); 935 - *vblanktime = vblanktimestamp(dev, crtc, cur_vblank); 934 + *vblanktime = vblanktimestamp(dev, pipe, cur_vblank); 936 935 smp_rmb(); 937 936 } while (cur_vblank != vblank->count); 938 937 ··· 959 958 /** 960 959 * drm_send_vblank_event - helper to send vblank event after pageflip 961 960 * @dev: DRM device 962 - * @crtc: CRTC in question 961 + * @pipe: CRTC index 963 962 * @e: the event to send 964 963 * 965 964 * Updates sequence # and timestamp on event, and sends it to userspace. ··· 967 966 * 968 967 * This is the legacy version of drm_crtc_send_vblank_event(). 969 968 */ 970 - void drm_send_vblank_event(struct drm_device *dev, int crtc, 971 - struct drm_pending_vblank_event *e) 969 + void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, 970 + struct drm_pending_vblank_event *e) 972 971 { 973 972 struct timeval now; 974 973 unsigned int seq; 975 974 976 975 if (dev->num_crtcs > 0) { 977 - seq = drm_vblank_count_and_time(dev, crtc, &now); 976 + seq = drm_vblank_count_and_time(dev, pipe, &now); 978 977 } else { 979 978 seq = 0; 980 979 981 980 now = get_drm_timestamp(); 982 981 } 983 - e->pipe = crtc; 982 + e->pipe = pipe; 984 983 send_vblank_event(dev, e, seq, &now); 985 984 } 986 985 EXPORT_SYMBOL(drm_send_vblank_event); ··· 1005 1004 /** 1006 1005 * drm_vblank_enable - enable the vblank interrupt on a CRTC 1007 1006 * @dev: DRM device 1008 - * @crtc: CRTC in question 1007 + * @pipe: CRTC index 1009 1008 */ 1010 - static int drm_vblank_enable(struct drm_device *dev, int crtc) 1009 + static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe) 1011 1010 { 1012 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1011 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1013 1012 int ret = 0; 1014 1013 1015 1014 assert_spin_locked(&dev->vbl_lock); ··· 1024 1023 * timestamps. Filtercode in drm_handle_vblank() will 1025 1024 * prevent double-accounting of same vblank interval. 1026 1025 */ 1027 - ret = dev->driver->enable_vblank(dev, crtc); 1028 - DRM_DEBUG("enabling vblank on crtc %d, ret: %d\n", crtc, ret); 1026 + ret = dev->driver->enable_vblank(dev, pipe); 1027 + DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret); 1029 1028 if (ret) 1030 1029 atomic_dec(&vblank->refcount); 1031 1030 else { 1032 1031 vblank->enabled = true; 1033 - drm_update_vblank_count(dev, crtc); 1032 + drm_update_vblank_count(dev, pipe); 1034 1033 } 1035 1034 } 1036 1035 ··· 1042 1041 /** 1043 1042 * drm_vblank_get - get a reference count on vblank events 1044 1043 * @dev: DRM device 1045 - * @crtc: which CRTC to own 1044 + * @pipe: index of CRTC to own 1046 1045 * 1047 1046 * Acquire a reference count on vblank events to avoid having them disabled 1048 1047 * while in use. ··· 1052 1051 * Returns: 1053 1052 * Zero on success, nonzero on failure. 1054 1053 */ 1055 - int drm_vblank_get(struct drm_device *dev, int crtc) 1054 + int drm_vblank_get(struct drm_device *dev, unsigned int pipe) 1056 1055 { 1057 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1056 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1058 1057 unsigned long irqflags; 1059 1058 int ret = 0; 1060 1059 1061 1060 if (!dev->num_crtcs) 1062 1061 return -EINVAL; 1063 1062 1064 - if (WARN_ON(crtc >= dev->num_crtcs)) 1063 + if (WARN_ON(pipe >= dev->num_crtcs)) 1065 1064 return -EINVAL; 1066 1065 1067 1066 spin_lock_irqsave(&dev->vbl_lock, irqflags); 1068 1067 /* Going from 0->1 means we have to enable interrupts again */ 1069 1068 if (atomic_add_return(1, &vblank->refcount) == 1) { 1070 - ret = drm_vblank_enable(dev, crtc); 1069 + ret = drm_vblank_enable(dev, pipe); 1071 1070 } else { 1072 1071 if (!vblank->enabled) { 1073 1072 atomic_dec(&vblank->refcount); ··· 1099 1098 EXPORT_SYMBOL(drm_crtc_vblank_get); 1100 1099 1101 1100 /** 1102 - * drm_vblank_put - give up ownership of vblank events 1101 + * drm_vblank_put - release ownership of vblank events 1103 1102 * @dev: DRM device 1104 - * @crtc: which counter to give up 1103 + * @pipe: index of CRTC to release 1105 1104 * 1106 1105 * Release ownership of a given vblank counter, turning off interrupts 1107 1106 * if possible. Disable interrupts after drm_vblank_offdelay milliseconds. 1108 1107 * 1109 1108 * This is the legacy version of drm_crtc_vblank_put(). 1110 1109 */ 1111 - void drm_vblank_put(struct drm_device *dev, int crtc) 1110 + void drm_vblank_put(struct drm_device *dev, unsigned int pipe) 1112 1111 { 1113 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1112 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1114 1113 1115 - if (WARN_ON(crtc >= dev->num_crtcs)) 1114 + if (WARN_ON(pipe >= dev->num_crtcs)) 1116 1115 return; 1117 1116 1118 1117 if (WARN_ON(atomic_read(&vblank->refcount) == 0)) ··· 1149 1148 /** 1150 1149 * drm_wait_one_vblank - wait for one vblank 1151 1150 * @dev: DRM device 1152 - * @crtc: crtc index 1151 + * @pipe: CRTC index 1153 1152 * 1154 1153 * This waits for one vblank to pass on @crtc, using the irq driver interfaces. 1155 1154 * It is a failure to call this when the vblank irq for @crtc is disabled, e.g. 1156 1155 * due to lack of driver support or because the crtc is off. 1157 1156 */ 1158 - void drm_wait_one_vblank(struct drm_device *dev, int crtc) 1157 + void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe) 1159 1158 { 1159 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1160 1160 int ret; 1161 1161 u32 last; 1162 1162 1163 - if (WARN_ON(crtc >= dev->num_crtcs)) 1163 + if (WARN_ON(pipe >= dev->num_crtcs)) 1164 1164 return; 1165 1165 1166 - ret = drm_vblank_get(dev, crtc); 1167 - if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", crtc, ret)) 1166 + ret = drm_vblank_get(dev, pipe); 1167 + if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", pipe, ret)) 1168 1168 return; 1169 1169 1170 - last = drm_vblank_count(dev, crtc); 1170 + last = drm_vblank_count(dev, pipe); 1171 1171 1172 - ret = wait_event_timeout(dev->vblank[crtc].queue, 1173 - last != drm_vblank_count(dev, crtc), 1172 + ret = wait_event_timeout(vblank->queue, 1173 + last != drm_vblank_count(dev, pipe), 1174 1174 msecs_to_jiffies(100)); 1175 1175 1176 - WARN(ret == 0, "vblank wait timed out on crtc %i\n", crtc); 1176 + WARN(ret == 0, "vblank wait timed out on crtc %i\n", pipe); 1177 1177 1178 - drm_vblank_put(dev, crtc); 1178 + drm_vblank_put(dev, pipe); 1179 1179 } 1180 1180 EXPORT_SYMBOL(drm_wait_one_vblank); 1181 1181 ··· 1197 1195 /** 1198 1196 * drm_vblank_off - disable vblank events on a CRTC 1199 1197 * @dev: DRM device 1200 - * @crtc: CRTC in question 1198 + * @pipe: CRTC index 1201 1199 * 1202 1200 * Drivers can use this function to shut down the vblank interrupt handling when 1203 1201 * disabling a crtc. This function ensures that the latest vblank frame count is ··· 1208 1206 * 1209 1207 * This is the legacy version of drm_crtc_vblank_off(). 1210 1208 */ 1211 - void drm_vblank_off(struct drm_device *dev, int crtc) 1209 + void drm_vblank_off(struct drm_device *dev, unsigned int pipe) 1212 1210 { 1213 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1211 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1214 1212 struct drm_pending_vblank_event *e, *t; 1215 1213 struct timeval now; 1216 1214 unsigned long irqflags; 1217 1215 unsigned int seq; 1218 1216 1219 - if (WARN_ON(crtc >= dev->num_crtcs)) 1217 + if (WARN_ON(pipe >= dev->num_crtcs)) 1220 1218 return; 1221 1219 1222 1220 spin_lock_irqsave(&dev->event_lock, irqflags); 1223 1221 1224 1222 spin_lock(&dev->vbl_lock); 1225 - vblank_disable_and_save(dev, crtc); 1223 + vblank_disable_and_save(dev, pipe); 1226 1224 wake_up(&vblank->queue); 1227 1225 1228 1226 /* ··· 1236 1234 spin_unlock(&dev->vbl_lock); 1237 1235 1238 1236 /* Send any queued vblank events, lest the natives grow disquiet */ 1239 - seq = drm_vblank_count_and_time(dev, crtc, &now); 1237 + seq = drm_vblank_count_and_time(dev, pipe, &now); 1240 1238 1241 1239 list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { 1242 - if (e->pipe != crtc) 1240 + if (e->pipe != pipe) 1243 1241 continue; 1244 1242 DRM_DEBUG("Sending premature vblank event on disable: \ 1245 1243 wanted %d, current %d\n", 1246 1244 e->event.sequence, seq); 1247 1245 list_del(&e->base.link); 1248 - drm_vblank_put(dev, e->pipe); 1246 + drm_vblank_put(dev, pipe); 1249 1247 send_vblank_event(dev, e, seq, &now); 1250 1248 } 1251 1249 spin_unlock_irqrestore(&dev->event_lock, irqflags); ··· 1306 1304 /** 1307 1305 * drm_vblank_on - enable vblank events on a CRTC 1308 1306 * @dev: DRM device 1309 - * @crtc: CRTC in question 1307 + * @pipe: CRTC index 1310 1308 * 1311 1309 * This functions restores the vblank interrupt state captured with 1312 1310 * drm_vblank_off() again. Note that calls to drm_vblank_on() and ··· 1315 1313 * 1316 1314 * This is the legacy version of drm_crtc_vblank_on(). 1317 1315 */ 1318 - void drm_vblank_on(struct drm_device *dev, int crtc) 1316 + void drm_vblank_on(struct drm_device *dev, unsigned int pipe) 1319 1317 { 1320 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1318 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1321 1319 unsigned long irqflags; 1322 1320 1323 - if (WARN_ON(crtc >= dev->num_crtcs)) 1321 + if (WARN_ON(pipe >= dev->num_crtcs)) 1324 1322 return; 1325 1323 1326 1324 spin_lock_irqsave(&dev->vbl_lock, irqflags); ··· 1338 1336 * vblank counter value before and after a modeset 1339 1337 */ 1340 1338 vblank->last = 1341 - (dev->driver->get_vblank_counter(dev, crtc) - 1) & 1339 + (dev->driver->get_vblank_counter(dev, pipe) - 1) & 1342 1340 dev->max_vblank_count; 1343 1341 /* 1344 1342 * re-enable interrupts if there are users left, or the ··· 1346 1344 */ 1347 1345 if (atomic_read(&vblank->refcount) != 0 || 1348 1346 (!dev->vblank_disable_immediate && drm_vblank_offdelay == 0)) 1349 - WARN_ON(drm_vblank_enable(dev, crtc)); 1347 + WARN_ON(drm_vblank_enable(dev, pipe)); 1350 1348 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1351 1349 } 1352 1350 EXPORT_SYMBOL(drm_vblank_on); ··· 1371 1369 /** 1372 1370 * drm_vblank_pre_modeset - account for vblanks across mode sets 1373 1371 * @dev: DRM device 1374 - * @crtc: CRTC in question 1372 + * @pipe: CRTC index 1375 1373 * 1376 1374 * Account for vblank events across mode setting events, which will likely 1377 1375 * reset the hardware frame counter. ··· 1391 1389 * Drivers must call drm_vblank_post_modeset() when re-enabling the same crtc 1392 1390 * again. 1393 1391 */ 1394 - void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) 1392 + void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe) 1395 1393 { 1396 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1394 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1397 1395 1398 1396 /* vblank is not initialized (IRQ not installed ?), or has been freed */ 1399 1397 if (!dev->num_crtcs) 1400 1398 return; 1401 1399 1402 - if (WARN_ON(crtc >= dev->num_crtcs)) 1400 + if (WARN_ON(pipe >= dev->num_crtcs)) 1403 1401 return; 1404 1402 1405 1403 /* ··· 1411 1409 */ 1412 1410 if (!vblank->inmodeset) { 1413 1411 vblank->inmodeset = 0x1; 1414 - if (drm_vblank_get(dev, crtc) == 0) 1412 + if (drm_vblank_get(dev, pipe) == 0) 1415 1413 vblank->inmodeset |= 0x2; 1416 1414 } 1417 1415 } ··· 1420 1418 /** 1421 1419 * drm_vblank_post_modeset - undo drm_vblank_pre_modeset changes 1422 1420 * @dev: DRM device 1423 - * @crtc: CRTC in question 1421 + * @pipe: CRTC index 1424 1422 * 1425 1423 * This function again drops the temporary vblank reference acquired in 1426 1424 * drm_vblank_pre_modeset. 1427 1425 */ 1428 - void drm_vblank_post_modeset(struct drm_device *dev, int crtc) 1426 + void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe) 1429 1427 { 1430 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1428 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1431 1429 unsigned long irqflags; 1432 1430 1433 1431 /* vblank is not initialized (IRQ not installed ?), or has been freed */ 1434 1432 if (!dev->num_crtcs) 1435 1433 return; 1436 1434 1437 - if (WARN_ON(crtc >= dev->num_crtcs)) 1435 + if (WARN_ON(pipe >= dev->num_crtcs)) 1438 1436 return; 1439 1437 1440 1438 if (vblank->inmodeset) { ··· 1443 1441 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1444 1442 1445 1443 if (vblank->inmodeset & 0x2) 1446 - drm_vblank_put(dev, crtc); 1444 + drm_vblank_put(dev, pipe); 1447 1445 1448 1446 vblank->inmodeset = 0; 1449 1447 } ··· 1465 1463 struct drm_file *file_priv) 1466 1464 { 1467 1465 struct drm_modeset_ctl *modeset = data; 1468 - unsigned int crtc; 1466 + unsigned int pipe; 1469 1467 1470 1468 /* If drm_vblank_init() hasn't been called yet, just no-op */ 1471 1469 if (!dev->num_crtcs) ··· 1475 1473 if (drm_core_check_feature(dev, DRIVER_MODESET)) 1476 1474 return 0; 1477 1475 1478 - crtc = modeset->crtc; 1479 - if (crtc >= dev->num_crtcs) 1476 + pipe = modeset->crtc; 1477 + if (pipe >= dev->num_crtcs) 1480 1478 return -EINVAL; 1481 1479 1482 1480 switch (modeset->cmd) { 1483 1481 case _DRM_PRE_MODESET: 1484 - drm_vblank_pre_modeset(dev, crtc); 1482 + drm_vblank_pre_modeset(dev, pipe); 1485 1483 break; 1486 1484 case _DRM_POST_MODESET: 1487 - drm_vblank_post_modeset(dev, crtc); 1485 + drm_vblank_post_modeset(dev, pipe); 1488 1486 break; 1489 1487 default: 1490 1488 return -EINVAL; ··· 1493 1491 return 0; 1494 1492 } 1495 1493 1496 - static int drm_queue_vblank_event(struct drm_device *dev, int pipe, 1494 + static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, 1497 1495 union drm_wait_vblank *vblwait, 1498 1496 struct drm_file *file_priv) 1499 1497 { ··· 1547 1545 vblwait->reply.sequence = vblwait->request.sequence; 1548 1546 } 1549 1547 1550 - DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n", 1548 + DRM_DEBUG("event on vblank count %d, current %d, crtc %u\n", 1551 1549 vblwait->request.sequence, seq, pipe); 1552 1550 1553 1551 trace_drm_vblank_event_queued(current->pid, pipe, ··· 1596 1594 struct drm_vblank_crtc *vblank; 1597 1595 union drm_wait_vblank *vblwait = data; 1598 1596 int ret; 1599 - unsigned int flags, seq, crtc, high_crtc; 1597 + unsigned int flags, seq, pipe, high_pipe; 1600 1598 1601 1599 if (!dev->irq_enabled) 1602 1600 return -EINVAL; ··· 1615 1613 } 1616 1614 1617 1615 flags = vblwait->request.type & _DRM_VBLANK_FLAGS_MASK; 1618 - high_crtc = (vblwait->request.type & _DRM_VBLANK_HIGH_CRTC_MASK); 1619 - if (high_crtc) 1620 - crtc = high_crtc >> _DRM_VBLANK_HIGH_CRTC_SHIFT; 1616 + high_pipe = (vblwait->request.type & _DRM_VBLANK_HIGH_CRTC_MASK); 1617 + if (high_pipe) 1618 + pipe = high_pipe >> _DRM_VBLANK_HIGH_CRTC_SHIFT; 1621 1619 else 1622 - crtc = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; 1623 - if (crtc >= dev->num_crtcs) 1620 + pipe = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; 1621 + if (pipe >= dev->num_crtcs) 1624 1622 return -EINVAL; 1625 1623 1626 - vblank = &dev->vblank[crtc]; 1624 + vblank = &dev->vblank[pipe]; 1627 1625 1628 - ret = drm_vblank_get(dev, crtc); 1626 + ret = drm_vblank_get(dev, pipe); 1629 1627 if (ret) { 1630 1628 DRM_DEBUG("failed to acquire vblank counter, %d\n", ret); 1631 1629 return ret; 1632 1630 } 1633 - seq = drm_vblank_count(dev, crtc); 1631 + seq = drm_vblank_count(dev, pipe); 1634 1632 1635 1633 switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) { 1636 1634 case _DRM_VBLANK_RELATIVE: ··· 1647 1645 /* must hold on to the vblank ref until the event fires 1648 1646 * drm_vblank_put will be called asynchronously 1649 1647 */ 1650 - return drm_queue_vblank_event(dev, crtc, vblwait, file_priv); 1648 + return drm_queue_vblank_event(dev, pipe, vblwait, file_priv); 1651 1649 } 1652 1650 1653 1651 if ((flags & _DRM_VBLANK_NEXTONMISS) && ··· 1655 1653 vblwait->request.sequence = seq + 1; 1656 1654 } 1657 1655 1658 - DRM_DEBUG("waiting on vblank count %d, crtc %d\n", 1659 - vblwait->request.sequence, crtc); 1656 + DRM_DEBUG("waiting on vblank count %d, crtc %u\n", 1657 + vblwait->request.sequence, pipe); 1660 1658 vblank->last_wait = vblwait->request.sequence; 1661 1659 DRM_WAIT_ON(ret, vblank->queue, 3 * HZ, 1662 - (((drm_vblank_count(dev, crtc) - 1660 + (((drm_vblank_count(dev, pipe) - 1663 1661 vblwait->request.sequence) <= (1 << 23)) || 1664 1662 !vblank->enabled || 1665 1663 !dev->irq_enabled)); ··· 1667 1665 if (ret != -EINTR) { 1668 1666 struct timeval now; 1669 1667 1670 - vblwait->reply.sequence = drm_vblank_count_and_time(dev, crtc, &now); 1668 + vblwait->reply.sequence = drm_vblank_count_and_time(dev, pipe, &now); 1671 1669 vblwait->reply.tval_sec = now.tv_sec; 1672 1670 vblwait->reply.tval_usec = now.tv_usec; 1673 1671 ··· 1678 1676 } 1679 1677 1680 1678 done: 1681 - drm_vblank_put(dev, crtc); 1679 + drm_vblank_put(dev, pipe); 1682 1680 return ret; 1683 1681 } 1684 1682 1685 - static void drm_handle_vblank_events(struct drm_device *dev, int crtc) 1683 + static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe) 1686 1684 { 1687 1685 struct drm_pending_vblank_event *e, *t; 1688 1686 struct timeval now; ··· 1690 1688 1691 1689 assert_spin_locked(&dev->event_lock); 1692 1690 1693 - seq = drm_vblank_count_and_time(dev, crtc, &now); 1691 + seq = drm_vblank_count_and_time(dev, pipe, &now); 1694 1692 1695 1693 list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { 1696 - if (e->pipe != crtc) 1694 + if (e->pipe != pipe) 1697 1695 continue; 1698 1696 if ((seq - e->event.sequence) > (1<<23)) 1699 1697 continue; ··· 1702 1700 e->event.sequence, seq); 1703 1701 1704 1702 list_del(&e->base.link); 1705 - drm_vblank_put(dev, e->pipe); 1703 + drm_vblank_put(dev, pipe); 1706 1704 send_vblank_event(dev, e, seq, &now); 1707 1705 } 1708 1706 1709 - trace_drm_vblank_event(crtc, seq); 1707 + trace_drm_vblank_event(pipe, seq); 1710 1708 } 1711 1709 1712 1710 /** 1713 1711 * drm_handle_vblank - handle a vblank event 1714 1712 * @dev: DRM device 1715 - * @crtc: where this event occurred 1713 + * @pipe: index of CRTC where this event occurred 1716 1714 * 1717 1715 * Drivers should call this routine in their vblank interrupt handlers to 1718 1716 * update the vblank counter and send any signals that may be pending. 1719 1717 * 1720 1718 * This is the legacy version of drm_crtc_handle_vblank(). 1721 1719 */ 1722 - bool drm_handle_vblank(struct drm_device *dev, int crtc) 1720 + bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe) 1723 1721 { 1724 - struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 1722 + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1725 1723 u32 vblcount; 1726 1724 s64 diff_ns; 1727 1725 struct timeval tvblank; ··· 1730 1728 if (WARN_ON_ONCE(!dev->num_crtcs)) 1731 1729 return false; 1732 1730 1733 - if (WARN_ON(crtc >= dev->num_crtcs)) 1731 + if (WARN_ON(pipe >= dev->num_crtcs)) 1734 1732 return false; 1735 1733 1736 1734 spin_lock_irqsave(&dev->event_lock, irqflags); ··· 1754 1752 1755 1753 /* Get current timestamp and count. */ 1756 1754 vblcount = vblank->count; 1757 - drm_get_last_vbltimestamp(dev, crtc, &tvblank, DRM_CALLED_FROM_VBLIRQ); 1755 + drm_get_last_vbltimestamp(dev, pipe, &tvblank, DRM_CALLED_FROM_VBLIRQ); 1758 1756 1759 1757 /* Compute time difference to timestamp of last vblank */ 1760 1758 diff_ns = timeval_to_ns(&tvblank) - 1761 - timeval_to_ns(&vblanktimestamp(dev, crtc, vblcount)); 1759 + timeval_to_ns(&vblanktimestamp(dev, pipe, vblcount)); 1762 1760 1763 1761 /* Update vblank timestamp and count if at least 1764 1762 * DRM_REDUNDANT_VBLIRQ_THRESH_NS nanoseconds ··· 1770 1768 * ignore those for accounting. 1771 1769 */ 1772 1770 if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) 1773 - store_vblank(dev, crtc, 1, &tvblank); 1771 + store_vblank(dev, pipe, 1, &tvblank); 1774 1772 else 1775 - DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n", 1776 - crtc, (int) diff_ns); 1773 + DRM_DEBUG("crtc %u: Redundant vblirq ignored. diff_ns = %d\n", 1774 + pipe, (int) diff_ns); 1777 1775 1778 1776 spin_unlock(&dev->vblank_time_lock); 1779 1777 1780 1778 wake_up(&vblank->queue); 1781 - drm_handle_vblank_events(dev, crtc); 1779 + drm_handle_vblank_events(dev, pipe); 1782 1780 1783 1781 spin_unlock_irqrestore(&dev->event_lock, irqflags); 1784 1782
+16 -16
include/drm/drmP.h
··· 681 681 682 682 struct drm_pending_vblank_event { 683 683 struct drm_pending_event base; 684 - int pipe; 684 + unsigned int pipe; 685 685 struct drm_event_vblank event; 686 686 }; 687 687 ··· 700 700 /* for wraparound handling */ 701 701 u32 last_wait; /* Last vblank seqno waited per CRTC */ 702 702 unsigned int inmodeset; /* Display driver is setting mode */ 703 - int crtc; /* crtc index */ 703 + unsigned int pipe; /* crtc index */ 704 704 bool enabled; /* so we don't call enable more than 705 705 once per disable */ 706 706 }; ··· 920 920 extern int drm_irq_install(struct drm_device *dev, int irq); 921 921 extern int drm_irq_uninstall(struct drm_device *dev); 922 922 923 - extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); 923 + extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs); 924 924 extern int drm_wait_vblank(struct drm_device *dev, void *data, 925 925 struct drm_file *filp); 926 - extern u32 drm_vblank_count(struct drm_device *dev, int crtc); 926 + extern u32 drm_vblank_count(struct drm_device *dev, int pipe); 927 927 extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); 928 - extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, 928 + extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, 929 929 struct timeval *vblanktime); 930 - extern void drm_send_vblank_event(struct drm_device *dev, int crtc, 931 - struct drm_pending_vblank_event *e); 930 + extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, 931 + struct drm_pending_vblank_event *e); 932 932 extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc, 933 933 struct drm_pending_vblank_event *e); 934 - extern bool drm_handle_vblank(struct drm_device *dev, int crtc); 934 + extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe); 935 935 extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc); 936 - extern int drm_vblank_get(struct drm_device *dev, int crtc); 937 - extern void drm_vblank_put(struct drm_device *dev, int crtc); 936 + extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe); 937 + extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe); 938 938 extern int drm_crtc_vblank_get(struct drm_crtc *crtc); 939 939 extern void drm_crtc_vblank_put(struct drm_crtc *crtc); 940 - extern void drm_wait_one_vblank(struct drm_device *dev, int crtc); 940 + extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe); 941 941 extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc); 942 - extern void drm_vblank_off(struct drm_device *dev, int crtc); 943 - extern void drm_vblank_on(struct drm_device *dev, int crtc); 942 + extern void drm_vblank_off(struct drm_device *dev, unsigned int pipe); 943 + extern void drm_vblank_on(struct drm_device *dev, unsigned int pipe); 944 944 extern void drm_crtc_vblank_off(struct drm_crtc *crtc); 945 945 extern void drm_crtc_vblank_reset(struct drm_crtc *crtc); 946 946 extern void drm_crtc_vblank_on(struct drm_crtc *crtc); 947 947 extern void drm_vblank_cleanup(struct drm_device *dev); 948 948 949 949 extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, 950 - int crtc, int *max_error, 950 + unsigned int pipe, int *max_error, 951 951 struct timeval *vblank_time, 952 952 unsigned flags, 953 953 const struct drm_crtc *refcrtc, ··· 968 968 } 969 969 970 970 /* Modesetting support */ 971 - extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); 972 - extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); 971 + extern void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe); 972 + extern void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe); 973 973 974 974 /* Stub support (drm_stub.h) */ 975 975 extern struct drm_master *drm_master_get(struct drm_master *master);