diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-09-06 16:29:00 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-13 08:52:16 -0400 |
commit | 42571aefafb1d330ef84eb29418832f72e7dfb4c (patch) | |
tree | c1c9e5cefc5228750b75511f3b2d1803b6f9cb23 /drivers/gpu/drm/i915/intel_display.c | |
parent | 3c52f4eb9335475b7336e2d9f42cd2d41b83fc97 (diff) |
drm/i915: Add support for pipe_bpp readout
On CTG+ read out the pipe bpp setting from hardware and fill it into
pipe config. Also check it appropriately.
v2: Don't do the pipe_bpp extraction inside the PCH only code block on
ILK+.
Avoid the PIPECONF read as we already have read it for the
PIPECONF_EANBLE check.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f1b3d33320d1..1f280cc7b1e3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4997,6 +4997,22 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc, | |||
4997 | if (!(tmp & PIPECONF_ENABLE)) | 4997 | if (!(tmp & PIPECONF_ENABLE)) |
4998 | return false; | 4998 | return false; |
4999 | 4999 | ||
5000 | if (IS_G4X(dev) || IS_VALLEYVIEW(dev)) { | ||
5001 | switch (tmp & PIPECONF_BPC_MASK) { | ||
5002 | case PIPECONF_6BPC: | ||
5003 | pipe_config->pipe_bpp = 18; | ||
5004 | break; | ||
5005 | case PIPECONF_8BPC: | ||
5006 | pipe_config->pipe_bpp = 24; | ||
5007 | break; | ||
5008 | case PIPECONF_10BPC: | ||
5009 | pipe_config->pipe_bpp = 30; | ||
5010 | break; | ||
5011 | default: | ||
5012 | break; | ||
5013 | } | ||
5014 | } | ||
5015 | |||
5000 | intel_get_pipe_timings(crtc, pipe_config); | 5016 | intel_get_pipe_timings(crtc, pipe_config); |
5001 | 5017 | ||
5002 | i9xx_get_pfit_config(crtc, pipe_config); | 5018 | i9xx_get_pfit_config(crtc, pipe_config); |
@@ -5895,6 +5911,23 @@ static bool ironlake_get_pipe_config(struct intel_crtc *crtc, | |||
5895 | if (!(tmp & PIPECONF_ENABLE)) | 5911 | if (!(tmp & PIPECONF_ENABLE)) |
5896 | return false; | 5912 | return false; |
5897 | 5913 | ||
5914 | switch (tmp & PIPECONF_BPC_MASK) { | ||
5915 | case PIPECONF_6BPC: | ||
5916 | pipe_config->pipe_bpp = 18; | ||
5917 | break; | ||
5918 | case PIPECONF_8BPC: | ||
5919 | pipe_config->pipe_bpp = 24; | ||
5920 | break; | ||
5921 | case PIPECONF_10BPC: | ||
5922 | pipe_config->pipe_bpp = 30; | ||
5923 | break; | ||
5924 | case PIPECONF_12BPC: | ||
5925 | pipe_config->pipe_bpp = 36; | ||
5926 | break; | ||
5927 | default: | ||
5928 | break; | ||
5929 | } | ||
5930 | |||
5898 | if (I915_READ(PCH_TRANSCONF(crtc->pipe)) & TRANS_ENABLE) { | 5931 | if (I915_READ(PCH_TRANSCONF(crtc->pipe)) & TRANS_ENABLE) { |
5899 | struct intel_shared_dpll *pll; | 5932 | struct intel_shared_dpll *pll; |
5900 | 5933 | ||
@@ -8624,6 +8657,9 @@ intel_pipe_config_compare(struct drm_device *dev, | |||
8624 | PIPE_CONF_CHECK_X(dpll_hw_state.fp0); | 8657 | PIPE_CONF_CHECK_X(dpll_hw_state.fp0); |
8625 | PIPE_CONF_CHECK_X(dpll_hw_state.fp1); | 8658 | PIPE_CONF_CHECK_X(dpll_hw_state.fp1); |
8626 | 8659 | ||
8660 | if (IS_G4X(dev) || INTEL_INFO(dev)->gen >= 5) | ||
8661 | PIPE_CONF_CHECK_I(pipe_bpp); | ||
8662 | |||
8627 | #undef PIPE_CONF_CHECK_X | 8663 | #undef PIPE_CONF_CHECK_X |
8628 | #undef PIPE_CONF_CHECK_I | 8664 | #undef PIPE_CONF_CHECK_I |
8629 | #undef PIPE_CONF_CHECK_FLAGS | 8665 | #undef PIPE_CONF_CHECK_FLAGS |