Skip to content

Commit 02d6f9a

Browse files
author
Thomas Zimmermann
committed
drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro
Provide DRM_PLANE_NON_ATOMIC_FUNCS, which initializes plane functions of non-atomic drivers to default values. The macro is not supposed to be used in new code, but helps with documenting and finding existing users. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Lyude Paul <[email protected]> # nouveau Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fa0706e commit 02d6f9a

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

drivers/gpu/drm/drm_modeset_helper.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ static const uint32_t safe_modeset_formats[] = {
108108
};
109109

110110
static const struct drm_plane_funcs primary_plane_funcs = {
111-
.update_plane = drm_plane_helper_update_primary,
112-
.disable_plane = drm_plane_helper_disable_primary,
113-
.destroy = drm_plane_helper_destroy,
111+
DRM_PLANE_NON_ATOMIC_FUNCS,
114112
};
115113

116114
/**

drivers/gpu/drm/nouveau/dispnv04/crtc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,9 +1276,7 @@ static const uint32_t modeset_formats[] = {
12761276
};
12771277

12781278
static const struct drm_plane_funcs nv04_primary_plane_funcs = {
1279-
.update_plane = drm_plane_helper_update_primary,
1280-
.disable_plane = drm_plane_helper_disable_primary,
1281-
.destroy = drm_plane_helper_destroy,
1279+
DRM_PLANE_NON_ATOMIC_FUNCS,
12821280
};
12831281

12841282
static int nv04_crtc_vblank_handler(struct nvif_notify *notify)

include/drm/drm_plane_helper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,16 @@ int drm_plane_helper_disable_primary(struct drm_plane *plane,
4343
void drm_plane_helper_destroy(struct drm_plane *plane);
4444
int drm_plane_helper_atomic_check(struct drm_plane *plane, struct drm_atomic_state *state);
4545

46+
/**
47+
* DRM_PLANE_NON_ATOMIC_FUNCS - Default plane functions for non-atomic drivers
48+
*
49+
* This macro initializes plane functions for non-atomic drivers to default
50+
* values. Non-atomic interfaces are deprecated and should not be used in new
51+
* drivers.
52+
*/
53+
#define DRM_PLANE_NON_ATOMIC_FUNCS \
54+
.update_plane = drm_plane_helper_update_primary, \
55+
.disable_plane = drm_plane_helper_disable_primary, \
56+
.destroy = drm_plane_helper_destroy
57+
4658
#endif

0 commit comments

Comments
 (0)