2017-12-06 14:29:47 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2014-07-30 21:28:27 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) STMicroelectronics SA 2014
|
|
|
|
* Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
|
|
|
|
* Fabien Dessenne <fabien.dessenne@st.com>
|
|
|
|
* for STMicroelectronics.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _STI_COMPOSITOR_H_
|
|
|
|
#define _STI_COMPOSITOR_H_
|
|
|
|
|
|
|
|
#include <linux/clk.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
|
|
|
#include "sti_mixer.h"
|
2015-07-31 12:32:34 +03:00
|
|
|
#include "sti_plane.h"
|
2014-07-30 21:28:27 +04:00
|
|
|
|
|
|
|
#define WAIT_NEXT_VSYNC_MS 50 /*ms*/
|
|
|
|
|
|
|
|
#define STI_MAX_MIXER 2
|
2015-07-31 12:32:13 +03:00
|
|
|
#define STI_MAX_VID 1
|
2014-07-30 21:28:27 +04:00
|
|
|
|
|
|
|
enum sti_compositor_subdev_type {
|
|
|
|
STI_MIXER_MAIN_SUBDEV,
|
|
|
|
STI_MIXER_AUX_SUBDEV,
|
|
|
|
STI_GPD_SUBDEV,
|
|
|
|
STI_VID_SUBDEV,
|
|
|
|
STI_CURSOR_SUBDEV,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sti_compositor_subdev_descriptor {
|
|
|
|
enum sti_compositor_subdev_type type;
|
|
|
|
int id;
|
|
|
|
unsigned int offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* STI Compositor data structure
|
|
|
|
*
|
|
|
|
* @nb_subdev: number of subdevices supported by the compositor
|
|
|
|
* @subdev_desc: subdev list description
|
|
|
|
*/
|
|
|
|
#define MAX_SUBDEV 9
|
|
|
|
struct sti_compositor_data {
|
|
|
|
unsigned int nb_subdev;
|
|
|
|
struct sti_compositor_subdev_descriptor subdev_desc[MAX_SUBDEV];
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* STI Compositor structure
|
|
|
|
*
|
|
|
|
* @dev: driver device
|
|
|
|
* @regs: registers (main)
|
|
|
|
* @data: device data
|
|
|
|
* @clk_compo_main: clock for main compo
|
|
|
|
* @clk_compo_aux: clock for aux compo
|
|
|
|
* @clk_pix_main: pixel clock for main path
|
|
|
|
* @clk_pix_aux: pixel clock for aux path
|
|
|
|
* @rst_main: reset control of the main path
|
|
|
|
* @rst_aux: reset control of the aux path
|
|
|
|
* @mixer: array of mixers
|
2015-07-31 12:32:13 +03:00
|
|
|
* @vid: array of vids
|
2016-09-06 10:42:25 +03:00
|
|
|
* @vtg: array of vtgs
|
2016-09-06 10:42:13 +03:00
|
|
|
* @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
|
2014-07-30 21:28:27 +04:00
|
|
|
*/
|
|
|
|
struct sti_compositor {
|
|
|
|
struct device *dev;
|
|
|
|
void __iomem *regs;
|
|
|
|
struct sti_compositor_data data;
|
|
|
|
struct clk *clk_compo_main;
|
|
|
|
struct clk *clk_compo_aux;
|
|
|
|
struct clk *clk_pix_main;
|
|
|
|
struct clk *clk_pix_aux;
|
|
|
|
struct reset_control *rst_main;
|
|
|
|
struct reset_control *rst_aux;
|
|
|
|
struct sti_mixer *mixer[STI_MAX_MIXER];
|
2015-07-31 12:32:13 +03:00
|
|
|
struct sti_vid *vid[STI_MAX_VID];
|
2016-09-06 10:42:25 +03:00
|
|
|
struct sti_vtg *vtg[STI_MAX_MIXER];
|
2016-09-06 10:42:13 +03:00
|
|
|
struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
|
2014-07-30 21:28:27 +04:00
|
|
|
};
|
|
|
|
|
2016-09-15 18:11:07 +03:00
|
|
|
int sti_compositor_debugfs_init(struct sti_compositor *compo,
|
|
|
|
struct drm_minor *minor);
|
2016-06-21 16:09:39 +03:00
|
|
|
|
2014-07-30 21:28:27 +04:00
|
|
|
#endif
|