All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix BUG_ON during CRTC atomic check update
@ 2018-05-28 15:06 sunpeng.li-5C7GfCeVMHo
       [not found] ` <1527520003-1224-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: sunpeng.li-5C7GfCeVMHo @ 2018-05-28 15:06 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, Leo (Sunpeng) Li,
	michel-otUistvHUpPR7s880joybQ, harry.wentland-5C7GfCeVMHo

From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>

For cases where the CRTC is inactive (DPMS off), where a modeset is not
required, yet the CRTC is still in the atomic state, we should not
attempt to update anything on it.

Previously, we were relying on the modereset_required() helper to check
the above condition. However, the function returns false immediatly if
a modeset is not required, ignoring the CRTC's enable/active state
flags. The correct way to filter is by looking at these flags instead.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 72f9a46..16d0bf7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4823,15 +4823,16 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		 * We want to do dc stream updates that do not require a
 		 * full modeset below.
 		 */
-		if (!enable || !aconnector || modereset_required(new_crtc_state))
+		if (!(enable && aconnector && new_crtc_state->enable &&
+		      new_crtc_state->active))
 			continue;
 		/*
 		 * Given above conditions, the dc state cannot be NULL because:
-		 * 1. We're attempting to enable a CRTC. Which has a...
-		 * 2. Valid connector attached, and
-		 * 3. User does not want to reset it (disable or mark inactive,
-		 *    which can happen on a CRTC that's already disabled).
-		 * => It currently exists.
+		 * 1. We're in the process of enabling CRTCs (just been added
+		 *    to the dc context, or already is on the context)
+		 * 2. Has a valid connector attached, and
+		 * 3. Is currently active and enabled.
+		 * => The dc stream state currently exists.
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
-- 
2.7.4

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

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

* Re: [PATCH] drm/amd/display: Fix BUG_ON during CRTC atomic check update
       [not found] ` <1527520003-1224-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-28 15:20   ` Michel Dänzer
       [not found]     ` <7be152e0-18c5-22f6-b80a-87e856effff9-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-05-28 18:00   ` [PATCH v2] " sunpeng.li-5C7GfCeVMHo
  2018-05-29 13:51   ` [PATCH v3] " sunpeng.li-5C7GfCeVMHo
  2 siblings, 1 reply; 6+ messages in thread
From: Michel Dänzer @ 2018-05-28 15:20 UTC (permalink / raw)
  To: sunpeng.li-5C7GfCeVMHo
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, harry.wentland-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-05-28 05:06 PM, sunpeng.li@amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
> 
> For cases where the CRTC is inactive (DPMS off), where a modeset is not
> required, yet the CRTC is still in the atomic state, we should not
> attempt to update anything on it.
> 
> Previously, we were relying on the modereset_required() helper to check

This should say "modeset_required()", right?


> the above condition. However, the function returns false immediatly if

"immediately" (missing "e")

> a modeset is not required, ignoring the CRTC's enable/active state
> flags. The correct way to filter is by looking at these flags instead.
> 
> Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Please add the following tags to the commit log:

Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"
Tested-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: Fix BUG_ON during CRTC atomic check update
       [not found]     ` <7be152e0-18c5-22f6-b80a-87e856effff9-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-05-28 16:05       ` Leo Li
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Li @ 2018-05-28 16:05 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, harry.wentland-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



On 2018-05-28 11:20 AM, Michel Dänzer wrote:
> On 2018-05-28 05:06 PM, sunpeng.li@amd.com wrote:
>> From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
>>
>> For cases where the CRTC is inactive (DPMS off), where a modeset is not
>> required, yet the CRTC is still in the atomic state, we should not
>> attempt to update anything on it.
>>
>> Previously, we were relying on the modereset_required() helper to check
> 
> This should say "modeset_required()", right?
> 

modereset_required() here refers to an amdgpu_dm specific helper, which 
was previously being used. It essentially returns true if the CRTC is 
*being* disabled or made inactive, not if it's currently disabled or 
inactive.

> 
>> the above condition. However, the function returns false immediatly if
> 
> "immediately" (missing "e") >
>> a modeset is not required, ignoring the CRTC's enable/active state
>> flags. The correct way to filter is by looking at these flags instead.
>>
>> Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
>> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> Please add the following tags to the commit log:
> 
> Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"
> Tested-by: Michel Dänzer <michel.daenzer@amd.com>
> 

Will do.

Leo

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

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

* [PATCH v2] drm/amd/display: Fix BUG_ON during CRTC atomic check update
       [not found] ` <1527520003-1224-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  2018-05-28 15:20   ` Michel Dänzer
