From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: avoid unnecessary call to intel_hpd_pin_to_port
Date: Fri, 06 Oct 2017 09:56:46 -0300 [thread overview]
Message-ID: <1507294606.26572.27.camel@intel.com> (raw)
In-Reply-To: <20171005214910.x4grwwvgdiiaeceu@intel.com>
Em Qui, 2017-10-05 às 14:49 -0700, Rodrigo Vivi escreveu:
> On Thu, Oct 05, 2017 at 09:38:41PM +0000, Paulo Zanoni wrote:
> > Don't call it when we can do like the other functions and just look
> > at
> > port->port. Also rename the intel_digital_port variable to make it
> > look like the other functions.
>
> what other functions?
All the _digital_port_connected() functions from intel_dp.c.
>
> Most of our functions use intel_dig_port. Also dport and less used is
> port.
>
> $ grep -r "intel_digital_port \*intel_dig_port" drivers/gpu/drm/i915/
> | wc -l
> 93
> $ grep -r "intel_digital_port \*port" drivers/gpu/drm/i915/ | wc -l
> 11
> $ grep -r "intel_digital_port \*dport" drivers/gpu/drm/i915/ | wc -l
> 18
>
> >
> > My main goal here is to prevent the copy-pasters from propagating
> > the
> > call to other parts of the code.
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_dp.c | 9 +++------
> > 1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index ca48bce..6fb90fa 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -4614,14 +4614,11 @@ static bool
> > bdw_digital_port_connected(struct drm_i915_private *dev_priv,
> > }
> >
> > static bool bxt_digital_port_connected(struct drm_i915_private
> > *dev_priv,
> > - struct intel_digital_port
> > *intel_dig_port)
> > + struct intel_digital_port
> > *port)
> > {
> > - struct intel_encoder *intel_encoder = &intel_dig_port-
> > >base;
> > - enum port port;
> > u32 bit;
> >
> > - port = intel_hpd_pin_to_port(intel_encoder->hpd_pin);
> > - switch (port) {
> > + switch (port->port) {
> > case PORT_A:
> > bit = BXT_DE_PORT_HP_DDIA;
> > break;
> > @@ -4632,7 +4629,7 @@ static bool bxt_digital_port_connected(struct
> > drm_i915_private *dev_priv,
> > bit = BXT_DE_PORT_HP_DDIC;
> > break;
> > default:
> > - MISSING_CASE(port);
> > + MISSING_CASE(port->port);
> > return false;
> > }
> >
> > --
> > 2.9.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-06 12:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 21:38 [PATCH 1/2] drm/i915: avoid unnecessary call to intel_hpd_pin_to_port Paulo Zanoni
2017-10-05 21:38 ` [PATCH 2/2] drm/i915: avoid division by zero on cnl_calc_wrpll_link Paulo Zanoni
2017-10-05 21:50 ` Rodrigo Vivi
2017-10-05 21:49 ` [PATCH 1/2] drm/i915: avoid unnecessary call to intel_hpd_pin_to_port Rodrigo Vivi
2017-10-06 12:56 ` Paulo Zanoni [this message]
2017-10-09 12:31 ` Jani Nikula
2017-10-06 10:45 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " Patchwork
2017-10-06 21:19 ` Paulo Zanoni
2017-10-06 21:26 ` Manasi Navare
2017-10-09 10:14 ` Martin Peres
2017-10-09 12:29 ` [PATCH 1/2] " Jani Nikula
2017-10-09 13:25 ` Ville Syrjälä
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=1507294606.26572.27.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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.