All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grodzovsky, Andrey" <Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>
To: "Cheng, Tony" <Tony.Cheng-5C7GfCeVMHo@public.gmane.org>,
	Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
Cc: dc_upstream <dc_upstream-5C7GfCeVMHo@public.gmane.org>,
	"nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: RE: [PATCH 1/4] drm/atomic: Save flip flags in drm_plane_state
Date: Thu, 26 Jan 2017 05:01:01 +0000	[thread overview]
Message-ID: <DM5PR12MB1147AEF3F8CFFAD4B69E114EEA770@DM5PR12MB1147.namprd12.prod.outlook.com> (raw)
In-Reply-To: <MWHPR12MB14066404FBCEF3C03EF24BF998720-Gy0DoCVfaSXS1+HfpYZxvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>



> -----Original Message-----
> From: Cheng, Tony
> Sent: Monday, January 23, 2017 2:49 PM
> To: Daniel Vetter; Grodzovsky, Andrey
> Cc: Deucher, Alexander; nouveau@lists.freedesktop.org; amd-
> gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org;
> daniel.vetter@intel.com; dc_upstream
> Subject: RE: [PATCH 1/4] drm/atomic: Save flip flags in drm_plane_state
> 
> 
> 
> > -----Original Message-----
> > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On
> > Behalf Of Daniel Vetter
> > Sent: Monday, January 23, 2017 3:55 AM
> > To: Grodzovsky, Andrey <Andrey.Grodzovsky@amd.com>
> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com>;
> > nouveau@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; dri-
> > devel@lists.freedesktop.org; daniel.vetter@intel.com
> > Subject: Re: [PATCH 1/4] drm/atomic: Save flip flags in
> > drm_plane_state
> >
> > On Mon, Jan 16, 2017 at 10:44:55AM -0500, Andrey Grodzovsky wrote:
> > > Allows using atomic flip helpers for drivers using ASYNC flip.
> > > Remove ASYNC_FLIP restriction in helpers and caches the page flip
> > > flags in drm_plane_state to be used in the low level drivers.
> > >
> > > Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
> >
> > It's mostly guesswork, but I think we should have the flip flags in
> > the crtc, not in each plane. Similar to how we move the event from planes
> to crtc.
> > -Daniel
> 
Do you mean here crtc or crtc_state ?

> What does ASYNC flip mean?  HW flip as soon as possible and result in tearing
> on screen?  If so I could imaging some use case where you have some UI
> control/menu overlay on top, and some game running on a underlay plane,
> and the game want to be able to flip as soon as possible.  Or Daniel do you
> think ASYNC property will apply to all planes in CRTC?
> 
Also the client code both in nouveau and AMD/DAL iterates over new planes and their new states
so it seems to me easier to retrieve the parameter from the plane_state and not adding loop
to find matching crtc or its  state, especially if it's before drm_atomic_helper_swap_state is called,
 when crtc->state still points to the old state ...
