All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu/drm/radeon: Do not evict VRAM with disabled HIBERNATE
@ 2018-07-24 22:15 Paul Menzel
       [not found] ` <495ce9ce-3111-d613-4202-d312a9c12242-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2018-07-24 22:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Paul Menzel <pmenzel@molgen.mpg.de>
Date: Wed, 18 Jul 2018 18:15:44 +0200

Improve commit d796d844 (drm/radeon/kms: make hibernate work on IGPs) to
only migrate VRAM objects if the Linux kernel is actually built with
support for hibernation (suspend to disk).

Link: https://bugs.freedesktop.org/show_bug.cgi?id=107277
Cc: stable@vger.kernel.org
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
  drivers/gpu/drm/radeon/radeon_object.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index edbb4cd519fd..0cb5eb013a4f 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -422,11 +422,13 @@ int radeon_bo_unpin(struct radeon_bo *bo)
  int radeon_bo_evict_vram(struct radeon_device *rdev)
  {
  	/* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */
-	if (0 && (rdev->flags & RADEON_IS_IGP)) {
+#ifndef CONFIG_HIBERNATION
+	if (rdev->flags & RADEON_IS_IGP) {
  		if (rdev->mc.igp_sideport_enabled == false)
  			/* Useless to evict on IGP chips */
  			return 0;
  	}
+#endif
  	return ttm_bo_evict_mm(&rdev->mman.bdev, TTM_PL_VRAM);
  }

-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/radeon: Do not evict VRAM with disabled HIBERNATE
       [not found] ` <495ce9ce-3111-d613-4202-d312a9c12242-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
@ 2018-07-25  8:34   ` Christian König
       [not found]     ` <e913459a-8d1f-7f79-0b91-b60030ac7c03-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2018-07-25  8:34 UTC (permalink / raw)
  To: Paul Menzel, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 25.07.2018 um 00:15 schrieb Paul Menzel:
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Date: Wed, 18 Jul 2018 18:15:44 +0200
>
> Improve commit d796d844 (drm/radeon/kms: make hibernate work on IGPs) to
> only migrate VRAM objects if the Linux kernel is actually built with
> support for hibernation (suspend to disk).
>
> Link: https://bugs.freedesktop.org/show_bug.cgi?id=107277
> Cc: stable@vger.kernel.org
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>

At least a step into the right direction.

Patch is Reviewed-by: Christian König <christian.koenig@amd.com>, but we 
are also going to need one for amdgpu.

Christian.

> ---
>  drivers/gpu/drm/radeon/radeon_object.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
> b/drivers/gpu/drm/radeon/radeon_object.c
> index edbb4cd519fd..0cb5eb013a4f 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -422,11 +422,13 @@ int radeon_bo_unpin(struct radeon_bo *bo)
>  int radeon_bo_evict_vram(struct radeon_device *rdev)
>  {
>      /* late 2.6.33 fix IGP hibernate - we need pm ops to do this 
> correct */
> -    if (0 && (rdev->flags & RADEON_IS_IGP)) {
> +#ifndef CONFIG_HIBERNATION
> +    if (rdev->flags & RADEON_IS_IGP) {
>          if (rdev->mc.igp_sideport_enabled == false)
>              /* Useless to evict on IGP chips */
>              return 0;
>      }
> +#endif
>      return ttm_bo_evict_mm(&rdev->mman.bdev, TTM_PL_VRAM);
>  }
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/radeon: Do not evict VRAM with disabled HIBERNATE
       [not found]     ` <e913459a-8d1f-7f79-0b91-b60030ac7c03-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-07-25  9:34       ` Paul Menzel
       [not found]         ` <1525c8cd-75b8-9b1b-1e43-ca18c5a507bb-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2018-07-25  9:34 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1079 bytes --]

Dear Christian,


On 07/25/18 10:34, Christian König wrote:
> Am 25.07.2018 um 00:15 schrieb Paul Menzel:
>> From: Paul Menzel <pmenzel-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
>> Date: Wed, 18 Jul 2018 18:15:44 +0200
>>
>> Improve commit d796d844 (drm/radeon/kms: make hibernate work on IGPs) to
>> only migrate VRAM objects if the Linux kernel is actually built with
>> support for hibernation (suspend to disk).
>>
>> Link: https://bugs.freedesktop.org/show_bug.cgi?id=107277
>> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Signed-off-by: Paul Menzel <pmenzel-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
> 
> At least a step into the right direction.

There is also the *nohibernate* keyword for the Linux command line.

> nohibernate     [HIBERNATION] Disable hibernation and resume.

I need to investigate, if that can be considered too.

> Patch is Reviewed-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>, but we
> are also going to need one for amdgpu.

Indeed. I can prepare that too.


Kind regards,

Paul


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5174 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm/radeon: Do not evict VRAM with disabled HIBERNATE
       [not found]         ` <1525c8cd-75b8-9b1b-1e43-ca18c5a507bb-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
@ 2018-07-25 10:09           ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2018-07-25 10:09 UTC (permalink / raw)
  To: Paul Menzel, Christian König
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1660 bytes --]

Am 25.07.2018 um 11:34 schrieb Paul Menzel:
> Dear Christian,
>
>
> On 07/25/18 10:34, Christian König wrote:
>> Am 25.07.2018 um 00:15 schrieb Paul Menzel:
>>> From: Paul Menzel <pmenzel-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
>>> Date: Wed, 18 Jul 2018 18:15:44 +0200
>>>
>>> Improve commit d796d844 (drm/radeon/kms: make hibernate work on IGPs) to
>>> only migrate VRAM objects if the Linux kernel is actually built with
>>> support for hibernation (suspend to disk).
>>>
>>> Link: https://bugs.freedesktop.org/show_bug.cgi?id=107277
>>> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> Signed-off-by: Paul Menzel <pmenzel-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
>> At least a step into the right direction.
> There is also the *nohibernate* keyword for the Linux command line.

Well in general it would be better to get that information from the PM 
subsystem during suspend.

IIRC in amdgpu we already distinct between suspend and freez in 
amdgpu_device_suspend().

So that information just needs to be passed on to amdgpu_evict_vram().

On radeon it is probably a bit more work to implement this.

Regards,
Christian.

>
>> nohibernate     [HIBERNATION] Disable hibernation and resume.
> I need to investigate, if that can be considered too.
>
>> Patch is Reviewed-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>, but we
>> are also going to need one for amdgpu.
> Indeed. I can prepare that too.
>
>
> Kind regards,
>
> Paul
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 3491 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-25 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24 22:15 [PATCH] gpu/drm/radeon: Do not evict VRAM with disabled HIBERNATE Paul Menzel
     [not found] ` <495ce9ce-3111-d613-4202-d312a9c12242-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
2018-07-25  8:34   ` Christian König
     [not found]     ` <e913459a-8d1f-7f79-0b91-b60030ac7c03-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-07-25  9:34       ` Paul Menzel
     [not found]         ` <1525c8cd-75b8-9b1b-1e43-ca18c5a507bb-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
2018-07-25 10:09           ` Christian König

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.