/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C) 2017 Icenowy Zheng <[email protected]> */ #ifndef _SUNXI_ENGINE_H_ #define _SUNXI_ENGINE_H_ struct drm_plane; struct drm_crtc; struct drm_device; struct drm_crtc_state; struct drm_display_mode; struct sunxi_engine; /** * struct sunxi_engine_ops - helper operations for sunXi engines * * These hooks are used by the common part of the DRM driver to * implement the proper behaviour. */ struct sunxi_engine_ops { … }; /** * struct sunxi_engine - the common parts of an engine for sun4i-drm driver * @ops: the operations of the engine * @node: the of device node of the engine * @regs: the regmap of the engine * @id: the id of the engine (-1 if not used) */ struct sunxi_engine { … }; /** * sunxi_engine_commit() - commit all changes of the engine * @engine: pointer to the engine * @crtc: pointer to crtc the engine is associated with * @state: atomic state */ static inline void sunxi_engine_commit(struct sunxi_engine *engine, struct drm_crtc *crtc, struct drm_atomic_state *state) { … } /** * sunxi_engine_layers_init() - Create planes (layers) for the engine * @drm: pointer to the drm_device for which planes will be created * @engine: pointer to the engine */ static inline struct drm_plane ** sunxi_engine_layers_init(struct drm_device *drm, struct sunxi_engine *engine) { … } /** * sunxi_engine_apply_color_correction - Apply the RGB2YUV color correction * @engine: pointer to the engine * * This functionality is optional for an engine, however, if the engine is * intended to be used with TV Encoder, the output will be incorrect * without the color correction, due to TV Encoder expects the engine to * output directly YUV signal. */ static inline void sunxi_engine_apply_color_correction(struct sunxi_engine *engine) { … } /** * sunxi_engine_disable_color_correction - Disable the color space correction * @engine: pointer to the engine * * This function is paired with apply_color_correction(). */ static inline void sunxi_engine_disable_color_correction(struct sunxi_engine *engine) { … } /** * sunxi_engine_mode_set - Inform engine of a new mode * @engine: pointer to the engine * @mode: new mode * * Engine can use this functionality to set specifics once per mode change. */ static inline void sunxi_engine_mode_set(struct sunxi_engine *engine, const struct drm_display_mode *mode) { … } #endif /* _SUNXI_ENGINE_H_ */