All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
Cc: Alexander.Deucher-5C7GfCeVMHo@public.gmane.org,
	harry.wentland-5C7GfCeVMHo@public.gmane.org,
	christian.koenig-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: Fix S3 resume failre.
Date: Thu, 19 Jul 2018 18:39:02 +0300	[thread overview]
Message-ID: <20180719153902.GA5565@intel.com> (raw)
In-Reply-To: <1532013596-26662-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>

On Thu, Jul 19, 2018 at 11:19:56AM -0400, Andrey Grodzovsky wrote:
> 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.
> 
> 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.grodzovsky@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;

So apparently you haven't yet turned off the planes here. If I'm 
reading things right amdgpu_device_ip_suspend() should end up doing
that through drm_atomic_helper_suspend(). So it looks like like now
you'll end up unpinning the same bos twice. Doesn't that mess up
some kind of refcount or something?

To me it would seem better to susped the display before trying
to evict the bos.

>  		struct amdgpu_bo *robj;
>  
>  		if (amdgpu_crtc->cursor_bo) {
> -- 
> 2.7.4

-- 
Ville Syrjälä
Intel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-07-19 15:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 15:19 [PATCH] drm/amdgpu: Fix S3 resume failre Andrey Grodzovsky
     [not found] ` <1532013596-26662-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-07-19 15:25   ` Christian König
     [not found]     ` <fb787740-8201-8d27-4ee2-dfcc8d732bc7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-19 15:32       ` Harry Wentland
2018-07-19 16:34       ` Andrey Grodzovsky
2018-07-19 15:39   ` Ville Syrjälä [this message]
     [not found]     ` <20180719153902.GA5565-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-07-19 16:33       ` Andrey Grodzovsky
     [not found]         ` <86de8654-1bff-ad56-9e72-9ec1eb2e7f76-5C7GfCeVMHo@public.gmane.org>
2018-07-19 16:47           ` Michel Dänzer
     [not found]             ` <13eee582-a100-4c36-e3c6-ad6f96f40efd-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-19 16:53               ` Andrey Grodzovsky
     [not found]                 ` <020d0b20-32f5-8974-06a7-5ef015ddca87-5C7GfCeVMHo@public.gmane.org>
2018-07-19 16:59                   ` Michel Dänzer
     [not found]                     ` <455ebec7-b2cf-0f8e-3fbc-be192d0913c0-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-19 17:07                       ` Andrey Grodzovsky
     [not found]                         ` <7406a2c5-56ed-15f0-7007-25a806218a79-5C7GfCeVMHo@public.gmane.org>
2018-07-19 18:30                           ` Alex Deucher
     [not found]                             ` <CADnq5_Om34fPU5uY_ChVv7b2jAJcP36-Auv6q-2a=Jf=d_L_KA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-19 19:37                               ` Harry Wentland
     [not found]                                 ` <6d0bf937-a857-11d7-3472-9b9e848b6576-5C7GfCeVMHo@public.gmane.org>
2018-07-19 20:17                                   ` Andrey Grodzovsky
     [not found]                                     ` <99b55a5d-fc78-c319-4c3e-cc6aa0478f7a-5C7GfCeVMHo@public.gmane.org>
2018-07-19 22:45                                       ` Andrey Grodzovsky
2018-07-20 13:52                               ` Andrey Grodzovsky

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=20180719153902.GA5565@intel.com \
    --to=ville.syrjala-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=harry.wentland-5C7GfCeVMHo@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.