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

drm/irq: Use unsigned int pipe in public API

This continues the pattern started in commit cc1ef118fc09 ("drm/irq:
Make pipe unsigned and name consistent"). This is applied to the public
APIs and driver callbacks, so pretty much all drivers need to be updated
to match the new prototypes.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Jianwei Wang <jianwei.wang.chn@gmail.com>
Cc: Alison Wang <alison.wang@freescale.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mark Yao <mark.yao@rock-chips.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Thierry Reding and committed by
Daniel Vetter
88e72717 14152c8d

+239 -232
+4 -4
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 2349 2349 struct drm_file *file_priv); 2350 2350 int amdgpu_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon); 2351 2351 int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon); 2352 - u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, int crtc); 2353 - int amdgpu_enable_vblank_kms(struct drm_device *dev, int crtc); 2354 - void amdgpu_disable_vblank_kms(struct drm_device *dev, int crtc); 2355 - int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, 2352 + u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); 2353 + int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); 2354 + void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); 2355 + int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, 2356 2356 int *max_error, 2357 2357 struct timeval *vblank_time, 2358 2358 unsigned flags);
+5 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 721 721 * an optional accurate timestamp of when query happened. 722 722 * 723 723 * \param dev Device to query. 724 - * \param crtc Crtc to query. 724 + * \param pipe Crtc to query. 725 725 * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). 726 726 * \param *vpos Location where vertical scanout position should be stored. 727 727 * \param *hpos Location where horizontal scanout position should go. ··· 744 744 * unknown small number of scanlines wrt. real scanout position. 745 745 * 746 746 */ 747 - int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags, 748 - int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, 747 + int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, 748 + unsigned int flags, int *vpos, int *hpos, 749 + ktime_t *stime, ktime_t *etime, 749 750 const struct drm_display_mode *mode) 750 751 { 751 752 u32 vbl = 0, position = 0; ··· 761 760 if (stime) 762 761 *stime = ktime_get(); 763 762 764 - if (amdgpu_display_page_flip_get_scanoutpos(adev, crtc, &vbl, &position) == 0) 763 + if (amdgpu_display_page_flip_get_scanoutpos(adev, pipe, &vbl, &position) == 0) 765 764 ret |= DRM_SCANOUTPOS_VALID; 766 765 767 766 /* Get optional system timestamp after query. */
+18 -18
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 600 600 * amdgpu_get_vblank_counter_kms - get frame count 601 601 * 602 602 * @dev: drm dev pointer 603 - * @crtc: crtc to get the frame count from 603 + * @pipe: crtc to get the frame count from 604 604 * 605 605 * Gets the frame count on the requested crtc (all asics). 606 606 * Returns frame count on success, -EINVAL on failure. 607 607 */ 608 - u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, int crtc) 608 + u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe) 609 609 { 610 610 struct amdgpu_device *adev = dev->dev_private; 611 611 612 - if (crtc < 0 || crtc >= adev->mode_info.num_crtc) { 613 - DRM_ERROR("Invalid crtc %d\n", crtc); 612 + if (pipe >= adev->mode_info.num_crtc) { 613 + DRM_ERROR("Invalid crtc %u\n", pipe); 614 614 return -EINVAL; 615 615 } 616 616 617 - return amdgpu_display_vblank_get_counter(adev, crtc); 617 + return amdgpu_display_vblank_get_counter(adev, pipe); 618 618 } 619 619 620 620 /** 621 621 * amdgpu_enable_vblank_kms - enable vblank interrupt 622 622 * 623 623 * @dev: drm dev pointer 624 - * @crtc: crtc to enable vblank interrupt for 624 + * @pipe: crtc to enable vblank interrupt for 625 625 * 626 626 * Enable the interrupt on the requested crtc (all asics). 627 627 * Returns 0 on success, -EINVAL on failure. 628 628 */ 629 - int amdgpu_enable_vblank_kms(struct drm_device *dev, int crtc) 629 + int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe) 630 630 { 631 631 struct amdgpu_device *adev = dev->dev_private; 632 - int idx = amdgpu_crtc_idx_to_irq_type(adev, crtc); 632 + int idx = amdgpu_crtc_idx_to_irq_type(adev, pipe); 633 633 634 634 return amdgpu_irq_get(adev, &adev->crtc_irq, idx); 635 635 } ··· 638 638 * amdgpu_disable_vblank_kms - disable vblank interrupt 639 639 * 640 640 * @dev: drm dev pointer 641 - * @crtc: crtc to disable vblank interrupt for 641 + * @pipe: crtc to disable vblank interrupt for 642 642 * 643 643 * Disable the interrupt on the requested crtc (all asics). 644 644 */ 645 - void amdgpu_disable_vblank_kms(struct drm_device *dev, int crtc) 645 + void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe) 646 646 { 647 647 struct amdgpu_device *adev = dev->dev_private; 648 - int idx = amdgpu_crtc_idx_to_irq_type(adev, crtc); 648 + int idx = amdgpu_crtc_idx_to_irq_type(adev, pipe); 649 649 650 650 amdgpu_irq_put(adev, &adev->crtc_irq, idx); 651 651 } ··· 663 663 * scanout position. (all asics). 664 664 * Returns postive status flags on success, negative error on failure. 665 665 */ 666 - int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, 666 + int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, 667 667 int *max_error, 668 668 struct timeval *vblank_time, 669 669 unsigned flags) 670 670 { 671 - struct drm_crtc *drmcrtc; 671 + struct drm_crtc *crtc; 672 672 struct amdgpu_device *adev = dev->dev_private; 673 673 674 - if (crtc < 0 || crtc >= dev->num_crtcs) { 675 - DRM_ERROR("Invalid crtc %d\n", crtc); 674 + if (pipe >= dev->num_crtcs) { 675 + DRM_ERROR("Invalid crtc %u\n", pipe); 676 676 return -EINVAL; 677 677 } 678 678 679 679 /* Get associated drm_crtc: */ 680 - drmcrtc = &adev->mode_info.crtcs[crtc]->base; 680 + crtc = &adev->mode_info.crtcs[pipe]->base; 681 681 682 682 /* Helper routine in DRM core does all the work: */ 683 - return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, 683 + return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, 684 684 vblank_time, flags, 685 - &drmcrtc->hwmode); 685 + &crtc->hwmode); 686 686 } 687 687 688 688 const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
+4 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
··· 540 540 541 541 void amdgpu_encoder_set_active_device(struct drm_encoder *encoder); 542 542 543 - int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 544 - unsigned int flags, 545 - int *vpos, int *hpos, ktime_t *stime, 546 - ktime_t *etime, 547 - const struct drm_display_mode *mode); 543 + int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, 544 + unsigned int flags, int *vpos, int *hpos, 545 + ktime_t *stime, ktime_t *etime, 546 + const struct drm_display_mode *mode); 548 547 549 548 int amdgpu_framebuffer_init(struct drm_device *dev, 550 549 struct amdgpu_framebuffer *rfb,
+4 -4
drivers/gpu/drm/armada/armada_drv.c
··· 254 254 } 255 255 256 256 /* These are called under the vbl_lock. */ 257 - static int armada_drm_enable_vblank(struct drm_device *dev, int crtc) 257 + static int armada_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) 258 258 { 259 259 struct armada_private *priv = dev->dev_private; 260 - armada_drm_crtc_enable_irq(priv->dcrtc[crtc], VSYNC_IRQ_ENA); 260 + armada_drm_crtc_enable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA); 261 261 return 0; 262 262 } 263 263 264 - static void armada_drm_disable_vblank(struct drm_device *dev, int crtc) 264 + static void armada_drm_disable_vblank(struct drm_device *dev, unsigned int pipe) 265 265 { 266 266 struct armada_private *priv = dev->dev_private; 267 - armada_drm_crtc_disable_irq(priv->dcrtc[crtc], VSYNC_IRQ_ENA); 267 + armada_drm_crtc_disable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA); 268 268 } 269 269 270 270 static struct drm_ioctl_desc armada_ioctls[] = {
+4 -2
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
··· 656 656 regmap_read(dc->hlcdc->regmap, ATMEL_HLCDC_ISR, &isr); 657 657 } 658 658 659 - static int atmel_hlcdc_dc_enable_vblank(struct drm_device *dev, int crtc) 659 + static int atmel_hlcdc_dc_enable_vblank(struct drm_device *dev, 660 + unsigned int pipe) 660 661 { 661 662 struct atmel_hlcdc_dc *dc = dev->dev_private; 662 663 ··· 667 666 return 0; 668 667 } 669 668 670 - static void atmel_hlcdc_dc_disable_vblank(struct drm_device *dev, int crtc) 669 + static void atmel_hlcdc_dc_disable_vblank(struct drm_device *dev, 670 + unsigned int pipe) 671 671 { 672 672 struct atmel_hlcdc_dc *dc = dev->dev_private; 673 673
+1 -1
drivers/gpu/drm/drm_irq.c
··· 877 877 * Returns: 878 878 * The software vblank counter. 879 879 */ 880 - u32 drm_vblank_count(struct drm_device *dev, int pipe) 880 + u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe) 881 881 { 882 882 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 883 883
+2 -2
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 167 167 return ERR_PTR(ret); 168 168 } 169 169 170 - int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe) 170 + int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe) 171 171 { 172 172 struct exynos_drm_private *private = dev->dev_private; 173 173 struct exynos_drm_crtc *exynos_crtc = ··· 179 179 return 0; 180 180 } 181 181 182 - void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) 182 + void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe) 183 183 { 184 184 struct exynos_drm_private *private = dev->dev_private; 185 185 struct exynos_drm_crtc *exynos_crtc =
+2 -2
drivers/gpu/drm/exynos/exynos_drm_crtc.h
··· 23 23 enum exynos_drm_output_type type, 24 24 const struct exynos_drm_crtc_ops *ops, 25 25 void *context); 26 - int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); 27 - void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); 26 + int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe); 27 + void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe); 28 28 void exynos_drm_crtc_wait_pending_update(struct exynos_drm_crtc *exynos_crtc); 29 29 void exynos_drm_crtc_finish_update(struct exynos_drm_crtc *exynos_crtc, 30 30 struct exynos_drm_plane *exynos_plane);
+3 -2
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
··· 140 140 return IRQ_HANDLED; 141 141 } 142 142 143 - static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, int crtc) 143 + static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) 144 144 { 145 145 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; 146 146 unsigned int value; ··· 156 156 return 0; 157 157 } 158 158 159 - static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, int crtc) 159 + static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, 160 + unsigned int pipe) 160 161 { 161 162 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; 162 163 unsigned int value;
+3 -3
drivers/gpu/drm/gma500/psb_drv.h
··· 687 687 extern void psb_irq_uninstall_islands(struct drm_device *dev, int hw_islands); 688 688 extern int psb_vblank_wait2(struct drm_device *dev, unsigned int *sequence); 689 689 extern int psb_vblank_wait(struct drm_device *dev, unsigned int *sequence); 690 - extern int psb_enable_vblank(struct drm_device *dev, int crtc); 691 - extern void psb_disable_vblank(struct drm_device *dev, int crtc); 690 + extern int psb_enable_vblank(struct drm_device *dev, unsigned int pipe); 691 + extern void psb_disable_vblank(struct drm_device *dev, unsigned int pipe); 692 692 void 693 693 psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask); 694 694 695 695 void 696 696 psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask); 697 697 698 - extern u32 psb_get_vblank_counter(struct drm_device *dev, int crtc); 698 + extern u32 psb_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 699 699 700 700 /* framebuffer.c */ 701 701 extern int psbfb_probed(struct drm_device *dev);
+4 -4
drivers/gpu/drm/gma500/psb_irq.c
··· 510 510 /* 511 511 * It is used to enable VBLANK interrupt 512 512 */ 513 - int psb_enable_vblank(struct drm_device *dev, int pipe) 513 + int psb_enable_vblank(struct drm_device *dev, unsigned int pipe) 514 514 { 515 515 struct drm_psb_private *dev_priv = dev->dev_private; 516 516 unsigned long irqflags; ··· 549 549 /* 550 550 * It is used to disable VBLANK interrupt 551 551 */ 552 - void psb_disable_vblank(struct drm_device *dev, int pipe) 552 + void psb_disable_vblank(struct drm_device *dev, unsigned int pipe) 553 553 { 554 554 struct drm_psb_private *dev_priv = dev->dev_private; 555 555 unsigned long irqflags; ··· 622 622 /* Called from drm generic code, passed a 'crtc', which 623 623 * we use as a pipe index 624 624 */ 625 - u32 psb_get_vblank_counter(struct drm_device *dev, int pipe) 625 + u32 psb_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 626 626 { 627 627 uint32_t high_frame = PIPEAFRAMEHIGH; 628 628 uint32_t low_frame = PIPEAFRAMEPIXEL; ··· 654 654 reg_val = REG_READ(pipeconf_reg); 655 655 656 656 if (!(reg_val & PIPEACONF_ENABLE)) { 657 - dev_err(dev->dev, "trying to get vblank count for disabled pipe %d\n", 657 + dev_err(dev->dev, "trying to get vblank count for disabled pipe %u\n", 658 658 pipe); 659 659 goto psb_get_vblank_counter_exit; 660 660 }
+3 -3
drivers/gpu/drm/gma500/psb_irq.h
··· 38 38 int psb_irq_disable_dpst(struct drm_device *dev); 39 39 void psb_irq_turn_on_dpst(struct drm_device *dev); 40 40 void psb_irq_turn_off_dpst(struct drm_device *dev); 41 - int psb_enable_vblank(struct drm_device *dev, int pipe); 42 - void psb_disable_vblank(struct drm_device *dev, int pipe); 43 - u32 psb_get_vblank_counter(struct drm_device *dev, int pipe); 41 + int psb_enable_vblank(struct drm_device *dev, unsigned int pipe); 42 + void psb_disable_vblank(struct drm_device *dev, unsigned int pipe); 43 + u32 psb_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 44 44 45 45 int mdfld_enable_te(struct drm_device *dev, int pipe); 46 46 void mdfld_disable_te(struct drm_device *dev, int pipe);
+17 -17
drivers/gpu/drm/i915/i915_irq.c
··· 554 554 * of horizontal active on the first line of vertical active 555 555 */ 556 556 557 - static u32 i8xx_get_vblank_counter(struct drm_device *dev, int pipe) 557 + static u32 i8xx_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 558 558 { 559 559 /* Gen2 doesn't have a hardware frame counter */ 560 560 return 0; ··· 563 563 /* Called from drm generic code, passed a 'crtc', which 564 564 * we use as a pipe index 565 565 */ 566 - static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) 566 + static u32 i915_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 567 567 { 568 568 struct drm_i915_private *dev_priv = dev->dev_private; 569 569 unsigned long high_frame; ··· 611 611 return (((high1 << 8) | low) + (pixel >= vbl_start)) & 0xffffff; 612 612 } 613 613 614 - static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) 614 + static u32 gm45_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 615 615 { 616 616 struct drm_i915_private *dev_priv = dev->dev_private; 617 617 int reg = PIPE_FRMCOUNT_GM45(pipe); ··· 672 672 return (position + crtc->scanline_offset) % vtotal; 673 673 } 674 674 675 - static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, 675 + static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, 676 676 unsigned int flags, int *vpos, int *hpos, 677 677 ktime_t *stime, ktime_t *etime, 678 678 const struct drm_display_mode *mode) ··· 809 809 return position; 810 810 } 811 811 812 - static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, 812 + static int i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, 813 813 int *max_error, 814 814 struct timeval *vblank_time, 815 815 unsigned flags) 816 816 { 817 817 struct drm_crtc *crtc; 818 818 819 - if (pipe < 0 || pipe >= INTEL_INFO(dev)->num_pipes) { 820 - DRM_ERROR("Invalid crtc %d\n", pipe); 819 + if (pipe >= INTEL_INFO(dev)->num_pipes) { 820 + DRM_ERROR("Invalid crtc %u\n", pipe); 821 821 return -EINVAL; 822 822 } 823 823 824 824 /* Get drm_crtc to timestamp: */ 825 825 crtc = intel_get_crtc_for_pipe(dev, pipe); 826 826 if (crtc == NULL) { 827 - DRM_ERROR("Invalid crtc %d\n", pipe); 827 + DRM_ERROR("Invalid crtc %u\n", pipe); 828 828 return -EINVAL; 829 829 } 830 830 831 831 if (!crtc->hwmode.crtc_clock) { 832 - DRM_DEBUG_KMS("crtc %d is disabled\n", pipe); 832 + DRM_DEBUG_KMS("crtc %u is disabled\n", pipe); 833 833 return -EBUSY; 834 834 } 835 835 ··· 2431 2431 /* Called from drm generic code, passed 'crtc' which 2432 2432 * we use as a pipe index 2433 2433 */ 2434 - static int i915_enable_vblank(struct drm_device *dev, int pipe) 2434 + static int i915_enable_vblank(struct drm_device *dev, unsigned int pipe) 2435 2435 { 2436 2436 struct drm_i915_private *dev_priv = dev->dev_private; 2437 2437 unsigned long irqflags; ··· 2448 2448 return 0; 2449 2449 } 2450 2450 2451 - static int ironlake_enable_vblank(struct drm_device *dev, int pipe) 2451 + static int ironlake_enable_vblank(struct drm_device *dev, unsigned int pipe) 2452 2452 { 2453 2453 struct drm_i915_private *dev_priv = dev->dev_private; 2454 2454 unsigned long irqflags; ··· 2462 2462 return 0; 2463 2463 } 2464 2464 2465 - static int valleyview_enable_vblank(struct drm_device *dev, int pipe) 2465 + static int valleyview_enable_vblank(struct drm_device *dev, unsigned int pipe) 2466 2466 { 2467 2467 struct drm_i915_private *dev_priv = dev->dev_private; 2468 2468 unsigned long irqflags; ··· 2475 2475 return 0; 2476 2476 } 2477 2477 2478 - static int gen8_enable_vblank(struct drm_device *dev, int pipe) 2478 + static int gen8_enable_vblank(struct drm_device *dev, unsigned int pipe) 2479 2479 { 2480 2480 struct drm_i915_private *dev_priv = dev->dev_private; 2481 2481 unsigned long irqflags; ··· 2491 2491 /* Called from drm generic code, passed 'crtc' which 2492 2492 * we use as a pipe index 2493 2493 */ 2494 - static void i915_disable_vblank(struct drm_device *dev, int pipe) 2494 + static void i915_disable_vblank(struct drm_device *dev, unsigned int pipe) 2495 2495 { 2496 2496 struct drm_i915_private *dev_priv = dev->dev_private; 2497 2497 unsigned long irqflags; ··· 2503 2503 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); 2504 2504 } 2505 2505 2506 - static void ironlake_disable_vblank(struct drm_device *dev, int pipe) 2506 + static void ironlake_disable_vblank(struct drm_device *dev, unsigned int pipe) 2507 2507 { 2508 2508 struct drm_i915_private *dev_priv = dev->dev_private; 2509 2509 unsigned long irqflags; ··· 2515 2515 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); 2516 2516 } 2517 2517 2518 - static void valleyview_disable_vblank(struct drm_device *dev, int pipe) 2518 + static void valleyview_disable_vblank(struct drm_device *dev, unsigned int pipe) 2519 2519 { 2520 2520 struct drm_i915_private *dev_priv = dev->dev_private; 2521 2521 unsigned long irqflags; ··· 2526 2526 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); 2527 2527 } 2528 2528 2529 - static void gen8_disable_vblank(struct drm_device *dev, int pipe) 2529 + static void gen8_disable_vblank(struct drm_device *dev, unsigned int pipe) 2530 2530 { 2531 2531 struct drm_i915_private *dev_priv = dev->dev_private; 2532 2532 unsigned long irqflags;
+4 -4
drivers/gpu/drm/imx/imx-drm-core.c
··· 145 145 } 146 146 EXPORT_SYMBOL_GPL(imx_drm_handle_vblank); 147 147 148 - static int imx_drm_enable_vblank(struct drm_device *drm, int crtc) 148 + static int imx_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) 149 149 { 150 150 struct imx_drm_device *imxdrm = drm->dev_private; 151 - struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[crtc]; 151 + struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe]; 152 152 int ret; 153 153 154 154 if (!imx_drm_crtc) ··· 163 163 return ret; 164 164 } 165 165 166 - static void imx_drm_disable_vblank(struct drm_device *drm, int crtc) 166 + static void imx_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) 167 167 { 168 168 struct imx_drm_device *imxdrm = drm->dev_private; 169 - struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[crtc]; 169 + struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe]; 170 170 171 171 if (!imx_drm_crtc) 172 172 return;
+3 -3
drivers/gpu/drm/mga/mga_drv.h
··· 183 183 extern int mga_warp_init(drm_mga_private_t *dev_priv); 184 184 185 185 /* mga_irq.c */ 186 - extern int mga_enable_vblank(struct drm_device *dev, int crtc); 187 - extern void mga_disable_vblank(struct drm_device *dev, int crtc); 188 - extern u32 mga_get_vblank_counter(struct drm_device *dev, int crtc); 186 + extern int mga_enable_vblank(struct drm_device *dev, unsigned int pipe); 187 + extern void mga_disable_vblank(struct drm_device *dev, unsigned int pipe); 188 + extern u32 mga_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 189 189 extern int mga_driver_fence_wait(struct drm_device *dev, unsigned int *sequence); 190 190 extern int mga_driver_vblank_wait(struct drm_device *dev, unsigned int *sequence); 191 191 extern irqreturn_t mga_driver_irq_handler(int irq, void *arg);
+10 -10
drivers/gpu/drm/mga/mga_irq.c
··· 35 35 #include <drm/mga_drm.h> 36 36 #include "mga_drv.h" 37 37 38 - u32 mga_get_vblank_counter(struct drm_device *dev, int crtc) 38 + u32 mga_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 39 39 { 40 40 const drm_mga_private_t *const dev_priv = 41 41 (drm_mga_private_t *) dev->dev_private; 42 42 43 - if (crtc != 0) 43 + if (pipe != 0) 44 44 return 0; 45 45 46 46 return atomic_read(&dev_priv->vbl_received); ··· 88 88 return IRQ_NONE; 89 89 } 90 90 91 - int mga_enable_vblank(struct drm_device *dev, int crtc) 91 + int mga_enable_vblank(struct drm_device *dev, unsigned int pipe) 92 92 { 93 93 drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; 94 94 95 - if (crtc != 0) { 96 - DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", 97 - crtc); 95 + if (pipe != 0) { 96 + DRM_ERROR("tried to enable vblank on non-existent crtc %u\n", 97 + pipe); 98 98 return 0; 99 99 } 100 100 ··· 103 103 } 104 104 105 105 106 - void mga_disable_vblank(struct drm_device *dev, int crtc) 106 + void mga_disable_vblank(struct drm_device *dev, unsigned int pipe) 107 107 { 108 - if (crtc != 0) { 109 - DRM_ERROR("tried to disable vblank on non-existent crtc %d\n", 110 - crtc); 108 + if (pipe != 0) { 109 + DRM_ERROR("tried to disable vblank on non-existent crtc %u\n", 110 + pipe); 111 111 } 112 112 113 113 /* Do *NOT* disable the vertical refresh interrupt. MGA doesn't have
+6 -6
drivers/gpu/drm/msm/msm_drv.c
··· 531 531 kms->funcs->irq_uninstall(kms); 532 532 } 533 533 534 - static int msm_enable_vblank(struct drm_device *dev, int crtc_id) 534 + static int msm_enable_vblank(struct drm_device *dev, unsigned int pipe) 535 535 { 536 536 struct msm_drm_private *priv = dev->dev_private; 537 537 struct msm_kms *kms = priv->kms; 538 538 if (!kms) 539 539 return -ENXIO; 540 - DBG("dev=%p, crtc=%d", dev, crtc_id); 541 - return vblank_ctrl_queue_work(priv, crtc_id, true); 540 + DBG("dev=%p, crtc=%u", dev, pipe); 541 + return vblank_ctrl_queue_work(priv, pipe, true); 542 542 } 543 543 544 - static void msm_disable_vblank(struct drm_device *dev, int crtc_id) 544 + static void msm_disable_vblank(struct drm_device *dev, unsigned int pipe) 545 545 { 546 546 struct msm_drm_private *priv = dev->dev_private; 547 547 struct msm_kms *kms = priv->kms; 548 548 if (!kms) 549 549 return; 550 - DBG("dev=%p, crtc=%d", dev, crtc_id); 551 - vblank_ctrl_queue_work(priv, crtc_id, false); 550 + DBG("dev=%p, crtc=%u", dev, pipe); 551 + vblank_ctrl_queue_work(priv, pipe, false); 552 552 } 553 553 554 554 /*
+12 -11
drivers/gpu/drm/nouveau/nouveau_display.c
··· 51 51 } 52 52 53 53 int 54 - nouveau_display_vblank_enable(struct drm_device *dev, int head) 54 + nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe) 55 55 { 56 56 struct drm_crtc *crtc; 57 57 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 58 58 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 59 - if (nv_crtc->index == head) { 59 + if (nv_crtc->index == pipe) { 60 60 nvif_notify_get(&nv_crtc->vblank); 61 61 return 0; 62 62 } ··· 65 65 } 66 66 67 67 void 68 - nouveau_display_vblank_disable(struct drm_device *dev, int head) 68 + nouveau_display_vblank_disable(struct drm_device *dev, unsigned int pipe) 69 69 { 70 70 struct drm_crtc *crtc; 71 71 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 72 72 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 73 - if (nv_crtc->index == head) { 73 + if (nv_crtc->index == pipe) { 74 74 nvif_notify_put(&nv_crtc->vblank); 75 75 return; 76 76 } ··· 132 132 } 133 133 134 134 int 135 - nouveau_display_scanoutpos(struct drm_device *dev, int head, unsigned int flags, 136 - int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, 135 + nouveau_display_scanoutpos(struct drm_device *dev, unsigned int pipe, 136 + unsigned int flags, int *vpos, int *hpos, 137 + ktime_t *stime, ktime_t *etime, 137 138 const struct drm_display_mode *mode) 138 139 { 139 140 struct drm_crtc *crtc; 140 141 141 142 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 142 - if (nouveau_crtc(crtc)->index == head) { 143 + if (nouveau_crtc(crtc)->index == pipe) { 143 144 return nouveau_display_scanoutpos_head(crtc, vpos, hpos, 144 145 stime, etime); 145 146 } ··· 150 149 } 151 150 152 151 int 153 - nouveau_display_vblstamp(struct drm_device *dev, int head, int *max_error, 154 - struct timeval *time, unsigned flags) 152 + nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, 153 + int *max_error, struct timeval *time, unsigned flags) 155 154 { 156 155 struct drm_crtc *crtc; 157 156 158 157 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 159 - if (nouveau_crtc(crtc)->index == head) { 158 + if (nouveau_crtc(crtc)->index == pipe) { 160 159 return drm_calc_vbltimestamp_from_scanoutpos(dev, 161 - head, max_error, time, flags, 160 + pipe, max_error, time, flags, 162 161 &crtc->hwmode); 163 162 } 164 163 }
+6 -6
drivers/gpu/drm/nouveau/nouveau_display.h
··· 65 65 void nouveau_display_fini(struct drm_device *dev); 66 66 int nouveau_display_suspend(struct drm_device *dev, bool runtime); 67 67 void nouveau_display_resume(struct drm_device *dev, bool runtime); 68 - int nouveau_display_vblank_enable(struct drm_device *, int); 69 - void nouveau_display_vblank_disable(struct drm_device *, int); 70 - int nouveau_display_scanoutpos(struct drm_device *, int, unsigned int, 71 - int *, int *, ktime_t *, ktime_t *, 72 - const struct drm_display_mode *); 73 - int nouveau_display_vblstamp(struct drm_device *, int, int *, 68 + int nouveau_display_vblank_enable(struct drm_device *, unsigned int); 69 + void nouveau_display_vblank_disable(struct drm_device *, unsigned int); 70 + int nouveau_display_scanoutpos(struct drm_device *, unsigned int, 71 + unsigned int, int *, int *, ktime_t *, 72 + ktime_t *, const struct drm_display_mode *); 73 + int nouveau_display_vblstamp(struct drm_device *, unsigned int, int *, 74 74 struct timeval *, unsigned); 75 75 76 76 int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
+2 -2
drivers/gpu/drm/omapdrm/omap_drv.h
··· 129 129 int omap_gem_resume(struct device *dev); 130 130 #endif 131 131 132 - int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id); 133 - void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id); 132 + int omap_irq_enable_vblank(struct drm_device *dev, unsigned int pipe); 133 + void omap_irq_disable_vblank(struct drm_device *dev, unsigned int pipe); 134 134 void __omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); 135 135 void __omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); 136 136 void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq);
+8 -8
drivers/gpu/drm/omapdrm/omap_irq.c
··· 134 134 /** 135 135 * enable_vblank - enable vblank interrupt events 136 136 * @dev: DRM device 137 - * @crtc: which irq to enable 137 + * @pipe: which irq to enable 138 138 * 139 139 * Enable vblank interrupts for @crtc. If the device doesn't have 140 140 * a hardware vblank counter, this routine should be a no-op, since ··· 144 144 * Zero on success, appropriate errno if the given @crtc's vblank 145 145 * interrupt cannot be enabled. 146 146 */ 147 - int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id) 147 + int omap_irq_enable_vblank(struct drm_device *dev, unsigned int pipe) 148 148 { 149 149 struct omap_drm_private *priv = dev->dev_private; 150 - struct drm_crtc *crtc = priv->crtcs[crtc_id]; 150 + struct drm_crtc *crtc = priv->crtcs[pipe]; 151 151 unsigned long flags; 152 152 153 - DBG("dev=%p, crtc=%d", dev, crtc_id); 153 + DBG("dev=%p, crtc=%u", dev, pipe); 154 154 155 155 spin_lock_irqsave(&list_lock, flags); 156 156 priv->vblank_mask |= pipe2vbl(crtc); ··· 163 163 /** 164 164 * disable_vblank - disable vblank interrupt events 165 165 * @dev: DRM device 166 - * @crtc: which irq to enable 166 + * @pipe: which irq to enable 167 167 * 168 168 * Disable vblank interrupts for @crtc. If the device doesn't have 169 169 * a hardware vblank counter, this routine should be a no-op, since 170 170 * interrupts will have to stay on to keep the count accurate. 171 171 */ 172 - void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id) 172 + void omap_irq_disable_vblank(struct drm_device *dev, unsigned int pipe) 173 173 { 174 174 struct omap_drm_private *priv = dev->dev_private; 175 - struct drm_crtc *crtc = priv->crtcs[crtc_id]; 175 + struct drm_crtc *crtc = priv->crtcs[pipe]; 176 176 unsigned long flags; 177 177 178 - DBG("dev=%p, crtc=%d", dev, crtc_id); 178 + DBG("dev=%p, crtc=%u", dev, pipe); 179 179 180 180 spin_lock_irqsave(&list_lock, flags); 181 181 priv->vblank_mask &= ~pipe2vbl(crtc);
+4 -3
drivers/gpu/drm/qxl/qxl_drv.c
··· 196 196 return qxl_drm_resume(drm_dev, false); 197 197 } 198 198 199 - static u32 qxl_noop_get_vblank_counter(struct drm_device *dev, int crtc) 199 + static u32 qxl_noop_get_vblank_counter(struct drm_device *dev, 200 + unsigned int pipe) 200 201 { 201 202 return 0; 202 203 } 203 204 204 - static int qxl_noop_enable_vblank(struct drm_device *dev, int crtc) 205 + static int qxl_noop_enable_vblank(struct drm_device *dev, unsigned int pipe) 205 206 { 206 207 return 0; 207 208 } 208 209 209 - static void qxl_noop_disable_vblank(struct drm_device *dev, int crtc) 210 + static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe) 210 211 { 211 212 } 212 213
+3 -3
drivers/gpu/drm/r128/r128_drv.h
··· 154 154 extern int r128_do_cce_idle(drm_r128_private_t *dev_priv); 155 155 extern int r128_do_cleanup_cce(struct drm_device *dev); 156 156 157 - extern int r128_enable_vblank(struct drm_device *dev, int crtc); 158 - extern void r128_disable_vblank(struct drm_device *dev, int crtc); 159 - extern u32 r128_get_vblank_counter(struct drm_device *dev, int crtc); 157 + extern int r128_enable_vblank(struct drm_device *dev, unsigned int pipe); 158 + extern void r128_disable_vblank(struct drm_device *dev, unsigned int pipe); 159 + extern u32 r128_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 160 160 extern irqreturn_t r128_driver_irq_handler(int irq, void *arg); 161 161 extern void r128_driver_irq_preinstall(struct drm_device *dev); 162 162 extern int r128_driver_irq_postinstall(struct drm_device *dev);
+8 -8
drivers/gpu/drm/r128/r128_irq.c
··· 34 34 #include <drm/r128_drm.h> 35 35 #include "r128_drv.h" 36 36 37 - u32 r128_get_vblank_counter(struct drm_device *dev, int crtc) 37 + u32 r128_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 38 38 { 39 39 const drm_r128_private_t *dev_priv = dev->dev_private; 40 40 41 - if (crtc != 0) 41 + if (pipe != 0) 42 42 return 0; 43 43 44 44 return atomic_read(&dev_priv->vbl_received); ··· 62 62 return IRQ_NONE; 63 63 } 64 64 65 - int r128_enable_vblank(struct drm_device *dev, int crtc) 65 + int r128_enable_vblank(struct drm_device *dev, unsigned int pipe) 66 66 { 67 67 drm_r128_private_t *dev_priv = dev->dev_private; 68 68 69 - if (crtc != 0) { 70 - DRM_ERROR("%s: bad crtc %d\n", __func__, crtc); 69 + if (pipe != 0) { 70 + DRM_ERROR("%s: bad crtc %u\n", __func__, pipe); 71 71 return -EINVAL; 72 72 } 73 73 ··· 75 75 return 0; 76 76 } 77 77 78 - void r128_disable_vblank(struct drm_device *dev, int crtc) 78 + void r128_disable_vblank(struct drm_device *dev, unsigned int pipe) 79 79 { 80 - if (crtc != 0) 81 - DRM_ERROR("%s: bad crtc %d\n", __func__, crtc); 80 + if (pipe != 0) 81 + DRM_ERROR("%s: bad crtc %u\n", __func__, pipe); 82 82 83 83 /* 84 84 * FIXME: implement proper interrupt disable by using the vblank
+13 -12
drivers/gpu/drm/radeon/radeon_display.c
··· 1799 1799 * unknown small number of scanlines wrt. real scanout position. 1800 1800 * 1801 1801 */ 1802 - int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags, 1803 - int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, 1802 + int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, 1803 + unsigned int flags, int *vpos, int *hpos, 1804 + ktime_t *stime, ktime_t *etime, 1804 1805 const struct drm_display_mode *mode) 1805 1806 { 1806 1807 u32 stat_crtc = 0, vbl = 0, position = 0; ··· 1817 1816 *stime = ktime_get(); 1818 1817 1819 1818 if (ASIC_IS_DCE4(rdev)) { 1820 - if (crtc == 0) { 1819 + if (pipe == 0) { 1821 1820 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1822 1821 EVERGREEN_CRTC0_REGISTER_OFFSET); 1823 1822 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + 1824 1823 EVERGREEN_CRTC0_REGISTER_OFFSET); 1825 1824 ret |= DRM_SCANOUTPOS_VALID; 1826 1825 } 1827 - if (crtc == 1) { 1826 + if (pipe == 1) { 1828 1827 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1829 1828 EVERGREEN_CRTC1_REGISTER_OFFSET); 1830 1829 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + 1831 1830 EVERGREEN_CRTC1_REGISTER_OFFSET); 1832 1831 ret |= DRM_SCANOUTPOS_VALID; 1833 1832 } 1834 - if (crtc == 2) { 1833 + if (pipe == 2) { 1835 1834 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1836 1835 EVERGREEN_CRTC2_REGISTER_OFFSET); 1837 1836 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + 1838 1837 EVERGREEN_CRTC2_REGISTER_OFFSET); 1839 1838 ret |= DRM_SCANOUTPOS_VALID; 1840 1839 } 1841 - if (crtc == 3) { 1840 + if (pipe == 3) { 1842 1841 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1843 1842 EVERGREEN_CRTC3_REGISTER_OFFSET); 1844 1843 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + 1845 1844 EVERGREEN_CRTC3_REGISTER_OFFSET); 1846 1845 ret |= DRM_SCANOUTPOS_VALID; 1847 1846 } 1848 - if (crtc == 4) { 1847 + if (pipe == 4) { 1849 1848 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1850 1849 EVERGREEN_CRTC4_REGISTER_OFFSET); 1851 1850 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + 1852 1851 EVERGREEN_CRTC4_REGISTER_OFFSET); 1853 1852 ret |= DRM_SCANOUTPOS_VALID; 1854 1853 } 1855 - if (crtc == 5) { 1854 + if (pipe == 5) { 1856 1855 vbl = RREG32(EVERGREEN_CRTC_V_BLANK_START_END + 1857 1856 EVERGREEN_CRTC5_REGISTER_OFFSET); 1858 1857 position = RREG32(EVERGREEN_CRTC_STATUS_POSITION + ··· 1860 1859 ret |= DRM_SCANOUTPOS_VALID; 1861 1860 } 1862 1861 } else if (ASIC_IS_AVIVO(rdev)) { 1863 - if (crtc == 0) { 1862 + if (pipe == 0) { 1864 1863 vbl = RREG32(AVIVO_D1CRTC_V_BLANK_START_END); 1865 1864 position = RREG32(AVIVO_D1CRTC_STATUS_POSITION); 1866 1865 ret |= DRM_SCANOUTPOS_VALID; 1867 1866 } 1868 - if (crtc == 1) { 1867 + if (pipe == 1) { 1869 1868 vbl = RREG32(AVIVO_D2CRTC_V_BLANK_START_END); 1870 1869 position = RREG32(AVIVO_D2CRTC_STATUS_POSITION); 1871 1870 ret |= DRM_SCANOUTPOS_VALID; 1872 1871 } 1873 1872 } else { 1874 1873 /* Pre-AVIVO: Different encoding of scanout pos and vblank interval. */ 1875 - if (crtc == 0) { 1874 + if (pipe == 0) { 1876 1875 /* Assume vbl_end == 0, get vbl_start from 1877 1876 * upper 16 bits. 1878 1877 */ ··· 1886 1885 1887 1886 ret |= DRM_SCANOUTPOS_VALID; 1888 1887 } 1889 - if (crtc == 1) { 1888 + if (pipe == 1) { 1890 1889 vbl = (RREG32(RADEON_CRTC2_V_TOTAL_DISP) & 1891 1890 RADEON_CRTC_V_DISP) >> RADEON_CRTC_V_DISP_SHIFT; 1892 1891 position = (RREG32(RADEON_CRTC2_VLINE_CRNT_VLINE) >> 16) & RADEON_CRTC_V_TOTAL;
+6 -7
drivers/gpu/drm/radeon/radeon_drv.c
··· 105 105 struct drm_file *file_priv); 106 106 int radeon_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon); 107 107 int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon); 108 - u32 radeon_get_vblank_counter_kms(struct drm_device *dev, int crtc); 109 - int radeon_enable_vblank_kms(struct drm_device *dev, int crtc); 110 - void radeon_disable_vblank_kms(struct drm_device *dev, int crtc); 111 - int radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, 108 + u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); 109 + int radeon_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); 110 + void radeon_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); 111 + int radeon_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, 112 112 int *max_error, 113 113 struct timeval *vblank_time, 114 114 unsigned flags); ··· 124 124 struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, 125 125 struct drm_gem_object *gobj, 126 126 int flags); 127 - extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 128 - unsigned int flags, 129 - int *vpos, int *hpos, 127 + extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int crtc, 128 + unsigned int flags, int *vpos, int *hpos, 130 129 ktime_t *stime, ktime_t *etime, 131 130 const struct drm_display_mode *mode); 132 131 extern bool radeon_is_px(struct drm_device *dev);
+3 -3
drivers/gpu/drm/radeon/radeon_drv.h
··· 404 404 extern int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv); 405 405 406 406 extern void radeon_do_release(struct drm_device * dev); 407 - extern u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc); 408 - extern int radeon_enable_vblank(struct drm_device *dev, int crtc); 409 - extern void radeon_disable_vblank(struct drm_device *dev, int crtc); 407 + extern u32 radeon_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 408 + extern int radeon_enable_vblank(struct drm_device *dev, unsigned int pipe); 409 + extern void radeon_disable_vblank(struct drm_device *dev, unsigned int pipe); 410 410 extern irqreturn_t radeon_driver_irq_handler(int irq, void *arg); 411 411 extern void radeon_driver_irq_preinstall(struct drm_device * dev); 412 412 extern int radeon_driver_irq_postinstall(struct drm_device *dev);
+19 -19
drivers/gpu/drm/radeon/radeon_irq.c
··· 62 62 RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg); 63 63 } 64 64 65 - int radeon_enable_vblank(struct drm_device *dev, int crtc) 65 + int radeon_enable_vblank(struct drm_device *dev, unsigned int pipe) 66 66 { 67 67 drm_radeon_private_t *dev_priv = dev->dev_private; 68 68 69 69 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) { 70 - switch (crtc) { 70 + switch (pipe) { 71 71 case 0: 72 72 r500_vbl_irq_set_state(dev, R500_D1MODE_INT_MASK, 1); 73 73 break; ··· 75 75 r500_vbl_irq_set_state(dev, R500_D2MODE_INT_MASK, 1); 76 76 break; 77 77 default: 78 - DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", 79 - crtc); 78 + DRM_ERROR("tried to enable vblank on non-existent crtc %u\n", 79 + pipe); 80 80 return -EINVAL; 81 81 } 82 82 } else { 83 - switch (crtc) { 83 + switch (pipe) { 84 84 case 0: 85 85 radeon_irq_set_state(dev, RADEON_CRTC_VBLANK_MASK, 1); 86 86 break; ··· 88 88 radeon_irq_set_state(dev, RADEON_CRTC2_VBLANK_MASK, 1); 89 89 break; 90 90 default: 91 - DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", 92 - crtc); 91 + DRM_ERROR("tried to enable vblank on non-existent crtc %u\n", 92 + pipe); 93 93 return -EINVAL; 94 94 } 95 95 } ··· 97 97 return 0; 98 98 } 99 99 100 - void radeon_disable_vblank(struct drm_device *dev, int crtc) 100 + void radeon_disable_vblank(struct drm_device *dev, unsigned int pipe) 101 101 { 102 102 drm_radeon_private_t *dev_priv = dev->dev_private; 103 103 104 104 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) { 105 - switch (crtc) { 105 + switch (pipe) { 106 106 case 0: 107 107 r500_vbl_irq_set_state(dev, R500_D1MODE_INT_MASK, 0); 108 108 break; ··· 110 110 r500_vbl_irq_set_state(dev, R500_D2MODE_INT_MASK, 0); 111 111 break; 112 112 default: 113 - DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", 114 - crtc); 113 + DRM_ERROR("tried to enable vblank on non-existent crtc %u\n", 114 + pipe); 115 115 break; 116 116 } 117 117 } else { 118 - switch (crtc) { 118 + switch (pipe) { 119 119 case 0: 120 120 radeon_irq_set_state(dev, RADEON_CRTC_VBLANK_MASK, 0); 121 121 break; ··· 123 123 radeon_irq_set_state(dev, RADEON_CRTC2_VBLANK_MASK, 0); 124 124 break; 125 125 default: 126 - DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", 127 - crtc); 126 + DRM_ERROR("tried to enable vblank on non-existent crtc %u\n", 127 + pipe); 128 128 break; 129 129 } 130 130 } ··· 255 255 return ret; 256 256 } 257 257 258 - u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc) 258 + u32 radeon_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 259 259 { 260 260 drm_radeon_private_t *dev_priv = dev->dev_private; 261 261 ··· 264 264 return -EINVAL; 265 265 } 266 266 267 - if (crtc < 0 || crtc > 1) { 268 - DRM_ERROR("Invalid crtc %d\n", crtc); 267 + if (pipe > 1) { 268 + DRM_ERROR("Invalid crtc %u\n", pipe); 269 269 return -EINVAL; 270 270 } 271 271 272 272 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) { 273 - if (crtc == 0) 273 + if (pipe == 0) 274 274 return RADEON_READ(R500_D1CRTC_FRAME_COUNT); 275 275 else 276 276 return RADEON_READ(R500_D2CRTC_FRAME_COUNT); 277 277 } else { 278 - if (crtc == 0) 278 + if (pipe == 0) 279 279 return RADEON_READ(RADEON_CRTC_CRNT_FRAME); 280 280 else 281 281 return RADEON_READ(RADEON_CRTC2_CRNT_FRAME);
+2 -3
drivers/gpu/drm/radeon/radeon_mode.h
··· 874 874 int x, int y); 875 875 extern void radeon_cursor_reset(struct drm_crtc *crtc); 876 876 877 - extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 878 - unsigned int flags, 879 - int *vpos, int *hpos, 877 + extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, 878 + unsigned int flags, int *vpos, int *hpos, 880 879 ktime_t *stime, ktime_t *etime, 881 880 const struct drm_display_mode *mode); 882 881
+4 -4
drivers/gpu/drm/rcar-du/rcar_du_drv.c
··· 221 221 drm_fbdev_cma_restore_mode(rcdu->fbdev); 222 222 } 223 223 224 - static int rcar_du_enable_vblank(struct drm_device *dev, int crtc) 224 + static int rcar_du_enable_vblank(struct drm_device *dev, unsigned int pipe) 225 225 { 226 226 struct rcar_du_device *rcdu = dev->dev_private; 227 227 228 - rcar_du_crtc_enable_vblank(&rcdu->crtcs[crtc], true); 228 + rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], true); 229 229 230 230 return 0; 231 231 } 232 232 233 - static void rcar_du_disable_vblank(struct drm_device *dev, int crtc) 233 + static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe) 234 234 { 235 235 struct rcar_du_device *rcdu = dev->dev_private; 236 236 237 - rcar_du_crtc_enable_vblank(&rcdu->crtcs[crtc], false); 237 + rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], false); 238 238 } 239 239 240 240 static const struct file_operations rcar_du_fops = {
+4 -2
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
··· 103 103 return NULL; 104 104 } 105 105 106 - static int rockchip_drm_crtc_enable_vblank(struct drm_device *dev, int pipe) 106 + static int rockchip_drm_crtc_enable_vblank(struct drm_device *dev, 107 + unsigned int pipe) 107 108 { 108 109 struct rockchip_drm_private *priv = dev->dev_private; 109 110 struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe); ··· 116 115 return 0; 117 116 } 118 117 119 - static void rockchip_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) 118 + static void rockchip_drm_crtc_disable_vblank(struct drm_device *dev, 119 + unsigned int pipe) 120 120 { 121 121 struct rockchip_drm_private *priv = dev->dev_private; 122 122 struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe);
+2 -2
drivers/gpu/drm/shmobile/shmob_drm_drv.c
··· 231 231 return IRQ_HANDLED; 232 232 } 233 233 234 - static int shmob_drm_enable_vblank(struct drm_device *dev, int crtc) 234 + static int shmob_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) 235 235 { 236 236 struct shmob_drm_device *sdev = dev->dev_private; 237 237 ··· 240 240 return 0; 241 241 } 242 242 243 - static void shmob_drm_disable_vblank(struct drm_device *dev, int crtc) 243 + static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe) 244 244 { 245 245 struct shmob_drm_device *sdev = dev->dev_private; 246 246
+8 -8
drivers/gpu/drm/sti/sti_crtc.c
··· 299 299 return 0; 300 300 } 301 301 302 - int sti_crtc_enable_vblank(struct drm_device *dev, int crtc) 302 + int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe) 303 303 { 304 304 struct sti_private *dev_priv = dev->dev_private; 305 305 struct sti_compositor *compo = dev_priv->compo; ··· 307 307 308 308 DRM_DEBUG_DRIVER("\n"); 309 309 310 - if (sti_vtg_register_client(crtc == STI_MIXER_MAIN ? 310 + if (sti_vtg_register_client(pipe == STI_MIXER_MAIN ? 311 311 compo->vtg_main : compo->vtg_aux, 312 - vtg_vblank_nb, crtc)) { 312 + vtg_vblank_nb, pipe)) { 313 313 DRM_ERROR("Cannot register VTG notifier\n"); 314 314 return -EINVAL; 315 315 } ··· 318 318 } 319 319 EXPORT_SYMBOL(sti_crtc_enable_vblank); 320 320 321 - void sti_crtc_disable_vblank(struct drm_device *drm_dev, int crtc) 321 + void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe) 322 322 { 323 323 struct sti_private *priv = drm_dev->dev_private; 324 324 struct sti_compositor *compo = priv->compo; ··· 326 326 327 327 DRM_DEBUG_DRIVER("\n"); 328 328 329 - if (sti_vtg_unregister_client(crtc == STI_MIXER_MAIN ? 329 + if (sti_vtg_unregister_client(pipe == STI_MIXER_MAIN ? 330 330 compo->vtg_main : compo->vtg_aux, vtg_vblank_nb)) 331 331 DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n"); 332 332 333 333 /* free the resources of the pending requests */ 334 - if (compo->mixer[crtc]->pending_event) { 335 - drm_vblank_put(drm_dev, crtc); 336 - compo->mixer[crtc]->pending_event = NULL; 334 + if (compo->mixer[pipe]->pending_event) { 335 + drm_vblank_put(drm_dev, pipe); 336 + compo->mixer[pipe]->pending_event = NULL; 337 337 } 338 338 } 339 339 EXPORT_SYMBOL(sti_crtc_disable_vblank);
+2 -2
drivers/gpu/drm/sti/sti_crtc.h
··· 13 13 14 14 int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer, 15 15 struct drm_plane *primary, struct drm_plane *cursor); 16 - int sti_crtc_enable_vblank(struct drm_device *dev, int crtc); 17 - void sti_crtc_disable_vblank(struct drm_device *dev, int crtc); 16 + int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe); 17 + void sti_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe); 18 18 int sti_crtc_vblank_cb(struct notifier_block *nb, 19 19 unsigned long event, void *data); 20 20 bool sti_crtc_is_main(struct drm_crtc *drm_crtc);
+4 -3
drivers/gpu/drm/tegra/drm.c
··· 822 822 return NULL; 823 823 } 824 824 825 - static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, int pipe) 825 + static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, 826 + unsigned int pipe) 826 827 { 827 828 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 828 829 struct tegra_dc *dc = to_tegra_dc(crtc); ··· 834 833 return tegra_dc_get_vblank_counter(dc); 835 834 } 836 835 837 - static int tegra_drm_enable_vblank(struct drm_device *drm, int pipe) 836 + static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) 838 837 { 839 838 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 840 839 struct tegra_dc *dc = to_tegra_dc(crtc); ··· 847 846 return 0; 848 847 } 849 848 850 - static void tegra_drm_disable_vblank(struct drm_device *drm, int pipe) 849 + static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) 851 850 { 852 851 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 853 852 struct tegra_dc *dc = to_tegra_dc(crtc);
+2 -2
drivers/gpu/drm/tilcdc/tilcdc_drv.c
··· 425 425 tilcdc_clear(dev, reg, mask); 426 426 } 427 427 428 - static int tilcdc_enable_vblank(struct drm_device *dev, int crtc) 428 + static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe) 429 429 { 430 430 enable_vblank(dev, true); 431 431 return 0; 432 432 } 433 433 434 - static void tilcdc_disable_vblank(struct drm_device *dev, int crtc) 434 + static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe) 435 435 { 436 436 enable_vblank(dev, false); 437 437 }
+3 -3
drivers/gpu/drm/via/via_drv.h
··· 136 136 extern int via_final_context(struct drm_device *dev, int context); 137 137 138 138 extern int via_do_cleanup_map(struct drm_device *dev); 139 - extern u32 via_get_vblank_counter(struct drm_device *dev, int crtc); 140 - extern int via_enable_vblank(struct drm_device *dev, int crtc); 141 - extern void via_disable_vblank(struct drm_device *dev, int crtc); 139 + extern u32 via_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 140 + extern int via_enable_vblank(struct drm_device *dev, unsigned int pipe); 141 + extern void via_disable_vblank(struct drm_device *dev, unsigned int pipe); 142 142 143 143 extern irqreturn_t via_driver_irq_handler(int irq, void *arg); 144 144 extern void via_driver_irq_preinstall(struct drm_device *dev);
+9 -8
drivers/gpu/drm/via/via_irq.c
··· 95 95 1000000 - (then->tv_usec - now->tv_usec); 96 96 } 97 97 98 - u32 via_get_vblank_counter(struct drm_device *dev, int crtc) 98 + u32 via_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 99 99 { 100 100 drm_via_private_t *dev_priv = dev->dev_private; 101 - if (crtc != 0) 101 + 102 + if (pipe != 0) 102 103 return 0; 103 104 104 105 return atomic_read(&dev_priv->vbl_received); ··· 171 170 } 172 171 } 173 172 174 - int via_enable_vblank(struct drm_device *dev, int crtc) 173 + int via_enable_vblank(struct drm_device *dev, unsigned int pipe) 175 174 { 176 175 drm_via_private_t *dev_priv = dev->dev_private; 177 176 u32 status; 178 177 179 - if (crtc != 0) { 180 - DRM_ERROR("%s: bad crtc %d\n", __func__, crtc); 178 + if (pipe != 0) { 179 + DRM_ERROR("%s: bad crtc %u\n", __func__, pipe); 181 180 return -EINVAL; 182 181 } 183 182 ··· 190 189 return 0; 191 190 } 192 191 193 - void via_disable_vblank(struct drm_device *dev, int crtc) 192 + void via_disable_vblank(struct drm_device *dev, unsigned int pipe) 194 193 { 195 194 drm_via_private_t *dev_priv = dev->dev_private; 196 195 u32 status; ··· 201 200 VIA_WRITE8(0x83d4, 0x11); 202 201 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) & ~0x30); 203 202 204 - if (crtc != 0) 205 - DRM_ERROR("%s: bad crtc %d\n", __func__, crtc); 203 + if (pipe != 0) 204 + DRM_ERROR("%s: bad crtc %u\n", __func__, pipe); 206 205 } 207 206 208 207 static int
+3 -3
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
··· 914 914 bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv, 915 915 uint32_t pitch, 916 916 uint32_t height); 917 - u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc); 918 - int vmw_enable_vblank(struct drm_device *dev, int crtc); 919 - void vmw_disable_vblank(struct drm_device *dev, int crtc); 917 + u32 vmw_get_vblank_counter(struct drm_device *dev, unsigned int pipe); 918 + int vmw_enable_vblank(struct drm_device *dev, unsigned int pipe); 919 + void vmw_disable_vblank(struct drm_device *dev, unsigned int pipe); 920 920 int vmw_kms_present(struct vmw_private *dev_priv, 921 921 struct drm_file *file_priv, 922 922 struct vmw_framebuffer *vfb,
+3 -3
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 1263 1263 /** 1264 1264 * Function called by DRM code called with vbl_lock held. 1265 1265 */ 1266 - u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc) 1266 + u32 vmw_get_vblank_counter(struct drm_device *dev, unsigned int pipe) 1267 1267 { 1268 1268 return 0; 1269 1269 } ··· 1271 1271 /** 1272 1272 * Function called by DRM code called with vbl_lock held. 1273 1273 */ 1274 - int vmw_enable_vblank(struct drm_device *dev, int crtc) 1274 + int vmw_enable_vblank(struct drm_device *dev, unsigned int pipe) 1275 1275 { 1276 1276 return -ENOSYS; 1277 1277 } ··· 1279 1279 /** 1280 1280 * Function called by DRM code called with vbl_lock held. 1281 1281 */ 1282 - void vmw_disable_vblank(struct drm_device *dev, int crtc) 1282 + void vmw_disable_vblank(struct drm_device *dev, unsigned int pipe) 1283 1283 { 1284 1284 } 1285 1285
+12 -13
include/drm/drmP.h
··· 412 412 /** 413 413 * get_vblank_counter - get raw hardware vblank counter 414 414 * @dev: DRM device 415 - * @crtc: counter to fetch 415 + * @pipe: counter to fetch 416 416 * 417 417 * Driver callback for fetching a raw hardware vblank counter for @crtc. 418 418 * If a device doesn't have a hardware counter, the driver can simply ··· 426 426 * RETURNS 427 427 * Raw vblank counter value. 428 428 */ 429 - u32 (*get_vblank_counter) (struct drm_device *dev, int crtc); 429 + u32 (*get_vblank_counter) (struct drm_device *dev, unsigned int pipe); 430 430 431 431 /** 432 432 * enable_vblank - enable vblank interrupt events 433 433 * @dev: DRM device 434 - * @crtc: which irq to enable 434 + * @pipe: which irq to enable 435 435 * 436 436 * Enable vblank interrupts for @crtc. If the device doesn't have 437 437 * a hardware vblank counter, this routine should be a no-op, since ··· 441 441 * Zero on success, appropriate errno if the given @crtc's vblank 442 442 * interrupt cannot be enabled. 443 443 */ 444 - int (*enable_vblank) (struct drm_device *dev, int crtc); 444 + int (*enable_vblank) (struct drm_device *dev, unsigned int pipe); 445 445 446 446 /** 447 447 * disable_vblank - disable vblank interrupt events 448 448 * @dev: DRM device 449 - * @crtc: which irq to enable 449 + * @pipe: which irq to enable 450 450 * 451 451 * Disable vblank interrupts for @crtc. If the device doesn't have 452 452 * a hardware vblank counter, this routine should be a no-op, since 453 453 * interrupts will have to stay on to keep the count accurate. 454 454 */ 455 - void (*disable_vblank) (struct drm_device *dev, int crtc); 455 + void (*disable_vblank) (struct drm_device *dev, unsigned int pipe); 456 456 457 457 /** 458 458 * Called by \c drm_device_is_agp. Typically used to determine if a ··· 474 474 * optional accurate ktime_get timestamp of when position was measured. 475 475 * 476 476 * \param dev DRM device. 477 - * \param crtc Id of the crtc to query. 477 + * \param pipe Id of the crtc to query. 478 478 * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). 479 479 * \param *vpos Target location for current vertical scanout position. 480 480 * \param *hpos Target location for current horizontal scanout position. ··· 498 498 * but unknown small number of scanlines wrt. real scanout position. 499 499 * 500 500 */ 501 - int (*get_scanout_position) (struct drm_device *dev, int crtc, 502 - unsigned int flags, 503 - int *vpos, int *hpos, 501 + int (*get_scanout_position) (struct drm_device *dev, unsigned int pipe, 502 + unsigned int flags, int *vpos, int *hpos, 504 503 ktime_t *stime, ktime_t *etime, 505 504 const struct drm_display_mode *mode); 506 505 ··· 517 518 * to the OpenML OML_sync_control extension specification. 518 519 * 519 520 * \param dev dev DRM device handle. 520 - * \param crtc crtc for which timestamp should be returned. 521 + * \param pipe crtc for which timestamp should be returned. 521 522 * \param *max_error Maximum allowable timestamp error in nanoseconds. 522 523 * Implementation should strive to provide timestamp 523 524 * with an error of at most *max_error nanoseconds. ··· 533 534 * negative number on failure. A positive status code on success, 534 535 * which describes how the vblank_time timestamp was computed. 535 536 */ 536 - int (*get_vblank_timestamp) (struct drm_device *dev, int crtc, 537 + int (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe, 537 538 int *max_error, 538 539 struct timeval *vblank_time, 539 540 unsigned flags); ··· 929 930 extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs); 930 931 extern int drm_wait_vblank(struct drm_device *dev, void *data, 931 932 struct drm_file *filp); 932 - extern u32 drm_vblank_count(struct drm_device *dev, int pipe); 933 + extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe); 933 934 extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc); 934 935 extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, 935 936 struct timeval *vblanktime);