Skip to content

Commit 3a97a29

Browse files
committed
Merge tag 'drm-fixes-2023-07-14-1' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "There were a bunch of fixes lined up for 2 weeks, so we have quite a few scattered fixes, mostly amdgpu and i915, but ttm has a bunch and nouveau makes an appearance. So a bit busier than usual for rc2, but nothing seems out of the ordinary. fbdev: - dma: Fix documented default preferred_bpp value ttm: - fix warning that we shouldn't mix && and || - never consider pinned BOs for eviction&swap - Don't leak a resource on eviction error - Don't leak a resource on swapout move error - fix bulk_move corruption when adding a entry client: - Send hotplug event after registering a client dma-buf: - keep the signaling time of merged fences v3 - fix an error pointer vs NULL bug sched: - wait for all deps in kill jobs - call set fence parent from scheduled i915: - Don't preserve dpll_hw_state for slave crtc in Bigjoiner - Consider OA buffer boundary when zeroing out reports - Remove dead code from gen8_pte_encode - Fix one wrong caching mode enum usage amdgpu: - SMU i2c locking fix - Fix a possible deadlock in process restoration for ROCm apps - Disable PCIe lane/speed switching on Intel platforms (the platforms don't support it) nouveau: - disp: fix HDMI on gt215+ - disp/g94: enable HDMI - acr: Abort loading ACR if no firmware was found - bring back blit subchannel for pre nv50 GPUs - Fix drm_dp_remove_payload() invocation ivpu: - Fix VPU register access in irq disable - Clear specific interrupt status bits on C0 bridge: - dw_hdmi: fix connector access for scdc - ti-sn65dsi86: Fix auxiliary bus lifetime panel: - simple: Add connector_type for innolux_at043tn24 - simple: Add Powertip PH800480T013 drm_display_mode flags" * tag 'drm-fixes-2023-07-14-1' of git://anongit.freedesktop.org/drm/drm: (32 commits) drm/nouveau: bring back blit subchannel for pre nv50 GPUs drm/nouveau/acr: Abort loading ACR if no firmware was found drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13 drm/amd: Move helper for dynamic speed switch check out of smu13 drm/amd/pm: conditionally disable pcie lane/speed switching for SMU13 drm/amd/pm: share the code around SMU13 pcie parameters update drm/amdgpu: avoid restore process run into dead loop. drm/amd/pm: fix smu i2c data read risk drm/nouveau/disp/g94: enable HDMI drm/nouveau/disp: fix HDMI on gt215+ drm/client: Send hotplug event after registering a client drm/i915: Fix one wrong caching mode enum usage drm/i915: Remove dead code from gen8_pte_encode drm/i915/perf: Consider OA buffer boundary when zeroing out reports drm/i915: Don't preserve dpll_hw_state for slave crtc in Bigjoiner drm/ttm: never consider pinned BOs for eviction&swap drm/fbdev-dma: Fix documented default preferred_bpp value dma-buf: fix an error pointer vs NULL bug accel/ivpu: Clear specific interrupt status bits on C0 accel/ivpu: Fix VPU register access in irq disable ...
2 parents ddbd916 + 38d88d5 commit 3a97a29

Some content is hidden

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

48 files changed

+318
-266
lines changed

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct ivpu_wa_table {
7575
bool punit_disabled;
7676
bool clear_runtime_mem;
7777
bool d3hot_after_power_off;
78+
bool interrupt_clear_with_0;
7879
};
7980

8081
struct ivpu_hw_info;

drivers/accel/ivpu/ivpu_hw_mtl.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)
101101
vdev->wa.punit_disabled = ivpu_is_fpga(vdev);
102102
vdev->wa.clear_runtime_mem = false;
103103
vdev->wa.d3hot_after_power_off = true;
104+
105+
if (ivpu_device_id(vdev) == PCI_DEVICE_ID_MTL && ivpu_revision(vdev) < 4)
106+
vdev->wa.interrupt_clear_with_0 = true;
104107
}
105108

