All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Misc atomic-related updates
@ 2015-04-09  1:56 Matt Roper
  2015-04-09  1:56 ` [PATCH 1/4] drm/i915: Make atomic use in-flight state for CRTC active value Matt Roper
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Matt Roper @ 2015-04-09  1:56 UTC (permalink / raw)
  To: intel-gfx

Here's a few atomic-related patches that I've developed in the process of
preparing the atomic watermark code.  I think some of this code is also
useful/important for other features that are being developed (e.g., SKL
scalers), so I'm extracting these and posting them early to get feedback and
possibly smooth the way for other developers.

The first patch here makes our atomic plane updates stop keying off
intel_crtc->active when generating their derived state.  This will be important
when we start handling CRTC state updates as part of an atomic transaction, or
even when we call our plane update functions from within a legacy modeset path.

The second patch updates some fragile plane => crtc mapping that works okay
today, but will definitely cause problems once we merge support for
non-blocking atomic flips.

The third patch switches our update_plane/disable_plane handlers back to the
full atomic helpers.  This caused a lot of breakage last time we tried, but we
try to sidestep those problems this time by replacing the plane vfunc calls we
still have in our legacy modeset path to call the transitional plane helpers
directly.  The important thing here is that we want to ensure legacy SetPlane()
calls from userspace have a top-level atomic transaction since a few pieces of
upcoming code really need this (SKL scalers, atomic watermarks, etc.).

The fourth patch fixes what I believe is a bug in our existing code (but not
one that anyone has stumbled over yet afaik).  Since crtc states aren't fully
wired up for i915 yet, we've been using intel_crtc->atomic as a temporary
dumping ground for stuff that will eventually transition to the CRTC state.  We
properly clear that structure out at the end of a successful atomic transaction
so that we'll start fresh on the next transaction, but we neglect to do so if
the transaction doesn't make it to the commit stage (e.g., because 'check'
failed).  I'm surprised having stale flags from a previous transaction's
'check' hasn't already caused problems for us, but I guess we've just been
lucky.



Matt Roper (4):
  drm/i915: Make atomic use in-flight state for CRTC active value
  drm/i915: Lookup CRTC for plane directly
  drm/i915: Switch to full atomic helpers for plane updates/disable,
    take two
  drm/i915: Clear crtc atomic flags at beginning of transaction

 drivers/gpu/drm/i915/intel_atomic.c       |  18 +++++
 drivers/gpu/drm/i915/intel_atomic_plane.c |  23 ++++---
 drivers/gpu/drm/i915/intel_display.c      | 107 ++++++++++++++++++++++++------
 drivers/gpu/drm/i915/intel_drv.h          |  11 +++
 drivers/gpu/drm/i915/intel_sprite.c       |  30 ++++++---
 5 files changed, 149 insertions(+), 40 deletions(-)

-- 
1.8.5.1

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

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: [PATCH] drm/i915: Fix frontbuffer false positve.
@ 2015-02-24  1:52 Rodrigo Vivi
  2015-02-24  2:14 ` [PATCH] drm/i915: Clear crtc atomic flags at beginning of transaction Matt Roper
  0 siblings, 1 reply; 29+ messages in thread
From: Rodrigo Vivi @ 2015-02-24  1:52 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Ander Conselvan de Oliveira, intel-gfx, Rodrigo Vivi

Hi Daniel,

It seems that one check with one good commit followed by many zeroed
intel_crtc->atomic commits is again in place.

So I'm getting that annoying false positives on latest -nightly.

Shouldn't we just merge this patch while atomic modeset design doesn't
get fixed at all?

Unfortunately nothing comes to my mind than moving all
intel_crtc->atomic set to commit time and let pre_commit just with
pm_get...
Ohter than that just a full redesign of atomic modeset.

Thanks,
Rodrigo.


