From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/8] drm/i915/pps: Extract msecs_to_pps_units()
Date: Wed, 6 Nov 2024 23:58:57 +0200 [thread overview]
Message-ID: <20241106215859.25446-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20241106215859.25446-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Replace all the hand rolled *10 stuff with something a bit
more descriptive (msecs_to_pps_units()).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_pps.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 6946ba0004eb..5be2903c6aaf 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -1462,6 +1462,12 @@ static bool pps_delays_valid(struct intel_pps_delays *delays)
delays->power_down || delays->power_cycle;
}
+static int msecs_to_pps_units(int msecs)
+{
+ /* PPS uses 100us units */
+ return msecs * 10;
+}
+
static void pps_init_delays_bios(struct intel_dp *intel_dp,
struct intel_pps_delays *bios)
{
@@ -1494,7 +1500,7 @@ static void pps_init_delays_vbt(struct intel_dp *intel_dp,
* seems sufficient to avoid this problem.
*/
if (intel_has_quirk(display, QUIRK_INCREASE_T12_DELAY)) {
- vbt->power_cycle = max_t(u16, vbt->power_cycle, 1300 * 10);
+ vbt->power_cycle = max_t(u16, vbt->power_cycle, msecs_to_pps_units(1300));
drm_dbg_kms(display->drm,
"Increasing T12 panel delay as per the quirk to %d\n",
vbt->power_cycle);
@@ -1510,13 +1516,12 @@ static void pps_init_delays_spec(struct intel_dp *intel_dp,
lockdep_assert_held(&display->pps.mutex);
- /* Upper limits from eDP 1.3 spec. Note that we use the clunky units of
- * our hw here, which are all in 100usec. */
- spec->power_up = (10 + 200) * 10; /* T1+T3 */
- spec->backlight_on = 50 * 10; /* no limit for T8, use T7 instead */
- spec->backlight_off = 50 * 10; /* no limit for T9, make it symmetric with T8 */
- spec->power_down = 500 * 10; /* T10 */
- spec->power_cycle = (10 + 500) * 10; /* T11+T12 */
+ /* Upper limits from eDP 1.3 spec */
+ spec->power_up = msecs_to_pps_units(10 + 200); /* T1+T3 */
+ spec->backlight_on = msecs_to_pps_units(50); /* no limit for T8, use T7 instead */
+ spec->backlight_off = msecs_to_pps_units(50); /* no limit for T9, make it symmetric with T8 */
+ spec->power_down = msecs_to_pps_units(500); /* T10 */
+ spec->power_cycle = msecs_to_pps_units(10 + 500); /* T11+T12 */
intel_pps_dump_state(intel_dp, "spec", spec);
}
@@ -1582,7 +1587,7 @@ static void pps_init_delays(struct intel_dp *intel_dp)
* HW has only a 100msec granularity for power_cycle so round it up
* accordingly.
*/
- final->power_cycle = roundup(final->power_cycle, 100 * 10);
+ final->power_cycle = roundup(final->power_cycle, msecs_to_pps_units(100));
}
static void pps_init_registers(struct intel_dp *intel_dp, bool force_disable_vdd)
--
2.45.2
next prev parent reply other threads:[~2024-11-06 22:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 21:58 [PATCH 0/8] drm/i915/pps: Some PPS cleanups Ville Syrjala
2024-11-06 21:58 ` [PATCH 1/8] drm/i915/pps: Store the power cycle delay without the +1 Ville Syrjala
2024-11-07 9:18 ` Jani Nikula
2024-11-06 21:58 ` [PATCH 2/8] drm/i915/pps: Decouple pps delays from VBT struct definition Ville Syrjala
2024-11-07 9:18 ` Jani Nikula
2024-11-06 21:58 ` [PATCH 3/8] drm/i915/pps: Rename intel_pps_delay members Ville Syrjala
2024-11-07 9:19 ` Jani Nikula
2024-11-06 21:58 ` [PATCH 4/8] drm/i915/lvds: Use struct intel_pps_delays for LVDS power sequencing Ville Syrjala
2024-11-07 9:19 ` Jani Nikula
2024-11-06 21:58 ` [PATCH 5/8] drm/i915/pps: Spell out the eDP spec power sequencing delays a bit more clearly Ville Syrjala
2024-11-07 9:19 ` Jani Nikula
2024-11-06 21:58 ` Ville Syrjala [this message]
2024-11-07 9:20 ` [PATCH 6/8] drm/i915/pps: Extract msecs_to_pps_units() Jani Nikula
2024-11-06 21:58 ` [PATCH 7/8] drm/i915/pps: Extract pps_units_to_msecs() Ville Syrjala
2024-11-07 9:20 ` Jani Nikula
2024-11-06 21:58 ` [PATCH 8/8] drm/i915/pps: Eliminate pointless get_delay() macro Ville Syrjala
2024-11-07 9:20 ` Jani Nikula
2024-11-06 22:44 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/pps: Some PPS cleanups Patchwork
2024-11-06 22:44 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-06 23:04 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-11-07 9:22 ` [PATCH 0/8] " Jani Nikula
2024-11-07 16:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/pps: Some PPS cleanups (rev2) Patchwork
2024-11-07 16:16 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-07 16:25 ` ✓ Fi.CI.BAT: success " Patchwork
2024-11-07 19:07 ` ✗ Fi.CI.IGT: failure " Patchwork
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=20241106215859.25446-7-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.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