Skip to contentSkip to conversation

drm/amdgpu: Enable scatter gather display support

PATCH Superseded Samuel Li 7 participants 65 messages Mar 2, 2018 – Mar 21, 2018 55 messages not in the archive

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Samuel Li

author
#0 lore raw

PATCH 1/2 drm/amdgpu: Enable scatter gather display support

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
 4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
 extern int amdgpu_compute_multipipe;
 extern int amdgpu_gpu_recovery;
 extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
 
 #ifdef CONFIG_DRM_AMDGPU_SI
 extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +7 -2
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
 #if defined(CONFIG_DRM_AMD_DC)
 	if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
 	    adev->flags & AMD_IS_APU &&
-	    amdgpu_device_asic_has_dc_support(adev->asic_type))
-		domain |= AMDGPU_GEM_DOMAIN_GTT;
+	    amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+		if (amdgpu_sg_display == 1) {
+			domain = AMDGPU_GEM_DOMAIN_GTT;
+		} else if (amdgpu_sg_display == -1) {
+			domain |= AMDGPU_GEM_DOMAIN_GTT;
+		}
+	}
 #endif
 
 	return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
index e670936..f0ada24 100644
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
 int amdgpu_compute_multipipe = -1;
 int amdgpu_gpu_recovery = -1; /* auto */
 int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
 
 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -290,6 +291,9 @@ module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444);
 MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 = disable)");
 module_param_named(emu_mode, amdgpu_emu_mode, int, 0444);
 
+MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 = enable, 0 = disable, -1 = auto");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
 #ifdef CONFIG_DRM_AMDGPU_SI
 
 #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
index 1206301..10f1f4f 100644
@@ -138,6 +138,11 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
 	mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
 						  fb_tiled);
 	domain = amdgpu_display_framebuffer_domains(adev);
+	if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+		DRM_INFO("Scatter gather display: enabled\n");
+	} else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+		DRM_INFO("Scatter gather display: auto\n");
+	}
 
 	height = ALIGN(mode_cmd->height, 8);
 	size = mode_cmd->pitches[0] * height;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 27 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
  4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
  extern int amdgpu_compute_multipipe;
  extern int amdgpu_gpu_recovery;
  extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
 
  #ifdef CONFIG_DRM_AMDGPU_SI
  extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
  #if defined(CONFIG_DRM_AMD_DC)

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev) · line 521

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
  	if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
  	    adev->flags & AMD_IS_APU &&
-	    amdgpu_device_asic_has_dc_support(adev->asic_type))
-		domain |= AMDGPU_GEM_DOMAIN_GTT;
+	    amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+		if (amdgpu_sg_display == 1) {
+			domain = AMDGPU_GEM_DOMAIN_GTT;
+		} else if (amdgpu_sg_display == -1) {
+			domain |= AMDGPU_GEM_DOMAIN_GTT;
+		}

Coding style, that if shouldn't use "{" and "}".

Quoted 31 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+	}
  #endif
 
  	return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
index e670936..f0ada24 100644
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
  int amdgpu_compute_multipipe = -1;
  int amdgpu_gpu_recovery = -1; /* auto */
  int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
 
  MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
  module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -290,6 +291,9 @@ module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444);
  MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 = disable)");
  module_param_named(emu_mode, amdgpu_emu_mode, int, 0444);
 
+MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 = enable, 0 = disable, -1 = auto");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
  #ifdef CONFIG_DRM_AMDGPU_SI
 
  #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 145

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
@@ -138,6 +138,11 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
  	mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
  						  fb_tiled);
  	domain = amdgpu_display_framebuffer_domains(adev);
+	if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+		DRM_INFO("Scatter gather display: enabled\n");
+	} else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+		DRM_INFO("Scatter gather display: auto\n");
+	}

Dito and printing that here is not a good idea as far as I can see.

Christian.

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 148

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
  	height = ALIGN(mode_cmd->height, 8);
  	size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#117 lore raw
In reply to a message not in the archive
Quoted 2 lines · Samuel Li

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

Do we really need a module parameter for this? There's already too many of them. The driver should know which to use in which cases, and developers can easily tweak the code. Users should never need to change this.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#119 lore raw
In reply to a message not in the archive

There are three major options when SG capability is enabled,
1) Allocate everything when possible from GTT memory
2) Allocate everything when possible from VRAM
3) Allow both VRAM/GTT to be available
Each has its own pros/cons, and it has not been decided which direction is going to be used for all PCs. So it seems beneficial to provide all the options.

Sam

Quoted 10 lines · Michel Dänzer
Quoted 2 lines · Samuel Li

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

Do we really need a module parameter for this? There's already too many of them. The driver should know which to use in which cases, and developers can easily tweak the code. Users should never need to change this.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#4 lore raw
In reply to a message not in the archive
Quoted 10 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 145

Quoted 6 lines
      domain = amdgpu_display_framebuffer_domains(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other suggestions?

Sam

Quoted 78 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 28 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.
---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++

  4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
   extern int amdgpu_compute_multipipe;
   extern int amdgpu_gpu_recovery;
   extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
     #ifdef CONFIG_DRM_AMDGPU_SI
   extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
   #if defined(CONFIG_DRM_AMD_DC)

      if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN && adev->flags & AMD_IS_APU &&

Quoted 8 lines

-        amdgpu_device_asic_has_dc_support(adev->asic_type)) -        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) { +        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 27 lines

+    }
  #endif
        return domain;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index e670936..f0ada24 100644
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
   int amdgpu_compute_multipipe = -1;

  int amdgpu_gpu_recovery = -1; /* auto */
  int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
    MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
@@ -290,6 +291,9 @@ module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444);
   MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 = disable)");
   module_param_named(emu_mode, amdgpu_emu_mode, int, 0444);
   +MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 = enable, 0 = disable, -1 = auto");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
   #ifdef CONFIG_DRM_AMDGPU_SI
     #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 145

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
@@ -138,6 +138,11 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
       mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
                             fb_tiled);
       domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Quoted 5 lines

Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
         height = ALIGN(mode_cmd->height, 8);
       size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw
In reply to a message not in the archive
Quoted 7 lines · Samuel Li
Quoted 7 lines
Quoted 6 lines
      domain = amdgpu_display_framebuffer_domains(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 6 lines
Quoted 3 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other suggestions?

Make it DRM_DEBUG? otherwise you'll spam the logs.

Quoted 85 lines

Sam

Quoted 80 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 26 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
  4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
  extern int amdgpu_compute_multipipe;
  extern int amdgpu_gpu_recovery;
  extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
    #ifdef CONFIG_DRM_AMDGPU_SI
  extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
  #if defined(CONFIG_DRM_AMD_DC)

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev) · line 521

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
      if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
          adev->flags & AMD_IS_APU &&
-        amdgpu_device_asic_has_dc_support(adev->asic_type))
-        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 27 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+    }
  #endif
        return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
index e670936..f0ada24 100644
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
  int amdgpu_compute_multipipe = -1;
  int amdgpu_gpu_recovery = -1; /* auto */
  int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
    MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
  module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -290,6 +291,9 @@ module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444);
  MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 = disable)");
  module_param_named(emu_mode, amdgpu_emu_mode, int, 0444);
  +MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 = enable, 0 = disable, -1 = auto");
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
  #ifdef CONFIG_DRM_AMDGPU_SI
    #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 145

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
@@ -138,6 +138,11 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
      mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
                            fb_tiled);
      domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Christian.

Quoted 7 lines
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · line 148

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
        height = ALIGN(mode_cmd->height, 8);
      size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#8 lore raw
In reply to a message not in the archive

This information is kind of important, and it only prints once typically when module is loaded.

Regards,
Samuel Li

Quoted 95 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, March 06, 2018 12:04 PM
To: Li, Samuel <[email protected]>
Cc: Koenig, Christian <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 7 lines · Samuel Li
Quoted 7 lines
Quoted 6 lines
      domain = amdgpu_display_framebuffer_domains(adev);
(quoted diff) +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 6 lines
Quoted 3 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other

suggestions?

Make it DRM_DEBUG? otherwise you'll spam the logs.

Quoted 25 lines

Sam

Quoted 20 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 19 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
  4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
  extern int amdgpu_compute_multipipe;
  extern int amdgpu_gpu_recovery;
  extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -0
    #ifdef CONFIG_DRM_AMDGPU_SI
  extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t

amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 514

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
  #if defined(CONFIG_DRM_AMD_DC)
      if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <

CHIP_RAVEN &&

Quoted 12 lines
Quoted 12 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 521

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
          adev->flags & AMD_IS_APU &&
-        amdgpu_device_asic_has_dc_support(adev->asic_type))
-        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+    }
  #endif
        return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index e670936..f0ada24 100644
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 136

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
  int amdgpu_compute_multipipe = -1;
  int amdgpu_gpu_recovery = -1; /* auto */
  int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
    MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in

megabytes");

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 137

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
  module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); @@
-290,6 +291,9 @@ module_param_named(gpu_recovery,

amdgpu_gpu_recovery, int, 0444);

Quoted 1 line
Quoted 1 line
Quoted 1 line

MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 =

disable)");

Quoted 36 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

module_param_named(emu_mode, amdgpu_emu_mode, int, 0444); +MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 =
enable, 0 = disable, -1 = auto");

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
  #ifdef CONFIG_DRM_AMDGPU_SI
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int

Quoted 8 lines
    #if defined(CONFIG_DRM_RADEON) ||

defined(CONFIG_DRM_RADEON_MODULE) diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
@@ -138,6 +138,11 @@ static int

amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,

Quoted 21 lines
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 138

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
      mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd-

width, cpp,

Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 145

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
                            fb_tiled);
      domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 7 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
        height = ALIGN(mode_cmd->height, 8);
      size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw
In reply to a message not in the archive

And exactly that's the problematical assumption.

