Skip to content

Commit 9c9155a

Browse files
committed
Merge tag 'drm-next-2022-10-14' of git://anongit.freedesktop.org/drm/drm
Pull more drm updates from Dave Airlie: "Round of fixes for the merge window stuff, bunch of amdgpu and i915 changes, this should have the gcc11 warning fix, amongst other changes. amdgpu: - DC mutex fix - DC SubVP fixes - DCN 3.2.x fixes - DCN 3.1.x fixes - SDMA 6.x fixes - Enable DPIA for 3.1.4 - VRR fixes - VRAM BO swapping fix - Revert dirty fb helper change - SR-IOV suspend/resume fixes - Work around GCC array bounds check fail warning - UMC 8.10 fixes - Misc fixes and cleanups i915: - Round to closest in g4x+ HDMI clock readout - Update MOCS table for EHL - Fix PSR_IMR/IIR field handling - Fix watermark calculations for gen12+/DG2 modifiers - Reject excessive dotclocks early - Fix revocation of non-persistent contexts - Handle migration for dpt - Fix display problems after resume - Allow control over the flags when migrating - Consider DG2_RC_CCS_CC when migrating buffers" * tag 'drm-next-2022-10-14' of git://anongit.freedesktop.org/drm/drm: (110 commits) drm/amd/display: Add HUBP surface flip interrupt handler drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers drm/i915: allow control over the flags when migrating drm/amd/display: Simplify bool conversion drm/amd/display: fix transfer function passed to build_coefficients() drm/amd/display: add a license to cursor_reg_cache.h drm/amd/display: make virtual_disable_link_output static drm/amd/display: fix indentation in dc.c drm/amd/display: make dcn32_split_stream_for_mpc_or_odm static drm/amd/display: fix build error on arm64 drm/amd/display: 3.2.207 drm/amd/display: Clean some DCN32 macros drm/amdgpu: Add poison mode query for umc v8_10_0 drm/amdgpu: Update umc v8_10_0 headers drm/amdgpu: fix coding style issue for mca notifier drm/amdgpu: define convert_error_address for umc v8.7 drm/amdgpu: define RAS convert_error_address API drm/amdgpu: remove check for CE in RAS error address query drm/i915: Fix display problems after resume drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() [take 2] ...
2 parents a521fc3 + fc3523a commit 9c9155a

File tree

116 files changed

+1830
-1081
lines changed

Some content is hidden

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

116 files changed

+1830
-1081
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev)
7575
return;
7676

7777
adev->kfd.dev = kgd2kfd_probe(adev, vf);
78-
79-
if (adev->kfd.dev)
80-
amdgpu_amdkfd_total_mem_size += adev->gmc.real_vram_size;
8178
}
8279

8380
/**
@@ -201,6 +198,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
201198
adev->kfd.init_complete = kgd2kfd_device_init(adev->kfd.dev,
202199
adev_to_drm(adev), &gpu_resources);
203200

201+
amdgpu_amdkfd_total_mem_size += adev->gmc.real_vram_size;
202+
204203
INIT_WORK(&adev->kfd.reset_work, amdgpu_amdkfd_reset_work);
205204
}
206205
}
@@ -210,6 +209,7 @@ void amdgpu_amdkfd_device_fini_sw(struct amdgpu_device *adev)
210209
if (adev->kfd.dev) {
211210
kgd2kfd_device_exit(adev->kfd.dev);
212211
adev->kfd.dev = NULL;
212+
amdgpu_amdkfd_total_mem_size -= adev->gmc.real_vram_size;
213213
}
214214
}
215215

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include <linux/pci.h>
3939
#include <linux/pm_runtime.h>
4040
#include <drm/drm_crtc_helper.h>
41-
#include <drm/drm_damage_helper.h>
42-
#include <drm/drm_drv.h>
4341
#include <drm/drm_edid.h>
4442
#include <drm/drm_gem_framebuffer_helper.h>
4543
#include <drm/drm_fb_helper.h>
@@ -500,12 +498,6 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
500498
.create_handle = drm_gem_fb_create_handle,
501499
};
502500

503-
static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = {
504-
.destroy = drm_gem_fb_destroy,
505-
.create_handle = drm_gem_fb_create_handle,
506-
.dirty = drm_atomic_helper_dirtyfb,
507-
};
508-
509501
uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
510502
uint64_t bo_flags)
511503
{
@@ -1108,10 +1100,8 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev,
11081100
if (ret)
11091101
goto err;
11101102

1111-
if (drm_drv_uses_atomic_modeset(dev))
1112-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs_atomic);
1113-
else
1114-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1103+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1104+
11151105
if (ret)
11161106
goto err;
11171107

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,16 @@ int amdgpu_bo_create_vm(struct amdgpu_device *adev,
688688
* num of amdgpu_vm_pt entries.
689689
*/
690690
BUG_ON(bp->bo_ptr_size < sizeof(struct amdgpu_bo_vm));
691-
bp->destroy = &amdgpu_bo_vm_destroy;
692691
r = amdgpu_bo_create(adev, bp, &bo_ptr);
693692
if (r)
694693
return r;
695694

