Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d3cbd84 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

drm: Clarify vblank ts/scanoutpos sampling #defines



I've read INVBL as "invalid backlight" and got mightly confused.
The #defines are already fairly long and we can afford to extend
them a bit more without resulting in ugly code all over.

I'm not sure how useful the complicated bitmask return value of these
functions really are since no one checks them. But for now let's keep
things as is.

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fb446a1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -721,7 +721,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
	 * within vblank area, counting down the number of lines until
	 * start of scanout.
	 */
	invbl = vbl_status & DRM_SCANOUTPOS_INVBL;
	invbl = vbl_status & DRM_SCANOUTPOS_IN_VBLANK;

	/* Convert scanout position into elapsed time at raw_time query
	 * since start of scanout at first display scanline. delta_ns
@@ -751,7 +751,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,

	vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD;
	if (invbl)
		vbl_status |= DRM_VBLANKTIME_INVBL;
		vbl_status |= DRM_VBLANKTIME_IN_VBLANK;

	return vbl_status;
}
+1 −1
Original line number Diff line number Diff line
@@ -1020,7 +1020,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,

	/* In vblank? */
	if (in_vbl)
		ret |= DRM_SCANOUTPOS_INVBL;
		ret |= DRM_SCANOUTPOS_IN_VBLANK;

	return ret;
}
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
	if (etime) *etime = ns_to_ktime(args.time[1]);

	if (*vpos < 0)
		ret |= DRM_SCANOUTPOS_INVBL;
		ret |= DRM_SCANOUTPOS_IN_VBLANK;
	return ret;
}

+1 −1
Original line number Diff line number Diff line
@@ -1917,7 +1917,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int fl

	/* In vblank? */
	if (in_vbl)
		ret |= DRM_SCANOUTPOS_INVBL;
		ret |= DRM_SCANOUTPOS_IN_VBLANK;

	/* Is vpos outside nominal vblank area, but less than
	 * 1/100 of a frame height away from start of vblank?
+1 −1
Original line number Diff line number Diff line
@@ -1560,7 +1560,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev)
		if (rdev->pm.active_crtcs & (1 << crtc)) {
			vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, 0, &vpos, &hpos, NULL, NULL);
			if ((vbl_status & DRM_SCANOUTPOS_VALID) &&
			    !(vbl_status & DRM_SCANOUTPOS_INVBL))
			    !(vbl_status & DRM_SCANOUTPOS_IN_VBLANK))
				in_vbl = false;
		}
	}
Loading