diff options
author | Maxime Ripard <maxime@cerno.tech> | 2020-11-02 14:38:34 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2020-11-03 12:20:09 +0100 |
commit | d74252bb8f0e38194e7457f7b4e5a8a33514bc24 (patch) | |
tree | 86b7456df926d93c1232f3497d07b13805e62168 /drivers/gpu/drm/drm_simple_kms_helper.c | |
parent | drm/nouveau/kms/nv50-: Use state helper instead of crtc pointer (diff) | |
download | linux-d74252bb8f0e38194e7457f7b4e5a8a33514bc24.tar.xz linux-d74252bb8f0e38194e7457f7b4e5a8a33514bc24.zip |
drm: Use the state pointer directly in atomic_check
Now that atomic_check takes the global atomic state as a parameter, we
don't need to go through the pointer in the CRTC state.
This was done using the following coccinelle script:
@ crtc_atomic_func @
identifier helpers;
identifier func;
@@
static struct drm_crtc_helper_funcs helpers = {
...,
.atomic_check = func,
...,
};
@@
identifier crtc_atomic_func.func;
identifier crtc, state;
@@
func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
...
- struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
... when != crtc_state
- crtc_state->state
+ state
...
}
@@
struct drm_crtc_state *crtc_state;
identifier crtc_atomic_func.func;
identifier crtc, state;
@@
func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
...
- crtc_state->state
+ state
...
}
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102133834.1176740-3-maxime@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/drm_simple_kms_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_simple_kms_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 4b46689634dd..743e57c1b44f 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -97,7 +97,7 @@ static int drm_simple_kms_crtc_check(struct drm_crtc *crtc, if (has_primary != crtc_state->enable) return -EINVAL; - return drm_atomic_add_affected_planes(crtc_state->state, crtc); + return drm_atomic_add_affected_planes(state, crtc); } static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc, |