696695
*vmbo_ptr = to_amdgpu_bo_vm(bo_ptr);
697696
INIT_LIST_HEAD(&(*vmbo_ptr)->shadow_list);
697+
/* Set destroy callback to amdgpu_bo_vm_destroy after vmbo->shadow_list
698+
* is initialized.
699+
*/
700+
bo_ptr->tbo.destroy = &amdgpu_bo_vm_destroy;
698701
return r;
699702
}
700703

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,9 +2877,9 @@ static int amdgpu_bad_page_notifier(struct notifier_block *nb,
28772877
err_data.err_addr =
28782878
kcalloc(adev->umc.max_ras_err_cnt_per_query,
28792879
sizeof(struct eeprom_table_record), GFP_KERNEL);
2880-
if(!err_data.err_addr) {
2881-
dev_warn(adev->dev, "Failed to alloc memory for "
2882-
"umc error address record in mca notifier!\n");
2880+
if (!err_data.err_addr) {
2881+
dev_warn(adev->dev,
2882+
"Failed to alloc memory for umc error record in mca notifier!\n");
28832883
return NOTIFY_DONE;
28842884
}
28852885

@@ -2889,7 +2889,7 @@ static int amdgpu_bad_page_notifier(struct notifier_block *nb,
28892889
if (adev->umc.ras &&
28902890
adev->umc.ras->convert_ras_error_address)
28912891
adev->umc.ras->convert_ras_error_address(adev,
2892-
&err_data, 0, ch_inst, umc_inst, m->addr);
2892+
&err_data, m->addr, ch_inst, umc_inst);
28932893

28942894
if (amdgpu_bad_page_threshold != 0) {
28952895
amdgpu_ras_add_bad_pages(adev, err_data.err_addr,

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

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev,
222222
adev->sdma.instance[instance].fw->data;
223223
version_major = le16_to_cpu(header->header_version_major);
224224

225-
if ((duplicate && instance) || (!duplicate && version_major > 1))
226-
return -EINVAL;
225+
if ((duplicate && instance) || (!duplicate && version_major > 1)) {
226+
err = -EINVAL;
227+
goto out;
228+
}
227229

228230
err = amdgpu_sdma_init_inst_ctx(&adev->sdma.instance[instance]);
229231
if (err)
@@ -272,7 +274,7 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev,
272274
ALIGN(le32_to_cpu(sdma_hdr->ctl_ucode_size_bytes), PAGE_SIZE);
273275
break;
274276
default:
275-
return -EINVAL;
277+
err = -EINVAL;
276278
}
277279
}
278280

@@ -283,3 +285,24 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev,
283285
}
284286
return err;
285287
}
288+
289+
void amdgpu_sdma_unset_buffer_funcs_helper(struct amdgpu_device *adev)
290+
{
291+
struct amdgpu_ring *sdma;
292+
int i;
293+
294+
for (i = 0; i < adev->sdma.num_instances; i++) {
295+
if (adev->sdma.has_page_queue) {
296+
sdma = &adev->sdma.instance[i].page;
297+
if (adev->mman.buffer_funcs_ring == sdma) {
298+
amdgpu_ttm_set_buffer_funcs_status(adev, false);
299+
break;
300+
}
301+
}
302+
sdma = &adev->sdma.instance[i].ring;
303+
if (adev->mman.buffer_funcs_ring == sdma) {
304+
amdgpu_ttm_set_buffer_funcs_status(adev, false);
305+
break;
306+
}
307+
}
308+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,6 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev,
128128
char *fw_name, u32 instance, bool duplicate);
129129
void amdgpu_sdma_destroy_inst_ctx(struct amdgpu_device *adev,
130130
bool duplicate);
131+
void amdgpu_sdma_unset_buffer_funcs_helper(struct amdgpu_device *adev);
132+
131133
#endif

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,9 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
424424
static bool amdgpu_mem_visible(struct amdgpu_device *adev,
425425
struct ttm_resource *mem)
426426
{
427-
uint64_t mem_size = (u64)mem->num_pages << PAGE_SHIFT;
427+
u64 mem_size = (u64)mem->num_pages << PAGE_SHIFT;
428428
struct amdgpu_res_cursor cursor;
429+
u64 end;
429430

430431
if (mem->mem_type == TTM_PL_SYSTEM ||
431432
mem->mem_type == TTM_PL_TT)
@@ -434,12 +435,18 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
434435
return false;
435436

436437
amdgpu_res_first(mem, 0, mem_size, &cursor);
438+
end = cursor.start + cursor.size;
439+
while (cursor.remaining) {
440+
amdgpu_res_next(&cursor, cursor.size);
437441

438-
/* ttm_resource_ioremap only supports contiguous memory */
439-
if (cursor.size != mem_size)
440-
return false;
442+
/* ttm_resource_ioremap only supports contiguous memory */
443+
if (end != cursor.start)
444+
return false;
445+
446+
end = cursor.start + cursor.size;
447+
}
441448

442-
return cursor.start + cursor.size <= adev->gmc.visible_vram_size;
449+
return end <= adev->gmc.visible_vram_size;
443450
}
444451