This doesn't print only when the module is loaded, but rather when a framebuffer object is created.

And depending on the use case that can even be many many times per second.

Please remove that printing, addition to that I agree with Michel that the module parameter is overkill.

Regards,
Christian.

Am 06.03.2018 um 18:09 schrieb Li, Samuel:

Quoted 131 lines

This information is kind of important, and it only prints once typically when module is loaded.

Regards,
Samuel Li

Quoted 125 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, March 06, 2018 12:04 PM
To: Li, Samuel <[email protected]>
Cc: Koenig, Christian <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 11 lines · Samuel Li
Quoted 9 lines

Review

Quoted 6 lines
       domain = amdgpu_display_framebuffer_domains(adev);
(quoted diff) +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other

suggestions?

Make it DRM_DEBUG? otherwise you'll spam the logs.

Quoted 24 lines

Sam

Quoted 20 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 19 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
   drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
   4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
   extern int amdgpu_compute_multipipe;
   extern int amdgpu_gpu_recovery;
   extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -0
     #ifdef CONFIG_DRM_AMDGPU_SI
   extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t

amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 514

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
   #if defined(CONFIG_DRM_AMD_DC)
       if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <

CHIP_RAVEN &&

Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 521

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
           adev->flags & AMD_IS_APU &&
-        amdgpu_device_asic_has_dc_support(adev->asic_type))
-        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+    }
   #endif
         return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index e670936..f0ada24 100644
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 136

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
   int amdgpu_compute_multipipe = -1;
   int amdgpu_gpu_recovery = -1; /* auto */
   int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
     MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in

megabytes");

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 137

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
   module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); @@
-290,6 +291,9 @@ module_param_named(gpu_recovery,

amdgpu_gpu_recovery, int, 0444);

Quoted 1 line
Quoted 1 line
Quoted 1 line

MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable, 0 =

disable)");

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

module_param_named(emu_mode, amdgpu_emu_mode, int, 0444); +MODULE_PARM_DESC(sg_display, "Enable scatter gather display, (1 =
enable, 0 = disable, -1 = auto");

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
   #ifdef CONFIG_DRM_AMDGPU_SI
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int

Quoted 8 lines
     #if defined(CONFIG_DRM_RADEON) ||

defined(CONFIG_DRM_RADEON_MODULE) diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
@@ -138,6 +138,11 @@ static int

amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,

Quoted 19 lines
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 138

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
       mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd-

width, cpp,

Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 145

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
                             fb_tiled);
       domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 6 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
         height = ALIGN(mode_cmd->height, 8);
       size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#12 lore raw
In reply to a message not in the archive
Quoted 1 line

And exactly that's the problematical assumption.

Not assumption, I tested. You have any typical use case that it might become a problem?

Quoted 1 line

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

Regards,
Samuel Li

Quoted 119 lines

-----Original Message-----
From: Koenig, Christian
Sent: Tuesday, March 06, 2018 12:12 PM
To: Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

And exactly that's the problematical assumption.

This doesn't print only when the module is loaded, but rather when a framebuffer object is created.

And depending on the use case that can even be many many times per second.

Please remove that printing, addition to that I agree with Michel that the module parameter is overkill.

Regards,
Christian.

Am 06.03.2018 um 18:09 schrieb Li, Samuel:

Quoted 1 line

This information is kind of important, and it only prints once typically when

module is loaded.

Quoted 94 lines

Regards,
Samuel Li

Quoted 89 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, March 06, 2018 12:04 PM
To: Li, Samuel <[email protected]>
Cc: Koenig, Christian <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 6 lines · Samuel Li
Quoted 6 lines
Quoted 6 lines
       domain = amdgpu_display_framebuffer_domains(adev);
(quoted diff) +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 6 lines
Quoted 3 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other

suggestions?

Make it DRM_DEBUG? otherwise you'll spam the logs.

Quoted 24 lines

Sam

Quoted 20 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 19 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
   drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
   4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
   extern int amdgpu_compute_multipipe;
   extern int amdgpu_gpu_recovery;
   extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -0
     #ifdef CONFIG_DRM_AMDGPU_SI
   extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t

amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 514

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
   #if defined(CONFIG_DRM_AMD_DC)
       if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <

CHIP_RAVEN &&

Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 521

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
           adev->flags & AMD_IS_APU &&
-        amdgpu_device_asic_has_dc_support(adev->asic_type))
-        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+    }
   #endif
         return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index e670936..f0ada24 100644
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 136

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
   int amdgpu_compute_multipipe = -1;
   int amdgpu_gpu_recovery = -1; /* auto */
   int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
     MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in

megabytes");

Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
   module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
Quoted 41 lines

@@

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 137

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
-290,6 +291,9 @@ module_param_named(gpu_recovery,

amdgpu_gpu_recovery, int, 0444);

Quoted 1 line
Quoted 1 line
Quoted 1 line

MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable,

0 =

Quoted 2 lines
Quoted 2 lines

disable)");

Quoted 1 line
Quoted 1 line
Quoted 1 line

module_param_named(emu_mode, amdgpu_emu_mode, int,

0444);

Quoted 33 lines
Quoted 33 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+MODULE_PARM_DESC(sg_display, "Enable scatter gather display,
(1 = enable, 0 = disable, -1 = auto");

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
   #ifdef CONFIG_DRM_AMDGPU_SI
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int

Quoted 8 lines
     #if defined(CONFIG_DRM_RADEON) ||

defined(CONFIG_DRM_RADEON_MODULE) diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
@@ -138,6 +138,11 @@ static int

amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,

Quoted 19 lines
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 138

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
       mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd-

width, cpp,

Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 145

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
                             fb_tiled);
       domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }
Quoted 6 lines

Dito and printing that here is not a good idea as far as I can see.

Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
         height = ALIGN(mode_cmd->height, 8);
       size = mode_cmd->pitches[0] * height;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#14 lore raw
In reply to a message not in the archive

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 2 lines
Quoted 1 line

And exactly that's the problematical assumption.

Not assumption, I tested. You have any typical use case that it might become a problem?

Not 100% sure, but I doubt you have tried that with different userspace programs.

Especially animated boot screens could allocated quite a number of framebuffers.

Quoted 3 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Regards,
Christian.

Quoted 159 lines

Regards,
Samuel Li

Quoted 154 lines

-----Original Message-----
From: Koenig, Christian
Sent: Tuesday, March 06, 2018 12:12 PM
To: Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

And exactly that's the problematical assumption.

This doesn't print only when the module is loaded, but rather when a framebuffer object is created.

And depending on the use case that can even be many many times per second.

Please remove that printing, addition to that I agree with Michel that the module parameter is overkill.

Regards,
Christian.

Am 06.03.2018 um 18:09 schrieb Li, Samuel:

Quoted 1 line

This information is kind of important, and it only prints once typically when

module is loaded.

Quoted 92 lines

Regards,
Samuel Li

Quoted 88 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, March 06, 2018 12:04 PM
To: Li, Samuel <[email protected]>
Cc: Koenig, Christian <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 11 lines · Samuel Li
Quoted 9 lines

Review

Quoted 6 lines
        domain = amdgpu_display_framebuffer_domains(adev);
(quoted diff) +5 -0
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Christian.

The intention here is to print out when fb is created. You have other

suggestions?

Make it DRM_DEBUG? otherwise you'll spam the logs.

Quoted 24 lines

Sam

Quoted 20 lines · Christian König

Am 03.03.2018 um 00:25 schrieb Samuel Li:

Quoted 19 lines

It's enabled by default. -1 is auto, to allow both vram and gtt memory be available, for testing purpose only.

---
    drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 +
    drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++++++--
    drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     | 4 ++++
    drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 5 +++++
    4 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 292c7e7..6b0ee34 100644
@@ -129,6 +129,7 @@ extern int amdgpu_lbpw;
    extern int amdgpu_compute_multipipe;
    extern int amdgpu_gpu_recovery;
    extern int amdgpu_emu_mode;
+extern int amdgpu_sg_display;
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -0
      #ifdef CONFIG_DRM_AMDGPU_SI
    extern int amdgpu_si_support;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
index 5495b29..dfa11b1 100644
@@ -513,8 +513,13 @@ uint32_t

amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)

Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 514

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -0
    #if defined(CONFIG_DRM_AMD_DC)
        if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <

CHIP_RAVEN &&

Quoted 11 lines
Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c uint32_t · line 521

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -2
            adev->flags & AMD_IS_APU &&
-        amdgpu_device_asic_has_dc_support(adev->asic_type))
-        domain |= AMDGPU_GEM_DOMAIN_GTT;
+        amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+        if (amdgpu_sg_display == 1) {
+            domain = AMDGPU_GEM_DOMAIN_GTT;
+        } else if (amdgpu_sg_display == -1) {
+            domain |= AMDGPU_GEM_DOMAIN_GTT;
+        }

Coding style, that if shouldn't use "{" and "}".

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
+    }
    #endif
          return domain;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index e670936..f0ada24 100644
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 136

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -132,6 +132,7 @@ int amdgpu_lbpw = -1;
    int amdgpu_compute_multipipe = -1;
    int amdgpu_gpu_recovery = -1; /* auto */
    int amdgpu_emu_mode = 0;
+int amdgpu_sg_display = 1;
      MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in

megabytes");

Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
    module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);

@@

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_lbpw = -1; · line 137

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
-290,6 +291,9 @@ module_param_named(gpu_recovery,

amdgpu_gpu_recovery, int, 0444);

Quoted 1 line
Quoted 1 line
Quoted 1 line

MODULE_PARM_DESC(emu_mode, "Emulation mode, (1 = enable,

0 =

Quoted 2 lines
Quoted 2 lines

disable)");

Quoted 1 line
Quoted 1 line
Quoted 1 line

module_param_named(emu_mode, amdgpu_emu_mode, int,

0444);

