All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane."
@ 2021-04-05 15:08 Qingqing Zhuo
  2021-04-05 16:10 ` Rodrigo Siqueira
  0 siblings, 1 reply; 3+ messages in thread
From: Qingqing Zhuo @ 2021-04-05 15:08 UTC (permalink / raw)
  To: amd-gfx
  Cc: markyacoub, Rodrigo.Siqueira, daniel.wheeler, bas,
	alexander.deucher, nicholas.kazlauskas

This reverts commit 9f81b5d40ca2c689334ad8288a4ddca4722a6e10.

The original commit was found to cause the following two issues
on sienna cichlid:
1. Refresh rate locked during vrrdemo
2. Display sticks on flipped landscape mode after changing
   orientation, and cannot be changed back to regular landscape

Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c    | 13 -------------
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 18 +++---------------
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 0f17984fdea4..6304a49b02fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -908,19 +908,6 @@ int amdgpu_display_gem_fb_verify_and_init(
 					 &amdgpu_fb_funcs);
 	if (ret)
 		goto err;
-	/* Verify that the modifier is supported. */
-	if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
-				      mode_cmd->modifier[0])) {
-		struct drm_format_name_buf format_name;
-		drm_dbg_kms(dev,
-			    "unsupported pixel format %s / modifier 0x%llx\n",
-			    drm_get_format_name(mode_cmd->pixel_format,
-						&format_name),
-			    mode_cmd->modifier[0]);
-
-		ret = -EINVAL;
-		goto err;
-	}
 
 	ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
 	if (ret)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 54ef0f3f37b7..ac6ab35f89b2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4299,7 +4299,6 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
 {
 	struct amdgpu_device *adev = drm_to_adev(plane->dev);
 	const struct drm_format_info *info = drm_format_info(format);
-	int i;
 
 	enum dm_micro_swizzle microtile = modifier_gfx9_swizzle_mode(modifier) & 3;
 
@@ -4307,22 +4306,11 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
 		return false;
 
 	/*
-	 * We always have to allow these modifiers:
-	 * 1. Core DRM checks for LINEAR support if userspace does not provide modifiers.
-	 * 2. Not passing any modifiers is the same as explicitly passing INVALID.
+	 * We always have to allow this modifier, because core DRM still
+	 * checks LINEAR support if userspace does not provide modifers.
 	 */
-	if (modifier == DRM_FORMAT_MOD_LINEAR ||
-	    modifier == DRM_FORMAT_MOD_INVALID) {
+	if (modifier == DRM_FORMAT_MOD_LINEAR)
 		return true;
-	}
-
-	/* Check that the modifier is on the list of the plane's supported modifiers. */
-	for (i = 0; i < plane->modifier_count; i++) {
-		if (modifier == plane->modifiers[i])
-			break;
-	}
-	if (i == plane->modifier_count)
-		return false;
 
 	/*
 	 * The arbitrary tiling support for multiplane formats has not been hooked
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane."
  2021-04-05 15:08 [PATCH] Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane." Qingqing Zhuo
@ 2021-04-05 16:10 ` Rodrigo Siqueira
  2021-04-05 16:14   ` Mark Yacoub
  0 siblings, 1 reply; 3+ messages in thread
From: Rodrigo Siqueira @ 2021-04-05 16:10 UTC (permalink / raw)
  To: Qingqing Zhuo, markyacoub
  Cc: alexander.deucher, daniel.wheeler, nicholas.kazlauskas, amd-gfx, bas


[-- Attachment #1.1: Type: text/plain, Size: 3355 bytes --]

In general lgtm.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

Mark Yacoub, do you have any comment?

On 04/05, Qingqing Zhuo wrote:
> This reverts commit 9f81b5d40ca2c689334ad8288a4ddca4722a6e10.
> 
> The original commit was found to cause the following two issues
> on sienna cichlid:
> 1. Refresh rate locked during vrrdemo
> 2. Display sticks on flipped landscape mode after changing
>    orientation, and cannot be changed back to regular landscape
> 
> Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c    | 13 -------------
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 18 +++---------------
>  2 files changed, 3 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 0f17984fdea4..6304a49b02fd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -908,19 +908,6 @@ int amdgpu_display_gem_fb_verify_and_init(
>  					 &amdgpu_fb_funcs);
>  	if (ret)
>  		goto err;
> -	/* Verify that the modifier is supported. */
> -	if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
> -				      mode_cmd->modifier[0])) {
> -		struct drm_format_name_buf format_name;
> -		drm_dbg_kms(dev,
> -			    "unsupported pixel format %s / modifier 0x%llx\n",
> -			    drm_get_format_name(mode_cmd->pixel_format,
> -						&format_name),
> -			    mode_cmd->modifier[0]);
> -
> -		ret = -EINVAL;
> -		goto err;
> -	}
>  
>  	ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
>  	if (ret)
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 54ef0f3f37b7..ac6ab35f89b2 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -4299,7 +4299,6 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
>  {
>  	struct amdgpu_device *adev = drm_to_adev(plane->dev);
>  	const struct drm_format_info *info = drm_format_info(format);
> -	int i;
>  
>  	enum dm_micro_swizzle microtile = modifier_gfx9_swizzle_mode(modifier) & 3;
>  
> @@ -4307,22 +4306,11 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
>  		return false;
>  
>  	/*
> -	 * We always have to allow these modifiers:
> -	 * 1. Core DRM checks for LINEAR support if userspace does not provide modifiers.
> -	 * 2. Not passing any modifiers is the same as explicitly passing INVALID.
> +	 * We always have to allow this modifier, because core DRM still
> +	 * checks LINEAR support if userspace does not provide modifers.
>  	 */
> -	if (modifier == DRM_FORMAT_MOD_LINEAR ||
> -	    modifier == DRM_FORMAT_MOD_INVALID) {
> +	if (modifier == DRM_FORMAT_MOD_LINEAR)
>  		return true;
> -	}
> -
> -	/* Check that the modifier is on the list of the plane's supported modifiers. */
> -	for (i = 0; i < plane->modifier_count; i++) {
> -		if (modifier == plane->modifiers[i])
> -			break;
> -	}
> -	if (i == plane->modifier_count)
> -		return false;
>  
>  	/*
>  	 * The arbitrary tiling support for multiplane formats has not been hooked
> -- 
> 2.17.1
> 

-- 
Rodrigo Siqueira
https://siqueira.tech

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane."
  2021-04-05 16:10 ` Rodrigo Siqueira
