drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v2)
PATCH 1/1 drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v2)
This fixes a problem found on the MacBookPro 2017 Retina panel.
The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec = multiplier 0xc), but the DP_MAX_LINK_RATE dpcd register only reports 2.7 Gbps (multiplier value 0xa) as possible, in direct contradiction of what the firmware successfully set up.
This restricts the panel to 8 bpc, not providing the full color depth of the panel.
This patch adds a quirk specific to the MBP 2017 15" Retina panel to add the additiional 324000 kbps link rate during edp setup.
Link to previous discussion of a different attempted fix with Ville and Jani:
https://patchwork.kernel.org/patch/11325935/
v2: Follow Jani's proposal of defining quirk_rates[] instead
of just appending 324000. This for better clarity.
--- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 11 +++++++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 20 insertions(+)
drivers/gpu/drm/drm_dp_helper.c +2 -0
@@ -1179,6 +1179,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) },/* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */ { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, +/* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */ + { OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) }, };#undef OUI
drivers/gpu/drm/i915/display/intel_dp.c +11 -0
@@ -169,6 +169,17 @@ static void intel_dp_set_sink_rates(struct intel_dp *intel_dp) };int i, max_rate; +if (drm_dp_has_quirk (&intel_dp->desc, +DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS )) { +/* Needed, e.g., for Apple MBP 2017, 15 inch eDP Retina panel */ +static const int quirk_rates[] = {162000 ,270000 ,324000 }; + +memcpy (intel_dp->sink_rates, quirk_rates,sizeof (quirk_rates)); + intel_dp->num_sink_rates =ARRAY_SIZE (quirk_rates); + +return ; + } + max_rate =drm_dp_bw_code_to_link_rate (intel_dp->dpcd[DP_MAX_LINK_RATE ]);for (i =0 ; i <ARRAY_SIZE (dp_rates); i++) {
include/drm/drm_dp_helper.h +7 -0
@@ -1532,6 +1532,13 @@ enum drm_dp_quirk {* The DSC caps can be read from the physical aux instead. */ DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD , +/** +* @DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS: +* +* The device supports a link rate of 3.24 Gbps (multiplier 0xc) despite +* the DP_MAX_LINK_RATE register reporting a lower max multiplier. +*/ + DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, };/**
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 21 lines · Mario Kleiner
This fixes a problem found on the MacBookPro 2017 Retina panel.
The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec = multiplier
0xc), but theDP_MAX_LINK_RATEdpcd register only reports 2.7 Gbps (multiplier value0xa) as possible, in direct contradiction of what the firmware successfully set up.This restricts the panel to 8 bpc, not providing the full color depth of the panel.
This patch adds a quirk specific to the MBP 2017 15" Retina panel to add the additiional 324000 kbps link rate during edp setup.
Link to previous discussion of a different attempted fix with Ville and Jani:
Quoted 7 lines
v2: Follow Jani's proposal of defining quirk_rates[] instead
of just appending 324000. This for better clarity.Signed-off-by Mario Kleiner <[email protected]>Tested-by Mario Kleiner <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Jani Nikula <[email protected]>
As much as I dislike quirks, I think we did exhaust other options when we debugged this, and this is now very nicely isolated. Thanks for the patch.
I'll merge once the CI results are in, mostly to ensure this doesn't impact other platforms, as we don't have the machine in the CI farm.
Quoted 59 lines
--- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 11 +++++++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 20 insertions(+)drivers/gpu/drm/drm_dp_helper.c +2
-0@@ -1179,6 +1179,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) },/* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */ { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, +/* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */ + { OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) }, };#undef OUIdrivers/gpu/drm/i915/display/intel_dp.c +11
-0@@ -169,6 +169,17 @@ static void intel_dp_set_sink_rates(struct intel_dp *intel_dp) };int i, max_rate; +if (drm_dp_has_quirk (&intel_dp->desc, +DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS )) { +/* Needed, e.g., for Apple MBP 2017, 15 inch eDP Retina panel */ +static const int quirk_rates[] = {162000 ,270000 ,324000 }; + +memcpy (intel_dp->sink_rates, quirk_rates,sizeof (quirk_rates)); + intel_dp->num_sink_rates =ARRAY_SIZE (quirk_rates); + +return ; + } + max_rate =drm_dp_bw_code_to_link_rate (intel_dp->dpcd[DP_MAX_LINK_RATE ]);for (i =0 ; i <ARRAY_SIZE (dp_rates); i++) {include/drm/drm_dp_helper.h +7
-0@@ -1532,6 +1532,13 @@ enum drm_dp_quirk {* The DSC caps can be read from the physical aux instead. */ DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD , +/** +* @DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS: +* +* The device supports a link rate of 3.24 Gbps (multiplier 0xc) despite +* the DP_MAX_LINK_RATE register reporting a lower max multiplier. +*/ + DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, };/**
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 30 lines · Jani Nikula
Quoted 21 lines · Mario Kleiner
This fixes a problem found on the MacBookPro 2017 Retina panel.
The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec = multiplier
0xc), but theDP_MAX_LINK_RATEdpcd register only reports 2.7 Gbps (multiplier value0xa) as possible, in direct contradiction of what the firmware successfully set up.This restricts the panel to 8 bpc, not providing the full color depth of the panel.
This patch adds a quirk specific to the MBP 2017 15" Retina panel to add the additiional 324000 kbps link rate during edp setup.
Link to previous discussion of a different attempted fix with Ville and Jani:
Quoted 7 lines
v2: Follow Jani's proposal of defining quirk_rates[] instead
of just appending 324000. This for better clarity.Signed-off-by Mario Kleiner <[email protected]>Tested-by Mario Kleiner <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Jani Nikula <[email protected]>
Quoted 8 lines
As much as I dislike quirks, I think we did exhaust other options when we debugged this, and this is now very nicely isolated. Thanks for the patch.
Reviewed-by Jani Nikula <[email protected]>I'll merge once the CI results are in, mostly to ensure this doesn't impact other platforms, as we don't have the machine in the CI farm.
Note to self, add this when merging per Mario's suggestion:
Quoted 60 lines
Quoted 60 lines
--- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 11 +++++++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 20 insertions(+)drivers/gpu/drm/drm_dp_helper.c +2
-0@@ -1179,6 +1179,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) },/* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */ { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, +/* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */ + { OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) }, };#undef OUIdrivers/gpu/drm/i915/display/intel_dp.c +11
-0@@ -169,6 +169,17 @@ static void intel_dp_set_sink_rates(struct intel_dp *intel_dp) };int i, max_rate; +if (drm_dp_has_quirk (&intel_dp->desc, +DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS )) { +/* Needed, e.g., for Apple MBP 2017, 15 inch eDP Retina panel */ +static const int quirk_rates[] = {162000 ,270000 ,324000 }; + +memcpy (intel_dp->sink_rates, quirk_rates,sizeof (quirk_rates)); + intel_dp->num_sink_rates =ARRAY_SIZE (quirk_rates); + +return ; + } + max_rate =drm_dp_bw_code_to_link_rate (intel_dp->dpcd[DP_MAX_LINK_RATE ]);for (i =0 ; i <ARRAY_SIZE (dp_rates); i++) {include/drm/drm_dp_helper.h +7
-0@@ -1532,6 +1532,13 @@ enum drm_dp_quirk {* The DSC caps can be read from the physical aux instead. */ DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD , +/** +* @DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS: +* +* The device supports a link rate of 3.24 Gbps (multiplier 0xc) despite +* the DP_MAX_LINK_RATE register reporting a lower max multiplier. +*/ + DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, };/**
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (rev2)
In reply to Mario Kleiner== Series Details ==
== Series Details ==
Series: drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (rev2)
URL : https://patchwork.freedesktop.org/series/74100/
State : failure
== Summary ==
Applying: drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v2) Using index info to reconstruct a base tree...
M drivers/gpu/drm/drm_dp_helper.c
M drivers/gpu/drm/i915/display/intel_dp.c
M include/drm/drm_dp_helper.h
Falling back to patching base and 3-way merge...
Auto-merging include/drm/drm_dp_helper.h
CONFLICT (content): Merge conflict in include/drm/drm_dp_helper.h Auto-merging drivers/gpu/drm/i915/display/intel_dp.c
Auto-merging drivers/gpu/drm/drm_dp_helper.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (v2) When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 (rev2)
Quoted 8 lines · Patchwork
== Series Details ==
Series: drm/i915/dp: Add dpcd
link_ratequirk for Apple 15" MBP 2017 (rev2)
URL : https://patchwork.freedesktop.org/series/74100/
State : failure== Summary ==
Quoted 16 lines
Applying: drm/i915/dp: Add dpcd
link_ratequirk for Apple 15" MBP 2017 (v2) Using index info to reconstruct a base tree...
Mdrivers/gpu/drm/drm_dp_helper.c
Mdrivers/gpu/drm/i915/display/intel_dp.c
Minclude/drm/drm_dp_helper.h
Falling back to patching base and 3-way merge...
Auto-merginginclude/drm/drm_dp_helper.h
CONFLICT (content): Merge conflict ininclude/drm/drm_dp_helper.hAuto-mergingdrivers/gpu/drm/i915/display/intel_dp.c
Auto-mergingdrivers/gpu/drm/drm_dp_helper.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915/dp: Add dpcdlink_ratequirk for Apple 15" MBP 2017 (v2) When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
I missed that this fails to apply, please rebase on top of current drm-tip and repost.
Thanks,
Jani.
Quoted 5 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx