Skip to content

Commit b322a50

Browse files
committed
Merge tag 'amd-drm-next-5.14-2021-06-22-1' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.14-2021-06-22-1: amdgpu: - Userptr BO fixes - RAS fixes - Beige Goby fixes - Add some missing freesync documentation - Aldebaran fixes - SR-IOV fixes - Potential memory corruption fix in framebuffer handling - Revert GFX9, 10 doorbell fixes, we just end up trading one bug for another - Multi-plane cursor fixes with rotation - LTTPR fixes - Backlight fixes - eDP fix - Fold DRM_AMD_DC_DCN3_1 into DRM_AMD_DC_DCN - Misc code cleanups amdkfd: - Topology fix - Locking fix radeon: - Misc code cleanup Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210622210345.27297-1-alexander.deucher@amd.com
2 parents 334200b + 8fe44c0 commit b322a50

110 files changed

Lines changed: 489 additions & 540 deletions

File tree

Some content is hidden

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

Documentation/gpu/amdgpu-dc.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,9 @@ Display Core
6666
============
6767

6868
**WIP**
69+
70+
FreeSync Video
71+
--------------
72+
73+
.. kernel-doc:: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
74+
:doc: FreeSync Video

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id, int n
373373
return -EINVAL;
374374
}
375375

376+
377+
int amdgpu_discovery_get_vcn_version(struct amdgpu_device *adev, int vcn_instance,
378+
int *major, int *minor, int *revision)
379+
{
380+
return amdgpu_discovery_get_ip_version(adev, VCN_HWID,
381+
vcn_instance, major, minor, revision);
382+
}
383+
376384
void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
377385
{
378386
struct binary_header *bhdr;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev);
3232
void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev);
3333
int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id, int number_instance,
3434
int *major, int *minor, int *revision);
35+
36+
int amdgpu_discovery_get_vcn_version(struct amdgpu_device *adev, int vcn_instance,
37+
int *major, int *minor, int *revision);
3538
int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev);
3639

3740
#endif /* __AMDGPU_DISCOVERY__ */

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,11 +1046,12 @@ int amdgpu_display_gem_fb_init(struct drm_device *dev,
10461046

10471047
rfb->base.obj[0] = obj;
10481048
drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
1049-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1049+
1050+
ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
10501051
if (ret)
10511052
goto err;
10521053

1053-
ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
1054+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
10541055
if (ret)
10551056
goto err;
10561057

@@ -1070,9 +1071,6 @@ int amdgpu_display_gem_fb_verify_and_init(
10701071

10711072
rfb->base.obj[0] = obj;
10721073
drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd);
1073-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1074-
if (ret)
1075-
goto err;
10761074
/* Verify that the modifier is supported. */
10771075
if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
10781076
mode_cmd->modifier[0])) {
@@ -1088,6 +1086,10 @@ int amdgpu_display_gem_fb_verify_and_init(
10881086
if (ret)
10891087
goto err;
10901088

1089+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1090+
if (ret)
1091+
goto err;
1092+
10911093
return 0;
10921094
err:
10931095
drm_dbg_kms(dev, "Failed to verify and init gem fb: %d\n", ret);

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,23 @@ module_param_named(tmz, amdgpu_tmz, int, 0444);
837837

838838
/**
839839
* DOC: freesync_video (uint)
840-
* Enabled the optimization to adjust front porch timing to achieve seamless mode change experience
841-
* when setting a freesync supported mode for which full modeset is not needed.
840+
* Enable the optimization to adjust front porch timing to achieve seamless
841+
* mode change experience when setting a freesync supported mode for which full
842+
* modeset is not needed.
843+
*
844+
* The Display Core will add a set of modes derived from the base FreeSync
845+
* video mode into the corresponding connector's mode list based on commonly
846+
* used refresh rates and VRR range of the connected display, when users enable
847+
* this feature. From the userspace perspective, they can see a seamless mode
848+
* change experience when the change between different refresh rates under the
849+
* same resolution. Additionally, userspace applications such as Video playback
850+
* can read this modeset list and change the refresh rate based on the video
851+
* frame rate. Finally, the userspace can also derive an appropriate mode for a
852+
* particular refresh rate based on the FreeSync Mode and add it to the
853+
* connector's mode list.
854+
*
855+
* Note: This is an experimental feature.
856+
*
842857
* The default value: 0 (off).
843858
*/
844859
MODULE_PARM_DESC(

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ int amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
300300
* @adev: amdgpu_device pointer
301301
* @offset: offset into the GPU's gart aperture
302302
* @pages: number of pages to bind
303-
* @pagelist: pages to bind
304303
* @dma_addr: DMA addresses of pages
305304
* @flags: page table entry flags
306305
*
@@ -309,7 +308,7 @@ int amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
309308
* Returns 0 for success, -EINVAL for failure.
310309
*/
311310
int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
312-
int pages, struct page **pagelist, dma_addr_t *dma_addr,
311+
int pages, dma_addr_t *dma_addr,
313312
uint64_t flags)
314313
{
315314
if (!adev->gart.ready) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ int amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
6464
int pages, dma_addr_t *dma_addr, uint64_t flags,
6565
void *dst);
6666
int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
67-
int pages, struct page **pagelist,
68-
dma_addr_t *dma_addr, uint64_t flags);
67+
int pages, dma_addr_t *dma_addr, uint64_t flags);
6968
void amdgpu_gart_invalidate_tlb(struct amdgpu_device *adev);
7069
#endif

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,6 +1984,9 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
19841984
ret = amdgpu_ras_load_bad_pages(adev);
19851985
if (ret)
19861986
goto free;
1987+
1988+
if (adev->smu.ppt_funcs && adev->smu.ppt_funcs->send_hbm_bad_pages_num)
1989+
adev->smu.ppt_funcs->send_hbm_bad_pages_num(&adev->smu, con->eeprom_control.num_recs);
19871990
}
19881991

