forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/gpu/drm/tegra/drm.h
....@@ -1,27 +1,24 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2012 Avionic Design GmbH
34 * Copyright (C) 2012-2013 NVIDIA CORPORATION. All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 */
96
107 #ifndef HOST1X_DRM_H
118 #define HOST1X_DRM_H 1
129
13
-#include <uapi/drm/tegra_drm.h>
1410 #include <linux/host1x.h>
1511 #include <linux/iova.h>
16
-#include <linux/of_gpio.h>
12
+#include <linux/gpio/consumer.h>
1713
18
-#include <drm/drmP.h>
1914 #include <drm/drm_atomic.h>
20
-#include <drm/drm_crtc_helper.h>
15
+#include <drm/drm_bridge.h>
2116 #include <drm/drm_edid.h>
2217 #include <drm/drm_encoder.h>
2318 #include <drm/drm_fb_helper.h>
2419 #include <drm/drm_fixed.h>
20
+#include <drm/drm_probe_helper.h>
21
+#include <uapi/drm/tegra_drm.h>
2522
2623 #include "gem.h"
2724 #include "hub.h"
....@@ -40,7 +37,7 @@
4037 struct drm_device *drm;
4138
4239 struct iommu_domain *domain;
43
- struct iommu_group *group;
40
+ bool use_explicit_iommu;
4441 struct mutex mm_lock;
4542 struct drm_mm mm;
4643
....@@ -60,8 +57,6 @@
6057 unsigned int pitch_align;
6158
6259 struct tegra_display_hub *hub;
63
-
64
- struct drm_atomic_state *state;
6560 };
6661
6762 struct tegra_drm_client;
....@@ -90,6 +85,7 @@
9085 struct tegra_drm_client {
9186 struct host1x_client base;
9287 struct list_head list;
88
+ struct tegra_drm *drm;
9389
9490 unsigned int version;
9591 const struct tegra_drm_client_ops *ops;
....@@ -105,10 +101,8 @@
105101 struct tegra_drm_client *client);
106102 int tegra_drm_unregister_client(struct tegra_drm *tegra,
107103 struct tegra_drm_client *client);
108
-struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client,
109
- bool shared);
110
-void host1x_client_iommu_detach(struct host1x_client *client,
111
- struct iommu_group *group);
104
+int host1x_client_iommu_attach(struct host1x_client *client);
105
+void host1x_client_iommu_detach(struct host1x_client *client);
112106
113107 int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm);
114108 int tegra_drm_exit(struct tegra_drm *tegra);
....@@ -123,13 +117,13 @@
123117 struct device_node *of_node;
124118 struct device *dev;
125119
120
+ struct drm_bridge *bridge;
126121 struct drm_panel *panel;
127122 struct i2c_adapter *ddc;
128123 const struct edid *edid;
129
- struct cec_notifier *notifier;
124
+ struct cec_notifier *cec;
130125 unsigned int hpd_irq;
131
- int hpd_gpio;
132
- enum of_gpio_flags hpd_gpio_flags;
126
+ struct gpio_desc *hpd_gpio;
133127
134128 struct drm_encoder encoder;
135129 struct drm_connector connector;
....@@ -152,26 +146,21 @@
152146 void tegra_output_exit(struct tegra_output *output);
153147 void tegra_output_find_possible_crtcs(struct tegra_output *output,
154148 struct drm_device *drm);
149
+int tegra_output_suspend(struct tegra_output *output);
150
+int tegra_output_resume(struct tegra_output *output);
155151
156152 int tegra_output_connector_get_modes(struct drm_connector *connector);
157153 enum drm_connector_status
158154 tegra_output_connector_detect(struct drm_connector *connector, bool force);
159155 void tegra_output_connector_destroy(struct drm_connector *connector);
160156
161
-void tegra_output_encoder_destroy(struct drm_encoder *encoder);
162
-
163157 /* from dpaux.c */
164
-struct drm_dp_link;
165
-
166158 struct drm_dp_aux *drm_dp_aux_find_by_of_node(struct device_node *np);
167159 enum drm_connector_status drm_dp_aux_detect(struct drm_dp_aux *aux);
168160 int drm_dp_aux_attach(struct drm_dp_aux *aux, struct tegra_output *output);
169161 int drm_dp_aux_detach(struct drm_dp_aux *aux);
170162 int drm_dp_aux_enable(struct drm_dp_aux *aux);
171163 int drm_dp_aux_disable(struct drm_dp_aux *aux);
172
-int drm_dp_aux_prepare(struct drm_dp_aux *aux, u8 encoding);
173
-int drm_dp_aux_train(struct drm_dp_aux *aux, struct drm_dp_link *link,
174
- u8 pattern);
175164
176165 /* from fb.c */
177166 struct tegra_bo *tegra_fb_get_plane(struct drm_framebuffer *framebuffer,
....@@ -186,8 +175,6 @@
186175 void tegra_drm_fb_free(struct drm_device *drm);
187176 int tegra_drm_fb_init(struct drm_device *drm);
188177 void tegra_drm_fb_exit(struct drm_device *drm);
189
-void tegra_drm_fb_suspend(struct drm_device *drm);
190
-void tegra_drm_fb_resume(struct drm_device *drm);
191178
192179 extern struct platform_driver tegra_display_hub_driver;
193180 extern struct platform_driver tegra_dc_driver;