blob: 9fc8a2e405e4e7679efedd57b2ef39ddef1841ac [file] [log] [blame]
Liviu Dudauad49f862016-03-07 10:00:53 +00001/*
2 * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
3 * Author: Liviu Dudau <Liviu.Dudau@arm.com>
4 *
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
8 * of such GNU licence.
9 *
10 * ARM Mali DP500/DP550/DP650 KMS/DRM driver structures
11 */
12
13#ifndef __MALIDP_DRV_H__
14#define __MALIDP_DRV_H__
15
16#include <linux/mutex.h>
17#include <linux/wait.h>
18#include "malidp_hw.h"
19
20struct malidp_drm {
21 struct malidp_hw_device *dev;
22 struct drm_fbdev_cma *fbdev;
23 struct list_head event_list;
24 struct drm_crtc crtc;
25 wait_queue_head_t wq;
26 atomic_t config_valid;
27};
28
29#define crtc_to_malidp_device(x) container_of(x, struct malidp_drm, crtc)
30
31struct malidp_plane {
32 struct drm_plane base;
33 struct malidp_hw_device *hwdev;
34 const struct malidp_layer *layer;
35};
36
37struct malidp_plane_state {
38 struct drm_plane_state base;
39
40 /* size of the required rotation memory if plane is rotated */
41 u32 rotmem_size;
Brian Starkey70c94a32016-10-11 15:26:09 +010042 /* internal format ID */
43 u8 format;
44 u8 n_planes;
Liviu Dudauad49f862016-03-07 10:00:53 +000045};
46
47#define to_malidp_plane(x) container_of(x, struct malidp_plane, base)
48#define to_malidp_plane_state(x) container_of(x, struct malidp_plane_state, base)
49
50int malidp_de_planes_init(struct drm_device *drm);
51void malidp_de_planes_destroy(struct drm_device *drm);
52int malidp_crtc_init(struct drm_device *drm);
53
54/* often used combination of rotational bits */
Joonas Lahtinen31ad61e2016-07-29 08:50:05 +030055#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)
Liviu Dudauad49f862016-03-07 10:00:53 +000056
57#endif /* __MALIDP_DRV_H__ */