All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH] drm/amd/display: Fix pageflipping for XOrg in Linux 5.11+
Date: Thu, 31 Dec 2020 21:51:36 +0100	[thread overview]
Message-ID: <20201231205136.11422-1-mario.kleiner.de@gmail.com> (raw)

Commit 816853f9dc4057b6c7ee3c45ca9bd5905 ("drm/amd/display: Set new
format info for converted metadata.") may fix the getfb2 ioctl, but
in exchange it completely breaks all pageflipping for classic user
space, e.g., XOrg, as tested with both amdgpu-ddx and modesetting-ddx.
This leads to massive tearing, broken visual timing/timestamping etc.

Reason is that the classic pageflip ioctl doesn't allow a fb format
change during flip, and at least X uses classic pageflip ioctl and no
atomic modesetting api at all.

As one attempted workaround, only set the new format info for converted
metadata if the calling client isn't X. Not sure if this is the best
way, or if a better check would not be "not all atomic clients" or
similar? In any case it works for XOrg X-Server. Checking the ddx
code of intel-ddx/modesetting-ddx/amdgpu-ddx as well as grepping over
Mesa doesn't show any users of the getfb2 ioctl(), so the need for this
format info assignment seems to be more the exception than the rule?

Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index f764803c53a4..cb414b3d327a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -828,7 +828,8 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
 			if (!format_info)
 				return -EINVAL;
 
-			afb->base.format = format_info;
+			if (afb->base.comm[0] != 'X')
+				afb->base.format = format_info;
 		}
 	}
 
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	mario.kleiner.de@gmail.com,
	Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Subject: [PATCH] drm/amd/display: Fix pageflipping for XOrg in Linux 5.11+
Date: Thu, 31 Dec 2020 21:51:36 +0100	[thread overview]
Message-ID: <20201231205136.11422-1-mario.kleiner.de@gmail.com> (raw)

Commit 816853f9dc4057b6c7ee3c45ca9bd5905 ("drm/amd/display: Set new
format info for converted metadata.") may fix the getfb2 ioctl, but
in exchange it completely breaks all pageflipping for classic user
space, e.g., XOrg, as tested with both amdgpu-ddx and modesetting-ddx.
This leads to massive tearing, broken visual timing/timestamping etc.

Reason is that the classic pageflip ioctl doesn't allow a fb format
change during flip, and at least X uses classic pageflip ioctl and no
atomic modesetting api at all.

As one attempted workaround, only set the new format info for converted
metadata if the calling client isn't X. Not sure if this is the best
way, or if a better check would not be "not all atomic clients" or
similar? In any case it works for XOrg X-Server. Checking the ddx
code of intel-ddx/modesetting-ddx/amdgpu-ddx as well as grepping over
Mesa doesn't show any users of the getfb2 ioctl(), so the need for this
format info assignment seems to be more the exception than the rule?

Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index f764803c53a4..cb414b3d327a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -828,7 +828,8 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
 			if (!format_info)
 				return -EINVAL;
 
-			afb->base.format = format_info;
+			if (afb->base.comm[0] != 'X')
+				afb->base.format = format_info;
 		}
 	}
 
-- 
2.25.1

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

             reply	other threads:[~2020-12-31 20:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 20:51 Mario Kleiner [this message]
2020-12-31 20:51 ` [PATCH] drm/amd/display: Fix pageflipping for XOrg in Linux 5.11+ Mario Kleiner
2021-01-02 14:05 ` Bas Nieuwenhuizen
2021-01-02 14:05   ` Bas Nieuwenhuizen
2021-01-02 15:05   ` Mario Kleiner
2021-01-02 15:05     ` Mario Kleiner
2021-01-02 15:49     ` Bas Nieuwenhuizen
2021-01-02 15:49       ` Bas Nieuwenhuizen
2021-01-02 18:34       ` Mario Kleiner
2021-01-02 18:34         ` Mario Kleiner
2021-01-02 18:50         ` Ilia Mirkin
2021-01-02 18:50           ` Ilia Mirkin
2021-01-02 19:40           ` Mario Kleiner
2021-01-02 19:40             ` Mario Kleiner

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=20201231205136.11422-1-mario.kleiner.de@gmail.com \
    --to=mario.kleiner.de@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /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.