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

Commit 6a52193b authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm: Use drm_crtc_mask()



Use drm_crtc_mask() where appropriate.

Mostly performed with coccinelle:
@@
@@
- (1<<drm_crtc_index(
+ drm_crtc_mask(
  ...)
-  )

@@
@@
- 1<<drm_crtc_index(
+ drm_crtc_mask(
  ...)

@@
@@
- BIT(drm_crtc_index(
+ drm_crtc_mask(
  ...)
- )

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-2-ville.syrjala@linux.intel.com


Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 62f77ad0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -329,9 +329,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
	crtc->primary = primary;
	crtc->primary = primary;
	crtc->cursor = cursor;
	crtc->cursor = cursor;
	if (primary && !primary->possible_crtcs)
	if (primary && !primary->possible_crtcs)
		primary->possible_crtcs = 1 << drm_crtc_index(crtc);
		primary->possible_crtcs = drm_crtc_mask(crtc);
	if (cursor && !cursor->possible_crtcs)
	if (cursor && !cursor->possible_crtcs)
		cursor->possible_crtcs = 1 << drm_crtc_index(crtc);
		cursor->possible_crtcs = drm_crtc_mask(crtc);


	ret = drm_crtc_crc_init(crtc);
	ret = drm_crtc_crc_init(crtc);
	if (ret) {
	if (ret) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -281,7 +281,7 @@ int drm_simple_display_pipe_init(struct drm_device *dev,
	if (ret)
	if (ret)
		return ret;
		return ret;


	encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
	encoder->possible_crtcs = drm_crtc_mask(crtc);
	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
			       DRM_MODE_ENCODER_NONE, NULL);
			       DRM_MODE_ENCODER_NONE, NULL);
	if (ret || !connector)
	if (ret || !connector)