1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
10 #include <drm/drm_plane.h>
16 struct tegra_windowgroup {
17 unsigned int usecount;
21 struct device *parent;
22 struct reset_control *rst;
25 struct tegra_shared_plane {
26 struct tegra_plane base;
27 struct tegra_windowgroup *wgrp;
30 static inline struct tegra_shared_plane *
31 to_tegra_shared_plane(struct drm_plane *plane)
33 return container_of(plane, struct tegra_shared_plane, base.base);
36 struct tegra_display_hub_soc {
37 unsigned int num_wgrps;
41 struct tegra_display_hub {
42 struct drm_private_obj base;
43 struct host1x_client client;
47 struct reset_control *rst;
49 unsigned int num_heads;
50 struct clk **clk_heads;
52 const struct tegra_display_hub_soc *soc;
53 struct tegra_windowgroup *wgrps;
56 static inline struct tegra_display_hub *
57 to_tegra_display_hub(struct host1x_client *client)
59 return container_of(client, struct tegra_display_hub, client);
62 struct tegra_display_hub_state {
63 struct drm_private_state base;
70 static inline struct tegra_display_hub_state *
71 to_tegra_display_hub_state(struct drm_private_state *priv)
73 return container_of(priv, struct tegra_display_hub_state, base);
79 int tegra_display_hub_prepare(struct tegra_display_hub *hub);
80 void tegra_display_hub_cleanup(struct tegra_display_hub *hub);
82 struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
87 int tegra_display_hub_atomic_check(struct drm_device *drm,
88 struct drm_atomic_state *state);
89 void tegra_display_hub_atomic_commit(struct drm_device *drm,
90 struct drm_atomic_state *state);
92 #define DC_CMD_IHUB_COMMON_MISC_CTL 0x068
93 #define LATENCY_EVENT (1 << 3)
95 #define DC_DISP_IHUB_COMMON_DISPLAY_FETCH_METER 0x451
96 #define CURS_SLOTS(x) (((x) & 0xff) << 8)
97 #define WGRP_SLOTS(x) (((x) & 0xff) << 0)
99 #endif /* TEGRA_HUB_H */