[Intel-gfx] [PATCH 2/2] drm/i915: Use drm_crtc_mask() helper

Thierry Reding thierry.reding at gmail.com
Mon Jan 13 12:46:50 CET 2014


Replace an open-coded occurrence by a call to the new drm_crtc_mask()
helper.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/i915/intel_display.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e77d4b8856a7..807feab38ea6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8723,21 +8723,7 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
 static bool intel_encoder_crtc_ok(struct drm_encoder *encoder,
 				  struct drm_crtc *crtc)
 {
-	struct drm_device *dev;
-	struct drm_crtc *tmp;
-	int crtc_mask = 1;
-
-	WARN(!crtc, "checking null crtc?\n");
-
-	dev = crtc->dev;
-
-	list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
-		if (tmp == crtc)
-			break;
-		crtc_mask <<= 1;
-	}
-
-	if (encoder->possible_crtcs & crtc_mask)
+	if (encoder->possible_crtcs & drm_crtc_mask(crtc))
 		return true;
 	return false;
 }
-- 
1.8.4.2




More information about the Intel-gfx mailing list