mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodrigo Siqueira Jordao <Rodrigo.Siqueira@amd.com>
To: "Joaquín Ignacio Aramendía" <samsagax@gmail.com>, harry.wentland@amd.com
Cc: amd-gfx@lists.freedesktop.org, sunpeng.li@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: Revert logic for plane modifiers
Date: Thu, 20 Oct 2022 08:35:23 -0400	[thread overview]
Message-ID: <ea5d60cd-8d0b-7018-425e-b91e5750a830@amd.com> (raw)
In-Reply-To: <20221019151543.22753-1-samsagax@gmail.com>



On 2022-10-19 11:15, Joaquín Ignacio Aramendía wrote:
> This file was split in commit 5d945cbcd4b16a29d6470a80dfb19738f9a4319f
> ("drm/amd/display: Create a file dedicated to planes") the logic in
> dm_plane_format_mod_supported() function got changed by a switch logic.
> That change broke drm_plane modifiers setting on series 5000 APUs
> (tested on OXP mini AMD 5800U and HP Dev One 5850U PRO)
> leading to Gamescope not working as reproted on GitHub[1]
> 
> To reproduce the issue, enter a TTY and run:
> 
> $ gamescope -- vkcube
> 
> With said commit applied it will abort. This one restores the old logic,
> fixing the issue that affects Gamescope.
> 
> [1](https://github.com/Plagman/gamescope/issues/624>> 
> Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com>
> ---
>   .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 50 +++----------------
>   1 file changed, 8 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> index dfd3be49eac8..81c1fc9468b8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> @@ -1371,6 +1371,8 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
>   	const struct drm_format_info *info = drm_format_info(format);
>   	struct hw_asic_id asic_id = adev->dm.dc->ctx->asic_id;

Hi,

First of all, thanks a lot for this patch.

You can drop asic_id since it is not used anymore.

Thanks
Siqueira

>   
> +	int i;
> +
>   	enum dm_micro_swizzle microtile = modifier_gfx9_swizzle_mode(modifier) & 3;
>   
>   	if (!info)
> @@ -1386,49 +1388,13 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
>   		return true;
>   	}
>   
> -	/* check if swizzle mode is supported by this version of DCN */
> -	switch (asic_id.chip_family) {
> -	case FAMILY_SI:
> -	case FAMILY_CI:
> -	case FAMILY_KV:
> -	case FAMILY_CZ:
> -	case FAMILY_VI:
> -		/* asics before AI does not have modifier support */
> -		return false;
> -	case FAMILY_AI:
> -	case FAMILY_RV:
> -	case FAMILY_NV:
> -	case FAMILY_VGH:
> -	case FAMILY_YELLOW_CARP:
> -	case AMDGPU_FAMILY_GC_10_3_6:
> -	case AMDGPU_FAMILY_GC_10_3_7:
> -		switch (AMD_FMT_MOD_GET(TILE, modifier)) {
> -		case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_D_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_S_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_D:
> -			return true;
> -		default:
> -			return false;
> -		}
> -		break;
> -	case AMDGPU_FAMILY_GC_11_0_0:
> -	case AMDGPU_FAMILY_GC_11_0_1:
> -		switch (AMD_FMT_MOD_GET(TILE, modifier)) {
> -		case AMD_FMT_MOD_TILE_GFX11_256K_R_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_D_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_S_X:
> -		case AMD_FMT_MOD_TILE_GFX9_64K_D:
> -			return true;
> -		default:
> -			return false;
> -		}
> -		break;
> -	default:
> -		ASSERT(0); /* Unknown asic */
> -		break;
> +	/* 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;
>   
>   	/*
>   	 * For D swizzle the canonical modifier depends on the bpp, so check


  reply	other threads:[~2022-10-20 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 15:15 Joaquín Ignacio Aramendía
2022-10-20 12:35 ` Rodrigo Siqueira Jordao [this message]
2022-10-20 20:53   ` Joaquín Ignacio Aramendía
2022-10-23 23:05     ` Bas Nieuwenhuizen
2022-10-24  3:08       ` [PATCH v2] " Joaquín Ignacio Aramendía
2022-10-24 11:33       ` Joaquín Ignacio Aramendía
2022-10-24 17:13         ` Alex Deucher

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=ea5d60cd-8d0b-7018-425e-b91e5750a830@amd.com \
    --to=rodrigo.siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samsagax@gmail.com \
    --cc=sunpeng.li@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®