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

Commit e37e4f05 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher
Browse files

drm/amd/amdgpu: Remove division from vblank_wait



Removes division from vblank_wait for DCE v6, v8,
and v10.  Was already implemented for v11.

Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 73559847
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -221,7 +221,7 @@ static bool dce_v10_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
 */
 */
static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
{
{
	unsigned i = 0;
	unsigned i = 100;


	if (crtc >= adev->mode_info.num_crtc)
	if (crtc >= adev->mode_info.num_crtc)
		return;
		return;
@@ -233,14 +233,16 @@ static void dce_v10_0_vblank_wait(struct amdgpu_device *adev, int crtc)
	 * wait for another frame.
	 * wait for another frame.
	 */
	 */
	while (dce_v10_0_is_in_vblank(adev, crtc)) {
	while (dce_v10_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v10_0_is_counter_moving(adev, crtc))
			if (!dce_v10_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}
	}
	}


	while (!dce_v10_0_is_in_vblank(adev, crtc)) {
	while (!dce_v10_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v10_0_is_counter_moving(adev, crtc))
			if (!dce_v10_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}
+5 −3
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ static bool dce_v6_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
 */
 */
static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
{
{
	unsigned i = 0;
	unsigned i = 100;


	if (crtc >= adev->mode_info.num_crtc)
	if (crtc >= adev->mode_info.num_crtc)
		return;
		return;
@@ -158,14 +158,16 @@ static void dce_v6_0_vblank_wait(struct amdgpu_device *adev, int crtc)
	 * wait for another frame.
	 * wait for another frame.
	 */
	 */
	while (dce_v6_0_is_in_vblank(adev, crtc)) {
	while (dce_v6_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v6_0_is_counter_moving(adev, crtc))
			if (!dce_v6_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}
	}
	}


	while (!dce_v6_0_is_in_vblank(adev, crtc)) {
	while (!dce_v6_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v6_0_is_counter_moving(adev, crtc))
			if (!dce_v6_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}
+5 −3
Original line number Original line Diff line number Diff line
@@ -170,7 +170,7 @@ static bool dce_v8_0_is_counter_moving(struct amdgpu_device *adev, int crtc)
 */
 */
static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
{
{
	unsigned i = 0;
	unsigned i = 100;


	if (crtc >= adev->mode_info.num_crtc)
	if (crtc >= adev->mode_info.num_crtc)
		return;
		return;
@@ -182,14 +182,16 @@ static void dce_v8_0_vblank_wait(struct amdgpu_device *adev, int crtc)
	 * wait for another frame.
	 * wait for another frame.
	 */
	 */
	while (dce_v8_0_is_in_vblank(adev, crtc)) {
	while (dce_v8_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v8_0_is_counter_moving(adev, crtc))
			if (!dce_v8_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}
	}
	}


	while (!dce_v8_0_is_in_vblank(adev, crtc)) {
	while (!dce_v8_0_is_in_vblank(adev, crtc)) {
		if (i++ % 100 == 0) {
		if (i++ == 100) {
			i = 0;
			if (!dce_v8_0_is_counter_moving(adev, crtc))
			if (!dce_v8_0_is_counter_moving(adev, crtc))
				break;
				break;
		}
		}