* [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit
@ 2023-11-06 7:37 oushixiong
2023-11-06 10:32 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: oushixiong @ 2023-11-06 7:37 UTC (permalink / raw)
To: Maarten Lankhorst
Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
dri-devel, linux-kernel, Shixiong Ou
From: Shixiong Ou <oushixiong@kylinos.cn>
Calling stall_checks() before allocating drm_crtc_commit not after that.
Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
---
drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2444fc33dd7c..94ea878b240d 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2283,6 +2283,10 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
funcs = state->dev->mode_config.helper_private;
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+ ret = stall_checks(crtc, nonblock);
+ if (ret)
+ return ret;
+
commit = kzalloc(sizeof(*commit), GFP_KERNEL);
if (!commit)
return -ENOMEM;
@@ -2291,10 +2295,6 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
new_crtc_state->commit = commit;
- ret = stall_checks(crtc, nonblock);
- if (ret)
- return ret;
-
/*
* Drivers only send out events when at least either current or
* new CRTC state is active. Complete right away if everything
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit
2023-11-06 7:37 [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit oushixiong
@ 2023-11-06 10:32 ` Maxime Ripard
2023-11-06 13:26 ` 回复: " oushixiong
0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2023-11-06 10:32 UTC (permalink / raw)
To: oushixiong
Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter,
dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi,
On Mon, Nov 06, 2023 at 03:37:42PM +0800, oushixiong wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> Calling stall_checks() before allocating drm_crtc_commit not after that.
>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
Generally speaking, we need much more context than that.
What bug did you encounter that makes you say that it should be moved?
How can we reproduce it? How long has that issue been in the code? What
makes you say that this is the right solution?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复: [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit
2023-11-06 10:32 ` Maxime Ripard
@ 2023-11-06 13:26 ` oushixiong
2023-11-06 15:37 ` 'Maxime Ripard'
0 siblings, 1 reply; 4+ messages in thread
From: oushixiong @ 2023-11-06 13:26 UTC (permalink / raw)
To: 'Maxime Ripard'
Cc: 'Maarten Lankhorst', 'Thomas Zimmermann',
'David Airlie', 'Daniel Vetter', dri-devel,
linux-kernel
Hi,
I think it will cause memory leaks if too many nonblock commit works return
-EBUSY.
You can try to send large number of nonblock commits by
drmModeAtomicCommit().
-----邮件原件-----
发件人: Maxime Ripard <mripard@kernel.org>
发送时间: 2023年11月6日 18:33
收件人: oushixiong <oushixiong@kylinos.cn>
抄送: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Thomas
Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@gmail.com>; Daniel
Vetter <daniel@ffwll.ch>; dri-devel@lists.freedesktop.org;
linux-kernel@vger.kernel.org
主题: Re: [PATCH] drm/atomic-helper: Call stall_checks() before allocate
drm_crtc_commit
Hi,
On Mon, Nov 06, 2023 at 03:37:42PM +0800, oushixiong wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> Calling stall_checks() before allocating drm_crtc_commit not after that.
>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
Generally speaking, we need much more context than that.
What bug did you encounter that makes you say that it should be moved?
How can we reproduce it? How long has that issue been in the code? What
makes you say that this is the right solution?
Maxime
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 回复: [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit
2023-11-06 13:26 ` 回复: " oushixiong
@ 2023-11-06 15:37 ` 'Maxime Ripard'
0 siblings, 0 replies; 4+ messages in thread
From: 'Maxime Ripard' @ 2023-11-06 15:37 UTC (permalink / raw)
To: oushixiong
Cc: 'Maarten Lankhorst', 'Thomas Zimmermann',
'David Airlie', 'Daniel Vetter', dri-devel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
Hi,
On Mon, Nov 06, 2023 at 09:26:15PM +0800, oushixiong@kylinos.cn wrote:
> I think it will cause memory leaks if too many nonblock commit works return
> -EBUSY.
Do you *think* or are you sure?
If you are sure, then please write down everything I mentioned earlier
in the commit log and resend the patch.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-06 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06 7:37 [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit oushixiong
2023-11-06 10:32 ` Maxime Ripard
2023-11-06 13:26 ` 回复: " oushixiong
2023-11-06 15:37 ` 'Maxime Ripard'
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox