AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver
@ 2017-01-22 19:15 Nils Holland
       [not found] ` <20170122191527.GA3125-iI9p2NPcQ/rYtjvyW6yDsg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nils Holland @ 2017-01-22 19:15 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From d44ac1157fdb86e67822b6538ae6113c8d620412 Mon Sep 17 00:00:00 2001
From: Nils Holland <nholland@tisys.org>
Date: Sun, 22 Jan 2017 13:24:52 +0100
Subject: [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver

Add the bo creation changes that have been done to the radeon driver in
recent times, e.g. disable GTT WC on 32 bit because it is broken there,
and also disable it generally (and print a warning message) when
CONFIG_X86_PAT is not set.

Signed-off-by: Nils Holland <nholland@tisys.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index bf79b73e1538..f71fe41c1c99 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -363,11 +363,31 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
 
 	bo->flags = flags;
 
+#ifdef CONFIG_X86_32
+	/* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
+	 */
+	bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
+#elif defined(CONFIG_X86) && !defined(CONFIG_X86_PAT)
+	/* Don't try to enable write-combining when it can't work, or things
+	 * may be slow
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
+	 */
+
+#warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \
+	 thanks to write-combining
+
+	if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC;)
+		DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
+			      "better performance thanks to write-combining\n");
+	bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
+#else
 	/* For architectures that don't support WC memory,
 	 * mask out the WC flag from the BO
 	 */
 	if (!drm_arch_can_wc_memory())
 		bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
+#endif
 
 	amdgpu_fill_placement_to_bo(bo, placement);
 	/* Kernel allocation are uninterruptible */
-- 
2.11.0

_______________________________________________
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] drm/amdgpu: Bring bo creation in line with radeon driver
       [not found] ` <20170122191527.GA3125-iI9p2NPcQ/rYtjvyW6yDsg@public.gmane.org>
@ 2017-01-23  2:46   ` Michel Dänzer
       [not found]     ` <854d801c-cf4d-9ea7-a23c-f2d3399dd270-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2017-01-23  2:46 UTC (permalink / raw)
  To: Nils Holland; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 23/01/17 04:15 AM, Nils Holland wrote:
> From d44ac1157fdb86e67822b6538ae6113c8d620412 Mon Sep 17 00:00:00 2001
> From: Nils Holland <nholland@tisys.org>
> Date: Sun, 22 Jan 2017 13:24:52 +0100
> Subject: [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver
> 
> Add the bo creation changes that have been done to the radeon driver in
> recent times, e.g. disable GTT WC on 32 bit because it is broken there,
> and also disable it generally (and print a warning message) when
> CONFIG_X86_PAT is not set.
> 
> Signed-off-by: Nils Holland <nholland@tisys.org>

Looks great, thanks Nils!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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] drm/amdgpu: Bring bo creation in line with radeon driver
       [not found]     ` <854d801c-cf4d-9ea7-a23c-f2d3399dd270-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-01-23 10:29       ` Christian König
       [not found]         ` <3632c484-020b-d494-4373-04032d305385-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2017-01-23 10:29 UTC (permalink / raw)
  To: Michel Dänzer, Nils Holland; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 23.01.2017 um 03:46 schrieb Michel Dänzer:
> On 23/01/17 04:15 AM, Nils Holland wrote:
>>  From d44ac1157fdb86e67822b6538ae6113c8d620412 Mon Sep 17 00:00:00 2001
>> From: Nils Holland <nholland@tisys.org>
>> Date: Sun, 22 Jan 2017 13:24:52 +0100
>> Subject: [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver
>>
>> Add the bo creation changes that have been done to the radeon driver in
>> recent times, e.g. disable GTT WC on 32 bit because it is broken there,
>> and also disable it generally (and print a warning message) when
>> CONFIG_X86_PAT is not set.
>>
>> Signed-off-by: Nils Holland <nholland@tisys.org>
> Looks great, thanks Nils!
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com> as well.
_______________________________________________
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] drm/amdgpu: Bring bo creation in line with radeon driver
       [not found]         ` <3632c484-020b-d494-4373-04032d305385-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2017-01-23 21:38           ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2017-01-23 21:38 UTC (permalink / raw)
  To: Christian König; +Cc: Michel Dänzer, Nils Holland, amd-gfx list

On Mon, Jan 23, 2017 at 5:29 AM, Christian König
<deathsimple@vodafone.de> wrote:
> Am 23.01.2017 um 03:46 schrieb Michel Dänzer:
>>
>> On 23/01/17 04:15 AM, Nils Holland wrote:
>>>
>>>  From d44ac1157fdb86e67822b6538ae6113c8d620412 Mon Sep 17 00:00:00 2001
>>> From: Nils Holland <nholland@tisys.org>
>>> Date: Sun, 22 Jan 2017 13:24:52 +0100
>>> Subject: [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver
>>>
>>> Add the bo creation changes that have been done to the radeon driver in
>>> recent times, e.g. disable GTT WC on 32 bit because it is broken there,
>>> and also disable it generally (and print a warning message) when
>>> CONFIG_X86_PAT is not set.
>>>
>>> Signed-off-by: Nils Holland <nholland@tisys.org>
>>
>> Looks great, thanks Nils!
>>
>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
> Reviewed-by: Christian König <christian.koenig@amd.com> as well.
>

Applied.  thanks!

Alex
_______________________________________________
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:[~2017-01-23 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-22 19:15 [PATCH] drm/amdgpu: Bring bo creation in line with radeon driver Nils Holland
     [not found] ` <20170122191527.GA3125-iI9p2NPcQ/rYtjvyW6yDsg@public.gmane.org>
2017-01-23  2:46   ` Michel Dänzer
     [not found]     ` <854d801c-cf4d-9ea7-a23c-f2d3399dd270-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-01-23 10:29       ` Christian König
     [not found]         ` <3632c484-020b-d494-4373-04032d305385-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-23 21:38           ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox