From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kahola <mika.kahola@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Get rid of hardcoded pipes
Date: Fri, 13 Oct 2017 17:13:01 +0300 [thread overview]
Message-ID: <20171013141301.GC10981@intel.com> (raw)
In-Reply-To: <1507890286-16214-1-git-send-email-mika.kahola@intel.com>
On Fri, Oct 13, 2017 at 01:24:46PM +0300, Mika Kahola wrote:
> Favor for_each_pipe() macro when looping through pipes.
>
> This patch is related to miscellenous fixes to reduce dependency on
> I915_MAX_PIPES.
>
> https://patchwork.freedesktop.org/series/30336/
These references to the other patches don't seem entirely relevant for
this commit message. So I just ripped them out and pushed this to dinq.
Thanks for the patch.
>
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp_mst.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 3c131e2..f7c7825 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -454,9 +454,10 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
> struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr);
> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> struct drm_device *dev = intel_dig_port->base.base.dev;
> + struct drm_i915_private *dev_priv = to_i915(dev);
> struct intel_connector *intel_connector;
> struct drm_connector *connector;
> - int i;
> + enum pipe pipe;
>
> intel_connector = intel_connector_alloc();
> if (!intel_connector)
> @@ -470,9 +471,9 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
> intel_connector->mst_port = intel_dp;
> intel_connector->port = port;
>
> - for (i = PIPE_A; i <= PIPE_C; i++) {
> + for_each_pipe(dev_priv, pipe) {
> drm_mode_connector_attach_encoder(&intel_connector->base,
> - &intel_dp->mst_encoders[i]->base.base);
> + &intel_dp->mst_encoders[pipe]->base.base);
> }
>
> drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0);
> @@ -569,11 +570,12 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
> static bool
> intel_dp_create_fake_mst_encoders(struct intel_digital_port *intel_dig_port)
> {
> - int i;
> struct intel_dp *intel_dp = &intel_dig_port->dp;
> + struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
> + enum pipe pipe;
>
> - for (i = PIPE_A; i <= PIPE_C; i++)
> - intel_dp->mst_encoders[i] = intel_dp_create_fake_mst_encoder(intel_dig_port, i);
> + for_each_pipe(dev_priv, pipe)
> + intel_dp->mst_encoders[pipe] = intel_dp_create_fake_mst_encoder(intel_dig_port, pipe);
> return true;
> }
>
> --
> 2.7.4
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-10-13 14:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 10:24 [PATCH] drm/i915: Get rid of hardcoded pipes Mika Kahola
2017-10-13 10:46 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-13 13:03 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-13 14:13 ` Ville Syrjälä [this message]
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=20171013141301.GC10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kahola@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.