hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/gpu/drm/mxsfb/mxsfb_drv.h
....@@ -1,29 +1,28 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2016 Marek Vasut <marex@denx.de>
34 *
45 * 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.
146 */
157
168 #ifndef __MXSFB_DRV_H__
179 #define __MXSFB_DRV_H__
1810
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
+
1918 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;
2726 };
2827
2928 struct mxsfb_drm_private {
....@@ -34,21 +33,26 @@
3433 struct clk *clk_axi;
3534 struct clk *clk_disp_axi;
3635
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;
4145 };
4246
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
+}
4552
4653 void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
4754 void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
4855
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);
5357
5458 #endif /* __MXSFB_DRV_H__ */