Exemplo n.º 1
0
/**
 * amdgpu_get_vblank_timestamp_kms - get vblank timestamp
 *
 * @dev: drm dev pointer
 * @crtc: crtc to get the timestamp for
 * @max_error: max error
 * @vblank_time: time value
 * @flags: flags passed to the driver
 *
 * Gets the timestamp on the requested crtc based on the
 * scanout position.  (all asics).
 * Returns postive status flags on success, negative error on failure.
 */
int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
				    int *max_error,
				    struct timeval *vblank_time,
				    unsigned flags)
{
	struct drm_crtc *crtc;
	struct amdgpu_device *adev = dev->dev_private;

	if (pipe >= dev->num_crtcs) {
		DRM_ERROR("Invalid crtc %u\n", pipe);
		return -EINVAL;
	}

	/* Get associated drm_crtc: */
	crtc = &adev->mode_info.crtcs[pipe]->base;
	if (!crtc) {
		/* This can occur on driver load if some component fails to
		 * initialize completely and driver is unloaded */
		DRM_ERROR("Uninitialized crtc %d\n", pipe);
		return -EINVAL;
	}

	/* Helper routine in DRM core does all the work: */
	return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
						     vblank_time, flags,
						     &crtc->hwmode);
}
Exemplo n.º 2
0
int radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc,
                                    int *max_error,
                                    struct timeval *vblank_time,
                                    unsigned flags)
{
    struct drm_crtc *drmcrtc;
    struct radeon_device *rdev = dev->dev_private;

    if (crtc < 0 || crtc >= dev->num_crtcs) {
        DRM_ERROR("Invalid crtc %d\n", crtc);
        return -EINVAL;
    }

    /* Get associated drm_crtc: */
    drmcrtc = &rdev->mode_info.crtcs[crtc]->base;

    /* Helper routine in DRM core does all the work: */
    return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error,
            vblank_time, flags,
            drmcrtc);
}
Exemplo n.º 3
0
/**
 * amdgpu_get_vblank_timestamp_kms - get vblank timestamp
 *
 * @dev: drm dev pointer
 * @crtc: crtc to get the timestamp for
 * @max_error: max error
 * @vblank_time: time value
 * @flags: flags passed to the driver
 *
 * Gets the timestamp on the requested crtc based on the
 * scanout position.  (all asics).
 * Returns postive status flags on success, negative error on failure.
 */
int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
				    int *max_error,
				    struct timeval *vblank_time,
				    unsigned flags)
{
	struct drm_crtc *crtc;
	struct amdgpu_device *adev = dev->dev_private;

	if (pipe >= dev->num_crtcs) {
		DRM_ERROR("Invalid crtc %u\n", pipe);
		return -EINVAL;
	}

	/* Get associated drm_crtc: */
	crtc = &adev->mode_info.crtcs[pipe]->base;

	/* Helper routine in DRM core does all the work: */
	return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
						     vblank_time, flags,
						     &crtc->hwmode);
}
Exemplo n.º 4
0
static int mdp5_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe,
				     int *max_error,
				     struct timeval *vblank_time,
				     unsigned flags)
{
	struct msm_drm_private *priv = dev->dev_private;
	struct drm_crtc *crtc;

	if (pipe < 0 || pipe >= priv->num_crtcs) {
		DRM_ERROR("Invalid crtc %d\n", pipe);
		return -EINVAL;
	}

	crtc = priv->crtcs[pipe];
	if (!crtc) {
		DRM_ERROR("Invalid crtc %d\n", pipe);
		return -EINVAL;
	}

	return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
						     vblank_time, flags,
						     &crtc->mode);
}