Quoted 29 lines
Quoted 29 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+MODULE_PARM_DESC(sg_display, "Enable scatter gather display,
(1 = enable, 0 = disable, -1 = auto");

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
+module_param_named(sg_display, amdgpu_sg_display, int, 0444);
+
    #ifdef CONFIG_DRM_AMDGPU_SI
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int

Quoted 8 lines
      #if defined(CONFIG_DRM_RADEON) ||

defined(CONFIG_DRM_RADEON_MODULE) diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 1206301..10f1f4f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
@@ -138,6 +138,11 @@ static int

amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,

Quoted 15 lines
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 138

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
        mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd-

width, cpp,

Quoted 13 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c static int · line 145

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +5 -0
                              fb_tiled);
        domain = amdgpu_display_framebuffer_domains(adev);
+    if (domain == AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: enabled\n");
+    } else if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+        DRM_INFO("Scatter gather display: auto\n");
+    }

Dito and printing that here is not a good idea as far as I can see.

Christian.

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -0
          height = ALIGN(mode_cmd->height, 8);
        size = mode_cmd->pitches[0] * height;
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#16 lore raw
In reply to a message not in the archive
Quoted 11 lines · Christian König

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 7 lines
Quoted 3 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#18 lore raw
In reply to a message not in the archive

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 12 lines · Christian König
Quoted 9 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#20 lore raw
In reply to a message not in the archive
Quoted 1 line

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Since scan out buffer is moved to GTT now, DDX/Mesa might need to make some changes for this too.

Regards,
Samuel Li

Quoted 20 lines

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Tuesday, March 06, 2018 1:02 PM
To: Michel Dänzer <[email protected]>; Koenig, Christian <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 10 lines · Christian König
Quoted 9 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Quoted 8 lines
Quoted 2 lines

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#21 lore raw
In reply to a message not in the archive
Quoted 9 lines · Christian König

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Userspace just needs a way to know which domains can/should be used for scanout buffers, e.g. via an info ioctl.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#23 lore raw
In reply to a message not in the archive

Am 06.03.2018 um 19:15 schrieb Michel Dänzer:

Quoted 10 lines · Christian König
Quoted 9 lines

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Userspace just needs a way to know which domains can/should be used for scanout buffers, e.g. via an info ioctl.

Yeah, but why shouldn't they then make the decision where to place it as well?

See when we enforce a certain placement in the kernel we will just get an unnecessary buffer move with old user space components.

In other words the kernel just needs to advertise that the hw/sw combination allows scanout from GTT as well and then an updated userspace can actually make use of that placement or decide to not use it in certain situations. E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

The major use case I can currently see are A+A laptop, cause there it can avoid the additional buffer move from GTT to VRAM for the APU.

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#25 lore raw
In reply to a message not in the archive
Quoted 23 lines · Christian König

Am 06.03.2018 um 19:15 schrieb Michel Dänzer:

Quoted 10 lines · Christian König
Quoted 9 lines

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Userspace just needs a way to know which domains can/should be used for scanout buffers, e.g. via an info ioctl.

Yeah, but why shouldn't they then make the decision where to place it as well?

Quoted 7 lines

See when we enforce a certain placement in the kernel we will just get an unnecessary buffer move with old user space components.

In other words the kernel just needs to advertise that the hw/sw combination allows scanout from GTT as well and then an updated userspace can actually make use of that placement or decide to not use it in certain situations.

I think we'll need to always pin BOs to GTT for scanout in some cases, because some hardware has issues when transitioning between scanout from VRAM and GTT.

How about:

Userspace can query from the kernel which domain(s) can be used for
scanout: only VRAM / VRAM or GTT / only GTT. Userspace sets the allowed domains correspondingly for scanout BOs.

If you can think of a scenario where this won't work, please specifically describe it and how you propose addressing it.

Quoted 2 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#27 lore raw
In reply to a message not in the archive

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 34 lines · Christian König
Quoted 22 lines

Am 06.03.2018 um 19:15 schrieb Michel Dänzer:

Quoted 10 lines · Christian König
Quoted 9 lines

Am 06.03.2018 um 18:51 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 06.03.2018 um 18:22 schrieb Li, Samuel:

Quoted 6 lines
Quoted 2 lines

addition to that I agree with Michel that the module parameter is overkill.

That I already explained. Currently SG display feature needs to provide options for all kinds of use cases. All amd drivers so far provides options, and the default configuration is actually to allocate everything from GTT when possible.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

That isn't job of the kernel to have this parameter. Saying that we should probably add a DDX and/or environment option to control that.

Why would we need that? It's the kernel driver's job to handle this as needed.

Buffer placement is specified by the DDX/Mesa, when we override that in the kernel we just force unnecessary buffer moves.

Userspace just needs a way to know which domains can/should be used for scanout buffers, e.g. via an info ioctl.

Yeah, but why shouldn't they then make the decision where to place it as well?

Quoted 7 lines

See when we enforce a certain placement in the kernel we will just get an unnecessary buffer move with old user space components.

In other words the kernel just needs to advertise that the hw/sw combination allows scanout from GTT as well and then an updated userspace can actually make use of that placement or decide to not use it in certain situations.

I think we'll need to always pin BOs to GTT for scanout in some cases, because some hardware has issues when transitioning between scanout from VRAM and GTT.

Quoted 5 lines

How about:

Userspace can query from the kernel which domain(s) can be used for
scanout: only VRAM / VRAM or GTT / only GTT. Userspace sets the allowed domains correspondingly for scanout BOs.

Well that sounds close to what I had in mind as well, we just can't specify only GTT when we want to keep backward compatibility with existing user space.

Quoted 9 lines

If you can think of a scenario where this won't work, please specifically describe it and how you propose addressing it.

Quoted 2 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#29 lore raw
In reply to a message not in the archive
Quoted 5 lines · Christian König

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

Quoted 7 lines

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

That means we either need to come up with a different workaround for hardware issues transitioning between scanout from VRAM and GTT, or we can't scan out from GTT in that case.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#31 lore raw
In reply to a message not in the archive

Am 07.03.2018 um 10:53 schrieb Michel Dänzer:

Quoted 9 lines · Christian König
Quoted 8 lines

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

Quoted 6 lines
Quoted 3 lines

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

That means we either need to come up with a different workaround for hardware issues transitioning between scanout from VRAM and GTT, or we can't scan out from GTT in that case.

What exactly was the problem with the transition from VRAM to GTT?

I mean what we can rather easily do is check where the existing BO is pinned and then always pin into the same domain on page flip.

Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#33 lore raw
In reply to a message not in the archive
Quoted 13 lines · Christian König

Am 07.03.2018 um 10:53 schrieb Michel Dänzer:

Quoted 12 lines · Christian König
Quoted 11 lines

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

Quoted 8 lines
Quoted 3 lines

That means we either need to come up with a different workaround for hardware issues transitioning between scanout from VRAM and GTT, or we can't scan out from GTT in that case.

What exactly was the problem with the transition from VRAM to GTT?

I mean what we can rather easily do is check where the existing BO is pinned and then always pin into the same domain on page flip.

Yeah, something like that could work. In which case, all that's needed is a way for userspace to know that GTT scanout can work, right? With that information, it can manage the domains of scanout BOs as it wants.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#35 lore raw
In reply to a message not in the archive

Why so complicated? If old user space compatibility is required, just use sg_display=0.

Sam

Quoted 18 lines · Michel Dänzer
Quoted 17 lines · Christian König

Am 07.03.2018 um 10:53 schrieb Michel Dänzer:

Quoted 15 lines · Christian König
Quoted 11 lines

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

That means we either need to come up with a different workaround for hardware issues transitioning between scanout from VRAM and GTT, or we can't scan out from GTT in that case.

Quoted 10 lines
Quoted 4 lines

What exactly was the problem with the transition from VRAM to GTT?

I mean what we can rather easily do is check where the existing BO is pinned and then always pin into the same domain on page flip.

Yeah, something like that could work. In which case, all that's needed is a way for userspace to know that GTT scanout can work, right? With that information, it can manage the domains of scanout BOs as it wants.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#37 lore raw
In reply to a message not in the archive
Quoted 2 lines · Samuel Li

Why so complicated? If old user space compatibility is required, just use sg_display=0.

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Alex

Quoted 33 lines

Sam

Quoted 28 lines · Michel Dänzer
Quoted 13 lines · Christian König

Am 07.03.2018 um 10:53 schrieb Michel Dänzer:

Quoted 12 lines · Christian König
Quoted 11 lines

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

So as long as we don't want a severe performance penalty when you combine old userspace with new kernel using a kernel parameter to force scanout from GTT is not possible.

Quoted 8 lines
Quoted 3 lines

That means we either need to come up with a different workaround for hardware issues transitioning between scanout from VRAM and GTT, or we can't scan out from GTT in that case.

What exactly was the problem with the transition from VRAM to GTT?

I mean what we can rather easily do is check where the existing BO is pinned and then always pin into the same domain on page flip.

Yeah, something like that could work. In which case, all that's needed is a way for userspace to know that GTT scanout can work, right? With that information, it can manage the domains of scanout BOs as it wants.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#39 lore raw
In reply to a message not in the archive
Quoted 8 lines · Alex Deucher
Quoted 2 lines · Samuel Li

Why so complicated? If old user space compatibility is required, just use sg_display=0.

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#41 lore raw
In reply to a message not in the archive

I think it's not useful though. Think about that, SG display feature is intended to use as less VRAM as possible. Will someone want a display buffer sometimes VRAM, sometimes GTT? Hardly a case to me, and I think it's a waste of effort. That also might explain no driver does that now.

Sam

Quoted 5 lines · Michel Dänzer
Quoted 4 lines · Alex Deucher
Quoted 2 lines · Samuel Li

Why so complicated? If old user space compatibility is required, just use sg_display=0.

