* [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc
@ 2019-06-05 16:33 Nicholas Kazlauskas
[not found] ` <20190605163359.19422-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Kazlauskas @ 2019-06-05 16:33 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Leo Li, Harry Wentland, Nicholas Kazlauskas
[Why]
The old logic for checking which output depth to use relied on using
the current connector state rather than the new proposed state. This
was a problem when performing atomic commits since we weren't verifying
it against the incoming max_requested_bpc.
But switching this to only use the new state and not the current state
breaks filtering modes - it'll always assume that the maximum bpc
supported by the display is in use, which will cause certain modes
like 1440p@144Hz to be filtered even when using 8bpc.
[How]
Still use the connector->state if we aren't passed an explicit state.
This will respect the max_bpc the user currently has when filtering
modes.
Also remember to reset the default max_requested_bpc to 8 whenever
connector reset is called to retain old behavior when using the new
property.
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
1 file changed, 4 insertions(+)
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 a698c8f272ed..f627c17a1039 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3046,6 +3046,9 @@ convert_color_depth_from_display_info(const struct drm_connector *connector,
{
uint32_t bpc = connector->display_info.bpc;
+ if (!state)
+ state = connector->state;
+
if (state) {
bpc = state->max_bpc;
/* Round down to the nearest even number. */
@@ -3820,6 +3823,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
state->underscan_enable = false;
state->underscan_hborder = 0;
state->underscan_vborder = 0;
+ state->base.max_requested_bpc = 8;
__drm_atomic_helper_connector_reset(connector, &state->base);
}
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc
[not found] ` <20190605163359.19422-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
@ 2019-06-05 17:30 ` Deucher, Alexander
[not found] ` <BN6PR12MB1809805E1DE3D37B38E23F92F7160-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-06-07 13:31 ` Harry Wentland
1 sibling, 1 reply; 4+ messages in thread
From: Deucher, Alexander @ 2019-06-05 17:30 UTC (permalink / raw)
To: Kazlauskas, Nicholas, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Li, Sun peng (Leo), Wentland, Harry
[-- Attachment #1.1: Type: text/plain, Size: 2929 bytes --]
Maybe add a reference to the bug report?
Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Nicholas Kazlauskas <nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
Sent: Wednesday, June 5, 2019 12:33 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc
[Why]
The old logic for checking which output depth to use relied on using
the current connector state rather than the new proposed state. This
was a problem when performing atomic commits since we weren't verifying
it against the incoming max_requested_bpc.
But switching this to only use the new state and not the current state
breaks filtering modes - it'll always assume that the maximum bpc
supported by the display is in use, which will cause certain modes
like 1440p@144Hz to be filtered even when using 8bpc.
[How]
Still use the connector->state if we aren't passed an explicit state.
This will respect the max_bpc the user currently has when filtering
modes.
Also remember to reset the default max_requested_bpc to 8 whenever
connector reset is called to retain old behavior when using the new
property.
Cc: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
Cc: Leo Li <sunpeng.li-5C7GfCeVMHo@public.gmane.org>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
1 file changed, 4 insertions(+)
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 a698c8f272ed..f627c17a1039 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3046,6 +3046,9 @@ convert_color_depth_from_display_info(const struct drm_connector *connector,
{
uint32_t bpc = connector->display_info.bpc;
+ if (!state)
+ state = connector->state;
+
if (state) {
bpc = state->max_bpc;
/* Round down to the nearest even number. */
@@ -3820,6 +3823,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
state->underscan_enable = false;
state->underscan_hborder = 0;
state->underscan_vborder = 0;
+ state->base.max_requested_bpc = 8;
__drm_atomic_helper_connector_reset(connector, &state->base);
}
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 4959 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc
[not found] ` <BN6PR12MB1809805E1DE3D37B38E23F92F7160-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-06-05 18:03 ` Kazlauskas, Nicholas
0 siblings, 0 replies; 4+ messages in thread
From: Kazlauskas, Nicholas @ 2019-06-05 18:03 UTC (permalink / raw)
To: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Li, Sun peng (Leo), Wentland, Harry
On 6/5/19 1:30 PM, Deucher, Alexander wrote:
> Maybe add a reference to the bug report?
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Oh right, I can add the bugzilla when this gets reviewed and I push. Thanks!
Nicholas Kazlauskas
> ------------------------------------------------------------------------
> *From:* amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of
> Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> *Sent:* Wednesday, June 5, 2019 12:33 PM
> *To:* amd-gfx@lists.freedesktop.org
> *Cc:* Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas
> *Subject:* [PATCH] drm/amd/display: Use current connector state if NULL
> when checking bpc
> [Why]
> The old logic for checking which output depth to use relied on using
> the current connector state rather than the new proposed state. This
> was a problem when performing atomic commits since we weren't verifying
> it against the incoming max_requested_bpc.
>
> But switching this to only use the new state and not the current state
> breaks filtering modes - it'll always assume that the maximum bpc
> supported by the display is in use, which will cause certain modes
> like 1440p@144Hz to be filtered even when using 8bpc.
>
> [How]
> Still use the connector->state if we aren't passed an explicit state.
> This will respect the max_bpc the user currently has when filtering
> modes.
>
> Also remember to reset the default max_requested_bpc to 8 whenever
> connector reset is called to retain old behavior when using the new
> property.
>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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 a698c8f272ed..f627c17a1039 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3046,6 +3046,9 @@ convert_color_depth_from_display_info(const struct
> drm_connector *connector,
> {
> uint32_t bpc = connector->display_info.bpc;
>
> + if (!state)
> + state = connector->state;
> +
> if (state) {
> bpc = state->max_bpc;
> /* Round down to the nearest even number. */
> @@ -3820,6 +3823,7 @@ void amdgpu_dm_connector_funcs_reset(struct
> drm_connector *connector)
> state->underscan_enable = false;
> state->underscan_hborder = 0;
> state->underscan_vborder = 0;
> + state->base.max_requested_bpc = 8;
>
> __drm_atomic_helper_connector_reset(connector,
> &state->base);
> }
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc
[not found] ` <20190605163359.19422-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2019-06-05 17:30 ` Deucher, Alexander
@ 2019-06-07 13:31 ` Harry Wentland
1 sibling, 0 replies; 4+ messages in thread
From: Harry Wentland @ 2019-06-07 13:31 UTC (permalink / raw)
To: Kazlauskas, Nicholas, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Li, Sun peng (Leo), Wentland, Harry
On 2019-06-05 12:33 p.m., Nicholas Kazlauskas wrote:
> [Why]
> The old logic for checking which output depth to use relied on using
> the current connector state rather than the new proposed state. This
> was a problem when performing atomic commits since we weren't verifying
> it against the incoming max_requested_bpc.
>
> But switching this to only use the new state and not the current state
> breaks filtering modes - it'll always assume that the maximum bpc
> supported by the display is in use, which will cause certain modes
> like 1440p@144Hz to be filtered even when using 8bpc.
>
> [How]
> Still use the connector->state if we aren't passed an explicit state.
> This will respect the max_bpc the user currently has when filtering
> modes.
>
> Also remember to reset the default max_requested_bpc to 8 whenever
> connector reset is called to retain old behavior when using the new
> property.
>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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 a698c8f272ed..f627c17a1039 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3046,6 +3046,9 @@ convert_color_depth_from_display_info(const struct drm_connector *connector,
> {
> uint32_t bpc = connector->display_info.bpc;
>
> + if (!state)
> + state = connector->state;
> +
> if (state) {
> bpc = state->max_bpc;
> /* Round down to the nearest even number. */
> @@ -3820,6 +3823,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
> state->underscan_enable = false;
> state->underscan_hborder = 0;
> state->underscan_vborder = 0;
> + state->base.max_requested_bpc = 8;
>
> __drm_atomic_helper_connector_reset(connector, &state->base);
> }
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-07 13:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 16:33 [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc Nicholas Kazlauskas
[not found] ` <20190605163359.19422-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2019-06-05 17:30 ` Deucher, Alexander
[not found] ` <BN6PR12MB1809805E1DE3D37B38E23F92F7160-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-06-05 18:03 ` Kazlauskas, Nicholas
2019-06-07 13:31 ` Harry Wentland
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.