plane.h (ca31fef11dc83e672415d5925a134749761329bd) plane.h (04d5d5df9df79f9045e76404775fc8a084aac23d)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
4 */
5
6#ifndef TEGRA_PLANE_H
7#define TEGRA_PLANE_H 1
8
9#include <drm/drm_plane.h>
10
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
4 */
5
6#ifndef TEGRA_PLANE_H
7#define TEGRA_PLANE_H 1
8
9#include <drm/drm_plane.h>
10
11struct icc_path;
11struct tegra_bo;
12struct tegra_dc;
13
14struct tegra_plane {
15 struct drm_plane base;
16 struct tegra_dc *dc;
17 unsigned int offset;
18 unsigned int index;
12struct tegra_bo;
13struct tegra_dc;
14
15struct tegra_plane {
16 struct drm_plane base;
17 struct tegra_dc *dc;
18 unsigned int offset;
19 unsigned int index;
20
21 struct icc_path *icc_mem;
22 struct icc_path *icc_mem_vfilter;
19};
20
21struct tegra_cursor {
22 struct tegra_plane base;
23
24 struct tegra_bo *bo;
25 unsigned int width;
26 unsigned int height;

--- 20 unchanged lines hidden (view full) ---

47 u32 swap;
48
49 bool reflect_x;
50 bool reflect_y;
51
52 /* used for legacy blending support only */
53 struct tegra_plane_legacy_blending_state blending[2];
54 bool opaque;
23};
24
25struct tegra_cursor {
26 struct tegra_plane base;
27
28 struct tegra_bo *bo;
29 unsigned int width;
30 unsigned int height;

--- 20 unchanged lines hidden (view full) ---

51 u32 swap;
52
53 bool reflect_x;
54 bool reflect_y;
55
56 /* used for legacy blending support only */
57 struct tegra_plane_legacy_blending_state blending[2];
58 bool opaque;
59
60 /* bandwidths are in ICC units, i.e. kbytes/sec */
61 u32 total_peak_memory_bandwidth;
62 u32 peak_memory_bandwidth;
63 u32 avg_memory_bandwidth;
55};
56
57static inline struct tegra_plane_state *
58to_tegra_plane_state(struct drm_plane_state *state)
59{
60 if (state)
61 return container_of(state, struct tegra_plane_state, base);
62
63 return NULL;
64}
65
64};
65
66static inline struct tegra_plane_state *
67to_tegra_plane_state(struct drm_plane_state *state)
68{
69 if (state)
70 return container_of(state, struct tegra_plane_state, base);
71
72 return NULL;
73}
74
75static inline const struct tegra_plane_state *
76to_const_tegra_plane_state(const struct drm_plane_state *state)
77{
78 return to_tegra_plane_state((struct drm_plane_state *)state);
79}
80
66extern const struct drm_plane_funcs tegra_plane_funcs;
67
68int tegra_plane_prepare_fb(struct drm_plane *plane,
69 struct drm_plane_state *state);
70void tegra_plane_cleanup_fb(struct drm_plane *plane,
71 struct drm_plane_state *state);
72
73int tegra_plane_state_add(struct tegra_plane *plane,
74 struct drm_plane_state *state);
75
76int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
77bool tegra_plane_format_is_indexed(unsigned int format);
78bool tegra_plane_format_is_yuv(unsigned int format, bool *planar, unsigned int *bpc);
79int tegra_plane_setup_legacy_state(struct tegra_plane *tegra,
80 struct tegra_plane_state *state);
81extern const struct drm_plane_funcs tegra_plane_funcs;
82
83int tegra_plane_prepare_fb(struct drm_plane *plane,
84 struct drm_plane_state *state);
85void tegra_plane_cleanup_fb(struct drm_plane *plane,
86 struct drm_plane_state *state);
87
88int tegra_plane_state_add(struct tegra_plane *plane,
89 struct drm_plane_state *state);
90
91int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
92bool tegra_plane_format_is_indexed(unsigned int format);
93bool tegra_plane_format_is_yuv(unsigned int format, bool *planar, unsigned int *bpc);
94int tegra_plane_setup_legacy_state(struct tegra_plane *tegra,
95 struct tegra_plane_state *state);
96int tegra_plane_interconnect_init(struct tegra_plane *plane);
81
82#endif /* TEGRA_PLANE_H */
97
98#endif /* TEGRA_PLANE_H */