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/drm/msm/mdp/mdp5/mdp5_kms.c | |
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/drm/msm/mdp/mdp5/mdp5_kms.c')
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 12 |
1 files changed, 6 insertions, 6 deletions
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, |