Skip to content

Commit 2eb29d5

Browse files
committed
Merge tag 'drm-next-2023-03-03-1' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "fbdev: - fix uninit var in error path shmem: - revert unGPLing an export i915: - Don't use stolen memory or BAR mappings for ring buffers with LLC - Add inverted backlight quirk for HP 14-r206nv - Fix GSI offset for MCR lookups - GVT fixes (memleak, debugfs attributes, kconfig, typos) amdgpu: - SMU 13 fixes - Enable TMZ for GC 10.3.6 - Misc display fixes - Buddy allocator fixes - GC 11 fixes - S0ix fix - INFO IOCTL queries for GC 11 - VCN harvest fixes for SR-IOV - UMC 8.10 RAS fixes - Don't restrict bpc to 8 - NBIO 7.5 fix - Allow freesync on PCon for more devices amdkfd: - SDMA fix - Illegal memory access fix" * tag 'drm-next-2023-03-03-1' of git://anongit.freedesktop.org/drm/drm: (45 commits) drm/amdgpu/vcn: fix compilation issue with legacy gcc drm/amd/display: Extend Freesync over PCon support for more devices Revert "drm/amd/display: Do not set DRR on pipe commit" drm/amd/display: fix shift-out-of-bounds in CalculateVMAndRowBytes drm/amd/display: Ext displays with dock can't recognized after resume drm/amdgpu: fix ttm_bo calltrace warning in psp_hw_fini drm/amdgpu: remove unused variable ring drm/amd/display: fix dm irq error message in gpu recover drm/amd: Fix initialization for nbio 7.5.1 drm/amd/display: Don't restrict bpc to 8 bpc drm/amdgpu: Make umc_v8_10_convert_error_address static and remove unused variable drm/radeon: Fix eDP for single-display iMac11,2 drm/shmem-helper: Revert accidental non-GPL export drm: omapdrm: Do not use helper unininitialized in omap_fbdev_init() drm/amd/pm: downgrade log level upon SMU IF version mismatch drm/amdgpu: Add ecc info query interface for umc v8_10 drm/amdgpu: Add convert_error_address function for umc v8_10 drm/amdgpu: add bad_page_threshold check in ras_eeprom_check_err drm/amdgpu: change default behavior of bad_page_threshold parameter drm/amdgpu: exclude duplicate pages from UMC RAS UE count ...
2 parents 39ce439 + 54ceb92 commit 2eb29d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+446
-149
lines changed

drivers/gpu/drm/amd/amdgpu/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config DRM_AMDGPU
66
select FW_LOADER
77
select DRM_DISPLAY_DP_HELPER
88
select DRM_DISPLAY_HDMI_HELPER
9+
select DRM_DISPLAY_HDCP_HELPER
910
select DRM_DISPLAY_HELPER
1011
select DRM_KMS_HELPER
1112
select DRM_SCHED

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10731073
(pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
10741074
return false;
10751075

1076+
if (adev->asic_type < CHIP_RAVEN)
1077+
return false;
1078+
10761079
/*
10771080
* If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
10781081
* risky to do any special firmware-related preparations for entering

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@
107107
* - 3.50.0 - Update AMDGPU_INFO_DEV_INFO IOCTL for minimum engine and memory clock
108108
* Update AMDGPU_INFO_SENSOR IOCTL for PEAK_PSTATE engine and memory clock
109109
* 3.51.0 - Return the PCIe gen and lanes from the INFO ioctl
110+
* 3.52.0 - Add AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD, add device_info fields:
111+
* tcp_cache_size, num_sqc_per_wgp, sqc_data_cache_size, sqc_inst_cache_size,
112+
* gl1c_cache_size, gl2c_cache_size, mall_size, enabled_rb_pipes_mask_hi
110113
*/
111114
#define KMS_DRIVER_MAJOR 3
112-
#define KMS_DRIVER_MINOR 51
115+
#define KMS_DRIVER_MINOR 52
113116
#define KMS_DRIVER_PATCHLEVEL 0
114117

115118
unsigned int amdgpu_vram_limit = UINT_MAX;
@@ -921,7 +924,7 @@ module_param_named(reset_method, amdgpu_reset_method, int, 0444);
921924
* result in the GPU entering bad status when the number of total
922925
* faulty pages by ECC exceeds the threshold value.
923926
*/
924-
MODULE_PARM_DESC(bad_page_threshold, "Bad page threshold(-1 = auto(default value), 0 = disable bad page retirement, -2 = ignore bad page threshold)");
927+
MODULE_PARM_DESC(bad_page_threshold, "Bad page threshold(-1 = ignore threshold (default value), 0 = disable bad page retirement, -2 = driver sets threshold)");
925928
module_param_named(bad_page_threshold, amdgpu_bad_page_threshold, int, 0444);
926929

927930
MODULE_PARM_DESC(num_kcq, "number of kernel compute queue user want to setup (8 if set to greater than 8 or less than 0, only affect gfx 8+)");
@@ -2414,8 +2417,10 @@ static int amdgpu_pmops_suspend(struct device *dev)
24142417

24152418
if (amdgpu_acpi_is_s0ix_active(adev))
24162419
adev->in_s0ix = true;
2417-
else
2420+
else if (amdgpu_acpi_is_s3_active(adev))
24182421
adev->in_s3 = true;
2422+
if (!adev->in_s0ix && !adev->in_s3)
2423+
return 0;
24192424
return amdgpu_device_suspend(drm_dev, true);
24202425
}
24212426

