Re: [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

2018-11-07 Thread Alex Deucher
On Wed, Nov 7, 2018 at 11:09 AM Kazlauskas, Nicholas
 wrote:
>
> On 11/7/18 10:40 AM, Deucher, Alexander wrote:
> > FWIW there is a common property patch:
> >
> > https://patchwork.kernel.org/patch/10606697/
> >
> > When should try and be compatible so we can transition.
> >
> >
> > Alex
>
> Thanks for the heads up. I remember seeing the i915 patch but I missed
> the common property one. It's a shame that this isn't already in.
>
> Sharing the same property name might work for compatibility ("max bpc").
> The implementation relies on the same min/max range, the only thing that
> would change with that would be swapping out the attach with
> drm_connector_attach_max_bpc_property down the line.

I defer to you.  Just wanted to give you a heads up.  Sounds like
Intel is in the same situation so the end results should be similar.

Alex

>
> >
> > 
> > *From:* amd-gfx  on behalf of
> > Nicholas Kazlauskas 
> > *Sent:* Wednesday, November 7, 2018 9:56:54 AM
> > *To:* amd-gfx@lists.freedesktop.org
> > *Cc:* Kazlauskas, Nicholas
> > *Subject:* [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property
> > [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's
> > 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]
> > Introduce the "max_bpc" connector property so the user can limit the
> > maximum bpc for the panel. It ranges from 8 to 16.
> >
> > This doesn't directly set the preferred bpc for the panel but this
> > convetion is already in use for other drivers.
> >
> > Signed-off-by: Nicholas Kazlauskas 
> > ---
> >   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..83dadf5b85e0 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
>
> Nicholas Kazlauskas
> ___
> 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


Re: [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

2018-11-07 Thread Kazlauskas, Nicholas
On 11/7/18 10:40 AM, Deucher, Alexander wrote:
> FWIW there is a common property patch:
> 
> https://patchwork.kernel.org/patch/10606697/
> 
> When should try and be compatible so we can transition.
> 
> 
> Alex

Thanks for the heads up. I remember seeing the i915 patch but I missed 
the common property one. It's a shame that this isn't already in.

Sharing the same property name might work for compatibility ("max bpc").
The implementation relies on the same min/max range, the only thing that 
would change with that would be swapping out the attach with 
drm_connector_attach_max_bpc_property down the line.

> 
> 
> *From:* amd-gfx  on behalf of 
> Nicholas Kazlauskas 
> *Sent:* Wednesday, November 7, 2018 9:56:54 AM
> *To:* amd-gfx@lists.freedesktop.org
> *Cc:* Kazlauskas, Nicholas
> *Subject:* [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property
> [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's
> 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]
> Introduce the "max_bpc" connector property so the user can limit the
> maximum bpc for the panel. It ranges from 8 to 16.
> 
> This doesn't directly set the preferred bpc for the panel but this
> convetion is already in use for other drivers.
> 
> Signed-off-by: Nicholas Kazlauskas 
> ---
>   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..83dadf5b85e0 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

Nicholas Kazlauskas
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

2018-11-07 Thread Wentland, Harry
On 2018-11-07 9:56 a.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's
> 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]
> Introduce the "max_bpc" connector property so the user can limit the
> maximum bpc for the panel. It ranges from 8 to 16.
> 
> This doesn't directly set the preferred bpc for the panel but this
> convetion is already in use for other drivers.

covetion -> convention

Maybe mention that this mirrors the behavior used by the i915 driver so people 
are not left guessing.

Harry

> 
> Signed-off-by: Nicholas Kazlauskas 
> ---
>  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..83dadf5b85e0 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 */
> 
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

2018-11-07 Thread Deucher, Alexander
FWIW there is a common property patch:

https://patchwork.kernel.org/patch/10606697/

When should try and be compatible so we can transition.


Alex


From: amd-gfx  on behalf of Nicholas 
Kazlauskas 
Sent: Wednesday, November 7, 2018 9:56:54 AM
To: amd-gfx@lists.freedesktop.org
Cc: Kazlauskas, Nicholas
Subject: [PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

[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's
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]
Introduce the "max_bpc" connector property so the user can limit the
maximum bpc for the panel. It ranges from 8 to 16.

This doesn't directly set the preferred bpc for the panel but this
convetion is already in use for other drivers.

Signed-off-by: Nicholas Kazlauskas 
---
 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..83dadf5b85e0 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/amdgpu: Add "max_bpc" connector property

2018-11-07 Thread 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's
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]
Introduce the "max_bpc" connector property so the user can limit the
maximum bpc for the panel. It ranges from 8 to 16.

This doesn't directly set the preferred bpc for the panel but this
convetion is already in use for other drivers.

Signed-off-by: Nicholas Kazlauskas 
---
 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..83dadf5b85e0 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