xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/i915/display/intel_panel.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: intel_panel.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 /*
5  * Copyright © 2019 Intel Corporation
6  */
7 
8 #ifndef __INTEL_PANEL_H__
9 #define __INTEL_PANEL_H__
10 
11 #include <linux/types.h>
12 
13 #include "intel_display.h"
14 
15 struct drm_connector;
16 struct drm_connector_state;
17 struct drm_display_mode;
18 struct intel_connector;
19 struct intel_crtc;
20 struct intel_crtc_state;
21 struct intel_encoder;
22 struct intel_panel;
23 
24 int intel_panel_init(struct intel_panel *panel,
25 		     struct drm_display_mode *fixed_mode,
26 		     struct drm_display_mode *downclock_mode);
27 void intel_panel_fini(struct intel_panel *panel);
28 void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
29 			    struct drm_display_mode *adjusted_mode);
30 void intel_pch_panel_fitting(struct intel_crtc *crtc,
31 			     struct intel_crtc_state *pipe_config,
32 			     int fitting_mode);
33 void intel_gmch_panel_fitting(struct intel_crtc *crtc,
34 			      struct intel_crtc_state *pipe_config,
35 			      int fitting_mode);
36 void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
37 				    u32 level, u32 max);
38 int intel_panel_setup_backlight(struct drm_connector *connector,
39 				enum pipe pipe);
40 void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
41 				  const struct drm_connector_state *conn_state);
42 void intel_panel_update_backlight(struct intel_encoder *encoder,
43 				  const struct intel_crtc_state *crtc_state,
44 				  const struct drm_connector_state *conn_state);
45 void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
46 struct drm_display_mode *
47 intel_panel_edid_downclock_mode(struct intel_connector *connector,
48 				const struct drm_display_mode *fixed_mode);
49 struct drm_display_mode *
50 intel_panel_edid_fixed_mode(struct intel_connector *connector);
51 struct drm_display_mode *
52 intel_panel_vbt_fixed_mode(struct intel_connector *connector);
53 
54 #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
55 int intel_backlight_device_register(struct intel_connector *connector);
56 void intel_backlight_device_unregister(struct intel_connector *connector);
57 #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
intel_backlight_device_register(struct intel_connector * connector)58 static inline int intel_backlight_device_register(struct intel_connector *connector)
59 {
60 	return 0;
61 }
intel_backlight_device_unregister(struct intel_connector * connector)62 static inline void intel_backlight_device_unregister(struct intel_connector *connector)
63 {
64 }
65 #endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
66 
67 #endif /* __INTEL_PANEL_H__ */
68