From: Todd Previte <tprevite@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/13] drm/i915: Make the DP rates int instead of uint32_t
Date: Fri, 13 Mar 2015 15:45:09 -0700 [thread overview]
Message-ID: <55036875.3030105@gmail.com> (raw)
In-Reply-To: <1426173039-24584-2-git-send-email-ville.syrjala@linux.intel.com>
On 3/12/2015 8:10 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> No point in using uint32_t here, just plain old int will do.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 33d5877..1fa8cc1 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -85,10 +85,9 @@ static const struct dp_link_dpll chv_dpll[] = {
> { .p1 = 2, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } }
> };
> /* Skylake supports following rates */
> -static const uint32_t gen9_rates[] = { 162000, 216000, 270000, 324000,
> - 432000, 540000 };
> -
> -static const uint32_t default_rates[] = { 162000, 270000, 540000 };
> +static const int gen9_rates[] = { 162000, 216000, 270000,
> + 324000, 432000, 540000 };
> +static const int default_rates[] = { 162000, 270000, 540000 };
>
> /**
> * is_edp - is the given port attached to an eDP panel (either CPU or PCH)
> @@ -1139,7 +1138,7 @@ hsw_dp_set_ddi_pll_sel(struct intel_crtc_state *pipe_config, int link_bw)
> }
>
> static int
> -intel_read_sink_rates(struct intel_dp *intel_dp, uint32_t *sink_rates)
> +intel_read_sink_rates(struct intel_dp *intel_dp, int *sink_rates)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> int i = 0;
> @@ -1166,7 +1165,7 @@ intel_read_sink_rates(struct intel_dp *intel_dp, uint32_t *sink_rates)
> }
>
> static int
> -intel_read_source_rates(struct intel_dp *intel_dp, uint32_t *source_rates)
> +intel_read_source_rates(struct intel_dp *intel_dp, int *source_rates)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> int i;
> @@ -1217,8 +1216,9 @@ intel_dp_set_clock(struct intel_encoder *encoder,
> }
> }
>
> -static int intel_supported_rates(const uint32_t *source_rates, int source_len,
> -const uint32_t *sink_rates, int sink_len, uint32_t *supported_rates)
> +static int intel_supported_rates(const int *source_rates, int source_len,
> + const int *sink_rates, int sink_len,
> + int *supported_rates)
> {
> int i = 0, j = 0, k = 0;
>
> @@ -1245,7 +1245,7 @@ const uint32_t *sink_rates, int sink_len, uint32_t *supported_rates)
> return k;
> }
>
> -static int rate_to_index(uint32_t find, const uint32_t *rates)
> +static int rate_to_index(int find, const int *rates)
> {
> int i = 0;
>
> @@ -1275,9 +1275,9 @@ intel_dp_compute_config(struct intel_encoder *encoder,
> int max_clock;
> int bpp, mode_rate;
> int link_avail, link_clock;
> - uint32_t sink_rates[8];
> - uint32_t supported_rates[8] = {0};
> - uint32_t source_rates[8];
> + int sink_rates[8];
> + int supported_rates[8] = {0};
> + int source_rates[8];
> int source_len, sink_len, supported_len;
>
> sink_len = intel_read_sink_rates(intel_dp, sink_rates);
Since you're going through the work to redo all the link rates, does it
make more sense to have the numerical rates defined in an enum then
referenced by enumerated type in the arrays? Functionally it really
won't make any difference but it might make it easier to understand
which platforms support which rates at a glance. Certainly not a
blocking request, just a thought.
Otherwise this looks fine.
Reviewed-by: Todd Previte <tprevite@gmail.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-13 22:45 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 15:10 [PATCH 00/13] drm/i915: Clean up the DP link rate code ville.syrjala
2015-03-12 15:10 ` [PATCH 01/13] drm/i915: Make the DP rates int instead of uint32_t ville.syrjala
2015-03-13 22:45 ` Todd Previte [this message]
2015-03-12 15:10 ` [PATCH 02/13] drm/i915: Store the converted link rates in intel_dp->supported_rates[] ville.syrjala
2015-03-13 22:58 ` Todd Previte
2015-03-12 15:10 ` [PATCH 03/13] drm/i915: Don't copy the DP source rates arrays ville.syrjala
2015-03-13 23:04 ` Todd Previte
2015-03-16 9:13 ` Jindal, Sonika
2015-03-16 9:34 ` Ville Syrjälä
2015-03-16 9:37 ` Jindal, Sonika
2015-03-16 10:55 ` Ville Syrjälä
2015-03-16 11:33 ` sonika
2015-03-16 11:55 ` Ville Syrjälä
2015-03-12 15:10 ` [PATCH 04/13] drm/i915: Don't copy sink rates either ville.syrjala
2015-03-12 15:10 ` [PATCH 05/13] drm/i915: Remove special case from intel_supported_rates() ville.syrjala
2015-03-12 15:10 ` [PATCH 06/13] drm/i915: Fully separate source vs. sink rates ville.syrjala
2015-03-17 10:06 ` Daniel Vetter
2015-03-12 15:10 ` [PATCH 07/13] drm/i915: Hide the source vs. sink rate handling from intel_dp_compute_config() ville.syrjala
2015-03-13 11:44 ` sonika
2015-03-13 12:02 ` Ville Syrjälä
2015-03-13 11:56 ` sonika
2015-03-12 15:10 ` [PATCH 08/13] drm/i915: Fix max link rate in intel_dp_mode_valid() ville.syrjala
2015-03-12 15:10 ` [PATCH 09/13] drm/i915: Use DP_LINK_RATE_SET whenever possible ville.syrjala
2015-03-12 15:10 ` [PATCH 10/13] drm/i915: Fix MST link rate handling ville.syrjala
2015-03-12 15:10 ` [PATCH 11/13] drm/i915: Avoid overflowing the DP link rate arrays ville.syrjala
2015-03-12 15:10 ` [PATCH 12/13] drm/i915: Add eDP intermediate frequencies for CHV ville.syrjala
2015-03-12 15:10 ` [PATCH 13/13] drm/i915: Include the sink/source/supported rates in debug output ville.syrjala
2015-03-12 19:42 ` shuang.he
2015-03-13 17:40 ` [PATCH 14/13] drm/i915: Unconfuse DP link rate array names ville.syrjala
2015-03-17 9:45 ` sonika
2015-03-17 10:13 ` Daniel Vetter
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=55036875.3030105@gmail.com \
--to=tprevite@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
/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