[Grodzovsky, Andrey] 
> >
> > > ---
> > >  drivers/gpu/drm/drm_atomic_helper.c | 10 +++-------
> > >  include/drm/drm_plane.h             |  8 ++++++++
> > >  2 files changed, 11 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> > > b/drivers/gpu/drm/drm_atomic_helper.c
> > > index a4e5477..f83dc43 100644
> > > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > > @@ -2737,7 +2737,8 @@ static int page_flip_common(
> > >  				struct drm_atomic_state *state,
> > >  				struct drm_crtc *crtc,
> > >  				struct drm_framebuffer *fb,
> > > -				struct drm_pending_vblank_event *event)
> > > +				struct drm_pending_vblank_event *event,
> > > +				uint32_t flags)
> > >  {
> > >  	struct drm_plane *plane = crtc->primary;
> > >  	struct drm_plane_state *plane_state; @@ -2754,6 +2755,7 @@ static
> > > int page_flip_common(
> > >  	if (IS_ERR(plane_state))
> > >  		return PTR_ERR(plane_state);
> > >
> > > +	plane_state->pflip_flags = flags;
> > >
> > >  	ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
> > >  	if (ret != 0)
> > > @@ -2800,9 +2802,6 @@ int drm_atomic_helper_page_flip(struct
> > > drm_crtc
> > *crtc,
> > >  	struct drm_atomic_state *state;
> > >  	int ret = 0;
> > >
> > > -	if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
> > > -		return -EINVAL;
> > > -
> > >  	state = drm_atomic_state_alloc(plane->dev);
> > >  	if (!state)
> > >  		return -ENOMEM;
> > > @@ -2865,9 +2864,6 @@ int drm_atomic_helper_page_flip_target(
> > >  	struct drm_crtc_state *crtc_state;
> > >  	int ret = 0;
> > >
> > > -	if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
> > > -		return -EINVAL;
> > > -
> > >  	state = drm_atomic_state_alloc(plane->dev);
> > >  	if (!state)
> > >  		return -ENOMEM;
> > > diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index
> > > db3bbde..86d8ffc 100644
> > > --- a/include/drm/drm_plane.h
> > > +++ b/include/drm/drm_plane.h
> > > @@ -122,6 +122,14 @@ struct drm_plane_state {
> > >  	 */
> > >  	bool visible;
> > >
> > > +
> > > +	/**
> > > +	 * @pflip_flags:
> > > +	 *
> > > +	 * Flip related config options
> > > +	 */
> > > +	u32 pflip_flags;
> > > +
> > >  	struct drm_atomic_state *state;
> > >  };
> > >
> > > --
> > > 1.9.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-01-26  5:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 15:44 [PATCH 0/4] Allow ASYNC flip with atomic helpers Andrey Grodzovsky
2017-01-16 15:44 ` [PATCH 1/4] drm/atomic: Save flip flags in drm_plane_state Andrey Grodzovsky
     [not found]   ` <1484581498-32309-2-git-send-email-Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>
2017-01-16 20:21     ` Gustavo Padovan
2017-01-16 20:53       ` Grodzovsky, Andrey
2017-01-23  8:54     ` Daniel Vetter
2017-01-23 19:48       ` Cheng, Tony
     [not found]         ` <MWHPR12MB14066404FBCEF3C03EF24BF998720-Gy0DoCVfaSXS1+HfpYZxvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-26  5:01           ` Grodzovsky, Andrey [this message]
     [not found]             ` <DM5PR12MB1147AEF3F8CFFAD4B69E114EEA770-2J9CzHegvk9IwjGPM8RDJwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-26  9:40               ` Daniel Vetter
2017-01-26  9:39         ` Daniel Vetter
2017-01-16 22:18   ` Laurent Pinchart
2017-01-17  4:03     ` Grodzovsky, Andrey
     [not found]       ` <DM5PR12MB1147FF9E484370F1572CB9C3EA7C0-2J9CzHegvk9IwjGPM8RDJwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-17  9:03         ` Laurent Pinchart
2017-01-17  8:14   ` Ville Syrjälä
     [not found] ` <1484581498-32309-1-git-send-email-Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>
2017-01-16 15:44   ` [PATCH 2/4] drm/amdgpu: Remove flip_flag from amdgpu_crtc Andrey Grodzovsky
2017-01-16 22:15     ` Laurent Pinchart
2017-01-16 15:44   ` [PATCH 3/4] drm/amd/display: Switch to using atomic_helper for flip Andrey Grodzovsky
2017-01-16 22:16     ` Laurent Pinchart
2017-01-18  1:50       ` Michel Dänzer
2017-01-18 12:02         ` Laurent Pinchart
2017-01-18 22:18         ` Grodzovsky, Andrey
     [not found]           ` <DM5PR12MB1147CFCD90203061E0F2EB95EA7F0-2J9CzHegvk9IwjGPM8RDJwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-19  2:14             ` Michel Dänzer
2017-01-19  4:57         ` [PATCH v3 2/3] " Andrey Grodzovsky
2017-01-16 15:44 ` [PATCH 4/4] drm/nouveau/kms/nv50: Switch to using atomic helper " Andrey Grodzovsky
2017-01-16 20:39 ` [PATCH 0/4] Allow ASYNC flip with atomic helpers Laurent Pinchart
2017-01-16 21:13   ` Harry Wentland
2017-01-16 22:14     ` Laurent Pinchart
2017-01-23  8:53       ` 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=DM5PR12MB1147AEF3F8CFFAD4B69E114EEA770@DM5PR12MB1147.namprd12.prod.outlook.com \
    --to=andrey.grodzovsky-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Tony.Cheng-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dc_upstream-5C7GfCeVMHo@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 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.