Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08a24034 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

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: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 0973f18f
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -7949,21 +7949,19 @@ static bool
intel_pipe_config_compare(struct intel_crtc_config *current_config,
			  struct intel_crtc_config *pipe_config)
{
	if (current_config->has_pch_encoder != pipe_config->has_pch_encoder) {
		DRM_ERROR("mismatch in has_pch_encoder "
			  "(expected %i, found %i)\n",
			  current_config->has_pch_encoder,
			  pipe_config->has_pch_encoder);
		return false;
#define PIPE_CONF_CHECK_I(name)	\
	if (current_config->name != pipe_config->name) { \
		DRM_ERROR("mismatch in " #name " " \
			  "(expected %i, found %i)\n", \
			  current_config->name, \
			  pipe_config->name); \
		return false; \
	}

	if (current_config->fdi_lanes != pipe_config->fdi_lanes) {
		DRM_ERROR("mismatch in fdi_lanes "
			  "(expected %i, found %i)\n",
			  current_config->fdi_lanes,
			  pipe_config->fdi_lanes);
		return false;
	}
	PIPE_CONF_CHECK_I(has_pch_encoder);
	PIPE_CONF_CHECK_I(fdi_lanes);

#undef PIPE_CONF_CHECK_I

	return true;
}