summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/plane.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-11-10 15:27:25 +0100
committerThierry Reding <treding@nvidia.com>2017-12-13 13:42:22 +0100
commit5acd351427361131c583dfb11c7bf4c364c98a9b (patch)
tree05dd7bd7abcab6a2485ef488656eb4ee54a0ab0a /drivers/gpu/drm/tegra/plane.h
parentb1415ff21d43e264b32c18faf1c7ae7e53bc235e (diff)
downloadlinux-stable-5acd351427361131c583dfb11c7bf4c364c98a9b.tar.gz
linux-stable-5acd351427361131c583dfb11c7bf4c364c98a9b.tar.bz2
linux-stable-5acd351427361131c583dfb11c7bf4c364c98a9b.zip
drm/tegra: Move common plane code to separate file
Subsequent patches will add support for Tegra186 which has a different architecture and needs different plane code but which can share a lot of code with earlier Tegra support. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/plane.h')
-rw-r--r--drivers/gpu/drm/tegra/plane.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/plane.h b/drivers/gpu/drm/tegra/plane.h
new file mode 100644
index 000000000000..8237b885acd7
--- /dev/null
+++ b/drivers/gpu/drm/tegra/plane.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef TEGRA_PLANE_H
+#define TEGRA_PLANE_H 1
+
+#include <drm/drm_plane.h>
+
+struct tegra_bo;
+
+struct tegra_plane {
+ struct drm_plane base;
+ unsigned int index;
+};
+
+struct tegra_cursor {
+ struct tegra_plane base;
+
+ struct tegra_bo *bo;
+ unsigned int width;
+ unsigned int height;
+};
+
+static inline struct tegra_plane *to_tegra_plane(struct drm_plane *plane)
+{
+ return container_of(plane, struct tegra_plane, base);
+}
+
+struct tegra_plane_state {
+ struct drm_plane_state base;
+
+ struct tegra_bo_tiling tiling;
+ u32 format;
+ u32 swap;
+};
+
+static inline struct tegra_plane_state *
+to_tegra_plane_state(struct drm_plane_state *state)
+{
+ if (state)
+ return container_of(state, struct tegra_plane_state, base);
+
+ return NULL;
+}
+
+extern const struct drm_plane_funcs tegra_plane_funcs;
+
+int tegra_plane_state_add(struct tegra_plane *plane,
+ struct drm_plane_state *state);
+
+int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap);
+bool tegra_plane_format_is_yuv(unsigned int format, bool *planar);
+
+#endif /* TEGRA_PLANE_H */