[Spice-devel] [PATCH v2 04/11] drm/atomic: Pass the full state to planes atomic_check

2021-01-21 Thread Maxime Ripard
The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's convert all the remaining helpers to provide a consistent int

[Spice-devel] [PATCH v2 07/11] drm: Store new plane state in a variable for atomic_update and disable

2021-01-21 Thread Maxime Ripard
In order to store the new plane state in a subsequent helper, let's move the plane->state dereferences into a variable. This was done using the following coccinelle script, plus some hand changes for vmwgfx: @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm

[Spice-devel] [PATCH v2 02/11] drm: Rename plane atomic_check state names

2021-01-21 Thread Maxime Ripard
Most drivers call the argument to the plane atomic_check hook simply state, which is going to conflict with the global atomic state in a later rework. Let's rename it to new_plane_state (or new_state depending on the convention used in the driver). This was done using the coccinelle script below,

[Spice-devel] [PATCH v2 10/11] drm: Use state helper instead of the plane state pointer

2021-01-21 Thread Maxime Ripard
Many drivers reference the plane->state pointer in order to get the current plane state in their atomic_update or atomic_disable hooks, which would be the new plane state in the global atomic state since _swap_state happened when those hooks are run. Use the drm_atomic_get_new_plane_state helper t

Re: [Spice-devel] [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update

2021-01-21 Thread Laurent Pinchart
Hi Maxime, Thank you for the patch. On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote: > The current atomic helpers have either their object state being passed as > an argument or the full atomic state. > > The former is the pattern that was done at first, before switching to the > l

[Spice-devel] [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update

2021-01-21 Thread Maxime Ripard
The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's convert the remaining helpers to provide a consistent interfa