From 5cc64032d8984017c49adb783dc0f4e560ec1b86 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 27 Feb 2013 09:09:30 -0800 Subject: [PATCH] 3.8-stable patches added patches: drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch --- ...xternal-transmitter-type-if-off-chip.patch | 48 +++++++++++ ...-a-type-mask-hash-in-parsed-dcb-data.patch | 86 +++++++++++++++++++ ...gic-for-running-encoder-init-scripts.patch | 51 +++++++++++ queue-3.8/series | 3 + 4 files changed, 188 insertions(+) create mode 100644 queue-3.8/drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch create mode 100644 queue-3.8/drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch create mode 100644 queue-3.8/drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch diff --git a/queue-3.8/drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch b/queue-3.8/drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch new file mode 100644 index 00000000000..25edca13a04 --- /dev/null +++ b/queue-3.8/drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch @@ -0,0 +1,48 @@ +From f3ed1048715f2edc10c4dda6148b60e93f6282ed Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Tue, 12 Feb 2013 10:16:31 +1000 +Subject: drm/nouveau/bios: parse external transmitter type if off-chip + +From: Ben Skeggs + +commit f3ed1048715f2edc10c4dda6148b60e93f6282ed upstream. + +Signed-off-by: Ben Skeggs +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h | 1 + + drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | 5 ++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h ++++ b/drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h +@@ -25,6 +25,7 @@ struct dcb_output { + uint8_t or; + uint8_t link; + bool duallink_possible; ++ uint8_t extdev; + union { + struct sor_conf { + int link; +--- a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c ++++ b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +@@ -135,6 +135,9 @@ dcb_outp_parse(struct nouveau_bios *bios + case DCB_OUTPUT_DP: + outp->link = (conf & 0x00000030) >> 4; + outp->sorconf.link = outp->link; /*XXX*/ ++ outp->extdev = 0x00; ++ if (outp->location != 0) ++ outp->extdev = (conf & 0x0000ff00) >> 8; + break; + default: + break; +@@ -147,7 +150,7 @@ dcb_outp_parse(struct nouveau_bios *bios + static inline u16 + dcb_outp_hasht(struct dcb_output *outp) + { +- return outp->type; ++ return (outp->location << 4) | outp->type; + } + + static inline u16 diff --git a/queue-3.8/drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch b/queue-3.8/drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch new file mode 100644 index 00000000000..1513100c87c --- /dev/null +++ b/queue-3.8/drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch @@ -0,0 +1,86 @@ +From 8e992c8d9eebc2bd3246252ee5c0422dbbbce7ae Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Sat, 16 Feb 2013 12:01:59 +1000 +Subject: drm/nouveau/bios: store a type/mask hash in parsed dcb data + +From: Ben Skeggs + +commit 8e992c8d9eebc2bd3246252ee5c0422dbbbce7ae upstream. + +Matches format used by a couple of other vbios tables, useful +to have laying around already calculated. + +Signed-off-by: Ben Skeggs +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h | 2 + + drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | 29 +++++++++-------- + 2 files changed, 18 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h ++++ b/drivers/gpu/drm/nouveau/core/include/subdev/bios/dcb.h +@@ -16,6 +16,8 @@ enum dcb_output_type { + + struct dcb_output { + int index; /* may not be raw dcb index if merging has happened */ ++ u16 hasht; ++ u16 hashm; + enum dcb_output_type type; + uint8_t i2c_index; + uint8_t heads; +--- a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c ++++ b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +@@ -107,6 +107,18 @@ dcb_outp(struct nouveau_bios *bios, u8 i + return 0x0000; + } + ++static inline u16 ++dcb_outp_hasht(struct dcb_output *outp) ++{ ++ return (outp->extdev << 8) | (outp->location << 4) | outp->type; ++} ++ ++static inline u16 ++dcb_outp_hashm(struct dcb_output *outp) ++{ ++ return (outp->heads << 8) | (outp->link << 6) | outp->or; ++} ++ + u16 + dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len, + struct dcb_output *outp) +@@ -143,29 +155,20 @@ dcb_outp_parse(struct nouveau_bios *bios + break; + } + } ++ ++ outp->hasht = dcb_outp_hasht(outp); ++ outp->hashm = dcb_outp_hashm(outp); + } + return dcb; + } + +-static inline u16 +-dcb_outp_hasht(struct dcb_output *outp) +-{ +- return (outp->location << 4) | outp->type; +-} +- +-static inline u16 +-dcb_outp_hashm(struct dcb_output *outp) +-{ +- return (outp->heads << 8) | (outp->link << 6) | outp->or; +-} +- + u16 + dcb_outp_match(struct nouveau_bios *bios, u16 type, u16 mask, + u8 *ver, u8 *len, struct dcb_output *outp) + { + u16 dcb, idx = 0; + while ((dcb = dcb_outp_parse(bios, idx++, ver, len, outp))) { +- if (dcb_outp_hasht(outp) == type) { ++ if ((dcb_outp_hasht(outp) & 0x00ff) == (type & 0x00ff)) { + if ((dcb_outp_hashm(outp) & mask) == mask) + break; + } diff --git a/queue-3.8/drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch b/queue-3.8/drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch new file mode 100644 index 00000000000..3defb5ac5f5 --- /dev/null +++ b/queue-3.8/drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch @@ -0,0 +1,51 @@ +From ac8cc241a81941932da44993242e68c62e115ec7 Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Sat, 16 Feb 2013 12:10:38 +1000 +Subject: drm/nv50/devinit: reverse the logic for running encoder init scripts + +From: Ben Skeggs + +commit ac8cc241a81941932da44993242e68c62e115ec7 upstream. + +A single U encoder table can match multiple DCB entries, whereas the +reverse is not true and can lead to us not matching a DCB entry at +all, and fail to initialise some encoders. + +Signed-off-by: Ben Skeggs +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c ++++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c +@@ -78,12 +78,13 @@ nv50_devinit_init(struct nouveau_object + if (ret) + return ret; + +- /* if we ran the init tables, execute first script pointer for each +- * display table output entry that has a matching dcb entry. ++ /* if we ran the init tables, we have to execute the first script ++ * pointer of each dcb entry's display encoder table in order ++ * to properly initialise each encoder. + */ +- while (priv->base.post && ver) { +- u16 data = nvbios_outp_parse(bios, i++, &ver, &hdr, &cnt, &len, &info); +- if (data && dcb_outp_match(bios, info.type, info.mask, &ver, &len, &outp)) { ++ while (priv->base.post && dcb_outp_parse(bios, i, &ver, &hdr, &outp)) { ++ if (nvbios_outp_match(bios, outp.hasht, outp.hashm, ++ &ver, &hdr, &cnt, &len, &info)) { + struct nvbios_init init = { + .subdev = nv_subdev(priv), + .bios = bios, +@@ -95,7 +96,8 @@ nv50_devinit_init(struct nouveau_object + + nvbios_exec(&init); + } +- }; ++ i++; ++ } + + return 0; + } diff --git a/queue-3.8/series b/queue-3.8/series index ab92181ea52..8ea7585b823 100644 --- a/queue-3.8/series +++ b/queue-3.8/series @@ -149,3 +149,6 @@ usb-usb-storage-unusual_devs-update-for-super-top-sata-bridge.patch usb-musb-core-fix-failure-path.patch usb-musb-fix-dependency-on-transceiver-driver.patch usb-musb-ux500-use-clk_prepare_enable-and-clk_disable_unprepare.patch +drm-nouveau-bios-parse-external-transmitter-type-if-off-chip.patch +drm-nouveau-bios-store-a-type-mask-hash-in-parsed-dcb-data.patch +drm-nv50-devinit-reverse-the-logic-for-running-encoder-init-scripts.patch -- 2.47.3