All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: nouveau@lists.freedesktop.org,
	"open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS"
	<dri-devel@lists.freedesktop.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@linux.ie>,
	"James Jones" <jajones@nvidia.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, "Jeremy Cline" <jcline@redhat.com>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Nirmoy Das" <nirmoy.aiemd@gmail.com>
Subject: Re: [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes
Date: Tue, 19 Jan 2021 17:50:42 +0200	[thread overview]
Message-ID: <YAb/0urUmEg5kd3C@intel.com> (raw)
In-Reply-To: <20210119015415.2511028-1-lyude@redhat.com>

On Mon, Jan 18, 2021 at 08:54:12PM -0500, Lyude Paul wrote:
> Nvidia hardware doesn't actually support using tiling formats with the
> cursor plane, only linear is allowed. In the future, we should write a
> testcase for this.

There are a couple of old modifier/format sanity tests here:
https://patchwork.freedesktop.org/series/46876/

Couple of things missing that now came to my mind:
- test setplane/etc. rejects unsupported formats/modifiers even if
  addfb allowed them, exactly for the case where only a subset of
  planes support something
- validate the IN_FORMATS blob harder, eg. make sure each modifier
  listed there supports at least one format. IIRC this was busted on
  a few drivers last year, dunno if they got fixed or not. Hmm,
  actually since this is now using the pre-parsed stuff I guess we
  should just stick an assert into igt_fill_plane_format_mod() where
  the blob gets parsed

> 
> Fixes: c586f30bf74c ("drm/nouveau/kms: Add format mod prop to base/ovly/nvdisp")
> Cc: James Jones <jajones@nvidia.com>
> Cc: Martin Peres <martin.peres@free.fr>
> Cc: Jeremy Cline <jcline@redhat.com>
> Cc: Simon Ser <contact@emersion.fr>
> Cc: <stable@vger.kernel.org> # v5.8+
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv50/wndw.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> index ce451242f79e..271de3a63f21 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> @@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw)
>  	nvif_notify_get(&wndw->notify);
>  }
>  
> +static const u64 nv50_cursor_format_modifiers[] = {
> +	DRM_FORMAT_MOD_LINEAR,
> +	DRM_FORMAT_MOD_INVALID,
> +};
> +
>  int
>  nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	       enum drm_plane_type type, const char *name, int index,
> @@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	struct nvif_mmu *mmu = &drm->client.mmu;
>  	struct nv50_disp *disp = nv50_disp(dev);
>  	struct nv50_wndw *wndw;
> +	const u64 *format_modifiers;
>  	int nformat;
>  	int ret;
>  
> @@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  
>  	for (nformat = 0; format[nformat]; nformat++);
>  
> -	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw,
> -				       format, nformat,
> -				       nouveau_display(dev)->format_modifiers,
> -				       type, "%s-%d", name, index);
> +	if (type == DRM_PLANE_TYPE_CURSOR)
> +		format_modifiers = nv50_cursor_format_modifiers;
> +	else
> +		format_modifiers = nouveau_display(dev)->format_modifiers;
> +
> +	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
> +				       format_modifiers, type, "%s-%d", name, index);
>  	if (ret) {
>  		kfree(*pwndw);
>  		*pwndw = NULL;
> -- 
> 2.29.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "David Airlie" <airlied-cv59FeDIM0c@public.gmane.org>,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	"open list"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Nirmoy Das"
	<nirmoy.aiemd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Ben Skeggs" <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes
Date: Tue, 19 Jan 2021 17:50:42 +0200	[thread overview]
Message-ID: <YAb/0urUmEg5kd3C@intel.com> (raw)
In-Reply-To: <20210119015415.2511028-1-lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Mon, Jan 18, 2021 at 08:54:12PM -0500, Lyude Paul wrote:
> Nvidia hardware doesn't actually support using tiling formats with the
> cursor plane, only linear is allowed. In the future, we should write a
> testcase for this.

There are a couple of old modifier/format sanity tests here:
https://patchwork.freedesktop.org/series/46876/

Couple of things missing that now came to my mind:
- test setplane/etc. rejects unsupported formats/modifiers even if
  addfb allowed them, exactly for the case where only a subset of
  planes support something
- validate the IN_FORMATS blob harder, eg. make sure each modifier
  listed there supports at least one format. IIRC this was busted on
  a few drivers last year, dunno if they got fixed or not. Hmm,
  actually since this is now using the pre-parsed stuff I guess we
  should just stick an assert into igt_fill_plane_format_mod() where
  the blob gets parsed

> 
> Fixes: c586f30bf74c ("drm/nouveau/kms: Add format mod prop to base/ovly/nvdisp")
> Cc: James Jones <jajones-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Cc: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
> Cc: Jeremy Cline <jcline-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Simon Ser <contact-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org>
> Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # v5.8+
> Signed-off-by: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/gpu/drm/nouveau/dispnv50/wndw.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> index ce451242f79e..271de3a63f21 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> @@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw)
>  	nvif_notify_get(&wndw->notify);
>  }
>  
> +static const u64 nv50_cursor_format_modifiers[] = {
> +	DRM_FORMAT_MOD_LINEAR,
> +	DRM_FORMAT_MOD_INVALID,
> +};
> +
>  int
>  nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	       enum drm_plane_type type, const char *name, int index,
> @@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	struct nvif_mmu *mmu = &drm->client.mmu;
>  	struct nv50_disp *disp = nv50_disp(dev);
>  	struct nv50_wndw *wndw;
> +	const u64 *format_modifiers;
>  	int nformat;
>  	int ret;
>  
> @@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  
>  	for (nformat = 0; format[nformat]; nformat++);
>  
> -	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw,
> -				       format, nformat,
> -				       nouveau_display(dev)->format_modifiers,
> -				       type, "%s-%d", name, index);
> +	if (type == DRM_PLANE_TYPE_CURSOR)
> +		format_modifiers = nv50_cursor_format_modifiers;
> +	else
> +		format_modifiers = nouveau_display(dev)->format_modifiers;
> +
> +	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
> +				       format_modifiers, type, "%s-%d", name, index);
>  	if (ret) {
>  		kfree(*pwndw);
>  		*pwndw = NULL;
> -- 
> 2.29.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: "David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, "James Jones" <jajones@nvidia.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS"
	<dri-devel@lists.freedesktop.org>,
	"Jeremy Cline" <jcline@redhat.com>,
	stable@vger.kernel.org, "Thomas Zimmermann" <tzimmermann@suse.de>,
	"Nirmoy Das" <nirmoy.aiemd@gmail.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Ben Skeggs" <bskeggs@redhat.com>
Subject: Re: [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes
Date: Tue, 19 Jan 2021 17:50:42 +0200	[thread overview]
Message-ID: <YAb/0urUmEg5kd3C@intel.com> (raw)
In-Reply-To: <20210119015415.2511028-1-lyude@redhat.com>

On Mon, Jan 18, 2021 at 08:54:12PM -0500, Lyude Paul wrote:
> Nvidia hardware doesn't actually support using tiling formats with the
> cursor plane, only linear is allowed. In the future, we should write a
> testcase for this.

There are a couple of old modifier/format sanity tests here:
https://patchwork.freedesktop.org/series/46876/

Couple of things missing that now came to my mind:
- test setplane/etc. rejects unsupported formats/modifiers even if
  addfb allowed them, exactly for the case where only a subset of
  planes support something
- validate the IN_FORMATS blob harder, eg. make sure each modifier
  listed there supports at least one format. IIRC this was busted on
  a few drivers last year, dunno if they got fixed or not. Hmm,
  actually since this is now using the pre-parsed stuff I guess we
  should just stick an assert into igt_fill_plane_format_mod() where
  the blob gets parsed

> 
> Fixes: c586f30bf74c ("drm/nouveau/kms: Add format mod prop to base/ovly/nvdisp")
> Cc: James Jones <jajones@nvidia.com>
> Cc: Martin Peres <martin.peres@free.fr>
> Cc: Jeremy Cline <jcline@redhat.com>
> Cc: Simon Ser <contact@emersion.fr>
> Cc: <stable@vger.kernel.org> # v5.8+
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv50/wndw.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> index ce451242f79e..271de3a63f21 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> @@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw)
>  	nvif_notify_get(&wndw->notify);
>  }
>  
> +static const u64 nv50_cursor_format_modifiers[] = {
> +	DRM_FORMAT_MOD_LINEAR,
> +	DRM_FORMAT_MOD_INVALID,
> +};
> +
>  int
>  nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	       enum drm_plane_type type, const char *name, int index,
> @@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  	struct nvif_mmu *mmu = &drm->client.mmu;
>  	struct nv50_disp *disp = nv50_disp(dev);
>  	struct nv50_wndw *wndw;
> +	const u64 *format_modifiers;
>  	int nformat;
>  	int ret;
>  
> @@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
>  
>  	for (nformat = 0; format[nformat]; nformat++);
>  
> -	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw,
> -				       format, nformat,
> -				       nouveau_display(dev)->format_modifiers,
> -				       type, "%s-%d", name, index);
> +	if (type == DRM_PLANE_TYPE_CURSOR)
> +		format_modifiers = nv50_cursor_format_modifiers;
> +	else
> +		format_modifiers = nouveau_display(dev)->format_modifiers;
> +
> +	ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
> +				       format_modifiers, type, "%s-%d", name, index);
>  	if (ret) {
>  		kfree(*pwndw);
>  		*pwndw = NULL;
> -- 
> 2.29.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-01-19 16:10 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  1:54 [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes Lyude Paul
2021-01-19  1:54 ` Lyude Paul
2021-01-19  1:54 ` Lyude Paul
2021-01-19  1:54 ` [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace Lyude Paul
2021-01-19  1:54   ` Lyude Paul
2021-01-19  1:54   ` Lyude Paul
2021-01-19 10:22   ` Simon Ser
2021-01-19 10:22     ` Simon Ser
2021-01-19 10:22     ` Simon Ser
2021-02-23 14:15   ` Alex Riesen
2021-02-23 14:15     ` Alex Riesen
2021-02-23 14:15     ` [Nouveau] " Alex Riesen
2021-02-23 14:56     ` Ilia Mirkin
2021-02-23 14:56       ` Ilia Mirkin
2021-02-23 14:56       ` [Nouveau] " Ilia Mirkin
2021-02-23 15:36       ` Alex Riesen
2021-02-23 15:36         ` Alex Riesen
2021-02-23 15:36         ` [Nouveau] " Alex Riesen
2021-02-23 15:46         ` Ilia Mirkin
2021-02-23 15:46           ` Ilia Mirkin
2021-02-23 15:46           ` [Nouveau] " Ilia Mirkin
2021-02-23 15:51           ` Alex Riesen
2021-02-23 15:51             ` Alex Riesen
2021-02-23 15:51             ` [Nouveau] " Alex Riesen
2021-02-23 16:22             ` Alex Riesen
2021-02-23 16:22               ` Alex Riesen
2021-02-23 16:22               ` [Nouveau] " Alex Riesen
2021-02-23 18:13               ` Ilia Mirkin
2021-02-23 18:13                 ` Ilia Mirkin
2021-02-23 18:13                 ` [Nouveau] " Ilia Mirkin
2021-02-24  9:08                 ` Alex Riesen
2021-02-24  9:08                   ` Alex Riesen
2021-02-24  9:08                   ` [Nouveau] " Alex Riesen
2021-02-24 15:10                   ` Ilia Mirkin
2021-02-24 15:10                     ` Ilia Mirkin
2021-02-24 16:35                     ` [Nouveau] " Alex Riesen
2021-02-24 16:35                       ` Alex Riesen
2021-02-24 16:48                       ` [Nouveau] " Ilia Mirkin
2021-02-24 16:48                         ` Ilia Mirkin
2021-02-24 16:53                         ` [Nouveau] " Alex Riesen
2021-02-24 16:53                           ` Alex Riesen
2021-02-24 16:57                           ` [Nouveau] " Ilia Mirkin
2021-02-24 16:57                             ` Ilia Mirkin
2021-02-24 17:02                             ` [Nouveau] " Alex Riesen
2021-02-24 17:02                               ` Alex Riesen
2021-02-24 17:47                               ` [Nouveau] " Ilia Mirkin
2021-02-24 17:47                                 ` Ilia Mirkin
2021-02-27 12:28                                 ` [Nouveau] " Uwe Sauter
2021-02-27 21:26                                   ` Ilia Mirkin
2021-02-28 15:10                                     ` Uwe Sauter
2021-02-28 17:02                                       ` Ilia Mirkin
2021-02-28 17:59                                         ` Uwe Sauter
2021-02-28 19:10                                           ` Ilia Mirkin
2021-02-28 19:24                                             ` Uwe Sauter
2021-02-28 20:38                                               ` Ilia Mirkin
2021-03-03 12:41                                     ` Alex Riesen
2021-03-03 13:12                                       ` Ilia Mirkin
2021-03-03 13:25                                         ` Uwe Sauter
2021-03-03 13:33                                           ` Ilia Mirkin
2021-03-03 17:02                                             ` Uwe Sauter
2021-03-03 17:11                                               ` Lyude Paul
2021-03-03 16:51                                         ` Lyude Paul
2021-03-03 17:05                                           ` James Jones
2021-01-19  1:54 ` [PATCH 3/3] drm/nouveau/kms/nve4-nv138: Fix > 64x64 cursors Lyude Paul
2021-01-19  1:54   ` Lyude Paul
2021-01-19  1:54   ` Lyude Paul
2021-01-19 10:18 ` [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes Simon Ser
2021-01-19 10:18   ` Simon Ser
2021-01-19 10:18   ` Simon Ser
2021-01-19 15:50 ` Ville Syrjälä [this message]
2021-01-19 15:50   ` Ville Syrjälä
2021-01-19 15:50   ` Ville Syrjälä
2021-01-19 15:52 ` James Jones
2021-01-19 15:52   ` James Jones
2021-01-19 15:52   ` James Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YAb/0urUmEg5kd3C@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jajones@nvidia.com \
    --cc=jcline@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=nirmoy.aiemd@gmail.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.