/*
* Copyright © 2006 Keith Packard
* Copyright © 2007-2008 Dave Airlie
* Copyright © 2007-2008 Intel Corporation
* Jesse Barnes <jesse.barnes@intel.com>
* Copyright © 2011-2013 Intel Corporation
* Copyright © 2015 Intel Corporation
* Daniel Vetter <daniel.vetter@ffwll.ch>
*
* 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.
*/
enum mode_set_atomic;
struct drm_writeback_connector;
struct drm_writeback_job;
/**
* struct drm_crtc_helper_funcs - helper operations for CRTCs
*
* These hooks are used by the legacy CRTC helpers, the transitional plane
* helpers and the new atomic modesetting helpers.
*/
struct drm_crtc_helper_funcs {
/**
* @dpms:
*
* Callback to control power levels on the CRTC. If the mode passed in
* is unsupported, the provider must use the next lowest power level.
* This is used by the legacy CRTC helpers to implement DPMS
* functionality in drm_helper_connector_dpms().
*
* This callback is also used to disable a CRTC by calling it with
* DRM_MODE_DPMS_OFF if the @disable hook isn't used.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for enabling and disabling a CRTC to
* facilitate transitions to atomic, but it is deprecated. Instead
* @atomic_enable and @atomic_disable should be used.
*/
void (*dpms)(struct drm_crtc *crtc, int mode);
/**
* @prepare:
*
* This callback should prepare the CRTC for a subsequent modeset, which
* in practice means the driver should disable the CRTC if it is
* running. Most drivers ended up implementing this by calling their
* @dpms hook with DRM_MODE_DPMS_OFF.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for disabling a CRTC to facilitate
* transitions to atomic, but it is deprecated. Instead @atomic_disable
* should be used.
*/
void (*prepare)(struct drm_crtc *crtc);
/**
* @commit:
*
* This callback should commit the new mode on the CRTC after a modeset,
* which in practice means the driver should enable the CRTC. Most
* drivers ended up implementing this by calling their @dpms hook with
* DRM_MODE_DPMS_ON.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using