@@ -2436,6 +2441,9 @@ static int amdgpu_pmops_resume(struct device *dev)
24362441
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24372442
int r;
24382443

2444+
if (!adev->in_s0ix && !adev->in_s3)
2445+
return 0;
2446+
24392447
/* Avoids registers access if device is physically gone */
24402448
if (!pci_device_is_present(adev->pdev))
24412449
adev->no_hw_access = true;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ struct amdgpu_gfx_config {
178178
uint32_t num_sc_per_sh;
179179
uint32_t num_packer_per_sc;
180180
uint32_t pa_sc_tile_steering_override;
181+
/* Whether texture coordinate truncation is conformant. */
182+
bool ta_cntl2_truncate_coord_mode;
181183
uint64_t tcc_disabled_mask;
182184
uint32_t gc_num_tcp_per_sa;
183185
uint32_t gc_num_sdp_interface;

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
552552
case IP_VERSION(10, 3, 2):
553553
case IP_VERSION(10, 3, 4):
554554
case IP_VERSION(10, 3, 5):
555+
case IP_VERSION(10, 3, 6):
555556
/* VANGOGH */
556557
case IP_VERSION(10, 3, 1):
557558
/* YELLOW_CARP*/

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
808808
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION;
809809
if (amdgpu_is_tmz(adev))
810810
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_TMZ;
811+
if (adev->gfx.config.ta_cntl2_truncate_coord_mode)
812+
dev_info->ids_flags |= AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD;
811813

812814
vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
813815
vm_size -= AMDGPU_VA_RESERVED_SIZE;
@@ -865,6 +867,15 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
865867
adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X4 ? 4 :
866868
adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X2 ? 2 : 1;
867869

870+
dev_info->tcp_cache_size = adev->gfx.config.gc_tcp_l1_size;
871+
dev_info->num_sqc_per_wgp = adev->gfx.config.gc_num_sqc_per_wgp;
872+
dev_info->sqc_data_cache_size = adev->gfx.config.gc_l1_data_cache_size_per_sqc;
873+
dev_info->sqc_inst_cache_size = adev->gfx.config.gc_l1_instruction_cache_size_per_sqc;
874+
dev_info->gl1c_cache_size = adev->gfx.config.gc_gl1c_size_per_instance *
875+
adev->gfx.config.gc_gl1c_per_sa;
876+
dev_info->gl2c_cache_size = adev->gfx.config.gc_gl2c_per_gpu;
877+
dev_info->mall_size = adev->gmc.mall_size;
878+
868879
ret = copy_to_user(out, dev_info,
869880
min((size_t)size, sizeof(*dev_info))) ? -EFAULT : 0;
870881
kfree(dev_info);

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
139139

140140
if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)
141141
places[c].lpfn = visible_pfn;
142-
else
142+
else if (adev->gmc.real_vram_size != adev->gmc.visible_vram_size)
143143
places[c].flags |= TTM_PL_FLAG_TOPDOWN;
144144

145145
if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ static int psp_hdcp_initialize(struct psp_context *psp)
16831683
psp->hdcp_context.context.mem_context.shared_mem_size = PSP_HDCP_SHARED_MEM_SIZE;
16841684
psp->hdcp_context.context.ta_load_type = GFX_CMD_ID_LOAD_TA;
16851685

