bpf: Prevent memory disambiguation attack
[linux/fpc-iii.git] / drivers / gpu / drm / tegra / hub.h
blob890a47cd05c310aa507d2a95a363dfaec73471da
1 /*
2 * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
9 #ifndef TEGRA_HUB_H
10 #define TEGRA_HUB_H 1
12 #include <drm/drmP.h>
13 #include <drm/drm_plane.h>
15 #include "plane.h"
17 struct tegra_dc;
19 struct tegra_windowgroup {
20 unsigned int usecount;
21 struct mutex lock;
23 unsigned int index;
24 struct device *parent;
25 struct reset_control *rst;
28 struct tegra_shared_plane {
29 struct tegra_plane base;
30 struct tegra_windowgroup *wgrp;
33 static inline struct tegra_shared_plane *
34 to_tegra_shared_plane(struct drm_plane *plane)
36 return container_of(plane, struct tegra_shared_plane, base.base);
39 struct tegra_display_hub_soc {
40 unsigned int num_wgrps;
43 struct tegra_display_hub {
44 struct host1x_client client;
45 struct clk *clk_disp;
46 struct clk *clk_dsc;
47 struct clk *clk_hub;
48 struct reset_control *rst;
50 const struct tegra_display_hub_soc *soc;
51 struct tegra_windowgroup *wgrps;
54 static inline struct tegra_display_hub *
55 to_tegra_display_hub(struct host1x_client *client)
57 return container_of(client, struct tegra_display_hub, client);
60 struct tegra_dc;
61 struct tegra_plane;
63 int tegra_display_hub_prepare(struct tegra_display_hub *hub);
64 void tegra_display_hub_cleanup(struct tegra_display_hub *hub);
66 struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
67 struct tegra_dc *dc,
68 unsigned int wgrp,
69 unsigned int index);
71 void tegra_display_hub_atomic_commit(struct drm_device *drm,
72 struct drm_atomic_state *state);
74 #define DC_CMD_IHUB_COMMON_MISC_CTL 0x068
75 #define LATENCY_EVENT (1 << 3)
77 #define DC_DISP_IHUB_COMMON_DISPLAY_FETCH_METER 0x451
78 #define CURS_SLOTS(x) (((x) & 0xff) << 8)
79 #define WGRP_SLOTS(x) (((x) & 0xff) << 0)
81 #endif /* TEGRA_HUB_H */