All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniel@fooishbar.org>
To: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 00/31] IPS/DRRS/PSR rework with PSR enabled by default
Date: Tue, 10 Nov 2015 16:26:56 +0000	[thread overview]
Message-ID: <CAPj87rPQ8orkphU_6-kWW+rTHGvCo1QWMuLFAQttdzP8NjkkOQ@mail.gmail.com> (raw)
In-Reply-To: <1447171060.1401.31.camel@intel.com>

Hi Rodrigo,

On 10 November 2015 at 15:57, Vivi, Rodrigo <rodrigo.vivi@intel.com> wrote:
> On Mon, 2015-11-09 at 11:47 +0000, Daniel Stone wrote:
>> I've been looking at pulling this on top of Maarten's tree, and
>
> I'm afraid I didn't followed completely your idea and maybe because I
> don't know the code you are referring to. What tree specifically are
> you talking about?

Ah, it's at git://people.freedesktop.org/~mlankhorst/linux#rework-page-flip.
The code itself isn't that important though - it makes for a very
messy rebase but has little functional impact - it's more about the
style overall. I'll try to explain a bit better. :\

>> currently my overriding wish is that, rather than the checks
>> sprinkled
>> all over various state-change functions,
>
> Ok, so you are suggesting we totally remove the pipe config variables
> right? I haven't considered this possibility since I believed some
> people would prefer to let the variables there. And also for PSRxDRRS
> conflict this would be safier since DRRS cannot be enabled if PSR is
> going to be enabled. With your solution we need to pay attention and
> never let someone invert PSR and DRRS orders.

Hm, not so much removing as making more use of them!

At the moment, the IPS/PSR logic is quite distributed. Taking this as
an example, from patch #6:

