drm: mm: add helper to unwind scan state