445452
/*

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#define __AMDGPU_UMC_H__
2323
#include "amdgpu_ras.h"
2424

25-
#define UMC_INVALID_ADDR 0x1ULL
26-
2725
/*
2826
* (addr / 256) * 4096, the higher 26 bits in ErrorAddr
2927
* is the index of 4KB block
@@ -54,9 +52,8 @@ struct amdgpu_umc_ras {
5452
void (*err_cnt_init)(struct amdgpu_device *adev);
5553
bool (*query_ras_poison_mode)(struct amdgpu_device *adev);
5654
void (*convert_ras_error_address)(struct amdgpu_device *adev,
57-
struct ras_err_data *err_data,
58-
uint32_t umc_reg_offset, uint32_t ch_inst,
59-
uint32_t umc_inst, uint64_t mca_addr);
55+
struct ras_err_data *err_data, uint64_t err_addr,
56+
uint32_t ch_inst, uint32_t umc_inst);
6057
void (*ecc_info_query_ras_error_count)(struct amdgpu_device *adev,
6158
void *ras_error_status);
6259
void (*ecc_info_query_ras_error_address)(struct amdgpu_device *adev,

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,10 @@ static void cik_sdma_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq
309309
*/
310310
static void cik_sdma_gfx_stop(struct amdgpu_device *adev)
311311
{
312-
struct amdgpu_ring *sdma0 = &adev->sdma.instance[0].ring;
313-
struct amdgpu_ring *sdma1 = &adev->sdma.instance[1].ring;
314312
u32 rb_cntl;
315313
int i;
316314

317-
if ((adev->mman.buffer_funcs_ring == sdma0) ||
318-
(adev->mman.buffer_funcs_ring == sdma1))
319-
amdgpu_ttm_set_buffer_funcs_status(adev, false);
315+
amdgpu_sdma_unset_buffer_funcs_helper(adev);
320316

321317
for (i = 0; i < adev->sdma.num_instances; i++) {
322318
rb_cntl = RREG32(mmSDMA0_GFX_RB_CNTL + sdma_offsets[i]);

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,10 @@ static void sdma_v2_4_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se
342342
*/
343343
static void sdma_v2_4_gfx_stop(struct amdgpu_device *adev)
344344
{
345-
struct amdgpu_ring *sdma0 = &adev->sdma.instance[0].ring;
346-
struct amdgpu_ring *sdma1 = &adev->sdma.instance[1].ring;
347345
u32 rb_cntl, ib_cntl;
348346
int i;
349347

350-
if ((adev->mman.buffer_funcs_ring == sdma0) ||
351-
(adev->mman.buffer_funcs_ring == sdma1))
352-
amdgpu_ttm_set_buffer_funcs_status(adev, false);
348+
amdgpu_sdma_unset_buffer_funcs_helper(adev);
353349

354350
for (i = 0; i < adev->sdma.num_instances; i++) {
355351
rb_cntl = RREG32(mmSDMA0_GFX_RB_CNTL + sdma_offsets[i]);

0 commit comments

Comments
 (0)