1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2015 MediaTek Inc.
10 #include <drm/drm_crtc.h>
11 #include <linux/types.h>
13 #define AFBC_DATA_BLOCK_WIDTH 32
14 #define AFBC_DATA_BLOCK_HEIGHT 8
15 #define AFBC_HEADER_BLOCK_SIZE 16
16 #define AFBC_HEADER_ALIGNMENT 1024
18 struct mtk_plane_pending_state {
24 unsigned int hdr_pitch;
26 unsigned long long modifier;
31 unsigned int rotation;
35 enum drm_color_encoding color_encoding;
38 struct mtk_plane_state {
39 struct drm_plane_state base;
40 struct mtk_plane_pending_state pending;
43 static inline struct mtk_plane_state *
44 to_mtk_plane_state(struct drm_plane_state *state)
46 return container_of(state, struct mtk_plane_state, base);
49 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
50 unsigned long possible_crtcs, enum drm_plane_type type,
51 unsigned int supported_rotations, const u32 *formats,