106109
static void ivpu_hw_timeouts_init(struct ivpu_device *vdev)
@@ -885,7 +888,7 @@ static void ivpu_hw_mtl_irq_disable(struct ivpu_device *vdev)
885888
REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x1);
886889
REGB_WR32(MTL_BUTTRESS_LOCAL_INT_MASK, BUTTRESS_IRQ_DISABLE_MASK);
887890
REGV_WR64(MTL_VPU_HOST_SS_ICB_ENABLE_0, 0x0ull);
888-
REGB_WR32(MTL_VPU_HOST_SS_FW_SOC_IRQ_EN, 0x0);
891+
REGV_WR32(MTL_VPU_HOST_SS_FW_SOC_IRQ_EN, 0x0);
889892
}
890893

891894
static void ivpu_hw_mtl_irq_wdt_nce_handler(struct ivpu_device *vdev)
@@ -973,12 +976,15 @@ static u32 ivpu_hw_mtl_irqb_handler(struct ivpu_device *vdev, int irq)
973976
schedule_recovery = true;
974977
}
975978

976-
/*
977-
* Clear local interrupt status by writing 0 to all bits.
978-
* This must be done after interrupts are cleared at the source.
979-
* Writing 1 triggers an interrupt, so we can't perform read update write.
980-
*/
981-
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, 0x0);
979+
/* This must be done after interrupts are cleared at the source. */
980+
if (IVPU_WA(interrupt_clear_with_0))
981+
/*
982+
* Writing 1 triggers an interrupt, so we can't perform read update write.
983+
* Clear local interrupt status by writing 0 to all bits.
984+
*/
985+
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, 0x0);
986+
else
987+
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, status);
982988

983989
/* Re-enable global interrupt */
984990
REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x0);

drivers/dma-buf/dma-fence-unwrap.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,36 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
6666
{
6767
struct dma_fence_array *result;
6868
struct dma_fence *tmp, **array;
69+
ktime_t timestamp;
6970
unsigned int i;
7071
size_t count;
7172

7273
count = 0;
74+
timestamp = ns_to_ktime(0);
7375
for (i = 0; i < num_fences; ++i) {
74-
dma_fence_unwrap_for_each(tmp, &iter[i], fences[i])
75-
if (!dma_fence_is_signaled(tmp))
76+
dma_fence_unwrap_for_each(tmp, &iter[i], fences[i]) {
77+
if (!dma_fence_is_signaled(tmp)) {
7678
++count;
79+
} else if (test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
80+
&tmp->flags)) {
81+
if (ktime_after(tmp->timestamp, timestamp))
82+
timestamp = tmp->timestamp;
83+
} else {
84+
/*
85+
* Use the current time if the fence is
86+
* currently signaling.
87+
*/
88+
timestamp = ktime_get();
89+
}
90+
}
7791
}
7892

93+
/*
94+
* If we couldn't find a pending fence just return a private signaled
95+
* fence with the timestamp of the last signaled one.
96+
*/
7997
if (count == 0)
80-
return dma_fence_get_stub();
98+
return dma_fence_allocate_private_stub(timestamp);
8199

82100
array = kmalloc_array(count, sizeof(*array), GFP_KERNEL);
83101
if (!array)
@@ -138,7 +156,7 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
138156
} while (tmp);
139157

140158
if (count == 0) {
141-
tmp = dma_fence_get_stub();
159+
tmp = dma_fence_allocate_private_stub(ktime_get());
142160
goto return_tmp;
143161
}
144162

drivers/dma-buf/dma-fence.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,17 @@ EXPORT_SYMBOL(dma_fence_get_stub);
150150

