2017-12-06 19:29:47 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2014-07-28 16:30:18 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) STMicroelectronics SA 2014
|
|
|
|
* Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
|
|
|
|
* Fabien Dessenne <fabien.dessenne@st.com>
|
|
|
|
* for STMicroelectronics.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _STI_MIXER_H_
|
|
|
|
#define _STI_MIXER_H_
|
|
|
|
|
2019-06-05 21:48:35 +08:00
|
|
|
#include <drm/drm_crtc.h>
|
|
|
|
|
|
|
|
#include <drm/drm_debugfs.h>
|
|
|
|
#include <drm/drm_file.h>
|
2014-07-28 16:30:18 +08:00
|
|
|
|
2015-07-31 17:32:34 +08:00
|
|
|
#include "sti_plane.h"
|
2014-07-28 16:30:18 +08:00
|
|
|
|
2019-06-05 21:48:35 +08:00
|
|
|
struct device;
|
|
|
|
|
2014-07-28 16:30:18 +08:00
|
|
|
#define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc)
|
|
|
|
|
2015-08-03 20:22:16 +08:00
|
|
|
enum sti_mixer_status {
|
|
|
|
STI_MIXER_READY,
|
|
|
|
STI_MIXER_DISABLING,
|
|
|
|
STI_MIXER_DISABLED,
|
|
|
|
};
|
|
|
|
|
2014-07-28 16:30:18 +08:00
|
|
|
/**
|
|
|
|
* STI Mixer subdevice structure
|
|
|
|
*
|
|
|
|
* @dev: driver device
|
|
|
|
* @regs: mixer registers
|
|
|
|
* @id: id of the mixer
|
|
|
|
* @drm_crtc: crtc object link to the mixer
|
2015-08-03 20:22:16 +08:00
|
|
|
* @status: to know the status of the mixer
|
2014-07-28 16:30:18 +08:00
|
|
|
*/
|
|
|
|
struct sti_mixer {
|
|
|
|
struct device *dev;
|
|
|
|
void __iomem *regs;
|
|
|
|
int id;
|
2015-07-31 17:32:13 +08:00
|
|
|
struct drm_crtc drm_crtc;
|
2015-08-03 20:22:16 +08:00
|
|
|
enum sti_mixer_status status;
|
2014-07-28 16:30:18 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const char *sti_mixer_to_str(struct sti_mixer *mixer);
|
|
|
|
|
2016-02-05 00:44:50 +08:00
|
|
|
struct sti_mixer *sti_mixer_create(struct device *dev,
|
|
|
|
struct drm_device *drm_dev,
|
|
|
|
int id,
|
2015-07-31 17:32:13 +08:00
|
|
|
void __iomem *baseaddr);
|
2014-07-28 16:30:18 +08:00
|
|
|
|
2015-07-31 17:32:13 +08:00
|
|
|
int sti_mixer_set_plane_status(struct sti_mixer *mixer,
|
|
|
|
struct sti_plane *plane, bool status);
|
|
|
|
int sti_mixer_set_plane_depth(struct sti_mixer *mixer, struct sti_plane *plane);
|
2014-07-28 16:30:18 +08:00
|
|
|
int sti_mixer_active_video_area(struct sti_mixer *mixer,
|
2015-07-31 17:32:13 +08:00
|
|
|
struct drm_display_mode *mode);
|
2014-07-28 16:30:18 +08:00
|
|
|
|
|
|
|
void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable);
|
|
|
|
|
2016-06-21 21:09:39 +08:00
|
|
|
int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor);
|
|
|
|
|
2014-07-28 16:30:18 +08:00
|
|
|
/* depth in Cross-bar control = z order */
|
2015-07-31 17:31:38 +08:00
|
|
|
#define GAM_MIXER_NB_DEPTH_LEVEL 6
|
2014-07-28 16:30:18 +08:00
|
|
|
|
|
|
|
#define STI_MIXER_MAIN 0
|
|
|
|
#define STI_MIXER_AUX 1
|
|
|
|
|
|
|
|
#endif
|