@@ -11562,12 +11554,8 @@ int intel_plane_atomic_calc_changes(struct
drm_crtc_state *crtc_state,

                if (turn_off) {
                        /*
-                        * FIXME: Actually if we will still have any other
-                        * plane enabled on the pipe we could let IPS enabled
-                        * still, but for now lets consider that when we make
-                        * primary invisible by setting DSPCNTR to 0 on
-                        * update_primary_plane function IPS needs to be
-                        * disable.
+                        * IPS disable_if_alone function will be called
+                        * in order to decide if IPS disable is really needed.
                         */
                        intel_crtc->atomic.disable_ips = true;

This gets called when the primary plane is being disabled. So the logic is:
  - if IPS was enabled
  - and the primary plane was on
  - and the primary plane was no longer on
  - maybe disable the plane

The implementation is buggy (see reply to patch coming shortly), but
more importantly, I think the state-machine concept - where you react
to very specific changes (e.g. 'disable a plane') is quite fragile. As
an example, there is nothing I can see in your patch that handles the
following case:
  - IPS is enabled with one primary and one overlay plane
  - disable the primary plane: intel_ips_disable_if_alone() is called,
and does not disable IPS, since the overlay plane is still active
  - disable the overlay plane, but IPS remains enabled even though no
planes are active

For me, a better way of approaching this - very much in line with the
atomic conversion work that has been ongoing ever since
intel_crtc_state was created - would be to examine the actual state as
a whole. So, rather than performing specific checks in response to one
specific action (disabling the primary plane), you would have one
function in intel_ips.c, which examines the entire CRTC state, and
returns a boolean answer: should IPS be enabled or disabled?

This keeps the logic in one place, and means that rather than
sprinkling magic enable/disable calls in response to specific
_actions_ - which gets difficult to do anyway with atomic changes -
you only ever perform enable/disable on the result of one function
which inspects the overall state ('are there any planes enabled in
this target state?') and comes up with an answer. Thus the interaction
with the core code is limited to:
    bool target_ips = intel_ips_target_state(intel_crtc_state);

Does that make sense? It's just about deriving the conditions from an
overall target state, rather than making them reactive to specific
actions.

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2015-11-10 16:26 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 18:49 [PATCH 00/31] IPS/DRRS/PSR rework with PSR enabled by default Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 01/31] drm/i915: Rename IPS ready variable at pipe config Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 02/31] drm/i915: Move IPS related stuff to intel_ips.c Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 03/31] drm/i915: Add IPS DockBook Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 04/31] drm/i915: Handle actual IPS enabled state Rodrigo Vivi
2015-11-07 19:19   ` Daniel Stone
2015-11-13 18:20   ` Daniel Stone
2015-11-13 18:38     ` Ville Syrjälä
2015-11-13 18:55       ` Daniel Stone
2015-11-13 20:28         ` Ville Syrjälä
2015-11-13 21:42           ` Daniel Stone
2015-11-05 18:49 ` [PATCH 05/31] drm/i915: Fix IPS initialization Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 06/31] drm/i915: Fix IPS disable sequence Rodrigo Vivi
2015-11-10 16:34   ` Daniel Stone
2015-11-11 23:31     ` Vivi, Rodrigo
2015-11-12 11:24       ` Daniel Stone
2015-11-05 18:49 ` [PATCH 07/31] drm/i915: IPS Sysfs interface Rodrigo Vivi
2015-11-05 21:04   ` Chris Wilson
2015-11-18 10:04     ` Daniel Vetter
2015-11-18 18:32       ` Vivi, Rodrigo
2015-11-09 11:37   ` Daniel Stone
2015-11-05 18:50 ` [PATCH 08/31] drm/i915: Add psr_ready on pipe_config Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 09/31] drm/i915: Only enable DRRS if PSR won't be enabled on this pipe Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 10/31] drm/i915: Detatch i915.enable_psr from psr_ready Rodrigo Vivi
2015-11-18 10:07   ` Daniel Vetter
2015-11-18 18:35     ` Vivi, Rodrigo
2015-11-19  9:19       ` Daniel Vetter
2015-11-05 18:50 ` [PATCH 11/31] drm/i915: Use intel_crtc instead of intel_dp on PSR enable/disable functions Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 12/31] drm/i915: Fix PSR initialization Rodrigo Vivi
2015-11-18 10:12   ` Daniel Vetter
2015-11-18 18:39     ` Vivi, Rodrigo
2015-11-19  9:34       ` Daniel Vetter
2015-11-05 18:50 ` [PATCH 13/31] drm/i915: Organize Makefile new display pm group Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 14/31] drm/i915: Create intel_drrs.c Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 15/31] drm/i915: Use intel_crtc instead of intel_dp on DRRS enable/disable functions Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 16/31] drm/i915: Fix DRRS initialization Rodrigo Vivi
2015-11-18 10:13   ` Daniel Vetter
2015-11-05 18:50 ` [PATCH 17/31] drm/i915: Add sys PSR toggle interface Rodrigo Vivi
2015-11-05 21:03   ` Chris Wilson
2015-11-05 18:50 ` [PATCH 18/31] drm/i915: Force PSR exit when IRQ_HPD is detected on eDP Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 19/31] drm/i915: Remove duplicated dpcd write on hsw_psr_enable_sink Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 20/31] drm/i915: PSR: Let's rely more on frontbuffer tracking Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 21/31] drm/i915: PSR: Mask LPSP hw tracking back again Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 22/31] drm/i915: Delay first PSR activation Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 23/31] drm/i915: Reduce PSR re-activation time for VLV/CHV Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 24/31] drm/i915: PSR: Don't Skip aux handshake on DP_PSR_NO_TRAIN_ON_EXIT Rodrigo Vivi
2015-11-09 10:38   ` Jani Nikula
2015-11-10 15:41     ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 25/31] drm/i915: Send TP1 TP2/3 even when panel claims no NO_TRAIN_ON_EXIT Rodrigo Vivi
2015-11-09 10:39   ` Jani Nikula
2015-11-10 15:42     ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 26/31] drm/i915: Fix idle_frames counter Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 27/31] drm/i915: Allow 1 vblank to let Sink CRC calculation to start or stop Rodrigo Vivi
2015-11-10 20:12   ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 28/31] drm/i915: Make Sink crc calculation waiting for counter to reset Rodrigo Vivi
2015-11-10 20:31   ` Paulo Zanoni
2015-11-10 21:49     ` Paulo Zanoni
2015-11-18 10:25       ` Daniel Vetter
2015-11-18 18:42         ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 29/31] drm/i915: Stop tracking last calculated Sink CRC Rodrigo Vivi
2015-11-10 21:36   ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 30/31] drm/i915: Rely on TEST_SINK_START instead of tracking Sink CRC state on dev_priv Rodrigo Vivi
2015-11-10 21:44   ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 31/31] drm/i915: Enable PSR by default Rodrigo Vivi
2015-11-05 21:07   ` Chris Wilson
2015-11-05 21:30     ` Vivi, Rodrigo
2015-11-09 11:47 ` [PATCH 00/31] IPS/DRRS/PSR rework with PSR enabled " Daniel Stone
2015-11-10 15:57   ` Vivi, Rodrigo
2015-11-10 16:26     ` Daniel Stone [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=CAPj87rPQ8orkphU_6-kWW+rTHGvCo1QWMuLFAQttdzP8NjkkOQ@mail.gmail.com \
    --to=daniel@fooishbar.org \
    --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.