diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/ObjectID.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 71 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 12 | 
15 files changed, 115 insertions, 18 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/ObjectID.h b/drivers/gpu/drm/amd/amdgpu/ObjectID.h index 5b393622f592..a0f0a17e224f 100644 --- a/drivers/gpu/drm/amd/amdgpu/ObjectID.h +++ b/drivers/gpu/drm/amd/amdgpu/ObjectID.h @@ -119,6 +119,7 @@  #define CONNECTOR_OBJECT_ID_eDP                   0x14  #define CONNECTOR_OBJECT_ID_MXM                   0x15  #define CONNECTOR_OBJECT_ID_LVDS_eDP              0x16 +#define CONNECTOR_OBJECT_ID_USBC                  0x17  /* deleted */ diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 3987ecb24ef4..49f734137f15 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -5733,7 +5733,7 @@ void amdgpu_device_flush_hdp(struct amdgpu_device *adev,  		struct amdgpu_ring *ring)  {  #ifdef CONFIG_X86_64 -	if (adev->flags & AMD_IS_APU) +	if ((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev))  		return;  #endif  	if (adev->gmc.xgmi.connected_to_cpu) @@ -5749,7 +5749,7 @@ void amdgpu_device_invalidate_hdp(struct amdgpu_device *adev,  		struct amdgpu_ring *ring)  {  #ifdef CONFIG_X86_64 -	if (adev->flags & AMD_IS_APU) +	if ((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev))  		return;  #endif  	if (adev->gmc.xgmi.connected_to_cpu) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index bb1c025d9001..b03663f42cc9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -680,7 +680,7 @@ MODULE_PARM_DESC(sched_policy,   * Maximum number of processes that HWS can schedule concurrently. The maximum is the   * number of VMIDs assigned to the HWS, which is also the default.   */ -int hws_max_conc_proc = 8; +int hws_max_conc_proc = -1;  module_param(hws_max_conc_proc, int, 0444);  MODULE_PARM_DESC(hws_max_conc_proc,  	"Max # processes HWS can execute concurrently when sched_policy=0 (0 = no concurrency, #VMIDs for KFD = Maximum(default))"); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c index 8fe939976224..28a736c507bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -266,7 +266,7 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,  		    * adev->gfx.mec.num_pipe_per_mec  		    * adev->gfx.mec.num_queue_per_pipe; -	while (queue_bit-- >= 0) { +	while (--queue_bit >= 0) {  		if (test_bit(queue_bit, adev->gfx.mec.queue_bitmap))  			continue; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index ca2cfb65f976..a66a0881a934 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -561,9 +561,15 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)  	switch (adev->ip_versions[GC_HWIP][0]) {  	case IP_VERSION(9, 0, 1): +	case IP_VERSION(9, 3, 0):  	case IP_VERSION(9, 4, 0):  	case IP_VERSION(9, 4, 1):  	case IP_VERSION(9, 4, 2): +	case IP_VERSION(10, 3, 3): +	case IP_VERSION(10, 3, 4): +	case IP_VERSION(10, 3, 5): +	case IP_VERSION(10, 3, 6): +	case IP_VERSION(10, 3, 7):  		/*  		 * noretry = 0 will cause kfd page fault tests fail  		 * for some ASICs, so set default to 1 for these ASICs. diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 25731719c627..940752488330 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -1284,6 +1284,7 @@ void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,   */  void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)  { +	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);  	struct dma_fence *fence = NULL;  	struct amdgpu_bo *abo;  	int r; @@ -1303,7 +1304,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)  		amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);  	if (bo->resource->mem_type != TTM_PL_VRAM || -	    !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE)) +	    !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE) || +	    adev->in_suspend || adev->shutdown)  		return;  	if (WARN_ON_ONCE(!dma_resv_trylock(bo->base.resv))) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 5320bb0883d8..317d80209e95 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -300,8 +300,8 @@ void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib);  void amdgpu_ring_commit(struct amdgpu_ring *ring);  void amdgpu_ring_undo(struct amdgpu_ring *ring);  int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, -		     unsigned int ring_size, struct amdgpu_irq_src *irq_src, -		     unsigned int irq_type, unsigned int prio, +		     unsigned int max_dw, struct amdgpu_irq_src *irq_src, +		     unsigned int irq_type, unsigned int hw_prio,  		     atomic_t *sched_score);  void amdgpu_ring_fini(struct amdgpu_ring *ring);  void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h index e2fde88aaf5e..f06fb7f882e2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h @@ -159,6 +159,7 @@  #define AMDGPU_VCN_MULTI_QUEUE_FLAG	(1 << 8)  #define AMDGPU_VCN_SW_RING_FLAG		(1 << 9)  #define AMDGPU_VCN_FW_LOGGING_FLAG	(1 << 10) +#define AMDGPU_VCN_SMU_VERSION_INFO_FLAG (1 << 11)  #define AMDGPU_VCN_IB_FLAG_DECODE_BUFFER	0x00000001  #define AMDGPU_VCN_CMD_FLAG_MSG_BUFFER		0x00000001 @@ -279,6 +280,11 @@ struct amdgpu_fw_shared_fw_logging {  	uint32_t size;  }; +struct amdgpu_fw_shared_smu_interface_info { +	uint8_t smu_interface_type; +	uint8_t padding[3]; +}; +  struct amdgpu_fw_shared {  	uint32_t present_flag_0;  	uint8_t pad[44]; @@ -287,6 +293,7 @@ struct amdgpu_fw_shared {  	struct amdgpu_fw_shared_multi_queue multi_queue;  	struct amdgpu_fw_shared_sw_ring sw_ring;  	struct amdgpu_fw_shared_fw_logging fw_log; +	struct amdgpu_fw_shared_smu_interface_info smu_interface_info;  };  struct amdgpu_vcn_fwlog { diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index f4c6accd3226..9426e252d8aa 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3293,7 +3293,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_3[] =  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000280),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGB_ADDR_CONFIG, 0x0c1807ff, 0x00000242), -	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL, 0x1ff1ffff, 0x00000500), +	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Vangogh, 0x1ff1ffff, 0x00000500),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL1_PIPE_STEER, 0x000000ff, 0x000000e4),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_0, 0x77777777, 0x32103210),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_1, 0x77777777, 0x32103210), @@ -3429,7 +3429,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_6[] =  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000280),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGB_ADDR_CONFIG, 0x0c1807ff, 0x00000042), -	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL, 0x1ff1ffff, 0x00000500), +	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Vangogh, 0x1ff1ffff, 0x00000500),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL1_PIPE_STEER, 0x000000ff, 0x00000044),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_0, 0x77777777, 0x32103210),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_1, 0x77777777, 0x32103210), @@ -3454,7 +3454,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_7[] = {  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000280),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGB_ADDR_CONFIG, 0x0c1807ff, 0x00000041), -	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL, 0x1ff1ffff, 0x00000500), +	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Vangogh, 0x1ff1ffff, 0x00000500),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL1_PIPE_STEER, 0x000000ff, 0x000000e4),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_0, 0x77777777, 0x32103210),  	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_1, 0x77777777, 0x32103210), @@ -7689,6 +7689,7 @@ static uint64_t gfx_v10_0_get_gpu_clock_counter(struct amdgpu_device *adev)  	switch (adev->ip_versions[GC_HWIP][0]) {  	case IP_VERSION(10, 3, 1):  	case IP_VERSION(10, 3, 3): +	case IP_VERSION(10, 3, 7):  		preempt_disable();  		clock_hi = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh);  		clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh); diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c index 3c1d440824a7..5228421b0f72 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c @@ -814,7 +814,7 @@ static int gmc_v10_0_mc_init(struct amdgpu_device *adev)  	adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);  #ifdef CONFIG_X86_64 -	if (adev->flags & AMD_IS_APU) { +	if ((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) {  		adev->gmc.aper_base = adev->gfxhub.funcs->get_mc_fb_offset(adev);  		adev->gmc.aper_size = adev->gmc.real_vram_size;  	} diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c index 344d819b4c1b..979da6f510e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c @@ -381,8 +381,9 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)  	adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);  #ifdef CONFIG_X86_64 -	if (adev->flags & AMD_IS_APU && -	    adev->gmc.real_vram_size > adev->gmc.aper_size) { +	if ((adev->flags & AMD_IS_APU) && +	    adev->gmc.real_vram_size > adev->gmc.aper_size && +	    !amdgpu_passthrough(adev)) {  		adev->gmc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;  		adev->gmc.aper_size = adev->gmc.real_vram_size;  	} diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c index ca9841d5669f..1932a3e4af7e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c @@ -581,7 +581,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)  	adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);  #ifdef CONFIG_X86_64 -	if (adev->flags & AMD_IS_APU) { +	if ((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) {  		adev->gmc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;  		adev->gmc.aper_size = adev->gmc.real_vram_size;  	} diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 431742eb7811..6009fbfdcc19 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -1456,7 +1456,7 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)  	 */  	/* check whether both host-gpu and gpu-gpu xgmi links exist */ -	if ((adev->flags & AMD_IS_APU) || +	if (((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) ||  	    (adev->gmc.xgmi.supported &&  	     adev->gmc.xgmi.connected_to_cpu)) {  		adev->gmc.aper_base = @@ -1721,7 +1721,7 @@ static int gmc_v9_0_sw_fini(void *handle)  	amdgpu_gem_force_release(adev);  	amdgpu_vm_manager_fini(adev);  	amdgpu_gart_table_vram_free(adev); -	amdgpu_bo_unref(&adev->gmc.pdb0_bo); +	amdgpu_bo_free_kernel(&adev->gmc.pdb0_bo, NULL, &adev->gmc.ptr_pdb0);  	amdgpu_bo_fini(adev);  	return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index dff54190b96c..f0fbcda76f5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c @@ -24,6 +24,7 @@  #include <linux/firmware.h>  #include "amdgpu.h" +#include "amdgpu_cs.h"  #include "amdgpu_vcn.h"  #include "amdgpu_pm.h"  #include "soc15.h" @@ -1900,6 +1901,75 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {  	.set_powergating_state = vcn_v1_0_set_powergating_state,  }; +/* + * It is a hardware issue that VCN can't handle a GTT TMZ buffer on + * CHIP_RAVEN series ASIC. Move such a GTT TMZ buffer to VRAM domain + * before command submission as a workaround. + */ +static int vcn_v1_0_validate_bo(struct amdgpu_cs_parser *parser, +				struct amdgpu_job *job, +				uint64_t addr) +{ +	struct ttm_operation_ctx ctx = { false, false }; +	struct amdgpu_fpriv *fpriv = parser->filp->driver_priv; +	struct amdgpu_vm *vm = &fpriv->vm; +	struct amdgpu_bo_va_mapping *mapping; +	struct amdgpu_bo *bo; +	int r; + +	addr &= AMDGPU_GMC_HOLE_MASK; +	if (addr & 0x7) { +		DRM_ERROR("VCN messages must be 8 byte aligned!\n"); +		return -EINVAL; +	} + +	mapping = amdgpu_vm_bo_lookup_mapping(vm, addr/AMDGPU_GPU_PAGE_SIZE); +	if (!mapping || !mapping->bo_va || !mapping->bo_va->base.bo) +		return -EINVAL; + +	bo = mapping->bo_va->base.bo; +	if (!(bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED)) +		return 0; + +	amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_VRAM); +	r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); +	if (r) { +		DRM_ERROR("Failed to validate the VCN message BO (%d)!\n", r); +		return r; +	} + +	return r; +} + +static int vcn_v1_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p, +					   struct amdgpu_job *job, +					   struct amdgpu_ib *ib) +{ +	uint32_t msg_lo = 0, msg_hi = 0; +	int i, r; + +	if (!(ib->flags & AMDGPU_IB_FLAGS_SECURE)) +		return 0; + +	for (i = 0; i < ib->length_dw; i += 2) { +		uint32_t reg = amdgpu_ib_get_value(ib, i); +		uint32_t val = amdgpu_ib_get_value(ib, i + 1); + +		if (reg == PACKET0(p->adev->vcn.internal.data0, 0)) { +			msg_lo = val; +		} else if (reg == PACKET0(p->adev->vcn.internal.data1, 0)) { +			msg_hi = val; +		} else if (reg == PACKET0(p->adev->vcn.internal.cmd, 0)) { +			r = vcn_v1_0_validate_bo(p, job, +						 ((u64)msg_hi) << 32 | msg_lo); +			if (r) +				return r; +		} +	} + +	return 0; +} +  static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {  	.type = AMDGPU_RING_TYPE_VCN_DEC,  	.align_mask = 0xf, @@ -1910,6 +1980,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {  	.get_rptr = vcn_v1_0_dec_ring_get_rptr,  	.get_wptr = vcn_v1_0_dec_ring_get_wptr,  	.set_wptr = vcn_v1_0_dec_ring_set_wptr, +	.patch_cs_in_place = vcn_v1_0_ring_patch_cs_in_place,  	.emit_frame_size =  		6 + 6 + /* hdp invalidate / flush */  		SOC15_FLUSH_GPU_TLB_NUM_WREG * 6 + diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c index c87263ed20ec..cb5f0a12333f 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c @@ -219,6 +219,11 @@ static int vcn_v3_0_sw_init(void *handle)  					     cpu_to_le32(AMDGPU_VCN_MULTI_QUEUE_FLAG) |  					     cpu_to_le32(AMDGPU_VCN_FW_SHARED_FLAG_0_RB);  		fw_shared->sw_ring.is_enabled = cpu_to_le32(DEC_SW_RING_ENABLED); +		fw_shared->present_flag_0 |= AMDGPU_VCN_SMU_VERSION_INFO_FLAG; +		if (adev->ip_versions[UVD_HWIP][0] == IP_VERSION(3, 1, 2)) +			fw_shared->smu_interface_info.smu_interface_type = 2; +		else if (adev->ip_versions[UVD_HWIP][0] == IP_VERSION(3, 1, 1)) +			fw_shared->smu_interface_info.smu_interface_type = 1;  		if (amdgpu_vcnfw_log)  			amdgpu_vcn_fwlog_init(&adev->vcn.inst[i]); @@ -575,8 +580,8 @@ static void vcn_v3_0_mc_resume_dpg_mode(struct amdgpu_device *adev, int inst_idx  			AMDGPU_GPU_PAGE_ALIGN(sizeof(struct amdgpu_fw_shared)), 0, indirect);  	/* VCN global tiling registers */ -	WREG32_SOC15_DPG_MODE(0, SOC15_DPG_MODE_OFFSET( -		UVD, 0, mmUVD_GFX10_ADDR_CONFIG), adev->gfx.config.gb_addr_config, 0, indirect); +	WREG32_SOC15_DPG_MODE(inst_idx, SOC15_DPG_MODE_OFFSET( +		UVD, inst_idx, mmUVD_GFX10_ADDR_CONFIG), adev->gfx.config.gb_addr_config, 0, indirect);  }  static void vcn_v3_0_disable_static_power_gating(struct amdgpu_device *adev, int inst) @@ -1480,8 +1485,11 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device *adev)  static int vcn_v3_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)  { +	struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__UNPAUSE};  	uint32_t tmp; +	vcn_v3_0_pause_dpg_mode(adev, inst_idx, &state); +  	/* Wait for power status to be 1 */  	SOC15_WAIT_ON_RREG(VCN, inst_idx, mmUVD_POWER_STATUS, 1,  		UVD_POWER_STATUS__UVD_POWER_STATUS_MASK); |