2017-12-06 19:29:46 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-04-14 18:13:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) STMicroelectronics SA 2017
|
|
|
|
*
|
|
|
|
* Authors: Philippe Cornu <philippe.cornu@st.com>
|
|
|
|
* Yannick Fertre <yannick.fertre@st.com>
|
|
|
|
* Fabien Dessenne <fabien.dessenne@st.com>
|
|
|
|
* Mickael Reulier <mickael.reulier@st.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LTDC_H_
|
|
|
|
#define _LTDC_H_
|
|
|
|
|
|
|
|
struct ltdc_caps {
|
|
|
|
u32 hw_version; /* hardware version */
|
|
|
|
u32 nb_layers; /* number of supported layers */
|
|
|
|
u32 reg_ofs; /* register offset for applicable regs */
|
|
|
|
u32 bus_width; /* bus width (32 or 64 bits) */
|
|
|
|
const u32 *pix_fmt_hw; /* supported pixel formats */
|
2018-02-01 18:42:43 +08:00
|
|
|
bool non_alpha_only_l1; /* non-native no-alpha formats on layer 1 */
|
2018-06-29 19:22:22 +08:00
|
|
|
int pad_max_freq_hz; /* max frequency supported by pad */
|
2017-04-14 18:13:34 +08:00
|
|
|
};
|
|
|
|
|
2018-04-08 05:35:03 +08:00
|
|
|
#define LTDC_MAX_LAYER 4
|
|
|
|
|
|
|
|
struct fps_info {
|
|
|
|
unsigned int counter;
|
|
|
|
ktime_t last_timestamp;
|
|
|
|
};
|
|
|
|
|
2017-04-14 18:13:34 +08:00
|
|
|
struct ltdc_device {
|
|
|
|
void __iomem *regs;
|
|
|
|
struct clk *pixel_clk; /* lcd pixel clock */
|
|
|
|
struct mutex err_lock; /* protecting error_status */
|
|
|
|
struct ltdc_caps caps;
|
|
|
|
u32 error_status;
|
|
|
|
u32 irq_status;
|
2018-04-08 05:35:03 +08:00
|
|
|
struct fps_info plane_fpsi[LTDC_MAX_LAYER];
|
2019-03-21 16:15:20 +08:00
|
|
|
struct drm_atomic_state *suspend_state;
|
2017-04-14 18:13:34 +08:00
|
|
|
};
|
|
|
|
|
2018-06-29 21:01:40 +08:00
|
|
|
bool ltdc_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
|
|
|
|
bool in_vblank_irq, int *vpos, int *hpos,
|
|
|
|
ktime_t *stime, ktime_t *etime,
|
|
|
|
const struct drm_display_mode *mode);
|
|
|
|
|
2017-04-14 18:13:34 +08:00
|
|
|
int ltdc_load(struct drm_device *ddev);
|
|
|
|
void ltdc_unload(struct drm_device *ddev);
|
2019-03-21 16:15:20 +08:00
|
|
|
void ltdc_suspend(struct drm_device *ddev);
|
|
|
|
int ltdc_resume(struct drm_device *ddev);
|
2017-04-14 18:13:34 +08:00
|
|
|
|
|
|
|
#endif
|