Commit 65defc4a authored by Jani Nikula's avatar Jani Nikula
Browse files

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/7f2de4dd170771991756073f037c7ca043c3e746.1765290097.git.jani.nikula@intel.com


Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 04f0aa5d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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,