| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2012 Avionic Design GmbH |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #ifndef HOST1X_DRM_H |
|---|
| 11 | 8 | #define HOST1X_DRM_H 1 |
|---|
| 12 | 9 | |
|---|
| 13 | | -#include <uapi/drm/tegra_drm.h> |
|---|
| 14 | 10 | #include <linux/host1x.h> |
|---|
| 15 | 11 | #include <linux/iova.h> |
|---|
| 16 | | -#include <linux/of_gpio.h> |
|---|
| 12 | +#include <linux/gpio/consumer.h> |
|---|
| 17 | 13 | |
|---|
| 18 | | -#include <drm/drmP.h> |
|---|
| 19 | 14 | #include <drm/drm_atomic.h> |
|---|
| 20 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 15 | +#include <drm/drm_bridge.h> |
|---|
| 21 | 16 | #include <drm/drm_edid.h> |
|---|
| 22 | 17 | #include <drm/drm_encoder.h> |
|---|
| 23 | 18 | #include <drm/drm_fb_helper.h> |
|---|
| 24 | 19 | #include <drm/drm_fixed.h> |
|---|
| 20 | +#include <drm/drm_probe_helper.h> |
|---|
| 21 | +#include <uapi/drm/tegra_drm.h> |
|---|
| 25 | 22 | |
|---|
| 26 | 23 | #include "gem.h" |
|---|
| 27 | 24 | #include "hub.h" |
|---|
| .. | .. |
|---|
| 40 | 37 | struct drm_device *drm; |
|---|
| 41 | 38 | |
|---|
| 42 | 39 | struct iommu_domain *domain; |
|---|
| 43 | | - struct iommu_group *group; |
|---|
| 40 | + bool use_explicit_iommu; |
|---|
| 44 | 41 | struct mutex mm_lock; |
|---|
| 45 | 42 | struct drm_mm mm; |
|---|
| 46 | 43 | |
|---|
| .. | .. |
|---|
| 60 | 57 | unsigned int pitch_align; |
|---|
| 61 | 58 | |
|---|
| 62 | 59 | struct tegra_display_hub *hub; |
|---|
| 63 | | - |
|---|
| 64 | | - struct drm_atomic_state *state; |
|---|
| 65 | 60 | }; |
|---|
| 66 | 61 | |
|---|
| 67 | 62 | struct tegra_drm_client; |
|---|
| .. | .. |
|---|
| 90 | 85 | struct tegra_drm_client { |
|---|
| 91 | 86 | struct host1x_client base; |
|---|
| 92 | 87 | struct list_head list; |
|---|
| 88 | + struct tegra_drm *drm; |
|---|
| 93 | 89 | |
|---|
| 94 | 90 | unsigned int version; |
|---|
| 95 | 91 | const struct tegra_drm_client_ops *ops; |
|---|
| .. | .. |
|---|
| 105 | 101 | struct tegra_drm_client *client); |
|---|
| 106 | 102 | int tegra_drm_unregister_client(struct tegra_drm *tegra, |
|---|
| 107 | 103 | 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); |
|---|
| 112 | 106 | |
|---|
| 113 | 107 | int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm); |
|---|
| 114 | 108 | int tegra_drm_exit(struct tegra_drm *tegra); |
|---|
| .. | .. |
|---|
| 123 | 117 | struct device_node *of_node; |
|---|
| 124 | 118 | struct device *dev; |
|---|
| 125 | 119 | |
|---|
| 120 | + struct drm_bridge *bridge; |
|---|
| 126 | 121 | struct drm_panel *panel; |
|---|
| 127 | 122 | struct i2c_adapter *ddc; |
|---|
| 128 | 123 | const struct edid *edid; |
|---|
| 129 | | - struct cec_notifier *notifier; |
|---|
| 124 | + struct cec_notifier *cec; |
|---|
| 130 | 125 | unsigned int hpd_irq; |
|---|
| 131 | | - int hpd_gpio; |
|---|
| 132 | | - enum of_gpio_flags hpd_gpio_flags; |
|---|
| 126 | + struct gpio_desc *hpd_gpio; |
|---|
| 133 | 127 | |
|---|
| 134 | 128 | struct drm_encoder encoder; |
|---|
| 135 | 129 | struct drm_connector connector; |
|---|
| .. | .. |
|---|
| 152 | 146 | void tegra_output_exit(struct tegra_output *output); |
|---|
| 153 | 147 | void tegra_output_find_possible_crtcs(struct tegra_output *output, |
|---|
| 154 | 148 | struct drm_device *drm); |
|---|
| 149 | +int tegra_output_suspend(struct tegra_output *output); |
|---|
| 150 | +int tegra_output_resume(struct tegra_output *output); |
|---|
| 155 | 151 | |
|---|
| 156 | 152 | int tegra_output_connector_get_modes(struct drm_connector *connector); |
|---|
| 157 | 153 | enum drm_connector_status |
|---|
| 158 | 154 | tegra_output_connector_detect(struct drm_connector *connector, bool force); |
|---|
| 159 | 155 | void tegra_output_connector_destroy(struct drm_connector *connector); |
|---|
| 160 | 156 | |
|---|
| 161 | | -void tegra_output_encoder_destroy(struct drm_encoder *encoder); |
|---|
| 162 | | - |
|---|
| 163 | 157 | /* from dpaux.c */ |
|---|
| 164 | | -struct drm_dp_link; |
|---|
| 165 | | - |
|---|
| 166 | 158 | struct drm_dp_aux *drm_dp_aux_find_by_of_node(struct device_node *np); |
|---|
| 167 | 159 | enum drm_connector_status drm_dp_aux_detect(struct drm_dp_aux *aux); |
|---|
| 168 | 160 | int drm_dp_aux_attach(struct drm_dp_aux *aux, struct tegra_output *output); |
|---|
| 169 | 161 | int drm_dp_aux_detach(struct drm_dp_aux *aux); |
|---|
| 170 | 162 | int drm_dp_aux_enable(struct drm_dp_aux *aux); |
|---|
| 171 | 163 | 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); |
|---|
| 175 | 164 | |
|---|
| 176 | 165 | /* from fb.c */ |
|---|
| 177 | 166 | struct tegra_bo *tegra_fb_get_plane(struct drm_framebuffer *framebuffer, |
|---|
| .. | .. |
|---|
| 186 | 175 | void tegra_drm_fb_free(struct drm_device *drm); |
|---|
| 187 | 176 | int tegra_drm_fb_init(struct drm_device *drm); |
|---|
| 188 | 177 | 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); |
|---|
| 191 | 178 | |
|---|
| 192 | 179 | extern struct platform_driver tegra_display_hub_driver; |
|---|
| 193 | 180 | extern struct platform_driver tegra_dc_driver; |
|---|