151151
/**
152152
* dma_fence_allocate_private_stub - return a private, signaled fence
153+
* @timestamp: timestamp when the fence was signaled
153154
*
154155
* Return a newly allocated and signaled stub fence.
155156
*/
156-
struct dma_fence *dma_fence_allocate_private_stub(void)
157+
struct dma_fence *dma_fence_allocate_private_stub(ktime_t timestamp)
157158
{
158159
struct dma_fence *fence;
159160

160161
fence = kzalloc(sizeof(*fence), GFP_KERNEL);
161162
if (fence == NULL)
162-
return ERR_PTR(-ENOMEM);
163+
return NULL;
163164

164165
dma_fence_init(fence,
165166
&dma_fence_stub_ops,
@@ -169,7 +170,7 @@ struct dma_fence *dma_fence_allocate_private_stub(void)
169170
set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
170171
&fence->flags);
171172

172-
dma_fence_signal(fence);
173+
dma_fence_signal_timestamp(fence, timestamp);
173174

174175
return fence;
175176
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
12961296
void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
12971297
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
12981298
bool amdgpu_device_need_post(struct amdgpu_device *adev);
1299+
bool amdgpu_device_pcie_dynamic_switching_supported(void);
12991300
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
13001301
bool amdgpu_device_aspm_support_quirk(void);
13011302

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,6 +2881,9 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
28812881
if (!attachment->is_mapped)
28822882
continue;
28832883

2884+
if (attachment->bo_va->base.bo->tbo.pin_count)
2885+
continue;
2886+
28842887
kfd_mem_dmaunmap_attachment(mem, attachment);
28852888
ret = update_gpuvm_pte(mem, attachment, &sync_obj);
28862889
if (ret) {

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,25 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
14581458
return true;
14591459
}
14601460

1461+
/*
1462+
* Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
1463+
* speed switching. Until we have confirmation from Intel that a specific host
1464+
* supports it, it's safer that we keep it disabled for all.
1465+
*
1466+
* https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
1467+
* https://gitlab.freedesktop.org/drm/amd/-/issues/2663
1468+
*/
1469+
bool amdgpu_device_pcie_dynamic_switching_supported(void)
1470+
{
1471+
#if IS_ENABLED(CONFIG_X86)
1472+
struct cpuinfo_x86 *c = &cpu_data(0);
1473+
1474+
if (c->x86_vendor == X86_VENDOR_INTEL)
1475+
return false;
1476+
#endif
1477+
return true;
1478+
}
1479+
14611480
/**
14621481
* amdgpu_device_should_use_aspm - check if the device should program ASPM
14631482
*

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,5 +295,9 @@ int smu_v13_0_get_pptable_from_firmware(struct smu_context *smu,
295295
uint32_t *size,
296296
uint32_t pptable_id);
297297

298+
int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
299+
uint32_t pcie_gen_cap,
300+
uint32_t pcie_width_cap);
301+
298302
#endif
299303
#endif

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,6 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap,
21132113
}
21142114
mutex_lock(&adev->pm.mutex);
21152115
r = smu_cmn_update_table(smu, SMU_TABLE_I2C_COMMANDS, 0, req, true);
2116-
mutex_unlock(&adev->pm.mutex);
21172116
if (r)
21182117
goto fail;
21192118

@@ -2130,6 +2129,7 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap,
21302129
}
21312130
r = num_msgs;
21322131
fail:
2132+
mutex_unlock(&adev->pm.mutex);
21332133
kfree(req);
21342134
return r;
21352135
}

drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,6 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap,
30213021
}
30223022
mutex_lock(&adev->pm.mutex);
30233023
r = smu_cmn_update_table(smu, SMU_TABLE_I2C_COMMANDS, 0, req, true);
3024-
mutex_unlock(&adev->pm.mutex);
30253024
if (r)
30263025
goto fail;
30273026

@@ -3038,6 +3037,7 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap,
30383037
}
30393038
r = num_msgs;
30403039
fail:
3040+
mutex_unlock(&adev->pm.mutex);
30413041
kfree(req);
30423042
return r;
30433043
}

0 commit comments

Comments
 (0)