nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Nouveau] [PATCH v2] drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet
@ 2021-03-05 22:21 Lyude Paul
  2021-03-21 22:58 ` Roy Spliet
  0 siblings, 1 reply; 2+ messages in thread
From: Lyude Paul @ 2021-03-05 22:21 UTC (permalink / raw)
  To: nouveau
  Cc: open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS,
	David Airlie, Pankaj Bharadiya, open list, stable, Ben Skeggs,
	Daniel Vetter, Dave Airlie

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

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: d3b2f0f7921c ("drm/nouveau/kms/nv50-: Report max cursor size to userspace")
Cc: <stable@vger.kernel.org> # v5.11+
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 196612addfd6..d92cf9e17ac3 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -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;
-- 
2.29.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [Nouveau] [PATCH v2] drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet
  2021-03-05 22:21 [Nouveau] [PATCH v2] drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet Lyude Paul
@ 2021-03-21 22:58 ` Roy Spliet
  0 siblings, 0 replies; 2+ messages in thread
From: Roy Spliet @ 2021-03-21 22:58 UTC (permalink / raw)
  To: nouveau

Tested-by: Roy Spliet <nouveau@spliet.org>

Op 05-03-2021 om 22:21 schreef Lyude Paul:
> 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
> 
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Fixes: d3b2f0f7921c ("drm/nouveau/kms/nv50-: Report max cursor size to userspace")
> Cc: <stable@vger.kernel.org> # v5.11+
> ---
>   drivers/gpu/drm/nouveau/dispnv50/disp.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 196612addfd6..d92cf9e17ac3 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -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;
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

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

end of thread, other threads:[~2021-03-21 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 22:21 [Nouveau] [PATCH v2] drm/nouveau/kms/nve4-nv108: Don't advertise 256x256 cursor support yet Lyude Paul
2021-03-21 22:58 ` Roy Spliet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).