diff options
| author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2013-01-03 13:38:45 -0500 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2013-01-13 03:07:45 -0500 |
| commit | c684cef795cb5356ae7f6a7ad613946eef14265f (patch) | |
| tree | fc13ab8584bea1f047ff5b07cccde9fe5b764763 | |
| parent | f20ebd034eab43fd38c58b11c5bb5fb125e5f7d7 (diff) | |
drm/nv50/disp: fix selection of bios script for analog outputs
Analog output number was overwritten by value from digital output path.
Fix it.
Fixes resume from s2ram: https://bugs.freedesktop.org/show_bug.cgi?id=58729
(as stumbled on by J Binder, Pontus Fuchs and me)
Fixes blank screen on module load (reported by Sune Mølgaard).
Fixes regression from commit 186ecad21c854385823a430b1402053ae7fd59dc
("drm/nv50/disp: move remaining interrupt handling into core").
Reported-by: J Binder <wheel@herr-der-mails.de>
Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Reported-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c index 0f09af135415..ca1a7d76a95b 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | |||
| @@ -851,20 +851,23 @@ exec_script(struct nv50_disp_priv *priv, int head, int id) | |||
| 851 | for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) | 851 | for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) |
| 852 | ctrl = nv_rd32(priv, 0x610b5c + (i * 8)); | 852 | ctrl = nv_rd32(priv, 0x610b5c + (i * 8)); |
| 853 | 853 | ||
| 854 | if (nv_device(priv)->chipset < 0x90 || | 854 | if (!(ctrl & (1 << head))) { |
| 855 | nv_device(priv)->chipset == 0x92 || | 855 | if (nv_device(priv)->chipset < 0x90 || |
| 856 | nv_device(priv)->chipset == 0xa0) { | 856 | nv_device(priv)->chipset == 0x92 || |
| 857 | for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) | 857 | nv_device(priv)->chipset == 0xa0) { |
| 858 | ctrl = nv_rd32(priv, 0x610b74 + (i * 8)); | 858 | for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) |
| 859 | i += 3; | 859 | ctrl = nv_rd32(priv, 0x610b74 + (i * 8)); |
| 860 | } else { | 860 | i += 4; |
| 861 | for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) | 861 | } else { |
| 862 | ctrl = nv_rd32(priv, 0x610798 + (i * 8)); | 862 | for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) |
| 863 | i += 3; | 863 | ctrl = nv_rd32(priv, 0x610798 + (i * 8)); |
| 864 | i += 4; | ||
| 865 | } | ||
| 864 | } | 866 | } |
| 865 | 867 | ||
| 866 | if (!(ctrl & (1 << head))) | 868 | if (!(ctrl & (1 << head))) |
| 867 | return false; | 869 | return false; |
| 870 | i--; | ||
| 868 | 871 | ||
| 869 | data = exec_lookup(priv, head, i, ctrl, &dcb, &ver, &hdr, &cnt, &len, &info); | 872 | data = exec_lookup(priv, head, i, ctrl, &dcb, &ver, &hdr, &cnt, &len, &info); |
| 870 | if (data) { | 873 | if (data) { |
| @@ -898,20 +901,23 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk, | |||
| 898 | for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) | 901 | for (i = 0; !(ctrl & (1 << head)) && i < 3; i++) |
| 899 | ctrl = nv_rd32(priv, 0x610b58 + (i * 8)); | 902 | ctrl = nv_rd32(priv, 0x610b58 + (i * 8)); |
| 900 | 903 | ||
| 901 | if (nv_device(priv)->chipset < 0x90 || | 904 | if (!(ctrl & (1 << head))) { |
| 902 | nv_device(priv)->chipset == 0x92 || | 905 | if (nv_device(priv)->chipset < 0x90 || |
| 903 | nv_device(priv)->chipset == 0xa0) { | 906 | nv_device(priv)->chipset == 0x92 || |
| 904 | for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) | 907 | nv_device(priv)->chipset == 0xa0) { |
| 905 | ctrl = nv_rd32(priv, 0x610b70 + (i * 8)); | 908 | for (i = 0; !(ctrl & (1 << head)) && i < 2; i++) |
| 906 | i += 3; | 909 | ctrl = nv_rd32(priv, 0x610b70 + (i * 8)); |
| 907 | } else { | 910 | i += 4; |
| 908 | for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) | 911 | } else { |
| 909 | ctrl = nv_rd32(priv, 0x610794 + (i * 8)); | 912 | for (i = 0; !(ctrl & (1 << head)) && i < 4; i++) |
| 910 | i += 3; | 913 | ctrl = nv_rd32(priv, 0x610794 + (i * 8)); |
| 914 | i += 4; | ||
| 915 | } | ||
| 911 | } | 916 | } |
| 912 | 917 | ||
| 913 | if (!(ctrl & (1 << head))) | 918 | if (!(ctrl & (1 << head))) |
| 914 | return 0x0000; | 919 | return 0x0000; |
| 920 | i--; | ||
| 915 | 921 | ||
| 916 | data = exec_lookup(priv, head, i, ctrl, outp, &ver, &hdr, &cnt, &len, &info1); | 922 | data = exec_lookup(priv, head, i, ctrl, outp, &ver, &hdr, &cnt, &len, &info1); |
| 917 | if (!data) | 923 | if (!data) |