@ 2018-05-28 18:00   ` sunpeng.li-5C7GfCeVMHo
       [not found]     ` <1527530423-14855-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  2018-05-29 13:51   ` [PATCH v3] " sunpeng.li-5C7GfCeVMHo
  2 siblings, 1 reply; 6+ messages in thread
From: sunpeng.li-5C7GfCeVMHo @ 2018-05-28 18:00 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, Leo (Sunpeng) Li,
	michel-otUistvHUpPR7s880joybQ, harry.wentland-5C7GfCeVMHo

From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>

For cases where the CRTC is inactive (DPMS off), where a modeset is not
required, yet the CRTC is still in the atomic state, we should not
attempt to update anything on it.

Previously, we were relying on the modereset_required() helper to check
the above condition. However, the function returns false immediately if
a modeset is not required, ignoring the CRTC's enable/active state
flags. The correct way to filter is by looking at these flags instead.

Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
---

v2: Fix commit message typo (immediatly -> immediately)
    Add Fixes line and Michel's Tested-by

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 72f9a46..16d0bf7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4823,15 +4823,16 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		 * We want to do dc stream updates that do not require a
 		 * full modeset below.
 		 */
-		if (!enable || !aconnector || modereset_required(new_crtc_state))
+		if (!(enable && aconnector && new_crtc_state->enable &&
+		      new_crtc_state->active))
 			continue;
 		/*
 		 * Given above conditions, the dc state cannot be NULL because:
-		 * 1. We're attempting to enable a CRTC. Which has a...
-		 * 2. Valid connector attached, and
-		 * 3. User does not want to reset it (disable or mark inactive,
-		 *    which can happen on a CRTC that's already disabled).
-		 * => It currently exists.
+		 * 1. We're in the process of enabling CRTCs (just been added
+		 *    to the dc context, or already is on the context)
+		 * 2. Has a valid connector attached, and
+		 * 3. Is currently active and enabled.
+		 * => The dc stream state currently exists.
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
-- 
2.7.4

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

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

* Re: [PATCH v2] drm/amd/display: Fix BUG_ON during CRTC atomic check update
       [not found]     ` <1527530423-14855-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-29  7:55       ` Michel Dänzer
  0 siblings, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2018-05-29  7:55 UTC (permalink / raw)
  To: sunpeng.li-5C7GfCeVMHo
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, harry.wentland-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-05-28 08:00 PM, sunpeng.li@amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
> 
> For cases where the CRTC is inactive (DPMS off), where a modeset is not
> required, yet the CRTC is still in the atomic state, we should not
> attempt to update anything on it.
> 
> Previously, we were relying on the modereset_required() helper to check
> the above condition. However, the function returns false immediately if
> a modeset is not required, ignoring the CRTC's enable/active state
> flags. The correct way to filter is by looking at these flags instead.
> 
> Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"

Might also want to add

Bugzilla: https://bugs.freedesktop.org/106194

for good measure.


> Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> Tested-by: Michel Dänzer <michel.daenzer@amd.com>
> ---
> 
> v2: Fix commit message typo (immediatly -> immediately)
>     Add Fixes line and Michel's Tested-by

Other than that looks good, thanks!


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH v3] drm/amd/display: Fix BUG_ON during CRTC atomic check update
       [not found] ` <1527520003-1224-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
  2018-05-28 15:20   ` Michel Dänzer
  2018-05-28 18:00   ` [PATCH v2] " sunpeng.li-5C7GfCeVMHo
@ 2018-05-29 13:51   ` sunpeng.li-5C7GfCeVMHo
  2 siblings, 0 replies; 6+ messages in thread
From: sunpeng.li-5C7GfCeVMHo @ 2018-05-29 13:51 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, Leo (Sunpeng) Li,
	michel-otUistvHUpPR7s880joybQ, harry.wentland-5C7GfCeVMHo

From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>

For cases where the CRTC is inactive (DPMS off), where a modeset is not
required, yet the CRTC is still in the atomic state, we should not
attempt to update anything on it.

Previously, we were relying on the modereset_required() helper to check
the above condition. However, the function returns false immediately if
a modeset is not required, ignoring the CRTC's enable/active state
flags. The correct way to filter is by looking at these flags instead.

Fixes: e277adc5a06c "drm/amd/display: Hookup color management functions"
Bugzilla: https://bugs.freedesktop.org/106194

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
---

v2: Fix commit message typo (immediatly -> immediately)
    Add Fixes line and Michel's Tested-by
v3: Add Bugzilla link

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 72f9a46..16d0bf7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4823,15 +4823,16 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm,
 		 * We want to do dc stream updates that do not require a
 		 * full modeset below.
 		 */
-		if (!enable || !aconnector || modereset_required(new_crtc_state))
+		if (!(enable && aconnector && new_crtc_state->enable &&
+		      new_crtc_state->active))
 			continue;
 		/*
 		 * Given above conditions, the dc state cannot be NULL because:
-		 * 1. We're attempting to enable a CRTC. Which has a...
-		 * 2. Valid connector attached, and
-		 * 3. User does not want to reset it (disable or mark inactive,
-		 *    which can happen on a CRTC that's already disabled).
-		 * => It currently exists.
+		 * 1. We're in the process of enabling CRTCs (just been added
+		 *    to the dc context, or already is on the context)
+		 * 2. Has a valid connector attached, and
+		 * 3. Is currently active and enabled.
+		 * => The dc stream state currently exists.
 		 */
 		BUG_ON(dm_new_crtc_state->stream == NULL);
 
-- 
2.7.4

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

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

end of thread, other threads:[~2018-05-29 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 15:06 [PATCH] drm/amd/display: Fix BUG_ON during CRTC atomic check update sunpeng.li-5C7GfCeVMHo
     [not found] ` <1527520003-1224-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-28 15:20   ` Michel Dänzer
     [not found]     ` <7be152e0-18c5-22f6-b80a-87e856effff9-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-28 16:05       ` Leo Li
2018-05-28 18:00   ` [PATCH v2] " sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1527530423-14855-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-05-29  7:55       ` Michel Dänzer
2018-05-29 13:51   ` [PATCH v3] " sunpeng.li-5C7GfCeVMHo

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.