diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-05-09 10:03:25 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-05-10 04:21:08 -0400 |
commit | d673c02c4bdbcbe3076a2680f9c954be26b525c8 (patch) | |
tree | 6a3535fa5b309037993de557aaf8360caee0281e /drivers/gpu | |
parent | 315f0242aa2b1e999bc1211123f7b6664068dba4 (diff) |
drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool
There's really no reason for anything more:
- Calling this while the crtc vblank stuff isn't set up is a driver
bug. Those places alrready DRM_ERROR.
- Calling this when the crtc is off is either a driver bug (calling
drm_crtc_handle_vblank at the wrong time) or a core bug (for
anything else). Again, we DRM_ERROR.
- EINVAL is checked at higher levels already, and if we'd use struct
drm_crtc * instead of (dev, pipe) it would be real obvious that
those are again core bugs.
The only valid failure mode is crap hardware that couldn't sample a
useful timestamp, to ask the core to just grab a not-so-accurate
timestamp. Bool is perfectly fine for that.
v2: Also fix up the one caller, I lost that in the shuffling (Jani).
v3: Fixup commit message (Neil).
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Cc: Eric Anholt <eric@anholt.net>
Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-1-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 49 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_drv.h | 2 |
11 files changed, 56 insertions, 69 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 6a8129949333..7b4f808afff9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1910,10 +1910,10 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); | |||
1910 | u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); | 1910 | u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); |
1911 | int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); | 1911 | int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); |
1912 | void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); | 1912 | void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); |
1913 | int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, | 1913 | bool amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, |
1914 | int *max_error, | 1914 | int *max_error, |
1915 | struct timeval *vblank_time, | 1915 | struct timeval *vblank_time, |
1916 | unsigned flags); | 1916 | unsigned flags); |
1917 | long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, | 1917 | long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, |
1918 | unsigned long arg); | 1918 | unsigned long arg); |
1919 | 1919 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 832be632478f..a1b97809305e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -945,19 +945,19 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe) | |||
945 | * | 945 | * |
946 | * Gets the timestamp on the requested crtc based on the | 946 | * Gets the timestamp on the requested crtc based on the |
947 | * scanout position. (all asics). | 947 | * scanout position. (all asics). |
948 | * Returns postive status flags on success, negative error on failure. | 948 | * Returns true on success, false on failure. |
949 | */ | 949 | */ |
950 | int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, | 950 | bool amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, |
951 | int *max_error, | 951 | int *max_error, |
952 | struct timeval *vblank_time, | 952 | struct timeval *vblank_time, |
953 | unsigned flags) | 953 | unsigned flags) |
954 | { | 954 | { |
955 | struct drm_crtc *crtc; | 955 | struct drm_crtc *crtc; |
956 | struct amdgpu_device *adev = dev->dev_private; | 956 | struct amdgpu_device *adev = dev->dev_private; |
957 | 957 | ||
958 | if (pipe >= dev->num_crtcs) { | 958 | if (pipe >= dev->num_crtcs) { |
959 | DRM_ERROR("Invalid crtc %u\n", pipe); | 959 | DRM_ERROR("Invalid crtc %u\n", pipe); |
960 | return -EINVAL; | 960 | return false; |
961 | } | 961 | } |
962 | 962 | ||
963 | /* Get associated drm_crtc: */ | 963 | /* Get associated drm_crtc: */ |
@@ -966,7 +966,7 @@ int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, | |||
966 | /* This can occur on driver load if some component fails to | 966 | /* This can occur on driver load if some component fails to |
967 | * initialize completely and driver is unloaded */ | 967 | * initialize completely and driver is unloaded */ |
968 | DRM_ERROR("Uninitialized crtc %d\n", pipe); | 968 | DRM_ERROR("Uninitialized crtc %d\n", pipe); |
969 | return -EINVAL; | 969 | return false; |
970 | } | 970 | } |
971 | 971 | ||
972 | /* Helper routine in DRM core does all the work: */ | 972 | /* Helper routine in DRM core does all the work: */ |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 8c866cac62dd..677b37b0372b 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -724,43 +724,32 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants); | |||
724 | * active. Higher level code is expected to handle this. | 724 | * active. Higher level code is expected to handle this. |
725 | * | 725 | * |
726 | * Returns: | 726 | * Returns: |
727 | * Negative value on error, failure or if not supported in current | ||
728 | * video mode: | ||
729 | * | ||
730 | * -EINVAL Invalid CRTC. | ||
731 | * -EAGAIN Temporary unavailable, e.g., called before initial modeset. | ||
732 | * -ENOTSUPP Function not supported in current display mode. | ||
733 | * -EIO Failed, e.g., due to failed scanout position query. | ||
734 | * | ||
735 | * Returns or'ed positive status flags on success: | ||
736 | * | ||
737 | * DRM_VBLANKTIME_SCANOUTPOS_METHOD - Signal this method used for timestamping. | ||
738 | * DRM_VBLANKTIME_INVBL - Timestamp taken while scanout was in vblank interval. | ||
739 | * | 727 | * |
728 | * Returns true on success, and false on failure, i.e. when no accurate | ||
729 | * timestamp could be acquired. | ||
740 | */ | 730 | */ |
741 | int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | 731 | bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, |
742 | unsigned int pipe, | 732 | unsigned int pipe, |
743 | int *max_error, | 733 | int *max_error, |
744 | struct timeval *vblank_time, | 734 | struct timeval *vblank_time, |
745 | unsigned flags, | 735 | unsigned flags, |
746 | const struct drm_display_mode *mode) | 736 | const struct drm_display_mode *mode) |
747 | { | 737 | { |
748 | struct timeval tv_etime; | 738 | struct timeval tv_etime; |
749 | ktime_t stime, etime; | 739 | ktime_t stime, etime; |
750 | unsigned int vbl_status; | 740 | unsigned int vbl_status; |
751 | int ret = DRM_VBLANKTIME_SCANOUTPOS_METHOD; | ||
752 | int vpos, hpos, i; | 741 | int vpos, hpos, i; |
753 | int delta_ns, duration_ns; | 742 | int delta_ns, duration_ns; |
754 | 743 | ||
755 | if (pipe >= dev->num_crtcs) { | 744 | if (pipe >= dev->num_crtcs) { |
756 | DRM_ERROR("Invalid crtc %u\n", pipe); | 745 | DRM_ERROR("Invalid crtc %u\n", pipe); |
757 | return -EINVAL; | 746 | return false; |
758 | } | 747 | } |
759 | 748 | ||
760 | /* Scanout position query not supported? Should not happen. */ | 749 | /* Scanout position query not supported? Should not happen. */ |
761 | if (!dev->driver->get_scanout_position) { | 750 | if (!dev->driver->get_scanout_position) { |
762 | DRM_ERROR("Called from driver w/o get_scanout_position()!?\n"); | 751 | DRM_ERROR("Called from driver w/o get_scanout_position()!?\n"); |
763 | return -EIO; | 752 | return false; |
764 | } | 753 | } |
765 | 754 | ||
766 | /* If mode timing undefined, just return as no-op: | 755 | /* If mode timing undefined, just return as no-op: |
@@ -768,7 +757,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | |||
768 | */ | 757 | */ |
769 | if (mode->crtc_clock == 0) { | 758 | if (mode->crtc_clock == 0) { |
770 | DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe); | 759 | DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe); |
771 | return -EAGAIN; | 760 | return false; |
772 | } | 761 | } |
773 | 762 | ||
774 | /* Get current scanout position with system timestamp. | 763 | /* Get current scanout position with system timestamp. |
@@ -792,7 +781,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | |||
792 | if (!(vbl_status & DRM_SCANOUTPOS_VALID)) { | 781 | if (!(vbl_status & DRM_SCANOUTPOS_VALID)) { |
793 | DRM_DEBUG("crtc %u : scanoutpos query failed [0x%x].\n", | 782 | DRM_DEBUG("crtc %u : scanoutpos query failed [0x%x].\n", |
794 | pipe, vbl_status); | 783 | pipe, vbl_status); |
795 | return -EIO; | 784 | return false; |
796 | } | 785 | } |
797 | 786 | ||
798 | /* Compute uncertainty in timestamp of scanout position query. */ | 787 | /* Compute uncertainty in timestamp of scanout position query. */ |
@@ -836,7 +825,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | |||
836 | (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, | 825 | (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, |
837 | duration_ns/1000, i); | 826 | duration_ns/1000, i); |
838 | 827 | ||
839 | return ret; | 828 | return true; |
840 | } | 829 | } |
841 | EXPORT_SYMBOL(drm_calc_vbltimestamp_from_scanoutpos); | 830 | EXPORT_SYMBOL(drm_calc_vbltimestamp_from_scanoutpos); |
842 | 831 | ||
@@ -872,25 +861,23 @@ static bool | |||
872 | drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, | 861 | drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, |
873 | struct timeval *tvblank, unsigned flags) | 862 | struct timeval *tvblank, unsigned flags) |
874 | { | 863 | { |
875 | int ret; | 864 | bool ret = false; |
876 | 865 | ||
877 | /* Define requested maximum error on timestamps (nanoseconds). */ | 866 | /* Define requested maximum error on timestamps (nanoseconds). */ |
878 | int max_error = (int) drm_timestamp_precision * 1000; | 867 | int max_error = (int) drm_timestamp_precision * 1000; |
879 | 868 | ||
880 | /* Query driver if possible and precision timestamping enabled. */ | 869 | /* Query driver if possible and precision timestamping enabled. */ |
881 | if (dev->driver->get_vblank_timestamp && (max_error > 0)) { | 870 | if (dev->driver->get_vblank_timestamp && (max_error > 0)) |
882 | ret = dev->driver->get_vblank_timestamp(dev, pipe, &max_error, | 871 | ret = dev->driver->get_vblank_timestamp(dev, pipe, &max_error, |
883 | tvblank, flags); | 872 | tvblank, flags); |
884 | if (ret > 0) | ||
885 | return true; | ||
886 | } | ||
887 | 873 | ||
888 | /* GPU high precision timestamp query unsupported or failed. | 874 | /* GPU high precision timestamp query unsupported or failed. |
889 | * Return current monotonic/gettimeofday timestamp as best estimate. | 875 | * Return current monotonic/gettimeofday timestamp as best estimate. |
890 | */ | 876 | */ |
891 | *tvblank = get_drm_timestamp(); | 877 | if (!ret) |
878 | *tvblank = get_drm_timestamp(); | ||
892 | 879 | ||
893 | return false; | 880 | return ret; |
894 | } | 881 | } |
895 | 882 | ||
896 | /** | 883 | /** |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index fd97fe00cd0d..315e6876fa85 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -964,7 +964,7 @@ int intel_get_crtc_scanline(struct intel_crtc *crtc) | |||
964 | return position; | 964 | return position; |
965 | } | 965 | } |
966 | 966 | ||
967 | static int i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, | 967 | static bool i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, |
968 | int *max_error, | 968 | int *max_error, |
969 | struct timeval *vblank_time, | 969 | struct timeval *vblank_time, |
970 | unsigned flags) | 970 | unsigned flags) |
@@ -974,19 +974,19 @@ static int i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, | |||
974 | 974 | ||
975 | if (pipe >= INTEL_INFO(dev_priv)->num_pipes) { | 975 | if (pipe >= INTEL_INFO(dev_priv)->num_pipes) { |
976 | DRM_ERROR("Invalid crtc %u\n", pipe); | 976 | DRM_ERROR("Invalid crtc %u\n", pipe); |
977 | return -EINVAL; | 977 | return false; |
978 | } | 978 | } |
979 | 979 | ||
980 | /* Get drm_crtc to timestamp: */ | 980 | /* Get drm_crtc to timestamp: */ |
981 | crtc = intel_get_crtc_for_pipe(dev_priv, pipe); | 981 | crtc = intel_get_crtc_for_pipe(dev_priv, pipe); |
982 | if (crtc == NULL) { | 982 | if (crtc == NULL) { |
983 | DRM_ERROR("Invalid crtc %u\n", pipe); | 983 | DRM_ERROR("Invalid crtc %u\n", pipe); |
984 | return -EINVAL; | 984 | return false; |
985 | } | 985 | } |
986 | 986 | ||
987 | if (!crtc->base.hwmode.crtc_clock) { | 987 | if (!crtc->base.hwmode.crtc_clock) { |
988 | DRM_DEBUG_KMS("crtc %u is disabled\n", pipe); | 988 | DRM_DEBUG_KMS("crtc %u is disabled\n", pipe); |
989 | return -EBUSY; | 989 | return false; |
990 | } | 990 | } |
991 | 991 | ||
992 | /* Helper routine in DRM core does all the work: */ | 992 | /* Helper routine in DRM core does all the work: */ |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index d3d6b4cae1e6..ffeb34bee3af 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | |||
@@ -592,23 +592,23 @@ static int mdp5_get_scanoutpos(struct drm_device *dev, unsigned int pipe, | |||
592 | return ret; | 592 | return ret; |
593 | } | 593 | } |
594 | 594 | ||
595 | static int mdp5_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, | 595 | static bool mdp5_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, |
596 | int *max_error, | 596 | int *max_error, |
597 | struct timeval *vblank_time, | 597 | struct timeval *vblank_time, |
598 | unsigned flags) | 598 | unsigned flags) |
599 | { | 599 | { |
600 | struct msm_drm_private *priv = dev->dev_private; | 600 | struct msm_drm_private *priv = dev->dev_private; |
601 | struct drm_crtc *crtc; | 601 | struct drm_crtc *crtc; |
602 | 602 | ||
603 | if (pipe < 0 || pipe >= priv->num_crtcs) { | 603 | if (pipe < 0 || pipe >= priv->num_crtcs) { |
604 | DRM_ERROR("Invalid crtc %d\n", pipe); | 604 | DRM_ERROR("Invalid crtc %d\n", pipe); |
605 | return -EINVAL; | 605 | return false; |
606 | } | 606 | } |
607 | 607 | ||
608 | crtc = priv->crtcs[pipe]; | 608 | crtc = priv->crtcs[pipe]; |
609 | if (!crtc) { | 609 | if (!crtc) { |
610 | DRM_ERROR("Invalid crtc %d\n", pipe); | 610 | DRM_ERROR("Invalid crtc %d\n", pipe); |
611 | return -EINVAL; | 611 | return false; |
612 | } | 612 | } |
613 | 613 | ||
614 | return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, | 614 | return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 21b10f9840c9..f1e36f70755d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -156,7 +156,7 @@ nouveau_display_scanoutpos(struct drm_device *dev, unsigned int pipe, | |||
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | int | 159 | bool |
160 | nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, | 160 | nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, |
161 | int *max_error, struct timeval *time, unsigned flags) | 161 | int *max_error, struct timeval *time, unsigned flags) |
162 | { | 162 | { |
@@ -174,7 +174,7 @@ nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | return -EINVAL; | 177 | return false; |
178 | } | 178 | } |
179 | 179 | ||
180 | static void | 180 | static void |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h index e1d772d39488..c6bfe533a641 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.h +++ b/drivers/gpu/drm/nouveau/nouveau_display.h | |||
@@ -71,8 +71,8 @@ void nouveau_display_vblank_disable(struct drm_device *, unsigned int); | |||
71 | int nouveau_display_scanoutpos(struct drm_device *, unsigned int, | 71 | int nouveau_display_scanoutpos(struct drm_device *, unsigned int, |
72 | unsigned int, int *, int *, ktime_t *, | 72 | unsigned int, int *, int *, ktime_t *, |
73 | ktime_t *, const struct drm_display_mode *); | 73 | ktime_t *, const struct drm_display_mode *); |
74 | int nouveau_display_vblstamp(struct drm_device *, unsigned int, int *, | 74 | bool nouveau_display_vblstamp(struct drm_device *, unsigned int, int *, |
75 | struct timeval *, unsigned); | 75 | struct timeval *, unsigned); |
76 | 76 | ||
77 | int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | 77 | int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
78 | struct drm_pending_vblank_event *event, | 78 | struct drm_pending_vblank_event *event, |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 93d45aa5c3d4..caa0b1cc4269 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -115,10 +115,10 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon); | |||
115 | u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); | 115 | u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); |
116 | int radeon_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); | 116 | int radeon_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); |
117 | void radeon_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); | 117 | void radeon_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); |
118 | int radeon_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, | 118 | bool radeon_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, |
119 | int *max_error, | 119 | int *max_error, |
120 | struct timeval *vblank_time, | 120 | struct timeval *vblank_time, |
121 | unsigned flags); | 121 | unsigned flags); |
122 | void radeon_driver_irq_preinstall_kms(struct drm_device *dev); | 122 | void radeon_driver_irq_preinstall_kms(struct drm_device *dev); |
123 | int radeon_driver_irq_postinstall_kms(struct drm_device *dev); | 123 | int radeon_driver_irq_postinstall_kms(struct drm_device *dev); |
124 | void radeon_driver_irq_uninstall_kms(struct drm_device *dev); | 124 | void radeon_driver_irq_uninstall_kms(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index e3e7cb1d10a2..535969d74f64 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -869,25 +869,25 @@ void radeon_disable_vblank_kms(struct drm_device *dev, int crtc) | |||
869 | * | 869 | * |
870 | * Gets the timestamp on the requested crtc based on the | 870 | * Gets the timestamp on the requested crtc based on the |
871 | * scanout position. (all asics). | 871 | * scanout position. (all asics). |
872 | * Returns postive status flags on success, negative error on failure. | 872 | * Returns true on success, false on failure. |
873 | */ | 873 | */ |
874 | int radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, | 874 | bool radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, |
875 | int *max_error, | 875 | int *max_error, |
876 | struct timeval *vblank_time, | 876 | struct timeval *vblank_time, |
877 | unsigned flags) | 877 | unsigned flags) |
878 | { | 878 | { |
879 | struct drm_crtc *drmcrtc; | 879 | struct drm_crtc *drmcrtc; |
880 | struct radeon_device *rdev = dev->dev_private; | 880 | struct radeon_device *rdev = dev->dev_private; |
881 | 881 | ||
882 | if (crtc < 0 || crtc >= dev->num_crtcs) { | 882 | if (crtc < 0 || crtc >= dev->num_crtcs) { |
883 | DRM_ERROR("Invalid crtc %d\n", crtc); | 883 | DRM_ERROR("Invalid crtc %d\n", crtc); |
884 | return -EINVAL; | 884 | return false; |
885 | } | 885 | } |
886 | 886 | ||
887 | /* Get associated drm_crtc: */ | 887 | /* Get associated drm_crtc: */ |
888 | drmcrtc = &rdev->mode_info.crtcs[crtc]->base; | 888 | drmcrtc = &rdev->mode_info.crtcs[crtc]->base; |
889 | if (!drmcrtc) | 889 | if (!drmcrtc) |
890 | return -EINVAL; | 890 | return false; |
891 | 891 | ||
892 | /* Helper routine in DRM core does all the work: */ | 892 | /* Helper routine in DRM core does all the work: */ |
893 | return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, | 893 | return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, |
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index d86c8cce3182..f506525a1066 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c | |||
@@ -270,7 +270,7 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, | |||
270 | return ret; | 270 | return ret; |
271 | } | 271 | } |
272 | 272 | ||
273 | int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, | 273 | bool vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, |
274 | int *max_error, struct timeval *vblank_time, | 274 | int *max_error, struct timeval *vblank_time, |
275 | unsigned flags) | 275 | unsigned flags) |
276 | { | 276 | { |
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 92eb7d811bf2..d1c53a5d0923 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h | |||
@@ -493,7 +493,7 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, | |||
493 | unsigned int flags, int *vpos, int *hpos, | 493 | unsigned int flags, int *vpos, int *hpos, |
494 | ktime_t *stime, ktime_t *etime, | 494 | ktime_t *stime, ktime_t *etime, |
495 | const struct drm_display_mode *mode); | 495 | const struct drm_display_mode *mode); |
496 | int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, | 496 | bool vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, |
497 | int *max_error, struct timeval *vblank_time, | 497 | int *max_error, struct timeval *vblank_time, |
498 | unsigned flags); | 498 | unsigned flags); |
499 | 499 | ||