dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 214621] WARNING: CPU: 3 PID: 521 at drivers/gpu/drm/ttm/ttm_bo.c:409 ttm_bo_release+0xb64/0xe40 [ttm]
Date: Fri, 12 Nov 2021 10:10:01 +0000	[thread overview]
Message-ID: <bug-214621-2300-hIHITTJHPz@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-214621-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=214621

--- Comment #18 from Lang Yu (Lang.Yu@amd.com) ---
Hi all,

I reproduced the issue. Thanks for Erhard F.'s work!

The problem is the pinned BO of last call to 
amdgpu_display_crtc_page_flip_target() was not unpinned properly.


int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
                                struct drm_framebuffer *fb,
                                struct drm_pending_vblank_event *event,
                                uint32_t page_flip_flags, uint32_t target,
                                struct drm_modeset_acquire_ctx *ctx)
{
        struct drm_device *dev = crtc->dev;
        struct amdgpu_device *adev = drm_to_adev(dev);
        struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
        struct drm_gem_object *obj;
        struct amdgpu_flip_work *work;
        struct amdgpu_bo *new_abo;
        unsigned long flags;
        u64 tiling_flags;
        int i, r;

        work = kzalloc(sizeof *work, GFP_KERNEL);
        if (work == NULL)
                return -ENOMEM;

        INIT_DELAYED_WORK(&work->flip_work, amdgpu_display_flip_work_func);
        INIT_WORK(&work->unpin_work, amdgpu_display_unpin_work_func);

        work->event = event;
        work->adev = adev;
        work->crtc_id = amdgpu_crtc->crtc_id;
        work->async = (page_flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;

        /* schedule unpin of the old buffer */
        obj = crtc->primary->fb->obj[0];

        /* take a reference to the old object */
        work->old_abo = gem_to_amdgpu_bo(obj);
        amdgpu_bo_ref(work->old_abo);

        obj = fb->obj[0];
        new_abo = gem_to_amdgpu_bo(obj);

        /* pin the new buffer */
        r = amdgpu_bo_reserve(new_abo, false);
        if (unlikely(r != 0)) {
                DRM_ERROR("failed to reserve new abo buffer before flip\n");
                goto cleanup;
        }

        if (!adev->enable_virtual_display) {
                r = amdgpu_bo_pin(new_abo,
                                  amdgpu_display_supported_domains(adev,
new_abo->flags));
                if (unlikely(r != 0)) {
                        DRM_ERROR("failed to pin new abo buffer before
flip\n");
                        goto unreserve;
                }
        }

        ......

}

Regards,
Lang

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2021-11-12 10:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 23:41 [Bug 214621] New: WARNING: CPU: 3 PID: 521 at drivers/gpu/drm/ttm/ttm_bo.c:409 ttm_bo_release+0xb64/0xe40 [ttm] bugzilla-daemon
2021-10-04 23:41 ` [Bug 214621] " bugzilla-daemon
2021-10-20 15:15 ` bugzilla-daemon
2021-10-27  7:12 ` bugzilla-daemon
2021-10-27 13:50 ` bugzilla-daemon
2021-11-01  8:46 ` bugzilla-daemon
2021-11-03 18:01 ` bugzilla-daemon
2021-11-04  7:19 ` bugzilla-daemon
2021-11-04  7:54 ` bugzilla-daemon
2021-11-04  8:05 ` bugzilla-daemon
2021-11-04 10:09 ` bugzilla-daemon
2021-11-04 10:16 ` bugzilla-daemon
2021-11-04 12:15 ` bugzilla-daemon
2021-11-04 12:39 ` bugzilla-daemon
2021-11-04 13:02 ` bugzilla-daemon
2021-11-04 14:13 ` bugzilla-daemon
2021-11-04 14:17 ` bugzilla-daemon
2021-11-04 14:18 ` bugzilla-daemon
2021-11-12 10:10 ` bugzilla-daemon [this message]
2021-11-12 11:08 ` bugzilla-daemon
2021-11-12 12:43 ` bugzilla-daemon
2022-02-17 13:12 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-214621-2300-hIHITTJHPz@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox