.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2016 Marek Vasut <marex@denx.de> |
---|
3 | 4 | * |
---|
4 | 5 | * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License |
---|
8 | | - * as published by the Free Software Foundation; either version 2 |
---|
9 | | - * of the License, or (at your option) any later version. |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #ifndef __MXSFB_DRV_H__ |
---|
17 | 9 | #define __MXSFB_DRV_H__ |
---|
18 | 10 | |
---|
| 11 | +#include <drm/drm_crtc.h> |
---|
| 12 | +#include <drm/drm_device.h> |
---|
| 13 | +#include <drm/drm_encoder.h> |
---|
| 14 | +#include <drm/drm_plane.h> |
---|
| 15 | + |
---|
| 16 | +struct clk; |
---|
| 17 | + |
---|
19 | 18 | struct mxsfb_devdata { |
---|
20 | | - unsigned int transfer_count; |
---|
21 | | - unsigned int cur_buf; |
---|
22 | | - unsigned int next_buf; |
---|
23 | | - unsigned int debug0; |
---|
24 | | - unsigned int hs_wdth_mask; |
---|
25 | | - unsigned int hs_wdth_shift; |
---|
26 | | - unsigned int ipversion; |
---|
| 19 | + unsigned int transfer_count; |
---|
| 20 | + unsigned int cur_buf; |
---|
| 21 | + unsigned int next_buf; |
---|
| 22 | + unsigned int hs_wdth_mask; |
---|
| 23 | + unsigned int hs_wdth_shift; |
---|
| 24 | + bool has_overlay; |
---|
| 25 | + bool has_ctrl2; |
---|
27 | 26 | }; |
---|
28 | 27 | |
---|
29 | 28 | struct mxsfb_drm_private { |
---|
.. | .. |
---|
34 | 33 | struct clk *clk_axi; |
---|
35 | 34 | struct clk *clk_disp_axi; |
---|
36 | 35 | |
---|
37 | | - struct drm_simple_display_pipe pipe; |
---|
38 | | - struct drm_connector connector; |
---|
39 | | - struct drm_panel *panel; |
---|
40 | | - struct drm_fbdev_cma *fbdev; |
---|
| 36 | + struct drm_device *drm; |
---|
| 37 | + struct { |
---|
| 38 | + struct drm_plane primary; |
---|
| 39 | + struct drm_plane overlay; |
---|
| 40 | + } planes; |
---|
| 41 | + struct drm_crtc crtc; |
---|
| 42 | + struct drm_encoder encoder; |
---|
| 43 | + struct drm_connector *connector; |
---|
| 44 | + struct drm_bridge *bridge; |
---|
41 | 45 | }; |
---|
42 | 46 | |
---|
43 | | -int mxsfb_setup_crtc(struct drm_device *dev); |
---|
44 | | -int mxsfb_create_output(struct drm_device *dev); |
---|
| 47 | +static inline struct mxsfb_drm_private * |
---|
| 48 | +to_mxsfb_drm_private(struct drm_device *drm) |
---|
| 49 | +{ |
---|
| 50 | + return drm->dev_private; |
---|
| 51 | +} |
---|
45 | 52 | |
---|
46 | 53 | void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb); |
---|
47 | 54 | void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb); |
---|
48 | 55 | |
---|
49 | | -void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb); |
---|
50 | | -void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb); |
---|
51 | | -void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, |
---|
52 | | - struct drm_plane_state *state); |
---|
| 56 | +int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb); |
---|
53 | 57 | |
---|
54 | 58 | #endif /* __MXSFB_DRV_H__ */ |
---|