mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
drm/vblank: add return value to drm_crtc_wait_one_vblank()
Let drivers deal with the vblank wait failures if they so desire. If the current warning backtrace gets toned down to a simple warning message, the drivers may wish to add the backtrace themselves. Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/7f2de4dd170771991756073f037c7ca043c3e746.1765290097.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
04f0aa5d69
commit
65defc4a78
2 changed files with 7 additions and 3 deletions
|
|
@ -1293,8 +1293,10 @@ EXPORT_SYMBOL(drm_crtc_vblank_put);
|
|||
* This waits for one vblank to pass on @crtc, using the irq driver interfaces.
|
||||
* It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
|
||||
* due to lack of driver support or because the crtc is off.
|
||||
*
|
||||
* Returns: 0 on success, negative error on failures.
|
||||
*/
|
||||
void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
|
||||
int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
|
||||
{
|
||||
struct drm_device *dev = crtc->dev;
|
||||
int pipe = drm_crtc_index(crtc);
|
||||
|
|
@ -1305,7 +1307,7 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
|
|||
ret = drm_vblank_get(dev, pipe);
|
||||
if (drm_WARN(dev, ret, "vblank not available on crtc %i, ret=%i\n",
|
||||
pipe, ret))
|
||||
return;
|
||||
return ret;
|
||||
|
||||
last = drm_vblank_count(dev, pipe);
|
||||
|
||||
|
|
@ -1316,6 +1318,8 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
|
|||
drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe);
|
||||
|
||||
drm_vblank_put(dev, pipe);
|
||||
|
||||
return ret ? 0 : -ETIMEDOUT;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
|
|||
bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
|
||||
int drm_crtc_vblank_get(struct drm_crtc *crtc);
|
||||
void drm_crtc_vblank_put(struct drm_crtc *crtc);
|
||||
void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
|
||||
int drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
|
||||
void drm_crtc_vblank_off(struct drm_crtc *crtc);
|
||||
void drm_crtc_vblank_reset(struct drm_crtc *crtc);
|
||||
void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue