xref: /linux/drivers/gpu/drm/verisilicon/vs_crtc.h (revision fbf5df34a4dbcd09d433dd4f0916bf9b2ddb16de)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2025 Icenowy Zheng <uwu@icenowy.me>
4  */
5 
6 #ifndef _VS_CRTC_H_
7 #define _VS_CRTC_H_
8 
9 #include <drm/drm_crtc.h>
10 #include <drm/drm_vblank.h>
11 
12 #define VSDC_DISP_TIMING_VALUE_MAX BIT_MASK(15)
13 
14 struct vs_dc;
15 
16 struct vs_crtc {
17 	struct drm_crtc base;
18 
19 	struct vs_dc *dc;
20 	unsigned int id;
21 };
22 
23 static inline struct vs_crtc *drm_crtc_to_vs_crtc(struct drm_crtc *crtc)
24 {
25 	return container_of(crtc, struct vs_crtc, base);
26 }
27 
28 struct vs_crtc *vs_crtc_init(struct drm_device *drm_dev, struct vs_dc *dc,
29 			     unsigned int output);
30 
31 #endif /* _VS_CRTC_H_ */
32