@ 2021-04-05 16:14   ` Mark Yacoub
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Yacoub @ 2021-04-05 16:14 UTC (permalink / raw)
  To: Rodrigo Siqueira
  Cc: Mark Yacoub, Qingqing Zhuo, amd-gfx list, daniel.wheeler,
	Bas Nieuwenhuizen, Alex Deucher, Nicholas Kazlauskas

Not really, I can't think what this patch breaks yet, I'll need to
investigate further. But if it's found to be the culprit for the bugs,
I'm all for reverting right now and I'll debug further later.

On Mon, Apr 5, 2021 at 12:10 PM Rodrigo Siqueira
<Rodrigo.Siqueira@amd.com> wrote:
>
> In general lgtm.
>
> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
>
> Mark Yacoub, do you have any comment?
>
> On 04/05, Qingqing Zhuo wrote:
> > This reverts commit 9f81b5d40ca2c689334ad8288a4ddca4722a6e10.
> >
> > The original commit was found to cause the following two issues
> > on sienna cichlid:
> > 1. Refresh rate locked during vrrdemo
> > 2. Display sticks on flipped landscape mode after changing
> >    orientation, and cannot be changed back to regular landscape
> >
> > Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c    | 13 -------------
> >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 18 +++---------------
> >  2 files changed, 3 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > index 0f17984fdea4..6304a49b02fd 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > @@ -908,19 +908,6 @@ int amdgpu_display_gem_fb_verify_and_init(
> >                                        &amdgpu_fb_funcs);
> >       if (ret)
> >               goto err;
> > -     /* Verify that the modifier is supported. */
> > -     if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
> > -                                   mode_cmd->modifier[0])) {
> > -             struct drm_format_name_buf format_name;
> > -             drm_dbg_kms(dev,
> > -                         "unsupported pixel format %s / modifier 0x%llx\n",
> > -                         drm_get_format_name(mode_cmd->pixel_format,
> > -                                             &format_name),
> > -                         mode_cmd->modifier[0]);
> > -
> > -             ret = -EINVAL;
> > -             goto err;
> > -     }
> >
> >       ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
> >       if (ret)
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index 54ef0f3f37b7..ac6ab35f89b2 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -4299,7 +4299,6 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
> >  {
> >       struct amdgpu_device *adev = drm_to_adev(plane->dev);
> >       const struct drm_format_info *info = drm_format_info(format);
> > -     int i;
> >
> >       enum dm_micro_swizzle microtile = modifier_gfx9_swizzle_mode(modifier) & 3;
> >
> > @@ -4307,22 +4306,11 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
> >               return false;
> >
> >       /*
> > -      * We always have to allow these modifiers:
> > -      * 1. Core DRM checks for LINEAR support if userspace does not provide modifiers.
> > -      * 2. Not passing any modifiers is the same as explicitly passing INVALID.
> > +      * We always have to allow this modifier, because core DRM still
> > +      * checks LINEAR support if userspace does not provide modifers.
> >        */
> > -     if (modifier == DRM_FORMAT_MOD_LINEAR ||
> > -         modifier == DRM_FORMAT_MOD_INVALID) {
> > +     if (modifier == DRM_FORMAT_MOD_LINEAR)
> >               return true;
> > -     }
> > -
> > -     /* Check that the modifier is on the list of the plane's supported modifiers. */
> > -     for (i = 0; i < plane->modifier_count; i++) {
> > -             if (modifier == plane->modifiers[i])
> > -                     break;
> > -     }
> > -     if (i == plane->modifier_count)
> > -             return false;
> >
> >       /*
> >        * The arbitrary tiling support for multiplane formats has not been hooked
> > --
> > 2.17.1
> >
>
> --
> Rodrigo Siqueira
> https://siqueira.tech
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-04-05 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 15:08 [PATCH] Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane." Qingqing Zhuo
2021-04-05 16:10 ` Rodrigo Siqueira
2021-04-05 16:14   ` Mark Yacoub

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.