Maxime Ripard
351f950db4
drm/atomic: Pass the full state to CRTC atomic enable/disable
If the CRTC driver ever needs to access the full DRM state, it can't do so
at atomic_enable / atomic_disable time since drm_atomic_helper_swap_state
will have cleared the pointer from the struct drm_crtc_state to the struct
drm_atomic_state before calling those hooks.
In order to allow that, let's pass the full DRM state to atomic_enable and
atomic_disable. The conversion was done using the coccinelle script below,
built tested on all the drivers and actually tested on vc4.
virtual report
@@
struct drm_crtc_helper_funcs *FUNCS;
identifier dev, state;
identifier crtc, crtc_state;
@@
disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
{
<...
- FUNCS->atomic_disable(crtc, crtc_state);
+ FUNCS->atomic_disable(crtc, state);
...>
}
@@
struct drm_crtc_helper_funcs *FUNCS;
identifier dev, state;
identifier crtc, crtc_state;
@@
drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state)
{
<...
- FUNCS->atomic_enable(crtc, crtc_state);
+ FUNCS->atomic_enable(crtc, state);
...>
}
@@
identifier crtc, old_state;
@@
struct drm_crtc_helper_funcs {
...
- void (*atomic_enable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
+ void (*atomic_enable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
...
- void (*atomic_disable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
+ void (*atomic_disable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
...
}
@ crtc_atomic_func @
identifier helpers;
identifier func;
@@
(
static struct drm_crtc_helper_funcs helpers = {
...,
.atomic_enable = func,
...,
};
|
static struct drm_crtc_helper_funcs helpers = {
...,
.atomic_disable = func,
...,
};
)
@ ignores_old_state @
identifier crtc_atomic_func.func;
identifier crtc, old_state;
@@
void func(struct drm_crtc *crtc,
struct drm_crtc_state *old_state)
{
... when != old_state
}
@ adds_old_state depends on crtc_atomic_func && !ignores_old_state @
identifier crtc_atomic_func.func;
identifier crtc, old_state;
@@
void func(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
{
+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
...
}
@ depends on crtc_atomic_func @
identifier crtc_atomic_func.func;
expression E;
type T;
@@
void func(...)
{
...
- T state = E;
+ T crtc_state = E;
<+...
- state
+ crtc_state
...+>
}
@ depends on crtc_atomic_func @
identifier crtc_atomic_func.func;
type T;
@@
void func(...)
{
...
- T state;
+ T crtc_state;
<+...
- state
+ crtc_state
...+>
}
@ depends on crtc_atomic_func @
identifier crtc_atomic_func.func;
identifier old_state;
identifier crtc;
@@
void func(struct drm_crtc *crtc,
- struct drm_crtc_state *old_state
+ struct drm_atomic_state *state
)
{ ... }
@ include depends on adds_old_state @
@@
#include <drm/drm_atomic.h>
@ no_include depends on !include && adds_old_state @
@@
+ #include <drm/drm_atomic.h>
#include <drm/...>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/845aa10ef171fc0ea060495efef142a0c13f7870.1602161031.git-series.maxime@cerno.tech
2020-10-09 09:55:59 +02:00
..
2020-10-07 13:53:08 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 18:16:34 +10:30
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-08-11 11:58:31 +10:00
2020-10-05 16:25:25 +02:00
2020-09-29 12:41:21 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-05 15:52:37 +02:00
2020-10-09 09:55:59 +02:00
2020-08-06 14:27:31 -07:00
2020-09-11 10:54:17 +02:00
2020-09-29 12:41:21 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-08-11 11:58:31 +10:00
2020-08-15 12:14:18 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-08-27 11:17:52 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-07 13:53:08 +02:00
2020-10-09 09:55:59 +02:00
2020-09-24 22:38:54 +02:00
2020-10-08 10:52:02 +01:00
2020-09-25 09:21:14 +02:00
2020-10-09 09:55:59 +02:00
2020-04-03 17:11:41 +02:00
2020-10-07 13:53:08 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-08-23 17:36:59 -05:00
2020-10-05 15:06:33 +02:00
2020-06-23 15:57:30 +02:00
2020-06-10 09:05:18 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-06-24 09:17:34 +02:00
2020-10-07 14:10:18 +02:00
2020-09-03 21:14:09 +02:00
2020-06-10 10:17:21 +02:00
2020-08-10 15:32:00 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-09-25 09:21:30 +02:00
2020-08-23 17:36:59 -05:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-09-25 09:21:40 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-10-09 09:55:59 +02:00
2020-07-02 20:25:51 +02:00
2020-07-02 15:26:00 +02:00
2020-10-08 11:30:03 +02:00
2020-06-15 14:49:50 +01:00
2020-05-14 02:10:52 +03:00
2020-08-26 19:11:41 +02:00
2020-06-23 19:53:27 +02:00
2020-08-23 17:36:59 -05:00
2020-05-27 14:31:42 +03:00
2020-05-26 13:31:01 +02:00
2020-08-17 13:41:50 -04:00
2020-09-01 13:38:34 +03:00
2020-03-16 09:23:55 +01:00
2020-07-13 13:29:20 -04:00
2020-07-02 15:26:00 +02:00
2020-03-18 17:53:28 +01:00
2020-08-25 11:00:02 +02:00
2020-09-01 09:45:44 +02:00
2020-06-25 15:47:14 -07:00
2020-04-03 17:11:41 +02:00
2020-09-09 12:27:13 +10:00
2020-09-22 14:06:20 -04:00
2020-09-21 10:45:08 +02:00
2020-08-05 19:50:06 -07:00
2020-06-19 09:20:21 +02:00
2020-04-21 08:15:03 +02:00
2020-10-08 11:29:33 +02:00
2020-07-02 15:26:00 +02:00
2020-05-26 13:33:08 +02:00
2020-06-19 13:33:40 +01:00
2020-09-09 11:45:18 +02:00
2020-09-29 12:41:21 +02:00
2020-05-19 22:31:31 +01:00
2020-09-29 12:41:21 +02:00
2020-09-08 10:43:30 +02:00
2020-10-07 15:41:58 +10:00
2020-09-25 09:21:48 +02:00
2020-05-05 14:01:53 -04:00
2020-09-21 10:45:08 +02:00
2020-07-02 15:26:00 +02:00
2020-06-24 15:45:51 +10:00
2020-05-29 12:58:11 +02:00
2020-07-02 15:26:00 +02:00
2020-07-02 15:26:00 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-07-10 20:21:45 +02:00
2020-06-23 15:46:40 +02:00
2020-07-02 15:26:00 +02:00
2020-08-17 13:41:50 -04:00
2020-08-23 17:36:59 -05:00
2020-08-11 11:58:31 +10:00
2020-08-04 11:45:23 +02:00
2020-08-16 17:12:18 +02:00
2020-07-02 15:26:00 +02:00
2020-08-25 11:00:02 +02:00
2020-09-29 12:41:21 +02:00
2020-07-31 14:42:37 +10:00
2020-06-02 10:59:11 -07:00
2020-10-09 09:55:59 +02:00
2020-08-02 15:22:31 +02:00
2020-06-03 10:24:23 +02:00
2020-08-06 11:55:43 -07:00
2020-09-14 22:37:31 +03:00
2020-06-24 15:45:51 +10:00
2020-05-20 20:03:45 +02:00
2020-07-18 02:59:16 +03:00
2020-09-09 16:39:48 +02:00