Merge tag 'amd-drm-fixes-6.0-2022-08-17' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.0-2022-08-17: amdgpu: - Revert some DML stack changes - Rounding fixes in KFD allocations - atombios vram info table parsing fix - DCN 3.1.4 fixes - Clockgating fixes for various new IPs - SMU 13.0.4 fixes - DCN 3.1.4 FP fixes - TMDS fixes for YCbCr420 4k modes - DCN 3.2.x fixes - USB 4 fixes - SMU 13.0 fixes - SMU driver unload memory leak fixes - Display orientation fix - Regression fix for generic fbdev conversion - SDMA 6.x fixes - SR-IOV fixes - IH 6.x fixes - Use after free fix in bo list handling - Revert pipe1 support - XGMI hive reset fix amdkfd: - Fix potential crach in kfd_create_indirect_link_prop() Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220818025206.6463-1-alexander.deucher@amd.com
This commit is contained in:
commit
b1fb6b87ed
@ -148,30 +148,22 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
|
|||||||
struct amdgpu_reset_context *reset_context)
|
struct amdgpu_reset_context *reset_context)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
|
struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
|
||||||
|
struct list_head *reset_device_list = reset_context->reset_device_list;
|
||||||
struct amdgpu_device *tmp_adev = NULL;
|
struct amdgpu_device *tmp_adev = NULL;
|
||||||
struct list_head reset_device_list;
|
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
dev_dbg(adev->dev, "aldebaran perform hw reset\n");
|
dev_dbg(adev->dev, "aldebaran perform hw reset\n");
|
||||||
|
|
||||||
|
if (reset_device_list == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2) &&
|
if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2) &&
|
||||||
reset_context->hive == NULL) {
|
reset_context->hive == NULL) {
|
||||||
/* Wrong context, return error */
|
/* Wrong context, return error */
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&reset_device_list);
|
list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
|
||||||
if (reset_context->hive) {
|
|
||||||
list_for_each_entry (tmp_adev,
|
|
||||||
&reset_context->hive->device_list,
|
|
||||||
gmc.xgmi.head)
|
|
||||||
list_add_tail(&tmp_adev->reset_list,
|
|
||||||
&reset_device_list);
|
|
||||||
} else {
|
|
||||||
list_add_tail(&reset_context->reset_req_dev->reset_list,
|
|
||||||
&reset_device_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each_entry (tmp_adev, &reset_device_list, reset_list) {
|
|
||||||
mutex_lock(&tmp_adev->reset_cntl->reset_lock);
|
mutex_lock(&tmp_adev->reset_cntl->reset_lock);
|
||||||
tmp_adev->reset_cntl->active_reset = AMD_RESET_METHOD_MODE2;
|
tmp_adev->reset_cntl->active_reset = AMD_RESET_METHOD_MODE2;
|
||||||
}
|
}
|
||||||
@ -179,7 +171,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
|
|||||||
* Mode2 reset doesn't need any sync between nodes in XGMI hive, instead launch
|
* Mode2 reset doesn't need any sync between nodes in XGMI hive, instead launch
|
||||||
* them together so that they can be completed asynchronously on multiple nodes
|
* them together so that they can be completed asynchronously on multiple nodes
|
||||||
*/
|
*/
|
||||||
list_for_each_entry (tmp_adev, &reset_device_list, reset_list) {
|
list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
|
||||||
/* For XGMI run all resets in parallel to speed up the process */
|
/* For XGMI run all resets in parallel to speed up the process */
|
||||||
if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
|
if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
|
||||||
if (!queue_work(system_unbound_wq,
|
if (!queue_work(system_unbound_wq,
|
||||||
@ -197,7 +189,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
|
|||||||
|
|
||||||
/* For XGMI wait for all resets to complete before proceed */
|
/* For XGMI wait for all resets to complete before proceed */
|
||||||
if (!r) {
|
if (!r) {
|
||||||
list_for_each_entry (tmp_adev, &reset_device_list, reset_list) {
|
list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
|
||||||
if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
|
if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
|
||||||
flush_work(&tmp_adev->reset_cntl->reset_work);
|
flush_work(&tmp_adev->reset_cntl->reset_work);
|
||||||
r = tmp_adev->asic_reset_res;
|
r = tmp_adev->asic_reset_res;
|
||||||
@ -207,7 +199,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list_for_each_entry (tmp_adev, &reset_device_list, reset_list) {
|
list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
|
||||||
mutex_unlock(&tmp_adev->reset_cntl->reset_lock);
|
mutex_unlock(&tmp_adev->reset_cntl->reset_lock);
|
||||||
tmp_adev->reset_cntl->active_reset = AMD_RESET_METHOD_NONE;
|
tmp_adev->reset_cntl->active_reset = AMD_RESET_METHOD_NONE;
|
||||||
}
|
}
|
||||||
@ -339,10 +331,13 @@ static int
|
|||||||
aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl,
|
aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl,
|
||||||
struct amdgpu_reset_context *reset_context)
|
struct amdgpu_reset_context *reset_context)
|
||||||
{
|
{
|
||||||
|
struct list_head *reset_device_list = reset_context->reset_device_list;
|
||||||
struct amdgpu_device *tmp_adev = NULL;
|
struct amdgpu_device *tmp_adev = NULL;
|
||||||
struct list_head reset_device_list;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (reset_device_list == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (reset_context->reset_req_dev->ip_versions[MP1_HWIP][0] ==
|
if (reset_context->reset_req_dev->ip_versions[MP1_HWIP][0] ==
|
||||||
IP_VERSION(13, 0, 2) &&
|
IP_VERSION(13, 0, 2) &&
|
||||||
reset_context->hive == NULL) {
|
reset_context->hive == NULL) {
|
||||||
@ -350,19 +345,7 @@ aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&reset_device_list);
|
list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
|
||||||
if (reset_context->hive) {
|
|
||||||
list_for_each_entry (tmp_adev,
|
|
||||||
&reset_context->hive->device_list,
|
|
||||||
gmc.xgmi.head)
|
|
||||||
list_add_tail(&tmp_adev->reset_list,
|
|
||||||
&reset_device_list);
|
|
||||||
} else {
|
|
||||||
list_add_tail(&reset_context->reset_req_dev->reset_list,
|
|
||||||
&reset_device_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each_entry (tmp_adev, &reset_device_list, reset_list) {
|
|
||||||
dev_info(tmp_adev->dev,
|
dev_info(tmp_adev->dev,
|
||||||
"GPU reset succeeded, trying to resume\n");
|
"GPU reset succeeded, trying to resume\n");
|
||||||
r = aldebaran_mode2_restore_ip(tmp_adev);
|
r = aldebaran_mode2_restore_ip(tmp_adev);
|
||||||
|
@ -317,7 +317,7 @@ enum amdgpu_kiq_irq {
|
|||||||
AMDGPU_CP_KIQ_IRQ_DRIVER0 = 0,
|
AMDGPU_CP_KIQ_IRQ_DRIVER0 = 0,
|
||||||
AMDGPU_CP_KIQ_IRQ_LAST
|
AMDGPU_CP_KIQ_IRQ_LAST
|
||||||
};
|
};
|
||||||
|
#define SRIOV_USEC_TIMEOUT 1200000 /* wait 12 * 100ms for SRIOV */
|
||||||
#define MAX_KIQ_REG_WAIT 5000 /* in usecs, 5ms */
|
#define MAX_KIQ_REG_WAIT 5000 /* in usecs, 5ms */
|
||||||
#define MAX_KIQ_REG_BAILOUT_INTERVAL 5 /* in msecs, 5ms */
|
#define MAX_KIQ_REG_BAILOUT_INTERVAL 5 /* in msecs, 5ms */
|
||||||
#define MAX_KIQ_REG_TRY 1000
|
#define MAX_KIQ_REG_TRY 1000
|
||||||
|
@ -96,6 +96,7 @@ struct amdgpu_amdkfd_fence {
|
|||||||
struct amdgpu_kfd_dev {
|
struct amdgpu_kfd_dev {
|
||||||
struct kfd_dev *dev;
|
struct kfd_dev *dev;
|
||||||
uint64_t vram_used;
|
uint64_t vram_used;
|
||||||
|
uint64_t vram_used_aligned;
|
||||||
bool init_complete;
|
bool init_complete;
|
||||||
struct work_struct reset_work;
|
struct work_struct reset_work;
|
||||||
};
|
};
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
#define AMDGPU_USERPTR_RESTORE_DELAY_MS 1
|
#define AMDGPU_USERPTR_RESTORE_DELAY_MS 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Align VRAM allocations to 2MB to avoid fragmentation caused by 4K allocations in the tail 2MB
|
* Align VRAM availability to 2MB to avoid fragmentation caused by 4K allocations in the tail 2MB
|
||||||
* BO chunk
|
* BO chunk
|
||||||
*/
|
*/
|
||||||
#define VRAM_ALLOCATION_ALIGN (1 << 21)
|
#define VRAM_AVAILABLITY_ALIGN (1 << 21)
|
||||||
|
|
||||||
/* Impose limit on how much memory KFD can use */
|
/* Impose limit on how much memory KFD can use */
|
||||||
static struct {
|
static struct {
|
||||||
@ -149,7 +149,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
|
|||||||
* to avoid fragmentation caused by 4K allocations in the tail
|
* to avoid fragmentation caused by 4K allocations in the tail
|
||||||
* 2M BO chunk.
|
* 2M BO chunk.
|
||||||
*/
|
*/
|
||||||
vram_needed = ALIGN(size, VRAM_ALLOCATION_ALIGN);
|
vram_needed = size;
|
||||||
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
|
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
|
||||||
system_mem_needed = size;
|
system_mem_needed = size;
|
||||||
} else if (!(alloc_flag &
|
} else if (!(alloc_flag &
|
||||||
@ -182,8 +182,10 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
|
|||||||
*/
|
*/
|
||||||
WARN_ONCE(vram_needed && !adev,
|
WARN_ONCE(vram_needed && !adev,
|
||||||
"adev reference can't be null when vram is used");
|
"adev reference can't be null when vram is used");
|
||||||
if (adev)
|
if (adev) {
|
||||||
adev->kfd.vram_used += vram_needed;
|
adev->kfd.vram_used += vram_needed;
|
||||||
|
adev->kfd.vram_used_aligned += ALIGN(vram_needed, VRAM_AVAILABLITY_ALIGN);
|
||||||
|
}
|
||||||
kfd_mem_limit.system_mem_used += system_mem_needed;
|
kfd_mem_limit.system_mem_used += system_mem_needed;
|
||||||
kfd_mem_limit.ttm_mem_used += ttm_mem_needed;
|
kfd_mem_limit.ttm_mem_used += ttm_mem_needed;
|
||||||
|
|
||||||
@ -203,8 +205,10 @@ void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
|
|||||||
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
|
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
|
||||||
WARN_ONCE(!adev,
|
WARN_ONCE(!adev,
|
||||||
"adev reference can't be null when alloc mem flags vram is set");
|
"adev reference can't be null when alloc mem flags vram is set");
|
||||||
if (adev)
|
if (adev) {
|
||||||
adev->kfd.vram_used -= ALIGN(size, VRAM_ALLOCATION_ALIGN);
|
adev->kfd.vram_used -= size;
|
||||||
|
adev->kfd.vram_used_aligned -= ALIGN(size, VRAM_AVAILABLITY_ALIGN);
|
||||||
|
}
|
||||||
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
|
} else if (alloc_flag & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
|
||||||
kfd_mem_limit.system_mem_used -= size;
|
kfd_mem_limit.system_mem_used -= size;
|
||||||
} else if (!(alloc_flag &
|
} else if (!(alloc_flag &
|
||||||
@ -1608,15 +1612,14 @@ size_t amdgpu_amdkfd_get_available_memory(struct amdgpu_device *adev)
|
|||||||
uint64_t reserved_for_pt =
|
uint64_t reserved_for_pt =
|
||||||
ESTIMATE_PT_SIZE(amdgpu_amdkfd_total_mem_size);
|
ESTIMATE_PT_SIZE(amdgpu_amdkfd_total_mem_size);
|
||||||
size_t available;
|
size_t available;
|
||||||
|
|
||||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||||
available = adev->gmc.real_vram_size
|
available = adev->gmc.real_vram_size
|
||||||
- adev->kfd.vram_used
|
- adev->kfd.vram_used_aligned
|
||||||
- atomic64_read(&adev->vram_pin_size)
|
- atomic64_read(&adev->vram_pin_size)
|
||||||
- reserved_for_pt;
|
- reserved_for_pt;
|
||||||
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
||||||
|
|
||||||
return ALIGN_DOWN(available, VRAM_ALLOCATION_ALIGN);
|
return ALIGN_DOWN(available, VRAM_AVAILABLITY_ALIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
|
int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
|
||||||
|
@ -314,7 +314,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
|
|||||||
mem_channel_number = vram_info->v30.channel_num;
|
mem_channel_number = vram_info->v30.channel_num;
|
||||||
mem_channel_width = vram_info->v30.channel_width;
|
mem_channel_width = vram_info->v30.channel_width;
|
||||||
if (vram_width)
|
if (vram_width)
|
||||||
*vram_width = mem_channel_number * mem_channel_width;
|
*vram_width = mem_channel_number * (1 << mem_channel_width);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -837,17 +837,13 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
r = amdgpu_vm_bo_update(adev, bo_va, false);
|
r = amdgpu_vm_bo_update(adev, bo_va, false);
|
||||||
if (r) {
|
if (r)
|
||||||
mutex_unlock(&p->bo_list->bo_list_mutex);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
|
||||||
|
|
||||||
r = amdgpu_sync_fence(&p->job->sync, bo_va->last_pt_update);
|
r = amdgpu_sync_fence(&p->job->sync, bo_va->last_pt_update);
|
||||||
if (r) {
|
if (r)
|
||||||
mutex_unlock(&p->bo_list->bo_list_mutex);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
r = amdgpu_vm_handle_moved(adev, vm);
|
r = amdgpu_vm_handle_moved(adev, vm);
|
||||||
if (r)
|
if (r)
|
||||||
|
@ -1705,7 +1705,7 @@ static ssize_t amdgpu_reset_dump_register_list_write(struct file *f,
|
|||||||
{
|
{
|
||||||
struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private;
|
struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private;
|
||||||
char reg_offset[11];
|
char reg_offset[11];
|
||||||
uint32_t *new, *tmp = NULL;
|
uint32_t *new = NULL, *tmp = NULL;
|
||||||
int ret, i = 0, len = 0;
|
int ret, i = 0, len = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -1747,6 +1747,7 @@ static ssize_t amdgpu_reset_dump_register_list_write(struct file *f,
|
|||||||
ret = size;
|
ret = size;
|
||||||
|
|
||||||
error_free:
|
error_free:
|
||||||
|
if (tmp != new)
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
kfree(new);
|
kfree(new);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -4742,6 +4742,8 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
|
|||||||
tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,
|
tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,
|
||||||
reset_list);
|
reset_list);
|
||||||
amdgpu_reset_reg_dumps(tmp_adev);
|
amdgpu_reset_reg_dumps(tmp_adev);
|
||||||
|
|
||||||
|
reset_context->reset_device_list = device_list_handle;
|
||||||
r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
|
r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
|
||||||
/* If reset handler not implemented, continue; otherwise return */
|
/* If reset handler not implemented, continue; otherwise return */
|
||||||
if (r == -ENOSYS)
|
if (r == -ENOSYS)
|
||||||
|
@ -272,10 +272,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct drm_gpu_scheduler *sched)
|
|||||||
/* Signal all jobs not yet scheduled */
|
/* Signal all jobs not yet scheduled */
|
||||||
for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) {
|
for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) {
|
||||||
struct drm_sched_rq *rq = &sched->sched_rq[i];
|
struct drm_sched_rq *rq = &sched->sched_rq[i];
|
||||||
|
|
||||||
if (!rq)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
spin_lock(&rq->lock);
|
spin_lock(&rq->lock);
|
||||||
list_for_each_entry(s_entity, &rq->entities, list) {
|
list_for_each_entry(s_entity, &rq->entities, list) {
|
||||||
while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
|
while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
|
||||||
|
@ -37,6 +37,7 @@ struct amdgpu_reset_context {
|
|||||||
struct amdgpu_device *reset_req_dev;
|
struct amdgpu_device *reset_req_dev;
|
||||||
struct amdgpu_job *job;
|
struct amdgpu_job *job;
|
||||||
struct amdgpu_hive_info *hive;
|
struct amdgpu_hive_info *hive;
|
||||||
|
struct list_head *reset_device_list;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -637,6 +637,8 @@ struct amdgpu_ttm_tt {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define ttm_to_amdgpu_ttm_tt(ptr) container_of(ptr, struct amdgpu_ttm_tt, ttm)
|
||||||
|
|
||||||
#ifdef CONFIG_DRM_AMDGPU_USERPTR
|
#ifdef CONFIG_DRM_AMDGPU_USERPTR
|
||||||
/*
|
/*
|
||||||
* amdgpu_ttm_tt_get_user_pages - get device accessible pages that back user
|
* amdgpu_ttm_tt_get_user_pages - get device accessible pages that back user
|
||||||
@ -648,7 +650,7 @@ struct amdgpu_ttm_tt {
|
|||||||
int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
|
int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
|
||||||
{
|
{
|
||||||
struct ttm_tt *ttm = bo->tbo.ttm;
|
struct ttm_tt *ttm = bo->tbo.ttm;
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
unsigned long start = gtt->userptr;
|
unsigned long start = gtt->userptr;
|
||||||
struct vm_area_struct *vma;
|
struct vm_area_struct *vma;
|
||||||
struct mm_struct *mm;
|
struct mm_struct *mm;
|
||||||
@ -702,7 +704,7 @@ out_unlock:
|
|||||||
*/
|
*/
|
||||||
bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm)
|
bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
bool r = false;
|
bool r = false;
|
||||||
|
|
||||||
if (!gtt || !gtt->userptr)
|
if (!gtt || !gtt->userptr)
|
||||||
@ -751,7 +753,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_device *bdev,
|
|||||||
struct ttm_tt *ttm)
|
struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
int write = !(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY);
|
int write = !(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY);
|
||||||
enum dma_data_direction direction = write ?
|
enum dma_data_direction direction = write ?
|
||||||
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
||||||
@ -788,7 +790,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_device *bdev,
|
|||||||
struct ttm_tt *ttm)
|
struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
int write = !(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY);
|
int write = !(gtt->userflags & AMDGPU_GEM_USERPTR_READONLY);
|
||||||
enum dma_data_direction direction = write ?
|
enum dma_data_direction direction = write ?
|
||||||
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
|
||||||
@ -822,7 +824,7 @@ static void amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
|
|||||||
{
|
{
|
||||||
struct amdgpu_bo *abo = ttm_to_amdgpu_bo(tbo);
|
struct amdgpu_bo *abo = ttm_to_amdgpu_bo(tbo);
|
||||||
struct ttm_tt *ttm = tbo->ttm;
|
struct ttm_tt *ttm = tbo->ttm;
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
if (amdgpu_bo_encrypted(abo))
|
if (amdgpu_bo_encrypted(abo))
|
||||||
flags |= AMDGPU_PTE_TMZ;
|
flags |= AMDGPU_PTE_TMZ;
|
||||||
@ -860,7 +862,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
|
|||||||
struct ttm_resource *bo_mem)
|
struct ttm_resource *bo_mem)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void*)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -927,7 +929,7 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
|
|||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
||||||
struct ttm_operation_ctx ctx = { false, false };
|
struct ttm_operation_ctx ctx = { false, false };
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)bo->ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(bo->ttm);
|
||||||
struct ttm_placement placement;
|
struct ttm_placement placement;
|
||||||
struct ttm_place placements;
|
struct ttm_place placements;
|
||||||
struct ttm_resource *tmp;
|
struct ttm_resource *tmp;
|
||||||
@ -998,7 +1000,7 @@ static void amdgpu_ttm_backend_unbind(struct ttm_device *bdev,
|
|||||||
struct ttm_tt *ttm)
|
struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
/* if the pages have userptr pinning then clear that first */
|
/* if the pages have userptr pinning then clear that first */
|
||||||
if (gtt->userptr) {
|
if (gtt->userptr) {
|
||||||
@ -1025,7 +1027,7 @@ static void amdgpu_ttm_backend_unbind(struct ttm_device *bdev,
|
|||||||
static void amdgpu_ttm_backend_destroy(struct ttm_device *bdev,
|
static void amdgpu_ttm_backend_destroy(struct ttm_device *bdev,
|
||||||
struct ttm_tt *ttm)
|
struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
if (gtt->usertask)
|
if (gtt->usertask)
|
||||||
put_task_struct(gtt->usertask);
|
put_task_struct(gtt->usertask);
|
||||||
@ -1079,7 +1081,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
|
|||||||
struct ttm_operation_ctx *ctx)
|
struct ttm_operation_ctx *ctx)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
pgoff_t i;
|
pgoff_t i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1113,7 +1115,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
|
|||||||
static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
|
static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
|
||||||
struct ttm_tt *ttm)
|
struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
struct amdgpu_device *adev;
|
struct amdgpu_device *adev;
|
||||||
pgoff_t i;
|
pgoff_t i;
|
||||||
|
|
||||||
@ -1182,7 +1184,7 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_buffer_object *bo,
|
|||||||
/* Set TTM_TT_FLAG_EXTERNAL before populate but after create. */
|
/* Set TTM_TT_FLAG_EXTERNAL before populate but after create. */
|
||||||
bo->ttm->page_flags |= TTM_TT_FLAG_EXTERNAL;
|
bo->ttm->page_flags |= TTM_TT_FLAG_EXTERNAL;
|
||||||
|
|
||||||
gtt = (void *)bo->ttm;
|
gtt = ttm_to_amdgpu_ttm_tt(bo->ttm);
|
||||||
gtt->userptr = addr;
|
gtt->userptr = addr;
|
||||||
gtt->userflags = flags;
|
gtt->userflags = flags;
|
||||||
|
|
||||||
@ -1199,7 +1201,7 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_buffer_object *bo,
|
|||||||
*/
|
*/
|
||||||
struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm)
|
struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
if (gtt == NULL)
|
if (gtt == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1218,7 +1220,7 @@ struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm)
|
|||||||
bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start,
|
bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start,
|
||||||
unsigned long end, unsigned long *userptr)
|
unsigned long end, unsigned long *userptr)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
|
|
||||||
if (gtt == NULL || !gtt->userptr)
|
if (gtt == NULL || !gtt->userptr)
|
||||||
@ -1241,7 +1243,7 @@ bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start,
|
|||||||
*/
|
*/
|
||||||
bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm)
|
bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
if (gtt == NULL || !gtt->userptr)
|
if (gtt == NULL || !gtt->userptr)
|
||||||
return false;
|
return false;
|
||||||
@ -1254,7 +1256,7 @@ bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm)
|
|||||||
*/
|
*/
|
||||||
bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm)
|
bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
|
||||||
|
|
||||||
if (gtt == NULL)
|
if (gtt == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
@ -496,8 +496,7 @@ static int amdgpu_vkms_sw_init(void *handle)
|
|||||||
adev_to_drm(adev)->mode_config.max_height = YRES_MAX;
|
adev_to_drm(adev)->mode_config.max_height = YRES_MAX;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
|
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
|
||||||
|
|
||||||
|
@ -28,13 +28,44 @@
|
|||||||
#include "navi10_enum.h"
|
#include "navi10_enum.h"
|
||||||
#include "soc15_common.h"
|
#include "soc15_common.h"
|
||||||
|
|
||||||
|
#define regATHUB_MISC_CNTL_V3_0_1 0x00d7
|
||||||
|
#define regATHUB_MISC_CNTL_V3_0_1_BASE_IDX 0
|
||||||
|
|
||||||
|
|
||||||
|
static uint32_t athub_v3_0_get_cg_cntl(struct amdgpu_device *adev)
|
||||||
|
{
|
||||||
|
uint32_t data;
|
||||||
|
|
||||||
|
switch (adev->ip_versions[ATHUB_HWIP][0]) {
|
||||||
|
case IP_VERSION(3, 0, 1):
|
||||||
|
data = RREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL_V3_0_1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
data = RREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void athub_v3_0_set_cg_cntl(struct amdgpu_device *adev, uint32_t data)
|
||||||
|
{
|
||||||
|
switch (adev->ip_versions[ATHUB_HWIP][0]) {
|
||||||
|
case IP_VERSION(3, 0, 1):
|
||||||
|
WREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL_V3_0_1, data);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL, data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
athub_v3_0_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
athub_v3_0_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
uint32_t def, data;
|
uint32_t def, data;
|
||||||
|
|
||||||
def = data = RREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL);
|
def = data = athub_v3_0_get_cg_cntl(adev);
|
||||||
|
|
||||||
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_ATHUB_MGCG))
|
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_ATHUB_MGCG))
|
||||||
data |= ATHUB_MISC_CNTL__CG_ENABLE_MASK;
|
data |= ATHUB_MISC_CNTL__CG_ENABLE_MASK;
|
||||||
@ -42,7 +73,7 @@ athub_v3_0_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
|||||||
data &= ~ATHUB_MISC_CNTL__CG_ENABLE_MASK;
|
data &= ~ATHUB_MISC_CNTL__CG_ENABLE_MASK;
|
||||||
|
|
||||||
if (def != data)
|
if (def != data)
|
||||||
WREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL, data);
|
athub_v3_0_set_cg_cntl(adev, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -51,7 +82,7 @@ athub_v3_0_update_medium_grain_light_sleep(struct amdgpu_device *adev,
|
|||||||
{
|
{
|
||||||
uint32_t def, data;
|
uint32_t def, data;
|
||||||
|
|
||||||
def = data = RREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL);
|
def = data = athub_v3_0_get_cg_cntl(adev);
|
||||||
|
|
||||||
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_ATHUB_LS))
|
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_ATHUB_LS))
|
||||||
data |= ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;
|
data |= ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;
|
||||||
@ -59,7 +90,7 @@ athub_v3_0_update_medium_grain_light_sleep(struct amdgpu_device *adev,
|
|||||||
data &= ~ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;
|
data &= ~ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;
|
||||||
|
|
||||||
if (def != data)
|
if (def != data)
|
||||||
WREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL, data);
|
athub_v3_0_set_cg_cntl(adev, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int athub_v3_0_set_clockgating(struct amdgpu_device *adev,
|
int athub_v3_0_set_clockgating(struct amdgpu_device *adev,
|
||||||
@ -70,6 +101,7 @@ int athub_v3_0_set_clockgating(struct amdgpu_device *adev,
|
|||||||
|
|
||||||
switch (adev->ip_versions[ATHUB_HWIP][0]) {
|
switch (adev->ip_versions[ATHUB_HWIP][0]) {
|
||||||
case IP_VERSION(3, 0, 0):
|
case IP_VERSION(3, 0, 0):
|
||||||
|
case IP_VERSION(3, 0, 1):
|
||||||
case IP_VERSION(3, 0, 2):
|
case IP_VERSION(3, 0, 2):
|
||||||
athub_v3_0_update_medium_grain_clock_gating(adev,
|
athub_v3_0_update_medium_grain_clock_gating(adev,
|
||||||
state == AMD_CG_STATE_GATE);
|
state == AMD_CG_STATE_GATE);
|
||||||
@ -88,7 +120,7 @@ void athub_v3_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
|
|||||||
int data;
|
int data;
|
||||||
|
|
||||||
/* AMD_CG_SUPPORT_ATHUB_MGCG */
|
/* AMD_CG_SUPPORT_ATHUB_MGCG */
|
||||||
data = RREG32_SOC15(ATHUB, 0, regATHUB_MISC_CNTL);
|
data = athub_v3_0_get_cg_cntl(adev);
|
||||||
if (data & ATHUB_MISC_CNTL__CG_ENABLE_MASK)
|
if (data & ATHUB_MISC_CNTL__CG_ENABLE_MASK)
|
||||||
*flags |= AMD_CG_SUPPORT_ATHUB_MGCG;
|
*flags |= AMD_CG_SUPPORT_ATHUB_MGCG;
|
||||||
|
|
||||||
|
@ -2796,8 +2796,7 @@ static int dce_v10_0_sw_init(void *handle)
|
|||||||
adev_to_drm(adev)->mode_config.max_height = 16384;
|
adev_to_drm(adev)->mode_config.max_height = 16384;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
||||||
|
|
||||||
|
@ -2914,8 +2914,7 @@ static int dce_v11_0_sw_init(void *handle)
|
|||||||
adev_to_drm(adev)->mode_config.max_height = 16384;
|
adev_to_drm(adev)->mode_config.max_height = 16384;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
||||||
|
|
||||||
|
@ -2673,8 +2673,7 @@ static int dce_v6_0_sw_init(void *handle)
|
|||||||
adev_to_drm(adev)->mode_config.max_width = 16384;
|
adev_to_drm(adev)->mode_config.max_width = 16384;
|
||||||
adev_to_drm(adev)->mode_config.max_height = 16384;
|
adev_to_drm(adev)->mode_config.max_height = 16384;
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
|
||||||
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
||||||
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
|
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
|
||||||
|
|
||||||
|
@ -2693,8 +2693,11 @@ static int dce_v8_0_sw_init(void *handle)
|
|||||||
adev_to_drm(adev)->mode_config.max_height = 16384;
|
adev_to_drm(adev)->mode_config.max_height = 16384;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
|
if (adev->asic_type == CHIP_HAWAII)
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
/* disable prefer shadow for now due to hibernation issues */
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
||||||
|
else
|
||||||
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
|
||||||
|
|
||||||
|
@ -4846,7 +4846,7 @@ static int gfx_v10_0_sw_init(void *handle)
|
|||||||
case IP_VERSION(10, 3, 3):
|
case IP_VERSION(10, 3, 3):
|
||||||
case IP_VERSION(10, 3, 7):
|
case IP_VERSION(10, 3, 7):
|
||||||
adev->gfx.me.num_me = 1;
|
adev->gfx.me.num_me = 1;
|
||||||
adev->gfx.me.num_pipe_per_me = 2;
|
adev->gfx.me.num_pipe_per_me = 1;
|
||||||
adev->gfx.me.num_queue_per_pipe = 1;
|
adev->gfx.me.num_queue_per_pipe = 1;
|
||||||
adev->gfx.mec.num_mec = 2;
|
adev->gfx.mec.num_mec = 2;
|
||||||
adev->gfx.mec.num_pipe_per_mec = 4;
|
adev->gfx.mec.num_pipe_per_mec = 4;
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#define GFX11_MEC_HPD_SIZE 2048
|
#define GFX11_MEC_HPD_SIZE 2048
|
||||||
|
|
||||||
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
|
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
|
||||||
|
#define RLC_PG_DELAY_3_DEFAULT_GC_11_0_1 0x1388
|
||||||
|
|
||||||
#define regCGTT_WD_CLK_CTRL 0x5086
|
#define regCGTT_WD_CLK_CTRL 0x5086
|
||||||
#define regCGTT_WD_CLK_CTRL_BASE_IDX 1
|
#define regCGTT_WD_CLK_CTRL_BASE_IDX 1
|
||||||
@ -5279,6 +5280,38 @@ static const struct amdgpu_rlc_funcs gfx_v11_0_rlc_funcs = {
|
|||||||
.update_spm_vmid = gfx_v11_0_update_spm_vmid,
|
.update_spm_vmid = gfx_v11_0_update_spm_vmid,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void gfx_v11_cntl_power_gating(struct amdgpu_device *adev, bool enable)
|
||||||
|
{
|
||||||
|
u32 data = RREG32_SOC15(GC, 0, regRLC_PG_CNTL);
|
||||||
|
|
||||||
|
if (enable && (adev->pg_flags & AMD_PG_SUPPORT_GFX_PG))
|
||||||
|
data |= RLC_PG_CNTL__GFX_POWER_GATING_ENABLE_MASK;
|
||||||
|
else
|
||||||
|
data &= ~RLC_PG_CNTL__GFX_POWER_GATING_ENABLE_MASK;
|
||||||
|
|
||||||
|
WREG32_SOC15(GC, 0, regRLC_PG_CNTL, data);
|
||||||
|
|
||||||
|
// Program RLC_PG_DELAY3 for CGPG hysteresis
|
||||||
|
if (enable && (adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) {
|
||||||
|
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||||
|
case IP_VERSION(11, 0, 1):
|
||||||
|
WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gfx_v11_cntl_pg(struct amdgpu_device *adev, bool enable)
|
||||||
|
{
|
||||||
|
amdgpu_gfx_rlc_enter_safe_mode(adev);
|
||||||
|
|
||||||
|
gfx_v11_cntl_power_gating(adev, enable);
|
||||||
|
|
||||||
|
amdgpu_gfx_rlc_exit_safe_mode(adev);
|
||||||
|
}
|
||||||
|
|
||||||
static int gfx_v11_0_set_powergating_state(void *handle,
|
static int gfx_v11_0_set_powergating_state(void *handle,
|
||||||
enum amd_powergating_state state)
|
enum amd_powergating_state state)
|
||||||
{
|
{
|
||||||
@ -5293,6 +5326,11 @@ static int gfx_v11_0_set_powergating_state(void *handle,
|
|||||||
case IP_VERSION(11, 0, 2):
|
case IP_VERSION(11, 0, 2):
|
||||||
amdgpu_gfx_off_ctrl(adev, enable);
|
amdgpu_gfx_off_ctrl(adev, enable);
|
||||||
break;
|
break;
|
||||||
|
case IP_VERSION(11, 0, 1):
|
||||||
|
gfx_v11_cntl_pg(adev, enable);
|
||||||
|
/* TODO: Enable this when GFXOFF is ready */
|
||||||
|
// amdgpu_gfx_off_ctrl(adev, enable);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5310,6 +5348,7 @@ static int gfx_v11_0_set_clockgating_state(void *handle,
|
|||||||
|
|
||||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||||
case IP_VERSION(11, 0, 0):
|
case IP_VERSION(11, 0, 0):
|
||||||
|
case IP_VERSION(11, 0, 1):
|
||||||
case IP_VERSION(11, 0, 2):
|
case IP_VERSION(11, 0, 2):
|
||||||
gfx_v11_0_update_gfx_clock_gating(adev,
|
gfx_v11_0_update_gfx_clock_gating(adev,
|
||||||
state == AMD_CG_STATE_GATE);
|
state == AMD_CG_STATE_GATE);
|
||||||
|
@ -419,6 +419,7 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
|
|||||||
uint32_t seq;
|
uint32_t seq;
|
||||||
uint16_t queried_pasid;
|
uint16_t queried_pasid;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
u32 usec_timeout = amdgpu_sriov_vf(adev) ? SRIOV_USEC_TIMEOUT : adev->usec_timeout;
|
||||||
struct amdgpu_ring *ring = &adev->gfx.kiq.ring;
|
struct amdgpu_ring *ring = &adev->gfx.kiq.ring;
|
||||||
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
|
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
|
||||||
|
|
||||||
@ -437,7 +438,7 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
|
|||||||
|
|
||||||
amdgpu_ring_commit(ring);
|
amdgpu_ring_commit(ring);
|
||||||
spin_unlock(&adev->gfx.kiq.ring_lock);
|
spin_unlock(&adev->gfx.kiq.ring_lock);
|
||||||
r = amdgpu_fence_wait_polling(ring, seq, adev->usec_timeout);
|
r = amdgpu_fence_wait_polling(ring, seq, usec_timeout);
|
||||||
if (r < 1) {
|
if (r < 1) {
|
||||||
dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r);
|
dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r);
|
||||||
return -ETIME;
|
return -ETIME;
|
||||||
|
@ -896,6 +896,7 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
|
|||||||
uint32_t seq;
|
uint32_t seq;
|
||||||
uint16_t queried_pasid;
|
uint16_t queried_pasid;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
u32 usec_timeout = amdgpu_sriov_vf(adev) ? SRIOV_USEC_TIMEOUT : adev->usec_timeout;
|
||||||
struct amdgpu_ring *ring = &adev->gfx.kiq.ring;
|
struct amdgpu_ring *ring = &adev->gfx.kiq.ring;
|
||||||
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
|
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
|
||||||
|
|
||||||
@ -935,7 +936,7 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
|
|||||||
|
|
||||||
amdgpu_ring_commit(ring);
|
amdgpu_ring_commit(ring);
|
||||||
spin_unlock(&adev->gfx.kiq.ring_lock);
|
spin_unlock(&adev->gfx.kiq.ring_lock);
|
||||||
r = amdgpu_fence_wait_polling(ring, seq, adev->usec_timeout);
|
r = amdgpu_fence_wait_polling(ring, seq, usec_timeout);
|
||||||
if (r < 1) {
|
if (r < 1) {
|
||||||
dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r);
|
dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r);
|
||||||
up_read(&adev->reset_domain->sem);
|
up_read(&adev->reset_domain->sem);
|
||||||
@ -1624,12 +1625,15 @@ static int gmc_v9_0_sw_init(void *handle)
|
|||||||
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 47);
|
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 47);
|
||||||
else
|
else
|
||||||
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 48);
|
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 48);
|
||||||
|
if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 2))
|
||||||
|
adev->gmc.translate_further = adev->vm_manager.num_level > 1;
|
||||||
break;
|
break;
|
||||||
case IP_VERSION(9, 4, 1):
|
case IP_VERSION(9, 4, 1):
|
||||||
adev->num_vmhubs = 3;
|
adev->num_vmhubs = 3;
|
||||||
|
|
||||||
/* Keep the vm size same with Vega20 */
|
/* Keep the vm size same with Vega20 */
|
||||||
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 48);
|
amdgpu_vm_adjust_size(adev, 256 * 1024, 9, 3, 48);
|
||||||
|
adev->gmc.translate_further = adev->vm_manager.num_level > 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -40,6 +40,156 @@ static void hdp_v5_2_flush_hdp(struct amdgpu_device *adev,
|
|||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void hdp_v5_2_update_mem_power_gating(struct amdgpu_device *adev,
|
||||||
|
bool enable)
|
||||||
|
{
|
||||||
|
uint32_t hdp_clk_cntl;
|
||||||
|
uint32_t hdp_mem_pwr_cntl;
|
||||||
|
|
||||||
|
if (!(adev->cg_flags & (AMD_CG_SUPPORT_HDP_LS |
|
||||||
|
AMD_CG_SUPPORT_HDP_DS |
|
||||||
|
AMD_CG_SUPPORT_HDP_SD)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL);
|
||||||
|
hdp_mem_pwr_cntl = RREG32_SOC15(HDP, 0, regHDP_MEM_POWER_CTRL);
|
||||||
|
|
||||||
|
/* Before doing clock/power mode switch, forced on MEM clock */
|
||||||
|
hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
|
||||||
|
ATOMIC_MEM_CLK_SOFT_OVERRIDE, 1);
|
||||||
|
hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
|
||||||
|
RC_MEM_CLK_SOFT_OVERRIDE, 1);
|
||||||
|
WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
|
||||||
|
|
||||||
|
/* disable clock and power gating before any changing */
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_CTRL_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_LS_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_DS_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_SD_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_CTRL_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_LS_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_DS_EN, 0);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_SD_EN, 0);
|
||||||
|
WREG32_SOC15(HDP, 0, regHDP_MEM_POWER_CTRL, hdp_mem_pwr_cntl);
|
||||||
|
|
||||||
|
/* Already disabled above. The actions below are for "enabled" only */
|
||||||
|
if (enable) {
|
||||||
|
/* only one clock gating mode (LS/DS/SD) can be enabled */
|
||||||
|
if (adev->cg_flags & AMD_CG_SUPPORT_HDP_SD) {
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_SD_EN, 1);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_SD_EN, 1);
|
||||||
|
} else if (adev->cg_flags & AMD_CG_SUPPORT_HDP_LS) {
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_LS_EN, 1);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_LS_EN, 1);
|
||||||
|
} else if (adev->cg_flags & AMD_CG_SUPPORT_HDP_DS) {
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_DS_EN, 1);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl,
|
||||||
|
HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_DS_EN, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* confirmed that ATOMIC/RC_MEM_POWER_CTRL_EN have to be set for SRAM LS/DS/SD */
|
||||||
|
if (adev->cg_flags & (AMD_CG_SUPPORT_HDP_LS | AMD_CG_SUPPORT_HDP_DS |
|
||||||
|
AMD_CG_SUPPORT_HDP_SD)) {
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
ATOMIC_MEM_POWER_CTRL_EN, 1);
|
||||||
|
hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
|
||||||
|
RC_MEM_POWER_CTRL_EN, 1);
|
||||||
|
WREG32_SOC15(HDP, 0, regHDP_MEM_POWER_CTRL, hdp_mem_pwr_cntl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* disable MEM clock override after clock/power mode changing */
|
||||||
|
hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
|
||||||
|
ATOMIC_MEM_CLK_SOFT_OVERRIDE, 0);
|
||||||
|
hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
|
||||||
|
RC_MEM_CLK_SOFT_OVERRIDE, 0);
|
||||||
|
WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hdp_v5_2_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
||||||
|
bool enable)
|
||||||
|
{
|
||||||
|
uint32_t hdp_clk_cntl;
|
||||||
|
|
||||||
|
if (!(adev->cg_flags & AMD_CG_SUPPORT_HDP_MGCG))
|
||||||
|
return;
|
||||||
|
|
||||||
|
hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL);
|
||||||
|
|
||||||
|
if (enable) {
|
||||||
|
hdp_clk_cntl &=
|
||||||
|
~(uint32_t)
|
||||||
|
(HDP_CLK_CNTL__ATOMIC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__RC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DBUS_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DYN_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__XDP_REG_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__HDP_REG_CLK_SOFT_OVERRIDE_MASK);
|
||||||
|
} else {
|
||||||
|
hdp_clk_cntl |= HDP_CLK_CNTL__ATOMIC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__RC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DBUS_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DYN_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__XDP_REG_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__HDP_REG_CLK_SOFT_OVERRIDE_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hdp_v5_2_get_clockgating_state(struct amdgpu_device *adev,
|
||||||
|
u64 *flags)
|
||||||
|
{
|
||||||
|
uint32_t tmp;
|
||||||
|
|
||||||
|
/* AMD_CG_SUPPORT_HDP_MGCG */
|
||||||
|
tmp = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL);
|
||||||
|
if (!(tmp & (HDP_CLK_CNTL__ATOMIC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__RC_MEM_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DBUS_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__DYN_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__XDP_REG_CLK_SOFT_OVERRIDE_MASK |
|
||||||
|
HDP_CLK_CNTL__HDP_REG_CLK_SOFT_OVERRIDE_MASK)))
|
||||||
|
*flags |= AMD_CG_SUPPORT_HDP_MGCG;
|
||||||
|
|
||||||
|
/* AMD_CG_SUPPORT_HDP_LS/DS/SD */
|
||||||
|
tmp = RREG32_SOC15(HDP, 0, regHDP_MEM_POWER_CTRL);
|
||||||
|
if (tmp & HDP_MEM_POWER_CTRL__ATOMIC_MEM_POWER_LS_EN_MASK)
|
||||||
|
*flags |= AMD_CG_SUPPORT_HDP_LS;
|
||||||
|
else if (tmp & HDP_MEM_POWER_CTRL__ATOMIC_MEM_POWER_DS_EN_MASK)
|
||||||
|
*flags |= AMD_CG_SUPPORT_HDP_DS;
|
||||||
|
else if (tmp & HDP_MEM_POWER_CTRL__ATOMIC_MEM_POWER_SD_EN_MASK)
|
||||||
|
*flags |= AMD_CG_SUPPORT_HDP_SD;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hdp_v5_2_update_clock_gating(struct amdgpu_device *adev,
|
||||||
|
bool enable)
|
||||||
|
{
|
||||||
|
hdp_v5_2_update_mem_power_gating(adev, enable);
|
||||||
|
hdp_v5_2_update_medium_grain_clock_gating(adev, enable);
|
||||||
|
}
|
||||||
|
|
||||||
const struct amdgpu_hdp_funcs hdp_v5_2_funcs = {
|
const struct amdgpu_hdp_funcs hdp_v5_2_funcs = {
|
||||||
.flush_hdp = hdp_v5_2_flush_hdp,
|
.flush_hdp = hdp_v5_2_flush_hdp,
|
||||||
|
.update_clock_gating = hdp_v5_2_update_clock_gating,
|
||||||
|
.get_clock_gating_state = hdp_v5_2_get_clockgating_state,
|
||||||
};
|
};
|
||||||
|
@ -727,6 +727,7 @@ static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
|
|||||||
static const struct amdgpu_ih_funcs ih_v6_0_funcs = {
|
static const struct amdgpu_ih_funcs ih_v6_0_funcs = {
|
||||||
.get_wptr = ih_v6_0_get_wptr,
|
.get_wptr = ih_v6_0_get_wptr,
|
||||||
.decode_iv = amdgpu_ih_decode_iv_helper,
|
.decode_iv = amdgpu_ih_decode_iv_helper,
|
||||||
|
.decode_iv_ts = amdgpu_ih_decode_iv_ts_helper,
|
||||||
.set_rptr = ih_v6_0_set_rptr
|
.set_rptr = ih_v6_0_set_rptr
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -518,18 +518,41 @@ static u64 mmhub_v3_0_1_get_mc_fb_offset(struct amdgpu_device *adev)
|
|||||||
static void mmhub_v3_0_1_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
static void mmhub_v3_0_1_update_medium_grain_clock_gating(struct amdgpu_device *adev,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
//TODO
|
uint32_t def, data;
|
||||||
|
|
||||||
|
def = data = RREG32_SOC15(MMHUB, 0, regMM_ATC_L2_MISC_CG);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
data |= MM_ATC_L2_MISC_CG__ENABLE_MASK;
|
||||||
|
else
|
||||||
|
data &= ~MM_ATC_L2_MISC_CG__ENABLE_MASK;
|
||||||
|
|
||||||
|
if (def != data)
|
||||||
|
WREG32_SOC15(MMHUB, 0, regMM_ATC_L2_MISC_CG, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mmhub_v3_0_1_update_medium_grain_light_sleep(struct amdgpu_device *adev,
|
static void mmhub_v3_0_1_update_medium_grain_light_sleep(struct amdgpu_device *adev,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
//TODO
|
uint32_t def, data;
|
||||||
|
|
||||||
|
def = data = RREG32_SOC15(MMHUB, 0, regMM_ATC_L2_MISC_CG);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
data |= MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
|
||||||
|
else
|
||||||
|
data &= ~MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
|
||||||
|
|
||||||
|
if (def != data)
|
||||||
|
WREG32_SOC15(MMHUB, 0, regMM_ATC_L2_MISC_CG, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mmhub_v3_0_1_set_clockgating(struct amdgpu_device *adev,
|
static int mmhub_v3_0_1_set_clockgating(struct amdgpu_device *adev,
|
||||||
enum amd_clockgating_state state)
|
enum amd_clockgating_state state)
|
||||||
{
|
{
|
||||||
|
if (amdgpu_sriov_vf(adev))
|
||||||
|
return 0;
|
||||||
|
|
||||||
mmhub_v3_0_1_update_medium_grain_clock_gating(adev,
|
mmhub_v3_0_1_update_medium_grain_clock_gating(adev,
|
||||||
state == AMD_CG_STATE_GATE);
|
state == AMD_CG_STATE_GATE);
|
||||||
mmhub_v3_0_1_update_medium_grain_light_sleep(adev,
|
mmhub_v3_0_1_update_medium_grain_light_sleep(adev,
|
||||||
@ -539,7 +562,20 @@ static int mmhub_v3_0_1_set_clockgating(struct amdgpu_device *adev,
|
|||||||
|
|
||||||
static void mmhub_v3_0_1_get_clockgating(struct amdgpu_device *adev, u64 *flags)
|
static void mmhub_v3_0_1_get_clockgating(struct amdgpu_device *adev, u64 *flags)
|
||||||
{
|
{
|
||||||
//TODO
|
int data;
|
||||||
|
|
||||||
|
if (amdgpu_sriov_vf(adev))
|
||||||
|
*flags = 0;
|
||||||
|
|
||||||
|
data = RREG32_SOC15(MMHUB, 0, regMM_ATC_L2_MISC_CG);
|
||||||
|
|
||||||
|
/* AMD_CG_SUPPORT_MC_MGCG */
|
||||||
|
if (data & MM_ATC_L2_MISC_CG__ENABLE_MASK)
|
||||||
|
*flags |= AMD_CG_SUPPORT_MC_MGCG;
|
||||||
|
|
||||||
|
/* AMD_CG_SUPPORT_MC_LS */
|
||||||
|
if (data & MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK)
|
||||||
|
*flags |= AMD_CG_SUPPORT_MC_LS;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct amdgpu_mmhub_funcs mmhub_v3_0_1_funcs = {
|
const struct amdgpu_mmhub_funcs mmhub_v3_0_1_funcs = {
|
||||||
|
@ -409,9 +409,11 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
|
|||||||
u32 wptr, tmp;
|
u32 wptr, tmp;
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
if (ih == &adev->irq.ih) {
|
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
|
||||||
/* Only ring0 supports writeback. On other rings fall back
|
/* Only ring0 supports writeback. On other rings fall back
|
||||||
* to register-based code with overflow checking below.
|
* to register-based code with overflow checking below.
|
||||||
|
* ih_soft ring doesn't have any backing hardware registers,
|
||||||
|
* update wptr and return.
|
||||||
*/
|
*/
|
||||||
wptr = le32_to_cpu(*ih->wptr_cpu);
|
wptr = le32_to_cpu(*ih->wptr_cpu);
|
||||||
|
|
||||||
@ -483,6 +485,9 @@ static void navi10_ih_set_rptr(struct amdgpu_device *adev,
|
|||||||
{
|
{
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
|
if (ih == &adev->irq.ih_soft)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ih->use_doorbell) {
|
if (ih->use_doorbell) {
|
||||||
/* XXX check if swapping is necessary on BE */
|
/* XXX check if swapping is necessary on BE */
|
||||||
*ih->rptr_cpu = ih->rptr;
|
*ih->rptr_cpu = ih->rptr;
|
||||||
|
@ -101,6 +101,16 @@ static int psp_v12_0_init_microcode(struct psp_context *psp)
|
|||||||
adev->psp.dtm_context.context.bin_desc.start_addr =
|
adev->psp.dtm_context.context.bin_desc.start_addr =
|
||||||
(uint8_t *)adev->psp.hdcp_context.context.bin_desc.start_addr +
|
(uint8_t *)adev->psp.hdcp_context.context.bin_desc.start_addr +
|
||||||
le32_to_cpu(ta_hdr->dtm.offset_bytes);
|
le32_to_cpu(ta_hdr->dtm.offset_bytes);
|
||||||
|
|
||||||
|
if (adev->apu_flags & AMD_APU_IS_RENOIR) {
|
||||||
|
adev->psp.securedisplay_context.context.bin_desc.fw_version =
|
||||||
|
le32_to_cpu(ta_hdr->securedisplay.fw_version);
|
||||||
|
adev->psp.securedisplay_context.context.bin_desc.size_bytes =
|
||||||
|
le32_to_cpu(ta_hdr->securedisplay.size_bytes);
|
||||||
|
adev->psp.securedisplay_context.context.bin_desc.start_addr =
|
||||||
|
(uint8_t *)adev->psp.hdcp_context.context.bin_desc.start_addr +
|
||||||
|
le32_to_cpu(ta_hdr->securedisplay.offset_bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/dev_printk.h>
|
|
||||||
#include <drm/drm_drv.h>
|
#include <drm/drm_drv.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
|
@ -546,8 +546,10 @@ static int soc21_common_early_init(void *handle)
|
|||||||
case IP_VERSION(11, 0, 0):
|
case IP_VERSION(11, 0, 0):
|
||||||
adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG |
|
adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG |
|
||||||
AMD_CG_SUPPORT_GFX_CGLS |
|
AMD_CG_SUPPORT_GFX_CGLS |
|
||||||
|
#if 0
|
||||||
AMD_CG_SUPPORT_GFX_3D_CGCG |
|
AMD_CG_SUPPORT_GFX_3D_CGCG |
|
||||||
AMD_CG_SUPPORT_GFX_3D_CGLS |
|
AMD_CG_SUPPORT_GFX_3D_CGLS |
|
||||||
|
#endif
|
||||||
AMD_CG_SUPPORT_GFX_MGCG |
|
AMD_CG_SUPPORT_GFX_MGCG |
|
||||||
AMD_CG_SUPPORT_REPEATER_FGCG |
|
AMD_CG_SUPPORT_REPEATER_FGCG |
|
||||||
AMD_CG_SUPPORT_GFX_FGCG |
|
AMD_CG_SUPPORT_GFX_FGCG |
|
||||||
@ -575,7 +577,9 @@ static int soc21_common_early_init(void *handle)
|
|||||||
AMD_CG_SUPPORT_VCN_MGCG |
|
AMD_CG_SUPPORT_VCN_MGCG |
|
||||||
AMD_CG_SUPPORT_JPEG_MGCG |
|
AMD_CG_SUPPORT_JPEG_MGCG |
|
||||||
AMD_CG_SUPPORT_ATHUB_MGCG |
|
AMD_CG_SUPPORT_ATHUB_MGCG |
|
||||||
AMD_CG_SUPPORT_ATHUB_LS;
|
AMD_CG_SUPPORT_ATHUB_LS |
|
||||||
|
AMD_CG_SUPPORT_IH_CG |
|
||||||
|
AMD_CG_SUPPORT_HDP_SD;
|
||||||
adev->pg_flags =
|
adev->pg_flags =
|
||||||
AMD_PG_SUPPORT_VCN |
|
AMD_PG_SUPPORT_VCN |
|
||||||
AMD_PG_SUPPORT_VCN_DPG |
|
AMD_PG_SUPPORT_VCN_DPG |
|
||||||
@ -586,9 +590,23 @@ static int soc21_common_early_init(void *handle)
|
|||||||
break;
|
break;
|
||||||
case IP_VERSION(11, 0, 1):
|
case IP_VERSION(11, 0, 1):
|
||||||
adev->cg_flags =
|
adev->cg_flags =
|
||||||
|
AMD_CG_SUPPORT_GFX_CGCG |
|
||||||
|
AMD_CG_SUPPORT_GFX_CGLS |
|
||||||
|
AMD_CG_SUPPORT_GFX_MGCG |
|
||||||
|
AMD_CG_SUPPORT_GFX_FGCG |
|
||||||
|
AMD_CG_SUPPORT_REPEATER_FGCG |
|
||||||
|
AMD_CG_SUPPORT_GFX_PERF_CLK |
|
||||||
|
AMD_CG_SUPPORT_MC_MGCG |
|
||||||
|
AMD_CG_SUPPORT_MC_LS |
|
||||||
|
AMD_CG_SUPPORT_HDP_MGCG |
|
||||||
|
AMD_CG_SUPPORT_HDP_LS |
|
||||||
|
AMD_CG_SUPPORT_ATHUB_MGCG |
|
||||||
|
AMD_CG_SUPPORT_ATHUB_LS |
|
||||||
|
AMD_CG_SUPPORT_IH_CG |
|
||||||
AMD_CG_SUPPORT_VCN_MGCG |
|
AMD_CG_SUPPORT_VCN_MGCG |
|
||||||
AMD_CG_SUPPORT_JPEG_MGCG;
|
AMD_CG_SUPPORT_JPEG_MGCG;
|
||||||
adev->pg_flags =
|
adev->pg_flags =
|
||||||
|
AMD_PG_SUPPORT_GFX_PG |
|
||||||
AMD_PG_SUPPORT_JPEG;
|
AMD_PG_SUPPORT_JPEG;
|
||||||
adev->external_rev_id = adev->rev_id + 0x1;
|
adev->external_rev_id = adev->rev_id + 0x1;
|
||||||
break;
|
break;
|
||||||
@ -683,6 +701,7 @@ static int soc21_common_set_clockgating_state(void *handle,
|
|||||||
|
|
||||||
switch (adev->ip_versions[NBIO_HWIP][0]) {
|
switch (adev->ip_versions[NBIO_HWIP][0]) {
|
||||||
case IP_VERSION(4, 3, 0):
|
case IP_VERSION(4, 3, 0):
|
||||||
|
case IP_VERSION(4, 3, 1):
|
||||||
adev->nbio.funcs->update_medium_grain_clock_gating(adev,
|
adev->nbio.funcs->update_medium_grain_clock_gating(adev,
|
||||||
state == AMD_CG_STATE_GATE);
|
state == AMD_CG_STATE_GATE);
|
||||||
adev->nbio.funcs->update_medium_grain_light_sleep(adev,
|
adev->nbio.funcs->update_medium_grain_light_sleep(adev,
|
||||||
@ -690,6 +709,10 @@ static int soc21_common_set_clockgating_state(void *handle,
|
|||||||
adev->hdp.funcs->update_clock_gating(adev,
|
adev->hdp.funcs->update_clock_gating(adev,
|
||||||
state == AMD_CG_STATE_GATE);
|
state == AMD_CG_STATE_GATE);
|
||||||
break;
|
break;
|
||||||
|
case IP_VERSION(7, 7, 0):
|
||||||
|
adev->hdp.funcs->update_clock_gating(adev,
|
||||||
|
state == AMD_CG_STATE_GATE);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1115,7 +1115,7 @@ static int vcn_v4_0_start(struct amdgpu_device *adev)
|
|||||||
*
|
*
|
||||||
* Stop VCN block with dpg mode
|
* Stop VCN block with dpg mode
|
||||||
*/
|
*/
|
||||||
static int vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)
|
static void vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
@ -1133,7 +1133,6 @@ static int vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)
|
|||||||
/* disable dynamic power gating mode */
|
/* disable dynamic power gating mode */
|
||||||
WREG32_P(SOC15_REG_OFFSET(VCN, inst_idx, regUVD_POWER_STATUS), 0,
|
WREG32_P(SOC15_REG_OFFSET(VCN, inst_idx, regUVD_POWER_STATUS), 0,
|
||||||
~UVD_POWER_STATUS__UVD_PG_MODE_MASK);
|
~UVD_POWER_STATUS__UVD_PG_MODE_MASK);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1154,7 +1153,7 @@ static int vcn_v4_0_stop(struct amdgpu_device *adev)
|
|||||||
fw_shared->sq.queue_mode |= FW_QUEUE_DPG_HOLD_OFF;
|
fw_shared->sq.queue_mode |= FW_QUEUE_DPG_HOLD_OFF;
|
||||||
|
|
||||||
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
|
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
|
||||||
r = vcn_v4_0_stop_dpg_mode(adev, i);
|
vcn_v4_0_stop_dpg_mode(adev, i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,9 +334,11 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
|
|||||||
u32 wptr, tmp;
|
u32 wptr, tmp;
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
if (ih == &adev->irq.ih) {
|
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
|
||||||
/* Only ring0 supports writeback. On other rings fall back
|
/* Only ring0 supports writeback. On other rings fall back
|
||||||
* to register-based code with overflow checking below.
|
* to register-based code with overflow checking below.
|
||||||
|
* ih_soft ring doesn't have any backing hardware registers,
|
||||||
|
* update wptr and return.
|
||||||
*/
|
*/
|
||||||
wptr = le32_to_cpu(*ih->wptr_cpu);
|
wptr = le32_to_cpu(*ih->wptr_cpu);
|
||||||
|
|
||||||
@ -409,6 +411,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev,
|
|||||||
{
|
{
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
|
if (ih == &adev->irq.ih_soft)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ih->use_doorbell) {
|
if (ih->use_doorbell) {
|
||||||
/* XXX check if swapping is necessary on BE */
|
/* XXX check if swapping is necessary on BE */
|
||||||
*ih->rptr_cpu = ih->rptr;
|
*ih->rptr_cpu = ih->rptr;
|
||||||
|
@ -385,9 +385,11 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev,
|
|||||||
u32 wptr, tmp;
|
u32 wptr, tmp;
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
if (ih == &adev->irq.ih) {
|
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
|
||||||
/* Only ring0 supports writeback. On other rings fall back
|
/* Only ring0 supports writeback. On other rings fall back
|
||||||
* to register-based code with overflow checking below.
|
* to register-based code with overflow checking below.
|
||||||
|
* ih_soft ring doesn't have any backing hardware registers,
|
||||||
|
* update wptr and return.
|
||||||
*/
|
*/
|
||||||
wptr = le32_to_cpu(*ih->wptr_cpu);
|
wptr = le32_to_cpu(*ih->wptr_cpu);
|
||||||
|
|
||||||
@ -461,6 +463,9 @@ static void vega20_ih_set_rptr(struct amdgpu_device *adev,
|
|||||||
{
|
{
|
||||||
struct amdgpu_ih_regs *ih_regs;
|
struct amdgpu_ih_regs *ih_regs;
|
||||||
|
|
||||||
|
if (ih == &adev->irq.ih_soft)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ih->use_doorbell) {
|
if (ih->use_doorbell) {
|
||||||
/* XXX check if swapping is necessary on BE */
|
/* XXX check if swapping is necessary on BE */
|
||||||
*ih->rptr_cpu = ih->rptr;
|
*ih->rptr_cpu = ih->rptr;
|
||||||
|
@ -874,7 +874,7 @@ static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p,
|
|||||||
err = kfd_wait_on_events(p, args->num_events,
|
err = kfd_wait_on_events(p, args->num_events,
|
||||||
(void __user *)args->events_ptr,
|
(void __user *)args->events_ptr,
|
||||||
(args->wait_for_all != 0),
|
(args->wait_for_all != 0),
|
||||||
args->timeout, &args->wait_result);
|
&args->timeout, &args->wait_result);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -102,13 +102,18 @@ static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd)
|
|||||||
|
|
||||||
switch (sdma_version) {
|
switch (sdma_version) {
|
||||||
case IP_VERSION(6, 0, 0):
|
case IP_VERSION(6, 0, 0):
|
||||||
case IP_VERSION(6, 0, 1):
|
|
||||||
case IP_VERSION(6, 0, 2):
|
case IP_VERSION(6, 0, 2):
|
||||||
/* Reserve 1 for paging and 1 for gfx */
|
/* Reserve 1 for paging and 1 for gfx */
|
||||||
kfd->device_info.num_reserved_sdma_queues_per_engine = 2;
|
kfd->device_info.num_reserved_sdma_queues_per_engine = 2;
|
||||||
/* BIT(0)=engine-0 queue-0; BIT(1)=engine-1 queue-0; BIT(2)=engine-0 queue-1; ... */
|
/* BIT(0)=engine-0 queue-0; BIT(1)=engine-1 queue-0; BIT(2)=engine-0 queue-1; ... */
|
||||||
kfd->device_info.reserved_sdma_queues_bitmap = 0xFULL;
|
kfd->device_info.reserved_sdma_queues_bitmap = 0xFULL;
|
||||||
break;
|
break;
|
||||||
|
case IP_VERSION(6, 0, 1):
|
||||||
|
/* Reserve 1 for paging and 1 for gfx */
|
||||||
|
kfd->device_info.num_reserved_sdma_queues_per_engine = 2;
|
||||||
|
/* BIT(0)=engine-0 queue-0; BIT(1)=engine-0 queue-1; ... */
|
||||||
|
kfd->device_info.reserved_sdma_queues_bitmap = 0x3ULL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -894,7 +894,8 @@ static long user_timeout_to_jiffies(uint32_t user_timeout_ms)
|
|||||||
return msecs_to_jiffies(user_timeout_ms) + 1;
|
return msecs_to_jiffies(user_timeout_ms) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters)
|
static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters,
|
||||||
|
bool undo_auto_reset)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
@ -903,6 +904,9 @@ static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters)
|
|||||||
spin_lock(&waiters[i].event->lock);
|
spin_lock(&waiters[i].event->lock);
|
||||||
remove_wait_queue(&waiters[i].event->wq,
|
remove_wait_queue(&waiters[i].event->wq,
|
||||||
&waiters[i].wait);
|
&waiters[i].wait);
|
||||||
|
if (undo_auto_reset && waiters[i].activated &&
|
||||||
|
waiters[i].event && waiters[i].event->auto_reset)
|
||||||
|
set_event(waiters[i].event);
|
||||||
spin_unlock(&waiters[i].event->lock);
|
spin_unlock(&waiters[i].event->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -911,7 +915,7 @@ static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters)
|
|||||||
|
|
||||||
int kfd_wait_on_events(struct kfd_process *p,
|
int kfd_wait_on_events(struct kfd_process *p,
|
||||||
uint32_t num_events, void __user *data,
|
uint32_t num_events, void __user *data,
|
||||||
bool all, uint32_t user_timeout_ms,
|
bool all, uint32_t *user_timeout_ms,
|
||||||
uint32_t *wait_result)
|
uint32_t *wait_result)
|
||||||
{
|
{
|
||||||
struct kfd_event_data __user *events =
|
struct kfd_event_data __user *events =
|
||||||
@ -920,7 +924,7 @@ int kfd_wait_on_events(struct kfd_process *p,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
struct kfd_event_waiter *event_waiters = NULL;
|
struct kfd_event_waiter *event_waiters = NULL;
|
||||||
long timeout = user_timeout_to_jiffies(user_timeout_ms);
|
long timeout = user_timeout_to_jiffies(*user_timeout_ms);
|
||||||
|
|
||||||
event_waiters = alloc_event_waiters(num_events);
|
event_waiters = alloc_event_waiters(num_events);
|
||||||
if (!event_waiters) {
|
if (!event_waiters) {
|
||||||
@ -970,15 +974,11 @@ int kfd_wait_on_events(struct kfd_process *p,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (signal_pending(current)) {
|
if (signal_pending(current)) {
|
||||||
/*
|
|
||||||
* This is wrong when a nonzero, non-infinite timeout
|
|
||||||
* is specified. We need to use
|
|
||||||
* ERESTARTSYS_RESTARTBLOCK, but struct restart_block
|
|
||||||
* contains a union with data for each user and it's
|
|
||||||
* in generic kernel code that I don't want to
|
|
||||||
* touch yet.
|
|
||||||
*/
|
|
||||||
ret = -ERESTARTSYS;
|
ret = -ERESTARTSYS;
|
||||||
|
if (*user_timeout_ms != KFD_EVENT_TIMEOUT_IMMEDIATE &&
|
||||||
|
*user_timeout_ms != KFD_EVENT_TIMEOUT_INFINITE)
|
||||||
|
*user_timeout_ms = jiffies_to_msecs(
|
||||||
|
max(0l, timeout-1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1019,7 +1019,7 @@ int kfd_wait_on_events(struct kfd_process *p,
|
|||||||
event_waiters, events);
|
event_waiters, events);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
free_waiters(num_events, event_waiters);
|
free_waiters(num_events, event_waiters, ret == -ERESTARTSYS);
|
||||||
mutex_unlock(&p->event_mutex);
|
mutex_unlock(&p->event_mutex);
|
||||||
out:
|
out:
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1317,7 +1317,7 @@ void kfd_event_free_process(struct kfd_process *p);
|
|||||||
int kfd_event_mmap(struct kfd_process *process, struct vm_area_struct *vma);
|
int kfd_event_mmap(struct kfd_process *process, struct vm_area_struct *vma);
|
||||||
int kfd_wait_on_events(struct kfd_process *p,
|
int kfd_wait_on_events(struct kfd_process *p,
|
||||||
uint32_t num_events, void __user *data,
|
uint32_t num_events, void __user *data,
|
||||||
bool all, uint32_t user_timeout_ms,
|
bool all, uint32_t *user_timeout_ms,
|
||||||
uint32_t *wait_result);
|
uint32_t *wait_result);
|
||||||
void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
|
void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
|
||||||
uint32_t valid_id_bits);
|
uint32_t valid_id_bits);
|
||||||
|
@ -541,7 +541,6 @@ svm_range_vram_node_new(struct amdgpu_device *adev, struct svm_range *prange,
|
|||||||
kfree(svm_bo);
|
kfree(svm_bo);
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
}
|
}
|
||||||
svm_bo->svms = prange->svms;
|
|
||||||
svm_bo->eviction_fence =
|
svm_bo->eviction_fence =
|
||||||
amdgpu_amdkfd_fence_create(dma_fence_context_alloc(1),
|
amdgpu_amdkfd_fence_create(dma_fence_context_alloc(1),
|
||||||
mm,
|
mm,
|
||||||
@ -3273,7 +3272,6 @@ int svm_range_schedule_evict_svm_bo(struct amdgpu_amdkfd_fence *fence)
|
|||||||
static void svm_range_evict_svm_bo_worker(struct work_struct *work)
|
static void svm_range_evict_svm_bo_worker(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct svm_range_bo *svm_bo;
|
struct svm_range_bo *svm_bo;
|
||||||
struct kfd_process *p;
|
|
||||||
struct mm_struct *mm;
|
struct mm_struct *mm;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
@ -3281,13 +3279,12 @@ static void svm_range_evict_svm_bo_worker(struct work_struct *work)
|
|||||||
if (!svm_bo_ref_unless_zero(svm_bo))
|
if (!svm_bo_ref_unless_zero(svm_bo))
|
||||||
return; /* svm_bo was freed while eviction was pending */
|
return; /* svm_bo was freed while eviction was pending */
|
||||||
|
|
||||||
/* svm_range_bo_release destroys this worker thread. So during
|
if (mmget_not_zero(svm_bo->eviction_fence->mm)) {
|
||||||
* the lifetime of this thread, kfd_process and mm will be valid.
|
mm = svm_bo->eviction_fence->mm;
|
||||||
*/
|
} else {
|
||||||
p = container_of(svm_bo->svms, struct kfd_process, svms);
|
svm_range_bo_unref(svm_bo);
|
||||||
mm = p->mm;
|
|
||||||
if (!mm)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mmap_read_lock(mm);
|
mmap_read_lock(mm);
|
||||||
spin_lock(&svm_bo->list_lock);
|
spin_lock(&svm_bo->list_lock);
|
||||||
@ -3305,8 +3302,7 @@ static void svm_range_evict_svm_bo_worker(struct work_struct *work)
|
|||||||
|
|
||||||
mutex_lock(&prange->migrate_mutex);
|
mutex_lock(&prange->migrate_mutex);
|
||||||
do {
|
do {
|
||||||
r = svm_migrate_vram_to_ram(prange,
|
r = svm_migrate_vram_to_ram(prange, mm,
|
||||||
svm_bo->eviction_fence->mm,
|
|
||||||
KFD_MIGRATE_TRIGGER_TTM_EVICTION);
|
KFD_MIGRATE_TRIGGER_TTM_EVICTION);
|
||||||
} while (!r && prange->actual_loc && --retries);
|
} while (!r && prange->actual_loc && --retries);
|
||||||
|
|
||||||
@ -3324,6 +3320,7 @@ static void svm_range_evict_svm_bo_worker(struct work_struct *work)
|
|||||||
}
|
}
|
||||||
spin_unlock(&svm_bo->list_lock);
|
spin_unlock(&svm_bo->list_lock);
|
||||||
mmap_read_unlock(mm);
|
mmap_read_unlock(mm);
|
||||||
|
mmput(mm);
|
||||||
|
|
||||||
dma_fence_signal(&svm_bo->eviction_fence->base);
|
dma_fence_signal(&svm_bo->eviction_fence->base);
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ struct svm_range_bo {
|
|||||||
spinlock_t list_lock;
|
spinlock_t list_lock;
|
||||||
struct amdgpu_amdkfd_fence *eviction_fence;
|
struct amdgpu_amdkfd_fence *eviction_fence;
|
||||||
struct work_struct eviction_work;
|
struct work_struct eviction_work;
|
||||||
struct svm_range_list *svms;
|
|
||||||
uint32_t evicting;
|
uint32_t evicting;
|
||||||
struct work_struct release_work;
|
struct work_struct release_work;
|
||||||
};
|
};
|
||||||
|
@ -1392,8 +1392,8 @@ static int kfd_build_p2p_node_entry(struct kfd_topology_device *dev,
|
|||||||
|
|
||||||
static int kfd_create_indirect_link_prop(struct kfd_topology_device *kdev, int gpu_node)
|
static int kfd_create_indirect_link_prop(struct kfd_topology_device *kdev, int gpu_node)
|
||||||
{
|
{
|
||||||
|
struct kfd_iolink_properties *gpu_link, *tmp_link, *cpu_link;
|
||||||
struct kfd_iolink_properties *props = NULL, *props2 = NULL;
|
struct kfd_iolink_properties *props = NULL, *props2 = NULL;
|
||||||
struct kfd_iolink_properties *gpu_link, *cpu_link;
|
|
||||||
struct kfd_topology_device *cpu_dev;
|
struct kfd_topology_device *cpu_dev;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i, num_cpu;
|
int i, num_cpu;
|
||||||
@ -1416,16 +1416,19 @@ static int kfd_create_indirect_link_prop(struct kfd_topology_device *kdev, int g
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* find CPU <--> CPU links */
|
/* find CPU <--> CPU links */
|
||||||
|
cpu_link = NULL;
|
||||||
cpu_dev = kfd_topology_device_by_proximity_domain(i);
|
cpu_dev = kfd_topology_device_by_proximity_domain(i);
|
||||||
if (cpu_dev) {
|
if (cpu_dev) {
|
||||||
list_for_each_entry(cpu_link,
|
list_for_each_entry(tmp_link,
|
||||||
&cpu_dev->io_link_props, list) {
|
&cpu_dev->io_link_props, list) {
|
||||||
if (cpu_link->node_to == gpu_link->node_to)
|
if (tmp_link->node_to == gpu_link->node_to) {
|
||||||
|
cpu_link = tmp_link;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cpu_link->node_to != gpu_link->node_to)
|
if (!cpu_link)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* CPU <--> CPU <--> GPU, GPU node*/
|
/* CPU <--> CPU <--> GPU, GPU node*/
|
||||||
|
@ -3825,8 +3825,11 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
|
|||||||
adev_to_drm(adev)->mode_config.max_height = 16384;
|
adev_to_drm(adev)->mode_config.max_height = 16384;
|
||||||
|
|
||||||
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
adev_to_drm(adev)->mode_config.preferred_depth = 24;
|
||||||
|
if (adev->asic_type == CHIP_HAWAII)
|
||||||
/* disable prefer shadow for now due to hibernation issues */
|
/* disable prefer shadow for now due to hibernation issues */
|
||||||
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
|
||||||
|
else
|
||||||
|
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
|
||||||
/* indicates support for immediate flip */
|
/* indicates support for immediate flip */
|
||||||
adev_to_drm(adev)->mode_config.async_page_flip = true;
|
adev_to_drm(adev)->mode_config.async_page_flip = true;
|
||||||
|
|
||||||
@ -4135,6 +4138,7 @@ static void register_backlight_device(struct amdgpu_display_manager *dm,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void amdgpu_set_panel_orientation(struct drm_connector *connector);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In this architecture, the association
|
* In this architecture, the association
|
||||||
@ -4326,6 +4330,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
|
|||||||
adev_to_drm(adev)->vblank_disable_immediate = false;
|
adev_to_drm(adev)->vblank_disable_immediate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
amdgpu_set_panel_orientation(&aconnector->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Software is initialized. Now we can register interrupt handlers. */
|
/* Software is initialized. Now we can register interrupt handlers. */
|
||||||
@ -6684,6 +6689,10 @@ static void amdgpu_set_panel_orientation(struct drm_connector *connector)
|
|||||||
connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
|
connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
mutex_lock(&connector->dev->mode_config.mutex);
|
||||||
|
amdgpu_dm_connector_get_modes(connector);
|
||||||
|
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||||
|
|
||||||
encoder = amdgpu_dm_connector_to_encoder(connector);
|
encoder = amdgpu_dm_connector_to_encoder(connector);
|
||||||
if (!encoder)
|
if (!encoder)
|
||||||
return;
|
return;
|
||||||
@ -6728,8 +6737,6 @@ static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,
|
|||||||
* restored here.
|
* restored here.
|
||||||
*/
|
*/
|
||||||
amdgpu_dm_update_freesync_caps(connector, edid);
|
amdgpu_dm_update_freesync_caps(connector, edid);
|
||||||
|
|
||||||
amdgpu_set_panel_orientation(connector);
|
|
||||||
} else {
|
} else {
|
||||||
amdgpu_dm_connector->num_modes = 0;
|
amdgpu_dm_connector->num_modes = 0;
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ static int get_plane_modifiers(struct amdgpu_device *adev, unsigned int plane_ty
|
|||||||
add_gfx10_1_modifiers(adev, mods, &size, &capacity);
|
add_gfx10_1_modifiers(adev, mods, &size, &capacity);
|
||||||
break;
|
break;
|
||||||
case AMDGPU_FAMILY_GC_11_0_0:
|
case AMDGPU_FAMILY_GC_11_0_0:
|
||||||
case AMDGPU_FAMILY_GC_11_0_2:
|
case AMDGPU_FAMILY_GC_11_0_1:
|
||||||
add_gfx11_modifiers(adev, mods, &size, &capacity);
|
add_gfx11_modifiers(adev, mods, &size, &capacity);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1412,7 +1412,7 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AMDGPU_FAMILY_GC_11_0_0:
|
case AMDGPU_FAMILY_GC_11_0_0:
|
||||||
case AMDGPU_FAMILY_GC_11_0_2:
|
case AMDGPU_FAMILY_GC_11_0_1:
|
||||||
switch (AMD_FMT_MOD_GET(TILE, modifier)) {
|
switch (AMD_FMT_MOD_GET(TILE, modifier)) {
|
||||||
case AMD_FMT_MOD_TILE_GFX11_256K_R_X:
|
case AMD_FMT_MOD_TILE_GFX11_256K_R_X:
|
||||||
case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
|
case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
|
||||||
|
@ -100,3 +100,24 @@ void convert_float_matrix(
|
|||||||
matrix[i] = (uint16_t)reg_value;
|
matrix[i] = (uint16_t)reg_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t find_gcd(uint32_t a, uint32_t b)
|
||||||
|
{
|
||||||
|
uint32_t remainder = 0;
|
||||||
|
while (b != 0) {
|
||||||
|
remainder = a % b;
|
||||||
|
a = b;
|
||||||
|
b = remainder;
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reduce_fraction(uint32_t num, uint32_t den,
|
||||||
|
uint32_t *out_num, uint32_t *out_den)
|
||||||
|
{
|
||||||
|
uint32_t gcd = 0;
|
||||||
|
|
||||||
|
gcd = find_gcd(num, den);
|
||||||
|
*out_num = num / gcd;
|
||||||
|
*out_den = den / gcd;
|
||||||
|
}
|
||||||
|
@ -38,6 +38,9 @@ void convert_float_matrix(
|
|||||||
struct fixed31_32 *flt,
|
struct fixed31_32 *flt,
|
||||||
uint32_t buffer_size);
|
uint32_t buffer_size);
|
||||||
|
|
||||||
|
void reduce_fraction(uint32_t num, uint32_t den,
|
||||||
|
uint32_t *out_num, uint32_t *out_den);
|
||||||
|
|
||||||
static inline unsigned int log_2(unsigned int num)
|
static inline unsigned int log_2(unsigned int num)
|
||||||
{
|
{
|
||||||
return ilog2(num);
|
return ilog2(num);
|
||||||
|
@ -337,7 +337,7 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AMDGPU_FAMILY_GC_11_0_2: {
|
case AMDGPU_FAMILY_GC_11_0_1: {
|
||||||
struct clk_mgr_dcn314 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL);
|
struct clk_mgr_dcn314 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL);
|
||||||
|
|
||||||
if (clk_mgr == NULL) {
|
if (clk_mgr == NULL) {
|
||||||
@ -397,7 +397,7 @@ void dc_destroy_clk_mgr(struct clk_mgr *clk_mgr_base)
|
|||||||
dcn32_clk_mgr_destroy(clk_mgr);
|
dcn32_clk_mgr_destroy(clk_mgr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AMDGPU_FAMILY_GC_11_0_2:
|
case AMDGPU_FAMILY_GC_11_0_1:
|
||||||
dcn314_clk_mgr_destroy(clk_mgr);
|
dcn314_clk_mgr_destroy(clk_mgr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -24,10 +24,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dccg.h"
|
#include "dccg.h"
|
||||||
#include "clk_mgr_internal.h"
|
#include "rn_clk_mgr.h"
|
||||||
|
|
||||||
#include "dcn20/dcn20_clk_mgr.h"
|
#include "dcn20/dcn20_clk_mgr.h"
|
||||||
#include "rn_clk_mgr.h"
|
|
||||||
#include "dml/dcn20/dcn20_fpu.h"
|
#include "dml/dcn20/dcn20_fpu.h"
|
||||||
|
|
||||||
#include "dce100/dce_clk_mgr.h"
|
#include "dce100/dce_clk_mgr.h"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "clk_mgr.h"
|
#include "clk_mgr.h"
|
||||||
#include "dm_pp_smu.h"
|
#include "dm_pp_smu.h"
|
||||||
|
#include "clk_mgr_internal.h"
|
||||||
|
|
||||||
extern struct wm_table ddr4_wm_table_gs;
|
extern struct wm_table ddr4_wm_table_gs;
|
||||||
extern struct wm_table lpddr4_wm_table_gs;
|
extern struct wm_table lpddr4_wm_table_gs;
|
||||||
|
@ -307,16 +307,6 @@ static void dcn314_enable_pme_wa(struct clk_mgr *clk_mgr_base)
|
|||||||
dcn314_smu_enable_pme_wa(clk_mgr);
|
dcn314_smu_enable_pme_wa(clk_mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dcn314_init_clocks(struct clk_mgr *clk_mgr)
|
|
||||||
{
|
|
||||||
memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
|
|
||||||
// Assumption is that boot state always supports pstate
|
|
||||||
clk_mgr->clks.p_state_change_support = true;
|
|
||||||
clk_mgr->clks.prev_p_state_change_support = true;
|
|
||||||
clk_mgr->clks.pwr_state = DCN_PWR_STATE_UNKNOWN;
|
|
||||||
clk_mgr->clks.zstate_support = DCN_ZSTATE_SUPPORT_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dcn314_are_clock_states_equal(struct dc_clocks *a,
|
bool dcn314_are_clock_states_equal(struct dc_clocks *a,
|
||||||
struct dc_clocks *b)
|
struct dc_clocks *b)
|
||||||
{
|
{
|
||||||
@ -425,7 +415,7 @@ static struct wm_table lpddr5_wm_table = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static DpmClocks_t dummy_clocks;
|
static DpmClocks314_t dummy_clocks;
|
||||||
|
|
||||||
static struct dcn314_watermarks dummy_wms = { 0 };
|
static struct dcn314_watermarks dummy_wms = { 0 };
|
||||||
|
|
||||||
@ -510,7 +500,7 @@ static void dcn314_notify_wm_ranges(struct clk_mgr *clk_mgr_base)
|
|||||||
static void dcn314_get_dpm_table_from_smu(struct clk_mgr_internal *clk_mgr,
|
static void dcn314_get_dpm_table_from_smu(struct clk_mgr_internal *clk_mgr,
|
||||||
struct dcn314_smu_dpm_clks *smu_dpm_clks)
|
struct dcn314_smu_dpm_clks *smu_dpm_clks)
|
||||||
{
|
{
|
||||||
DpmClocks_t *table = smu_dpm_clks->dpm_clks;
|
DpmClocks314_t *table = smu_dpm_clks->dpm_clks;
|
||||||
|
|
||||||
if (!clk_mgr->smu_ver)
|
if (!clk_mgr->smu_ver)
|
||||||
return;
|
return;
|
||||||
@ -527,6 +517,26 @@ static void dcn314_get_dpm_table_from_smu(struct clk_mgr_internal *clk_mgr,
|
|||||||
dcn314_smu_transfer_dpm_table_smu_2_dram(clk_mgr);
|
dcn314_smu_transfer_dpm_table_smu_2_dram(clk_mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool is_valid_clock_value(uint32_t clock_value)
|
||||||
|
{
|
||||||
|
return clock_value > 1 && clock_value < 100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned int convert_wck_ratio(uint8_t wck_ratio)
|
||||||
|
{
|
||||||
|
switch (wck_ratio) {
|
||||||
|
case WCK_RATIO_1_2:
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
case WCK_RATIO_1_4:
|
||||||
|
return 4;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t find_max_clk_value(const uint32_t clocks[], uint32_t num_clocks)
|
static uint32_t find_max_clk_value(const uint32_t clocks[], uint32_t num_clocks)
|
||||||
{
|
{
|
||||||
uint32_t max = 0;
|
uint32_t max = 0;
|
||||||
@ -540,89 +550,127 @@ static uint32_t find_max_clk_value(const uint32_t clocks[], uint32_t num_clocks)
|
|||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int find_clk_for_voltage(
|
|
||||||
const DpmClocks_t *clock_table,
|
|
||||||
const uint32_t clocks[],
|
|
||||||
unsigned int voltage)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int max_voltage = 0;
|
|
||||||
int clock = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_SOC_VOLTAGE_LEVELS; i++) {
|
|
||||||
if (clock_table->SocVoltage[i] == voltage) {
|
|
||||||
return clocks[i];
|
|
||||||
} else if (clock_table->SocVoltage[i] >= max_voltage &&
|
|
||||||
clock_table->SocVoltage[i] < voltage) {
|
|
||||||
max_voltage = clock_table->SocVoltage[i];
|
|
||||||
clock = clocks[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT(clock);
|
|
||||||
return clock;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dcn314_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk_mgr,
|
static void dcn314_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk_mgr,
|
||||||
struct integrated_info *bios_info,
|
struct integrated_info *bios_info,
|
||||||
const DpmClocks_t *clock_table)
|
const DpmClocks314_t *clock_table)
|
||||||
{
|
{
|
||||||
int i, j;
|
|
||||||
struct clk_bw_params *bw_params = clk_mgr->base.bw_params;
|
struct clk_bw_params *bw_params = clk_mgr->base.bw_params;
|
||||||
uint32_t max_dispclk = 0, max_dppclk = 0;
|
struct clk_limit_table_entry def_max = bw_params->clk_table.entries[bw_params->clk_table.num_entries - 1];
|
||||||
|
uint32_t max_pstate = 0, max_fclk = 0, min_pstate = 0, max_dispclk = 0, max_dppclk = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
j = -1;
|
/* Find highest valid fclk pstate */
|
||||||
|
for (i = 0; i < clock_table->NumDfPstatesEnabled; i++) {
|
||||||
ASSERT(NUM_DF_PSTATE_LEVELS <= MAX_NUM_DPM_LVL);
|
if (is_valid_clock_value(clock_table->DfPstateTable[i].FClk) &&
|
||||||
|
clock_table->DfPstateTable[i].FClk > max_fclk) {
|
||||||
/* Find lowest DPM, FCLK is filled in reverse order*/
|
max_fclk = clock_table->DfPstateTable[i].FClk;
|
||||||
|
max_pstate = i;
|
||||||
for (i = NUM_DF_PSTATE_LEVELS - 1; i >= 0; i--) {
|
|
||||||
if (clock_table->DfPstateTable[i].FClk != 0) {
|
|
||||||
j = i;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == -1) {
|
/* We expect the table to contain at least one valid fclk entry. */
|
||||||
/* clock table is all 0s, just use our own hardcode */
|
ASSERT(is_valid_clock_value(max_fclk));
|
||||||
ASSERT(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bw_params->clk_table.num_entries = j + 1;
|
/* Dispclk and dppclk can be max at any voltage, same number of levels for both */
|
||||||
|
|
||||||
/* dispclk and dppclk can be max at any voltage, same number of levels for both */
|
|
||||||
if (clock_table->NumDispClkLevelsEnabled <= NUM_DISPCLK_DPM_LEVELS &&
|
if (clock_table->NumDispClkLevelsEnabled <= NUM_DISPCLK_DPM_LEVELS &&
|
||||||
clock_table->NumDispClkLevelsEnabled <= NUM_DPPCLK_DPM_LEVELS) {
|
clock_table->NumDispClkLevelsEnabled <= NUM_DPPCLK_DPM_LEVELS) {
|
||||||
max_dispclk = find_max_clk_value(clock_table->DispClocks, clock_table->NumDispClkLevelsEnabled);
|
max_dispclk = find_max_clk_value(clock_table->DispClocks, clock_table->NumDispClkLevelsEnabled);
|
||||||
max_dppclk = find_max_clk_value(clock_table->DppClocks, clock_table->NumDispClkLevelsEnabled);
|
max_dppclk = find_max_clk_value(clock_table->DppClocks, clock_table->NumDispClkLevelsEnabled);
|
||||||
} else {
|
} else {
|
||||||
|
/* Invalid number of entries in the table from PMFW. */
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < bw_params->clk_table.num_entries; i++, j--) {
|
/* Base the clock table on dcfclk, need at least one entry regardless of pmfw table */
|
||||||
bw_params->clk_table.entries[i].fclk_mhz = clock_table->DfPstateTable[j].FClk;
|
for (i = 0; i < clock_table->NumDcfClkLevelsEnabled; i++) {
|
||||||
bw_params->clk_table.entries[i].memclk_mhz = clock_table->DfPstateTable[j].MemClk;
|
uint32_t min_fclk = clock_table->DfPstateTable[0].FClk;
|
||||||
bw_params->clk_table.entries[i].voltage = clock_table->DfPstateTable[j].Voltage;
|
int j;
|
||||||
switch (clock_table->DfPstateTable[j].WckRatio) {
|
|
||||||
case WCK_RATIO_1_2:
|
for (j = 1; j < clock_table->NumDfPstatesEnabled; j++) {
|
||||||
bw_params->clk_table.entries[i].wck_ratio = 2;
|
if (is_valid_clock_value(clock_table->DfPstateTable[j].FClk) &&
|
||||||
break;
|
clock_table->DfPstateTable[j].FClk < min_fclk &&
|
||||||
case WCK_RATIO_1_4:
|
clock_table->DfPstateTable[j].Voltage <= clock_table->SocVoltage[i]) {
|
||||||
bw_params->clk_table.entries[i].wck_ratio = 4;
|
min_fclk = clock_table->DfPstateTable[j].FClk;
|
||||||
break;
|
min_pstate = j;
|
||||||
default:
|
|
||||||
bw_params->clk_table.entries[i].wck_ratio = 1;
|
|
||||||
}
|
}
|
||||||
bw_params->clk_table.entries[i].dcfclk_mhz = find_clk_for_voltage(clock_table, clock_table->DcfClocks, clock_table->DfPstateTable[j].Voltage);
|
|
||||||
bw_params->clk_table.entries[i].socclk_mhz = find_clk_for_voltage(clock_table, clock_table->SocClocks, clock_table->DfPstateTable[j].Voltage);
|
|
||||||
bw_params->clk_table.entries[i].dispclk_mhz = max_dispclk;
|
|
||||||
bw_params->clk_table.entries[i].dppclk_mhz = max_dppclk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* First search defaults for the clocks we don't read using closest lower or equal default dcfclk */
|
||||||
|
for (j = bw_params->clk_table.num_entries - 1; j > 0; j--)
|
||||||
|
if (bw_params->clk_table.entries[j].dcfclk_mhz <= clock_table->DcfClocks[i])
|
||||||
|
break;
|
||||||
|
|
||||||
|
bw_params->clk_table.entries[i].phyclk_mhz = bw_params->clk_table.entries[j].phyclk_mhz;
|
||||||
|
bw_params->clk_table.entries[i].phyclk_d18_mhz = bw_params->clk_table.entries[j].phyclk_d18_mhz;
|
||||||
|
bw_params->clk_table.entries[i].dtbclk_mhz = bw_params->clk_table.entries[j].dtbclk_mhz;
|
||||||
|
|
||||||
|
/* Now update clocks we do read */
|
||||||
|
bw_params->clk_table.entries[i].fclk_mhz = min_fclk;
|
||||||
|
bw_params->clk_table.entries[i].memclk_mhz = clock_table->DfPstateTable[min_pstate].MemClk;
|
||||||
|
bw_params->clk_table.entries[i].voltage = clock_table->DfPstateTable[min_pstate].Voltage;
|
||||||
|
bw_params->clk_table.entries[i].dcfclk_mhz = clock_table->DcfClocks[i];
|
||||||
|
bw_params->clk_table.entries[i].socclk_mhz = clock_table->SocClocks[i];
|
||||||
|
bw_params->clk_table.entries[i].dispclk_mhz = max_dispclk;
|
||||||
|
bw_params->clk_table.entries[i].dppclk_mhz = max_dppclk;
|
||||||
|
bw_params->clk_table.entries[i].wck_ratio = convert_wck_ratio(
|
||||||
|
clock_table->DfPstateTable[min_pstate].WckRatio);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Make sure to include at least one entry at highest pstate */
|
||||||
|
if (max_pstate != min_pstate || i == 0) {
|
||||||
|
if (i > MAX_NUM_DPM_LVL - 1)
|
||||||
|
i = MAX_NUM_DPM_LVL - 1;
|
||||||
|
|
||||||
|
bw_params->clk_table.entries[i].fclk_mhz = max_fclk;
|
||||||
|
bw_params->clk_table.entries[i].memclk_mhz = clock_table->DfPstateTable[max_pstate].MemClk;
|
||||||
|
bw_params->clk_table.entries[i].voltage = clock_table->DfPstateTable[max_pstate].Voltage;
|
||||||
|
bw_params->clk_table.entries[i].dcfclk_mhz = find_max_clk_value(clock_table->DcfClocks, NUM_DCFCLK_DPM_LEVELS);
|
||||||
|
bw_params->clk_table.entries[i].socclk_mhz = find_max_clk_value(clock_table->SocClocks, NUM_SOCCLK_DPM_LEVELS);
|
||||||
|
bw_params->clk_table.entries[i].dispclk_mhz = max_dispclk;
|
||||||
|
bw_params->clk_table.entries[i].dppclk_mhz = max_dppclk;
|
||||||
|
bw_params->clk_table.entries[i].wck_ratio = convert_wck_ratio(
|
||||||
|
clock_table->DfPstateTable[max_pstate].WckRatio);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
bw_params->clk_table.num_entries = i--;
|
||||||
|
|
||||||
|
/* Make sure all highest clocks are included*/
|
||||||
|
bw_params->clk_table.entries[i].socclk_mhz = find_max_clk_value(clock_table->SocClocks, NUM_SOCCLK_DPM_LEVELS);
|
||||||
|
bw_params->clk_table.entries[i].dispclk_mhz = find_max_clk_value(clock_table->DispClocks, NUM_DISPCLK_DPM_LEVELS);
|
||||||
|
bw_params->clk_table.entries[i].dppclk_mhz = find_max_clk_value(clock_table->DppClocks, NUM_DPPCLK_DPM_LEVELS);
|
||||||
|
ASSERT(clock_table->DcfClocks[i] == find_max_clk_value(clock_table->DcfClocks, NUM_DCFCLK_DPM_LEVELS));
|
||||||
|
bw_params->clk_table.entries[i].phyclk_mhz = def_max.phyclk_mhz;
|
||||||
|
bw_params->clk_table.entries[i].phyclk_d18_mhz = def_max.phyclk_d18_mhz;
|
||||||
|
bw_params->clk_table.entries[i].dtbclk_mhz = def_max.dtbclk_mhz;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set any 0 clocks to max default setting. Not an issue for
|
||||||
|
* power since we aren't doing switching in such case anyway
|
||||||
|
*/
|
||||||
|
for (i = 0; i < bw_params->clk_table.num_entries; i++) {
|
||||||
|
if (!bw_params->clk_table.entries[i].fclk_mhz) {
|
||||||
|
bw_params->clk_table.entries[i].fclk_mhz = def_max.fclk_mhz;
|
||||||
|
bw_params->clk_table.entries[i].memclk_mhz = def_max.memclk_mhz;
|
||||||
|
bw_params->clk_table.entries[i].voltage = def_max.voltage;
|
||||||
|
}
|
||||||
|
if (!bw_params->clk_table.entries[i].dcfclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].dcfclk_mhz = def_max.dcfclk_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].socclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].socclk_mhz = def_max.socclk_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].dispclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].dispclk_mhz = def_max.dispclk_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].dppclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].dppclk_mhz = def_max.dppclk_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].phyclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].phyclk_mhz = def_max.phyclk_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].phyclk_d18_mhz)
|
||||||
|
bw_params->clk_table.entries[i].phyclk_d18_mhz = def_max.phyclk_d18_mhz;
|
||||||
|
if (!bw_params->clk_table.entries[i].dtbclk_mhz)
|
||||||
|
bw_params->clk_table.entries[i].dtbclk_mhz = def_max.dtbclk_mhz;
|
||||||
|
}
|
||||||
|
ASSERT(bw_params->clk_table.entries[i-1].dcfclk_mhz);
|
||||||
bw_params->vram_type = bios_info->memory_type;
|
bw_params->vram_type = bios_info->memory_type;
|
||||||
bw_params->num_channels = bios_info->ma_channel_number;
|
bw_params->num_channels = bios_info->ma_channel_number ? bios_info->ma_channel_number : 4;
|
||||||
|
|
||||||
for (i = 0; i < WM_SET_COUNT; i++) {
|
for (i = 0; i < WM_SET_COUNT; i++) {
|
||||||
bw_params->wm_table.entries[i].wm_inst = i;
|
bw_params->wm_table.entries[i].wm_inst = i;
|
||||||
@ -641,7 +689,7 @@ static struct clk_mgr_funcs dcn314_funcs = {
|
|||||||
.get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
|
.get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
|
||||||
.get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
|
.get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
|
||||||
.update_clocks = dcn314_update_clocks,
|
.update_clocks = dcn314_update_clocks,
|
||||||
.init_clocks = dcn314_init_clocks,
|
.init_clocks = dcn31_init_clocks,
|
||||||
.enable_pme_wa = dcn314_enable_pme_wa,
|
.enable_pme_wa = dcn314_enable_pme_wa,
|
||||||
.are_clock_states_equal = dcn314_are_clock_states_equal,
|
.are_clock_states_equal = dcn314_are_clock_states_equal,
|
||||||
.notify_wm_ranges = dcn314_notify_wm_ranges
|
.notify_wm_ranges = dcn314_notify_wm_ranges
|
||||||
@ -681,10 +729,10 @@ void dcn314_clk_mgr_construct(
|
|||||||
}
|
}
|
||||||
ASSERT(clk_mgr->smu_wm_set.wm_set);
|
ASSERT(clk_mgr->smu_wm_set.wm_set);
|
||||||
|
|
||||||
smu_dpm_clks.dpm_clks = (DpmClocks_t *)dm_helpers_allocate_gpu_mem(
|
smu_dpm_clks.dpm_clks = (DpmClocks314_t *)dm_helpers_allocate_gpu_mem(
|
||||||
clk_mgr->base.base.ctx,
|
clk_mgr->base.base.ctx,
|
||||||
DC_MEM_ALLOC_TYPE_FRAME_BUFFER,
|
DC_MEM_ALLOC_TYPE_FRAME_BUFFER,
|
||||||
sizeof(DpmClocks_t),
|
sizeof(DpmClocks314_t),
|
||||||
&smu_dpm_clks.mc_address.quad_part);
|
&smu_dpm_clks.mc_address.quad_part);
|
||||||
|
|
||||||
if (smu_dpm_clks.dpm_clks == NULL) {
|
if (smu_dpm_clks.dpm_clks == NULL) {
|
||||||
@ -729,7 +777,7 @@ void dcn314_clk_mgr_construct(
|
|||||||
if (clk_mgr->base.base.ctx->dc->debug.pstate_enabled) {
|
if (clk_mgr->base.base.ctx->dc->debug.pstate_enabled) {
|
||||||
dcn314_get_dpm_table_from_smu(&clk_mgr->base, &smu_dpm_clks);
|
dcn314_get_dpm_table_from_smu(&clk_mgr->base, &smu_dpm_clks);
|
||||||
|
|
||||||
if (ctx->dc_bios && ctx->dc_bios->integrated_info) {
|
if (ctx->dc_bios && ctx->dc_bios->integrated_info && ctx->dc->config.use_default_clock_table == false) {
|
||||||
dcn314_clk_mgr_helper_populate_bw_params(
|
dcn314_clk_mgr_helper_populate_bw_params(
|
||||||
&clk_mgr->base,
|
&clk_mgr->base,
|
||||||
ctx->dc_bios->integrated_info,
|
ctx->dc_bios->integrated_info,
|
||||||
|
@ -42,7 +42,7 @@ struct clk_mgr_dcn314 {
|
|||||||
|
|
||||||
bool dcn314_are_clock_states_equal(struct dc_clocks *a,
|
bool dcn314_are_clock_states_equal(struct dc_clocks *a,
|
||||||
struct dc_clocks *b);
|
struct dc_clocks *b);
|
||||||
void dcn314_init_clocks(struct clk_mgr *clk_mgr);
|
|
||||||
void dcn314_update_clocks(struct clk_mgr *clk_mgr_base,
|
void dcn314_update_clocks(struct clk_mgr *clk_mgr_base,
|
||||||
struct dc_state *context,
|
struct dc_state *context,
|
||||||
bool safe_to_lower);
|
bool safe_to_lower);
|
||||||
|
@ -36,6 +36,37 @@ typedef enum {
|
|||||||
WCK_RATIO_MAX
|
WCK_RATIO_MAX
|
||||||
} WCK_RATIO_e;
|
} WCK_RATIO_e;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t FClk;
|
||||||
|
uint32_t MemClk;
|
||||||
|
uint32_t Voltage;
|
||||||
|
uint8_t WckRatio;
|
||||||
|
uint8_t Spare[3];
|
||||||
|
} DfPstateTable314_t;
|
||||||
|
|
||||||
|
//Freq in MHz
|
||||||
|
//Voltage in milli volts with 2 fractional bits
|
||||||
|
typedef struct {
|
||||||
|
uint32_t DcfClocks[NUM_DCFCLK_DPM_LEVELS];
|
||||||
|
uint32_t DispClocks[NUM_DISPCLK_DPM_LEVELS];
|
||||||
|
uint32_t DppClocks[NUM_DPPCLK_DPM_LEVELS];
|
||||||
|
uint32_t SocClocks[NUM_SOCCLK_DPM_LEVELS];
|
||||||
|
uint32_t VClocks[NUM_VCN_DPM_LEVELS];
|
||||||
|
uint32_t DClocks[NUM_VCN_DPM_LEVELS];
|
||||||
|
uint32_t SocVoltage[NUM_SOC_VOLTAGE_LEVELS];
|
||||||
|
DfPstateTable314_t DfPstateTable[NUM_DF_PSTATE_LEVELS];
|
||||||
|
|
||||||
|
uint8_t NumDcfClkLevelsEnabled;
|
||||||
|
uint8_t NumDispClkLevelsEnabled; //Applies to both Dispclk and Dppclk
|
||||||
|
uint8_t NumSocClkLevelsEnabled;
|
||||||
|
uint8_t VcnClkLevelsEnabled; //Applies to both Vclk and Dclk
|
||||||
|
uint8_t NumDfPstatesEnabled;
|
||||||
|
uint8_t spare[3];
|
||||||
|
|
||||||
|
uint32_t MinGfxClk;
|
||||||
|
uint32_t MaxGfxClk;
|
||||||
|
} DpmClocks314_t;
|
||||||
|
|
||||||
struct dcn314_watermarks {
|
struct dcn314_watermarks {
|
||||||
// Watermarks
|
// Watermarks
|
||||||
WatermarkRowGeneric_t WatermarkRow[WM_COUNT][NUM_WM_RANGES];
|
WatermarkRowGeneric_t WatermarkRow[WM_COUNT][NUM_WM_RANGES];
|
||||||
@ -43,7 +74,7 @@ struct dcn314_watermarks {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct dcn314_smu_dpm_clks {
|
struct dcn314_smu_dpm_clks {
|
||||||
DpmClocks_t *dpm_clks;
|
DpmClocks314_t *dpm_clks;
|
||||||
union large_integer mc_address;
|
union large_integer mc_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1074,8 +1074,15 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
|
|||||||
struct dc_stream_state *old_stream =
|
struct dc_stream_state *old_stream =
|
||||||
dc->current_state->res_ctx.pipe_ctx[i].stream;
|
dc->current_state->res_ctx.pipe_ctx[i].stream;
|
||||||
bool should_disable = true;
|
bool should_disable = true;
|
||||||
bool pipe_split_change =
|
bool pipe_split_change = false;
|
||||||
context->res_ctx.pipe_ctx[i].top_pipe != dc->current_state->res_ctx.pipe_ctx[i].top_pipe;
|
|
||||||
|
if ((context->res_ctx.pipe_ctx[i].top_pipe) &&
|
||||||
|
(dc->current_state->res_ctx.pipe_ctx[i].top_pipe))
|
||||||
|
pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe->pipe_idx !=
|
||||||
|
dc->current_state->res_ctx.pipe_ctx[i].top_pipe->pipe_idx;
|
||||||
|
else
|
||||||
|
pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe !=
|
||||||
|
dc->current_state->res_ctx.pipe_ctx[i].top_pipe;
|
||||||
|
|
||||||
for (j = 0; j < context->stream_count; j++) {
|
for (j = 0; j < context->stream_count; j++) {
|
||||||
if (old_stream == context->streams[j]) {
|
if (old_stream == context->streams[j]) {
|
||||||
@ -3229,7 +3236,7 @@ static void commit_planes_for_stream(struct dc *dc,
|
|||||||
odm_pipe->ttu_regs.min_ttu_vblank = MAX_TTU;
|
odm_pipe->ttu_regs.min_ttu_vblank = MAX_TTU;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed) {
|
if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
|
||||||
if (top_pipe_to_program &&
|
if (top_pipe_to_program &&
|
||||||
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
|
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
|
||||||
if (should_use_dmub_lock(stream->link)) {
|
if (should_use_dmub_lock(stream->link)) {
|
||||||
@ -3247,7 +3254,6 @@ static void commit_planes_for_stream(struct dc *dc,
|
|||||||
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable(
|
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable(
|
||||||
top_pipe_to_program->stream_res.tg);
|
top_pipe_to_program->stream_res.tg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) {
|
if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) {
|
||||||
if (dc->hwss.subvp_pipe_control_lock)
|
if (dc->hwss.subvp_pipe_control_lock)
|
||||||
@ -3466,7 +3472,7 @@ static void commit_planes_for_stream(struct dc *dc,
|
|||||||
dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
|
dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed) {
|
if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
|
||||||
if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
|
if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
|
||||||
top_pipe_to_program->stream_res.tg->funcs->wait_for_state(
|
top_pipe_to_program->stream_res.tg->funcs->wait_for_state(
|
||||||
top_pipe_to_program->stream_res.tg,
|
top_pipe_to_program->stream_res.tg,
|
||||||
@ -3493,9 +3499,8 @@ static void commit_planes_for_stream(struct dc *dc,
|
|||||||
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_disable(
|
top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_disable(
|
||||||
top_pipe_to_program->stream_res.tg);
|
top_pipe_to_program->stream_res.tg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (update_type != UPDATE_TYPE_FAST) {
|
if (update_type != UPDATE_TYPE_FAST)
|
||||||
dc->hwss.post_unlock_program_front_end(dc, context);
|
dc->hwss.post_unlock_program_front_end(dc, context);
|
||||||
|
|
||||||
/* Since phantom pipe programming is moved to post_unlock_program_front_end,
|
/* Since phantom pipe programming is moved to post_unlock_program_front_end,
|
||||||
@ -3508,7 +3513,6 @@ static void commit_planes_for_stream(struct dc *dc,
|
|||||||
if (dc->hwss.subvp_pipe_control_lock)
|
if (dc->hwss.subvp_pipe_control_lock)
|
||||||
dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, top_pipe_to_program, subvp_prev_use);
|
dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, top_pipe_to_program, subvp_prev_use);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Fire manual trigger only when bottom plane is flipped
|
// Fire manual trigger only when bottom plane is flipped
|
||||||
for (j = 0; j < dc->res_pool->pipe_count; j++) {
|
for (j = 0; j < dc->res_pool->pipe_count; j++) {
|
||||||
@ -4292,7 +4296,7 @@ bool dc_is_dmub_outbox_supported(struct dc *dc)
|
|||||||
!dc->debug.dpia_debug.bits.disable_dpia)
|
!dc->debug.dpia_debug.bits.disable_dpia)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_2 &&
|
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_1 &&
|
||||||
!dc->debug.dpia_debug.bits.disable_dpia)
|
!dc->debug.dpia_debug.bits.disable_dpia)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -4340,6 +4344,7 @@ void dc_enable_dmub_outbox(struct dc *dc)
|
|||||||
struct dc_context *dc_ctx = dc->ctx;
|
struct dc_context *dc_ctx = dc->ctx;
|
||||||
|
|
||||||
dmub_enable_outbox_notification(dc_ctx->dmub_srv);
|
dmub_enable_outbox_notification(dc_ctx->dmub_srv);
|
||||||
|
DC_LOG_DC("%s: dmub outbox notifications enabled\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3372,7 +3372,7 @@ bool dc_link_setup_psr(struct dc_link *link,
|
|||||||
switch(link->ctx->asic_id.chip_family) {
|
switch(link->ctx->asic_id.chip_family) {
|
||||||
case FAMILY_YELLOW_CARP:
|
case FAMILY_YELLOW_CARP:
|
||||||
case AMDGPU_FAMILY_GC_10_3_6:
|
case AMDGPU_FAMILY_GC_10_3_6:
|
||||||
case AMDGPU_FAMILY_GC_11_0_2:
|
case AMDGPU_FAMILY_GC_11_0_1:
|
||||||
if(!dc->debug.disable_z10)
|
if(!dc->debug.disable_z10)
|
||||||
psr_context->psr_level.bits.SKIP_CRTC_DISABLE = false;
|
psr_context->psr_level.bits.SKIP_CRTC_DISABLE = false;
|
||||||
break;
|
break;
|
||||||
|
@ -169,7 +169,7 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
|
|||||||
if (ASICREV_IS_GC_11_0_2(asic_id.hw_internal_rev))
|
if (ASICREV_IS_GC_11_0_2(asic_id.hw_internal_rev))
|
||||||
dc_version = DCN_VERSION_3_21;
|
dc_version = DCN_VERSION_3_21;
|
||||||
break;
|
break;
|
||||||
case AMDGPU_FAMILY_GC_11_0_2:
|
case AMDGPU_FAMILY_GC_11_0_1:
|
||||||
dc_version = DCN_VERSION_3_14;
|
dc_version = DCN_VERSION_3_14;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -47,7 +47,7 @@ struct aux_payload;
|
|||||||
struct set_config_cmd_payload;
|
struct set_config_cmd_payload;
|
||||||
struct dmub_notification;
|
struct dmub_notification;
|
||||||
|
|
||||||
#define DC_VER "3.2.196"
|
#define DC_VER "3.2.198"
|
||||||
|
|
||||||
#define MAX_SURFACES 3
|
#define MAX_SURFACES 3
|
||||||
#define MAX_PLANES 6
|
#define MAX_PLANES 6
|
||||||
@ -213,6 +213,7 @@ struct dc_caps {
|
|||||||
uint32_t cache_num_ways;
|
uint32_t cache_num_ways;
|
||||||
uint16_t subvp_fw_processing_delay_us;
|
uint16_t subvp_fw_processing_delay_us;
|
||||||
uint16_t subvp_prefetch_end_to_mall_start_us;
|
uint16_t subvp_prefetch_end_to_mall_start_us;
|
||||||
|
uint8_t subvp_swath_height_margin_lines; // subvp start line must be aligned to 2 x swath height
|
||||||
uint16_t subvp_pstate_allow_width_us;
|
uint16_t subvp_pstate_allow_width_us;
|
||||||
uint16_t subvp_vertical_int_margin_us;
|
uint16_t subvp_vertical_int_margin_us;
|
||||||
bool seamless_odm;
|
bool seamless_odm;
|
||||||
@ -352,6 +353,7 @@ struct dc_config {
|
|||||||
bool use_pipe_ctx_sync_logic;
|
bool use_pipe_ctx_sync_logic;
|
||||||
bool ignore_dpref_ss;
|
bool ignore_dpref_ss;
|
||||||
bool enable_mipi_converter_optimization;
|
bool enable_mipi_converter_optimization;
|
||||||
|
bool use_default_clock_table;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum visual_confirm {
|
enum visual_confirm {
|
||||||
@ -609,6 +611,7 @@ struct dc_bounding_box_overrides {
|
|||||||
int percent_of_ideal_drambw;
|
int percent_of_ideal_drambw;
|
||||||
int dram_clock_change_latency_ns;
|
int dram_clock_change_latency_ns;
|
||||||
int dummy_clock_change_latency_ns;
|
int dummy_clock_change_latency_ns;
|
||||||
|
int fclk_clock_change_latency_ns;
|
||||||
/* This forces a hard min on the DCFCLK we use
|
/* This forces a hard min on the DCFCLK we use
|
||||||
* for DML. Unlike the debug option for forcing
|
* for DML. Unlike the debug option for forcing
|
||||||
* DCFCLK, this override affects watermark calculations
|
* DCFCLK, this override affects watermark calculations
|
||||||
@ -751,6 +754,7 @@ struct dc_debug_options {
|
|||||||
uint32_t mst_start_top_delay;
|
uint32_t mst_start_top_delay;
|
||||||
uint8_t psr_power_use_phy_fsm;
|
uint8_t psr_power_use_phy_fsm;
|
||||||
enum dml_hostvm_override_opts dml_hostvm_override;
|
enum dml_hostvm_override_opts dml_hostvm_override;
|
||||||
|
bool dml_disallow_alternate_prefetch_modes;
|
||||||
bool use_legacy_soc_bb_mechanism;
|
bool use_legacy_soc_bb_mechanism;
|
||||||
bool exit_idle_opt_for_cursor_updates;
|
bool exit_idle_opt_for_cursor_updates;
|
||||||
bool enable_single_display_2to1_odm_policy;
|
bool enable_single_display_2to1_odm_policy;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "dm_helpers.h"
|
#include "dm_helpers.h"
|
||||||
#include "dc_hw_types.h"
|
#include "dc_hw_types.h"
|
||||||
#include "core_types.h"
|
#include "core_types.h"
|
||||||
|
#include "../basics/conversion.h"
|
||||||
|
|
||||||
#define CTX dc_dmub_srv->ctx
|
#define CTX dc_dmub_srv->ctx
|
||||||
#define DC_LOGGER CTX->logger
|
#define DC_LOGGER CTX->logger
|
||||||
@ -275,8 +276,7 @@ void dc_dmub_srv_set_drr_manual_trigger_cmd(struct dc *dc, uint32_t tg_inst)
|
|||||||
union dmub_rb_cmd cmd = { 0 };
|
union dmub_rb_cmd cmd = { 0 };
|
||||||
|
|
||||||
cmd.drr_update.header.type = DMUB_CMD__FW_ASSISTED_MCLK_SWITCH;
|
cmd.drr_update.header.type = DMUB_CMD__FW_ASSISTED_MCLK_SWITCH;
|
||||||
// TODO: Uncomment once FW headers are promoted
|
cmd.drr_update.header.sub_type = DMUB_CMD__FAMS_SET_MANUAL_TRIGGER;
|
||||||
//cmd.drr_update.header.sub_type = DMUB_CMD__FAMS_SET_MANUAL_TRIGGER;
|
|
||||||
cmd.drr_update.dmub_optc_state_req.tg_inst = tg_inst;
|
cmd.drr_update.dmub_optc_state_req.tg_inst = tg_inst;
|
||||||
|
|
||||||
cmd.drr_update.header.payload_bytes = sizeof(cmd.drr_update) - sizeof(cmd.drr_update.header);
|
cmd.drr_update.header.payload_bytes = sizeof(cmd.drr_update) - sizeof(cmd.drr_update.header);
|
||||||
@ -601,6 +601,7 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
|
|||||||
&cmd->fw_assisted_mclk_switch_v2.config_data.pipe_data[cmd_pipe_index];
|
&cmd->fw_assisted_mclk_switch_v2.config_data.pipe_data[cmd_pipe_index];
|
||||||
struct dc_crtc_timing *main_timing = &subvp_pipe->stream->timing;
|
struct dc_crtc_timing *main_timing = &subvp_pipe->stream->timing;
|
||||||
struct dc_crtc_timing *phantom_timing = &subvp_pipe->stream->mall_stream_config.paired_stream->timing;
|
struct dc_crtc_timing *phantom_timing = &subvp_pipe->stream->mall_stream_config.paired_stream->timing;
|
||||||
|
uint32_t out_num, out_den;
|
||||||
|
|
||||||
pipe_data->mode = SUBVP;
|
pipe_data->mode = SUBVP;
|
||||||
pipe_data->pipe_config.subvp_data.pix_clk_100hz = subvp_pipe->stream->timing.pix_clk_100hz;
|
pipe_data->pipe_config.subvp_data.pix_clk_100hz = subvp_pipe->stream->timing.pix_clk_100hz;
|
||||||
@ -612,6 +613,16 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
|
|||||||
main_timing->v_total - main_timing->v_front_porch - main_timing->v_addressable;
|
main_timing->v_total - main_timing->v_front_porch - main_timing->v_addressable;
|
||||||
pipe_data->pipe_config.subvp_data.mall_region_lines = phantom_timing->v_addressable;
|
pipe_data->pipe_config.subvp_data.mall_region_lines = phantom_timing->v_addressable;
|
||||||
pipe_data->pipe_config.subvp_data.main_pipe_index = subvp_pipe->pipe_idx;
|
pipe_data->pipe_config.subvp_data.main_pipe_index = subvp_pipe->pipe_idx;
|
||||||
|
pipe_data->pipe_config.subvp_data.is_drr = subvp_pipe->stream->ignore_msa_timing_param;
|
||||||
|
|
||||||
|
/* Calculate the scaling factor from the src and dst height.
|
||||||
|
* e.g. If 3840x2160 being downscaled to 1920x1080, the scaling factor is 1/2.
|
||||||
|
* Reduce the fraction 1080/2160 = 1/2 for the "scaling factor"
|
||||||
|
*/
|
||||||
|
reduce_fraction(subvp_pipe->stream->src.height, subvp_pipe->stream->dst.height, &out_num, &out_den);
|
||||||
|
// TODO: Uncomment below lines once DMCUB include headers are promoted
|
||||||
|
//pipe_data->pipe_config.subvp_data.scale_factor_numerator = out_num;
|
||||||
|
//pipe_data->pipe_config.subvp_data.scale_factor_denominator = out_den;
|
||||||
|
|
||||||
// Prefetch lines is equal to VACTIVE + BP + VSYNC
|
// Prefetch lines is equal to VACTIVE + BP + VSYNC
|
||||||
pipe_data->pipe_config.subvp_data.prefetch_lines =
|
pipe_data->pipe_config.subvp_data.prefetch_lines =
|
||||||
|
@ -344,6 +344,7 @@ enum dc_detect_reason {
|
|||||||
DETECT_REASON_HPDRX,
|
DETECT_REASON_HPDRX,
|
||||||
DETECT_REASON_FALLBACK,
|
DETECT_REASON_FALLBACK,
|
||||||
DETECT_REASON_RETRAIN,
|
DETECT_REASON_RETRAIN,
|
||||||
|
DETECT_REASON_TDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
|
bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
|
||||||
|
@ -543,9 +543,11 @@ static void dce112_get_pix_clk_dividers_helper (
|
|||||||
switch (pix_clk_params->color_depth) {
|
switch (pix_clk_params->color_depth) {
|
||||||
case COLOR_DEPTH_101010:
|
case COLOR_DEPTH_101010:
|
||||||
actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 5) >> 2;
|
actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 5) >> 2;
|
||||||
|
actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10;
|
||||||
break;
|
break;
|
||||||
case COLOR_DEPTH_121212:
|
case COLOR_DEPTH_121212:
|
||||||
actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 6) >> 2;
|
actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 6) >> 2;
|
||||||
|
actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10;
|
||||||
break;
|
break;
|
||||||
case COLOR_DEPTH_161616:
|
case COLOR_DEPTH_161616:
|
||||||
actual_pixel_clock_100hz = actual_pixel_clock_100hz * 2;
|
actual_pixel_clock_100hz = actual_pixel_clock_100hz * 2;
|
||||||
|
@ -361,8 +361,6 @@ void dpp1_cnv_setup (
|
|||||||
select = INPUT_CSC_SELECT_ICSC;
|
select = INPUT_CSC_SELECT_ICSC;
|
||||||
break;
|
break;
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
||||||
pixel_format = 22;
|
|
||||||
break;
|
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
||||||
pixel_format = 26; /* ARGB16161616_UNORM */
|
pixel_format = 26; /* ARGB16161616_UNORM */
|
||||||
break;
|
break;
|
||||||
|
@ -278,9 +278,6 @@ void hubp1_program_pixel_format(
|
|||||||
SURFACE_PIXEL_FORMAT, 10);
|
SURFACE_PIXEL_FORMAT, 10);
|
||||||
break;
|
break;
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
||||||
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
|
||||||
SURFACE_PIXEL_FORMAT, 22);
|
|
||||||
break;
|
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616: /*we use crossbar already*/
|
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616: /*we use crossbar already*/
|
||||||
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
||||||
SURFACE_PIXEL_FORMAT, 26); /* ARGB16161616_UNORM */
|
SURFACE_PIXEL_FORMAT, 26); /* ARGB16161616_UNORM */
|
||||||
|
@ -110,6 +110,7 @@ void dcn10_lock_all_pipes(struct dc *dc,
|
|||||||
*/
|
*/
|
||||||
if (pipe_ctx->top_pipe ||
|
if (pipe_ctx->top_pipe ||
|
||||||
!pipe_ctx->stream ||
|
!pipe_ctx->stream ||
|
||||||
|
!pipe_ctx->plane_state ||
|
||||||
!tg->funcs->is_tg_enabled(tg))
|
!tg->funcs->is_tg_enabled(tg))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -131,6 +131,12 @@ struct mpcc *mpc1_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id)
|
|||||||
while (tmp_mpcc != NULL) {
|
while (tmp_mpcc != NULL) {
|
||||||
if (tmp_mpcc->dpp_id == dpp_id)
|
if (tmp_mpcc->dpp_id == dpp_id)
|
||||||
return tmp_mpcc;
|
return tmp_mpcc;
|
||||||
|
|
||||||
|
/* avoid circular linked list */
|
||||||
|
ASSERT(tmp_mpcc != tmp_mpcc->mpcc_bot);
|
||||||
|
if (tmp_mpcc == tmp_mpcc->mpcc_bot)
|
||||||
|
break;
|
||||||
|
|
||||||
tmp_mpcc = tmp_mpcc->mpcc_bot;
|
tmp_mpcc = tmp_mpcc->mpcc_bot;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -465,6 +465,11 @@ void optc1_enable_optc_clock(struct timing_generator *optc, bool enable)
|
|||||||
OTG_CLOCK_ON, 1,
|
OTG_CLOCK_ON, 1,
|
||||||
1, 1000);
|
1, 1000);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
//last chance to clear underflow, otherwise, it will always there due to clock is off.
|
||||||
|
if (optc->funcs->is_optc_underflow_occurred(optc) == true)
|
||||||
|
optc->funcs->clear_optc_underflow(optc);
|
||||||
|
|
||||||
REG_UPDATE_2(OTG_CLOCK_CONTROL,
|
REG_UPDATE_2(OTG_CLOCK_CONTROL,
|
||||||
OTG_CLOCK_GATE_DIS, 0,
|
OTG_CLOCK_GATE_DIS, 0,
|
||||||
OTG_CLOCK_EN, 0);
|
OTG_CLOCK_EN, 0);
|
||||||
|
@ -166,8 +166,6 @@ static void dpp2_cnv_setup (
|
|||||||
select = DCN2_ICSC_SELECT_ICSC_A;
|
select = DCN2_ICSC_SELECT_ICSC_A;
|
||||||
break;
|
break;
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
||||||
pixel_format = 22;
|
|
||||||
break;
|
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
||||||
pixel_format = 26; /* ARGB16161616_UNORM */
|
pixel_format = 26; /* ARGB16161616_UNORM */
|
||||||
break;
|
break;
|
||||||
|
@ -463,9 +463,6 @@ void hubp2_program_pixel_format(
|
|||||||
SURFACE_PIXEL_FORMAT, 10);
|
SURFACE_PIXEL_FORMAT, 10);
|
||||||
break;
|
break;
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
||||||
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
|
||||||
SURFACE_PIXEL_FORMAT, 22);
|
|
||||||
break;
|
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616: /*we use crossbar already*/
|
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616: /*we use crossbar already*/
|
||||||
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
REG_UPDATE(DCSURF_SURFACE_CONFIG,
|
||||||
SURFACE_PIXEL_FORMAT, 26); /* ARGB16161616_UNORM */
|
SURFACE_PIXEL_FORMAT, 26); /* ARGB16161616_UNORM */
|
||||||
|
@ -531,6 +531,12 @@ static struct mpcc *mpc2_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id)
|
|||||||
while (tmp_mpcc != NULL) {
|
while (tmp_mpcc != NULL) {
|
||||||
if (tmp_mpcc->dpp_id == 0xf || tmp_mpcc->dpp_id == dpp_id)
|
if (tmp_mpcc->dpp_id == 0xf || tmp_mpcc->dpp_id == dpp_id)
|
||||||
return tmp_mpcc;
|
return tmp_mpcc;
|
||||||
|
|
||||||
|
/* avoid circular linked list */
|
||||||
|
ASSERT(tmp_mpcc != tmp_mpcc->mpcc_bot);
|
||||||
|
if (tmp_mpcc == tmp_mpcc->mpcc_bot)
|
||||||
|
break;
|
||||||
|
|
||||||
tmp_mpcc = tmp_mpcc->mpcc_bot;
|
tmp_mpcc = tmp_mpcc->mpcc_bot;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -67,9 +67,15 @@ static uint32_t convert_and_clamp(
|
|||||||
void dcn21_dchvm_init(struct hubbub *hubbub)
|
void dcn21_dchvm_init(struct hubbub *hubbub)
|
||||||
{
|
{
|
||||||
struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub);
|
struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub);
|
||||||
uint32_t riommu_active;
|
uint32_t riommu_active, prefetch_done;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
REG_GET(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, &prefetch_done);
|
||||||
|
|
||||||
|
if (prefetch_done) {
|
||||||
|
hubbub->riommu_active = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
//Init DCHVM block
|
//Init DCHVM block
|
||||||
REG_UPDATE(DCHVM_CTRL0, HOSTVM_INIT_REQ, 1);
|
REG_UPDATE(DCHVM_CTRL0, HOSTVM_INIT_REQ, 1);
|
||||||
|
|
||||||
|
@ -244,8 +244,6 @@ void dpp3_cnv_setup (
|
|||||||
select = INPUT_CSC_SELECT_ICSC;
|
select = INPUT_CSC_SELECT_ICSC;
|
||||||
break;
|
break;
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
|
||||||
pixel_format = 22;
|
|
||||||
break;
|
|
||||||
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616:
|
||||||
pixel_format = 26; /* ARGB16161616_UNORM */
|
pixel_format = 26; /* ARGB16161616_UNORM */
|
||||||
break;
|
break;
|
||||||
|
@ -86,7 +86,7 @@ bool hubp3_program_surface_flip_and_addr(
|
|||||||
VMID, address->vmid);
|
VMID, address->vmid);
|
||||||
|
|
||||||
if (address->type == PLN_ADDR_TYPE_GRPH_STEREO) {
|
if (address->type == PLN_ADDR_TYPE_GRPH_STEREO) {
|
||||||
REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_MODE_FOR_STEREOSYNC, 0x1);
|
REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_MODE_FOR_STEREOSYNC, 0);
|
||||||
REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_IN_STEREOSYNC, 0x1);
|
REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_IN_STEREOSYNC, 0x1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -372,7 +372,7 @@ static struct stream_encoder *dcn303_stream_encoder_create(enum engine_id eng_id
|
|||||||
int afmt_inst;
|
int afmt_inst;
|
||||||
|
|
||||||
/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
|
/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
|
||||||
if (eng_id <= ENGINE_ID_DIGE) {
|
if (eng_id <= ENGINE_ID_DIGB) {
|
||||||
vpg_inst = eng_id;
|
vpg_inst = eng_id;
|
||||||
afmt_inst = eng_id;
|
afmt_inst = eng_id;
|
||||||
} else
|
} else
|
||||||
|
@ -162,7 +162,8 @@
|
|||||||
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, AIP_ENABLE, mask_sh),\
|
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, AIP_ENABLE, mask_sh),\
|
||||||
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, ACM_ENABLE, mask_sh),\
|
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, ACM_ENABLE, mask_sh),\
|
||||||
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_ENABLE, mask_sh),\
|
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_ENABLE, mask_sh),\
|
||||||
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_CONT_MODE_ENABLE, mask_sh)
|
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_CONT_MODE_ENABLE, mask_sh),\
|
||||||
|
SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_HBLANK_CONTROL, HBLANK_MINIMUM_SYMBOL_WIDTH, mask_sh)
|
||||||
|
|
||||||
|
|
||||||
#define DCN3_1_HPO_DP_STREAM_ENC_REG_FIELD_LIST(type) \
|
#define DCN3_1_HPO_DP_STREAM_ENC_REG_FIELD_LIST(type) \
|
||||||
|
@ -2153,7 +2153,7 @@ static bool dcn31_resource_construct(
|
|||||||
pool->base.usb4_dpia_count = 4;
|
pool->base.usb4_dpia_count = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_2)
|
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_1)
|
||||||
pool->base.usb4_dpia_count = 4;
|
pool->base.usb4_dpia_count = 4;
|
||||||
|
|
||||||
/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */
|
/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
container_of(pool, struct dcn31_resource_pool, base)
|
container_of(pool, struct dcn31_resource_pool, base)
|
||||||
|
|
||||||
extern struct _vcs_dpi_ip_params_st dcn3_1_ip;
|
extern struct _vcs_dpi_ip_params_st dcn3_1_ip;
|
||||||
extern struct _vcs_dpi_soc_bounding_box_st dcn3_1_soc;
|
|
||||||
|
|
||||||
struct dcn31_resource_pool {
|
struct dcn31_resource_pool {
|
||||||
struct resource_pool base;
|
struct resource_pool base;
|
||||||
|
@ -13,31 +13,6 @@
|
|||||||
DCN314 = dcn314_resource.o dcn314_hwseq.o dcn314_init.o \
|
DCN314 = dcn314_resource.o dcn314_hwseq.o dcn314_init.o \
|
||||||
dcn314_dio_stream_encoder.o dcn314_dccg.o dcn314_optc.o
|
dcn314_dio_stream_encoder.o dcn314_dccg.o dcn314_optc.o
|
||||||
|
|
||||||
ifdef CONFIG_X86
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dcn314/dcn314_resource.o := -mhard-float -msse
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_PPC64
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dcn314/dcn314_resource.o := -mhard-float -maltivec
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_CC_IS_GCC
|
|
||||||
ifeq ($(call cc-ifversion, -lt, 0701, y), y)
|
|
||||||
IS_OLD_GCC = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_X86
|
|
||||||
ifdef IS_OLD_GCC
|
|
||||||
# Stack alignment mismatch, proceed with caution.
|
|
||||||
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
|
|
||||||
# (8B stack alignment).
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dcn314/dcn314_resource.o += -mpreferred-stack-boundary=4
|
|
||||||
else
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dcn314/dcn314_resource.o += -msse2
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
AMD_DAL_DCN314 = $(addprefix $(AMDDALPATH)/dc/dcn314/,$(DCN314))
|
AMD_DAL_DCN314 = $(addprefix $(AMDDALPATH)/dc/dcn314/,$(DCN314))
|
||||||
|
|
||||||
AMD_DISPLAY_FILES += $(AMD_DAL_DCN314)
|
AMD_DISPLAY_FILES += $(AMD_DAL_DCN314)
|
||||||
|
@ -343,7 +343,10 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig
|
|||||||
{
|
{
|
||||||
struct dc_stream_state *stream = pipe_ctx->stream;
|
struct dc_stream_state *stream = pipe_ctx->stream;
|
||||||
unsigned int odm_combine_factor = 0;
|
unsigned int odm_combine_factor = 0;
|
||||||
|
struct dc *dc = pipe_ctx->stream->ctx->dc;
|
||||||
|
bool two_pix_per_container = false;
|
||||||
|
|
||||||
|
two_pix_per_container = optc2_is_two_pixels_per_containter(&stream->timing);
|
||||||
odm_combine_factor = get_odm_config(pipe_ctx, NULL);
|
odm_combine_factor = get_odm_config(pipe_ctx, NULL);
|
||||||
|
|
||||||
if (is_dp_128b_132b_signal(pipe_ctx)) {
|
if (is_dp_128b_132b_signal(pipe_ctx)) {
|
||||||
@ -355,16 +358,13 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig
|
|||||||
else
|
else
|
||||||
*k2_div = PIXEL_RATE_DIV_BY_4;
|
*k2_div = PIXEL_RATE_DIV_BY_4;
|
||||||
} else if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
|
} else if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
|
||||||
if (stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
|
if (two_pix_per_container) {
|
||||||
*k1_div = PIXEL_RATE_DIV_BY_1;
|
*k1_div = PIXEL_RATE_DIV_BY_1;
|
||||||
*k2_div = PIXEL_RATE_DIV_BY_2;
|
*k2_div = PIXEL_RATE_DIV_BY_2;
|
||||||
} else if (stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR422) {
|
|
||||||
*k1_div = PIXEL_RATE_DIV_BY_2;
|
|
||||||
*k2_div = PIXEL_RATE_DIV_BY_2;
|
|
||||||
} else {
|
} else {
|
||||||
if (odm_combine_factor == 1)
|
*k1_div = PIXEL_RATE_DIV_BY_1;
|
||||||
*k2_div = PIXEL_RATE_DIV_BY_4;
|
*k2_div = PIXEL_RATE_DIV_BY_4;
|
||||||
else if (odm_combine_factor == 2)
|
if ((odm_combine_factor == 2) || dc->debug.enable_dp_dig_pixel_rate_div_policy)
|
||||||
*k2_div = PIXEL_RATE_DIV_BY_2;
|
*k2_div = PIXEL_RATE_DIV_BY_2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,3 +374,31 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig
|
|||||||
|
|
||||||
return odm_combine_factor;
|
return odm_combine_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)
|
||||||
|
{
|
||||||
|
uint32_t pix_per_cycle = 1;
|
||||||
|
uint32_t odm_combine_factor = 1;
|
||||||
|
|
||||||
|
if (!pipe_ctx || !pipe_ctx->stream || !pipe_ctx->stream_res.stream_enc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
odm_combine_factor = get_odm_config(pipe_ctx, NULL);
|
||||||
|
if (optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing) || odm_combine_factor > 1
|
||||||
|
|| dcn314_is_dp_dig_pixel_rate_div_policy(pipe_ctx))
|
||||||
|
pix_per_cycle = 2;
|
||||||
|
|
||||||
|
if (pipe_ctx->stream_res.stream_enc->funcs->set_input_mode)
|
||||||
|
pipe_ctx->stream_res.stream_enc->funcs->set_input_mode(pipe_ctx->stream_res.stream_enc,
|
||||||
|
pix_per_cycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dcn314_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx)
|
||||||
|
{
|
||||||
|
struct dc *dc = pipe_ctx->stream->ctx->dc;
|
||||||
|
|
||||||
|
if (dc_is_dp_signal(pipe_ctx->stream->signal) && !is_dp_128b_132b_signal(pipe_ctx) &&
|
||||||
|
dc->debug.enable_dp_dig_pixel_rate_div_policy)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -39,4 +39,8 @@ void dcn314_enable_power_gating_plane(struct dce_hwseq *hws, bool enable);
|
|||||||
|
|
||||||
unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigned int *k1_div, unsigned int *k2_div);
|
unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigned int *k1_div, unsigned int *k2_div);
|
||||||
|
|
||||||
|
void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx);
|
||||||
|
|
||||||
|
bool dcn314_is_dp_dig_pixel_rate_div_policy(struct pipe_ctx *pipe_ctx);
|
||||||
|
|
||||||
#endif /* __DC_HWSS_DCN314_H__ */
|
#endif /* __DC_HWSS_DCN314_H__ */
|
||||||
|
@ -145,6 +145,8 @@ static const struct hwseq_private_funcs dcn314_private_funcs = {
|
|||||||
.set_shaper_3dlut = dcn20_set_shaper_3dlut,
|
.set_shaper_3dlut = dcn20_set_shaper_3dlut,
|
||||||
.setup_hpo_hw_control = dcn31_setup_hpo_hw_control,
|
.setup_hpo_hw_control = dcn31_setup_hpo_hw_control,
|
||||||
.calculate_dccg_k1_k2_values = dcn314_calculate_dccg_k1_k2_values,
|
.calculate_dccg_k1_k2_values = dcn314_calculate_dccg_k1_k2_values,
|
||||||
|
.set_pixels_per_cycle = dcn314_set_pixels_per_cycle,
|
||||||
|
.is_dp_dig_pixel_rate_div_policy = dcn314_is_dp_dig_pixel_rate_div_policy,
|
||||||
};
|
};
|
||||||
|
|
||||||
void dcn314_hw_sequencer_construct(struct dc *dc)
|
void dcn314_hw_sequencer_construct(struct dc *dc)
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
#include "dce110/dce110_resource.h"
|
#include "dce110/dce110_resource.h"
|
||||||
#include "dml/display_mode_vba.h"
|
#include "dml/display_mode_vba.h"
|
||||||
#include "dml/dcn31/dcn31_fpu.h"
|
#include "dml/dcn31/dcn31_fpu.h"
|
||||||
|
#include "dml/dcn314/dcn314_fpu.h"
|
||||||
#include "dcn314/dcn314_dccg.h"
|
#include "dcn314/dcn314_dccg.h"
|
||||||
#include "dcn10/dcn10_resource.h"
|
#include "dcn10/dcn10_resource.h"
|
||||||
#include "dcn31/dcn31_panel_cntl.h"
|
#include "dcn31/dcn31_panel_cntl.h"
|
||||||
@ -132,155 +133,6 @@ static const struct IP_BASE DCN_BASE = { { { { 0x00000012, 0x000000C0, 0x000034C
|
|||||||
|
|
||||||
#define DC_LOGGER_INIT(logger)
|
#define DC_LOGGER_INIT(logger)
|
||||||
|
|
||||||
#define DCN3_14_DEFAULT_DET_SIZE 384
|
|
||||||
#define DCN3_14_MAX_DET_SIZE 384
|
|
||||||
#define DCN3_14_MIN_COMPBUF_SIZE_KB 128
|
|
||||||
#define DCN3_14_CRB_SEGMENT_SIZE_KB 64
|
|
||||||
struct _vcs_dpi_ip_params_st dcn3_14_ip = {
|
|
||||||
.VBlankNomDefaultUS = 668,
|
|
||||||
.gpuvm_enable = 1,
|
|
||||||
.gpuvm_max_page_table_levels = 1,
|
|
||||||
.hostvm_enable = 1,
|
|
||||||
.hostvm_max_page_table_levels = 2,
|
|
||||||
.rob_buffer_size_kbytes = 64,
|
|
||||||
.det_buffer_size_kbytes = DCN3_14_DEFAULT_DET_SIZE,
|
|
||||||
.config_return_buffer_size_in_kbytes = 1792,
|
|
||||||
.compressed_buffer_segment_size_in_kbytes = 64,
|
|
||||||
.meta_fifo_size_in_kentries = 32,
|
|
||||||
.zero_size_buffer_entries = 512,
|
|
||||||
.compbuf_reserved_space_64b = 256,
|
|
||||||
.compbuf_reserved_space_zs = 64,
|
|
||||||
.dpp_output_buffer_pixels = 2560,
|
|
||||||
.opp_output_buffer_lines = 1,
|
|
||||||
.pixel_chunk_size_kbytes = 8,
|
|
||||||
.meta_chunk_size_kbytes = 2,
|
|
||||||
.min_meta_chunk_size_bytes = 256,
|
|
||||||
.writeback_chunk_size_kbytes = 8,
|
|
||||||
.ptoi_supported = false,
|
|
||||||
.num_dsc = 4,
|
|
||||||
.maximum_dsc_bits_per_component = 10,
|
|
||||||
.dsc422_native_support = false,
|
|
||||||
.is_line_buffer_bpp_fixed = true,
|
|
||||||
.line_buffer_fixed_bpp = 48,
|
|
||||||
.line_buffer_size_bits = 789504,
|
|
||||||
.max_line_buffer_lines = 12,
|
|
||||||
.writeback_interface_buffer_size_kbytes = 90,
|
|
||||||
.max_num_dpp = 4,
|
|
||||||
.max_num_otg = 4,
|
|
||||||
.max_num_hdmi_frl_outputs = 1,
|
|
||||||
.max_num_wb = 1,
|
|
||||||
.max_dchub_pscl_bw_pix_per_clk = 4,
|
|
||||||
.max_pscl_lb_bw_pix_per_clk = 2,
|
|
||||||
.max_lb_vscl_bw_pix_per_clk = 4,
|
|
||||||
.max_vscl_hscl_bw_pix_per_clk = 4,
|
|
||||||
.max_hscl_ratio = 6,
|
|
||||||
.max_vscl_ratio = 6,
|
|
||||||
.max_hscl_taps = 8,
|
|
||||||
.max_vscl_taps = 8,
|
|
||||||
.dpte_buffer_size_in_pte_reqs_luma = 64,
|
|
||||||
.dpte_buffer_size_in_pte_reqs_chroma = 34,
|
|
||||||
.dispclk_ramp_margin_percent = 1,
|
|
||||||
.max_inter_dcn_tile_repeaters = 8,
|
|
||||||
.cursor_buffer_size = 16,
|
|
||||||
.cursor_chunk_size = 2,
|
|
||||||
.writeback_line_buffer_buffer_size = 0,
|
|
||||||
.writeback_min_hscl_ratio = 1,
|
|
||||||
.writeback_min_vscl_ratio = 1,
|
|
||||||
.writeback_max_hscl_ratio = 1,
|
|
||||||
.writeback_max_vscl_ratio = 1,
|
|
||||||
.writeback_max_hscl_taps = 1,
|
|
||||||
.writeback_max_vscl_taps = 1,
|
|
||||||
.dppclk_delay_subtotal = 46,
|
|
||||||
.dppclk_delay_scl = 50,
|
|
||||||
.dppclk_delay_scl_lb_only = 16,
|
|
||||||
.dppclk_delay_cnvc_formatter = 27,
|
|
||||||
.dppclk_delay_cnvc_cursor = 6,
|
|
||||||
.dispclk_delay_subtotal = 119,
|
|
||||||
.dynamic_metadata_vm_enabled = false,
|
|
||||||
.odm_combine_4to1_supported = false,
|
|
||||||
.dcc_supported = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = {
|
|
||||||
/*TODO: correct dispclk/dppclk voltage level determination*/
|
|
||||||
.clock_limits = {
|
|
||||||
{
|
|
||||||
.state = 0,
|
|
||||||
.dispclk_mhz = 1200.0,
|
|
||||||
.dppclk_mhz = 1200.0,
|
|
||||||
.phyclk_mhz = 600.0,
|
|
||||||
.phyclk_d18_mhz = 667.0,
|
|
||||||
.dscclk_mhz = 186.0,
|
|
||||||
.dtbclk_mhz = 625.0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.state = 1,
|
|
||||||
.dispclk_mhz = 1200.0,
|
|
||||||
.dppclk_mhz = 1200.0,
|
|
||||||
.phyclk_mhz = 810.0,
|
|
||||||
.phyclk_d18_mhz = 667.0,
|
|
||||||
.dscclk_mhz = 209.0,
|
|
||||||
.dtbclk_mhz = 625.0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.state = 2,
|
|
||||||
.dispclk_mhz = 1200.0,
|
|
||||||
.dppclk_mhz = 1200.0,
|
|
||||||
.phyclk_mhz = 810.0,
|
|
||||||
.phyclk_d18_mhz = 667.0,
|
|
||||||
.dscclk_mhz = 209.0,
|
|
||||||
.dtbclk_mhz = 625.0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.state = 3,
|
|
||||||
.dispclk_mhz = 1200.0,
|
|
||||||
.dppclk_mhz = 1200.0,
|
|
||||||
.phyclk_mhz = 810.0,
|
|
||||||
.phyclk_d18_mhz = 667.0,
|
|
||||||
.dscclk_mhz = 371.0,
|
|
||||||
.dtbclk_mhz = 625.0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.state = 4,
|
|
||||||
.dispclk_mhz = 1200.0,
|
|
||||||
.dppclk_mhz = 1200.0,
|
|
||||||
.phyclk_mhz = 810.0,
|
|
||||||
.phyclk_d18_mhz = 667.0,
|
|
||||||
.dscclk_mhz = 417.0,
|
|
||||||
.dtbclk_mhz = 625.0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
.num_states = 5,
|
|
||||||
.sr_exit_time_us = 9.0,
|
|
||||||
.sr_enter_plus_exit_time_us = 11.0,
|
|
||||||
.sr_exit_z8_time_us = 442.0,
|
|
||||||
.sr_enter_plus_exit_z8_time_us = 560.0,
|
|
||||||
.writeback_latency_us = 12.0,
|
|
||||||
.dram_channel_width_bytes = 4,
|
|
||||||
.round_trip_ping_latency_dcfclk_cycles = 106,
|
|
||||||
.urgent_latency_pixel_data_only_us = 4.0,
|
|
||||||
.urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
|
|
||||||
.urgent_latency_vm_data_only_us = 4.0,
|
|
||||||
.urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
|
|
||||||
.urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
|
|
||||||
.urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
|
|
||||||
.pct_ideal_sdp_bw_after_urgent = 80.0,
|
|
||||||
.pct_ideal_dram_sdp_bw_after_urgent_pixel_only = 65.0,
|
|
||||||
.pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm = 60.0,
|
|
||||||
.pct_ideal_dram_sdp_bw_after_urgent_vm_only = 30.0,
|
|
||||||
.max_avg_sdp_bw_use_normal_percent = 60.0,
|
|
||||||
.max_avg_dram_bw_use_normal_percent = 60.0,
|
|
||||||
.fabric_datapath_to_dcn_data_return_bytes = 32,
|
|
||||||
.return_bus_width_bytes = 64,
|
|
||||||
.downspread_percent = 0.38,
|
|
||||||
.dcn_downspread_percent = 0.5,
|
|
||||||
.gpuvm_min_page_size_bytes = 4096,
|
|
||||||
.hostvm_min_page_size_bytes = 4096,
|
|
||||||
.do_urgent_latency_adjustment = false,
|
|
||||||
.urgent_latency_adjustment_fabric_clock_component_us = 0,
|
|
||||||
.urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum dcn31_clk_src_array_id {
|
enum dcn31_clk_src_array_id {
|
||||||
DCN31_CLK_SRC_PLL0,
|
DCN31_CLK_SRC_PLL0,
|
||||||
DCN31_CLK_SRC_PLL1,
|
DCN31_CLK_SRC_PLL1,
|
||||||
@ -1402,7 +1254,7 @@ static struct stream_encoder *dcn314_stream_encoder_create(
|
|||||||
int afmt_inst;
|
int afmt_inst;
|
||||||
|
|
||||||
/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
|
/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
|
||||||
if (eng_id <= ENGINE_ID_DIGF) {
|
if (eng_id < ENGINE_ID_DIGF) {
|
||||||
vpg_inst = eng_id;
|
vpg_inst = eng_id;
|
||||||
afmt_inst = eng_id;
|
afmt_inst = eng_id;
|
||||||
} else
|
} else
|
||||||
@ -1447,7 +1299,8 @@ static struct hpo_dp_stream_encoder *dcn31_hpo_dp_stream_encoder_create(
|
|||||||
* VPG[8] -> HPO_DP[2]
|
* VPG[8] -> HPO_DP[2]
|
||||||
* VPG[9] -> HPO_DP[3]
|
* VPG[9] -> HPO_DP[3]
|
||||||
*/
|
*/
|
||||||
vpg_inst = hpo_dp_inst + 6;
|
//Uses offset index 5-8, but actually maps to vpg_inst 6-9
|
||||||
|
vpg_inst = hpo_dp_inst + 5;
|
||||||
|
|
||||||
/* Mapping of APG register blocks to HPO DP block instance:
|
/* Mapping of APG register blocks to HPO DP block instance:
|
||||||
* APG[0] -> HPO_DP[0]
|
* APG[0] -> HPO_DP[0]
|
||||||
@ -1793,109 +1646,16 @@ static struct clock_source *dcn31_clock_source_create(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_dual_plane(enum surface_pixel_format format)
|
|
||||||
{
|
|
||||||
return format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN || format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dcn314_populate_dml_pipes_from_context(
|
static int dcn314_populate_dml_pipes_from_context(
|
||||||
struct dc *dc, struct dc_state *context,
|
struct dc *dc, struct dc_state *context,
|
||||||
display_e2e_pipe_params_st *pipes,
|
display_e2e_pipe_params_st *pipes,
|
||||||
bool fast_validate)
|
bool fast_validate)
|
||||||
{
|
{
|
||||||
int i, pipe_cnt;
|
int pipe_cnt;
|
||||||
struct resource_context *res_ctx = &context->res_ctx;
|
|
||||||
struct pipe_ctx *pipe;
|
|
||||||
bool upscaled = false;
|
|
||||||
|
|
||||||
dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
|
DC_FP_START();
|
||||||
|
pipe_cnt = dcn314_populate_dml_pipes_from_context_fpu(dc, context, pipes, fast_validate);
|
||||||
for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
|
DC_FP_END();
|
||||||
struct dc_crtc_timing *timing;
|
|
||||||
|
|
||||||
if (!res_ctx->pipe_ctx[i].stream)
|
|
||||||
continue;
|
|
||||||
pipe = &res_ctx->pipe_ctx[i];
|
|
||||||
timing = &pipe->stream->timing;
|
|
||||||
|
|
||||||
if (dc_extended_blank_supported(dc) && pipe->stream->adjust.v_total_max == pipe->stream->adjust.v_total_min
|
|
||||||
&& pipe->stream->adjust.v_total_min > timing->v_total)
|
|
||||||
pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min;
|
|
||||||
|
|
||||||
if (pipe->plane_state &&
|
|
||||||
(pipe->plane_state->src_rect.height < pipe->plane_state->dst_rect.height ||
|
|
||||||
pipe->plane_state->src_rect.width < pipe->plane_state->dst_rect.width))
|
|
||||||
upscaled = true;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Immediate flip can be set dynamically after enabling the plane.
|
|
||||||
* We need to require support for immediate flip or underflow can be
|
|
||||||
* intermittently experienced depending on peak b/w requirements.
|
|
||||||
*/
|
|
||||||
pipes[pipe_cnt].pipe.src.immediate_flip = true;
|
|
||||||
|
|
||||||
pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
|
|
||||||
pipes[pipe_cnt].pipe.src.hostvm = dc->res_pool->hubbub->riommu_active;
|
|
||||||
pipes[pipe_cnt].pipe.src.gpuvm = true;
|
|
||||||
pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0;
|
|
||||||
pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0;
|
|
||||||
pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch;
|
|
||||||
pipes[pipe_cnt].pipe.src.dcc_rate = 3;
|
|
||||||
pipes[pipe_cnt].dout.dsc_input_bpc = 0;
|
|
||||||
|
|
||||||
if (pipes[pipe_cnt].dout.dsc_enable) {
|
|
||||||
switch (timing->display_color_depth) {
|
|
||||||
case COLOR_DEPTH_888:
|
|
||||||
pipes[pipe_cnt].dout.dsc_input_bpc = 8;
|
|
||||||
break;
|
|
||||||
case COLOR_DEPTH_101010:
|
|
||||||
pipes[pipe_cnt].dout.dsc_input_bpc = 10;
|
|
||||||
break;
|
|
||||||
case COLOR_DEPTH_121212:
|
|
||||||
pipes[pipe_cnt].dout.dsc_input_bpc = 12;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe_cnt++;
|
|
||||||
}
|
|
||||||
context->bw_ctx.dml.ip.det_buffer_size_kbytes = DCN3_14_DEFAULT_DET_SIZE;
|
|
||||||
|
|
||||||
dc->config.enable_4to1MPC = false;
|
|
||||||
if (pipe_cnt == 1 && pipe->plane_state && !dc->debug.disable_z9_mpc) {
|
|
||||||
if (is_dual_plane(pipe->plane_state->format)
|
|
||||||
&& pipe->plane_state->src_rect.width <= 1920 && pipe->plane_state->src_rect.height <= 1080) {
|
|
||||||
dc->config.enable_4to1MPC = true;
|
|
||||||
} else if (!is_dual_plane(pipe->plane_state->format) && pipe->plane_state->src_rect.width <= 5120) {
|
|
||||||
/* Limit to 5k max to avoid forced pipe split when there is not enough detile for swath */
|
|
||||||
context->bw_ctx.dml.ip.det_buffer_size_kbytes = 192;
|
|
||||||
pipes[0].pipe.src.unbounded_req_mode = true;
|
|
||||||
}
|
|
||||||
} else if (context->stream_count >= dc->debug.crb_alloc_policy_min_disp_count
|
|
||||||
&& dc->debug.crb_alloc_policy > DET_SIZE_DEFAULT) {
|
|
||||||
context->bw_ctx.dml.ip.det_buffer_size_kbytes = dc->debug.crb_alloc_policy * 64;
|
|
||||||
} else if (context->stream_count >= 3 && upscaled) {
|
|
||||||
context->bw_ctx.dml.ip.det_buffer_size_kbytes = 192;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
|
||||||
struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
|
|
||||||
|
|
||||||
if (!pipe->stream)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (pipe->stream->signal == SIGNAL_TYPE_EDP && dc->debug.seamless_boot_odm_combine &&
|
|
||||||
pipe->stream->apply_seamless_boot_optimization) {
|
|
||||||
|
|
||||||
if (pipe->stream->apply_boot_odm_mode == dm_odm_combine_policy_2to1) {
|
|
||||||
context->bw_ctx.dml.vba.ODMCombinePolicy = dm_odm_combine_policy_2to1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pipe_cnt;
|
return pipe_cnt;
|
||||||
}
|
}
|
||||||
@ -1906,88 +1666,9 @@ static struct dc_cap_funcs cap_funcs = {
|
|||||||
|
|
||||||
static void dcn314_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
|
static void dcn314_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
|
||||||
{
|
{
|
||||||
struct clk_limit_table *clk_table = &bw_params->clk_table;
|
DC_FP_START();
|
||||||
struct _vcs_dpi_voltage_scaling_st *clock_tmp = dcn3_14_soc._clock_tmp;
|
dcn314_update_bw_bounding_box_fpu(dc, bw_params);
|
||||||
unsigned int i, closest_clk_lvl;
|
DC_FP_END();
|
||||||
int max_dispclk_mhz = 0, max_dppclk_mhz = 0;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
// Default clock levels are used for diags, which may lead to overclocking.
|
|
||||||
if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
|
|
||||||
|
|
||||||
dcn3_14_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator;
|
|
||||||
dcn3_14_ip.max_num_dpp = dc->res_pool->pipe_count;
|
|
||||||
|
|
||||||
if (bw_params->num_channels > 0)
|
|
||||||
dcn3_14_soc.num_chans = bw_params->num_channels;
|
|
||||||
|
|
||||||
ASSERT(dcn3_14_soc.num_chans);
|
|
||||||
ASSERT(clk_table->num_entries);
|
|
||||||
|
|
||||||
/* Prepass to find max clocks independent of voltage level. */
|
|
||||||
for (i = 0; i < clk_table->num_entries; ++i) {
|
|
||||||
if (clk_table->entries[i].dispclk_mhz > max_dispclk_mhz)
|
|
||||||
max_dispclk_mhz = clk_table->entries[i].dispclk_mhz;
|
|
||||||
if (clk_table->entries[i].dppclk_mhz > max_dppclk_mhz)
|
|
||||||
max_dppclk_mhz = clk_table->entries[i].dppclk_mhz;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < clk_table->num_entries; i++) {
|
|
||||||
/* loop backwards*/
|
|
||||||
for (closest_clk_lvl = 0, j = dcn3_14_soc.num_states - 1; j >= 0; j--) {
|
|
||||||
if ((unsigned int) dcn3_14_soc.clock_limits[j].dcfclk_mhz <= clk_table->entries[i].dcfclk_mhz) {
|
|
||||||
closest_clk_lvl = j;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (clk_table->num_entries == 1) {
|
|
||||||
/*smu gives one DPM level, let's take the highest one*/
|
|
||||||
closest_clk_lvl = dcn3_14_soc.num_states - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
clock_tmp[i].state = i;
|
|
||||||
|
|
||||||
/* Clocks dependent on voltage level. */
|
|
||||||
clock_tmp[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
|
|
||||||
if (clk_table->num_entries == 1 &&
|
|
||||||
clock_tmp[i].dcfclk_mhz < dcn3_14_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) {
|
|
||||||
/*SMU fix not released yet*/
|
|
||||||
clock_tmp[i].dcfclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dcfclk_mhz;
|
|
||||||
}
|
|
||||||
clock_tmp[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
|
|
||||||
clock_tmp[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
|
|
||||||
|
|
||||||
if (clk_table->entries[i].memclk_mhz && clk_table->entries[i].wck_ratio)
|
|
||||||
clock_tmp[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
|
|
||||||
|
|
||||||
/* Clocks independent of voltage level. */
|
|
||||||
clock_tmp[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
|
|
||||||
dcn3_14_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
|
|
||||||
|
|
||||||
clock_tmp[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
|
|
||||||
dcn3_14_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
|
|
||||||
|
|
||||||
clock_tmp[i].dram_bw_per_chan_gbps = dcn3_14_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
|
|
||||||
clock_tmp[i].dscclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
|
|
||||||
clock_tmp[i].dtbclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
|
|
||||||
clock_tmp[i].phyclk_d18_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
|
|
||||||
clock_tmp[i].phyclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
|
|
||||||
}
|
|
||||||
for (i = 0; i < clk_table->num_entries; i++)
|
|
||||||
dcn3_14_soc.clock_limits[i] = clock_tmp[i];
|
|
||||||
if (clk_table->num_entries)
|
|
||||||
dcn3_14_soc.num_states = clk_table->num_entries;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (max_dispclk_mhz) {
|
|
||||||
dcn3_14_soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz * 2;
|
|
||||||
dc->dml.soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment))
|
|
||||||
dml_init_instance(&dc->dml, &dcn3_14_soc, &dcn3_14_ip, DML_PROJECT_DCN31);
|
|
||||||
else
|
|
||||||
dml_init_instance(&dc->dml, &dcn3_14_soc, &dcn3_14_ip, DML_PROJECT_DCN31_FPGA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct resource_funcs dcn314_res_pool_funcs = {
|
static struct resource_funcs dcn314_res_pool_funcs = {
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
#include "core_types.h"
|
#include "core_types.h"
|
||||||
|
|
||||||
|
extern struct _vcs_dpi_ip_params_st dcn3_14_ip;
|
||||||
|
extern struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc;
|
||||||
|
|
||||||
#define TO_DCN314_RES_POOL(pool)\
|
#define TO_DCN314_RES_POOL(pool)\
|
||||||
container_of(pool, struct dcn314_resource_pool, base)
|
container_of(pool, struct dcn314_resource_pool, base)
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
container_of(pool, struct dcn315_resource_pool, base)
|
container_of(pool, struct dcn315_resource_pool, base)
|
||||||
|
|
||||||
extern struct _vcs_dpi_ip_params_st dcn3_15_ip;
|
extern struct _vcs_dpi_ip_params_st dcn3_15_ip;
|
||||||
extern struct _vcs_dpi_ip_params_st dcn3_15_soc;
|
|
||||||
|
|
||||||
struct dcn315_resource_pool {
|
struct dcn315_resource_pool {
|
||||||
struct resource_pool base;
|
struct resource_pool base;
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
container_of(pool, struct dcn316_resource_pool, base)
|
container_of(pool, struct dcn316_resource_pool, base)
|
||||||
|
|
||||||
extern struct _vcs_dpi_ip_params_st dcn3_16_ip;
|
extern struct _vcs_dpi_ip_params_st dcn3_16_ip;
|
||||||
extern struct _vcs_dpi_ip_params_st dcn3_16_soc;
|
|
||||||
|
|
||||||
struct dcn316_resource_pool {
|
struct dcn316_resource_pool {
|
||||||
struct resource_pool base;
|
struct resource_pool base;
|
||||||
|
@ -250,6 +250,7 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c
|
|||||||
uint32_t total_lines = 0;
|
uint32_t total_lines = 0;
|
||||||
uint32_t lines_per_way = 0;
|
uint32_t lines_per_way = 0;
|
||||||
uint32_t num_ways = 0;
|
uint32_t num_ways = 0;
|
||||||
|
uint32_t prev_addr_low = 0;
|
||||||
|
|
||||||
for (i = 0; i < ctx->stream_count; i++) {
|
for (i = 0; i < ctx->stream_count; i++) {
|
||||||
stream = ctx->streams[i];
|
stream = ctx->streams[i];
|
||||||
@ -267,10 +268,20 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c
|
|||||||
plane = ctx->stream_status[i].plane_states[j];
|
plane = ctx->stream_status[i].plane_states[j];
|
||||||
|
|
||||||
// Calculate total surface size
|
// Calculate total surface size
|
||||||
surface_size = plane->plane_size.surface_pitch *
|
if (prev_addr_low != plane->address.grph.addr.u.low_part) {
|
||||||
|
/* if plane address are different from prev FB, then userspace allocated separate FBs*/
|
||||||
|
surface_size += plane->plane_size.surface_pitch *
|
||||||
plane->plane_size.surface_size.height *
|
plane->plane_size.surface_size.height *
|
||||||
(plane->format >= SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 ? 8 : 4);
|
(plane->format >= SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 ? 8 : 4);
|
||||||
|
|
||||||
|
prev_addr_low = plane->address.grph.addr.u.low_part;
|
||||||
|
} else {
|
||||||
|
/* We have the same fb for all the planes.
|
||||||
|
* Xorg always creates one giant fb that holds all surfaces,
|
||||||
|
* so allocating it once is sufficient.
|
||||||
|
* */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Convert surface size + starting address to number of cache lines required
|
// Convert surface size + starting address to number of cache lines required
|
||||||
// (alignment accounted for)
|
// (alignment accounted for)
|
||||||
cache_lines_used += dcn32_cache_lines_for_surface(dc, surface_size,
|
cache_lines_used += dcn32_cache_lines_for_surface(dc, surface_size,
|
||||||
@ -320,7 +331,10 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c
|
|||||||
bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable)
|
bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable)
|
||||||
{
|
{
|
||||||
union dmub_rb_cmd cmd;
|
union dmub_rb_cmd cmd;
|
||||||
uint8_t ways;
|
uint8_t ways, i;
|
||||||
|
int j;
|
||||||
|
bool stereo_in_use = false;
|
||||||
|
struct dc_plane_state *plane = NULL;
|
||||||
|
|
||||||
if (!dc->ctx->dmub_srv)
|
if (!dc->ctx->dmub_srv)
|
||||||
return false;
|
return false;
|
||||||
@ -349,7 +363,23 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable)
|
|||||||
* and configure HUBP's to fetch from MALL
|
* and configure HUBP's to fetch from MALL
|
||||||
*/
|
*/
|
||||||
ways = dcn32_calculate_cab_allocation(dc, dc->current_state);
|
ways = dcn32_calculate_cab_allocation(dc, dc->current_state);
|
||||||
if (ways <= dc->caps.cache_num_ways) {
|
|
||||||
|
/* MALL not supported with Stereo3D. If any plane is using stereo,
|
||||||
|
* don't try to enter MALL.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < dc->current_state->stream_count; i++) {
|
||||||
|
for (j = 0; j < dc->current_state->stream_status[i].plane_count; j++) {
|
||||||
|
plane = dc->current_state->stream_status[i].plane_states[j];
|
||||||
|
|
||||||
|
if (plane->address.type == PLN_ADDR_TYPE_GRPH_STEREO) {
|
||||||
|
stereo_in_use = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stereo_in_use)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ways <= dc->caps.cache_num_ways && !stereo_in_use) {
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS;
|
cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS;
|
||||||
cmd.cab.header.sub_type = DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB;
|
cmd.cab.header.sub_type = DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB;
|
||||||
@ -683,9 +713,11 @@ void dcn32_update_mall_sel(struct dc *dc, struct dc_state *context)
|
|||||||
if (pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
|
if (pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
|
||||||
hubp->funcs->hubp_update_mall_sel(hubp, 1, false);
|
hubp->funcs->hubp_update_mall_sel(hubp, 1, false);
|
||||||
} else {
|
} else {
|
||||||
|
// MALL not supported with Stereo3D
|
||||||
hubp->funcs->hubp_update_mall_sel(hubp,
|
hubp->funcs->hubp_update_mall_sel(hubp,
|
||||||
num_ways <= dc->caps.cache_num_ways &&
|
num_ways <= dc->caps.cache_num_ways &&
|
||||||
pipe->stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED ? 2 : 0,
|
pipe->stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED &&
|
||||||
|
pipe->plane_state->address.type != PLN_ADDR_TYPE_GRPH_STEREO ? 2 : 0,
|
||||||
cache_cursor);
|
cache_cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ static struct timing_generator_funcs dcn32_tg_funcs = {
|
|||||||
.lock_doublebuffer_enable = optc3_lock_doublebuffer_enable,
|
.lock_doublebuffer_enable = optc3_lock_doublebuffer_enable,
|
||||||
.lock_doublebuffer_disable = optc3_lock_doublebuffer_disable,
|
.lock_doublebuffer_disable = optc3_lock_doublebuffer_disable,
|
||||||
.enable_optc_clock = optc1_enable_optc_clock,
|
.enable_optc_clock = optc1_enable_optc_clock,
|
||||||
.set_drr = optc31_set_drr, // TODO: Update to optc32_set_drr once FW headers are promoted
|
.set_drr = optc32_set_drr,
|
||||||
.get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal,
|
.get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal,
|
||||||
.set_vtotal_min_max = optc3_set_vtotal_min_max,
|
.set_vtotal_min_max = optc3_set_vtotal_min_max,
|
||||||
.set_static_screen_control = optc1_set_static_screen_control,
|
.set_static_screen_control = optc1_set_static_screen_control,
|
||||||
|
@ -867,7 +867,7 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
.use_max_lb = true,
|
.use_max_lb = true,
|
||||||
.force_disable_subvp = true,
|
.force_disable_subvp = false,
|
||||||
.exit_idle_opt_for_cursor_updates = true,
|
.exit_idle_opt_for_cursor_updates = true,
|
||||||
.enable_single_display_2to1_odm_policy = true,
|
.enable_single_display_2to1_odm_policy = true,
|
||||||
.enable_dp_dig_pixel_rate_div_policy = 1,
|
.enable_dp_dig_pixel_rate_div_policy = 1,
|
||||||
@ -2051,6 +2051,7 @@ static bool dcn32_resource_construct(
|
|||||||
dc->caps.max_cab_allocation_bytes = 67108864; // 64MB = 1024 * 1024 * 64
|
dc->caps.max_cab_allocation_bytes = 67108864; // 64MB = 1024 * 1024 * 64
|
||||||
dc->caps.subvp_fw_processing_delay_us = 15;
|
dc->caps.subvp_fw_processing_delay_us = 15;
|
||||||
dc->caps.subvp_prefetch_end_to_mall_start_us = 15;
|
dc->caps.subvp_prefetch_end_to_mall_start_us = 15;
|
||||||
|
dc->caps.subvp_swath_height_margin_lines = 16;
|
||||||
dc->caps.subvp_pstate_allow_width_us = 20;
|
dc->caps.subvp_pstate_allow_width_us = 20;
|
||||||
dc->caps.subvp_vertical_int_margin_us = 30;
|
dc->caps.subvp_vertical_int_margin_us = 30;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_stat
|
|||||||
if (pipe->stream && pipe->plane_state && !pipe->top_pipe &&
|
if (pipe->stream && pipe->plane_state && !pipe->top_pipe &&
|
||||||
pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
|
pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
|
||||||
bytes_per_pixel = pipe->plane_state->format >= SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 ? 8 : 4;
|
bytes_per_pixel = pipe->plane_state->format >= SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 ? 8 : 4;
|
||||||
mall_region_pixels = pipe->stream->timing.h_addressable * pipe->stream->timing.v_addressable;
|
mall_region_pixels = pipe->plane_state->plane_size.surface_pitch * pipe->stream->timing.v_addressable;
|
||||||
|
|
||||||
// For bytes required in MALL, calculate based on number of MBlks required
|
// For bytes required in MALL, calculate based on number of MBlks required
|
||||||
num_mblks = (mall_region_pixels * bytes_per_pixel +
|
num_mblks = (mall_region_pixels * bytes_per_pixel +
|
||||||
|
@ -868,7 +868,7 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
.use_max_lb = true,
|
.use_max_lb = true,
|
||||||
.force_disable_subvp = true,
|
.force_disable_subvp = false,
|
||||||
.exit_idle_opt_for_cursor_updates = true,
|
.exit_idle_opt_for_cursor_updates = true,
|
||||||
.enable_single_display_2to1_odm_policy = true,
|
.enable_single_display_2to1_odm_policy = true,
|
||||||
.enable_dp_dig_pixel_rate_div_policy = 1,
|
.enable_dp_dig_pixel_rate_div_policy = 1,
|
||||||
@ -1662,8 +1662,9 @@ static bool dcn321_resource_construct(
|
|||||||
dc->caps.max_cab_allocation_bytes = 33554432; // 32MB = 1024 * 1024 * 32
|
dc->caps.max_cab_allocation_bytes = 33554432; // 32MB = 1024 * 1024 * 32
|
||||||
dc->caps.subvp_fw_processing_delay_us = 15;
|
dc->caps.subvp_fw_processing_delay_us = 15;
|
||||||
dc->caps.subvp_prefetch_end_to_mall_start_us = 15;
|
dc->caps.subvp_prefetch_end_to_mall_start_us = 15;
|
||||||
|
dc->caps.subvp_swath_height_margin_lines = 16;
|
||||||
dc->caps.subvp_pstate_allow_width_us = 20;
|
dc->caps.subvp_pstate_allow_width_us = 20;
|
||||||
|
dc->caps.subvp_vertical_int_margin_us = 30;
|
||||||
dc->caps.max_slave_planes = 1;
|
dc->caps.max_slave_planes = 1;
|
||||||
dc->caps.max_slave_yuv_planes = 1;
|
dc->caps.max_slave_yuv_planes = 1;
|
||||||
dc->caps.max_slave_rgb_planes = 1;
|
dc->caps.max_slave_rgb_planes = 1;
|
||||||
|
@ -61,7 +61,6 @@ CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags)
|
|||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags)
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags)
|
||||||
@ -71,6 +70,7 @@ CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_ccflags) $(fram
|
|||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_mode_vba_31.o := $(dml_ccflags) $(frame_warn_flag)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_mode_vba_31.o := $(dml_ccflags) $(frame_warn_flag)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_rq_dlg_calc_31.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn31/display_rq_dlg_calc_31.o := $(dml_ccflags)
|
||||||
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn314/dcn314_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_32.o := $(dml_ccflags) $(frame_warn_flag)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_32.o := $(dml_ccflags) $(frame_warn_flag)
|
||||||
@ -82,7 +82,6 @@ CFLAGS_$(AMDDALPATH)/dc/dml/dcn301/dcn301_fpu.o := $(dml_ccflags)
|
|||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags)
|
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_ccflags) -Wno-tautological-compare
|
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_ccflags) -Wno-tautological-compare
|
||||||
@ -131,6 +130,7 @@ DML += dcn321/dcn321_fpu.o
|
|||||||
DML += dcn301/dcn301_fpu.o
|
DML += dcn301/dcn301_fpu.o
|
||||||
DML += dcn302/dcn302_fpu.o
|
DML += dcn302/dcn302_fpu.o
|
||||||
DML += dcn303/dcn303_fpu.o
|
DML += dcn303/dcn303_fpu.o
|
||||||
|
DML += dcn314/dcn314_fpu.o
|
||||||
DML += dsc/rc_calc_fpu.o
|
DML += dsc/rc_calc_fpu.o
|
||||||
DML += calcs/dcn_calcs.o calcs/dcn_calc_math.o calcs/dcn_calc_auto.o
|
DML += calcs/dcn_calcs.o calcs/dcn_calc_math.o calcs/dcn_calc_auto.o
|
||||||
endif
|
endif
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "dchubbub.h"
|
#include "dchubbub.h"
|
||||||
#include "dcn20/dcn20_resource.h"
|
#include "dcn20/dcn20_resource.h"
|
||||||
#include "dcn21/dcn21_resource.h"
|
#include "dcn21/dcn21_resource.h"
|
||||||
|
#include "clk_mgr/dcn21/rn_clk_mgr.h"
|
||||||
|
|
||||||
#include "dcn20_fpu.h"
|
#include "dcn20_fpu.h"
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "clk_mgr.h"
|
#include "clk_mgr.h"
|
||||||
#include "dcn20/dcn20_resource.h"
|
#include "dcn20/dcn20_resource.h"
|
||||||
#include "dcn301/dcn301_resource.h"
|
#include "dcn301/dcn301_resource.h"
|
||||||
|
#include "clk_mgr/dcn301/vg_clk_mgr.h"
|
||||||
|
|
||||||
#include "dml/dcn20/dcn20_fpu.h"
|
#include "dml/dcn20/dcn20_fpu.h"
|
||||||
#include "dcn301_fpu.h"
|
#include "dcn301_fpu.h"
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "clk_mgr.h"
|
#include "clk_mgr.h"
|
||||||
|
#include "dcn31/dcn31_resource.h"
|
||||||
|
#include "dcn315/dcn315_resource.h"
|
||||||
|
#include "dcn316/dcn316_resource.h"
|
||||||
|
|
||||||
#include "dml/dcn20/dcn20_fpu.h"
|
#include "dml/dcn20/dcn20_fpu.h"
|
||||||
#include "dcn31_fpu.h"
|
#include "dcn31_fpu.h"
|
||||||
@ -114,7 +117,7 @@ struct _vcs_dpi_ip_params_st dcn3_1_ip = {
|
|||||||
.dcc_supported = true,
|
.dcc_supported = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _vcs_dpi_soc_bounding_box_st dcn3_1_soc = {
|
static struct _vcs_dpi_soc_bounding_box_st dcn3_1_soc = {
|
||||||
/*TODO: correct dispclk/dppclk voltage level determination*/
|
/*TODO: correct dispclk/dppclk voltage level determination*/
|
||||||
.clock_limits = {
|
.clock_limits = {
|
||||||
{
|
{
|
||||||
@ -259,7 +262,7 @@ struct _vcs_dpi_ip_params_st dcn3_15_ip = {
|
|||||||
.dcc_supported = true,
|
.dcc_supported = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = {
|
static struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = {
|
||||||
.sr_exit_time_us = 9.0,
|
.sr_exit_time_us = 9.0,
|
||||||
.sr_enter_plus_exit_time_us = 11.0,
|
.sr_enter_plus_exit_time_us = 11.0,
|
||||||
.sr_exit_z8_time_us = 50.0,
|
.sr_exit_z8_time_us = 50.0,
|
||||||
@ -355,7 +358,7 @@ struct _vcs_dpi_ip_params_st dcn3_16_ip = {
|
|||||||
.dcc_supported = true,
|
.dcc_supported = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _vcs_dpi_soc_bounding_box_st dcn3_16_soc = {
|
static struct _vcs_dpi_soc_bounding_box_st dcn3_16_soc = {
|
||||||
/*TODO: correct dispclk/dppclk voltage level determination*/
|
/*TODO: correct dispclk/dppclk voltage level determination*/
|
||||||
.clock_limits = {
|
.clock_limits = {
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "dc.h"
|
#include "dc.h"
|
||||||
#include "dc_link.h"
|
#include "dc_link.h"
|
||||||
#include "../display_mode_lib.h"
|
#include "../display_mode_lib.h"
|
||||||
#include "dml/dcn30/display_mode_vba_30.h"
|
#include "../dcn30/display_mode_vba_30.h"
|
||||||
#include "display_mode_vba_31.h"
|
#include "display_mode_vba_31.h"
|
||||||
#include "../dml_inline_defs.h"
|
#include "../dml_inline_defs.h"
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "../display_mode_vba.h"
|
#include "../display_mode_vba.h"
|
||||||
#include "../dml_inline_defs.h"
|
#include "../dml_inline_defs.h"
|
||||||
#include "display_rq_dlg_calc_31.h"
|
#include "display_rq_dlg_calc_31.h"
|
||||||
#include "dml/dcn30/display_mode_vba_30.h"
|
#include "../dcn30/display_mode_vba_30.h"
|
||||||
|
|
||||||
static bool is_dual_plane(enum source_format_class source_format)
|
static bool is_dual_plane(enum source_format_class source_format)
|
||||||
{
|
{
|
||||||
|
376
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
Normal file
376
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
Normal file
@ -0,0 +1,376 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
/*
|
||||||
|
* Copyright 2022 Advanced Micro Devices, Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*
|
||||||
|
* Authors: AMD
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "clk_mgr.h"
|
||||||
|
#include "resource.h"
|
||||||
|
#include "dcn31/dcn31_hubbub.h"
|
||||||
|
#include "dcn314_fpu.h"
|
||||||
|
#include "dml/dcn20/dcn20_fpu.h"
|
||||||
|
#include "dml/display_mode_vba.h"
|
||||||
|
|
||||||
|
struct _vcs_dpi_ip_params_st dcn3_14_ip = {
|
||||||
|
.VBlankNomDefaultUS = 668,
|
||||||
|
.gpuvm_enable = 1,
|
||||||
|
.gpuvm_max_page_table_levels = 1,
|
||||||
|
.hostvm_enable = 1,
|
||||||
|
.hostvm_max_page_table_levels = 2,
|
||||||
|
.rob_buffer_size_kbytes = 64,
|
||||||
|
.det_buffer_size_kbytes = DCN3_14_DEFAULT_DET_SIZE,
|
||||||
|
.config_return_buffer_size_in_kbytes = 1792,
|
||||||
|
.compressed_buffer_segment_size_in_kbytes = 64,
|
||||||
|
.meta_fifo_size_in_kentries = 32,
|
||||||
|
.zero_size_buffer_entries = 512,
|
||||||
|
.compbuf_reserved_space_64b = 256,
|
||||||
|
.compbuf_reserved_space_zs = 64,
|
||||||
|
.dpp_output_buffer_pixels = 2560,
|
||||||
|
.opp_output_buffer_lines = 1,
|
||||||
|
.pixel_chunk_size_kbytes = 8,
|
||||||
|
.meta_chunk_size_kbytes = 2,
|
||||||
|
.min_meta_chunk_size_bytes = 256,
|
||||||
|
.writeback_chunk_size_kbytes = 8,
|
||||||
|
.ptoi_supported = false,
|
||||||
|
.num_dsc = 4,
|
||||||
|
.maximum_dsc_bits_per_component = 10,
|
||||||
|
.dsc422_native_support = false,
|
||||||
|
.is_line_buffer_bpp_fixed = true,
|
||||||
|
.line_buffer_fixed_bpp = 48,
|
||||||
|
.line_buffer_size_bits = 789504,
|
||||||
|
.max_line_buffer_lines = 12,
|
||||||
|
.writeback_interface_buffer_size_kbytes = 90,
|
||||||
|
.max_num_dpp = 4,
|
||||||
|
.max_num_otg = 4,
|
||||||
|
.max_num_hdmi_frl_outputs = 1,
|
||||||
|
.max_num_wb = 1,
|
||||||
|
.max_dchub_pscl_bw_pix_per_clk = 4,
|
||||||
|
.max_pscl_lb_bw_pix_per_clk = 2,
|
||||||
|
.max_lb_vscl_bw_pix_per_clk = 4,
|
||||||
|
.max_vscl_hscl_bw_pix_per_clk = 4,
|
||||||
|
.max_hscl_ratio = 6,
|
||||||
|
.max_vscl_ratio = 6,
|
||||||
|
.max_hscl_taps = 8,
|
||||||
|
.max_vscl_taps = 8,
|
||||||
|
.dpte_buffer_size_in_pte_reqs_luma = 64,
|
||||||
|
.dpte_buffer_size_in_pte_reqs_chroma = 34,
|
||||||
|
.dispclk_ramp_margin_percent = 1,
|
||||||
|
.max_inter_dcn_tile_repeaters = 8,
|
||||||
|
.cursor_buffer_size = 16,
|
||||||
|
.cursor_chunk_size = 2,
|
||||||
|
.writeback_line_buffer_buffer_size = 0,
|
||||||
|
.writeback_min_hscl_ratio = 1,
|
||||||
|
.writeback_min_vscl_ratio = 1,
|
||||||
|
.writeback_max_hscl_ratio = 1,
|
||||||
|
.writeback_max_vscl_ratio = 1,
|
||||||
|
.writeback_max_hscl_taps = 1,
|
||||||
|
.writeback_max_vscl_taps = 1,
|
||||||
|
.dppclk_delay_subtotal = 46,
|
||||||
|
.dppclk_delay_scl = 50,
|
||||||
|
.dppclk_delay_scl_lb_only = 16,
|
||||||
|
.dppclk_delay_cnvc_formatter = 27,
|
||||||
|
.dppclk_delay_cnvc_cursor = 6,
|
||||||
|
.dispclk_delay_subtotal = 119,
|
||||||
|
.dynamic_metadata_vm_enabled = false,
|
||||||
|
.odm_combine_4to1_supported = false,
|
||||||
|
.dcc_supported = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = {
|
||||||
|
/*TODO: correct dispclk/dppclk voltage level determination*/
|
||||||
|
.clock_limits = {
|
||||||
|
{
|
||||||
|
.state = 0,
|
||||||
|
.dispclk_mhz = 1200.0,
|
||||||
|
.dppclk_mhz = 1200.0,
|
||||||
|
.phyclk_mhz = 600.0,
|
||||||
|
.phyclk_d18_mhz = 667.0,
|
||||||
|
.dscclk_mhz = 186.0,
|
||||||
|
.dtbclk_mhz = 600.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.state = 1,
|
||||||
|
.dispclk_mhz = 1200.0,
|
||||||
|
.dppclk_mhz = 1200.0,
|
||||||
|
.phyclk_mhz = 810.0,
|
||||||
|
.phyclk_d18_mhz = 667.0,
|
||||||
|
.dscclk_mhz = 209.0,
|
||||||
|
.dtbclk_mhz = 600.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.state = 2,
|
||||||
|
.dispclk_mhz = 1200.0,
|
||||||
|
.dppclk_mhz = 1200.0,
|
||||||
|
.phyclk_mhz = 810.0,
|
||||||
|
.phyclk_d18_mhz = 667.0,
|
||||||
|
.dscclk_mhz = 209.0,
|
||||||
|
.dtbclk_mhz = 600.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.state = 3,
|
||||||
|
.dispclk_mhz = 1200.0,
|
||||||
|
.dppclk_mhz = 1200.0,
|
||||||
|
.phyclk_mhz = 810.0,
|
||||||
|
.phyclk_d18_mhz = 667.0,
|
||||||
|
.dscclk_mhz = 371.0,
|
||||||
|
.dtbclk_mhz = 600.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.state = 4,
|
||||||
|
.dispclk_mhz = 1200.0,
|
||||||
|
.dppclk_mhz = 1200.0,
|
||||||
|
.phyclk_mhz = 810.0,
|
||||||
|
.phyclk_d18_mhz = 667.0,
|
||||||
|
.dscclk_mhz = 417.0,
|
||||||
|
.dtbclk_mhz = 600.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
.num_states = 5,
|
||||||
|
.sr_exit_time_us = 9.0,
|
||||||
|
.sr_enter_plus_exit_time_us = 11.0,
|
||||||
|
.sr_exit_z8_time_us = 442.0,
|
||||||
|
.sr_enter_plus_exit_z8_time_us = 560.0,
|
||||||
|
.writeback_latency_us = 12.0,
|
||||||
|
.dram_channel_width_bytes = 4,
|
||||||
|
.round_trip_ping_latency_dcfclk_cycles = 106,
|
||||||
|
.urgent_latency_pixel_data_only_us = 4.0,
|
||||||
|
.urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
|
||||||
|
.urgent_latency_vm_data_only_us = 4.0,
|
||||||
|
.urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
|
||||||
|
.urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
|
||||||
|
.urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
|
||||||
|
.pct_ideal_sdp_bw_after_urgent = 80.0,
|
||||||
|
.pct_ideal_dram_sdp_bw_after_urgent_pixel_only = 65.0,
|
||||||
|
.pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm = 60.0,
|
||||||
|
.pct_ideal_dram_sdp_bw_after_urgent_vm_only = 30.0,
|
||||||
|
.max_avg_sdp_bw_use_normal_percent = 60.0,
|
||||||
|
.max_avg_dram_bw_use_normal_percent = 60.0,
|
||||||
|
.fabric_datapath_to_dcn_data_return_bytes = 32,
|
||||||
|
.return_bus_width_bytes = 64,
|
||||||
|
.downspread_percent = 0.38,
|
||||||
|
.dcn_downspread_percent = 0.5,
|
||||||
|
.gpuvm_min_page_size_bytes = 4096,
|
||||||
|
.hostvm_min_page_size_bytes = 4096,
|
||||||
|
.do_urgent_latency_adjustment = false,
|
||||||
|
.urgent_latency_adjustment_fabric_clock_component_us = 0,
|
||||||
|
.urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void dcn314_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_params)
|
||||||
|
{
|
||||||
|
struct clk_limit_table *clk_table = &bw_params->clk_table;
|
||||||
|
struct _vcs_dpi_voltage_scaling_st *clock_limits =
|
||||||
|
dcn3_14_soc.clock_limits;
|
||||||
|
unsigned int i, closest_clk_lvl;
|
||||||
|
int max_dispclk_mhz = 0, max_dppclk_mhz = 0;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
dc_assert_fp_enabled();
|
||||||
|
|
||||||
|
// Default clock levels are used for diags, which may lead to overclocking.
|
||||||
|
if (!IS_DIAG_DC(dc->ctx->dce_environment) && dc->config.use_default_clock_table == false) {
|
||||||
|
|
||||||
|
dcn3_14_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator;
|
||||||
|
dcn3_14_ip.max_num_dpp = dc->res_pool->pipe_count;
|
||||||
|
|
||||||
|
if (bw_params->num_channels > 0)
|
||||||
|
dcn3_14_soc.num_chans = bw_params->num_channels;
|
||||||
|
|
||||||
|
ASSERT(dcn3_14_soc.num_chans);
|
||||||
|
ASSERT(clk_table->num_entries);
|
||||||
|
|
||||||
|
/* Prepass to find max clocks independent of voltage level. */
|
||||||
|
for (i = 0; i < clk_table->num_entries; ++i) {
|
||||||
|
if (clk_table->entries[i].dispclk_mhz > max_dispclk_mhz)
|
||||||
|
max_dispclk_mhz = clk_table->entries[i].dispclk_mhz;
|
||||||
|
if (clk_table->entries[i].dppclk_mhz > max_dppclk_mhz)
|
||||||
|
max_dppclk_mhz = clk_table->entries[i].dppclk_mhz;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < clk_table->num_entries; i++) {
|
||||||
|
/* loop backwards*/
|
||||||
|
for (closest_clk_lvl = 0, j = dcn3_14_soc.num_states - 1; j >= 0; j--) {
|
||||||
|
if ((unsigned int) dcn3_14_soc.clock_limits[j].dcfclk_mhz <= clk_table->entries[i].dcfclk_mhz) {
|
||||||
|
closest_clk_lvl = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clk_table->num_entries == 1) {
|
||||||
|
/*smu gives one DPM level, let's take the highest one*/
|
||||||
|
closest_clk_lvl = dcn3_14_soc.num_states - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
clock_limits[i].state = i;
|
||||||
|
|
||||||
|
/* Clocks dependent on voltage level. */
|
||||||
|
clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
|
||||||
|
if (clk_table->num_entries == 1 &&
|
||||||
|
clock_limits[i].dcfclk_mhz < dcn3_14_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) {
|
||||||
|
/*SMU fix not released yet*/
|
||||||
|
clock_limits[i].dcfclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dcfclk_mhz;
|
||||||
|
}
|
||||||
|
clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
|
||||||
|
clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
|
||||||
|
|
||||||
|
if (clk_table->entries[i].memclk_mhz && clk_table->entries[i].wck_ratio)
|
||||||
|
clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
|
||||||
|
|
||||||
|
/* Clocks independent of voltage level. */
|
||||||
|
clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
|
||||||
|
dcn3_14_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
|
||||||
|
|
||||||
|
clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
|
||||||
|
dcn3_14_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
|
||||||
|
|
||||||
|
clock_limits[i].dram_bw_per_chan_gbps = dcn3_14_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
|
||||||
|
clock_limits[i].dscclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
|
||||||
|
clock_limits[i].dtbclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
|
||||||
|
clock_limits[i].phyclk_d18_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
|
||||||
|
clock_limits[i].phyclk_mhz = dcn3_14_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
|
||||||
|
}
|
||||||
|
for (i = 0; i < clk_table->num_entries; i++)
|
||||||
|
dcn3_14_soc.clock_limits[i] = clock_limits[i];
|
||||||
|
if (clk_table->num_entries) {
|
||||||
|
dcn3_14_soc.num_states = clk_table->num_entries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max_dispclk_mhz) {
|
||||||
|
dcn3_14_soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz * 2;
|
||||||
|
dc->dml.soc.dispclk_dppclk_vco_speed_mhz = max_dispclk_mhz * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment))
|
||||||
|
dml_init_instance(&dc->dml, &dcn3_14_soc, &dcn3_14_ip, DML_PROJECT_DCN31);
|
||||||
|
else
|
||||||
|
dml_init_instance(&dc->dml, &dcn3_14_soc, &dcn3_14_ip, DML_PROJECT_DCN31_FPGA);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool is_dual_plane(enum surface_pixel_format format)
|
||||||
|
{
|
||||||
|
return format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN || format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *context,
|
||||||
|
display_e2e_pipe_params_st *pipes,
|
||||||
|
bool fast_validate)
|
||||||
|
{
|
||||||
|
int i, pipe_cnt;
|
||||||
|
struct resource_context *res_ctx = &context->res_ctx;
|
||||||
|
struct pipe_ctx *pipe;
|
||||||
|
bool upscaled = false;
|
||||||
|
|
||||||
|
dc_assert_fp_enabled();
|
||||||
|
|
||||||
|
dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
|
||||||
|
|
||||||
|
for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
|
||||||
|
struct dc_crtc_timing *timing;
|
||||||
|
|
||||||
|
if (!res_ctx->pipe_ctx[i].stream)
|
||||||
|
continue;
|
||||||
|
pipe = &res_ctx->pipe_ctx[i];
|
||||||
|
timing = &pipe->stream->timing;
|
||||||
|
|
||||||
|
if (dc_extended_blank_supported(dc) && pipe->stream->adjust.v_total_max == pipe->stream->adjust.v_total_min
|
||||||
|
&& pipe->stream->adjust.v_total_min > timing->v_total)
|
||||||
|
pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min;
|
||||||
|
|
||||||
|
if (pipe->plane_state &&
|
||||||
|
(pipe->plane_state->src_rect.height < pipe->plane_state->dst_rect.height ||
|
||||||
|
pipe->plane_state->src_rect.width < pipe->plane_state->dst_rect.width))
|
||||||
|
upscaled = true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Immediate flip can be set dynamically after enabling the plane.
|
||||||
|
* We need to require support for immediate flip or underflow can be
|
||||||
|
* intermittently experienced depending on peak b/w requirements.
|
||||||
|
*/
|
||||||
|
pipes[pipe_cnt].pipe.src.immediate_flip = true;
|
||||||
|
|
||||||
|
pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
|
||||||
|
pipes[pipe_cnt].pipe.src.hostvm = dc->res_pool->hubbub->riommu_active;
|
||||||
|
pipes[pipe_cnt].pipe.src.gpuvm = true;
|
||||||
|
pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0;
|
||||||
|
pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0;
|
||||||
|
pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch;
|
||||||
|
pipes[pipe_cnt].pipe.src.dcc_rate = 3;
|
||||||
|
pipes[pipe_cnt].dout.dsc_input_bpc = 0;
|
||||||
|
|
||||||
|
if (pipes[pipe_cnt].dout.dsc_enable) {
|
||||||
|
switch (timing->display_color_depth) {
|
||||||
|
case COLOR_DEPTH_888:
|
||||||
|
pipes[pipe_cnt].dout.dsc_input_bpc = 8;
|
||||||
|
break;
|
||||||
|
case COLOR_DEPTH_101010:
|
||||||
|
pipes[pipe_cnt].dout.dsc_input_bpc = 10;
|
||||||
|
break;
|
||||||
|
case COLOR_DEPTH_121212:
|
||||||
|
pipes[pipe_cnt].dout.dsc_input_bpc = 12;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pipe_cnt++;
|
||||||
|
}
|
||||||
|
context->bw_ctx.dml.ip.det_buffer_size_kbytes = DCN3_14_DEFAULT_DET_SIZE;
|
||||||
|
|
||||||
|
dc->config.enable_4to1MPC = false;
|
||||||
|
if (pipe_cnt == 1 && pipe->plane_state && !dc->debug.disable_z9_mpc) {
|
||||||
|
if (is_dual_plane(pipe->plane_state->format)
|
||||||
|
&& pipe->plane_state->src_rect.width <= 1920 && pipe->plane_state->src_rect.height <= 1080) {
|
||||||
|
dc->config.enable_4to1MPC = true;
|
||||||
|
} else if (!is_dual_plane(pipe->plane_state->format) && pipe->plane_state->src_rect.width <= 5120) {
|
||||||
|
/* Limit to 5k max to avoid forced pipe split when there is not enough detile for swath */
|
||||||
|
context->bw_ctx.dml.ip.det_buffer_size_kbytes = 192;
|
||||||
|
pipes[0].pipe.src.unbounded_req_mode = true;
|
||||||
|
}
|
||||||
|
} else if (context->stream_count >= dc->debug.crb_alloc_policy_min_disp_count
|
||||||
|
&& dc->debug.crb_alloc_policy > DET_SIZE_DEFAULT) {
|
||||||
|
context->bw_ctx.dml.ip.det_buffer_size_kbytes = dc->debug.crb_alloc_policy * 64;
|
||||||
|
} else if (context->stream_count >= 3 && upscaled) {
|
||||||
|
context->bw_ctx.dml.ip.det_buffer_size_kbytes = 192;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||||
|
struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
|
||||||
|
|
||||||
|
if (!pipe->stream)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pipe->stream->signal == SIGNAL_TYPE_EDP && dc->debug.seamless_boot_odm_combine &&
|
||||||
|
pipe->stream->apply_seamless_boot_optimization) {
|
||||||
|
|
||||||
|
if (pipe->stream->apply_boot_odm_mode == dm_odm_combine_policy_2to1) {
|
||||||
|
context->bw_ctx.dml.vba.ODMCombinePolicy = dm_odm_combine_policy_2to1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pipe_cnt;
|
||||||
|
}
|
40
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.h
Normal file
40
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* SPDX-License-Identifier: MIT */
|
||||||
|
/*
|
||||||
|
* Copyright 2022 Advanced Micro Devices, Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*
|
||||||
|
* Authors: AMD
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __DCN314_FPU_H__
|
||||||
|
#define __DCN314_FPU_H__
|
||||||
|
|
||||||
|
#define DCN3_14_DEFAULT_DET_SIZE 384
|
||||||
|
#define DCN3_14_MAX_DET_SIZE 384
|
||||||
|
#define DCN3_14_MIN_COMPBUF_SIZE_KB 128
|
||||||
|
#define DCN3_14_CRB_SEGMENT_SIZE_KB 64
|
||||||
|
|
||||||
|
void dcn314_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_params);
|
||||||
|
int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *context,
|
||||||
|
display_e2e_pipe_params_st *pipes,
|
||||||
|
bool fast_validate);
|
||||||
|
|
||||||
|
#endif
|
@ -473,8 +473,11 @@ void dcn32_set_phantom_stream_timing(struct dc *dc,
|
|||||||
|
|
||||||
// DML calculation for MALL region doesn't take into account FW delay
|
// DML calculation for MALL region doesn't take into account FW delay
|
||||||
// and required pstate allow width for multi-display cases
|
// and required pstate allow width for multi-display cases
|
||||||
|
/* Add 16 lines margin to the MALL REGION because SUB_VP_START_LINE must be aligned
|
||||||
|
* to 2 swaths (i.e. 16 lines)
|
||||||
|
*/
|
||||||
phantom_vactive = get_subviewport_lines_needed_in_mall(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx) +
|
phantom_vactive = get_subviewport_lines_needed_in_mall(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx) +
|
||||||
pstate_width_fw_delay_lines;
|
pstate_width_fw_delay_lines + dc->caps.subvp_swath_height_margin_lines;
|
||||||
|
|
||||||
// For backporch of phantom pipe, use vstartup of the main pipe
|
// For backporch of phantom pipe, use vstartup of the main pipe
|
||||||
phantom_bp = get_vstartup(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx);
|
phantom_bp = get_vstartup(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx);
|
||||||
@ -490,6 +493,7 @@ void dcn32_set_phantom_stream_timing(struct dc *dc,
|
|||||||
phantom_stream->timing.v_front_porch +
|
phantom_stream->timing.v_front_porch +
|
||||||
phantom_stream->timing.v_sync_width +
|
phantom_stream->timing.v_sync_width +
|
||||||
phantom_bp;
|
phantom_bp;
|
||||||
|
phantom_stream->timing.flags.DSC = 0; // Don't need DSC for phantom timing
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -983,9 +987,15 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,
|
|||||||
* DML favors voltage over p-state, but we're more interested in
|
* DML favors voltage over p-state, but we're more interested in
|
||||||
* supporting p-state over voltage. We can't support p-state in
|
* supporting p-state over voltage. We can't support p-state in
|
||||||
* prefetch mode > 0 so try capping the prefetch mode to start.
|
* prefetch mode > 0 so try capping the prefetch mode to start.
|
||||||
|
* Override present for testing.
|
||||||
*/
|
*/
|
||||||
|
if (dc->debug.dml_disallow_alternate_prefetch_modes)
|
||||||
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
||||||
dm_prefetch_support_uclk_fclk_and_stutter;
|
dm_prefetch_support_uclk_fclk_and_stutter;
|
||||||
|
else
|
||||||
|
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
||||||
|
dm_prefetch_support_uclk_fclk_and_stutter_if_possible;
|
||||||
|
|
||||||
*vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, *pipe_cnt);
|
*vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, *pipe_cnt);
|
||||||
/* This may adjust vlevel and maxMpcComb */
|
/* This may adjust vlevel and maxMpcComb */
|
||||||
if (*vlevel < context->bw_ctx.dml.soc.num_states)
|
if (*vlevel < context->bw_ctx.dml.soc.num_states)
|
||||||
@ -1014,7 +1024,9 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,
|
|||||||
* will not allow for switch in VBLANK. The DRR display must have it's VBLANK stretched
|
* will not allow for switch in VBLANK. The DRR display must have it's VBLANK stretched
|
||||||
* enough to support MCLK switching.
|
* enough to support MCLK switching.
|
||||||
*/
|
*/
|
||||||
if (*vlevel == context->bw_ctx.dml.soc.num_states) {
|
if (*vlevel == context->bw_ctx.dml.soc.num_states &&
|
||||||
|
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final ==
|
||||||
|
dm_prefetch_support_uclk_fclk_and_stutter) {
|
||||||
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
||||||
dm_prefetch_support_stutter;
|
dm_prefetch_support_stutter;
|
||||||
/* There are params (such as FabricClock) that need to be recalculated
|
/* There are params (such as FabricClock) that need to be recalculated
|
||||||
@ -1344,7 +1356,8 @@ bool dcn32_internal_validate_bw(struct dc *dc,
|
|||||||
int split[MAX_PIPES] = { 0 };
|
int split[MAX_PIPES] = { 0 };
|
||||||
bool merge[MAX_PIPES] = { false };
|
bool merge[MAX_PIPES] = { false };
|
||||||
bool newly_split[MAX_PIPES] = { false };
|
bool newly_split[MAX_PIPES] = { false };
|
||||||
int pipe_cnt, i, pipe_idx, vlevel;
|
int pipe_cnt, i, pipe_idx;
|
||||||
|
int vlevel = context->bw_ctx.dml.soc.num_states;
|
||||||
struct vba_vars_st *vba = &context->bw_ctx.dml.vba;
|
struct vba_vars_st *vba = &context->bw_ctx.dml.vba;
|
||||||
|
|
||||||
dc_assert_fp_enabled();
|
dc_assert_fp_enabled();
|
||||||
@ -1373,14 +1386,19 @@ bool dcn32_internal_validate_bw(struct dc *dc,
|
|||||||
DC_FP_END();
|
DC_FP_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fast_validate || vlevel == context->bw_ctx.dml.soc.num_states ||
|
if (fast_validate ||
|
||||||
vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported) {
|
(dc->debug.dml_disallow_alternate_prefetch_modes &&
|
||||||
|
(vlevel == context->bw_ctx.dml.soc.num_states ||
|
||||||
|
vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported))) {
|
||||||
/*
|
/*
|
||||||
* If mode is unsupported or there's still no p-state support then
|
* If dml_disallow_alternate_prefetch_modes is false, then we have already
|
||||||
* fall back to favoring voltage.
|
* tried alternate prefetch modes during full validation.
|
||||||
*
|
*
|
||||||
* If Prefetch mode 0 failed for this config, or passed with Max UCLK, try if
|
* If mode is unsupported or there is no p-state support, then
|
||||||
* supported with Prefetch mode 1 (dm_prefetch_support_fclk_and_stutter == 2)
|
* fall back to favouring voltage.
|
||||||
|
*
|
||||||
|
* If Prefetch mode 0 failed for this config, or passed with Max UCLK, then try
|
||||||
|
* to support with Prefetch mode 1 (dm_prefetch_support_fclk_and_stutter == 2)
|
||||||
*/
|
*/
|
||||||
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
|
||||||
dm_prefetch_support_fclk_and_stutter;
|
dm_prefetch_support_fclk_and_stutter;
|
||||||
@ -2098,6 +2116,13 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pa
|
|||||||
dc->bb_overrides.dram_clock_change_latency_ns / 1000.0;
|
dc->bb_overrides.dram_clock_change_latency_ns / 1000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int)(dcn3_2_soc.fclk_change_latency_us * 1000)
|
||||||
|
!= dc->bb_overrides.fclk_clock_change_latency_ns
|
||||||
|
&& dc->bb_overrides.fclk_clock_change_latency_ns) {
|
||||||
|
dcn3_2_soc.fclk_change_latency_us =
|
||||||
|
dc->bb_overrides.fclk_clock_change_latency_ns / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
if ((int)(dcn3_2_soc.dummy_pstate_latency_us * 1000)
|
if ((int)(dcn3_2_soc.dummy_pstate_latency_us * 1000)
|
||||||
!= dc->bb_overrides.dummy_clock_change_latency_ns
|
!= dc->bb_overrides.dummy_clock_change_latency_ns
|
||||||
&& dc->bb_overrides.dummy_clock_change_latency_ns) {
|
&& dc->bb_overrides.dummy_clock_change_latency_ns) {
|
||||||
|
@ -221,7 +221,6 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
|
|||||||
// VBA_DELTA
|
// VBA_DELTA
|
||||||
// Calculate DET size, swath height
|
// Calculate DET size, swath height
|
||||||
dml32_CalculateSwathAndDETConfiguration(
|
dml32_CalculateSwathAndDETConfiguration(
|
||||||
&v->dummy_vars.dml32_CalculateSwathAndDETConfiguration,
|
|
||||||
mode_lib->vba.DETSizeOverride,
|
mode_lib->vba.DETSizeOverride,
|
||||||
mode_lib->vba.UsesMALLForPStateChange,
|
mode_lib->vba.UsesMALLForPStateChange,
|
||||||
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
||||||
@ -461,7 +460,6 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
|
|||||||
{
|
{
|
||||||
|
|
||||||
dml32_CalculateVMRowAndSwath(
|
dml32_CalculateVMRowAndSwath(
|
||||||
&v->dummy_vars.dml32_CalculateVMRowAndSwath,
|
|
||||||
mode_lib->vba.NumberOfActiveSurfaces,
|
mode_lib->vba.NumberOfActiveSurfaces,
|
||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.SurfaceParameters,
|
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.SurfaceParameters,
|
||||||
v->SurfaceSizeInMALL,
|
v->SurfaceSizeInMALL,
|
||||||
@ -757,9 +755,7 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
|
|||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelY = v->BytePerPixelY[k];
|
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelY = v->BytePerPixelY[k];
|
||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelC = v->BytePerPixelC[k];
|
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelC = v->BytePerPixelC[k];
|
||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.ProgressiveToInterlaceUnitInOPP = mode_lib->vba.ProgressiveToInterlaceUnitInOPP;
|
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.ProgressiveToInterlaceUnitInOPP = mode_lib->vba.ProgressiveToInterlaceUnitInOPP;
|
||||||
v->ErrorResult[k] = dml32_CalculatePrefetchSchedule(
|
v->ErrorResult[k] = dml32_CalculatePrefetchSchedule(v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.HostVMInefficiencyFactor,
|
||||||
&v->dummy_vars.dml32_CalculatePrefetchSchedule,
|
|
||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.HostVMInefficiencyFactor,
|
|
||||||
&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe, v->DSCDelay[k],
|
&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe, v->DSCDelay[k],
|
||||||
mode_lib->vba.DPPCLKDelaySubtotal + mode_lib->vba.DPPCLKDelayCNVCFormater,
|
mode_lib->vba.DPPCLKDelaySubtotal + mode_lib->vba.DPPCLKDelayCNVCFormater,
|
||||||
mode_lib->vba.DPPCLKDelaySCL,
|
mode_lib->vba.DPPCLKDelaySCL,
|
||||||
@ -1167,7 +1163,6 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
|
|||||||
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters.SMNLatency = mode_lib->vba.SMNLatency;
|
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters.SMNLatency = mode_lib->vba.SMNLatency;
|
||||||
|
|
||||||
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
||||||
&v->dummy_vars.dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport,
|
|
||||||
mode_lib->vba.USRRetrainingRequiredFinal,
|
mode_lib->vba.USRRetrainingRequiredFinal,
|
||||||
mode_lib->vba.UsesMALLForPStateChange,
|
mode_lib->vba.UsesMALLForPStateChange,
|
||||||
mode_lib->vba.PrefetchModePerState[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb],
|
mode_lib->vba.PrefetchModePerState[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb],
|
||||||
@ -1952,7 +1947,6 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||||||
}
|
}
|
||||||
|
|
||||||
dml32_CalculateSwathAndDETConfiguration(
|
dml32_CalculateSwathAndDETConfiguration(
|
||||||
&v->dummy_vars.dml32_CalculateSwathAndDETConfiguration,
|
|
||||||
mode_lib->vba.DETSizeOverride,
|
mode_lib->vba.DETSizeOverride,
|
||||||
mode_lib->vba.UsesMALLForPStateChange,
|
mode_lib->vba.UsesMALLForPStateChange,
|
||||||
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
||||||
@ -2549,7 +2543,6 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||||||
}
|
}
|
||||||
|
|
||||||
dml32_CalculateSwathAndDETConfiguration(
|
dml32_CalculateSwathAndDETConfiguration(
|
||||||
&v->dummy_vars.dml32_CalculateSwathAndDETConfiguration,
|
|
||||||
mode_lib->vba.DETSizeOverride,
|
mode_lib->vba.DETSizeOverride,
|
||||||
mode_lib->vba.UsesMALLForPStateChange,
|
mode_lib->vba.UsesMALLForPStateChange,
|
||||||
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
mode_lib->vba.ConfigReturnBufferSizeInKByte,
|
||||||
@ -2749,7 +2742,6 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||||||
|
|
||||||
{
|
{
|
||||||
dml32_CalculateVMRowAndSwath(
|
dml32_CalculateVMRowAndSwath(
|
||||||
&v->dummy_vars.dml32_CalculateVMRowAndSwath,
|
|
||||||
mode_lib->vba.NumberOfActiveSurfaces,
|
mode_lib->vba.NumberOfActiveSurfaces,
|
||||||
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters,
|
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters,
|
||||||
mode_lib->vba.SurfaceSizeInMALL,
|
mode_lib->vba.SurfaceSizeInMALL,
|
||||||
@ -3266,7 +3258,6 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||||||
|
|
||||||
mode_lib->vba.NoTimeForPrefetch[i][j][k] =
|
mode_lib->vba.NoTimeForPrefetch[i][j][k] =
|
||||||
dml32_CalculatePrefetchSchedule(
|
dml32_CalculatePrefetchSchedule(
|
||||||
&v->dummy_vars.dml32_CalculatePrefetchSchedule,
|
|
||||||
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.HostVMInefficiencyFactor,
|
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.HostVMInefficiencyFactor,
|
||||||
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe,
|
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe,
|
||||||
mode_lib->vba.DSCDelayPerState[i][k],
|
mode_lib->vba.DSCDelayPerState[i][k],
|
||||||
@ -3566,7 +3557,6 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||||||
|
|
||||||
{
|
{
|
||||||
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
||||||
&v->dummy_vars.dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport,
|
|
||||||
mode_lib->vba.USRRetrainingRequiredFinal,
|
mode_lib->vba.USRRetrainingRequiredFinal,
|
||||||
mode_lib->vba.UsesMALLForPStateChange,
|
mode_lib->vba.UsesMALLForPStateChange,
|
||||||
mode_lib->vba.PrefetchModePerState[i][j],
|
mode_lib->vba.PrefetchModePerState[i][j],
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,6 @@
|
|||||||
#include "os_types.h"
|
#include "os_types.h"
|
||||||
#include "../dc_features.h"
|
#include "../dc_features.h"
|
||||||
#include "../display_mode_structs.h"
|
#include "../display_mode_structs.h"
|
||||||
#include "dml/display_mode_vba.h"
|
|
||||||
|
|
||||||
unsigned int dml32_dscceComputeDelay(
|
unsigned int dml32_dscceComputeDelay(
|
||||||
unsigned int bpc,
|
unsigned int bpc,
|
||||||
@ -82,7 +81,6 @@ void dml32_CalculateSinglePipeDPPCLKAndSCLThroughput(
|
|||||||
double *DPPCLKUsingSingleDPP);
|
double *DPPCLKUsingSingleDPP);
|
||||||
|
|
||||||
void dml32_CalculateSwathAndDETConfiguration(
|
void dml32_CalculateSwathAndDETConfiguration(
|
||||||
struct dml32_CalculateSwathAndDETConfiguration *st_vars,
|
|
||||||
unsigned int DETSizeOverride[],
|
unsigned int DETSizeOverride[],
|
||||||
enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
|
enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
|
||||||
unsigned int ConfigReturnBufferSizeInKByte,
|
unsigned int ConfigReturnBufferSizeInKByte,
|
||||||
@ -362,7 +360,6 @@ void dml32_CalculateSurfaceSizeInMall(
|
|||||||
bool *ExceededMALLSize);
|
bool *ExceededMALLSize);
|
||||||
|
|
||||||
void dml32_CalculateVMRowAndSwath(
|
void dml32_CalculateVMRowAndSwath(
|
||||||
struct dml32_CalculateVMRowAndSwath *st_vars,
|
|
||||||
unsigned int NumberOfActiveSurfaces,
|
unsigned int NumberOfActiveSurfaces,
|
||||||
DmlPipe myPipe[],
|
DmlPipe myPipe[],
|
||||||
unsigned int SurfaceSizeInMALL[],
|
unsigned int SurfaceSizeInMALL[],
|
||||||
@ -715,7 +712,6 @@ double dml32_CalculateExtraLatency(
|
|||||||
unsigned int HostVMMaxNonCachedPageTableLevels);
|
unsigned int HostVMMaxNonCachedPageTableLevels);
|
||||||
|
|
||||||
bool dml32_CalculatePrefetchSchedule(
|
bool dml32_CalculatePrefetchSchedule(
|
||||||
struct dml32_CalculatePrefetchSchedule *st_vars,
|
|
||||||
double HostVMInefficiencyFactor,
|
double HostVMInefficiencyFactor,
|
||||||
DmlPipe *myPipe,
|
DmlPipe *myPipe,
|
||||||
unsigned int DSCDelay,
|
unsigned int DSCDelay,
|
||||||
@ -811,7 +807,6 @@ void dml32_CalculateFlipSchedule(
|
|||||||
bool *ImmediateFlipSupportedForPipe);
|
bool *ImmediateFlipSupportedForPipe);
|
||||||
|
|
||||||
void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
|
||||||
struct dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport *st_vars,
|
|
||||||
bool USRRetrainingRequiredFinal,
|
bool USRRetrainingRequiredFinal,
|
||||||
enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
|
enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
|
||||||
unsigned int PrefetchMode,
|
unsigned int PrefetchMode,
|
||||||
|
@ -498,6 +498,13 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_p
|
|||||||
dc->bb_overrides.dram_clock_change_latency_ns / 1000.0;
|
dc->bb_overrides.dram_clock_change_latency_ns / 1000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int)(dcn3_21_soc.fclk_change_latency_us * 1000)
|
||||||
|
!= dc->bb_overrides.fclk_clock_change_latency_ns
|
||||||
|
&& dc->bb_overrides.fclk_clock_change_latency_ns) {
|
||||||
|
dcn3_21_soc.fclk_change_latency_us =
|
||||||
|
dc->bb_overrides.fclk_clock_change_latency_ns / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
if ((int)(dcn3_21_soc.dummy_pstate_latency_us * 1000)
|
if ((int)(dcn3_21_soc.dummy_pstate_latency_us * 1000)
|
||||||
!= dc->bb_overrides.dummy_clock_change_latency_ns
|
!= dc->bb_overrides.dummy_clock_change_latency_ns
|
||||||
&& dc->bb_overrides.dummy_clock_change_latency_ns) {
|
&& dc->bb_overrides.dummy_clock_change_latency_ns) {
|
||||||
|
@ -182,108 +182,6 @@ void Calculate256BBlockSizes(
|
|||||||
unsigned int *BlockWidth256BytesY,
|
unsigned int *BlockWidth256BytesY,
|
||||||
unsigned int *BlockWidth256BytesC);
|
unsigned int *BlockWidth256BytesC);
|
||||||
|
|
||||||
struct dml32_CalculateSwathAndDETConfiguration {
|
|
||||||
unsigned int MaximumSwathHeightY[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int MaximumSwathHeightC[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int RoundedUpMaxSwathSizeBytesY[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int RoundedUpMaxSwathSizeBytesC[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int RoundedUpSwathSizeBytesY;
|
|
||||||
unsigned int RoundedUpSwathSizeBytesC;
|
|
||||||
double SwathWidthdoubleDPP[DC__NUM_DPP__MAX];
|
|
||||||
double SwathWidthdoubleDPPChroma[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int TotalActiveDPP;
|
|
||||||
bool NoChromaSurfaces;
|
|
||||||
unsigned int DETBufferSizeInKByteForSwathCalculation;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct dml32_CalculateVMRowAndSwath {
|
|
||||||
unsigned int PTEBufferSizeInRequestsForLuma[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PTEBufferSizeInRequestsForChroma[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PDEAndMetaPTEBytesFrameY;
|
|
||||||
unsigned int PDEAndMetaPTEBytesFrameC;
|
|
||||||
unsigned int MetaRowByteY[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int MetaRowByteC[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PixelPTEBytesPerRowY[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PixelPTEBytesPerRowC[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PixelPTEBytesPerRowY_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int PixelPTEBytesPerRowC_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int dpte_row_width_luma_ub_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int dpte_row_height_luma_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int dpte_row_width_chroma_ub_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int dpte_row_height_chroma_one_row_per_frame[DC__NUM_DPP__MAX];
|
|
||||||
bool one_row_per_frame_fits_in_buffer[DC__NUM_DPP__MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport {
|
|
||||||
unsigned int SurfaceWithMinActiveFCLKChangeMargin;
|
|
||||||
unsigned int DRAMClockChangeSupportNumber;
|
|
||||||
unsigned int LastSurfaceWithoutMargin;
|
|
||||||
unsigned int DRAMClockChangeMethod;
|
|
||||||
bool FoundFirstSurfaceWithMinActiveFCLKChangeMargin;
|
|
||||||
double MinActiveFCLKChangeMargin;
|
|
||||||
double SecondMinActiveFCLKChangeMarginOneDisplayInVBLank;
|
|
||||||
double ActiveClockChangeLatencyHidingY;
|
|
||||||
double ActiveClockChangeLatencyHidingC;
|
|
||||||
double ActiveClockChangeLatencyHiding;
|
|
||||||
double EffectiveDETBufferSizeY;
|
|
||||||
double ActiveFCLKChangeLatencyMargin[DC__NUM_DPP__MAX];
|
|
||||||
double USRRetrainingLatencyMargin[DC__NUM_DPP__MAX];
|
|
||||||
double TotalPixelBW;
|
|
||||||
bool SynchronizedSurfaces[DC__NUM_DPP__MAX][DC__NUM_DPP__MAX];
|
|
||||||
double EffectiveLBLatencyHidingY;
|
|
||||||
double EffectiveLBLatencyHidingC;
|
|
||||||
double LinesInDETY[DC__NUM_DPP__MAX];
|
|
||||||
double LinesInDETC[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int LinesInDETYRoundedDownToSwath[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int LinesInDETCRoundedDownToSwath[DC__NUM_DPP__MAX];
|
|
||||||
double FullDETBufferingTimeY;
|
|
||||||
double FullDETBufferingTimeC;
|
|
||||||
double WritebackDRAMClockChangeLatencyMargin;
|
|
||||||
double WritebackFCLKChangeLatencyMargin;
|
|
||||||
double WritebackLatencyHiding;
|
|
||||||
bool SameTimingForFCLKChange;
|
|
||||||
unsigned int TotalActiveWriteback;
|
|
||||||
unsigned int LBLatencyHidingSourceLinesY[DC__NUM_DPP__MAX];
|
|
||||||
unsigned int LBLatencyHidingSourceLinesC[DC__NUM_DPP__MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct dml32_CalculatePrefetchSchedule {
|
|
||||||
unsigned int DPPCycles, DISPCLKCycles;
|
|
||||||
double DSTTotalPixelsAfterScaler;
|
|
||||||
double LineTime;
|
|
||||||
double dst_y_prefetch_equ;
|
|
||||||
double prefetch_bw_oto;
|
|
||||||
double Tvm_oto;
|
|
||||||
double Tr0_oto;
|
|
||||||
double Tvm_oto_lines;
|
|
||||||
double Tr0_oto_lines;
|
|
||||||
double dst_y_prefetch_oto;
|
|
||||||
double TimeForFetchingMetaPTE;
|
|
||||||
double TimeForFetchingRowInVBlank;
|
|
||||||
double LinesToRequestPrefetchPixelData;
|
|
||||||
unsigned int HostVMDynamicLevelsTrips;
|
|
||||||
double trip_to_mem;
|
|
||||||
double Tvm_trips;
|
|
||||||
double Tr0_trips;
|
|
||||||
double Tvm_trips_rounded;
|
|
||||||
double Tr0_trips_rounded;
|
|
||||||
double Lsw_oto;
|
|
||||||
double Tpre_rounded;
|
|
||||||
double prefetch_bw_equ;
|
|
||||||
double Tvm_equ;
|
|
||||||
double Tr0_equ;
|
|
||||||
double Tdmbf;
|
|
||||||
double Tdmec;
|
|
||||||
double Tdmsks;
|
|
||||||
double prefetch_sw_bytes;
|
|
||||||
double bytes_pp;
|
|
||||||
double dep_bytes;
|
|
||||||
unsigned int max_vratio_pre;
|
|
||||||
double min_Lsw;
|
|
||||||
double Tsw_est1;
|
|
||||||
double Tsw_est3;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation {
|
struct DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation {
|
||||||
unsigned int dummy_integer_array[2][DC__NUM_DPP__MAX];
|
unsigned int dummy_integer_array[2][DC__NUM_DPP__MAX];
|
||||||
double dummy_single_array[2][DC__NUM_DPP__MAX];
|
double dummy_single_array[2][DC__NUM_DPP__MAX];
|
||||||
@ -355,10 +253,6 @@ struct dummy_vars {
|
|||||||
struct DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation
|
struct DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation
|
||||||
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation;
|
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation;
|
||||||
struct dml32_ModeSupportAndSystemConfigurationFull dml32_ModeSupportAndSystemConfigurationFull;
|
struct dml32_ModeSupportAndSystemConfigurationFull dml32_ModeSupportAndSystemConfigurationFull;
|
||||||
struct dml32_CalculateSwathAndDETConfiguration dml32_CalculateSwathAndDETConfiguration;
|
|
||||||
struct dml32_CalculateVMRowAndSwath dml32_CalculateVMRowAndSwath;
|
|
||||||
struct dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport;
|
|
||||||
struct dml32_CalculatePrefetchSchedule dml32_CalculatePrefetchSchedule;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vba_vars_st {
|
struct vba_vars_st {
|
||||||
|
@ -244,13 +244,15 @@ enum {
|
|||||||
#define ASICREV_IS_GC_10_3_7(eChipRev) ((eChipRev >= GC_10_3_7_A0) && (eChipRev < GC_10_3_7_UNKNOWN))
|
#define ASICREV_IS_GC_10_3_7(eChipRev) ((eChipRev >= GC_10_3_7_A0) && (eChipRev < GC_10_3_7_UNKNOWN))
|
||||||
|
|
||||||
#define AMDGPU_FAMILY_GC_11_0_0 145
|
#define AMDGPU_FAMILY_GC_11_0_0 145
|
||||||
#define AMDGPU_FAMILY_GC_11_0_2 148
|
#define AMDGPU_FAMILY_GC_11_0_1 148
|
||||||
#define GC_11_0_0_A0 0x1
|
#define GC_11_0_0_A0 0x1
|
||||||
#define GC_11_0_2_A0 0x10
|
#define GC_11_0_2_A0 0x10
|
||||||
|
#define GC_11_0_3_A0 0x20
|
||||||
#define GC_11_UNKNOWN 0xFF
|
#define GC_11_UNKNOWN 0xFF
|
||||||
|
|
||||||
#define ASICREV_IS_GC_11_0_0(eChipRev) (eChipRev < GC_11_0_2_A0)
|
#define ASICREV_IS_GC_11_0_0(eChipRev) (eChipRev < GC_11_0_2_A0)
|
||||||
#define ASICREV_IS_GC_11_0_2(eChipRev) (eChipRev >= GC_11_0_2_A0 && eChipRev < GC_11_UNKNOWN)
|
#define ASICREV_IS_GC_11_0_2(eChipRev) (eChipRev >= GC_11_0_2_A0 && eChipRev < GC_11_0_3_A0)
|
||||||
|
#define ASICREV_IS_GC_11_0_3(eChipRev) (eChipRev >= GC_11_0_3_A0 && eChipRev < GC_11_UNKNOWN)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ASIC chip ID
|
* ASIC chip ID
|
||||||
|
@ -119,13 +119,15 @@ enum dc_log_type {
|
|||||||
LOG_HDMI_RETIMER_REDRIVER,
|
LOG_HDMI_RETIMER_REDRIVER,
|
||||||
LOG_DSC,
|
LOG_DSC,
|
||||||
LOG_SMU_MSG,
|
LOG_SMU_MSG,
|
||||||
|
LOG_DC2RESERVED4,
|
||||||
|
LOG_DC2RESERVED5,
|
||||||
LOG_DWB,
|
LOG_DWB,
|
||||||
LOG_GAMMA_DEBUG,
|
LOG_GAMMA_DEBUG,
|
||||||
LOG_MAX_HW_POINTS,
|
LOG_MAX_HW_POINTS,
|
||||||
LOG_ALL_TF_CHANNELS,
|
LOG_ALL_TF_CHANNELS,
|
||||||
LOG_SAMPLE_1DLUT,
|
LOG_SAMPLE_1DLUT,
|
||||||
LOG_DP2,
|
LOG_DP2,
|
||||||
LOG_SECTION_TOTAL_COUNT
|
LOG_DC2RESERVED12,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DC_MIN_LOG_MASK ((1 << LOG_ERROR) | \
|
#define DC_MIN_LOG_MASK ((1 << LOG_ERROR) | \
|
||||||
|
@ -613,10 +613,6 @@ static void build_vrr_infopacket_data_v1(const struct mod_vrr_params *vrr,
|
|||||||
* Note: We should never go above the field rate of the mode timing set.
|
* Note: We should never go above the field rate of the mode timing set.
|
||||||
*/
|
*/
|
||||||
infopacket->sb[8] = (unsigned char)((vrr->max_refresh_in_uhz + 500000) / 1000000);
|
infopacket->sb[8] = (unsigned char)((vrr->max_refresh_in_uhz + 500000) / 1000000);
|
||||||
|
|
||||||
/* FreeSync HDR */
|
|
||||||
infopacket->sb[9] = 0;
|
|
||||||
infopacket->sb[10] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr,
|
static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr,
|
||||||
@ -684,10 +680,6 @@ static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr,
|
|||||||
|
|
||||||
/* PB16 : Reserved bits 7:1, FixedRate bit 0 */
|
/* PB16 : Reserved bits 7:1, FixedRate bit 0 */
|
||||||
infopacket->sb[16] = (vrr->state == VRR_STATE_ACTIVE_FIXED) ? 1 : 0;
|
infopacket->sb[16] = (vrr->state == VRR_STATE_ACTIVE_FIXED) ? 1 : 0;
|
||||||
|
|
||||||
//FreeSync HDR
|
|
||||||
infopacket->sb[9] = 0;
|
|
||||||
infopacket->sb[10] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void build_vrr_infopacket_fs2_data(enum color_transfer_func app_tf,
|
static void build_vrr_infopacket_fs2_data(enum color_transfer_func app_tf,
|
||||||
@ -772,8 +764,7 @@ static void build_vrr_infopacket_header_v2(enum signal_type signal,
|
|||||||
/* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length = 0x09] */
|
/* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length = 0x09] */
|
||||||
infopacket->hb2 = 0x09;
|
infopacket->hb2 = 0x09;
|
||||||
|
|
||||||
*payload_size = 0x0A;
|
*payload_size = 0x09;
|
||||||
|
|
||||||
} else if (dc_is_dp_signal(signal)) {
|
} else if (dc_is_dp_signal(signal)) {
|
||||||
|
|
||||||
/* HEADER */
|
/* HEADER */
|
||||||
@ -822,9 +813,9 @@ static void build_vrr_infopacket_header_v3(enum signal_type signal,
|
|||||||
infopacket->hb1 = version;
|
infopacket->hb1 = version;
|
||||||
|
|
||||||
/* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length] */
|
/* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length] */
|
||||||
*payload_size = 0x10;
|
infopacket->hb2 = 0x10;
|
||||||
infopacket->hb2 = *payload_size - 1; //-1 for checksum
|
|
||||||
|
|
||||||
|
*payload_size = 0x10;
|
||||||
} else if (dc_is_dp_signal(signal)) {
|
} else if (dc_is_dp_signal(signal)) {
|
||||||
|
|
||||||
/* HEADER */
|
/* HEADER */
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user