Skip to contentSkip to conversation

drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet

PATCH In review Lyude Paul 2 participants 2 messages Mar 5, 2021 – Mar 21, 2021

Subsystems (4)
lore
Share & tools
lore

Lyude Paul

author maintainer
#0 lore raw

PATCH v2 1/1 drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet

While Kepler does technically support 256x256 cursors, it turns out that in order for us to use these correctly we need to make sure that the cursor plane uses a ctxdma that is set to use small (4K)/large (128K) pages - whichever is applicable to the given cursor surface.

Right now however, we share the main kmsVramCtxDma that is used for all but the ovly plane which defaults to small pages - resulting in artifacts when we use 256x256 cursor surfaces. So until we teach nouveau to use a separate ctxdma for the cursor, let's just stop advertising 256x256 cursors by default - which should fix the issues that users were seeing.

Coincidentally - this is also why small ovlys don't work on Kepler: the ctxdma we use for ovlys is set to large pages.

Changes since v2:
* Fix comments and patch description

Fixes d3b2f0f7921c ("drm/nouveau/kms/nv50-: Report max cursor size to userspace")
Cc <[email protected]> # v5.11+
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +11 -1
index 196612addfd6..d92cf9e17ac3 100644
@@ -2693,9 +2693,19 @@ nv50_display_create(struct drm_device *dev)
 	else
 		nouveau_display(dev)->format_modifiers = disp50xx_modifiers;
 
-	if (disp->disp->object.oclass >= GK104_DISP) {
+	/* FIXME: 256x256 cursors are supported on Kepler, however unlike Maxwell and later
+	 * generations Kepler requires that we specify the page type, small (4K) or large (128K),
+	 * correctly for the ctxdma being used on curs/ovly. We currently share a ctxdma across all
+	 * display planes (except ovly) that defaults to small pages, which results in artifacting
+	 * on 256x256 cursors. Until we teach nouveau to create an appropriate ctxdma for the cursor
+	 * fb in use, simply avoid advertising support for 256x256 cursors.
+	 */
+	if (disp->disp->object.oclass >= GM107_DISP) {
 		dev->mode_config.cursor_width = 256;
 		dev->mode_config.cursor_height = 256;
+	} else if (disp->disp->object.oclass >= GK104_DISP) {
+		dev->mode_config.cursor_width = 128;
+		dev->mode_config.cursor_height = 128;
 	} else {
 		dev->mode_config.cursor_width = 64;
 		dev->mode_config.cursor_height = 64;
Signature · 6 lines
2.29.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Tested-by on v2 1/1
#1 lore raw

Op 05-03-2021 om 22:21 schreef Lyude Paul:

Quoted 40 lines

While Kepler does technically support 256x256 cursors, it turns out that in order for us to use these correctly we need to make sure that the cursor plane uses a ctxdma that is set to use small (4K)/large (128K) pages - whichever is applicable to the given cursor surface.

Right now however, we share the main kmsVramCtxDma that is used for all but the ovly plane which defaults to small pages - resulting in artifacts when we use 256x256 cursor surfaces. So until we teach nouveau to use a separate ctxdma for the cursor, let's just stop advertising 256x256 cursors by default - which should fix the issues that users were seeing.

Coincidentally - this is also why small ovlys don't work on Kepler: the ctxdma we use for ovlys is set to large pages.

Changes since v2:
* Fix comments and patch description

Fixes d3b2f0f7921c ("drm/nouveau/kms/nv50-: Report max cursor size to userspace")
Cc <[email protected]> # v5.11+
---
  drivers/gpu/drm/nouveau/dispnv50/disp.c | 12 +++++++++++-
  1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +6 -1
index 196612addfd6..d92cf9e17ac3 100644
@@ -2693,9 +2693,19 @@ nv50_display_create(struct drm_device *dev)
  	else
  		nouveau_display(dev)->format_modifiers = disp50xx_modifiers;
 
-	if (disp->disp->object.oclass >= GK104_DISP) {
+	/* FIXME: 256x256 cursors are supported on Kepler, however unlike Maxwell and later
+	 * generations Kepler requires that we specify the page type, small (4K) or large (128K),
+	 * correctly for the ctxdma being used on curs/ovly. We currently share a ctxdma across all
+	 * display planes (except ovly) that defaults to small pages, which results in artifacting
+	 * on 256x256 cursors. Until we teach nouveau to create an appropriate ctxdma for the cursor
+	 * fb in use, simply avoid advertising support for 256x256 cursors.

drivers/gpu/drm/nouveau/dispnv50/disp.c nv50_display_create(struct drm_device *dev) · line 2711

Quoted 10 lines
drivers/gpu/drm/nouveau/dispnv50/disp.c +5 -0
+	 */
+	if (disp->disp->object.oclass >= GM107_DISP) {
  		dev->mode_config.cursor_width = 256;
  		dev->mode_config.cursor_height = 256;
+	} else if (disp->disp->object.oclass >= GK104_DISP) {
+		dev->mode_config.cursor_width = 128;
+		dev->mode_config.cursor_height = 128;
  	} else {
  		dev->mode_config.cursor_width = 64;
  		dev->mode_config.cursor_height = 64;

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau