drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
Subsystems (2)
PATCH 1/1 drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the drm_crtc_mask and indicate the stolen CRTC as an affected CRTC in atomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.
To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic.c +4 -2
@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }/* * For commits that allow modesets drivers can add other CRTCs to the
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Can that also be asserted somehow, or does this already do that?
Thanks,
pq
Quoted 18 lines
Cc Ville Syrjälä <[email protected]>Cc Simon Ser <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Daniel Stone <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +0
-0@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } }
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 10 lines
drivers/gpu/drm/drm_atomic.c +4
-2-for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }/* * For commits that allow modesets drivers can add other CRTCs to the
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 13 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Quoted 7 lines
Hi,
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing atomic_check_only() here, the stolen crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 2 lines
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
Manasi
Quoted 31 lines
Thanks,
pqQuoted 26 lines
Cc Ville Syrjälä <[email protected]>Cc Simon Ser <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Daniel Stone <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }
Quoted 3 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolen
But the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 10 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 2 lines
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pq
Quoted 39 lines
Manasi
Quoted 34 lines
Thanks,
pqQuoted 28 lines
Cc Ville Syrjälä <[email protected]>Cc Simon Ser <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Daniel Stone <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }/* * For commits that allow modesets drivers can add other CRTCs to the
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 25 lines · Pekka Paalanen
Quoted 22 lines · Manasi
Quoted 20 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Quoted 4 lines
Quoted 1 line
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
Manasi
Quoted 15 lines
Quoted 11 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 2 lines
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 48 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 39 lines
Manasi
Quoted 34 lines
Thanks,
pqQuoted 28 lines
Cc Ville Syrjälä <[email protected]>Cc Simon Ser <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Daniel Stone <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }/* * For commits that allow modesets drivers can add other CRTCs to the
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 31 lines · Manasi
Quoted 25 lines · Pekka Paalanen
Quoted 22 lines · Manasi
Quoted 20 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Quoted 4 lines
Quoted 1 line
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Quoted 3 lines
Quoted 3 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pq
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that drm_atomic_uapi.c makes sure we can't send out events for stuff that userspace didn't ask for. -Daniel
Quoted 34 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Daniel Vetter
Quoted 8 lines · Pekka Paalanen
Quoted 6 lines · Manasi
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Yeah. We can _never_ generate externally-visible completion events. We can later fail to enable the stolen CRTC - because trying to enable new things can fail for any reason whatsoever - but we can't generate spurious completion events, as doing so falls into the uncanny valley.
If the kernel is doing clever things behind userspace's back - such as stealing planes or CRTCs - then userspace can never know about it, apart from failing to enable those resources later. The kernel can either never do anything clever (and make userspace bind them both together), or be extremely clever (by hiding the entire details from userspace), but it cannot choose the halfway house of doing clever things behind userspace's back (such as stealing new CRTCs) whilst also exposing all those details to userspace (such as delivering spurious completion events for resources userspace never requested to be programmed).
Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 36 lines · Daniel Stone
Quoted 10 lines · Daniel Vetter
Quoted 8 lines · Pekka Paalanen
Quoted 6 lines · Manasi
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Yeah. We can _never_ generate externally-visible completion events. We can later fail to enable the stolen CRTC - because trying to enable new things can fail for any reason whatsoever - but we can't generate spurious completion events, as doing so falls into the uncanny valley.
If the kernel is doing clever things behind userspace's back - such as stealing planes or CRTCs - then userspace can never know about it, apart from failing to enable those resources later. The kernel can either never do anything clever (and make userspace bind them both together), or be extremely clever (by hiding the entire details from userspace), but it cannot choose the halfway house of doing clever things behind userspace's back (such as stealing new CRTCs) whilst also exposing all those details to userspace (such as delivering spurious completion events for resources userspace never requested to be programmed).
Quoted 2 lines
Cheers,
Daniel
Yes I agree, in this case there will not be any completion events associated with the stolen slave CRTC since that does not get used for the output. The completion events will only occur on the bigjoiner master crtc.
But I guess like Danvet suggested we need a separate mask for keeping track of active and enabled crtcs before and after atomic check. But need to look at how this will fix the affected crtc not matching warning.
Manasi
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
So basically we see this warning only in case of bigjoiner when drm_atomic_check gets called without setting the state->allow_modeset flag.
So do you think that in i915, in intel_atomic_check_bigjoiner() we should only steal the crtc when allow_modeset flag is set in state?
If we add this check there then the affected crtc wont count the slave crtc and we wont get this warning.
Ville, Danvet?
Manasi
Quoted 119 lines · Daniel Vetter
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that
drm_atomic_uapi.cmakes sure we can't send out events for stuff that userspace didn't ask for. -DanielQuoted 28 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }
Quoted 13 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.
Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?
No. If you fully read drm_atomic_check_only() you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.
So you're barking up the wrong tree here. The problem I think is that you're just computing requested_crtcs wrong.
Quoted 145 lines
If we add this check there then the affected crtc wont count the slave crtc and we wont get this warning.
Ville, Danvet?
Manasi
Quoted 119 lines · Daniel Vetter
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that
drm_atomic_uapi.cmakes sure we can't send out events for stuff that userspace didn't ask for. -DanielQuoted 28 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }Quoted 13 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?
Quoted 6 lines
No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.
So here in this case, requested CRTC = 0x1 since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as 0x3 and hence the mismatch.
Now what is not clear to me is that if a full modeset was not required why did i915 still steal that slave CRTC?
Manasi
Quoted 138 lines
Quoted 138 lines
If we add this check there then the affected crtc wont count the slave crtc and we wont get this warning.
Ville, Danvet?
Manasi
Quoted 128 lines · Daniel Vetter
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that
drm_atomic_uapi.cmakes sure we can't send out events for stuff that userspace didn't ask for. -DanielQuoted 34 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines
Quoted 8 lines
Quoted 4 lines
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.
Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.
Hmm. How can it be 0x3 if we filtered out the uapi.enable==false case?
Quoted 155 lines
Now what is not clear to me is that if a full modeset was not required why did i915 still steal that slave CRTC?
Manasi
Quoted 150 lines
Quoted 146 lines
If we add this check there then the affected crtc wont count the slave crtc and we wont get this warning.
Ville, Danvet?
Manasi
Quoted 119 lines · Daniel Vetter
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that
drm_atomic_uapi.cmakes sure we can't send out events for stuff that userspace didn't ask for. -DanielQuoted 28 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }Quoted 13 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 17 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only 0x1 since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc = 0x1
If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
Manasi
Quoted 147 lines
Quoted 147 lines
Now what is not clear to me is that if a full modeset was not required why did i915 still steal that slave CRTC?
Manasi
Quoted 142 lines
Quoted 142 lines
If we add this check there then the affected crtc wont count the slave crtc and we wont get this warning.
Ville, Danvet?
Manasi
Quoted 132 lines · Daniel Vetter
Quoted 35 lines · Pekka Paalanen
Quoted 31 lines · Manasi
Quoted 29 lines · Pekka Paalanen
Quoted 16 lines · Manasi
Quoted 15 lines · Pekka Paalanen
Quoted 9 lines · On Tue, 2 Mar 2021 12:41:32 -0800 Manasi Navare <[email protected]>…
In case of a modeset where a mode gets split across mutiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the
drm_crtc_maskand indicate the stolen CRTC as an affected CRTC inatomic_check_only().
This triggers a warning since affected CRTCs doent match requested CRTC.To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode.
Hi,
Quoted 7 lines
Quoted 5 lines
I think that makes sense to me. Stealing CRTCs that are not currently used by the userspace (display server) should be ok, as long as that is completely invisible to userspace: meaning that it does not cause userspace to unexpectedly e.g. receive or miss per-crtc atomic completion events.
Yes since we are only doing
atomic_check_only()here, the stolenBut the real not-test-only commit will follow if this test-only commit succeeds, and keeping the guarantees for the real commit are important.
Quoted 7 lines
Quoted 7 lines
Hmm well after the actual real commit, since the second crtc is stolen even though it is not being used for the display output, it is used for joiner so the uapi.enable will be true after the real commit.
so actually the assertion would fail in this case.
@Ville @Danvet any suggestions here in that case?
That is very bad. We can't frob uapi state like that. I think that calls for even more checks to make sure kms drivers who try to play clever games don't get it wrong, so we probably need to check uapi enable and active state in another mask before/after ->atomic_check too. Or something like that.
Quoted 24 lines
Hi,
that is not what I was talking about, but sounds like you found a different problem. It seems like the problem you are talking about would be guaranteed to be hit if bigjoiner was used. Have you not tested this?
However, I was talking about the real commit itself, not what happens on commits after it, see below.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
crtc is completely invisible to the userspace and hence that is indicated by uapi.enable which is not true for this stolen crtc. However if allow modeset flag set, then it will do a full modeset and indicate the uapi.enable for this stolen crtc as well since that cannot be used for other modeset requested by userspace.
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Can that also be asserted somehow, or does this already do that?
Not clear what you want the assertion for? Could you elaborate
As assertion that when the real atomic commit happens and then completion events are fired, they match exactly the affected crtcs mask.
Quoted 7 lines
This is my concern and a question, although like I say below, only tangential to this patch.
However, as this patch aims to allow bigjoiner usage, naturally the question will arise whether the completion events then match what userspace expects or not. Userspace does not expect completion events referring to the stolen CRTCs.
Yeah we also must make sure that we don't send out events for these additional crtc in bigjoiner usage. Sounds like igt testing didn't catch this, I think we need a lot more igts here to make sure all these surprises don't happen.
Plus maybe triple-checking that
drm_atomic_uapi.cmakes sure we can't send out events for stuff that userspace didn't ask for. -DanielQuoted 34 lines
Quoted 4 lines
Quoted 4 lines
I understand this may be off-topic for this particular patch, but since we are discussing the topic, such checks would be really nice. I'm curious if such checks already exist.
Thanks,
pqQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_atomic.c +4
-2@@ -1358,8 +1358,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state) } } -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) - affected_crtc |=drm_crtc_mask (crtc); +for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->enable) + affected_crtc |=drm_crtc_mask (crtc); + }Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c int drm_atomic_check_only(struct drm_atomic_state *state) · line 1367
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +0
-0/* * For commits that allow modesets drivers can add other CRTCs to the _______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 28 lines · Manasi
Quoted 17 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?
Quoted 6 lines
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only
0x1since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc =0x1If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
I think you still need to fix the requested_crtcs calculation.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Manasi
Quoted 26 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?
Quoted 8 lines
Quoted 6 lines
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only
0x1since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc =0x1If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
I think you still need to fix the
requested_crtcscalculation.
We calculate requested crtc at the beginning :for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
requested_crtc |= drm_crtc_mask(crtc);
Are you suggesting adding this to after:
if (config->funcs->atomic_check) {
ret = config->funcs->atomic_check(state->dev, state);
if (ret) {
DRM_DEBUG_ATOMIC("atomic driver check for %p failed: %d\n",
state, ret);
return ret;
}
requested_crtc |= drm_crtc_mask(crtc); // Here it will have requested crtc = 0x11
}in this case here the state should already have master crtc 0 and slave crtc 1 and that requested crtc should already be 0x11
Then in that case we dont need any special check for calculating affected crtc, that also will be 0x11
Manasi
Quoted 4 lines
Signature · 3 lines
-- Ville Syrjälä Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 55 lines · Manasi
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Manasi
Quoted 26 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?Quoted 8 lines
Quoted 6 lines
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only
0x1since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc =0x1If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
I think you still need to fix the
requested_crtcscalculation.We calculate requested crtc at the beginning :
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)requested_crtc |= drm_crtc_mask(crtc);Are you suggesting adding this to after:
if (config->funcs->atomic_check) { ret = config->funcs->atomic_check(state->dev, state); if (ret) { DRM_DEBUG_ATOMIC("atomic driver check for %p failed: %d\n", state, ret); return ret; } requested_crtc |= drm_crtc_mask(crtc); // Here it will have requested crtc = 0x11 }
Quoted 4 lines
in this case here the state should already have master crtc 0 and slave crtc 1 and that requested crtc should already be
0x11Then in that case we dont need any special check for calculating affected crtc, that also will be
0x11
All I'm saying is that you're currently calculating requested_crtcs and affected_crtcs differently. So I'm not at all surprised that they might not match.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 56 lines · Ville Syrjälä
Quoted 55 lines · Manasi
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Manasi
Quoted 26 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?Quoted 8 lines
Quoted 6 lines
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only
0x1since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc =0x1If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
I think you still need to fix the
requested_crtcscalculation.We calculate requested crtc at the beginning :
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)requested_crtc |= drm_crtc_mask(crtc);Are you suggesting adding this to after:
if (config->funcs->atomic_check) { ret = config->funcs->atomic_check(state->dev, state); if (ret) { DRM_DEBUG_ATOMIC("atomic driver check for %p failed: %d\n", state, ret); return ret; } requested_crtc |= drm_crtc_mask(crtc); // Here it will have requested crtc = 0x11 }
Quoted 9 lines
Quoted 4 lines
in this case here the state should already have master crtc 0 and slave crtc 1 and that requested crtc should already be
0x11Then in that case we dont need any special check for calculating affected crtc, that also will be
0x11All I'm saying is that you're currently calculating
requested_crtcsandaffected_crtcsdifferently. So I'm not at all surprised that they might not match.
I dont get your point yet.
requested crtc is calculated before the atomic check call and we dont check for crtc uapi.enable to be true. And hence requested crtc = CRTC 0 = 0x2
After I added the check in this patch where affected crtc will include only the crtcs that have uapi.enable = true then it perfectly matches the requested crtc and return 0x2 but without this check when the calculation of requested and affected crtc is the same is where we see the affected crtc = CRTC 0 and 1 = 0x3
So when the calculation is different infcat we dont see the mismatch
What is your point here?
Manasi
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 74 lines · Manasi
Quoted 56 lines · Ville Syrjälä
Quoted 55 lines · Manasi
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Manasi
Quoted 26 lines · Ville Syrjälä
Quoted 16 lines · Manasi
Quoted 15 lines · Ville Syrjälä
Quoted 2 lines · Manasi
So basically we see this warning only in case of bigjoiner when
drm_atomic_checkgets called without setting thestate->allow_modesetflag.Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious.
Quoted 3 lines
So do you think that in i915, in
intel_atomic_check_bigjoiner()we should only steal the crtc whenallow_modesetflag is set in state?No. If you fully read
drm_atomic_check_only()you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN.Quoted 6 lines
Quoted 2 lines
So you're barking up the wrong tree here. The problem I think is that you're just computing
requested_crtcswrong.So here in this case, requested CRTC =
0x1since it requests modeset on CRTC 0 Now in teh atomic check, it steals the slave CRTC 1 and hence affected CRTC comes out as0x3and hence the mismatch.Hmm. How can it be
0x3if we filtered out the uapi.enable==false case?Quoted 8 lines
Quoted 6 lines
Yes if I add that condition like in this patch then it correctly calculates the affected crtc bitmask as only
0x1since it doesnt include the slave crtc. So with this patch, requested crtc = 0x 1, affected crtc =0x1If this looks good then this fixes our bigjoiner warnings. Does this patch look good to you as is then?
I think you still need to fix the
requested_crtcscalculation.We calculate requested crtc at the beginning :
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)requested_crtc |= drm_crtc_mask(crtc);Are you suggesting adding this to after:
if (config->funcs->atomic_check) { ret = config->funcs->atomic_check(state->dev, state); if (ret) { DRM_DEBUG_ATOMIC("atomic driver check for %p failed: %d\n", state, ret); return ret; } requested_crtc |= drm_crtc_mask(crtc); // Here it will have requested crtc = 0x11 }Quoted 9 lines
Quoted 4 lines
in this case here the state should already have master crtc 0 and slave crtc 1 and that requested crtc should already be
0x11Then in that case we dont need any special check for calculating affected crtc, that also will be
0x11All I'm saying is that you're currently calculating
requested_crtcsandaffected_crtcsdifferently. So I'm not at all surprised that they might not match.I dont get your point yet.
requested crtc is calculated before the atomic check call and we dont check for crtc uapi.enable to be true. And hence requested crtc = CRTC 0 =0x2
After I added the check in this patch where affected crtc will include only the crtcs that have uapi.enable = true then it perfectly matches the requested crtc and return0x2but without this check when the calculation of requested and affected crtc is the same is where we see the affected crtc = CRTC 0 and 1 =0x3
Quoted 3 lines
So when the calculation is different infcat we dont see the mismatch
What is your point here?
Try doing an atomic commit wiht both crtcs already added in by userspace. I think that will still WARN.
Signature · 2 lines
Ville Syrjälä Intel
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
In reply to Manasi Navare== Series Details ==
== Series Details ==
Series: drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
URL : https://patchwork.freedesktop.org/series/87555/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
bf128dc47afb drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
-:10: WARNING:TYPO_SPELLING: 'mutiple' may be misspelled - perhaps 'multiple'?
#10:
In case of a modeset where a mode gets split across mutiple CRTCs
^^^^^^^-:12: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #12:
the affected CRTCs based on the drm_crtc_mask and indicate the stolen CRTC as
total: 0 errors, 2 warnings, 0 checks, 12 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
In reply to Manasi Navare== Series Details ==
== Series Details ==
Series: drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
URL : https://patchwork.freedesktop.org/series/87555/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9824 -> Patchwork_19747
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_19747 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_19747, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19747/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_19747:
### IGT changes ###
#### Possible regressions ####
* igt@gem_wait@busy@all:
- fi-bsw-nick: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9824/fi-bsw-nick/igt@gem_wait@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19747/fi-bsw-nick/igt@gem_wait@[email protected]
#### Warnings ####
* igt@i915_pm_rpm@module-reload:
- fi-glk-dsi: [DMESG-WARN][3] ([i915#1982]) -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9824/fi-glk-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19747/fi-glk-dsi/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_19747 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [FAIL][5] ([i915#1372]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9824/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19747/fi-kbl-7500u/igt@[email protected]
[i915#1372]: https://gitlab.freedesktop.org/drm/intel/issues/1372
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
Participating hosts (42 -> 37)
------------------------------
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9824 -> Patchwork_19747
CI-20190529: 20190529
CI_DRM_9824: 6b21aa2a30637b56282297d09a9fbfd1954cc7b0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6020: 8382d9e87bba39ecc6fa879b2491e28c7fb2e3c7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19747: bf128dc47afbdf9d6d0d1760e3d45098c1f52ee5 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
bf128dc47afb drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19747/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx