* [PATCH v2 1/2] drm/amdgpu: Add amdgpu "max bpc" connector property
@ 2018-11-07 17:50 Nicholas Kazlauskas
[not found] ` <20181107175016.12565-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Kazlauskas @ 2018-11-07 17:50 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Harry.Wentland-5C7GfCeVMHo, Nicholas Kazlauskas
[Why]
Many panels support more than 8bpc but some modes are unavailable while
running at greater than 8bpc due to DP/HDMI bandwidth constraints.
Support for more than 8bpc was added recently in the driver but it
defaults to the maximum supported bpc - locking out these modes.
This should be a user configurable option such that the user can select
what bpc configuration they would like.
[How]
This patch introduces the "max bpc" amdgpu driver specific connector
property so the user can limit the maximum bpc. It ranges from 8 to 16.
This doesn't directly set the preferred bpc for the panel since it
follows Intel's existing driver conventions.
This proprety should be removed once common drm support for max bpc
lands.
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 +++++
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 7d6a36bca9dd..292bfd5340fa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -626,6 +626,11 @@ int amdgpu_display_modeset_create_props(struct amdgpu_device *adev)
"dither",
amdgpu_dither_enum_list, sz);
+ adev->mode_info.max_bpc_property =
+ drm_property_create_range(adev->ddev, 0, "max bpc", 8, 16);
+ if (!adev->mode_info.max_bpc_property)
+ return -ENOMEM;
+
if (amdgpu_device_has_dc_support(adev)) {
adev->mode_info.freesync_property =
drm_property_create_bool(adev->ddev, 0, "freesync");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
index 1627dd3413c7..c39af5d79608 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
@@ -338,6 +338,8 @@ struct amdgpu_mode_info {
struct drm_property *audio_property;
/* FMT dithering */
struct drm_property *dither_property;
+ /* maximum number of bits per channel for monitor color */
+ struct drm_property *max_bpc_property;
/* it is used to allow enablement of freesync mode */
struct drm_property *freesync_property;
/* it is used to know about display capability of freesync mode */
--
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[parent not found: <20181107175016.12565-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>]
* [PATCH v2 2/2] drm/amd/display: Support amdgpu "max bpc" connector property [not found] ` <20181107175016.12565-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org> @ 2018-11-07 17:50 ` Nicholas Kazlauskas [not found] ` <20181107175016.12565-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Nicholas Kazlauskas @ 2018-11-07 17:50 UTC (permalink / raw) To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: Harry.Wentland-5C7GfCeVMHo, Nicholas Kazlauskas [Why] Many panels support more than 8bpc but some modes are unavailable while running at greater than 8bpc due to DP/HDMI bandwidth constraints. Support for more than 8bpc was added recently in the driver but it defaults to the maximum supported bpc - locking out these modes. This should be a user configurable option such that the user can select what bpc configuration they would like. [How] This patch adds support for getting and setting the amdgpu driver specific "max bpc" property on the connector. It also adds support for limiting the output bpc based on the property value. The default limitation is the lowest value in the range, 8bpc. This was the old value before the range was uncapped. This patch should be updated/replaced later once common drm support for max bpc lands. Bugzilla: https://bugs.freedesktop.org/108542 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201585 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200645 Fixes: e03fd3f300f6 ("drm/amd/display: Do not limit color depth to 8bpc") Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++++++++++++++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + 2 files changed, 17 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 c440d967db57..6b746afc55e7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2417,8 +2417,15 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode, static enum dc_color_depth convert_color_depth_from_display_info(const struct drm_connector *connector) { + struct dm_connector_state *dm_conn_state = + to_dm_connector_state(connector->state); uint32_t bpc = connector->display_info.bpc; + /* TODO: Remove this when there's support for max_bpc in drm */ + if (dm_conn_state && bpc > dm_conn_state->max_bpc) + /* Round down to nearest even number. */ + bpc = dm_conn_state->max_bpc - (dm_conn_state->max_bpc & 1); + switch (bpc) { case 0: /* @@ -3001,6 +3008,9 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { dm_new_state->underscan_enable = val; ret = 0; + } else if (property == adev->mode_info.max_bpc_property) { + dm_new_state->max_bpc = val; + ret = 0; } else if (property == adev->mode_info.freesync_property) { dm_new_state->freesync_enable = val; ret = 0; @@ -3049,6 +3059,9 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { *val = dm_state->underscan_enable; ret = 0; + } else if (property == adev->mode_info.max_bpc_property) { + *val = dm_state->max_bpc; + ret = 0; } else if (property == adev->mode_info.freesync_property) { *val = dm_state->freesync_enable; ret = 0; @@ -3864,6 +3877,9 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, drm_object_attach_property(&aconnector->base.base, adev->mode_info.underscan_vborder_property, 0); + drm_object_attach_property(&aconnector->base.base, + adev->mode_info.max_bpc_property, + 0); if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort) { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 23f2d05cf07e..afcb9842bb45 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -252,6 +252,7 @@ struct dm_connector_state { enum amdgpu_rmx_type scaling; uint8_t underscan_vborder; uint8_t underscan_hborder; + uint8_t max_bpc; bool underscan_enable; bool freesync_enable; bool freesync_capable; -- 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
[parent not found: <20181107175016.12565-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH v2 2/2] drm/amd/display: Support amdgpu "max bpc" connector property [not found] ` <20181107175016.12565-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org> @ 2018-11-09 22:36 ` Alex Deucher 2018-11-12 16:04 ` Wentland, Harry 1 sibling, 0 replies; 4+ messages in thread From: Alex Deucher @ 2018-11-09 22:36 UTC (permalink / raw) To: nicholas.kazlauskas-5C7GfCeVMHo; +Cc: Wentland, Harry, amd-gfx list On Wed, Nov 7, 2018 at 12:50 PM Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> wrote: > > [Why] > Many panels support more than 8bpc but some modes are unavailable while > running at greater than 8bpc due to DP/HDMI bandwidth constraints. > > Support for more than 8bpc was added recently in the driver but it > defaults to the maximum supported bpc - locking out these modes. > > This should be a user configurable option such that the user can select > what bpc configuration they would like. > > [How] > This patch adds support for getting and setting the amdgpu driver > specific "max bpc" property on the connector. > > It also adds support for limiting the output bpc based on the property > value. The default limitation is the lowest value in the range, 8bpc. > This was the old value before the range was uncapped. > > This patch should be updated/replaced later once common drm support > for max bpc lands. > > Bugzilla: https://bugs.freedesktop.org/108542 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201585 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200645 > Fixes: e03fd3f300f6 ("drm/amd/display: Do not limit color depth to 8bpc") > > Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Series is: Acked-by: Alex Deucher <alexander.deucher@amd.com> > --- > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++++++++++++++ > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + > 2 files changed, 17 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 c440d967db57..6b746afc55e7 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -2417,8 +2417,15 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode, > static enum dc_color_depth > convert_color_depth_from_display_info(const struct drm_connector *connector) > { > + struct dm_connector_state *dm_conn_state = > + to_dm_connector_state(connector->state); > uint32_t bpc = connector->display_info.bpc; > > + /* TODO: Remove this when there's support for max_bpc in drm */ > + if (dm_conn_state && bpc > dm_conn_state->max_bpc) > + /* Round down to nearest even number. */ > + bpc = dm_conn_state->max_bpc - (dm_conn_state->max_bpc & 1); > + > switch (bpc) { > case 0: > /* > @@ -3001,6 +3008,9 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, > } else if (property == adev->mode_info.underscan_property) { > dm_new_state->underscan_enable = val; > ret = 0; > + } else if (property == adev->mode_info.max_bpc_property) { > + dm_new_state->max_bpc = val; > + ret = 0; > } else if (property == adev->mode_info.freesync_property) { > dm_new_state->freesync_enable = val; > ret = 0; > @@ -3049,6 +3059,9 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, > } else if (property == adev->mode_info.underscan_property) { > *val = dm_state->underscan_enable; > ret = 0; > + } else if (property == adev->mode_info.max_bpc_property) { > + *val = dm_state->max_bpc; > + ret = 0; > } else if (property == adev->mode_info.freesync_property) { > *val = dm_state->freesync_enable; > ret = 0; > @@ -3864,6 +3877,9 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, > drm_object_attach_property(&aconnector->base.base, > adev->mode_info.underscan_vborder_property, > 0); > + drm_object_attach_property(&aconnector->base.base, > + adev->mode_info.max_bpc_property, > + 0); > > if (connector_type == DRM_MODE_CONNECTOR_HDMIA || > connector_type == DRM_MODE_CONNECTOR_DisplayPort) { > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > index 23f2d05cf07e..afcb9842bb45 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > @@ -252,6 +252,7 @@ struct dm_connector_state { > enum amdgpu_rmx_type scaling; > uint8_t underscan_vborder; > uint8_t underscan_hborder; > + uint8_t max_bpc; > bool underscan_enable; > bool freesync_enable; > bool freesync_capable; > -- > 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 v2 2/2] drm/amd/display: Support amdgpu "max bpc" connector property [not found] ` <20181107175016.12565-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org> 2018-11-09 22:36 ` Alex Deucher @ 2018-11-12 16:04 ` Wentland, Harry 1 sibling, 0 replies; 4+ messages in thread From: Wentland, Harry @ 2018-11-12 16:04 UTC (permalink / raw) To: Kazlauskas, Nicholas, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org On 2018-11-07 12:50 p.m., Nicholas Kazlauskas wrote: > [Why] > Many panels support more than 8bpc but some modes are unavailable while > running at greater than 8bpc due to DP/HDMI bandwidth constraints. > > Support for more than 8bpc was added recently in the driver but it > defaults to the maximum supported bpc - locking out these modes. > > This should be a user configurable option such that the user can select > what bpc configuration they would like. > > [How] > This patch adds support for getting and setting the amdgpu driver > specific "max bpc" property on the connector. > > It also adds support for limiting the output bpc based on the property > value. The default limitation is the lowest value in the range, 8bpc. > This was the old value before the range was uncapped. > > This patch should be updated/replaced later once common drm support > for max bpc lands. Generally good to call out changes for 'v2' here. > > Bugzilla: https://bugs.freedesktop.org/108542 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201585 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200645 > Fixes: e03fd3f300f6 ("drm/amd/display: Do not limit color depth to 8bpc") > > Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Series is Reviewed-by: Harry Wentland <harry.wentland@amd.com> Harry > --- > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++++++++++++++ > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + > 2 files changed, 17 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 c440d967db57..6b746afc55e7 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -2417,8 +2417,15 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode, > static enum dc_color_depth > convert_color_depth_from_display_info(const struct drm_connector *connector) > { > + struct dm_connector_state *dm_conn_state = > + to_dm_connector_state(connector->state); > uint32_t bpc = connector->display_info.bpc; > > + /* TODO: Remove this when there's support for max_bpc in drm */ > + if (dm_conn_state && bpc > dm_conn_state->max_bpc) > + /* Round down to nearest even number. */ > + bpc = dm_conn_state->max_bpc - (dm_conn_state->max_bpc & 1); > + > switch (bpc) { > case 0: > /* > @@ -3001,6 +3008,9 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, > } else if (property == adev->mode_info.underscan_property) { > dm_new_state->underscan_enable = val; > ret = 0; > + } else if (property == adev->mode_info.max_bpc_property) { > + dm_new_state->max_bpc = val; > + ret = 0; > } else if (property == adev->mode_info.freesync_property) { > dm_new_state->freesync_enable = val; > ret = 0; > @@ -3049,6 +3059,9 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, > } else if (property == adev->mode_info.underscan_property) { > *val = dm_state->underscan_enable; > ret = 0; > + } else if (property == adev->mode_info.max_bpc_property) { > + *val = dm_state->max_bpc; > + ret = 0; > } else if (property == adev->mode_info.freesync_property) { > *val = dm_state->freesync_enable; > ret = 0; > @@ -3864,6 +3877,9 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, > drm_object_attach_property(&aconnector->base.base, > adev->mode_info.underscan_vborder_property, > 0); > + drm_object_attach_property(&aconnector->base.base, > + adev->mode_info.max_bpc_property, > + 0); > > if (connector_type == DRM_MODE_CONNECTOR_HDMIA || > connector_type == DRM_MODE_CONNECTOR_DisplayPort) { > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > index 23f2d05cf07e..afcb9842bb45 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h > @@ -252,6 +252,7 @@ struct dm_connector_state { > enum amdgpu_rmx_type scaling; > uint8_t underscan_vborder; > uint8_t underscan_hborder; > + uint8_t max_bpc; > bool underscan_enable; > bool freesync_enable; > bool freesync_capable; > _______________________________________________ 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:[~2018-11-12 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-07 17:50 [PATCH v2 1/2] drm/amdgpu: Add amdgpu "max bpc" connector property Nicholas Kazlauskas
[not found] ` <20181107175016.12565-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2018-11-07 17:50 ` [PATCH v2 2/2] drm/amd/display: Support " Nicholas Kazlauskas
[not found] ` <20181107175016.12565-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2018-11-09 22:36 ` Alex Deucher
2018-11-12 16:04 ` Wentland, Harry
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox