Skip to content

Commit fa0706e

Browse files
author
Thomas Zimmermann
committed
drm/plane-helper: Warn if atomic drivers call non-atomic helpers
The plane update and disable helpers are only useful for non-atomic drivers. Print a warning if an atomic driver calls them. Suggested-by: Daniel Vetter <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e71def0 commit fa0706e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/drm_plane_helper.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
#include <drm/drm_atomic_uapi.h>
3131
#include <drm/drm_crtc_helper.h>
3232
#include <drm/drm_device.h>
33+
#include <drm/drm_drv.h>
3334
#include <drm/drm_encoder.h>
3435
#include <drm/drm_plane_helper.h>
36+
#include <drm/drm_print.h>
3537
#include <drm/drm_rect.h>
3638

3739
#define SUBPIXEL_MASK 0xffff
@@ -195,10 +197,14 @@ int drm_plane_helper_update_primary(struct drm_plane *plane, struct drm_crtc *cr
195197
.x2 = crtc_x + crtc_w,
196198
.y2 = crtc_y + crtc_h,
197199
};
200+
struct drm_device *dev = plane->dev;
198201
struct drm_connector **connector_list;
199202
int num_connectors, ret;
200203
bool visible;
201204

205+
if (drm_WARN_ON_ONCE(dev, drm_drv_uses_atomic_modeset(dev)))
206+
return -EINVAL;
207+
202208
ret = drm_plane_helper_check_update(plane, crtc, fb,
203209
&src, &dest,
204210
DRM_MODE_ROTATE_0,
@@ -260,6 +266,10 @@ EXPORT_SYMBOL(drm_plane_helper_update_primary);
260266
int drm_plane_helper_disable_primary(struct drm_plane *plane,
261267
struct drm_modeset_acquire_ctx *ctx)
262268
{
269+
struct drm_device *dev = plane->dev;
270+
271+
drm_WARN_ON_ONCE(dev, drm_drv_uses_atomic_modeset(dev));
272+
263273
return -EINVAL;
264274
}
265275
EXPORT_SYMBOL(drm_plane_helper_disable_primary);

0 commit comments

Comments
 (0)