Quoted 9 lines
Quoted 4 lines

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#43 lore raw
In reply to a message not in the archive
Quoted 2 lines · Samuel Li

I think it's not useful though. Think about that, SG display feature is intended to use as less VRAM as possible. Will someone want a display buffer sometimes VRAM, sometimes GTT? Hardly a case to me, and I think it's a waste of effort. That also might explain no driver does that now.

You might want different strategies depending on how much VRAM you have. If you have a bunch and it performs better, prefer it. If you have limited VRAM, you might want to prefer GTT. You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary. This would make the logic dynamic and all in one place. The kernel can advertise what asics support scanout from system ram and then UMDs can just query that to choose placements rather than adding hardcoded logic for specific asics.

Alex

Quoted 20 lines

Sam

Quoted 14 lines · Michel Dänzer
Quoted 8 lines · Alex Deucher
Quoted 2 lines · Samuel Li

Why so complicated? If old user space compatibility is required, just use sg_display=0.

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#45 lore raw
In reply to a message not in the archive
Quoted 2 lines

You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary.

For display buffer, this case seems not really attractive. When display buffer changes between GTT and VRAM dynamically, our driver needs to adpat too, which is hard to see the benefits and not really worth the effort.

Sam

Quoted 13 lines · Alex Deucher
Quoted 2 lines · Samuel Li

I think it's not useful though. Think about that, SG display feature is intended to use as less VRAM as possible. Will someone want a display buffer sometimes VRAM, sometimes GTT? Hardly a case to me, and I think it's a waste of effort. That also might explain no driver does that now.

You might want different strategies depending on how much VRAM you have. If you have a bunch and it performs better, prefer it. If you have limited VRAM, you might want to prefer GTT. You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary. This would make the logic dynamic and all in one place. The kernel can advertise what asics support scanout from system ram and then UMDs can just query that to choose placements rather than adding hardcoded logic for specific asics.

Quoted 22 lines

Alex

Quoted 20 lines

Sam

Quoted 14 lines · Michel Dänzer
Quoted 8 lines · Alex Deucher
Quoted 2 lines · Samuel Li

Why so complicated? If old user space compatibility is required, just use sg_display=0.

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#47 lore raw
In reply to a message not in the archive

How about that, in my previous patches, it actually allows three scenarios,
1) VRAM as display buffer
2) GTT as display buffer
3) Mixed GTT/display buffer, as you have asked.

I think the first step is to make the 2nd scenario work at optimal level. After that, if anyone wants to work the 3rd scenario, I have no objection at all.

Regards,
Samuel Li

Quoted 42 lines

-----Original Message-----
From: Samuel Li [mailto:[email protected]]
Sent: Wednesday, March 07, 2018 1:54 PM
To: Alex Deucher <[email protected]>
Cc: Michel Dänzer <[email protected]>; Koenig, Christian <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 2 lines

You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary.

For display buffer, this case seems not really attractive. When display buffer changes between GTT and VRAM dynamically, our driver needs to adpat too, which is hard to see the benefits and not really worth the effort.

Sam

Quoted 2 lines · Alex Deucher
Quoted 1 line · Samuel Li

I think it's not useful though. Think about that, SG display feature is

intended to use as less VRAM as possible. Will someone want a display buffer sometimes VRAM, sometimes GTT?

Quoted 1 line
Quoted 1 line

Hardly a case to me, and I think it's a waste of effort. That also might

explain no driver does that now.

Quoted 17 lines

You might want different strategies depending on how much VRAM you have. If you have a bunch and it performs better, prefer it. If you have limited VRAM, you might want to prefer GTT. You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary. This would make the logic dynamic and all in one place. The kernel can advertise what asics support scanout from system ram and then UMDs can just query that to choose placements rather than adding hardcoded logic for specific asics.

Alex

Quoted 5 lines

Sam

Quoted 17 lines
Quoted 3 lines
Quoted 3 lines · Michel Dänzer
Quoted 2 lines · Alex Deucher
Quoted 1 line

On Wed, Mar 7, 2018 at 12:29 PM, Samuel Li <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Why so complicated? If old user space compatibility is required, just

use sg_display=0.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#49 lore raw
In reply to a message not in the archive
Quoted 6 lines · Samuel

How about that, in my previous patches, it actually allows three scenarios,
1) VRAM as display buffer
2) GTT as display buffer
3) Mixed GTT/display buffer, as you have asked.

I think the first step is to make the 2nd scenario work at optimal level. After that, if anyone wants to work the 3rd scenario, I have no objection at all.

Regardless of which scenarios we need to support, I think we also need to really plumb this through to mesa however since user space is who ultimately requests the location. Overriding it in the kernel gets tricky and can lead to ping-ponging as others have noted. Better to have user space know what chips support it or not and request display buffers in GTT or VRAM from the start.

Alex

Quoted 64 lines

Regards,
Samuel Li

Quoted 59 lines

-----Original Message-----
From: Samuel Li [mailto:[email protected]]
Sent: Wednesday, March 07, 2018 1:54 PM
To: Alex Deucher <[email protected]>
Cc: Michel Dänzer <[email protected]>; Koenig, Christian <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoted 2 lines

You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary.

For display buffer, this case seems not really attractive. When display buffer changes between GTT and VRAM dynamically, our driver needs to adpat too, which is hard to see the benefits and not really worth the effort.

Sam

Quoted 2 lines · Alex Deucher
Quoted 1 line · Samuel Li

I think it's not useful though. Think about that, SG display feature is

intended to use as less VRAM as possible. Will someone want a display buffer sometimes VRAM, sometimes GTT?

Quoted 1 line
Quoted 1 line

Hardly a case to me, and I think it's a waste of effort. That also might

explain no driver does that now.

Quoted 20 lines

You might want different strategies depending on how much VRAM you have. If you have a bunch and it performs better, prefer it. If you have limited VRAM, you might want to prefer GTT. You might also want to prefer VRAM, but also allow buffers to fall back to GTT if necessary. This would make the logic dynamic and all in one place. The kernel can advertise what asics support scanout from system ram and then UMDs can just query that to choose placements rather than adding hardcoded logic for specific asics.

Alex

Quoted 8 lines

Sam

Quoted 2 lines · Michel Dänzer
Quoted 1 line · Alex Deucher

On Wed, Mar 7, 2018 at 12:29 PM, Samuel Li <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Why so complicated? If old user space compatibility is required, just

use sg_display=0.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

It will always just work in that case and we can adjust for the optimal scenario by default in all cases without requiring the user to set misc parameters to tune their setup that may break in the future or hide bugs because a user sets it and forgets it.

Right. I don't agree it's all that complicated anyway, we do this sort of thing all the time, it also makes our lives easier down the road.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#50 lore raw
In reply to a message not in the archive
Quoted 11 lines · Christian König

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 3 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

Quoted 7 lines

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#52 lore raw
In reply to a message not in the archive

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

Quoted 15 lines · Christian König
Quoted 14 lines

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 3 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

Quoted 6 lines
Quoted 3 lines

So what happened was that on scanout we moved the VRAM BO to GTT and after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#54 lore raw
In reply to a message not in the archive

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 3 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

Quoted 8 lines
Quoted 8 lines

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

Quoted 5 lines
Quoted 2 lines

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Quoted 6 lines

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#56 lore raw
In reply to a message not in the archive

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

Quoted 56 lines

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

Quoted 50 lines

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 3 lines

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

Quoted 8 lines
Quoted 8 lines

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

Quoted 5 lines
Quoted 2 lines

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#58 lore raw
In reply to a message not in the archive
Quoted 6 lines · Christian König

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Quoted 73 lines

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

Quoted 66 lines

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----

Quoted 58 lines

From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

Quoted 21 lines · Christian König
Quoted 11 lines

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

Quoted 8 lines · Christian König

E.g. the last time I tested it placing things into GTT still

Quoted 2 lines

resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

Quoted 9 lines

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

Quoted 9 lines

and

after unpinning it on the first command submission which used the BO

Quoted 2 lines

we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an
A+A laptop understands etc...

Quoted 9 lines
Quoted 4 lines
Quoted 3 lines

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#60 lore raw
In reply to a message not in the archive

Am 19.03.2018 um 20:39 schrieb Marek Olšák:

Quoted 10 lines · On Mon, Mar 19, 2018 at 3:27 PM, Christian König…

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Yeah, but it can set the initial domain based on what it knows how the buffer will be used.

E.g. when scanout from GTT is supported we would like to always set the initial domain as GTT instead of VRAM.

Christian.

Quoted 100 lines

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected] <mailto:[email protected]>>; Li, Samuel <[email protected] <mailto:[email protected]>>; Alex Deucher <[email protected] <mailto:[email protected]>>
Cc: amd-gfx list <[email protected] <mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather
display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I
tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with
the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both
still assumed VRAM as placement for scanout BOs, but the kernel
forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO
we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek:
Can't the kernel
driver simply change the BO's preferred domain to GTT when scanning
out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two
reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just
temporary moved the buffer where it was needed and moved it back after
the operation completed.

Additional to that Mesa might want to set even more flags and/or changes
it's behavior. E.g. use a tilling mode which both importer and export in an
A+A laptop understands etc...

Regards,
Christian.

Quoted 7 lines

