rockchip_drm_drv.h 1.9 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0-only */
M
Mark Yao 已提交
2 3 4 5 6 7 8 9 10 11 12
/*
 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
 * Author:Mark Yao <mark.yao@rock-chips.com>
 *
 * based on exynos_drm_drv.h
 */

#ifndef _ROCKCHIP_DRM_DRV_H
#define _ROCKCHIP_DRM_DRV_H

#include <drm/drm_fb_helper.h>
13
#include <drm/drm_atomic_helper.h>
M
Mark Yao 已提交
14 15 16 17 18 19 20 21 22 23 24
#include <drm/drm_gem.h>

#include <linux/module.h>
#include <linux/component.h>

#define ROCKCHIP_MAX_FB_BUFFER	3
#define ROCKCHIP_MAX_CONNECTOR	2
#define ROCKCHIP_MAX_CRTC	2

struct drm_device;
struct drm_connector;
25
struct iommu_domain;
M
Mark Yao 已提交
26

27 28 29 30
struct rockchip_crtc_state {
	struct drm_crtc_state base;
	int output_type;
	int output_mode;
31
	int output_bpc;
32
	int output_flags;
33
	bool enable_afbc;
34 35 36 37
};
#define to_rockchip_crtc_state(s) \
		container_of(s, struct rockchip_crtc_state, base)

M
Mark Yao 已提交
38 39 40 41 42
/*
 * Rockchip drm private structure.
 *
 * @crtc: array of enabled CRTCs, used to map from "pipe" to drm_crtc.
 * @num_pipe: number of pipes for this device.
43
 * @mm_lock: protect drm_mm on multi-threads.
M
Mark Yao 已提交
44 45 46 47
 */
struct rockchip_drm_private {
	struct drm_fb_helper fbdev_helper;
	struct drm_gem_object *fbdev_bo;
48 49 50
	struct iommu_domain *domain;
	struct mutex mm_lock;
	struct drm_mm mm;
M
Mark Yao 已提交
51 52 53 54 55 56
};

int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
				   struct device *dev);
void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
				    struct device *dev);
57
int rockchip_drm_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout);
58

59
int rockchip_drm_endpoint_is_subdriver(struct device_node *ep);
60 61
extern struct platform_driver cdn_dp_driver;
extern struct platform_driver dw_hdmi_rockchip_pltfm_driver;
62
extern struct platform_driver dw_mipi_dsi_rockchip_driver;
63 64
extern struct platform_driver inno_hdmi_driver;
extern struct platform_driver rockchip_dp_driver;
65
extern struct platform_driver rockchip_lvds_driver;
66
extern struct platform_driver vop_platform_driver;
67
extern struct platform_driver rk3066_hdmi_driver;
M
Mark Yao 已提交
68
#endif /* _ROCKCHIP_DRM_DRV_H_ */