linux/include/drm/drm_simple_kms_helper.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2016 Noralf Trønnes
 */

#ifndef __LINUX_DRM_SIMPLE_KMS_HELPER_H
#define __LINUX_DRM_SIMPLE_KMS_HELPER_H

#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>
#include <drm/drm_plane.h>

struct drm_simple_display_pipe;

/**
 * struct drm_simple_display_pipe_funcs - helper operations for a simple
 *                                        display pipeline
 */
struct drm_simple_display_pipe_funcs {};

/**
 * struct drm_simple_display_pipe - simple display pipeline
 * @crtc: CRTC control structure
 * @plane: Plane control structure
 * @encoder: Encoder control structure
 * @connector: Connector control structure
 * @funcs: Pipeline control functions (optional)
 *
 * Simple display pipeline with plane, crtc and encoder collapsed into one
 * entity. It should be initialized by calling drm_simple_display_pipe_init().
 */
struct drm_simple_display_pipe {};

int drm_simple_display_pipe_attach_bridge(struct drm_simple_display_pipe *pipe,
					  struct drm_bridge *bridge);

int drm_simple_display_pipe_init(struct drm_device *dev,
			struct drm_simple_display_pipe *pipe,
			const struct drm_simple_display_pipe_funcs *funcs,
			const uint32_t *formats, unsigned int format_count,
			const uint64_t *format_modifiers,
			struct drm_connector *connector);

int drm_simple_encoder_init(struct drm_device *dev,
			    struct drm_encoder *encoder,
			    int encoder_type);

void *__drmm_simple_encoder_alloc(struct drm_device *dev, size_t size,
				  size_t offset, int encoder_type);

/**
 * drmm_simple_encoder_alloc - Allocate and initialize an encoder with basic
 *                             functionality.
 * @dev: drm device
 * @type: the type of the struct which contains struct &drm_encoder
 * @member: the name of the &drm_encoder within @type.
 * @encoder_type: user visible type of the encoder
 *
 * Allocates and initializes an encoder that has no further functionality.
 * Settings for possible CRTC and clones are left to their initial values.
 * Cleanup is automatically handled through registering drm_encoder_cleanup()
 * with drmm_add_action().
 *
 * Returns:
 * Pointer to new encoder, or ERR_PTR on failure.
 */
#define drmm_simple_encoder_alloc(dev, type, member, encoder_type)

#endif /* __LINUX_DRM_SIMPLE_KMS_HELPER_H */