drm/atomic: Add new reverse iterator over all plane state
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1519809663-25339-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org
PATCH 1/1 drm/atomic: Add new reverse iterator over all plane state
From: Shirish S <[email protected]>
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.
--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
include/drm/drm_atomic.h +22 -0
@@ -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
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1826A7CC70B786648E00B387F2C70-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Any DRM related changes needs to be sent to [email protected]
Andrey
Quoted 40 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +15
-0@@ -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; \
include/drm/drm_atomic.h void drm_state_dump(struct drm_device *dev, struct drm_printer *p); · line 781
Quoted 10 lines
include/drm/drm_atomic.h +7
-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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
+ dri-devel
Quoted 53 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +22
-1@@ -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
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_NYPTwH=Ro0eB=0fi0dBGMGbQD3Cm45vgZnZ3AhGNL21A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Daniel Vetter
Reviewed-byQuoted 17 lines · Alex Deucher
+ dri-devel
Quoted 13 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>
Makes sense.
Quoted 11 lines
Quoted 11 lines
--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +0
-0@@ -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))
Quoted 3 lines
include/drm/drm_atomic.h void drm_state_dump(struct drm_device *dev, struct drm_printer *p); · line 758
Quoted 3 lines
include/drm/drm_atomic.h +2
-0/** +* for_each_oldnew_plane_in_state_reverse - iterate over all planes in an atomic +* update in reverse order
Are you sure this renders correctly in kernel-doc? Iirc you have to indent the continuation line.
Assuming this is fixed:
Quoted 34 lines
Quoted 26 lines
include/drm/drm_atomic.h +20
-1+* @__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
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB17805C31305E2882EEDB245680D90@BN6PR12MB1780.namprd12.prod.outlook.com
Vishwakarma, Pratik
Reviewed-by Daniel VetterBelow mail was rejected, maybe due to attachment. Sending again without attachment.
Regards
Pratik
-----Original Message-----
From: Vishwakarma, Pratik
Sent: Tuesday, March 6, 2018 4:22 PM
To: 'Daniel Vetter' <[email protected]>; Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; Maling list - DRI developers <[email protected]>; S, Shirish <[email protected]>
Subject: RE: [PATCH] drm/atomic: Add new reverse iterator over all plane state
Hi Daniel,
I have checked make htmldocs on v2 of this patch. I have attached output drm-kms.html on that thread. No indentation issue is observed. Attached again for reference.
Can you please provide RB on that?
Regards
Pratik
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, March 6, 2018 3:36 PM
To: Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; Maling list - DRI developers <[email protected]>; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state
Quoted 17 lines · Alex Deucher
+ dri-devel
Quoted 13 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>
Makes sense.
Quoted 12 lines
Quoted 12 lines
--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +0
-0@@ -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))
Quoted 4 lines
include/drm/drm_atomic.h void drm_state_dump(struct drm_device *dev, struct drm_printer *p); · line 758
Quoted 4 lines
include/drm/drm_atomic.h +3
-0/** +* for_each_oldnew_plane_in_state_reverse - iterate over all planes +in an atomic +* update in reverse order
Are you sure this renders correctly in kernel-doc? Iirc you have to indent the continuation line.
Assuming this is fixed:
Quoted 31 lines
Quoted 31 lines
include/drm/drm_atomic.h +25
-1+* @__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
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Pratik
Hi Daniel,
I have checked make htmldocs on v2 of this patch. I have attached output drm-kms.html on that thread. No indentation issue is observed. Attached again for reference.
Can you please provide RB on that?
How did you send the patch? I can't get V2 to apply. The patch is mangled. Please use git-send-email if you didn't before.
Alex
Quoted 94 lines
Regards
Pratik-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, March 6, 2018 3:36 PM
To: Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; Maling list - DRI developers <[email protected]>; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane stateQuoted 17 lines · Alex Deucher
+ dri-devel
Quoted 13 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>Makes sense.
Quoted 12 lines
Quoted 12 lines
--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +0
-0@@ -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))Quoted 4 lines
include/drm/drm_atomic.h void drm_state_dump(struct drm_device *dev, struct drm_printer *p); · line 758
Quoted 4 lines
include/drm/drm_atomic.h +3
-0/** +* for_each_oldnew_plane_in_state_reverse - iterate over all planes +in an atomic +* update in reverse order Are you sure this renders correctly in kernel-doc? Iirc you have to indent the continuation line.
Assuming this is fixed:
Reviewed-by Daniel Vetter <[email protected]>Quoted 31 lines
Quoted 31 lines
include/drm/drm_atomic.h +25
-1+* @__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
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Alex,
Have resent the V2 with R-B of Daniel.
Regards,
Shirish S
-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, March 6, 2018 11:01 PM
To: Vishwakarma, Pratik <[email protected]>
Cc: Daniel Vetter <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]; Maling list - DRI developers <[email protected]>; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane state
Quoted 5 lines · Pratik
Hi Daniel,
I have checked make htmldocs on v2 of this patch. I have attached output drm-kms.html on that thread. No indentation issue is observed. Attached again for reference.
Can you please provide RB on that?
How did you send the patch? I can't get V2 to apply. The patch is mangled. Please use git-send-email if you didn't before.
Alex
Quoted 98 lines
Regards
Pratik-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, March 6, 2018 3:36 PM
To: Alex Deucher <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; Maling list - DRI developers <[email protected]>; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/atomic: Add new reverse iterator over all plane stateQuoted 17 lines · Alex Deucher
+ dri-devel
Quoted 13 lines · Shirish
From: Shirish S <[email protected]>
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 <[email protected]>Signed-off-by Pratik Vishwakarma <[email protected]>Makes sense.
Quoted 12 lines
Quoted 12 lines
--- include/drm/drm_atomic.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)include/drm/drm_atomic.h +0
-0@@ -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))Quoted 4 lines
include/drm/drm_atomic.h void drm_state_dump(struct drm_device *dev, struct drm_printer *p); · line 760
Quoted 4 lines
include/drm/drm_atomic.h +3
-0/** +* for_each_oldnew_plane_in_state_reverse - iterate over all +planes in an atomic +* update in reverse order Are you sure this renders correctly in kernel-doc? Iirc you have to indent the continuation line.
Assuming this is fixed:
Reviewed-by Daniel Vetter <[email protected]>Quoted 31 lines
Quoted 31 lines
include/drm/drm_atomic.h +25
-1+* @__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
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel