/* * Copyright © 2006 Keith Packard * Copyright © 2007-2008 Dave Airlie * Copyright © 2007-2008 Intel Corporation * Jesse Barnes <[email protected]> * Copyright © 2011-2013 Intel Corporation * Copyright © 2015 Intel Corporation * Daniel Vetter <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __DRM_MODESET_HELPER_VTABLES_H__ #define __DRM_MODESET_HELPER_VTABLES_H__ #include <drm/drm_crtc.h> #include <drm/drm_encoder.h> /** * DOC: overview * * The DRM mode setting helper functions are common code for drivers to use if * they wish. Drivers are not forced to use this code in their * implementations but it would be useful if the code they do use at least * provides a consistent interface and operation to userspace. Therefore it is * highly recommended to use the provided helpers as much as possible. * * Because there is only one pointer per modeset object to hold a vfunc table * for helper libraries they are by necessity shared among the different * helpers. * * To make this clear all the helper vtables are pulled together in this location here. */ struct drm_scanout_buffer; struct drm_writeback_connector; struct drm_writeback_job; enum mode_set_atomic { … }; /** * struct drm_crtc_helper_funcs - helper operations for CRTCs * * These hooks are used by the legacy CRTC helpers and the new atomic * modesetting helpers. */ struct drm_crtc_helper_funcs { … }; /** * drm_crtc_helper_add - sets the helper vtable for a crtc * @crtc: DRM CRTC * @funcs: helper vtable to set for @crtc */ static inline void drm_crtc_helper_add(struct drm_crtc *crtc, const struct drm_crtc_helper_funcs *funcs) { … } /** * struct drm_encoder_helper_funcs - helper operations for encoders * * These hooks are used by the legacy CRTC helpers and the new atomic * modesetting helpers. */ struct drm_encoder_helper_funcs { … }; /** * drm_encoder_helper_add - sets the helper vtable for an encoder * @encoder: DRM encoder * @funcs: helper vtable to set for @encoder */ static inline void drm_encoder_helper_add(struct drm_encoder *encoder, const struct drm_encoder_helper_funcs *funcs) { … } /** * struct drm_connector_helper_funcs - helper operations for connectors * * These functions are used by the atomic and legacy modeset helpers and by the * probe helpers. */ struct drm_connector_helper_funcs { … }; /** * drm_connector_helper_add - sets the helper vtable for a connector * @connector: DRM connector * @funcs: helper vtable to set for @connector */ static inline void drm_connector_helper_add(struct drm_connector *connector, const struct drm_connector_helper_funcs *funcs) { … } /** * struct drm_plane_helper_funcs - helper operations for planes * * These functions are used by the atomic helpers. */ struct drm_plane_helper_funcs { … }; /** * drm_plane_helper_add - sets the helper vtable for a plane * @plane: DRM plane * @funcs: helper vtable to set for @plane */ static inline void drm_plane_helper_add(struct drm_plane *plane, const struct drm_plane_helper_funcs *funcs) { … } /** * struct drm_mode_config_helper_funcs - global modeset helper operations * * These helper functions are used by the atomic helpers. */ struct drm_mode_config_helper_funcs { … }; #endif