19891992
return 0;
@@ -2063,7 +2066,9 @@ static void amdgpu_ras_get_quirks(struct amdgpu_device *adev)
20632066
return;
20642067

20652068
if (strnstr(ctx->vbios_version, "D16406",
2066-
sizeof(ctx->vbios_version)))
2069+
sizeof(ctx->vbios_version)) ||
2070+
strnstr(ctx->vbios_version, "D36002",
2071+
sizeof(ctx->vbios_version)))
20672072
adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__GFX);
20682073
}
20692074

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
841841
uint64_t page_idx = 1;
842842

843843
r = amdgpu_gart_bind(adev, gtt->offset, page_idx,
844-
ttm->pages, gtt->ttm.dma_address, flags);
844+
gtt->ttm.dma_address, flags);
845845
if (r)
846846
goto gart_bind_fail;
847847

@@ -855,11 +855,10 @@ static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
855855
r = amdgpu_gart_bind(adev,
856856
gtt->offset + (page_idx << PAGE_SHIFT),
857857
ttm->num_pages - page_idx,
858-
&ttm->pages[page_idx],
859858
&(gtt->ttm.dma_address[page_idx]), flags);
860859
} else {
861860
r = amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
862-
ttm->pages, gtt->ttm.dma_address, flags);
861+
gtt->ttm.dma_address, flags);
863862
}
864863

865864
gart_bind_fail:
@@ -935,7 +934,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
935934
/* bind pages into GART page tables */
936935
gtt->offset = (u64)bo_mem->start << PAGE_SHIFT;
937936
r = amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
938-
ttm->pages, gtt->ttm.dma_address, flags);
937+
gtt->ttm.dma_address, flags);
939938

940939
if (r)
941940
DRM_ERROR("failed to bind %u pages at 0x%08llX\n",
@@ -1129,8 +1128,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
11291128
ttm->sg = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
11301129
if (!ttm->sg)
11311130
return -ENOMEM;
1132-
1133-
ttm->page_flags |= TTM_PAGE_FLAG_SG;
11341131
return 0;
11351132
}
11361133

@@ -1156,7 +1153,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
11561153
amdgpu_ttm_tt_set_user_pages(ttm, NULL);
11571154
kfree(ttm->sg);
11581155
ttm->sg = NULL;
1159-
ttm->page_flags &= ~TTM_PAGE_FLAG_SG;
11601156
return;
11611157
}
11621158

@@ -1190,6 +1186,9 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_buffer_object *bo,
11901186
return -ENOMEM;
11911187
}
11921188

1189+
/* Set TTM_PAGE_FLAG_SG before populate but after create. */
1190+
bo->ttm->page_flags |= TTM_PAGE_FLAG_SG;
1191+
11931192
gtt = (void *)bo->ttm;
11941193
gtt->userptr = addr;
11951194
gtt->userflags = flags;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
9494
struct amdgpu_iv_entry *entry)
9595
{
9696
struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
97+
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
9798

9899
kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
99100
if (adev->umc.ras_funcs &&
@@ -131,6 +132,9 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
131132
amdgpu_ras_add_bad_pages(adev, err_data->err_addr,
132133
err_data->err_addr_cnt);
133134
amdgpu_ras_save_bad_pages(adev);
135+
136+
if (adev->smu.ppt_funcs && adev->smu.ppt_funcs->send_hbm_bad_pages_num)
137+
adev->smu.ppt_funcs->send_hbm_bad_pages_num(&adev->smu, con->eeprom_control.num_recs);
134138
}
135139

136140
amdgpu_ras_reset_gpu(adev);

0 commit comments

Comments
 (0)