Commit b1f81666 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'amd-drm-next-5.16-2021-10-08' of...

Merge tag 'amd-drm-next-5.16-2021-10-08' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-next

amd-drm-next-5.16-2021-10-08:

amdgpu:
- gart BO pin count fix
- RAS fixes
- Misc display fixes
- Misc code cleanups
- Validate IP discovery table
- IOMMU handling fixes for hotplug
- Cyan Skillfish display support
- DP 2.0 fixes
- Covert vega and navi to IP discovery based asic enumeration
- JPEG fixes
- More FP cleanup for display
- DCC fixes for DCN3.x
- Initial USB4 DP tunnelling support
- Aldebaran MCE support

amdkfd:
- Misc bug fixes
- Misc code cleanups
- RAS fixes

x86/MCE:
- Export symbol for use by GPU driver

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211008200345.4689-1-alexander.deucher@amd.com
parents 407baae3 40348bae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -300,8 +300,8 @@ pcie_replay_count
.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
   :doc: pcie_replay_count

+GPU SmartShift Information
============================
GPU SmartShift Information
==========================

GPU SmartShift information via sysfs

+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ extern int mce_threshold_remove_device(unsigned int cpu);

void mce_amd_feature_init(struct cpuinfo_x86 *c);
int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr);

enum smca_bank_types smca_get_bank_type(unsigned int bank);
#else

static inline int mce_threshold_create_device(unsigned int cpu)		{ return 0; };
+2 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ const char *smca_get_long_name(enum smca_bank_types t)
}
EXPORT_SYMBOL_GPL(smca_get_long_name);

static enum smca_bank_types smca_get_bank_type(unsigned int bank)
enum smca_bank_types smca_get_bank_type(unsigned int bank)
{
	struct smca_bank *b;

@@ -132,6 +132,7 @@ static enum smca_bank_types smca_get_bank_type(unsigned int bank)

	return b->hwid->bank_type;
}
EXPORT_SYMBOL_GPL(smca_get_bank_type);

static struct smca_hwid smca_hwid_mcatypes[] = {
	/* { bank_type, hwid_mcatype } */
+9 −2
Original line number Diff line number Diff line
@@ -744,6 +744,7 @@ enum amd_hw_ip_block_type {
	UVD_HWIP,
	VCN_HWIP = UVD_HWIP,
	JPEG_HWIP = VCN_HWIP,
	VCN1_HWIP,
	VCE_HWIP,
	DF_HWIP,
	DCE_HWIP,
@@ -755,11 +756,16 @@ enum amd_hw_ip_block_type {
	CLK_HWIP,
	UMC_HWIP,
	RSMU_HWIP,
	XGMI_HWIP,
	DCI_HWIP,
	MAX_HWIP
};

#define HWIP_MAX_INSTANCE	10

#define HW_ID_MAX		300
#define IP_VERSION(mj, mn, rv) (((mj) << 16) | ((mn) << 8) | (rv))

struct amd_powerplay {
	void *pp_handle;
	const struct amd_pm_funcs *pp_funcs;
@@ -830,6 +836,7 @@ struct amdgpu_device {
	struct notifier_block		acpi_nb;
	struct amdgpu_i2c_chan		*i2c_bus[AMDGPU_MAX_I2C_BUS];
	struct debugfs_blob_wrapper     debugfs_vbios_blob;
	struct debugfs_blob_wrapper     debugfs_discovery_blob;
	struct mutex			srbm_mutex;
	/* GRBM index mutex. Protects concurrent access to GRBM index */
	struct mutex                    grbm_idx_mutex;
@@ -1078,8 +1085,6 @@ struct amdgpu_device {
	char				product_name[32];
	char				serial[20];

	struct amdgpu_autodump		autodump;

	atomic_t			throttling_logging_enabled;
	struct ratelimit_state		throttling_logging_rs;
	uint32_t                        ras_hw_enabled;
@@ -1087,8 +1092,10 @@ struct amdgpu_device {

	bool                            no_hw_access;
	struct pci_saved_state          *pci_state;
	pci_channel_state_t		pci_channel_state;

	struct amdgpu_reset_control     *reset_cntl;
	uint32_t                        ip_versions[HW_ID_MAX][HWIP_MAX_INSTANCE];
};

static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
+15 −2
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@
#include <linux/dma-buf.h>
#include "amdgpu_xgmi.h"
#include <uapi/linux/kfd_ioctl.h>
#include "amdgpu_ras.h"
#include "amdgpu_umc.h"

/* Total memory size in system memory and all GPU VRAM. Used to
 * estimate worst case amount of memory to reserve for page tables
@@ -70,8 +72,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev)
	if (!kfd_initialized)
		return;

	adev->kfd.dev = kgd2kfd_probe((struct kgd_dev *)adev,
				      adev->pdev, adev->asic_type, vf);
	adev->kfd.dev = kgd2kfd_probe((struct kgd_dev *)adev, vf);

	if (adev->kfd.dev)
		amdgpu_amdkfd_total_mem_size += adev->gmc.real_vram_size;
@@ -780,3 +781,15 @@ bool amdgpu_amdkfd_have_atomics_support(struct kgd_dev *kgd)

	return adev->have_atomics_support;
}

void amdgpu_amdkfd_ras_poison_consumption_handler(struct kgd_dev *kgd)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
	struct ras_err_data err_data = {0, 0, 0, NULL};

	/* CPU MCA will handle page retirement if connected_to_cpu is 1 */
	if (!adev->gmc.xgmi.connected_to_cpu)
		amdgpu_umc_process_ras_data_cb(adev, &err_data, NULL);
	else
		amdgpu_amdkfd_gpu_reset(kgd);
}
Loading