_______________________________________________
amd-gfx mailing list
[email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#61 lore raw
In reply to a message not in the archive

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,
Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; Michel Dänzer <[email protected]>; Alex Deucher <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:
I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:
I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:
On 2018-03-07 10:47 AM, Christian König wrote:
Am 07.03.2018 um 09:42 schrieb Michel Dänzer:
On 2018-03-06 07:23 PM, Christian König wrote:
E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering. FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled. No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and
after unpinning it on the first command submission which used the BO we moved it back to VRAM again.
In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.
Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#63 lore raw
In reply to a message not in the archive

Quoting Alex:

Quoted 6 lines

Regardless of which scenarios we need to support, I think we also need to really plumb this through to mesa however since user space is who ultimately requests the location. Overriding it in the kernel gets tricky and can lead to ping-ponging as others have noted. Better to have user space know what chips support it or not and request display buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Quoted 133 lines

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid

exactly that.
Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

*From:*Marek Olšák [mailto:[email protected]]
*Sent:* Monday, March 19, 2018 3:39 PM
*To:* Koenig, Christian <[email protected]>
*Cc:* Li, Samuel <[email protected]>; Michel Dänzer <[email protected]>; Alex Deucher <[email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected] <mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected] <mailto:[email protected]>>; Li, Samuel <[email protected] <mailto:[email protected]>>; Alex Deucher <[email protected] <mailto:[email protected]>>
Cc: amd-gfx list <[email protected] <mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather
display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I
tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with
the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both
still assumed VRAM as placement for scanout BOs, but the kernel
forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO
we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek:
Can't the kernel
driver simply change the BO's preferred domain to GTT when scanning
out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two
reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just
temporary moved the buffer where it was needed and moved it back after
the operation completed.

Additional to that Mesa might want to set even more flags and/or changes
it's behavior. E.g. use a tilling mode which both importer and export in an
A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#65 lore raw
In reply to a message not in the archive

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.
His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,
Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]>; Marek Olšák <[email protected]>; Koenig, Christian <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.
And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:
Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,
Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:
I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:
I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:
On 2018-03-07 10:47 AM, Christian König wrote:
Am 07.03.2018 um 09:42 schrieb Michel Dänzer:
On 2018-03-06 07:23 PM, Christian König wrote:
E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering. FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled. No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT and
after unpinning it on the first command submission which used the BO we moved it back to VRAM again.
In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.
Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#67 lore raw
In reply to a message not in the archive

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Li, Samuel <[email protected]>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]>; Marek Olšák <[email protected]>; Koenig, Christian <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#69 lore raw
In reply to a message not in the archive

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.
But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel ...)

Regards,
Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Li, Samuel <[email protected]<mailto:[email protected]>>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex's comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex's concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#71 lore raw
In reply to a message not in the archive

Hi Sam,

no that is seriously a no-go. The placement decision is done my userspace, not the kernel.

The only time the kernel overrides that decision is a) hardware requirements (for example old UVD on AGP systems) and b) memory pressure.

We are have actually pushed quite hard on avoiding and removing places where the kernel overrides the placement decision of userspace, so I don't think we should add any new ones.

Regards,
Christian.

Am 19.03.2018 um 20:58 schrieb Li, Samuel:

Quoted 221 lines

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

*From:*Deucher, Alexander
*Sent:* Monday, March 19, 2018 3:54 PM
*To:* Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]> *Cc:* Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

------------------------------------------------------------------------

*From:*amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>> on behalf of Li, Samuel <[email protected] <mailto:[email protected]>> *Sent:* Monday, March 19, 2018 3:50:34 PM
*To:* Koenig, Christian; Marek Olšák
*Cc:* Alex Deucher; Michel Dänzer; amd-gfx list
*Subject:* RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 4 lines

Regardless of which scenarios we need to support, I think we also need to really plumb this through to mesa however since user space is who ultimately requests the location.  Overriding it in the kernel gets tricky and can lead to ping-ponging as others have noted.  Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

*From:*Christian König [mailto:[email protected]]
*Sent:* Monday, March 19, 2018 3:45 PM
*To:* Li, Samuel <[email protected] <mailto:[email protected]>>; Marek Olšák <[email protected] <mailto:[email protected]>>; Koenig, Christian <[email protected] <mailto:[email protected]>> *Cc:* Alex Deucher <[email protected] <mailto:[email protected]>>; Michel Dänzer <[email protected] <mailto:[email protected]>>; amd-gfx list <[email protected] <mailto:[email protected]>> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location.  Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted.  Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

>I think that the consensus with Alex and me is that we should avoid exactly that.
Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

*From:*Marek Olšák [mailto:[email protected]]
*Sent:* Monday, March 19, 2018 3:39 PM
*To:* Koenig, Christian <[email protected]> <mailto:[email protected]>
*Cc:* Li, Samuel <[email protected]> <mailto:[email protected]>; Michel Dänzer <[email protected]> <mailto:[email protected]>; Alex Deucher <[email protected]> <mailto:[email protected]>; amd-gfx list <[email protected]> <mailto:[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather
display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected] <mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected] <mailto:[email protected]>>; Li, Samuel <[email protected] <mailto:[email protected]>>; Alex Deucher <[email protected] <mailto:[email protected]>>
Cc: amd-gfx list <[email protected] <mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter
gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with
the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both
still assumed VRAM as placement for scanout BOs, but the kernel
forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek:
Can't the kernel
driver simply change the BO's preferred domain to GTT when scanning
out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two
reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just
temporary moved the buffer where it was needed and moved it back after
the operation completed.

Additional to that Mesa might want to set even more flags and/or changes
it's behavior. E.g. use a tilling mode which both importer and export in an
A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 8 lines

_______________________________________________

amd-gfx mailing list

[email protected] <mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#72 lore raw
In reply to a message not in the archive

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex

________________________________
From: Li, Samuel
Sent: Monday, March 19, 2018 3:58:52 PM
To: Deucher, Alexander; Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________

From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Li, Samuel <[email protected]<mailto:[email protected]>>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#74 lore raw
In reply to a message not in the archive

s/not/now/. I meant to say, "we have NOW excluded the possibility of ever setting displays anywhere else without a kernel update".

Alex

From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Deucher, Alexander
Sent: Monday, March 19, 2018 4:13 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex

________________________________
From: Li, Samuel
Sent: Monday, March 19, 2018 3:58:52 PM
To: Deucher, Alexander; Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel ...)

Regards,

Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________

From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Li, Samuel <[email protected]<mailto:[email protected]>>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex's comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex's concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#76 lore raw
In reply to a message not in the archive

When Mesa wants a buffer in VRAM, it always sets VRAM. It relies on BO move throttling to prevent unnecessary BO moves.

My questions are:
- what should Mesa do differently for tiny VRAM?
- what is a tiny VRAM?
- if VRAM is tiny, which allocations should we put there?

Marek

Quoted 302 lines · Alexander

s/not/now/. I meant to say, “we have NOW excluded the possibility of ever setting displays anywhere else without a kernel update”.

Alex

*From:* amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] *On Behalf Of *Deucher, Alexander
*Sent:* Monday, March 19, 2018 4:13 PM

