| @@ -785,10 +785,22 @@ static void intel_disable_hdmi(struct intel_encoder *encoder) · 784 unmodified lines |
| 785 | 785 | } |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | +static int hdmi_portclock_limit(struct intel_hdmi *hdmi) |
| 789 | +{ |
| 790 | + struct drm_device *dev = intel_hdmi_to_dev(hdmi); |
| 791 | + |
| 792 | + if (IS_G4X(dev)) |
| 793 | + return 165000; |
| 794 | + else if (IS_HASWELL(dev)) |
| 795 | + return 300000; |
| 796 | + else |
| 797 | + return 225000; |
| 798 | +} |
| 799 | + |
| 788 | 800 | static int intel_hdmi_mode_valid(struct drm_connector *connector, |
| 789 | 801 | struct drm_display_mode *mode) |
| 790 | 802 | { |
| 791 | | − if (mode->clock > 165000) |
| 803 | + if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector))) |
| 792 | 804 | return MODE_CLOCK_HIGH; |
| 793 | 805 | if (mode->clock < 20000) |
| 794 | 806 | return MODE_CLOCK_LOW; |
| @@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, · 11 unmodified lines |
| 806 | 818 | struct drm_device *dev = encoder->base.dev; |
| 807 | 819 | struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; |
| 808 | 820 | int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2; |
| 821 | + int portclock_limit = hdmi_portclock_limit(intel_hdmi); |
| 809 | 822 | int desired_bpp; |
| 810 | 823 | |
| 811 | 824 | if (intel_hdmi->color_range_auto) { |
| @@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, · 17 unmodified lines |
| 829 | 842 | * outputs. We also need to check that the higher clock still fits |
| 830 | 843 | * within limits. |
| 831 | 844 | */ |
| 832 | | − if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000 |
| 845 | + if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit |
| 833 | 846 | && HAS_PCH_SPLIT(dev)) { |
| 834 | 847 | DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); |
| 835 | 848 | desired_bpp = 12*3; |
| @@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, · 10 unmodified lines |
| 846 | 859 | pipe_config->pipe_bpp = desired_bpp; |
| 847 | 860 | } |
| 848 | 861 | |
| 849 | | − if (adjusted_mode->clock > 225000) { |
| 862 | + if (adjusted_mode->clock > portclock_limit) { |
| 850 | 863 | DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n"); |
| 851 | 864 | return false; |
| 852 | 865 | } |