* [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
@ 2018-07-26 13:02 StanLis
2018-07-26 13:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: StanLis @ 2018-07-26 13:02 UTC (permalink / raw)
To: intel-gfx; +Cc: ville.syrjala
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
This was inspired, by a bugs like this:
Bugzilla: https://bugs.freedesktop.org/93361
In short, when TV advertises 12bpc, the refresh
rate might get inaccurate causing some playback
issues.
The temporary solution was to hack the EDID,
so that it doesn't advertise deep color, so this
new property makes it unnecessary.
Long term solution would be to change clock frequency,
however this affects all the clock tree and might not
be doable, so this is the currently proposed fix.
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/intel_atomic.c | 8 ++++++++
drivers/gpu/drm/i915/intel_drv.h | 4 ++++
drivers/gpu/drm/i915/intel_hdmi.c | 13 ++++++++-----
drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++
5 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index eeb002a47032..823eccd29f70 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1817,6 +1817,7 @@ struct drm_i915_private {
struct intel_fbdev *fbdev;
struct work_struct fbdev_suspend_work;
+ struct drm_property *max_bpp_property;
struct drm_property *broadcast_rgb_property;
struct drm_property *force_audio_property;
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index b04952bacf77..ac890fda8029 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -58,6 +58,8 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
*val = intel_conn_state->force_audio;
else if (property == dev_priv->broadcast_rgb_property)
*val = intel_conn_state->broadcast_rgb;
+ else if (property == dev_priv->max_bpp_property)
+ *val = intel_conn_state->max_bpp;
else {
DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
property->base.id, property->name);
@@ -96,6 +98,11 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
return 0;
}
+ if (property == dev_priv->max_bpp_property) {
+ intel_conn_state->max_bpp = val;
+ return 0;
+ }
+
DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
property->base.id, property->name);
return -EINVAL;
@@ -126,6 +133,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
if (new_conn_state->force_audio != old_conn_state->force_audio ||
new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
+ new_conn_state->max_bpp != old_conn_state->max_bpp ||
new_conn_state->base.content_type != old_conn_state->base.content_type ||
new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
crtc_state->mode_changed = true;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 61e715ddd0d5..38d1f430b44f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -422,6 +422,7 @@ struct intel_digital_connector_state {
enum hdmi_force_audio force_audio;
int broadcast_rgb;
+ int max_bpp;
};
#define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base)
@@ -1837,9 +1838,12 @@ bool intel_is_dual_link_lvds(struct drm_device *dev);
int intel_connector_update_modes(struct drm_connector *connector,
struct edid *edid);
int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
+
void intel_attach_force_audio_property(struct drm_connector *connector);
void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
void intel_attach_aspect_ratio_property(struct drm_connector *connector);
+void intel_attach_force_max_bpp_property(struct drm_connector *connector);
+
/* intel_overlay.c */
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 8363fbd18ee8..323b96f5eac7 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1748,15 +1748,16 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
*/
if (hdmi_deep_color_possible(pipe_config, 12) &&
hdmi_port_clock_valid(intel_hdmi, clock_12bpc,
- true, force_dvi) == MODE_OK) {
+ true, force_dvi) == MODE_OK &&
+ intel_conn_state->max_bpp >= 12 * 3) {
DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
- desired_bpp = 12*3;
-
+ desired_bpp = 12 * 3;
/* Need to adjust the port link by 1.5x for 12bpc. */
pipe_config->port_clock = clock_12bpc;
} else if (hdmi_deep_color_possible(pipe_config, 10) &&
hdmi_port_clock_valid(intel_hdmi, clock_10bpc,
- true, force_dvi) == MODE_OK) {
+ true, force_dvi) == MODE_OK &&
+ intel_conn_state->max_bpp >= 10 * 3) {
DRM_DEBUG_KMS("picking bpc to 10 for HDMI output\n");
desired_bpp = 10 * 3;
@@ -1764,7 +1765,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
pipe_config->port_clock = clock_10bpc;
} else {
DRM_DEBUG_KMS("picking bpc to 8 for HDMI output\n");
- desired_bpp = 8*3;
+ desired_bpp = 8 * 3;
pipe_config->port_clock = clock_8bpc;
}
@@ -2096,8 +2097,10 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
intel_attach_force_audio_property(connector);
intel_attach_broadcast_rgb_property(connector);
intel_attach_aspect_ratio_property(connector);
+ intel_attach_force_max_bpp_property(connector);
drm_connector_attach_content_type_property(connector);
connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
+ to_intel_digital_connector_state(connector->state)->max_bpp = 8*3;
}
/*
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index b39846613e3c..6f2ff2714c68 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -97,6 +97,26 @@ intel_attach_force_audio_property(struct drm_connector *connector)
drm_object_attach_property(&connector->base, prop, 0);
}
+void
+intel_attach_force_max_bpp_property(struct drm_connector *connector)
+{
+ struct drm_device *dev = connector->dev;
+ struct drm_i915_private *dev_priv = to_i915(dev);
+ struct drm_property *prop;
+
+ prop = dev_priv->max_bpp_property;
+ if (prop == NULL) {
+ prop = drm_property_create_range(dev, 0,
+ "Max bpp", 0, 12*3);
+ if (prop == NULL)
+ return;
+
+ dev_priv->max_bpp_property = prop;
+ }
+
+ drm_object_attach_property(&connector->base, prop, 8*3);
+}
+
static const struct drm_prop_enum_list broadcast_rgb_names[] = {
{ INTEL_BROADCAST_RGB_AUTO, "Automatic" },
{ INTEL_BROADCAST_RGB_FULL, "Full" },
--
2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
@ 2018-07-26 13:36 ` Patchwork
2018-07-26 13:37 ` ✗ Fi.CI.SPARSE: " Patchwork
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-07-26 13:36 UTC (permalink / raw)
To: StanLis; +Cc: intel-gfx
== Series Details ==
Series: Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
URL : https://patchwork.freedesktop.org/series/47286/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
e194ce13c27e Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
-:136: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV)
#136: FILE: drivers/gpu/drm/i915/intel_hdmi.c:2103:
+ to_intel_digital_connector_state(connector->state)->max_bpp = 8*3;
^
-:156: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!prop"
#156: FILE: drivers/gpu/drm/i915/intel_modes.c:108:
+ if (prop == NULL) {
-:158: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#158: FILE: drivers/gpu/drm/i915/intel_modes.c:110:
+ prop = drm_property_create_range(dev, 0,
+ "Max bpp", 0, 12*3);
-:158: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV)
#158: FILE: drivers/gpu/drm/i915/intel_modes.c:110:
+ "Max bpp", 0, 12*3);
^
-:159: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!prop"
#159: FILE: drivers/gpu/drm/i915/intel_modes.c:111:
+ if (prop == NULL)
-:165: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV)
#165: FILE: drivers/gpu/drm/i915/intel_modes.c:117:
+ drm_object_attach_property(&connector->base, prop, 8*3);
^
total: 0 errors, 0 warnings, 6 checks, 116 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✗ Fi.CI.SPARSE: warning for Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
2018-07-26 13:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-07-26 13:37 ` Patchwork
2018-07-26 13:57 ` ✓ Fi.CI.BAT: success " Patchwork
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-07-26 13:37 UTC (permalink / raw)
To: StanLis; +Cc: intel-gfx
== Series Details ==
Series: Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
URL : https://patchwork.freedesktop.org/series/47286/
State : warning
== Summary ==
$ dim sparse origin/drm-tip
Commit: Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
-drivers/gpu/drm/i915/selftests/../i915_drv.h:3645:16: warning: expression using sizeof(void)
+drivers/gpu/drm/i915/selftests/../i915_drv.h:3646:16: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
2018-07-26 13:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-07-26 13:37 ` ✗ Fi.CI.SPARSE: " Patchwork
@ 2018-07-26 13:57 ` Patchwork
2018-07-26 15:26 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-08 23:41 ` [PATCH v1] " Rodrigo Vivi
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-07-26 13:57 UTC (permalink / raw)
To: StanLis; +Cc: intel-gfx
== Series Details ==
Series: Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
URL : https://patchwork.freedesktop.org/series/47286/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4551 -> Patchwork_9781 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/47286/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9781:
=== IGT changes ===
==== Possible regressions ====
igt@gem_exec_reloc@basic-gtt-read-noreloc:
{fi-icl-u}: PASS -> DMESG-WARN +94
==== Warnings ====
igt@debugfs_test@read_all_entries:
{fi-icl-u}: DMESG-WARN -> DMESG-FAIL
== Known issues ==
Here are the changes found in Patchwork_9781 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-glk-dsi: PASS -> FAIL (fdo#100368)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-snb-2520m: PASS -> INCOMPLETE (fdo#103713)
{igt@kms_psr@primary_mmap_gtt}:
fi-cnl-psr: PASS -> DMESG-WARN (fdo#107372)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
fi-kbl-7560u: DMESG-FAIL (fdo#106560, fdo#106947) -> PASS
igt@drv_selftest@live_workarounds:
fi-skl-6700hq: DMESG-FAIL (fdo#107292) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
{fi-cfl-8109u}: INCOMPLETE (fdo#106070) -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#106070 https://bugs.freedesktop.org/show_bug.cgi?id=106070
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107292 https://bugs.freedesktop.org/show_bug.cgi?id=107292
fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
== Participating hosts (50 -> 43) ==
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-glk-j4005 fi-byt-clapper
== Build changes ==
* Linux: CI_DRM_4551 -> Patchwork_9781
CI_DRM_4551: 68157d5c225b33a8f480ceb2ea11d2fae680fe65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4576: bcb37a9b20eeec97f15fac2222408cc2e0b77631 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9781: e194ce13c27edf8320806ec9c47d2091117fd3b7 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
e194ce13c27e Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9781/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.IGT: success for Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
` (2 preceding siblings ...)
2018-07-26 13:57 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-07-26 15:26 ` Patchwork
2018-08-08 23:41 ` [PATCH v1] " Rodrigo Vivi
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-07-26 15:26 UTC (permalink / raw)
To: StanLis; +Cc: intel-gfx
== Series Details ==
Series: Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
URL : https://patchwork.freedesktop.org/series/47286/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4551_full -> Patchwork_9781_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9781_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_9781_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9781_full:
=== IGT changes ===
==== Warnings ====
igt@gem_mocs_settings@mocs-rc6-bsd2:
shard-kbl: PASS -> SKIP
igt@gem_mocs_settings@mocs-rc6-vebox:
shard-kbl: SKIP -> PASS
== Known issues ==
Here are the changes found in Patchwork_9781_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: PASS -> FAIL (fdo#105189)
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-glk: PASS -> FAIL (fdo#100368) +1
igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
shard-apl: PASS -> FAIL (fdo#103375)
igt@perf@short-reads:
shard-kbl: PASS -> FAIL (fdo#103183)
==== Possible fixes ====
igt@gem_softpin@noreloc-s3:
shard-kbl: INCOMPLETE (fdo#103665) -> PASS
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
shard-glk: FAIL (fdo#103375) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103183 https://bugs.freedesktop.org/show_bug.cgi?id=103183
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4551 -> Patchwork_9781
CI_DRM_4551: 68157d5c225b33a8f480ceb2ea11d2fae680fe65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4576: bcb37a9b20eeec97f15fac2222408cc2e0b77631 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9781: e194ce13c27edf8320806ec9c47d2091117fd3b7 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9781/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
` (3 preceding siblings ...)
2018-07-26 15:26 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-08-08 23:41 ` Rodrigo Vivi
2018-08-09 14:00 ` Lisovskiy, Stanislav
4 siblings, 1 reply; 7+ messages in thread
From: Rodrigo Vivi @ 2018-08-08 23:41 UTC (permalink / raw)
To: StanLis; +Cc: intel-gfx, ville.syrjala
On Thu, Jul 26, 2018 at 04:02:53PM +0300, StanLis wrote:
> From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
>
> This was inspired, by a bugs like this:
>
> Bugzilla: https://bugs.freedesktop.org/93361
>
> In short, when TV advertises 12bpc, the refresh
> rate might get inaccurate causing some playback
> issues.
>
> The temporary solution was to hack the EDID,
> so that it doesn't advertise deep color, so this
> new property makes it unnecessary.
>
> Long term solution would be to change clock frequency,
> however this affects all the clock tree and might not
> be doable, so this is the currently proposed fix.
It seems that the fix for this should be on the refresh rate side,
not providing an option to the user to workaround and hide the issue.
>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_atomic.c | 8 ++++++++
> drivers/gpu/drm/i915/intel_drv.h | 4 ++++
> drivers/gpu/drm/i915/intel_hdmi.c | 13 ++++++++-----
> drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++
> 5 files changed, 41 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index eeb002a47032..823eccd29f70 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1817,6 +1817,7 @@ struct drm_i915_private {
> struct intel_fbdev *fbdev;
> struct work_struct fbdev_suspend_work;
>
> + struct drm_property *max_bpp_property;
> struct drm_property *broadcast_rgb_property;
> struct drm_property *force_audio_property;
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index b04952bacf77..ac890fda8029 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -58,6 +58,8 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
> *val = intel_conn_state->force_audio;
> else if (property == dev_priv->broadcast_rgb_property)
> *val = intel_conn_state->broadcast_rgb;
> + else if (property == dev_priv->max_bpp_property)
> + *val = intel_conn_state->max_bpp;
> else {
> DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
> property->base.id, property->name);
> @@ -96,6 +98,11 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
> return 0;
> }
>
> + if (property == dev_priv->max_bpp_property) {
> + intel_conn_state->max_bpp = val;
> + return 0;
> + }
> +
> DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
> property->base.id, property->name);
> return -EINVAL;
> @@ -126,6 +133,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
> if (new_conn_state->force_audio != old_conn_state->force_audio ||
> new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
> new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
> + new_conn_state->max_bpp != old_conn_state->max_bpp ||
> new_conn_state->base.content_type != old_conn_state->base.content_type ||
> new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
> crtc_state->mode_changed = true;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 61e715ddd0d5..38d1f430b44f 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -422,6 +422,7 @@ struct intel_digital_connector_state {
>
> enum hdmi_force_audio force_audio;
> int broadcast_rgb;
> + int max_bpp;
> };
>
> #define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base)
> @@ -1837,9 +1838,12 @@ bool intel_is_dual_link_lvds(struct drm_device *dev);
> int intel_connector_update_modes(struct drm_connector *connector,
> struct edid *edid);
> int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
> +
> void intel_attach_force_audio_property(struct drm_connector *connector);
> void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
> void intel_attach_aspect_ratio_property(struct drm_connector *connector);
> +void intel_attach_force_max_bpp_property(struct drm_connector *connector);
> +
>
>
> /* intel_overlay.c */
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 8363fbd18ee8..323b96f5eac7 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1748,15 +1748,16 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
> */
> if (hdmi_deep_color_possible(pipe_config, 12) &&
> hdmi_port_clock_valid(intel_hdmi, clock_12bpc,
> - true, force_dvi) == MODE_OK) {
> + true, force_dvi) == MODE_OK &&
> + intel_conn_state->max_bpp >= 12 * 3) {
> DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
> - desired_bpp = 12*3;
> -
> + desired_bpp = 12 * 3;
> /* Need to adjust the port link by 1.5x for 12bpc. */
> pipe_config->port_clock = clock_12bpc;
> } else if (hdmi_deep_color_possible(pipe_config, 10) &&
> hdmi_port_clock_valid(intel_hdmi, clock_10bpc,
> - true, force_dvi) == MODE_OK) {
> + true, force_dvi) == MODE_OK &&
> + intel_conn_state->max_bpp >= 10 * 3) {
> DRM_DEBUG_KMS("picking bpc to 10 for HDMI output\n");
> desired_bpp = 10 * 3;
>
> @@ -1764,7 +1765,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
> pipe_config->port_clock = clock_10bpc;
> } else {
> DRM_DEBUG_KMS("picking bpc to 8 for HDMI output\n");
> - desired_bpp = 8*3;
> + desired_bpp = 8 * 3;
>
> pipe_config->port_clock = clock_8bpc;
> }
> @@ -2096,8 +2097,10 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
> intel_attach_force_audio_property(connector);
> intel_attach_broadcast_rgb_property(connector);
> intel_attach_aspect_ratio_property(connector);
> + intel_attach_force_max_bpp_property(connector);
> drm_connector_attach_content_type_property(connector);
> connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
> + to_intel_digital_connector_state(connector->state)->max_bpp = 8*3;
> }
>
> /*
> diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
> index b39846613e3c..6f2ff2714c68 100644
> --- a/drivers/gpu/drm/i915/intel_modes.c
> +++ b/drivers/gpu/drm/i915/intel_modes.c
> @@ -97,6 +97,26 @@ intel_attach_force_audio_property(struct drm_connector *connector)
> drm_object_attach_property(&connector->base, prop, 0);
> }
>
> +void
> +intel_attach_force_max_bpp_property(struct drm_connector *connector)
> +{
> + struct drm_device *dev = connector->dev;
> + struct drm_i915_private *dev_priv = to_i915(dev);
> + struct drm_property *prop;
> +
> + prop = dev_priv->max_bpp_property;
> + if (prop == NULL) {
> + prop = drm_property_create_range(dev, 0,
> + "Max bpp", 0, 12*3);
> + if (prop == NULL)
> + return;
> +
> + dev_priv->max_bpp_property = prop;
> + }
> +
> + drm_object_attach_property(&connector->base, prop, 8*3);
> +}
> +
> static const struct drm_prop_enum_list broadcast_rgb_names[] = {
> { INTEL_BROADCAST_RGB_AUTO, "Automatic" },
> { INTEL_BROADCAST_RGB_FULL, "Full" },
> --
> 2.17.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit.
2018-08-08 23:41 ` [PATCH v1] " Rodrigo Vivi
@ 2018-08-09 14:00 ` Lisovskiy, Stanislav
0 siblings, 0 replies; 7+ messages in thread
From: Lisovskiy, Stanislav @ 2018-08-09 14:00 UTC (permalink / raw)
To: Vivi, Rodrigo; +Cc: intel-gfx@lists.freedesktop.org, Syrjala, Ville
On Wed, 2018-08-08 at 16:41 -0700, Rodrigo Vivi wrote:
> On Thu, Jul 26, 2018 at 04:02:53PM +0300, StanLis wrote:
> > From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> >
> > This was inspired, by a bugs like this:
> >
> > Bugzilla: https://bugs.freedesktop.org/93361
> >
> > In short, when TV advertises 12bpc, the refresh
> > rate might get inaccurate causing some playback
> > issues.
> >
> > The temporary solution was to hack the EDID,
> > so that it doesn't advertise deep color, so this
> > new property makes it unnecessary.
> >
> > Long term solution would be to change clock frequency,
> > however this affects all the clock tree and might not
> > be doable, so this is the currently proposed fix.
>
> It seems that the fix for this should be on the refresh rate side,
> not providing an option to the user to workaround and hide the issue.
Correct. I mentioned this in the commit message. However,
after discussion with Ville we decided that this is way to go
at least for now, as refresh rate side fix would require changing
the whole implementation of finding best pll and clock divisor
algorithm, which will also affect all of the other connected outputs.
Currently as I understood it's not even clear, if this is doable at
all. I can of course ask again, if we still stick to this option or
should I start looking at implementing a real fix.
>
> >
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_atomic.c | 8 ++++++++
> > drivers/gpu/drm/i915/intel_drv.h | 4 ++++
> > drivers/gpu/drm/i915/intel_hdmi.c | 13 ++++++++-----
> > drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++
> > 5 files changed, 41 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h
> > index eeb002a47032..823eccd29f70 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1817,6 +1817,7 @@ struct drm_i915_private {
> > struct intel_fbdev *fbdev;
> > struct work_struct fbdev_suspend_work;
> >
> > + struct drm_property *max_bpp_property;
> > struct drm_property *broadcast_rgb_property;
> > struct drm_property *force_audio_property;
> >
> > diff --git a/drivers/gpu/drm/i915/intel_atomic.c
> > b/drivers/gpu/drm/i915/intel_atomic.c
> > index b04952bacf77..ac890fda8029 100644
> > --- a/drivers/gpu/drm/i915/intel_atomic.c
> > +++ b/drivers/gpu/drm/i915/intel_atomic.c
> > @@ -58,6 +58,8 @@ int
> > intel_digital_connector_atomic_get_property(struct drm_connector
> > *connector,
> > *val = intel_conn_state->force_audio;
> > else if (property == dev_priv->broadcast_rgb_property)
> > *val = intel_conn_state->broadcast_rgb;
> > + else if (property == dev_priv->max_bpp_property)
> > + *val = intel_conn_state->max_bpp;
> > else {
> > DRM_DEBUG_ATOMIC("Unknown property
> > [PROP:%d:%s]\n",
> > property->base.id, property-
> > >name);
> > @@ -96,6 +98,11 @@ int
> > intel_digital_connector_atomic_set_property(struct drm_connector
> > *connector,
> > return 0;
> > }
> >
> > + if (property == dev_priv->max_bpp_property) {
> > + intel_conn_state->max_bpp = val;
> > + return 0;
> > + }
> > +
> > DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
> > property->base.id, property->name);
> > return -EINVAL;
> > @@ -126,6 +133,7 @@ int intel_digital_connector_atomic_check(struct
> > drm_connector *conn,
> > if (new_conn_state->force_audio != old_conn_state-
> > >force_audio ||
> > new_conn_state->broadcast_rgb != old_conn_state-
> > >broadcast_rgb ||
> > new_conn_state->base.picture_aspect_ratio !=
> > old_conn_state->base.picture_aspect_ratio ||
> > + new_conn_state->max_bpp != old_conn_state->max_bpp ||
> > new_conn_state->base.content_type != old_conn_state-
> > >base.content_type ||
> > new_conn_state->base.scaling_mode != old_conn_state-
> > >base.scaling_mode)
> > crtc_state->mode_changed = true;
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h
> > b/drivers/gpu/drm/i915/intel_drv.h
> > index 61e715ddd0d5..38d1f430b44f 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -422,6 +422,7 @@ struct intel_digital_connector_state {
> >
> > enum hdmi_force_audio force_audio;
> > int broadcast_rgb;
> > + int max_bpp;
> > };
> >
> > #define to_intel_digital_connector_state(x) container_of(x, struct
> > intel_digital_connector_state, base)
> > @@ -1837,9 +1838,12 @@ bool intel_is_dual_link_lvds(struct
> > drm_device *dev);
> > int intel_connector_update_modes(struct drm_connector *connector,
> > struct edid *edid);
> > int intel_ddc_get_modes(struct drm_connector *c, struct
> > i2c_adapter *adapter);
> > +
> > void intel_attach_force_audio_property(struct drm_connector
> > *connector);
> > void intel_attach_broadcast_rgb_property(struct drm_connector
> > *connector);
> > void intel_attach_aspect_ratio_property(struct drm_connector
> > *connector);
> > +void intel_attach_force_max_bpp_property(struct drm_connector
> > *connector);
> > +
> >
> >
> > /* intel_overlay.c */
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
> > b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 8363fbd18ee8..323b96f5eac7 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -1748,15 +1748,16 @@ bool intel_hdmi_compute_config(struct
> > intel_encoder *encoder,
> > */
> > if (hdmi_deep_color_possible(pipe_config, 12) &&
> > hdmi_port_clock_valid(intel_hdmi, clock_12bpc,
> > - true, force_dvi) == MODE_OK) {
> > + true, force_dvi) == MODE_OK &&
> > + intel_conn_state->max_bpp >= 12 * 3) {
> > DRM_DEBUG_KMS("picking bpc to 12 for HDMI
> > output\n");
> > - desired_bpp = 12*3;
> > -
> > + desired_bpp = 12 * 3;
> > /* Need to adjust the port link by 1.5x for 12bpc.
> > */
> > pipe_config->port_clock = clock_12bpc;
> > } else if (hdmi_deep_color_possible(pipe_config, 10) &&
> > hdmi_port_clock_valid(intel_hdmi, clock_10bpc,
> > - true, force_dvi) ==
> > MODE_OK) {
> > + true, force_dvi) ==
> > MODE_OK &&
> > + intel_conn_state->max_bpp >= 10 * 3) {
> > DRM_DEBUG_KMS("picking bpc to 10 for HDMI
> > output\n");
> > desired_bpp = 10 * 3;
> >
> > @@ -1764,7 +1765,7 @@ bool intel_hdmi_compute_config(struct
> > intel_encoder *encoder,
> > pipe_config->port_clock = clock_10bpc;
> > } else {
> > DRM_DEBUG_KMS("picking bpc to 8 for HDMI
> > output\n");
> > - desired_bpp = 8*3;
> > + desired_bpp = 8 * 3;
> >
> > pipe_config->port_clock = clock_8bpc;
> > }
> > @@ -2096,8 +2097,10 @@ intel_hdmi_add_properties(struct intel_hdmi
> > *intel_hdmi, struct drm_connector *c
> > intel_attach_force_audio_property(connector);
> > intel_attach_broadcast_rgb_property(connector);
> > intel_attach_aspect_ratio_property(connector);
> > + intel_attach_force_max_bpp_property(connector);
> > drm_connector_attach_content_type_property(connector);
> > connector->state->picture_aspect_ratio =
> > HDMI_PICTURE_ASPECT_NONE;
> > + to_intel_digital_connector_state(connector->state)-
> > >max_bpp = 8*3;
> > }
> >
> > /*
> > diff --git a/drivers/gpu/drm/i915/intel_modes.c
> > b/drivers/gpu/drm/i915/intel_modes.c
> > index b39846613e3c..6f2ff2714c68 100644
> > --- a/drivers/gpu/drm/i915/intel_modes.c
> > +++ b/drivers/gpu/drm/i915/intel_modes.c
> > @@ -97,6 +97,26 @@ intel_attach_force_audio_property(struct
> > drm_connector *connector)
> > drm_object_attach_property(&connector->base, prop, 0);
> > }
> >
> > +void
> > +intel_attach_force_max_bpp_property(struct drm_connector
> > *connector)
> > +{
> > + struct drm_device *dev = connector->dev;
> > + struct drm_i915_private *dev_priv = to_i915(dev);
> > + struct drm_property *prop;
> > +
> > + prop = dev_priv->max_bpp_property;
> > + if (prop == NULL) {
> > + prop = drm_property_create_range(dev, 0,
> > + "Max bpp", 0, 12*3);
> > + if (prop == NULL)
> > + return;
> > +
> > + dev_priv->max_bpp_property = prop;
> > + }
> > +
> > + drm_object_attach_property(&connector->base, prop, 8*3);
> > +}
> > +
> > static const struct drm_prop_enum_list broadcast_rgb_names[] = {
> > { INTEL_BROADCAST_RGB_AUTO, "Automatic" },
> > { INTEL_BROADCAST_RGB_FULL, "Full" },
> > --
> > 2.17.0
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Best Regards,
Lisovskiy Stanislav
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-08-09 14:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26 13:02 [PATCH v1] Added max_bpp property to limit maximum bpp even if HDMI TV advertises higher limit StanLis
2018-07-26 13:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-07-26 13:37 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-26 13:57 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-26 15:26 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-08 23:41 ` [PATCH v1] " Rodrigo Vivi
2018-08-09 14:00 ` Lisovskiy, Stanislav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).