2016-03-07 10:00:53 +00:00
|
|
|
/*
|
|
|
|
* (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
|
|
|
|
* Author: Liviu Dudau <Liviu.Dudau@arm.com>
|
|
|
|
*
|
|
|
|
* This program is free software and is provided to you under the terms of the
|
|
|
|
* GNU General Public License version 2 as published by the Free Software
|
|
|
|
* Foundation, and any use by you of this program is subject to the terms
|
|
|
|
* of such GNU licence.
|
|
|
|
*
|
|
|
|
* ARM Mali DP500/DP550/DP650 KMS/DRM driver structures
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MALIDP_DRV_H__
|
|
|
|
#define __MALIDP_DRV_H__
|
|
|
|
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
#include <linux/wait.h>
|
2016-10-06 17:01:39 +00:00
|
|
|
#include <drm/drmP.h>
|
2016-03-07 10:00:53 +00:00
|
|
|
#include "malidp_hw.h"
|
|
|
|
|
|
|
|
struct malidp_drm {
|
|
|
|
struct malidp_hw_device *dev;
|
|
|
|
struct drm_fbdev_cma *fbdev;
|
|
|
|
struct drm_crtc crtc;
|
|
|
|
wait_queue_head_t wq;
|
|
|
|
atomic_t config_valid;
|
2017-03-22 10:44:57 +00:00
|
|
|
struct drm_atomic_state *pm_state;
|
2016-03-07 10:00:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define crtc_to_malidp_device(x) container_of(x, struct malidp_drm, crtc)
|
|
|
|
|
|
|
|
struct malidp_plane {
|
|
|
|
struct drm_plane base;
|
|
|
|
struct malidp_hw_device *hwdev;
|
|
|
|
const struct malidp_layer *layer;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct malidp_plane_state {
|
|
|
|
struct drm_plane_state base;
|
|
|
|
|
|
|
|
/* size of the required rotation memory if plane is rotated */
|
|
|
|
u32 rotmem_size;
|
2016-10-11 14:26:09 +00:00
|
|
|
/* internal format ID */
|
|
|
|
u8 format;
|
|
|
|
u8 n_planes;
|
2016-03-07 10:00:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define to_malidp_plane(x) container_of(x, struct malidp_plane, base)
|
|
|
|
#define to_malidp_plane_state(x) container_of(x, struct malidp_plane_state, base)
|
|
|
|
|
2017-02-01 14:48:49 +00:00
|
|
|
struct malidp_crtc_state {
|
|
|
|
struct drm_crtc_state base;
|
2017-02-01 14:48:50 +00:00
|
|
|
u32 gamma_coeffs[MALIDP_COEFFTAB_NUM_COEFFS];
|
2017-02-13 12:49:03 +00:00
|
|
|
u32 coloradj_coeffs[MALIDP_COLORADJ_NUM_COEFFS];
|
2017-02-01 14:48:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define to_malidp_crtc_state(x) container_of(x, struct malidp_crtc_state, base)
|
|
|
|
|
2016-03-07 10:00:53 +00:00
|
|
|
int malidp_de_planes_init(struct drm_device *drm);
|
|
|
|
void malidp_de_planes_destroy(struct drm_device *drm);
|
|
|
|
int malidp_crtc_init(struct drm_device *drm);
|
|
|
|
|
|
|
|
/* often used combination of rotational bits */
|
2016-07-29 05:50:05 +00:00
|
|
|
#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)
|
2016-03-07 10:00:53 +00:00
|
|
|
|
|
|
|
#endif /* __MALIDP_DRV_H__ */
|