On Fri, Feb 13, 2015 at 12:48 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Feb 12, 2015 at 05:17:04PM -0800, Rodrigo Vivi wrote:
>> No, we had solved old frontbuffer false positives... some missing
>> flush somewhere at that time...
>>
>> So, I added a bunch of printk and I insist that it is conceptually
>> wrong to set intel_crtc_atomic_commit on check times when you do
>> memset(&intel_crtc->atomic, 0, sizeof(intel_crtc->atomic));
>> on every finish_commit.
>>
>> With exception of atomic.disabled_planes I believe the rest shouldn't
>> work in the way it is implemented because you can have one check
>> followed by many commits, but after the first commit all atomic
>> variables are zeroed, except the disabled_planes that is set outside
>> check...
>
> Ok here's the trouble: Every commit should have at exactly one check for
> the new state objects. Unfortunately in the transition that seems to have
> been lost for some cases.
>
>> For instance: on every cursor movement atomic.fb_bits was 0x000 when
>> it should be 0x002. This is why this patch solved the false positive,
>> i.e. setting it on commit instead on check time we get it propperly
>> set. One of the problems is the false positive but also it breaks
>> entirely SW tracking on VLV/CHV....
>>
>> I believe wait_for flips, update_fbc, watermarks, etc should keep the
>> value got on check for the commit or the check should be done at
>> commit plane instead of on check.
>>
>> I started doing a patch here to move all atomic sets from check to
>> commit functions but gave up on middle when I noticed the
>> prepare_commit would almost get empty...
>
> All state precomputation must be done in check, at commit time you have a
> lot less information since the old state is somewhat gone. You can still
> get at it, but as soon as we add an async flip queue that will get really
> ugly. The current placement is imo the correct one. Instead we need to
> figure out where we're doing a ->commit without properly calling ->check
> beforehand.
>
>> Another idea was to make a atomic set per plane and just memset(0) on
>> begin of every check... But this would require reliable access to the
>> plane being updated on finish_commit... I believe loop on all planes
>> would be messy and cause other issues...
>>
>> So, I'll be out returning only next wed. Please let me know if you
>> have any suggestion of best changes to do that I can implement the
>> changes.
>
> Since you've done this testing I've landed Matt's patches to switch legacy
> plane entry points over to atomic. Which means cursor updates should now
> be done properly using atomic, always. But even then the old transitional
> plane helpers should have called the check functions ... So not sure where
> exactly we're loosing that check call.
>
> Matt Roper might have more insights.
>
> Thanks, Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-04-15  0:48 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09  1:56 [PATCH 0/4] Misc atomic-related updates Matt Roper
2015-04-09  1:56 ` [PATCH 1/4] drm/i915: Make atomic use in-flight state for CRTC active value Matt Roper
2015-04-09 12:42   ` Daniel Vetter
2015-04-09 14:00     ` Matt Roper
2015-04-09 14:45       ` Daniel Vetter
2015-04-09 14:49         ` Matt Roper
2015-04-09 13:18   ` Ville Syrjälä
2015-04-09 14:10     ` Matt Roper
2015-04-09 14:46       ` Ville Syrjälä
2015-04-09 14:54         ` Matt Roper
2015-04-10  7:24           ` Daniel Vetter
2015-04-09  1:56 ` [PATCH 2/4] drm/i915: Lookup CRTC for plane directly Matt Roper
2015-04-09 12:44   ` Daniel Vetter
2015-04-09 14:36     ` Matt Roper
2015-04-09  1:56 ` [PATCH 3/4] drm/i915: Switch to full atomic helpers for plane updates/disable, take two Matt Roper
2015-04-09 12:46   ` Daniel Vetter
2015-04-09 18:03     ` Matt Roper
2015-04-15  0:48       ` Konduru, Chandra
2015-04-09  1:56 ` [PATCH 4/4] drm/i915: Clear crtc atomic flags at beginning of transaction Matt Roper
2015-04-09 12:48   ` Daniel Vetter
2015-04-09 15:03     ` Matt Roper
2015-04-09 15:51       ` Daniel Vetter
2015-04-09 17:48         ` [PATCH] " Matt Roper
2015-04-10  7:37           ` Daniel Vetter
2015-04-10 20:05           ` shuang.he
2015-04-10  2:36   ` [PATCH 4/4] " shuang.he
  -- strict thread matches above, loose matches on Subject: below --
2015-02-24  1:52 [PATCH] drm/i915: Fix frontbuffer false positve Rodrigo Vivi
2015-02-24  2:14 ` [PATCH] drm/i915: Clear crtc atomic flags at beginning of transaction Matt Roper
2015-02-24 17:43   ` Rodrigo Vivi
2015-02-24 17:52     ` Rodrigo Vivi

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.