1686-
if (!psp->hdcp_context.context.initialized) {
1686+
if (!psp->hdcp_context.context.mem_context.shared_buf) {
16871687
ret = psp_ta_init_shared_buf(psp, &psp->hdcp_context.context.mem_context);
16881688
if (ret)
16891689
return ret;
@@ -1750,7 +1750,7 @@ static int psp_dtm_initialize(struct psp_context *psp)
17501750
psp->dtm_context.context.mem_context.shared_mem_size = PSP_DTM_SHARED_MEM_SIZE;
17511751
psp->dtm_context.context.ta_load_type = GFX_CMD_ID_LOAD_TA;
17521752

1753-
if (!psp->dtm_context.context.initialized) {
1753+
if (!psp->dtm_context.context.mem_context.shared_buf) {
17541754
ret = psp_ta_init_shared_buf(psp, &psp->dtm_context.context.mem_context);
17551755
if (ret)
17561756
return ret;
@@ -1818,7 +1818,7 @@ static int psp_rap_initialize(struct psp_context *psp)
18181818
psp->rap_context.context.mem_context.shared_mem_size = PSP_RAP_SHARED_MEM_SIZE;
18191819
psp->rap_context.context.ta_load_type = GFX_CMD_ID_LOAD_TA;
18201820

1821-
if (!psp->rap_context.context.initialized) {
1821+
if (!psp->rap_context.context.mem_context.shared_buf) {
18221822
ret = psp_ta_init_shared_buf(psp, &psp->rap_context.context.mem_context);
18231823
if (ret)
18241824
return ret;

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static int amdgpu_reserve_page_direct(struct amdgpu_device *adev, uint64_t addre
176176
if (amdgpu_bad_page_threshold != 0) {
177177
amdgpu_ras_add_bad_pages(adev, err_data.err_addr,
178178
err_data.err_addr_cnt);
179-
amdgpu_ras_save_bad_pages(adev);
179+
amdgpu_ras_save_bad_pages(adev, NULL);
180180
}
181181

182182
dev_warn(adev->dev, "WARNING: THIS IS ONLY FOR TEST PURPOSES AND WILL CORRUPT RAS EEPROM\n");
@@ -2084,22 +2084,32 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
20842084
/*
20852085
* write error record array to eeprom, the function should be
20862086
* protected by recovery_lock
2087+
* new_cnt: new added UE count, excluding reserved bad pages, can be NULL
20872088
*/
2088-
int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev)
2089+
int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev,
2090+
unsigned long *new_cnt)
20892091
{
20902092
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
20912093
struct ras_err_handler_data *data;
20922094
struct amdgpu_ras_eeprom_control *control;
20932095
int save_count;
20942096

2095-
if (!con || !con->eh_data)
2097+
if (!con || !con->eh_data) {
2098+
if (new_cnt)
2099+
*new_cnt = 0;
2100+
20962101
return 0;
2102+
}
20972103

20982104
mutex_lock(&con->recovery_lock);
20992105
control = &con->eeprom_control;
21002106
data = con->eh_data;
21012107
save_count = data->count - control->ras_num_recs;
21022108
mutex_unlock(&con->recovery_lock);
2109+
2110+
if (new_cnt)
2111+
*new_cnt = save_count / adev->umc.retire_unit;
2112+
21032113
/* only new entries are saved */
21042114
if (save_count > 0) {
21052115
if (amdgpu_ras_eeprom_append(control,
@@ -2186,11 +2196,12 @@ static void amdgpu_ras_validate_threshold(struct amdgpu_device *adev,
21862196
/*
21872197
* Justification of value bad_page_cnt_threshold in ras structure
21882198
*
2189-
* Generally, -1 <= amdgpu_bad_page_threshold <= max record length
2190-
* in eeprom, and introduce two scenarios accordingly.
2199+
* Generally, 0 <= amdgpu_bad_page_threshold <= max record length
2200+
* in eeprom or amdgpu_bad_page_threshold == -2, introduce two
2201+
* scenarios accordingly.
21912202
*
21922203
* Bad page retirement enablement:
2193-
* - If amdgpu_bad_page_threshold = -1,
2204+
* - If amdgpu_bad_page_threshold = -2,
21942205
* bad_page_cnt_threshold = typical value by formula.
21952206
*
21962207
* - When the value from user is 0 < amdgpu_bad_page_threshold <

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ int amdgpu_ras_query_error_count(struct amdgpu_device *adev,
547547
int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
548548
struct eeprom_table_record *bps, int pages);
549549

550-
int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev);
550+
int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev,
551+
unsigned long *new_cnt);
551552

552553
static inline enum ta_ras_block
553554
amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) {

0 commit comments

Comments
 (0)