*To:* Li, Samuel <[email protected]>; Koenig, Christian < [email protected]>; Marek Olšák <[email protected]> *Cc:* Alex Deucher <[email protected]>; Michel Dänzer < [email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex
------------------------------

*From:* Li, Samuel
*Sent:* Monday, March 19, 2018 3:58:52 PM
*To:* Deucher, Alexander; Koenig, Christian; Marek Olšák *Cc:* Alex Deucher; Michel Dänzer; amd-gfx list *Subject:* RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

*From:* Deucher, Alexander
*Sent:* Monday, March 19, 2018 3:54 PM
*To:* Li, Samuel <[email protected]>; Koenig, Christian < [email protected]>; Marek Olšák <[email protected]> *Cc:* Alex Deucher <[email protected]>; Michel Dänzer < [email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex
------------------------------

*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Li, Samuel <[email protected]>
*Sent:* Monday, March 19, 2018 3:50:34 PM
*To:* Koenig, Christian; Marek Olšák
*Cc:* Alex Deucher; Michel Dänzer; amd-gfx list
*Subject:* RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

*From:* Christian König [mailto:[email protected] <[email protected]>]
*Sent:* Monday, March 19, 2018 3:45 PM
*To:* Li, Samuel <[email protected]>; Marek Olšák <[email protected]>;
Koenig, Christian <[email protected]>
*Cc:* Alex Deucher <[email protected]>; Michel Dänzer < [email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid

exactly that.
Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

*From:* Marek Olšák [mailto:[email protected] <[email protected]>] *Sent:* Monday, March 19, 2018 3:39 PM
*To:* Koenig, Christian <[email protected]> <[email protected]>
*Cc:* Li, Samuel <[email protected]> <[email protected]>; Michel Dänzer <[email protected]> <[email protected]>; Alex Deucher <[email protected]> <[email protected]>; amd-gfx list <[email protected]> <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display
support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 10 lines

_______________________________________________

amd-gfx mailing list

[email protected]

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#78 lore raw
In reply to a message not in the archive
Quoted 1 line

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select where to put display buffers.
As whether to put the option in Mesa or kernel, it seems the difference is not much. Also, since amdgpufb can request even without mesa, kernel might be a better choice. In addition, putting in the kernel can save client’s duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Regards,
Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 4:27 PM
To: Deucher, Alexander <[email protected]>
Cc: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

When Mesa wants a buffer in VRAM, it always sets VRAM. It relies on BO move throttling to prevent unnecessary BO moves.

My questions are:
- what should Mesa do differently for tiny VRAM?
- what is a tiny VRAM?
- if VRAM is tiny, which allocations should we put there?

Marek

On Mon, Mar 19, 2018 at 4:15 PM, Deucher, Alexander <[email protected]<mailto:[email protected]>> wrote:
s/not/now/. I meant to say, “we have NOW excluded the possibility of ever setting displays anywhere else without a kernel update”.

Alex

From: amd-gfx [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Deucher, Alexander
Sent: Monday, March 19, 2018 4:13 PM

To: Li, Samuel <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex

________________________________
From: Li, Samuel
Sent: Monday, March 19, 2018 3:58:52 PM
To: Deucher, Alexander; Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________

From: amd-gfx <[email protected]<mailto:[email protected]>> on behalf of Li, Samuel <[email protected]<mailto:[email protected]>>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 1 line

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]><mailto:[email protected]>
Cc: Li, Samuel <[email protected]><mailto:[email protected]>; Michel Dänzer <[email protected]><mailto:[email protected]>; Alex Deucher <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; Alex Deucher <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#114 lore raw
In reply to a message not in the archive
Quoted 7 lines · Marek Olšák

When Mesa wants a buffer in VRAM, it always sets VRAM. It relies on BO move throttling to prevent unnecessary BO moves.

My questions are:
- what should Mesa do differently for tiny VRAM?
- what is a tiny VRAM?
- if VRAM is tiny, which allocations should we put there?

Right now, all mesa would have to do is query the kernel to see if the device supports s/g display. If it does, it can do whatever makes sense in the long term once we've had more time to benchmark, etc., but to start off with, I'd say just make it GTT or VRAM|GTT. Otherwise we have the kernel second guessing mesa and I'd like to avoid that. I want the kernel to respect that userspace asks for as much as possible.

Alex

Quoted 314 lines

Marek

Quoted 307 lines · Alexander

s/not/now/. I meant to say, “we have NOW excluded the possibility of ever setting displays anywhere else without a kernel update”.

Alex

From: amd-gfx [mailto:[email protected]] On Behalf Of Deucher, Alexander
Sent: Monday, March 19, 2018 4:13 PM

To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex

________________________________

From: Li, Samuel
Sent: Monday, March 19, 2018 3:58:52 PM
To: Deucher, Alexander; Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________

From: amd-gfx <[email protected]> on behalf of Li, Samuel <[email protected]>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]>; Marek Olšák <[email protected]>; Koenig, Christian <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 2 lines

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; Michel Dänzer <[email protected]>; Alex Deucher <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König
<[email protected]> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an
A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#116 lore raw
In reply to a message not in the archive
Quoted 10 lines · Alex Deucher
Quoted 1 line · Marek Olšák

When Mesa wants a buffer in VRAM, it always sets VRAM. It relies on BO

move

Quoted 6 lines

throttling to prevent unnecessary BO moves.

My questions are:
- what should Mesa do differently for tiny VRAM?
- what is a tiny VRAM?
- if VRAM is tiny, which allocations should we put there?

Quoted 8 lines

Right now, all mesa would have to do is query the kernel to see if the device supports s/g display. If it does, it can do whatever makes sense in the long term once we've had more time to benchmark, etc., but to start off with, I'd say just make it GTT or VRAM|GTT. Otherwise we have the kernel second guessing mesa and I'd like to avoid that. I want the kernel to respect that userspace asks for as much as possible.

Sounds good.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#80 lore raw
In reply to a message not in the archive
Quoted 10 lines · Samuel
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select where to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference is not much. Also, since amdgpufb can request even without mesa, kernel might be a better choice. In addition, putting in the kernel can save client’s duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Alex

Quoted 322 lines

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 4:27 PM
To: Deucher, Alexander <[email protected]>
Cc: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>

Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

When Mesa wants a buffer in VRAM, it always sets VRAM. It relies on BO move throttling to prevent unnecessary BO moves.

My questions are:

- what should Mesa do differently for tiny VRAM?

- what is a tiny VRAM?

- if VRAM is tiny, which allocations should we put there?

Marek

On Mon, Mar 19, 2018 at 4:15 PM, Deucher, Alexander <[email protected]> wrote:

s/not/now/. I meant to say, “we have NOW excluded the possibility of ever setting displays anywhere else without a kernel update”.

Alex

From: amd-gfx [mailto:[email protected]] On Behalf Of Deucher, Alexander
Sent: Monday, March 19, 2018 4:13 PM

To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I'm not sure what you mean by the 3 scenarios. Generally userspace selects what domains it wants a buffer to be in, vram, gtt, or both (don't care). I'd rather not have the kernel second guess the UMDs if we can help it. I'd rather leave the kernel for cases where we have to force things due to hw bugs, or hw restrictions, etc. If we force all display buffers to be in gtt in the kernel, we have not excluded the possibility of ever setting displays anywhere else without a kernel update. E.g., to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported. That was the point I was trying to make about user mode selecting the domain (vram of gtt or vram|gtt). Say you have a board with 2 GB of ram and 1 GB is carved out for "vram". In that case, it would make sense to put the buffer in vram because otherwise you are wasting a comparatively scarce resource.

Alex

________________________________

From: Li, Samuel
Sent: Monday, March 19, 2018 3:58:52 PM
To: Deucher, Alexander; Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Alex,

I assume you are talking the three scenarios here, 1)VRAM, 2)GTT, 3)VRAM/GTT.

But kernel will need the decision too(amdgpufb). I think it shall be better to do it in kernel, instead of different clients(mesa, ddx, kernel …)

Regards,

Samuel Li

From: Deucher, Alexander
Sent: Monday, March 19, 2018 3:54 PM
To: Li, Samuel <[email protected]>; Koenig, Christian <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.

Alex

________________________________

From: amd-gfx <[email protected]> on behalf of Li, Samuel <[email protected]>
Sent: Monday, March 19, 2018 3:50:34 PM
To: Koenig, Christian; Marek Olšák
Cc: Alex Deucher; Michel Dänzer; amd-gfx list
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Christian,

You misunderstood Alex’s comments,

Quoted 7 lines

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.

His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern here.

Regards,

Samuel Li

From: Christian König [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:45 PM
To: Li, Samuel <[email protected]>; Marek Olšák <[email protected]>; Koenig, Christian <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Quoting Alex:

Regardless of which scenarios we need to support, I think we also need

to really plumb this through to mesa however since user space is who

ultimately requests the location. Overriding it in the kernel gets

tricky and can lead to ping-ponging as others have noted. Better to

have user space know what chips support it or not and request display

buffers in GTT or VRAM from the start.

And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.

Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.

Regards,
Christian.

Am 19.03.2018 um 20:42 schrieb Li, Samuel:

Agreed.

Quoted 2 lines

I think that the consensus with Alex and me is that we should avoid exactly that.

Christian, Alex’s concern is about ping-pong, not about the preferred domain.

Regards,

Samuel Li

From: Marek Olšák [mailto:[email protected]]
Sent: Monday, March 19, 2018 3:39 PM
To: Koenig, Christian <[email protected]>
Cc: Li, Samuel <[email protected]>; Michel Dänzer <[email protected]>; Alex Deucher <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

On Mon, Mar 19, 2018 at 3:27 PM, Christian König <[email protected]> wrote:

I think that the consensus with Alex and me is that we should avoid exactly that.

Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.

I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.

Marek

Regards,
Christian.

Am 19.03.2018 um 20:22 schrieb Li, Samuel:

I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.

Regards,
Samuel Li

-----Original Message-----
From: Koenig, Christian
Sent: Thursday, March 08, 2018 4:07 AM
To: Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 08.03.2018 um 09:35 schrieb Michel Dänzer:

On 2018-03-07 10:47 AM, Christian König wrote:

Am 07.03.2018 um 09:42 schrieb Michel Dänzer:

On 2018-03-06 07:23 PM, Christian König wrote:

E.g. the last time I tested it placing things into GTT still resulted in quite a performance penalty for rendering.

FWIW, I think the penalty is most likely IOMMU related. Last time I tested, I couldn't measure a big difference with IOMMU disabled.

No, the penalty I'm talking about came from the ping/pong we did with the scanout buffers.

See when I tested this the DDX and Mesa where unmodified, so both still assumed VRAM as placement for scanout BOs, but the kernel forced scanout BOs into GTT for testing.

So what happened was that on scanout we moved the VRAM BO to GTT

and

after unpinning it on the first command submission which used the BO we moved it back to VRAM again.

In the meantime, I've had the same idea as Marek: Can't the kernel driver simply change the BO's preferred domain to GTT when scanning out from it? Then it won't move back to VRAM.

Yes, I've considered this as well.

But I think making the decision in Mesa is the cleaner approach.

E.g. so far we only override the placement decision of userspace for two reasons:
1. We where running out of memory in VRAM.
2. We have a hardware restriction which makes VRAM usage mandatory.

And even then we never adjust the placement permanently, we just temporary moved the buffer where it was needed and moved it back after the operation completed.

Quoted 7 lines

Additional to that Mesa might want to set even more flags and/or changes it's behavior. E.g. use a tilling mode which both importer and export in an A+A laptop understands etc...

Regards,
Christian.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#82 lore raw
In reply to a message not in the archive

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

Quoted 25 lines · Alex Deucher
Quoted 4 lines · Samuel
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select

where

Quoted 3 lines

to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference

is

Quoted 1 line

not much. Also, since amdgpufb can request even without mesa, kernel

might

Quoted 2 lines

be a better choice. In addition, putting in the kernel can save client’s duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Quoted 2 lines

Alex

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#84 lore raw
In reply to a message not in the archive

Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:

Quoted 36 lines

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <[email protected] <mailto:[email protected]>> wrote:

On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel <[email protected] <mailto:[email protected]>> wrote:
>>to my earlier point, there may be cases where it is advantageous
to put
>> display buffers in vram even if s/g display is supported
>
> Agreed. That is also why the patch has the options to let user select where
> to put display buffers.
>
> As whether to put the option in Mesa or kernel, it seems the difference is
> not much. Also, since amdgpufb can request even without mesa, kernel might
> be a better choice. In addition, putting in the kernel can save client’s
> duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first place ;)  Each pool has performance characteristics that may be relevant for a particular work load.  Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it.  The kernel exposes functionality and userspace sets the policy.  With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Quoted 8 lines

Alex

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#86 lore raw
In reply to a message not in the archive
Quoted 3 lines · Christian König

Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek

Quoted 50 lines

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

Quoted 25 lines · Alex Deucher
Quoted 4 lines · Samuel
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select

where

Quoted 3 lines

to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference

is

Quoted 1 line

not much. Also, since amdgpufb can request even without mesa, kernel

