Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / gpu / drm / tegra / plane.h
blob6938719e7e5dd876d0b2e92df47f77dc14d5ec0e
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_PLANE_H
10 #define TEGRA_PLANE_H 1
12 #include <drm/drm_plane.h>
14 struct tegra_bo;
15 struct tegra_dc;
17 struct tegra_plane {
18 struct drm_plane base;
19 struct tegra_dc *dc;
20 unsigned int offset;
21 unsigned int index;
24 struct tegra_cursor {
25 struct tegra_plane base;
27 struct tegra_bo *bo;
28 unsigned int width;
29 unsigned int height;
32 static inline struct tegra_plane *to_tegra_plane(struct drm_plane *plane)
34 return container_of(plane, struct tegra_plane, base);
37 struct tegra_plane_state {
38 struct drm_plane_state base;
40 struct tegra_bo_tiling tiling;
41 u32 format;
42 u32 swap;
44 /* used for legacy blending support only */
45 bool opaque;
46 bool dependent[3];
49 static inline struct tegra_plane_state *
50 to_tegra_plane_state(struct drm_plane_state *state)
52 if (state)
53 return container_of(state, struct tegra_plane_state, base);
55 return NULL;
58 extern const struct drm_plane_funcs tegra_plane_funcs;
60 int tegra_plane_state_add(struct tegra_plane *plane,
61 struct drm_plane_state *state);
63 int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
64 bool tegra_plane_format_is_yuv(unsigned int format, bool *planar);
65 bool tegra_plane_format_has_alpha(unsigned int format);
66 int tegra_plane_format_get_alpha(unsigned int opaque, unsigned int *alpha);
67 void tegra_plane_check_dependent(struct tegra_plane *tegra,
68 struct tegra_plane_state *state);
70 #endif /* TEGRA_PLANE_H */