* [PATCH 1/2] disp: activate dual link TMDS links only when possible
@ 2015-11-03 22:41 Ilia Mirkin
[not found] ` <1446590484-8670-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2015-11-03 22:41 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hauke Mehrtens
From: Hauke Mehrtens <hauke@hauke-m.de>
Without this patch a pixel clock rate above 165 MHz on a TMDS link is
assumed to be dual link. This is true for DVI, but not for HDMI. HDMI
supports no dual link, but it supports pixel clock rates above 165 MHz.
Only activate Dual Link mode when it is actual possible.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
drm/nouveau/nv50_display.c | 8 ++++----
drm/nouveau/nvkm/engine/disp/gf119.c | 2 +-
drm/nouveau/nvkm/engine/disp/nv50.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drm/nouveau/nv50_display.c b/drm/nouveau/nv50_display.c
index c053c50..93bcfdf 100644
--- a/drm/nouveau/nv50_display.c
+++ b/drm/nouveau/nv50_display.c
@@ -1961,10 +1961,10 @@ nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
switch (nv_encoder->dcb->type) {
case DCB_OUTPUT_TMDS:
if (nv_encoder->dcb->sorconf.link & 1) {
- if (mode->clock < 165000)
- proto = 0x1;
- else
- proto = 0x5;
+ proto = 0x1;
+ if (mode->clock >= 165000 &&
+ nv_encoder->dcb->duallink_possible)
+ proto |= 0x4;
} else {
proto = 0x2;
}
diff --git a/drm/nouveau/nvkm/engine/disp/gf119.c b/drm/nouveau/nvkm/engine/disp/gf119.c
index 186fd3a..8691b68 100644
--- a/drm/nouveau/nvkm/engine/disp/gf119.c
+++ b/drm/nouveau/nvkm/engine/disp/gf119.c
@@ -158,7 +158,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
switch (outp->info.type) {
case DCB_OUTPUT_TMDS:
*conf = (ctrl & 0x00000f00) >> 8;
- if (pclk >= 165000)
+ if (pclk >= 165000 && outp->info.duallink_possible)
*conf |= 0x0100;
break;
case DCB_OUTPUT_LVDS:
diff --git a/drm/nouveau/nvkm/engine/disp/nv50.c b/drm/nouveau/nvkm/engine/disp/nv50.c
index 32e73a9..ceecd0e 100644
--- a/drm/nouveau/nvkm/engine/disp/nv50.c
+++ b/drm/nouveau/nvkm/engine/disp/nv50.c
@@ -391,7 +391,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
switch (outp->info.type) {
case DCB_OUTPUT_TMDS:
*conf = (ctrl & 0x00000f00) >> 8;
- if (pclk >= 165000)
+ if (pclk >= 165000 && outp->info.duallink_possible)
*conf |= 0x0100;
break;
case DCB_OUTPUT_LVDS:
--
2.4.10
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] connector: allow 225/297MHz pixel clocks for HDMI on Fermi/Kepler
[not found] ` <1446590484-8670-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2015-11-03 22:41 ` Ilia Mirkin
2015-11-04 0:02 ` [PATCH 1/2] disp: activate dual link TMDS links only when possible Ben Skeggs
1 sibling, 0 replies; 5+ messages in thread
From: Ilia Mirkin @ 2015-11-03 22:41 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Some Fermi's apparently alow allow 297MHz clocks, so create a parameter
which allows end-users to set it themselves until we have a reliable way
to determine the board's maximum pixel clocks.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
drm/nouveau/nouveau_connector.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drm/nouveau/nouveau_connector.c b/drm/nouveau/nouveau_connector.c
index 4c8f6ef..f5806eb 100644
--- a/drm/nouveau/nouveau_connector.c
+++ b/drm/nouveau/nouveau_connector.c
@@ -56,6 +56,10 @@ MODULE_PARM_DESC(duallink, "Allow dual-link TMDS (default: enabled)");
int nouveau_duallink = 1;
module_param_named(duallink, nouveau_duallink, int, 0400);
+MODULE_PARM_DESC(hdmimhz, "Force a maximum HDMI pixel clock (in MHz)");
+int nouveau_hdmimhz = 0;
+module_param_named(hdmimhz, nouveau_hdmimhz, int, 0400);
+
struct nouveau_encoder *
find_encoder(struct drm_connector *connector, int type)
{
@@ -815,6 +819,17 @@ get_tmds_link_bandwidth(struct drm_connector *connector)
struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct dcb_output *dcb = nv_connector->detected_encoder->dcb;
+ if (drm_detect_hdmi_monitor(nv_connector->edid)) {
+ if (nouveau_hdmimhz > 0)
+ return nouveau_hdmimhz * 1000;
+ /* Note: these limits are conservative, some Fermi's
+ * can do 297 MHz. Unclear how this can be determined.
+ */
+ if (drm->device.info.family >= NV_DEVICE_INFO_V0_KEPLER)
+ return 297000;
+ if (drm->device.info.family >= NV_DEVICE_INFO_V0_FERMI)
+ return 225000;
+ }
if (dcb->location != DCB_LOC_ON_CHIP ||
drm->device.info.chipset >= 0x46)
return 165000;
--
2.4.10
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] disp: activate dual link TMDS links only when possible
[not found] ` <1446590484-8670-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-11-03 22:41 ` [PATCH 2/2] connector: allow 225/297MHz pixel clocks for HDMI on Fermi/Kepler Ilia Mirkin
@ 2015-11-04 0:02 ` Ben Skeggs
[not found] ` <56394B31.2050504-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
1 sibling, 1 reply; 5+ messages in thread
From: Ben Skeggs @ 2015-11-04 0:02 UTC (permalink / raw)
To: Ilia Mirkin, Ben Skeggs
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hauke Mehrtens
[-- Attachment #1.1: Type: text/plain, Size: 2859 bytes --]
On 11/04/2015 08:41 AM, Ilia Mirkin wrote:
> From: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
>
> Without this patch a pixel clock rate above 165 MHz on a TMDS link is
> assumed to be dual link. This is true for DVI, but not for HDMI. HDMI
> supports no dual link, but it supports pixel clock rates above 165 MHz.
> Only activate Dual Link mode when it is actual possible.
>
> Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
> ---
> drm/nouveau/nv50_display.c | 8 ++++----
> drm/nouveau/nvkm/engine/disp/gf119.c | 2 +-
> drm/nouveau/nvkm/engine/disp/nv50.c | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drm/nouveau/nv50_display.c b/drm/nouveau/nv50_display.c
> index c053c50..93bcfdf 100644
> --- a/drm/nouveau/nv50_display.c
> +++ b/drm/nouveau/nv50_display.c
> @@ -1961,10 +1961,10 @@ nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
> switch (nv_encoder->dcb->type) {
> case DCB_OUTPUT_TMDS:
> if (nv_encoder->dcb->sorconf.link & 1) {
> - if (mode->clock < 165000)
> - proto = 0x1;
> - else
> - proto = 0x5;
> + proto = 0x1;
> + if (mode->clock >= 165000 &&
> + nv_encoder->dcb->duallink_possible)
> + proto |= 0x4;
This is a somewhat flaky condition, given that one could plug a
single-link HDMI monitor into a duallink-capable TMDS connector.
Still, it's an improvement :)
> } else {
> proto = 0x2;
> }
> diff --git a/drm/nouveau/nvkm/engine/disp/gf119.c b/drm/nouveau/nvkm/engine/disp/gf119.c
> index 186fd3a..8691b68 100644
> --- a/drm/nouveau/nvkm/engine/disp/gf119.c
> +++ b/drm/nouveau/nvkm/engine/disp/gf119.c
> @@ -158,7 +158,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
> switch (outp->info.type) {
> case DCB_OUTPUT_TMDS:
> *conf = (ctrl & 0x00000f00) >> 8;
> - if (pclk >= 165000)
> + if (pclk >= 165000 && outp->info.duallink_possible)
> *conf |= 0x0100;
I think it might be more robust to key this off the SOR protocol, rather
than duplicating the condition above.
> break;
> case DCB_OUTPUT_LVDS:
> diff --git a/drm/nouveau/nvkm/engine/disp/nv50.c b/drm/nouveau/nvkm/engine/disp/nv50.c
> index 32e73a9..ceecd0e 100644
> --- a/drm/nouveau/nvkm/engine/disp/nv50.c
> +++ b/drm/nouveau/nvkm/engine/disp/nv50.c
> @@ -391,7 +391,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
> switch (outp->info.type) {
> case DCB_OUTPUT_TMDS:
> *conf = (ctrl & 0x00000f00) >> 8;
> - if (pclk >= 165000)
> + if (pclk >= 165000 && outp->info.duallink_possible)
> *conf |= 0x0100;
Same here.
> break;
> case DCB_OUTPUT_LVDS:
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] disp: activate dual link TMDS links only when possible
[not found] ` <56394B31.2050504-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-11-04 0:37 ` Ilia Mirkin
[not found] ` <CAKb7Uvi1uJt29hW4-VbVCwaTD4cOT5VZ9AbFvUdUYg8NZ957hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2015-11-04 0:37 UTC (permalink / raw)
To: Ben Skeggs
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Ben Skeggs, Hauke Mehrtens
On Tue, Nov 3, 2015 at 7:02 PM, Ben Skeggs <skeggsb@gmail.com> wrote:
> On 11/04/2015 08:41 AM, Ilia Mirkin wrote:
>> From: Hauke Mehrtens <hauke@hauke-m.de>
>>
>> Without this patch a pixel clock rate above 165 MHz on a TMDS link is
>> assumed to be dual link. This is true for DVI, but not for HDMI. HDMI
>> supports no dual link, but it supports pixel clock rates above 165 MHz.
>> Only activate Dual Link mode when it is actual possible.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
>> ---
>> drm/nouveau/nv50_display.c | 8 ++++----
>> drm/nouveau/nvkm/engine/disp/gf119.c | 2 +-
>> drm/nouveau/nvkm/engine/disp/nv50.c | 2 +-
>> 3 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drm/nouveau/nv50_display.c b/drm/nouveau/nv50_display.c
>> index c053c50..93bcfdf 100644
>> --- a/drm/nouveau/nv50_display.c
>> +++ b/drm/nouveau/nv50_display.c
>> @@ -1961,10 +1961,10 @@ nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
>> switch (nv_encoder->dcb->type) {
>> case DCB_OUTPUT_TMDS:
>> if (nv_encoder->dcb->sorconf.link & 1) {
>> - if (mode->clock < 165000)
>> - proto = 0x1;
>> - else
>> - proto = 0x5;
>> + proto = 0x1;
>> + if (mode->clock >= 165000 &&
>> + nv_encoder->dcb->duallink_possible)
>> + proto |= 0x4;
> This is a somewhat flaky condition, given that one could plug a
> single-link HDMI monitor into a duallink-capable TMDS connector.
>
> Still, it's an improvement :)
Yeah, FWIW I thought of that (for the second patch too). All this
stuff is pretty fragile. But... what are you gonna do. Is there some
other way of telling whether we're on HDMI or DVI?
>
>> } else {
>> proto = 0x2;
>> }
>> diff --git a/drm/nouveau/nvkm/engine/disp/gf119.c b/drm/nouveau/nvkm/engine/disp/gf119.c
>> index 186fd3a..8691b68 100644
>> --- a/drm/nouveau/nvkm/engine/disp/gf119.c
>> +++ b/drm/nouveau/nvkm/engine/disp/gf119.c
>> @@ -158,7 +158,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
>> switch (outp->info.type) {
>> case DCB_OUTPUT_TMDS:
>> *conf = (ctrl & 0x00000f00) >> 8;
>> - if (pclk >= 165000)
>> + if (pclk >= 165000 && outp->info.duallink_possible)
>> *conf |= 0x0100;
> I think it might be more robust to key this off the SOR protocol, rather
> than duplicating the condition above.
You mean disp->sor.lvdsconf? What do I do with that? Or did you have
something else in mind?
>
>> break;
>> case DCB_OUTPUT_LVDS:
>> diff --git a/drm/nouveau/nvkm/engine/disp/nv50.c b/drm/nouveau/nvkm/engine/disp/nv50.c
>> index 32e73a9..ceecd0e 100644
>> --- a/drm/nouveau/nvkm/engine/disp/nv50.c
>> +++ b/drm/nouveau/nvkm/engine/disp/nv50.c
>> @@ -391,7 +391,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
>> switch (outp->info.type) {
>> case DCB_OUTPUT_TMDS:
>> *conf = (ctrl & 0x00000f00) >> 8;
>> - if (pclk >= 165000)
>> + if (pclk >= 165000 && outp->info.duallink_possible)
>> *conf |= 0x0100;
> Same here.
>
>> break;
>> case DCB_OUTPUT_LVDS:
>>
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] disp: activate dual link TMDS links only when possible
[not found] ` <CAKb7Uvi1uJt29hW4-VbVCwaTD4cOT5VZ9AbFvUdUYg8NZ957hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-11-04 1:10 ` Ben Skeggs
0 siblings, 0 replies; 5+ messages in thread
From: Ben Skeggs @ 2015-11-04 1:10 UTC (permalink / raw)
To: Ilia Mirkin
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Ben Skeggs, Hauke Mehrtens
[-- Attachment #1.1: Type: text/plain, Size: 4411 bytes --]
On 11/04/2015 10:37 AM, Ilia Mirkin wrote:
> On Tue, Nov 3, 2015 at 7:02 PM, Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 11/04/2015 08:41 AM, Ilia Mirkin wrote:
>>> From: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
>>>
>>> Without this patch a pixel clock rate above 165 MHz on a TMDS link is
>>> assumed to be dual link. This is true for DVI, but not for HDMI. HDMI
>>> supports no dual link, but it supports pixel clock rates above 165 MHz.
>>> Only activate Dual Link mode when it is actual possible.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
>>> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
>>> ---
>>> drm/nouveau/nv50_display.c | 8 ++++----
>>> drm/nouveau/nvkm/engine/disp/gf119.c | 2 +-
>>> drm/nouveau/nvkm/engine/disp/nv50.c | 2 +-
>>> 3 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drm/nouveau/nv50_display.c b/drm/nouveau/nv50_display.c
>>> index c053c50..93bcfdf 100644
>>> --- a/drm/nouveau/nv50_display.c
>>> +++ b/drm/nouveau/nv50_display.c
>>> @@ -1961,10 +1961,10 @@ nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
>>> switch (nv_encoder->dcb->type) {
>>> case DCB_OUTPUT_TMDS:
>>> if (nv_encoder->dcb->sorconf.link & 1) {
>>> - if (mode->clock < 165000)
>>> - proto = 0x1;
>>> - else
>>> - proto = 0x5;
>>> + proto = 0x1;
>>> + if (mode->clock >= 165000 &&
>>> + nv_encoder->dcb->duallink_possible)
>>> + proto |= 0x4;
>> This is a somewhat flaky condition, given that one could plug a
>> single-link HDMI monitor into a duallink-capable TMDS connector.
>>
>> Still, it's an improvement :)
>
> Yeah, FWIW I thought of that (for the second patch too). All this
> stuff is pretty fragile. But... what are you gonna do. Is there some
> other way of telling whether we're on HDMI or DVI?
drm_detect_hdmi_monitor() should do the trick :)
>
>>
>>> } else {
>>> proto = 0x2;
>>> }
>>> diff --git a/drm/nouveau/nvkm/engine/disp/gf119.c b/drm/nouveau/nvkm/engine/disp/gf119.c
>>> index 186fd3a..8691b68 100644
>>> --- a/drm/nouveau/nvkm/engine/disp/gf119.c
>>> +++ b/drm/nouveau/nvkm/engine/disp/gf119.c
>>> @@ -158,7 +158,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
>>> switch (outp->info.type) {
>>> case DCB_OUTPUT_TMDS:
>>> *conf = (ctrl & 0x00000f00) >> 8;
>>> - if (pclk >= 165000)
>>> + if (pclk >= 165000 && outp->info.duallink_possible)
>>> *conf |= 0x0100;
>> I think it might be more robust to key this off the SOR protocol, rather
>> than duplicating the condition above.
>
> You mean disp->sor.lvdsconf? What do I do with that? Or did you have
> something else in mind?
No, not that. The "proto" field you're setting set "5" in the previous
hunk when dual-link is requested is actually
NV907D_SOR_SET_CONTROL_PROTOCOL_DUAL_TMDS - which is what is parsed here
with (ctrl & 0x00000f00).
So, instead of "if (pclk >= 165000)" here, you should just be able to do
"(*conf == 5)".
I have no idea why the BIOS tables identify the dual-link data with
0x0105 instead of 0x0005, when "5" already indicates DUAL_TMDS - but anyway.
>
>>
>>> break;
>>> case DCB_OUTPUT_LVDS:
>>> diff --git a/drm/nouveau/nvkm/engine/disp/nv50.c b/drm/nouveau/nvkm/engine/disp/nv50.c
>>> index 32e73a9..ceecd0e 100644
>>> --- a/drm/nouveau/nvkm/engine/disp/nv50.c
>>> +++ b/drm/nouveau/nvkm/engine/disp/nv50.c
>>> @@ -391,7 +391,7 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
>>> switch (outp->info.type) {
>>> case DCB_OUTPUT_TMDS:
>>> *conf = (ctrl & 0x00000f00) >> 8;
>>> - if (pclk >= 165000)
>>> + if (pclk >= 165000 && outp->info.duallink_possible)
>>> *conf |= 0x0100;
>> Same here.
>>
>>> break;
>>> case DCB_OUTPUT_LVDS:
>>>
>>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-04 1:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:41 [PATCH 1/2] disp: activate dual link TMDS links only when possible Ilia Mirkin
[not found] ` <1446590484-8670-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-11-03 22:41 ` [PATCH 2/2] connector: allow 225/297MHz pixel clocks for HDMI on Fermi/Kepler Ilia Mirkin
2015-11-04 0:02 ` [PATCH 1/2] disp: activate dual link TMDS links only when possible Ben Skeggs
[not found] ` <56394B31.2050504-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-04 0:37 ` Ilia Mirkin
[not found] ` <CAKb7Uvi1uJt29hW4-VbVCwaTD4cOT5VZ9AbFvUdUYg8NZ957hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-04 1:10 ` Ben Skeggs
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.