might

Quoted 2 lines

be a better choice. In addition, putting in the kernel can save client’s duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Quoted 9 lines
Quoted 2 lines

Alex

_______________________________________________
amd-gfx mailing listamd-gfx-PD4FTy7X32lNgt0PjOBp934avgP/[email protected]://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#88 lore raw
In reply to a message not in the archive

I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:

Quoted 81 lines · On Tue, Mar 20, 2018 at 9:55 AM, Christian König…

Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:

Quoted 51 lines

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher
<[email protected] <mailto:[email protected]>> wrote:

On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel <[email protected] <mailto:[email protected]>> wrote:
>>to my earlier point, there may be cases where it is
advantageous to put
>> display buffers in vram even if s/g display is supported
>
> Agreed. That is also why the patch has the options to let
user select where
> to put display buffers.
>
> As whether to put the option in Mesa or kernel, it seems
the difference is
> not much. Also, since amdgpufb can request even without
mesa, kernel might
> be a better choice. In addition, putting in the kernel can
save client’s
> duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first
place ;)  Each pool has performance characteristics that may be relevant for a particular work load.  Only the UMDs really know the
finer points of those workloads. In general, you don't want the kernel
dictating policy if you can avoid it.  The kernel exposes functionality and userspace sets the policy.  With the location set in
userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their
kernel for every use case.

Alex

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#90 lore raw
In reply to a message not in the archive

I think we can also have the case of systems with similar amounts of carve out and system ram. E.g., on a system with 4 GB of system memory with 1 GB carved out for vram. It would be a big waste not to use VRAM. We'll probably need a heuristic at some point.

Alex

________________________________
From: Christian König <[email protected]>
Sent: Tuesday, March 20, 2018 2:32:49 PM
To: Marek Olšák; Koenig, Christian
Cc: Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:
On Tue, Mar 20, 2018 at 9:55 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:
In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <[email protected]<mailto:[email protected]>> wrote:

Quoted 10 lines · On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel…
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select where to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference is not much. Also, since amdgpufb can request even without mesa, kernel might be a better choice. In addition, putting in the kernel can save client’s duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Alex

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#92 lore raw
In reply to a message not in the archive

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Christian.

Am 20.03.2018 um 21:04 schrieb Deucher, Alexander:

Quoted 14 lines

I think we can also have the case of systems with similar amounts of carve out and system ram.  E.g., on a system with 4 GB of system memory with 1 GB carved out for vram.  It would be a big waste not to use VRAM.  We'll probably need a heuristic at some point.

Alex

------------------------------------------------------------------------
*From:* Christian König <[email protected]> *Sent:* Tuesday, March 20, 2018 2:32:49 PM
*To:* Marek Olšák; Koenig, Christian
*Cc:* Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support I don't think that is a good idea.

Quoted 94 lines

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:

Quoted 86 lines · On Tue, Mar 20, 2018 at 9:55 AM, Christian König…

Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:

Quoted 52 lines

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher
<[email protected] <mailto:[email protected]>> wrote:

On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel <[email protected] <mailto:[email protected]>> wrote:
>>to my earlier point, there may be cases where it is
advantageous to put
>> display buffers in vram even if s/g display is supported
>
> Agreed. That is also why the patch has the options to let
user select where
> to put display buffers.
>
> As whether to put the option in Mesa or kernel, it seems
the difference is
> not much. Also, since amdgpufb can request even without
mesa, kernel might
> be a better choice. In addition, putting in the kernel can
save client’s
> duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first
place ;)  Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the
finer points of those workloads. In general, you don't want the kernel
dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy.  With the location set in
userspace, each app/user can have whatever policy makes sense for
their use case all at the same time without needing to tweak their
kernel for every use case.

Alex

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>

_______________________________________________
amd-gfx mailing list
[email protected] <mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#94 lore raw
In reply to a message not in the archive

O I think we can also have the case of systems with similar amounts of carve out and system ram. E.g., on a system with 4 GB of system memory with 1 GB carved out for vram. It would be a big waste not to use VRAM. We'll probably need a heuristic at some point. Agreed. But for CZ/ST, due to hardware limitation as discussed before, we either use VRAM or GTT, not both. That might be changed for later ASICs, but it is beyond the scope of this patch.

Regards,
Samuel Li

From: Koenig, Christian
Sent: Tuesday, March 20, 2018 4:17 PM
To: Deucher, Alexander <[email protected]>; Marek Olšák <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Christian.

Am 20.03.2018 um 21:04 schrieb Deucher, Alexander:

I think we can also have the case of systems with similar amounts of carve out and system ram. E.g., on a system with 4 GB of system memory with 1 GB carved out for vram. It would be a big waste not to use VRAM. We'll probably need a heuristic at some point.

Alex

________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Tuesday, March 20, 2018 2:32:49 PM
To: Marek Olšák; Koenig, Christian
Cc: Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:
On Tue, Mar 20, 2018 at 9:55 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time. Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:
In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <[email protected]<mailto:[email protected]>> wrote:

Quoted 10 lines · On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel…
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select where to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference is not much. Also, since amdgpufb can request even without mesa, kernel might be a better choice. In addition, putting in the kernel can save client's duplicate work(mesa, ogl, vulkan, 2d, kernel...)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Alex

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#113 lore raw
In reply to Christian König

Also, the change here is only for display buffer, so it is not really a "big" waste.

Regards,
Samuel Li

From: Li, Samuel
Sent: Tuesday, March 20, 2018 4:38 PM
To: Deucher, Alexander <[email protected]>
Cc: Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>; Marek Olšák <[email protected]>; Koenig, Christian <[email protected]>
Subject: RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

O I think we can also have the case of systems with similar amounts of carve out and system ram. E.g., on a system with 4 GB of system memory with 1 GB carved out for vram. It would be a big waste not to use VRAM. We'll probably need a heuristic at some point. Agreed. But for CZ/ST, due to hardware limitation as discussed before, we either use VRAM or GTT, not both. That might be changed for later ASICs, but it is beyond the scope of this patch.

Regards,
Samuel Li

From: Koenig, Christian
Sent: Tuesday, March 20, 2018 4:17 PM
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Marek Olšák <[email protected]<mailto:[email protected]>>
Cc: Alex Deucher <[email protected]<mailto:[email protected]>>; Michel Dänzer <[email protected]<mailto:[email protected]>>; Li, Samuel <[email protected]<mailto:[email protected]>>; amd-gfx list <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Christian.

Am 20.03.2018 um 21:04 schrieb Deucher, Alexander:

I think we can also have the case of systems with similar amounts of carve out and system ram. E.g., on a system with 4 GB of system memory with 1 GB carved out for vram. It would be a big waste not to use VRAM. We'll probably need a heuristic at some point.

Alex

________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Tuesday, March 20, 2018 2:32:49 PM
To: Marek Olšák; Koenig, Christian
Cc: Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:
On Tue, Mar 20, 2018 at 9:55 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time. Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:
In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <[email protected]<mailto:[email protected]>> wrote:

Quoted 10 lines · On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel…
Quoted 2 lines

to my earlier point, there may be cases where it is advantageous to put display buffers in vram even if s/g display is supported

Agreed. That is also why the patch has the options to let user select where to put display buffers.

As whether to put the option in Mesa or kernel, it seems the difference is not much. Also, since amdgpufb can request even without mesa, kernel might be a better choice. In addition, putting in the kernel can save client's duplicate work(mesa, ogl, vulkan, 2d, kernel...)

Why do we even expose different memory pools to the UMDs in the first place ;) Each pool has performance characteristics that may be relevant for a particular work load. Only the UMDs really know the finer points of those workloads. In general, you don't want the kernel dictating policy if you can avoid it. The kernel exposes functionality and userspace sets the policy. With the location set in userspace, each app/user can have whatever policy makes sense for their use case all at the same time without needing to tweak their kernel for every use case.

Alex

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#97 lore raw
In reply to a message not in the archive
Quoted 10 lines · Christian König

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#96 lore raw
In reply to a message not in the archive
Quoted 1 line

But for CZ/ST, due to hardware limitation as discussed before, we either use VRAM or GTT, not both.

That is actually not correct, as far as I read up on that the issue for switching between VRAM and GTT placement is minimal.

We should just make sure that we don't do this on every page flip, e.g. have double or triple buffering where one BO is in GTT and one in VRAM.

Regards,
Christian.

Am 20.03.2018 um 21:38 schrieb Li, Samuel:

Quoted 157 lines

ØI think we can also have the case of systems with similar amounts of carve out and system ram.  E.g., on a system with 4 GB of system memory with 1 GB carved out for vram.  It would be a big waste not to use VRAM.  We'll probably need a heuristic at some point.

Agreed. But for CZ/ST, due to hardware limitation as discussed before, we either use VRAM or GTT, not both. That might be changed for later ASICs, but it is beyond the scope of this patch.

Regards,

Samuel Li

*From:*Koenig, Christian
*Sent:* Tuesday, March 20, 2018 4:17 PM
*To:* Deucher, Alexander <[email protected]>; Marek Olšák <[email protected]>
*Cc:* Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; Li, Samuel <[email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Christian.

Am 20.03.2018 um 21:04 schrieb Deucher, Alexander:

I think we can also have the case of systems with similar amounts of carve out and system ram.  E.g., on a system with 4 GB of system memory with 1 GB carved out for vram.  It would be a big waste not to use VRAM.  We'll probably need a heuristic at some point.

Alex

------------------------------------------------------------------------

*From:*Christian König <[email protected]> <mailto:[email protected]> *Sent:* Tuesday, March 20, 2018 2:32:49 PM
*To:* Marek Olšák; Koenig, Christian
*Cc:* Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list
*Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather
display support

I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:

On Tue, Mar 20, 2018 at 9:55 AM, Christian König <[email protected] <mailto:[email protected]>> wrote:

Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.

Am 20.03.2018 um 00:01 schrieb Marek Olšák:

In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <[email protected] <mailto:[email protected]>> wrote:

On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel <[email protected] <mailto:[email protected]>> wrote:
>>to my earlier point, there may be cases where it
is advantageous to put
>> display buffers in vram even if s/g display is
supported
>
> Agreed. That is also why the patch has the
options to let user select where
> to put display buffers.
>
> As whether to put the option in Mesa or kernel,
it seems the difference is
> not much. Also, since amdgpufb can request even
without mesa, kernel might
> be a better choice. In addition, putting in the
kernel can save client’s
> duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first
place ;)  Each pool has performance characteristics that may be
relevant for a particular work load.  Only the UMDs really know the
finer points of those workloads. In general, you don't want the kernel
dictating policy if you can avoid it.  The kernel exposes
functionality and userspace sets the policy.  With the location set in
userspace, each app/user can have whatever policy makes sense for
their use case all at the same time without needing to tweak their
kernel for every use case.

