aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-19 05:25:34 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-29 15:51:18 -0400
commit08a24034a84866e3abb7fdb35ed0e479b240c205 (patch)
tree8152e9a940d469885d23a16e1603855f1c3d9a54 /drivers/gpu/drm/i915/intel_display.c
parent0973f18f8a764d869add12728887c2d1cc281ffb (diff)
drm/i915: introduce macros to check pipe config properties
This code will get _really_ repetive, and we'll end up with tons more of this kind. So extract the common patterns. This should also help when we add a lazy pipe_config compare mode for fastboot. Reviewed-by: Mika Kuoppala <mika.kuoppala@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.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 467c77bc7cb9..2c3cbec75b4e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7949,21 +7949,19 @@ static bool
7949intel_pipe_config_compare(struct intel_crtc_config *current_config, 7949intel_pipe_config_compare(struct intel_crtc_config *current_config,
7950 struct intel_crtc_config *pipe_config) 7950 struct intel_crtc_config *pipe_config)
7951{ 7951{
7952 if (current_config->has_pch_encoder != pipe_config->has_pch_encoder) { 7952#define PIPE_CONF_CHECK_I(name) \
7953 DRM_ERROR("mismatch in has_pch_encoder " 7953 if (current_config->name != pipe_config->name) { \
7954 "(expected %i, found %i)\n", 7954 DRM_ERROR("mismatch in " #name " " \
7955 current_config->has_pch_encoder, 7955 "(expected %i, found %i)\n", \
7956 pipe_config->has_pch_encoder); 7956 current_config->name, \
7957 return false; 7957 pipe_config->name); \
7958 return false; \
7958 } 7959 }
7959 7960
7960 if (current_config->fdi_lanes != pipe_config->fdi_lanes) { 7961 PIPE_CONF_CHECK_I(has_pch_encoder);
7961 DRM_ERROR("mismatch in fdi_lanes " 7962 PIPE_CONF_CHECK_I(fdi_lanes);
7962 "(expected %i, found %i)\n", 7963
7963 current_config->fdi_lanes, 7964#undef PIPE_CONF_CHECK_I
7964 pipe_config->fdi_lanes);
7965 return false;
7966 }
7967 7965
7968 return true; 7966 return true;
7969} 7967}