xref: /linux/include/drm/drm_plane_helper.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1c103d1cfSMatt Roper /*
2c103d1cfSMatt Roper  * Copyright (C) 2011-2013 Intel Corporation
3c103d1cfSMatt Roper  *
4c103d1cfSMatt Roper  * Permission is hereby granted, free of charge, to any person obtaining a
5c103d1cfSMatt Roper  * copy of this software and associated documentation files (the "Software"),
6c103d1cfSMatt Roper  * to deal in the Software without restriction, including without limitation
7c103d1cfSMatt Roper  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8c103d1cfSMatt Roper  * and/or sell copies of the Software, and to permit persons to whom the
9c103d1cfSMatt Roper  * Software is furnished to do so, subject to the following conditions:
10c103d1cfSMatt Roper  *
11c103d1cfSMatt Roper  * The above copyright notice and this permission notice (including the next
12c103d1cfSMatt Roper  * paragraph) shall be included in all copies or substantial portions of the
13c103d1cfSMatt Roper  * Software.
14c103d1cfSMatt Roper  *
15c103d1cfSMatt Roper  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16c103d1cfSMatt Roper  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17c103d1cfSMatt Roper  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18c103d1cfSMatt Roper  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19c103d1cfSMatt Roper  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20c103d1cfSMatt Roper  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21c103d1cfSMatt Roper  * SOFTWARE.
22c103d1cfSMatt Roper  */
23c103d1cfSMatt Roper 
24c103d1cfSMatt Roper #ifndef DRM_PLANE_HELPER_H
25c103d1cfSMatt Roper #define DRM_PLANE_HELPER_H
26c103d1cfSMatt Roper 
2730c63715SThomas Zimmermann #include <linux/types.h>
287daf8d54SMatt Roper 
2930c63715SThomas Zimmermann struct drm_crtc;
3030c63715SThomas Zimmermann struct drm_framebuffer;
3130c63715SThomas Zimmermann struct drm_modeset_acquire_ctx;
3230c63715SThomas Zimmermann struct drm_plane;
3330c63715SThomas Zimmermann 
3430c63715SThomas Zimmermann int drm_plane_helper_update_primary(struct drm_plane *plane, struct drm_crtc *crtc,
3530c63715SThomas Zimmermann 				    struct drm_framebuffer *fb,
3630c63715SThomas Zimmermann 				    int crtc_x, int crtc_y,
3730c63715SThomas Zimmermann 				    unsigned int crtc_w, unsigned int crtc_h,
3830c63715SThomas Zimmermann 				    uint32_t src_x, uint32_t src_y,
3930c63715SThomas Zimmermann 				    uint32_t src_w, uint32_t src_h,
4030c63715SThomas Zimmermann 				    struct drm_modeset_acquire_ctx *ctx);
4130c63715SThomas Zimmermann int drm_plane_helper_disable_primary(struct drm_plane *plane,
4230c63715SThomas Zimmermann 				     struct drm_modeset_acquire_ctx *ctx);
4330c63715SThomas Zimmermann void drm_plane_helper_destroy(struct drm_plane *plane);
44c103d1cfSMatt Roper 
45*02d6f9a1SThomas Zimmermann /**
46*02d6f9a1SThomas Zimmermann  * DRM_PLANE_NON_ATOMIC_FUNCS - Default plane functions for non-atomic drivers
47*02d6f9a1SThomas Zimmermann  *
48*02d6f9a1SThomas Zimmermann  * This macro initializes plane functions for non-atomic drivers to default
49*02d6f9a1SThomas Zimmermann  * values. Non-atomic interfaces are deprecated and should not be used in new
50*02d6f9a1SThomas Zimmermann  * drivers.
51*02d6f9a1SThomas Zimmermann  */
52*02d6f9a1SThomas Zimmermann #define DRM_PLANE_NON_ATOMIC_FUNCS \
53*02d6f9a1SThomas Zimmermann 	.update_plane = drm_plane_helper_update_primary, \
54*02d6f9a1SThomas Zimmermann 	.disable_plane = drm_plane_helper_disable_primary, \
55*02d6f9a1SThomas Zimmermann 	.destroy = drm_plane_helper_destroy
56*02d6f9a1SThomas Zimmermann 
57c103d1cfSMatt Roper #endif
58