Alex

_______________________________________________

amd-gfx mailing list

[email protected] <mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected] <mailto:[email protected]>

Quoted 8 lines

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#99 lore raw
In reply to a message not in the archive

Am 21.03.2018 um 06:08 schrieb Marek Olšák:

Quoted 14 lines · On Tue, Mar 20, 2018 at 4:16 PM, Christian König…

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 3 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Christian.

Quoted 8 lines

Marek

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#101 lore raw
In reply to a message not in the archive
Quoted 16 lines · Christian König

Am 21.03.2018 um 06:08 schrieb Marek Olšák:

On Tue, Mar 20, 2018 at 4:16 PM, Christian König <[email protected]

Quoted 5 lines

wrote:

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

Quoted 7 lines

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 9 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

Quoted 4 lines

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#103 lore raw
In reply to a message not in the archive

Am 21.03.2018 um 14:57 schrieb Marek Olšák:

Quoted 28 lines · On Wed, Mar 21, 2018 at 4:13 AM, Christian König…
    Am 21.03.2018 um 06:08 schrieb Marek Olšák:
Quoted 16 lines

On Tue, Mar 20, 2018 at 4:16 PM, Christian König <[email protected] <mailto:[email protected]>> wrote:

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 4 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

Quoted 8 lines

I explained why: VRAM|GTT is practically as good as GTT.

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Then we don't use the memory stolen for VRAM.

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

Christian.

Quoted 2 lines

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#105 lore raw
In reply to a message not in the archive

Ø But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit. Not really, since we only move display buffer here.

Regards,
Samuel Li

From: Koenig, Christian
Sent: Wednesday, March 21, 2018 10:07 AM
To: Marek Olšák <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Alex Deucher <[email protected]>; Michel Dänzer <[email protected]>; amd-gfx list <[email protected]>; Li, Samuel <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support

Am 21.03.2018 um 14:57 schrieb Marek Olšák:
On Wed, Mar 21, 2018 at 4:13 AM, Christian König <[email protected]<mailto:[email protected]>> wrote:
Am 21.03.2018 um 06:08 schrieb Marek Olšák:
On Tue, Mar 20, 2018 at 4:16 PM, Christian König <[email protected]<mailto:[email protected]>> wrote:
That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT". I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Then we don't use the memory stolen for VRAM.

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

Christian.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#106 lore raw
In reply to a message not in the archive
Quoted 43 lines · Christian König

Am 21.03.2018 um 14:57 schrieb Marek Olšák:

Quoted 16 lines · Christian König

Am 21.03.2018 um 06:08 schrieb Marek Olšák:

Quoted 10 lines · Christian König

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 9 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

Quoted 4 lines

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Quoted 8 lines

Then we don't use the memory stolen for VRAM.

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

BO priorities and BO move throttling should take care of optimal VRAM usage regardless of the VRAM size. We can adjust the throttling for small VRAM, but that's about all we can do.

VRAM|GTT doesn't guarantee that VRAM will be used usefully. In fact, it doesn't guarantee anything about VRAM.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#108 lore raw
In reply to a message not in the archive

Am 21.03.2018 um 19:04 schrieb Marek Olšák:

Quoted 47 lines · On Wed, Mar 21, 2018 at 10:07 AM, Christian König…
    Am 21.03.2018 um 14:57 schrieb Marek Olšák:
Quoted 34 lines
    On Wed, Mar 21, 2018 at 4:13 AM, Christian König
    <[email protected]
    <mailto:[email protected]>> wrote:

        Am 21.03.2018 um 06:08 schrieb Marek Olšák:
Quoted 17 lines

On Tue, Mar 20, 2018 at 4:16 PM, Christian König <[email protected] <mailto:[email protected]>> wrote:

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 4 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

Quoted 7 lines

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Then we don't use the memory stolen for VRAM.

Quoted 8 lines

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

BO priorities and BO move throttling should take care of optimal VRAM usage regardless of the VRAM size. We can adjust the throttling for small VRAM, but that's about all we can do.

Well at least on APUs move throttling is complete nonsense. VRAM should expose the same performance as GTT.

So the only usage we have for VRAM is for special cases like page tables and to allow to actually use the stolen memory.

Quoted 1 line

VRAM|GTT doesn't guarantee that VRAM will be used usefully. In fact, it doesn't guarantee anything about VRAM.

Why not? VRAM|GTT means that we should use VRAM as long as it is available and if it is used up fallback to GTT.

When BOs are evicted from VRAM they are never moved back into it. As far as I can see that is exactly what we need on APUs.

Christian.

Quoted 2 lines

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#110 lore raw
In reply to a message not in the archive
Quoted 72 lines · Christian König

Am 21.03.2018 um 19:04 schrieb Marek Olšák:

Quoted 43 lines · Christian König

Am 21.03.2018 um 14:57 schrieb Marek Olšák:

Quoted 16 lines · Christian König

Am 21.03.2018 um 06:08 schrieb Marek Olšák:

Quoted 10 lines · Christian König

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 9 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

Quoted 4 lines

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Quoted 8 lines

Then we don't use the memory stolen for VRAM.

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

BO priorities and BO move throttling should take care of optimal VRAM usage regardless of the VRAM size. We can adjust the throttling for small VRAM, but that's about all we can do.

Well at least on APUs move throttling is complete nonsense. VRAM should expose the same performance as GTT.

So the only usage we have for VRAM is for special cases like page tables and to allow to actually use the stolen memory.

VRAM|GTT doesn't guarantee that VRAM will be used usefully. In fact, it doesn't guarantee anything about VRAM.

Quoted 6 lines

Why not? VRAM|GTT means that we should use VRAM as long as it is available and if it is used up fallback to GTT.

When BOs are evicted from VRAM they are never moved back into it. As far as I can see that is exactly what we need on APUs.

I see. You don't want to use VRAM usefully. You just want to fill it up with something (anything) so that it's not unused.

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#112 lore raw
In reply to a message not in the archive

Am 21.03.2018 um 19:23 schrieb Marek Olšák:

Quoted 73 lines · On Wed, Mar 21, 2018 at 2:15 PM, Christian König…
    Am 21.03.2018 um 19:04 schrieb Marek Olšák:
Quoted 53 lines
    On Wed, Mar 21, 2018 at 10:07 AM, Christian König
    <[email protected] <mailto:[email protected]>> wrote:

        Am 21.03.2018 um 14:57 schrieb Marek Olšák:
Quoted 36 lines
        On Wed, Mar 21, 2018 at 4:13 AM, Christian König
        <[email protected]
        <mailto:[email protected]>> wrote:

            Am 21.03.2018 um 06:08 schrieb Marek Olšák:
Quoted 18 lines

On Tue, Mar 20, 2018 at 4:16 PM, Christian König <[email protected] <mailto:[email protected]>> wrote:

That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Quoted 4 lines

VRAM|GTT is practically as good as GTT. VRAM with BO priorities and eviction throttling is the true "VRAM|GTT".

I don't know how else to make use of VRAM intelligently.

Well why not set VRAM|GTT as default on APUs? That should still save quite a bunch of moves even with throttling.

I explained why: VRAM|GTT is practically as good as GTT.

Quoted 7 lines

I mean there really shouldn't be any advantage to use VRAM any more except that we want to use it up as long as it is available.

Why are you suggesting to use VRAM|GTT then? Let's just only use GTT on all APUs.

Then we don't use the memory stolen for VRAM.

See we want to get to a point where we have any ~16MB of stolen VRAM on APUs and everything else in GTT.

Quoted 7 lines

But we still have to support cases where we have 1GB stolen VRAM, and wasting those 1GB would suck a bit.

BO priorities and BO move throttling should take care of optimal VRAM usage regardless of the VRAM size. We can adjust the throttling for small VRAM, but that's about all we can do.

Well at least on APUs move throttling is complete nonsense. VRAM should expose the same performance as GTT.

So the only usage we have for VRAM is for special cases like page tables and to allow to actually use the stolen memory.

Quoted 2 lines

VRAM|GTT doesn't guarantee that VRAM will be used usefully. In fact, it doesn't guarantee anything about VRAM.

Quoted 8 lines

Why not? VRAM|GTT means that we should use VRAM as long as it is available and if it is used up fallback to GTT.

When BOs are evicted from VRAM they are never moved back into it. As far as I can see that is exactly what we need on APUs.

I see. You don't want to use VRAM usefully. You just want to fill it up with something (anything) so that it's not unused.

Yes, exactly. The point is we really don't have any special use case for it on APUs any more on newer kernels/hardware.

We need a bit for firmware, but that is fixed and allocate at driver load time.

Page tables are still in VRAM, but at least for Raven that is just an issue that I didn't had free time to implement it otherwise.

If I could I would give the unused parts back to the OS for general purpose usage, but you need to reconfigure the northbridge to do that and well that is easier said than done.

Christian.

Quoted 2 lines

Marek

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx