All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "S, Shirish" <Shirish.S-5C7GfCeVMHo@public.gmane.org>,
	Maling list - DRI developers
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"Wentland, Harry" <Harry.Wentland-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state
Date: Wed, 28 Feb 2018 09:26:26 -0500	[thread overview]
Message-ID: <CADnq5_NYPTwH=Ro0eB=0fi0dBGMGbQD3Cm45vgZnZ3AhGNL21A@mail.gmail.com> (raw)
In-Reply-To: <BN6PR12MB1826A7CC70B786648E00B387F2C70-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

+ dri-devel


On Wed, Feb 28, 2018 at 4:33 AM, S, Shirish <Shirish.S@amd.com> wrote:
> From: Shirish S <shirish.s@amd.com>
>
> Add reverse iterator "for_each_oldnew_plane_in_state_reverse" to
> complement "for_each_oldnew_plane_in_state" way of reading plane
> states.
>
> The plane states are required to be read in reverse order for
> amdgpu, as the z order convention followed in linux is
> opposite to how the planes are supposed to be presented to DC
> engine, which is in common to both windows and linux.
>
> Signed-off-by: Shirish S <shirish.s@amd.com>
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> ---
>  include/drm/drm_atomic.h | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index cf13842..b947930 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -754,6 +754,28 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
>                               (new_plane_state) = (__state)->planes[__i].new_state, 1))
>
>  /**
> + * for_each_oldnew_plane_in_state_reverse - iterate over all planes in an atomic
> + * update in reverse order
> + * @__state: &struct drm_atomic_state pointer
> + * @plane: &struct drm_plane iteration cursor
> + * @old_plane_state: &struct drm_plane_state iteration cursor for the old state
> + * @new_plane_state: &struct drm_plane_state iteration cursor for the new state
> + * @__i: int iteration cursor, for macro-internal use
> + *
> + * This iterates over all planes in an atomic update in reverse order,
> + * tracking both old and  new state. This is useful in places where the
> + * state delta needs to be considered, for example in atomic check functions.
> + */
> +#define for_each_oldnew_plane_in_state_reverse(__state, plane, old_plane_state, new_plane_state, __i) \
> +       (for ((__i) = ((__state)->dev->mode_config.num_total_plane - 1);        \
> +            (__i) >= 0;                                                \
> +            (__i)--)                                                   \
> +               for_each_if ((__state)->planes[__i].ptr &&              \
> +                            ((plane) = (__state)->planes[__i].ptr,     \
> +                             (old_plane_state) = (__state)->planes[__i].old_state,\
> +                             (new_plane_state) = (__state)->planes[__i].new_state, 1)))
> +
> +/**
>   * for_each_old_plane_in_state - iterate over all planes in an atomic update
>   * @__state: &struct drm_atomic_state pointer
>   * @plane: &struct drm_plane iteration cursor
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-02-28 14:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1519809663-25339-1-git-send-email-shirish.s@amd.com>
     [not found] ` <1519809663-25339-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-02-28  9:33   ` [PATCH] drm/atomic: Add new reverse iterator over all plane state S, Shirish
     [not found]     ` <BN6PR12MB1826A7CC70B786648E00B387F2C70-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-28 13:49       ` Andrey Grodzovsky
2018-02-28 14:26       ` Alex Deucher [this message]
     [not found]         ` <CADnq5_NYPTwH=Ro0eB=0fi0dBGMGbQD3Cm45vgZnZ3AhGNL21A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-06 10:06           ` Daniel Vetter
     [not found]             ` <BN6PR12MB17805C31305E2882EEDB245680D90@BN6PR12MB1780.namprd12.prod.outlook.com>
2018-03-06 14:52               ` Vishwakarma, Pratik
2018-03-06 17:31               ` Alex Deucher
2018-03-07  3:11                 ` S, Shirish

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='CADnq5_NYPTwH=Ro0eB=0fi0dBGMGbQD3Cm45vgZnZ3AhGNL21A@mail.gmail.com' \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Harry.Wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=Shirish.S-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-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.