diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-01 18:56:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-01 18:56:15 -0500 |
commit | 5d60e057d127538113d8945ea87d916fccee93fe (patch) | |
tree | 7aa0a320da9847ccb90fee45bc5392364efe5903 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 2120447b5dbda530a5c13cbc77cf20336465a5b4 (diff) | |
parent | 93dfdf9fde9f20f1c46738bf184adeebc7d7d66e (diff) |
Merge tag 'drm-fixes-for-v4.16-rc4' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"Pretty much run of the mill drm fixes.
amdgpu:
- power management fixes
- some display fixes
- one ppc 32-bit dma fix
i915:
- two display fixes
- three gem fixes
sun4i:
- display regression fixes
nouveau:
- display regression fix
virtio-gpu:
- dumb airlied ioctl fix"
* tag 'drm-fixes-for-v4.16-rc4' of git://people.freedesktop.org/~airlied/linux: (25 commits)
drm/amdgpu: skip ECC for SRIOV in gmc late_init
drm/amd/amdgpu: Correct VRAM width for APUs with GMC9
drm/amdgpu: fix&cleanups for wb_clear
drm/amdgpu: Correct sdma_v4 get_wptr(v2)
drm/amd/powerplay: fix power over limit on Fiji
drm/amdgpu:Fixed wrong emit frame size for enc
drm/amdgpu: move WB_FREE to correct place
drm/amdgpu: only flush hotplug work without DC
drm/amd/display: check for ipp before calling cursor operations
drm/i915: Make global seqno known in i915_gem_request_execute tracepoint
drm/i915: Clear the in-use marker on execbuf failure
drm/i915/cnl: Fix PORT_TX_DW5/7 register address
drm/i915/audio: fix check for av_enc_map overflow
drm/i915: Fix rsvd2 mask when out-fence is returned
virtio-gpu: fix ioctl and expose the fixed status to userspace.
drm/sun4i: Protect the TCON pixel clocks
drm/sun4i: Enable the output on the pins (tcon0)
drm/nouveau: prefer XBGR2101010 for addfb ioctl
drm/radeon: insist on 32-bit DMA for Cedar on PPC64/PPC64LE
drm/amd/display: VGA black screen from s3 when attached to hook
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 00a50cc5ec9a..af1b879a9ee9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -492,7 +492,7 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev) | |||
492 | memset(&adev->wb.used, 0, sizeof(adev->wb.used)); | 492 | memset(&adev->wb.used, 0, sizeof(adev->wb.used)); |
493 | 493 | ||
494 | /* clear wb memory */ | 494 | /* clear wb memory */ |
495 | memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t)); | 495 | memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t) * 8); |
496 | } | 496 | } |
497 | 497 | ||
498 | return 0; | 498 | return 0; |
@@ -530,8 +530,9 @@ int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb) | |||
530 | */ | 530 | */ |
531 | void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb) | 531 | void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb) |
532 | { | 532 | { |
533 | wb >>= 3; | ||
533 | if (wb < adev->wb.num_wb) | 534 | if (wb < adev->wb.num_wb) |
534 | __clear_bit(wb >> 3, adev->wb.used); | 535 | __clear_bit(wb, adev->wb.used); |
535 | } | 536 | } |
536 | 537 | ||
537 | /** | 538 | /** |
@@ -1455,11 +1456,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) | |||
1455 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1456 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1456 | if (!adev->ip_blocks[i].status.hw) | 1457 | if (!adev->ip_blocks[i].status.hw) |
1457 | continue; | 1458 | continue; |
1458 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { | ||
1459 | amdgpu_free_static_csa(adev); | ||
1460 | amdgpu_device_wb_fini(adev); | ||
1461 | amdgpu_device_vram_scratch_fini(adev); | ||
1462 | } | ||
1463 | 1459 | ||
1464 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && | 1460 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
1465 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { | 1461 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { |
@@ -1486,6 +1482,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) | |||
1486 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1482 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1487 | if (!adev->ip_blocks[i].status.sw) | 1483 | if (!adev->ip_blocks[i].status.sw) |
1488 | continue; | 1484 | continue; |
1485 | |||
1486 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { | ||
1487 | amdgpu_free_static_csa(adev); | ||
1488 | amdgpu_device_wb_fini(adev); | ||
1489 | amdgpu_device_vram_scratch_fini(adev); | ||
1490 | } | ||
1491 | |||
1489 | r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); | 1492 | r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); |
1490 | /* XXX handle errors */ | 1493 | /* XXX handle errors */ |
1491 | if (r) { | 1494 | if (r) { |
@@ -2284,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) | |||
2284 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); | 2287 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); |
2285 | } | 2288 | } |
2286 | drm_modeset_unlock_all(dev); | 2289 | drm_modeset_unlock_all(dev); |
2287 | } else { | ||
2288 | /* | ||
2289 | * There is no equivalent atomic helper to turn on | ||
2290 | * display, so we defined our own function for this, | ||
2291 | * once suspend resume is supported by the atomic | ||
2292 | * framework this will be reworked | ||
2293 | */ | ||
2294 | amdgpu_dm_display_resume(adev); | ||
2295 | } | 2290 | } |
2296 | } | 2291 | } |
2297 | 2292 | ||
@@ -2726,7 +2721,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, | |||
2726 | if (amdgpu_device_has_dc_support(adev)) { | 2721 | if (amdgpu_device_has_dc_support(adev)) { |
2727 | if (drm_atomic_helper_resume(adev->ddev, state)) | 2722 | if (drm_atomic_helper_resume(adev->ddev, state)) |
2728 | dev_info(adev->dev, "drm resume failed:%d\n", r); | 2723 | dev_info(adev->dev, "drm resume failed:%d\n", r); |
2729 | amdgpu_dm_display_resume(adev); | ||
2730 | } else { | 2724 | } else { |
2731 | drm_helper_resume_force_mode(adev->ddev); | 2725 | drm_helper_resume_force_mode(adev->ddev); |
2732 | } | 2726 | } |