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

Commit 0c5ccf14 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher
Browse files

drm/amd/powerplay: apply Vega20 BACO workaround



Applied vdci flush workaround for Vega20 BACO.

Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9b638f97
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -929,6 +929,7 @@ struct amdgpu_device {
	/* counter of mapped memory through xgmi */
	atomic_t			xgmi_map_counter;

	bool                            in_baco_reset;
};

static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev)
+2 −0
Original line number Diff line number Diff line
@@ -452,6 +452,8 @@ static int soc15_asic_baco_reset(struct amdgpu_device *adev)

	dev_info(adev->dev, "GPU BACO reset\n");

	adev->in_baco_reset = 1;

	return 0;
}

+12 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "vega20_inc.h"
#include "vega20_ppsmc.h"
#include "vega20_baco.h"
#include "vega20_smumgr.h"



@@ -101,3 +102,14 @@ int vega20_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)

	return 0;
}

int vega20_baco_apply_vdci_flush_workaround(struct pp_hwmgr *hwmgr)
{
	int ret = 0;

	ret = vega20_set_pptable_driver_address(hwmgr);
	if (ret)
		return ret;

	return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_BacoWorkAroundFlushVDCI);
}
+1 −0
Original line number Diff line number Diff line
@@ -28,5 +28,6 @@
extern int vega20_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
extern int vega20_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
extern int vega20_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
extern int vega20_baco_apply_vdci_flush_workaround(struct pp_hwmgr *hwmgr);

#endif
+10 −1
Original line number Diff line number Diff line
@@ -443,6 +443,7 @@ static int vega20_init_sclk_threshold(struct pp_hwmgr *hwmgr)

static int vega20_setup_asic_task(struct pp_hwmgr *hwmgr)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
	int ret = 0;

	ret = vega20_init_sclk_threshold(hwmgr);
@@ -450,7 +451,15 @@ static int vega20_setup_asic_task(struct pp_hwmgr *hwmgr)
			"Failed to init sclk threshold!",
			return ret);

	return 0;
	if (adev->in_baco_reset) {
		adev->in_baco_reset = 0;

		ret = vega20_baco_apply_vdci_flush_workaround(hwmgr);
		if (ret)
			pr_err("Failed to apply vega20 baco workaround!\n");
	}

	return ret;
}

/*
Loading