]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/dg2: Don't wait for AUX power well enable ACKs
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 21 Jul 2021 22:30:38 +0000 (15:30 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 22 Jul 2021 16:30:15 +0000 (09:30 -0700)
On DG2 we're supposed to just wait 600us after programming the well
before moving on; there won't be an ack from the hardware.

Bspec: 49296
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210721223043.834562-14-matthew.d.roper@intel.com
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/display/intel_display_power.h

index bec380e58f4063168fd02093fc0c1e97cff74ca7..4732efbb02f91a88ff9635486eeaf4b443f7066f 100644 (file)
@@ -341,6 +341,17 @@ static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
 {
        const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
        int pw_idx = power_well->desc->hsw.idx;
+       int enable_delay = power_well->desc->hsw.fixed_enable_delay;
+
+       /*
+        * For some power wells we're not supposed to watch the status bit for
+        * an ack, but rather just wait a fixed amount of time and then
+        * proceed.  This is only used on DG2.
+        */
+       if (IS_DG2(dev_priv) && enable_delay) {
+               usleep_range(enable_delay, 2 * enable_delay);
+               return;
+       }
 
        /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us. */
        if (intel_de_wait_for_set(dev_priv, regs->driver,
@@ -4828,6 +4839,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
                {
                        .hsw.regs = &icl_aux_power_well_regs,
                        .hsw.idx = ICL_PW_CTL_IDX_AUX_A,
+                       .hsw.fixed_enable_delay = 600,
                },
        },
        {
@@ -4838,6 +4850,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
                {
                        .hsw.regs = &icl_aux_power_well_regs,
                        .hsw.idx = ICL_PW_CTL_IDX_AUX_B,
+                       .hsw.fixed_enable_delay = 600,
                },
        },
        {
@@ -4848,6 +4861,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
                {
                        .hsw.regs = &icl_aux_power_well_regs,
                        .hsw.idx = ICL_PW_CTL_IDX_AUX_C,
+                       .hsw.fixed_enable_delay = 600,
                },
        },
        {
@@ -4858,6 +4872,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
                {
                        .hsw.regs = &icl_aux_power_well_regs,
                        .hsw.idx = XELPD_PW_CTL_IDX_AUX_D,
+                       .hsw.fixed_enable_delay = 600,
                },
        },
        {
@@ -4878,6 +4893,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
                {
                        .hsw.regs = &icl_aux_power_well_regs,
                        .hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
+                       .hsw.fixed_enable_delay = 600,
                },
        },
        {
index 4f0917df43755d28ebff0524afec117301986b98..22367b5cba96a9932f7270305708b0c7bec6d2a7 100644 (file)
@@ -223,6 +223,12 @@ struct i915_power_well_desc {
                        u8 idx;
                        /* Mask of pipes whose IRQ logic is backed by the pw */
                        u8 irq_pipe_mask;
+                       /*
+                        * Instead of waiting for the status bit to ack enables,
+                        * just wait a specific amount of time and then consider
+                        * the well enabled.
+                        */
+                       u16 fixed_enable_delay;
                        /* The pw is backing the VGA functionality */
                        bool has_vga:1;
                        bool has_fuses:1;