sti_mixer.h 1.6 KB
Newer Older
B
Benjamin Gaignard 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
 * Copyright (C) STMicroelectronics SA 2014
 * Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
 *          Fabien Dessenne <fabien.dessenne@st.com>
 *          for STMicroelectronics.
 * License terms:  GNU General Public License (GPL), version 2
 */

#ifndef _STI_MIXER_H_
#define _STI_MIXER_H_

#include <drm/drmP.h>

14
#include "sti_plane.h"
B
Benjamin Gaignard 已提交
15 16 17

#define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc)

18 19 20 21 22 23
enum sti_mixer_status {
	STI_MIXER_READY,
	STI_MIXER_DISABLING,
	STI_MIXER_DISABLED,
};

B
Benjamin Gaignard 已提交
24 25 26 27 28 29 30 31
/**
 * STI Mixer subdevice structure
 *
 * @dev: driver device
 * @regs: mixer registers
 * @id: id of the mixer
 * @drm_crtc: crtc object link to the mixer
 * @pending_event: set if a flip event is pending on crtc
32
 * @status: to know the status of the mixer
B
Benjamin Gaignard 已提交
33 34 35 36 37
 */
struct sti_mixer {
	struct device *dev;
	void __iomem *regs;
	int id;
V
Vincent Abriou 已提交
38
	struct drm_crtc drm_crtc;
B
Benjamin Gaignard 已提交
39
	struct drm_pending_vblank_event *pending_event;
40
	enum sti_mixer_status status;
B
Benjamin Gaignard 已提交
41 42 43 44
};

const char *sti_mixer_to_str(struct sti_mixer *mixer);

45 46 47
struct sti_mixer *sti_mixer_create(struct device *dev,
				   struct drm_device *drm_dev,
				   int id,
V
Vincent Abriou 已提交
48
				   void __iomem *baseaddr);
B
Benjamin Gaignard 已提交
49

V
Vincent Abriou 已提交
50 51 52
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);
B
Benjamin Gaignard 已提交
53
int sti_mixer_active_video_area(struct sti_mixer *mixer,
V
Vincent Abriou 已提交
54
				struct drm_display_mode *mode);
B
Benjamin Gaignard 已提交
55 56 57 58

void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable);

/* depth in Cross-bar control = z order */
V
Vincent Abriou 已提交
59
#define GAM_MIXER_NB_DEPTH_LEVEL 6
B
Benjamin Gaignard 已提交
60 61 62 63 64

#define STI_MIXER_MAIN 0
#define STI_MIXER_AUX  1

#endif