Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau/dp: remove broken display depth function, use the improved one

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+12 -22
+12 -22
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 78 78 return NULL; 79 79 } 80 80 81 - /*TODO: This could use improvement, and learn to handle the fixed 82 - * BIOS tables etc. It's fine currently, for its only user. 83 - */ 84 - int 85 - nouveau_connector_bpp(struct drm_connector *connector) 86 - { 87 - struct nouveau_connector *nv_connector = nouveau_connector(connector); 88 - 89 - if (nv_connector->edid && nv_connector->edid->revision >= 4) { 90 - u8 bpc = ((nv_connector->edid->input & 0x70) >> 3) + 4; 91 - if (bpc > 4) 92 - return bpc; 93 - } 94 - 95 - return 18; 96 - } 97 - 98 81 static void 99 82 nouveau_connector_destroy(struct drm_connector *connector) 100 83 { ··· 697 714 nv_connector->native_mode = drm_mode_duplicate(dev, &mode); 698 715 } 699 716 717 + /* Determine display colour depth for everything except LVDS now, 718 + * DP requires this before mode_valid() is called. 719 + */ 720 + if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS) 721 + nouveau_connector_detect_depth(connector); 722 + 700 723 /* Find the native mode if this is a digital panel, if we didn't 701 724 * find any modes through DDC previously add the native mode to 702 725 * the list of modes. ··· 718 729 ret = 1; 719 730 } 720 731 721 - /* Attempt to determine display colour depth, this has to happen after 722 - * we've determined the "native" mode for LVDS, as the VBIOS tables 723 - * require us to compare against a pixel clock in some cases.. 732 + /* Determine LVDS colour depth, must happen after determining 733 + * "native" mode as some VBIOS tables require us to use the 734 + * pixel clock as part of the lookup... 724 735 */ 725 - nouveau_connector_detect_depth(connector); 736 + if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) 737 + nouveau_connector_detect_depth(connector); 726 738 727 739 if (nv_encoder->dcb->type == OUTPUT_TV) 728 740 ret = get_slave_funcs(encoder)->get_modes(encoder, connector); ··· 789 799 case OUTPUT_DP: 790 800 max_clock = nv_encoder->dp.link_nr; 791 801 max_clock *= nv_encoder->dp.link_bw; 792 - clock = clock * nouveau_connector_bpp(connector) / 10; 802 + clock = clock * (connector->display_info.bpc * 3) / 10; 793 803 break; 794 804 default: 795 805 BUG_ON(1);