1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
7 #define TEGRA_PLANE_H 1
9 #include <drm/drm_plane.h>
15 struct drm_plane base;
22 struct tegra_plane base;
29 static inline struct tegra_plane *to_tegra_plane(struct drm_plane *plane)
31 return container_of(plane, struct tegra_plane, base);
34 struct tegra_plane_legacy_blending_state {
39 struct tegra_plane_state {
40 struct drm_plane_state base;
42 struct sg_table *sgt[3];
45 struct tegra_bo_tiling tiling;
51 /* used for legacy blending support only */
52 struct tegra_plane_legacy_blending_state blending[2];
56 static inline struct tegra_plane_state *
57 to_tegra_plane_state(struct drm_plane_state *state)
60 return container_of(state, struct tegra_plane_state, base);
65 extern const struct drm_plane_funcs tegra_plane_funcs;
67 int tegra_plane_prepare_fb(struct drm_plane *plane,
68 struct drm_plane_state *state);
69 void tegra_plane_cleanup_fb(struct drm_plane *plane,
70 struct drm_plane_state *state);
72 int tegra_plane_state_add(struct tegra_plane *plane,
73 struct drm_plane_state *state);
75 int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
76 bool tegra_plane_format_is_yuv(unsigned int format, bool *planar);
77 int tegra_plane_setup_legacy_state(struct tegra_plane *tegra,
78 struct tegra_plane_state *state);
80 #endif /* TEGRA_PLANE_H */