Skip to contentSkip to conversation

drm/mgag200: Enable caching for SHMEM pages

PATCH In review Thomas Zimmermann 2 participants 4 messages Jun 18, 2020 – Jun 23, 2020

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/mgag200: Enable caching for SHMEM pages

We've had reports about performance regressions after switching mgag200 from VRAM helpers to SHMEM helpers. SHMEM pages use writecombine caching by default, but can also use the platform's default page caching. Doing so improves the performance of I/O on the framebuffer.

Mgag200's hardware does not access framebuffer pages directly (i.e., via DMA), so enabling caching does not have an effect on consistency of the framebuffer memory or the displayed data.

Fixes 913ec479bb5c ("drm/mgag200: Replace VRAM helpers with SHMEM helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Rong Chen <[email protected]>
Cc John Donnelly <[email protected]>
---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -0
index e19660f4a637..7189c7745baf 100644
@@ -36,6 +36,7 @@ static struct drm_driver mgag200_driver = {
 	.major = DRIVER_MAJOR,
 	.minor = DRIVER_MINOR,
 	.patchlevel = DRIVER_PATCHLEVEL,
+	.gem_create_object = drm_gem_shmem_create_object_cached,
 	DRM_GEM_SHMEM_DRIVER_OPS,
 };
 
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi Thomas,

I tested the patch based on commit 24b806b0a1dd3, the regression of phoronix-test-suite.glmark2.1024x768.score still exists:

1f58fcaf27cb7 drm/mgag200: Enable caching for SHMEM pages                                            2 2 2
24b806b0a1dd3 drm-tip: 2020y-06m-22d-07h-52m-06s UTC integration manifest                            2 2 2 2 2
913ec479bb5cc drm/mgag200: Replace VRAM helpers with SHMEM helpers                                   2 2 2 2 2
88fabb75ea9ed drm/mgag200: Convert to simple KMS helper                                              165 168 167 165 164

Best Regards,
Rong Chen

Quoted 41 lines · Thomas Zimmermann

We've had reports about performance regressions after switching mgag200 from VRAM helpers to SHMEM helpers. SHMEM pages use writecombine caching by default, but can also use the platform's default page caching. Doing so improves the performance of I/O on the framebuffer.

Mgag200's hardware does not access framebuffer pages directly (i.e., via DMA), so enabling caching does not have an effect on consistency of the framebuffer memory or the displayed data.

Fixes 913ec479bb5c ("drm/mgag200: Replace VRAM helpers with SHMEM helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Rong Chen <[email protected]>
Cc John Donnelly <[email protected]>
---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -0
index e19660f4a637..7189c7745baf 100644
@@ -36,6 +36,7 @@ static struct drm_driver mgag200_driver = {
 	.major = DRIVER_MAJOR,
 	.minor = DRIVER_MINOR,
 	.patchlevel = DRIVER_PATCHLEVEL,
+	.gem_create_object = drm_gem_shmem_create_object_cached,
 	DRM_GEM_SHMEM_DRIVER_OPS,
 };
 
Signature · 1 line
2.27.0

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

author maintainer
#2 lore raw

Hi

Am 22.06.20 um 17:00 schrieb Rong Chen:

Quoted 3 lines

Hi Thomas,

I tested the patch based on commit 24b806b0a1dd3, the regression

Thanks!

Quoted 1 line

of phoronix-test-suite.glmark2.1024x768.score still exists:

I expected that the test is related to drawing onto the screen. Do you know what exactly it is testing?

Best regards
Thomas

Quoted 51 lines
1f58fcaf27cb7 drm/mgag200: Enable caching for SHMEM pages                                            2 2 2
24b806b0a1dd3 drm-tip: 2020y-06m-22d-07h-52m-06s UTC integration manifest                            2 2 2 2 2
913ec479bb5cc drm/mgag200: Replace VRAM helpers with SHMEM helpers                                   2 2 2 2 2
88fabb75ea9ed drm/mgag200: Convert to simple KMS helper                                              165 168 167 165 164

Best Regards,
Rong Chen

Quoted 41 lines · Thomas Zimmermann

We've had reports about performance regressions after switching mgag200 from VRAM helpers to SHMEM helpers. SHMEM pages use writecombine caching by default, but can also use the platform's default page caching. Doing so improves the performance of I/O on the framebuffer.

Mgag200's hardware does not access framebuffer pages directly (i.e., via DMA), so enabling caching does not have an effect on consistency of the framebuffer memory or the displayed data.

Fixes 913ec479bb5c ("drm/mgag200: Replace VRAM helpers with SHMEM helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Rong Chen <[email protected]>
Cc John Donnelly <[email protected]>
---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -0
index e19660f4a637..7189c7745baf 100644
@@ -36,6 +36,7 @@ static struct drm_driver mgag200_driver = {
 	.major = DRIVER_MAJOR,
 	.minor = DRIVER_MINOR,
 	.patchlevel = DRIVER_PATCHLEVEL,
+	.gem_create_object = drm_gem_shmem_create_object_cached,
 	DRM_GEM_SHMEM_DRIVER_OPS,
 };
 
Signature · 1 line
2.27.0
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

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

#3 lore raw
Quoted 10 lines · Thomas Zimmermann

Hi

Am 22.06.20 um 17:00 schrieb Rong Chen:

Quoted 3 lines

Hi Thomas,

I tested the patch based on commit 24b806b0a1dd3, the regression

Thanks!

Quoted 1 line

of phoronix-test-suite.glmark2.1024x768.score still exists:

I expected that the test is related to drawing onto the screen.

Hi Thomas,

This server doesn't connect a monitor.

Quoted 2 lines

Do you
know what exactly it is testing?

It's a glmark2 test, please see https://openbenchmarking.org/test/pts/glmark2
the test command is ./glmark2 --annotate -s 1024x768

Best Regards,
Rong Chen

Quoted 50 lines

Best regards
Thomas

Quoted 47 lines
1f58fcaf27cb7 drm/mgag200: Enable caching for SHMEM pages                                            2 2 2
24b806b0a1dd3 drm-tip: 2020y-06m-22d-07h-52m-06s UTC integration manifest                            2 2 2 2 2
913ec479bb5cc drm/mgag200: Replace VRAM helpers with SHMEM helpers                                   2 2 2 2 2
88fabb75ea9ed drm/mgag200: Convert to simple KMS helper                                              165 168 167 165 164

Best Regards,
Rong Chen

Quoted 38 lines · Thomas Zimmermann

We've had reports about performance regressions after switching mgag200 from VRAM helpers to SHMEM helpers. SHMEM pages use writecombine caching by default, but can also use the platform's default page caching. Doing so improves the performance of I/O on the framebuffer.

Mgag200's hardware does not access framebuffer pages directly (i.e., via DMA), so enabling caching does not have an effect on consistency of the framebuffer memory or the displayed data.

Fixes 913ec479bb5c ("drm/mgag200: Replace VRAM helpers with SHMEM helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Rong Chen <[email protected]>
Cc John Donnelly <[email protected]>
---
  drivers/gpu/drm/mgag200/mgag200_drv.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -0
index e19660f4a637..7189c7745baf 100644
@@ -36,6 +36,7 @@ static struct drm_driver mgag200_driver = {
  	.major = DRIVER_MAJOR,
  	.minor = DRIVER_MINOR,
  	.patchlevel = DRIVER_PATCHLEVEL,
+	.gem_create_object = drm_gem_shmem_create_object_cached,
  	DRM_GEM_SHMEM_DRIVER_OPS,
  };
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.27.0

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