From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 12/14] drm/i915: Clean up encoder->crtc_mask setup
Date: Mon, 18 Jun 2018 21:27:52 +0300 [thread overview]
Message-ID: <87zhzsx847.fsf@intel.com> (raw)
In-Reply-To: <20180615164925.28971-13-ville.syrjala@linux.intel.com>
On Fri, 15 Jun 2018, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Use BIT(pipe) for better legibility when populating the crtc_mask
> for encoders.
>
> Also remove the redundant possible_crtcs setup for the TV encoder.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_crt.c | 4 ++--
> drivers/gpu/drm/i915/intel_ddi.c | 2 +-
> drivers/gpu/drm/i915/intel_dp.c | 6 +++---
> drivers/gpu/drm/i915/intel_dvo.c | 2 +-
> drivers/gpu/drm/i915/intel_hdmi.c | 6 +++---
> drivers/gpu/drm/i915/intel_lvds.c | 6 +++---
> drivers/gpu/drm/i915/intel_sdvo.c | 2 +-
> drivers/gpu/drm/i915/intel_tv.c | 3 +--
> 8 files changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 95aa29cf2d9c..b6b1464a47b2 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -967,9 +967,9 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
> crt->base.type = INTEL_OUTPUT_ANALOG;
> crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI);
> if (IS_I830(dev_priv))
> - crt->base.crtc_mask = (1 << 0);
> + crt->base.crtc_mask = BIT(PIPE_A);
> else
> - crt->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + crt->base.crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
>
> if (IS_GEN2(dev_priv))
> connector->interlace_allowed = 0;
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index ca73387bd596..0462d9b31f7d 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -3514,7 +3514,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> intel_encoder->type = INTEL_OUTPUT_DDI;
> intel_encoder->power_domain = intel_port_to_power_domain(port);
> intel_encoder->port = port;
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
> intel_encoder->cloneable = 0;
>
> if (INTEL_GEN(dev_priv) >= 11)
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index a58bac01aeea..d983924ed69a 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -6474,11 +6474,11 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
> intel_encoder->power_domain = intel_port_to_power_domain(port);
> if (IS_CHERRYVIEW(dev_priv)) {
> if (port == PORT_D)
> - intel_encoder->crtc_mask = 1 << 2;
> + intel_encoder->crtc_mask = BIT(PIPE_C);
> else
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
> } else {
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
> }
> intel_encoder->cloneable = 0;
> intel_encoder->port = port;
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index 27f16db8953a..27c18680deb4 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -499,7 +499,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
> intel_encoder->type = INTEL_OUTPUT_DVO;
> intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
> intel_encoder->port = port;
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
>
> switch (dvo->type) {
> case INTEL_DVO_CHIP_TMDS:
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 09d7d38f0d4e..666bcc1a4660 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -2405,11 +2405,11 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
> intel_encoder->port = port;
> if (IS_CHERRYVIEW(dev_priv)) {
> if (port == PORT_D)
> - intel_encoder->crtc_mask = 1 << 2;
> + intel_encoder->crtc_mask = BIT(PIPE_C);
> else
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
> } else {
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
> }
> intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG;
> /*
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index bb06744d28a4..753df8dd9a03 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -1085,11 +1085,11 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
> intel_encoder->port = PORT_NONE;
> intel_encoder->cloneable = 0;
> if (HAS_PCH_SPLIT(dev_priv))
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
> else if (IS_GEN4(dev_priv))
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
> else
> - intel_encoder->crtc_mask = (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_B);
>
> drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
> connector->display_info.subpixel_order = SubPixelHorizontalRGB;
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index e6a64b3ecd91..ef540cf00373 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -2741,7 +2741,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
> bytes[0], bytes[1]);
> return false;
> }
> - intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
> + intel_sdvo->base.crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
>
> return true;
> }
> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
> index 24dc368fdaa1..7a68c132d08c 100644
> --- a/drivers/gpu/drm/i915/intel_tv.c
> +++ b/drivers/gpu/drm/i915/intel_tv.c
> @@ -1520,9 +1520,8 @@ intel_tv_init(struct drm_i915_private *dev_priv)
> intel_encoder->type = INTEL_OUTPUT_TVOUT;
> intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
> intel_encoder->port = PORT_NONE;
> - intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
> + intel_encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B);
> intel_encoder->cloneable = 0;
> - intel_encoder->base.possible_crtcs = ((1 << 0) | (1 << 1));
> intel_tv->type = DRM_MODE_CONNECTOR_Unknown;
>
> /* BIOS margin values */
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-06-18 18:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 16:49 [PATCH 00/14] drm: Try to fix encoder possible_clones/crtcs Ville Syrjala
2018-06-15 16:49 ` [PATCH 01/14] drm: Add drm_encoder_mask() Ville Syrjala
2018-06-15 16:49 ` [PATCH 02/14] drm: Include the encoder itself in possible_clones Ville Syrjala
2018-06-15 16:49 ` [PATCH 03/14] drm/gma500: Sanitize possible_clones Ville Syrjala
2018-06-15 16:49 ` [PATCH 04/14] drm/sti: Remove pointless casts Ville Syrjala
2018-06-18 7:53 ` Benjamin Gaignard
2018-06-15 16:49 ` [PATCH 05/14] drm/sti: Try to fix up the tvout possible clones Ville Syrjala
2018-06-18 8:16 ` Benjamin Gaignard
2018-06-18 12:38 ` [PATCH v2 " Ville Syrjala
2018-06-20 9:02 ` Benjamin Gaignard
2018-06-15 16:49 ` [PATCH 06/14] drm/exynos: Use drm_encoder_mask() Ville Syrjala
2018-06-15 16:49 ` [PATCH 07/14] drm/imx: Remove the bogus possible_clones setup Ville Syrjala
2018-06-15 16:49 ` [PATCH 08/14] drm: Validate encoder->possible_clones Ville Syrjala
2018-06-15 16:49 ` [PATCH 09/14] drm/i915: Use drm_encoder_mask() Ville Syrjala
2018-06-15 16:49 ` [PATCH 10/14] drm/i915: Populate possible_crtcs correctly Ville Syrjala
2018-06-22 1:26 ` Dhinakaran Pandiyan
2018-06-25 11:10 ` Ville Syrjälä
2018-06-25 18:37 ` Dhinakaran Pandiyan
2018-06-15 16:49 ` [PATCH 11/14] drm/i915: Fix DP-MST crtc_mask Ville Syrjala
2018-06-15 18:33 ` Dhinakaran Pandiyan
2018-06-15 18:43 ` Ville Syrjälä
2018-06-22 0:36 ` [Intel-gfx] " Dhinakaran Pandiyan
2018-06-15 16:49 ` [PATCH 12/14] drm/i915: Clean up encoder->crtc_mask setup Ville Syrjala
2018-06-18 18:27 ` Jani Nikula [this message]
2018-06-15 16:49 ` [PATCH 13/14] drm/i915: Simplfy LVDS crtc_mask setup Ville Syrjala
2018-06-15 16:49 ` [PATCH 14/14] drm: Validate encoder->possible_crtcs Ville Syrjala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhzsx847.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox