* [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
@ 2018-03-07 3:10 Shirish S
[not found] ` <1520392203-6885-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Shirish S @ 2018-03-07 3:10 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Alexander.Deucher-5C7GfCeVMHo,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: daniel-/w4YWyX8dFk, Shirish S
Add reverse iterator for_each_oldnew_plane_in_state_reverse to
compliment the for_each_oldnew_plane_in_state way or reading plane
states.
The plane states are required to be read in reverse order for
amd drivers, cause 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.
V2: fix compile time errors due to -Werror flag.
Signed-off-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
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..3fe8dde 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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
[not found] ` <1520392203-6885-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-07 20:59 ` Harry Wentland
0 siblings, 0 replies; 6+ messages in thread
From: Harry Wentland @ 2018-03-07 20:59 UTC (permalink / raw)
To: Shirish S, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Alexander.Deucher-5C7GfCeVMHo,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018-03-06 10:10 PM, Shirish S wrote:
> Add reverse iterator for_each_oldnew_plane_in_state_reverse to
> compliment the for_each_oldnew_plane_in_state way or reading plane
> states.
>
> The plane states are required to be read in reverse order for
> amd drivers, cause 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.
>
> V2: fix compile time errors due to -Werror flag.
>
> Signed-off-by: Shirish S <shirish.s@amd.com>
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Merged to drm-misc-next.
Harry
> ---
> 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..3fe8dde 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
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
[not found] ` <3498cf6f-384b-44c9-1924-ccbfa96f3704-5C7GfCeVMHo@public.gmane.org>
2018-03-06 5:16 ` Vishwakarma, Pratik
@ 2018-03-06 8:38 ` Jani Nikula
1 sibling, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2018-03-06 8:38 UTC (permalink / raw)
To: Harry Wentland, S, Shirish, Maling list - DRI developers
Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Mon, 05 Mar 2018, Harry Wentland <harry.wentland@amd.com> wrote:
> make DOCBOOKS="" htmldocs
DOCBOOKS is no more. Simply 'make htmldocs' will do the same.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
[not found] ` <3498cf6f-384b-44c9-1924-ccbfa96f3704-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-06 5:16 ` Vishwakarma, Pratik
2018-03-06 8:38 ` Jani Nikula
1 sibling, 0 replies; 6+ messages in thread
From: Vishwakarma, Pratik @ 2018-03-06 5:16 UTC (permalink / raw)
To: Wentland, Harry, S, Shirish, Maling list - DRI developers
Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1: Type: text/plain, Size: 3418 bytes --]
Hi Harry,
It renders fine. I have attached generated doc for reference.
Regards
Pratik
-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Harry Wentland
Sent: Tuesday, March 6, 2018 3:58 AM
To: S, Shirish <Shirish.S@amd.com>; Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
On 2018-03-01 02:56 AM, S, Shirish wrote:
> From: Shirish S <shirish.s@amd.com>
>
> Add reverse iterator for_each_oldnew_plane_in_state_reverse to compliment the for_each_oldnew_plane_in_state way or reading plane states.
>
> The plane states are required to be read in reverse order for amd drivers, cause 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.
>
> V2: fix compile time errors due to -Werror flag.
>
> 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..3fe8dde 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
Looks good but can you check if docs build and render well with the newline in here? To build the docs run
make DOCBOOKS="" htmldocs
and then check that it renders correctly in Documentation/output/gpu/drm_kms.html
Harry
> + * @__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
[-- Attachment #2: drm-kms.html --]
[-- Type: text/html, Size: 711397 bytes --]
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
2018-03-01 7:56 ` S, Shirish
@ 2018-03-05 22:28 ` Harry Wentland
[not found] ` <3498cf6f-384b-44c9-1924-ccbfa96f3704-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Harry Wentland @ 2018-03-05 22:28 UTC (permalink / raw)
To: S, Shirish, Maling list - DRI developers; +Cc: Deucher, Alexander, amd-gfx
On 2018-03-01 02:56 AM, S, Shirish wrote:
> From: Shirish S <shirish.s@amd.com>
>
> Add reverse iterator for_each_oldnew_plane_in_state_reverse to compliment the for_each_oldnew_plane_in_state way or reading plane states.
>
> The plane states are required to be read in reverse order for amd drivers, cause 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.
>
> V2: fix compile time errors due to -Werror flag.
>
> 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..3fe8dde 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
Looks good but can you check if docs build and render well with the newline in here? To build the docs run
make DOCBOOKS="" htmldocs
and then check that it renders correctly in Documentation/output/gpu/drm_kms.html
Harry
> + * @__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
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2)
[not found] ` <1519890811-3638-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-01 7:56 ` S, Shirish
2018-03-05 22:28 ` Harry Wentland
0 siblings, 1 reply; 6+ messages in thread
From: S, Shirish @ 2018-03-01 7:56 UTC (permalink / raw)
To: Maling list - DRI developers
Cc: Deucher, Alexander, Wentland, Harry,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Shirish S <shirish.s@amd.com>
Add reverse iterator for_each_oldnew_plane_in_state_reverse to compliment the for_each_oldnew_plane_in_state way or reading plane states.
The plane states are required to be read in reverse order for amd drivers, cause 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.
V2: fix compile time errors due to -Werror flag.
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..3fe8dde 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-03-07 20:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 3:10 [PATCH] drm/atomic: Add new reverse iterator over all plane state (V2) Shirish S
[not found] ` <1520392203-6885-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-03-07 20:59 ` Harry Wentland
[not found] <1519890811-3638-1-git-send-email-shirish.s@amd.com>
[not found] ` <1519890811-3638-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-03-01 7:56 ` S, Shirish
2018-03-05 22:28 ` Harry Wentland
[not found] ` <3498cf6f-384b-44c9-1924-ccbfa96f3704-5C7GfCeVMHo@public.gmane.org>
2018-03-06 5:16 ` Vishwakarma, Pratik
2018-03-06 8:38 ` Jani Nikula
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.