On 07/19/2018 11:25 AM, Christian König wrote:
Am 19.07.2018 um 17:19 schrieb Andrey Grodzovsky:
Problem:
FB is still not unpinned during the first run of amdgpu_bo_evict_vram
and so it's left for the second run, but during second run the SDMA for
moving buffer around already disabled and you have to do
it with CPU, but FB is not in visible VRAM and hence the eviction failure
leading later to resume failure.

Fix:
When DAL in use get a pointer to FB from crtc->primary->state rather
then from crtc->primary which is not set for DAL since it supports
atomic KMS.

Nice catch, but could we add a helper for unpinning them and just unpin both instead of checking if DC is enabled or not?

They are mutually exclusive, once is only used in legacy drivers another only in atomic KMS drivers.

Andrey


I think that would be a little bit cleaner.

Christian.


Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107065
Fixes e00fb85 drm: Stop updating plane->crtc/fb/old_fb on atomic drivers
Signed-off-by: Andrey Grodzovsky <andrey.grodzov...@amd.com>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 709e4a3..dd9ebf7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2642,7 +2642,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
      /* unpin the front buffers and cursors */
      list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
          struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
-        struct drm_framebuffer *fb = crtc->primary->fb;
+         struct drm_framebuffer *fb = amdgpu_device_has_dc_support(adev) ?
+                 crtc->primary->state->fb : crtc->primary->fb;
          struct amdgpu_bo *robj;
            if (amdgpu_crtc->cursor_bo) {


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to