2 * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
3 * Author: Liviu Dudau <Liviu.Dudau@arm.com>
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * ARM Mali DP500/DP550/DP650 KMS/DRM driver structures
13 #ifndef __MALIDP_DRV_H__
14 #define __MALIDP_DRV_H__
16 #include <linux/mutex.h>
17 #include <linux/wait.h>
19 #include "malidp_hw.h"
22 struct malidp_hw_device
*dev
;
23 struct drm_fbdev_cma
*fbdev
;
26 atomic_t config_valid
;
27 struct drm_atomic_state
*pm_state
;
31 #define crtc_to_malidp_device(x) container_of(x, struct malidp_drm, crtc)
34 struct drm_plane base
;
35 struct malidp_hw_device
*hwdev
;
36 const struct malidp_layer
*layer
;
39 struct malidp_plane_state
{
40 struct drm_plane_state base
;
42 /* size of the required rotation memory if plane is rotated */
44 /* internal format ID */
49 #define to_malidp_plane(x) container_of(x, struct malidp_plane, base)
50 #define to_malidp_plane_state(x) container_of(x, struct malidp_plane_state, base)
52 struct malidp_crtc_state
{
53 struct drm_crtc_state base
;
54 u32 gamma_coeffs
[MALIDP_COEFFTAB_NUM_COEFFS
];
55 u32 coloradj_coeffs
[MALIDP_COLORADJ_NUM_COEFFS
];
56 struct malidp_se_config scaler_config
;
57 /* Bitfield of all the planes that have requested a scaled output. */
58 u8 scaled_planes_mask
;
61 #define to_malidp_crtc_state(x) container_of(x, struct malidp_crtc_state, base)
63 int malidp_de_planes_init(struct drm_device
*drm
);
64 void malidp_de_planes_destroy(struct drm_device
*drm
);
65 int malidp_crtc_init(struct drm_device
*drm
);
67 /* often used combination of rotational bits */
68 #define MALIDP_ROTATED_MASK (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270)
70 #endif /* __MALIDP_DRV_H__ */