2 * Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
3 * Copyright (c) 2007-2008 Intel Corporation
4 * Jesse Barnes <jesse.barnes@intel.com>
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 #ifndef __INTEL_DRV_H__
26 #define __INTEL_DRV_H__
28 #include <linux/async.h>
29 #include <linux/i2c.h>
30 #include <linux/hdmi.h>
31 #include <linux/sched/clock.h>
32 #include <drm/i915_drm.h>
34 #include <drm/drm_crtc.h>
35 #include <drm/drm_crtc_helper.h>
36 #include <drm/drm_encoder.h>
37 #include <drm/drm_fb_helper.h>
38 #include <drm/drm_dp_dual_mode_helper.h>
39 #include <drm/drm_dp_mst_helper.h>
40 #include <drm/drm_rect.h>
41 #include <drm/drm_atomic.h>
44 * _wait_for - magic (register) wait macro
46 * Does the right thing for modeset paths when run under kdgb or similar atomic
47 * contexts. Note that it's important that we check the condition again after
48 * having timed out, since the timeout could be due to preemption or similar and
49 * we've never had a chance to check the condition before the timeout.
51 #define _wait_for(COND, US, Wmin, Wmax) ({ \
52 unsigned long timeout__ = jiffies + usecs_to_jiffies(US) + 1; \
53 long wait__ = (Wmin); /* recommended min for usleep is 10 us */ \
57 bool expired__ = time_after(jiffies, timeout__); \
66 usleep_range(wait__, wait__ * 2); \
67 if (wait__ < (Wmax)) \
73 #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000)
75 /* If CONFIG_PREEMPT_COUNT is disabled, in_atomic() always reports false. */
76 #if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT)
77 # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) WARN_ON_ONCE((ATOMIC) && !in_atomic())
79 # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) do { } while (0)
82 #define _wait_for_atomic(COND, US, ATOMIC) \
84 int cpu, ret, timeout = (US) * 1000; \
86 _WAIT_FOR_ATOMIC_CHECK(ATOMIC); \
89 cpu = smp_processor_id(); \
91 base = local_clock(); \
93 u64 now = local_clock(); \
100 if (now - base >= timeout) { \
107 if (unlikely(cpu != smp_processor_id())) { \
108 timeout -= now - base; \
109 cpu = smp_processor_id(); \
110 base = local_clock(); \
117 #define wait_for_us(COND, US) \
120 BUILD_BUG_ON(!__builtin_constant_p(US)); \
122 ret__ = _wait_for((COND), (US), 10, 10); \
124 ret__ = _wait_for_atomic((COND), (US), 0); \
128 #define wait_for_atomic_us(COND, US) \
130 BUILD_BUG_ON(!__builtin_constant_p(US)); \
131 BUILD_BUG_ON((US) > 50000); \
132 _wait_for_atomic((COND), (US), 1); \
135 #define wait_for_atomic(COND, MS) wait_for_atomic_us((COND), (MS) * 1000)
137 #define KHz(x) (1000 * (x))
138 #define MHz(x) KHz(1000 * (x))
141 * Display related stuff
144 /* store information about an Ixxx DVO */
145 /* The i830->i865 use multiple DVOs with multiple i2cs */
146 /* the i915, i945 have a single sDVO i2c bus - which is different */
147 #define MAX_OUTPUTS 6
148 /* maximum connectors per crtcs in the mode set */
150 /* Maximum cursor sizes */
151 #define GEN2_CURSOR_WIDTH 64
152 #define GEN2_CURSOR_HEIGHT 64
153 #define MAX_CURSOR_WIDTH 256
154 #define MAX_CURSOR_HEIGHT 256
156 #define INTEL_I2C_BUS_DVO 1
157 #define INTEL_I2C_BUS_SDVO 2
159 /* these are outputs from the chip - integrated only
160 external chips are via DVO or SDVO output */
161 enum intel_output_type {
162 INTEL_OUTPUT_UNUSED = 0,
163 INTEL_OUTPUT_ANALOG = 1,
164 INTEL_OUTPUT_DVO = 2,
165 INTEL_OUTPUT_SDVO = 3,
166 INTEL_OUTPUT_LVDS = 4,
167 INTEL_OUTPUT_TVOUT = 5,
168 INTEL_OUTPUT_HDMI = 6,
170 INTEL_OUTPUT_EDP = 8,
171 INTEL_OUTPUT_DSI = 9,
172 INTEL_OUTPUT_DDI = 10,
173 INTEL_OUTPUT_DP_MST = 11,
176 #define INTEL_DVO_CHIP_NONE 0
177 #define INTEL_DVO_CHIP_LVDS 1
178 #define INTEL_DVO_CHIP_TMDS 2
179 #define INTEL_DVO_CHIP_TVOUT 4
181 #define INTEL_DSI_VIDEO_MODE 0
182 #define INTEL_DSI_COMMAND_MODE 1
184 struct intel_framebuffer {
185 struct drm_framebuffer base;
186 struct drm_i915_gem_object *obj;
187 struct intel_rotation_info rot_info;
189 /* for each plane in the normal GTT view */
193 /* for each plane in the rotated GTT view */
196 unsigned int pitch; /* pixels */
201 struct drm_fb_helper helper;
202 struct intel_framebuffer *fb;
203 struct i915_vma *vma;
204 unsigned long vma_flags;
205 async_cookie_t cookie;
209 struct intel_encoder {
210 struct drm_encoder base;
212 enum intel_output_type type;
214 unsigned int cloneable;
215 void (*hot_plug)(struct intel_encoder *);
216 enum intel_output_type (*compute_output_type)(struct intel_encoder *,
217 struct intel_crtc_state *,
218 struct drm_connector_state *);
219 bool (*compute_config)(struct intel_encoder *,
220 struct intel_crtc_state *,
221 struct drm_connector_state *);
222 void (*pre_pll_enable)(struct intel_encoder *,
223 const struct intel_crtc_state *,
224 const struct drm_connector_state *);
225 void (*pre_enable)(struct intel_encoder *,
226 const struct intel_crtc_state *,
227 const struct drm_connector_state *);
228 void (*enable)(struct intel_encoder *,
229 const struct intel_crtc_state *,
230 const struct drm_connector_state *);
231 void (*disable)(struct intel_encoder *,
232 const struct intel_crtc_state *,
233 const struct drm_connector_state *);
234 void (*post_disable)(struct intel_encoder *,
235 const struct intel_crtc_state *,
236 const struct drm_connector_state *);
237 void (*post_pll_disable)(struct intel_encoder *,
238 const struct intel_crtc_state *,
239 const struct drm_connector_state *);
240 /* Read out the current hw state of this connector, returning true if
241 * the encoder is active. If the encoder is enabled it also set the pipe
242 * it is connected to in the pipe parameter. */
243 bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe);
244 /* Reconstructs the equivalent mode flags for the current hardware
245 * state. This must be called _after_ display->get_pipe_config has
246 * pre-filled the pipe config. Note that intel_encoder->base.crtc must
247 * be set correctly before calling this function. */
248 void (*get_config)(struct intel_encoder *,
249 struct intel_crtc_state *pipe_config);
250 /* Returns a mask of power domains that need to be referenced as part
251 * of the hardware state readout code. */
252 u64 (*get_power_domains)(struct intel_encoder *encoder);
254 * Called during system suspend after all pending requests for the
255 * encoder are flushed (for example for DP AUX transactions) and
256 * device interrupts are disabled.
258 void (*suspend)(struct intel_encoder *);
260 enum hpd_pin hpd_pin;
261 enum intel_display_power_domain power_domain;
262 /* for communication with audio component; protected by av_mutex */
263 const struct drm_connector *audio_connector;
267 struct drm_display_mode *fixed_mode;
268 struct drm_display_mode *alt_fixed_mode;
269 struct drm_display_mode *downclock_mode;
278 bool combination_mode; /* gen 2/4 only */
280 bool alternate_pwm_increment; /* lpt+ */
283 bool util_pin_active_low; /* bxt+ */
284 u8 controller; /* bxt+ only */
285 struct pwm_device *pwm;
287 struct backlight_device *device;
289 /* Connector and platform specific backlight functions */
290 int (*setup)(struct intel_connector *connector, enum pipe pipe);
291 uint32_t (*get)(struct intel_connector *connector);
292 void (*set)(const struct drm_connector_state *conn_state, uint32_t level);
293 void (*disable)(const struct drm_connector_state *conn_state);
294 void (*enable)(const struct intel_crtc_state *crtc_state,
295 const struct drm_connector_state *conn_state);
296 uint32_t (*hz_to_pwm)(struct intel_connector *connector,
298 void (*power)(struct intel_connector *, bool enable);
302 struct intel_connector {
303 struct drm_connector base;
305 * The fixed encoder this connector is connected to.
307 struct intel_encoder *encoder;
309 /* ACPI device id for ACPI and driver cooperation */
312 /* Reads out the current hw, returning true if the connector is enabled
313 * and active (i.e. dpms ON state). */
314 bool (*get_hw_state)(struct intel_connector *);
316 /* Panel info for eDP and LVDS */
317 struct intel_panel panel;
319 /* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */
321 struct edid *detect_edid;
323 /* since POLL and HPD connectors may use the same HPD line keep the native
324 state of connector->polled in case hotplug storm detection changes it */
327 void *port; /* store this opaque as its illegal to dereference it */
329 struct intel_dp *mst_port;
331 /* Work struct to schedule a uevent on link train failure */
332 struct work_struct modeset_retry_work;
335 struct intel_digital_connector_state {
336 struct drm_connector_state base;
338 enum hdmi_force_audio force_audio;
342 #define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base)
356 struct intel_atomic_state {
357 struct drm_atomic_state base;
361 * Logical state of cdclk (used for all scaling, watermark,
362 * etc. calculations and checks). This is computed as if all
363 * enabled crtcs were active.
365 struct intel_cdclk_state logical;
368 * Actual state of cdclk, can be different from the logical
369 * state only when all crtc's are DPMS off.
371 struct intel_cdclk_state actual;
374 bool dpll_set, modeset;
377 * Does this transaction change the pipes that are active? This mask
378 * tracks which CRTC's have changed their active state at the end of
379 * the transaction (not counting the temporary disable during modesets).
380 * This mask should only be non-zero when intel_state->modeset is true,
381 * but the converse is not necessarily true; simply changing a mode may
382 * not flip the final active status of any CRTC's
384 unsigned int active_pipe_changes;
386 unsigned int active_crtcs;
387 /* minimum acceptable cdclk for each pipe */
388 int min_cdclk[I915_MAX_PIPES];
389 /* minimum acceptable voltage level for each pipe */
390 u8 min_voltage_level[I915_MAX_PIPES];
392 struct intel_shared_dpll_state shared_dpll[I915_NUM_PLLS];
395 * Current watermarks can't be trusted during hardware readout, so
396 * don't bother calculating intermediate watermarks.
398 bool skip_intermediate_wm;
401 struct skl_wm_values wm_results;
403 struct i915_sw_fence commit_ready;
405 struct llist_node freed;
408 struct intel_plane_state {
409 struct drm_plane_state base;
410 struct drm_rect clip;
411 struct i915_vma *vma;
413 #define PLANE_HAS_FENCE BIT(0)
424 /* plane control register */
427 /* plane color control register */
432 * = -1 : not using a scaler
433 * >= 0 : using a scalers
435 * plane requiring a scaler:
436 * - During check_plane, its bit is set in
437 * crtc_state->scaler_state.scaler_users by calling helper function
438 * update_scaler_plane.
439 * - scaler_id indicates the scaler it got assigned.
441 * plane doesn't require a scaler:
442 * - this can happen when scaling is no more required or plane simply
444 * - During check_plane, corresponding bit is reset in
445 * crtc_state->scaler_state.scaler_users by calling helper function
446 * update_scaler_plane.
450 struct drm_intel_sprite_colorkey ckey;
453 struct intel_initial_plane_config {
454 struct intel_framebuffer *fb;
460 #define SKL_MIN_SRC_W 8
461 #define SKL_MAX_SRC_W 4096
462 #define SKL_MIN_SRC_H 8
463 #define SKL_MAX_SRC_H 4096
464 #define SKL_MIN_DST_W 8
465 #define SKL_MAX_DST_W 4096
466 #define SKL_MIN_DST_H 8
467 #define SKL_MAX_DST_H 4096
469 struct intel_scaler {
474 struct intel_crtc_scaler_state {
475 #define SKL_NUM_SCALERS 2
476 struct intel_scaler scalers[SKL_NUM_SCALERS];
479 * scaler_users: keeps track of users requesting scalers on this crtc.
481 * If a bit is set, a user is using a scaler.
482 * Here user can be a plane or crtc as defined below:
483 * bits 0-30 - plane (bit position is index from drm_plane_index)
486 * Instead of creating a new index to cover planes and crtc, using
487 * existing drm_plane_index for planes which is well less than 31
488 * planes and bit 31 for crtc. This should be fine to cover all
491 * intel_atomic_setup_scalers will setup available scalers to users
492 * requesting scalers. It will gracefully fail if request exceeds
495 #define SKL_CRTC_INDEX 31
496 unsigned scaler_users;
498 /* scaler used by crtc for panel fitting purpose */
502 /* drm_mode->private_flags */
503 #define I915_MODE_FLAG_INHERITED 1
504 /* Flag to get scanline using frame time stamps */
505 #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1)
507 struct intel_pipe_wm {
508 struct intel_wm_level wm[5];
512 bool sprites_enabled;
516 struct skl_plane_wm {
517 struct skl_wm_level wm[8];
518 struct skl_wm_level trans_wm;
522 struct skl_plane_wm planes[I915_MAX_PLANES];
529 VLV_WM_LEVEL_DDR_DVFS,
533 struct vlv_wm_state {
534 struct g4x_pipe_wm wm[NUM_VLV_WM_LEVELS];
535 struct g4x_sr_wm sr[NUM_VLV_WM_LEVELS];
540 struct vlv_fifo_state {
541 u16 plane[I915_MAX_PLANES];
551 struct g4x_wm_state {
552 struct g4x_pipe_wm wm;
554 struct g4x_sr_wm hpll;
560 struct intel_crtc_wm_state {
564 * Intermediate watermarks; these can be
565 * programmed immediately since they satisfy
566 * both the current configuration we're
567 * switching away from and the new
568 * configuration we're switching to.
570 struct intel_pipe_wm intermediate;
573 * Optimal watermarks, programmed post-vblank
574 * when this state is committed.
576 struct intel_pipe_wm optimal;
580 /* gen9+ only needs 1-step wm programming */
581 struct skl_pipe_wm optimal;
582 struct skl_ddb_entry ddb;
586 /* "raw" watermarks (not inverted) */
587 struct g4x_pipe_wm raw[NUM_VLV_WM_LEVELS];
588 /* intermediate watermarks (inverted) */
589 struct vlv_wm_state intermediate;
590 /* optimal watermarks (inverted) */
591 struct vlv_wm_state optimal;
592 /* display FIFO split */
593 struct vlv_fifo_state fifo_state;
597 /* "raw" watermarks */
598 struct g4x_pipe_wm raw[NUM_G4X_WM_LEVELS];
599 /* intermediate watermarks */
600 struct g4x_wm_state intermediate;
601 /* optimal watermarks */
602 struct g4x_wm_state optimal;
607 * Platforms with two-step watermark programming will need to
608 * update watermark programming post-vblank to switch from the
609 * safe intermediate watermarks to the optimal final
612 bool need_postvbl_update;
615 struct intel_crtc_state {
616 struct drm_crtc_state base;
619 * quirks - bitfield with hw state readout quirks
621 * For various reasons the hw state readout code might not be able to
622 * completely faithfully read out the current state. These cases are
623 * tracked with quirk flags so that fastboot and state checker can act
626 #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
627 unsigned long quirks;
629 unsigned fb_bits; /* framebuffers to flip */
630 bool update_pipe; /* can a fast modeset be performed? */
632 bool update_wm_pre, update_wm_post; /* watermarks are updated */
633 bool fb_changed; /* fb on any of the planes is changed */
634 bool fifo_changed; /* FIFO split is changed */
636 /* Pipe source size (ie. panel fitter input size)
637 * All planes will be positioned inside this space,
638 * and get clipped at the edges. */
639 int pipe_src_w, pipe_src_h;
642 * Pipe pixel rate, adjusted for
643 * panel fitter/pipe scaler downscaling.
645 unsigned int pixel_rate;
647 /* Whether to set up the PCH/FDI. Note that we never allow sharing
648 * between pch encoders and cpu encoders. */
649 bool has_pch_encoder;
651 /* Are we sending infoframes on the attached port */
654 /* CPU Transcoder for the pipe. Currently this can only differ from the
655 * pipe on Haswell and later (where we have a special eDP transcoder)
656 * and Broxton (where we have special DSI transcoders). */
657 enum transcoder cpu_transcoder;
660 * Use reduced/limited/broadcast rbg range, compressing from the full
661 * range fed into the crtcs.
663 bool limited_color_range;
665 /* Bitmask of encoder types (enum intel_output_type)
666 * driven by the pipe.
668 unsigned int output_types;
670 /* Whether we should send NULL infoframes. Required for audio. */
673 /* Audio enabled on this pipe. Only valid if either has_hdmi_sink or
674 * has_dp_encoder is set. */
678 * Enable dithering, used when the selected pipe bpp doesn't match the
684 * Dither gets enabled for 18bpp which causes CRC mismatch errors for
685 * compliance video pattern tests.
686 * Disable dither only if it is a compliance test request for
689 bool dither_force_disable;
691 /* Controls for the clock computation, to override various stages. */
694 /* SDVO TV has a bunch of special case. To make multifunction encoders
695 * work correctly, we need to track this at runtime.*/
699 * crtc bandwidth limit, don't increase pipe bpp or clock if not really
700 * required. This is set in the 2nd loop of calling encoder's
701 * ->compute_config if the first pick doesn't work out.
705 /* Settings for the intel dpll used on pretty much everything but
709 /* Selected dpll when shared or NULL. */
710 struct intel_shared_dpll *shared_dpll;
712 /* Actual register state of the dpll, for shared dpll cross-checking. */
713 struct intel_dpll_hw_state dpll_hw_state;
715 /* DSI PLL registers */
721 struct intel_link_m_n dp_m_n;
723 /* m2_n2 for eDP downclock */
724 struct intel_link_m_n dp_m2_n2;
731 * Frequence the dpll for the port should run at. Differs from the
732 * adjusted dotclock e.g. for DP or 12bpc hdmi mode. This is also
733 * already multiplied by pixel_multiplier.
737 /* Used by SDVO (and if we ever fix it, HDMI). */
738 unsigned pixel_multiplier;
743 * Used by platforms having DP/HDMI PHY with programmable lane
744 * latency optimization.
746 uint8_t lane_lat_optim_mask;
748 /* minimum acceptable voltage level */
749 u8 min_voltage_level;
751 /* Panel fitter controls for gen2-gen4 + VLV */
755 u32 lvds_border_bits;
758 /* Panel fitter placement and size for Ironlake+ */
766 /* FDI configuration, only valid if has_pch_encoder is set. */
768 struct intel_link_m_n fdi_m_n;
771 bool ips_force_disable;
779 struct intel_crtc_scaler_state scaler_state;
781 /* w/a for waiting 2 vblanks during crtc enable */
782 enum pipe hsw_workaround_pipe;
784 /* IVB sprite scaling w/a (WaCxSRDisabledForSpriteScaling:ivb) */
787 struct intel_crtc_wm_state wm;
789 /* Gamma mode programmed on the pipe */
792 /* bitmask of visible planes (enum plane_id) */
795 /* HDMI scrambling status */
796 bool hdmi_scrambling;
798 /* HDMI High TMDS char rate ratio */
799 bool hdmi_high_tmds_clock_ratio;
801 /* output format is YCBCR 4:2:0 */
806 struct drm_crtc base;
809 * Whether the crtc and the connected output pipeline is active. Implies
810 * that crtc->enabled is set, i.e. the current mode configuration has
811 * some outputs connected to this crtc.
815 unsigned long long enabled_power_domains;
816 struct intel_overlay *overlay;
818 struct intel_crtc_state *config;
820 /* global reset count when the last flip was submitted */
821 unsigned int reset_count;
823 /* Access to these should be protected by dev_priv->irq_lock. */
824 bool cpu_fifo_underrun_disabled;
825 bool pch_fifo_underrun_disabled;
827 /* per-pipe watermark state */
829 /* watermarks currently being used */
831 struct intel_pipe_wm ilk;
832 struct vlv_wm_state vlv;
833 struct g4x_wm_state g4x;
840 unsigned start_vbl_count;
841 ktime_t start_vbl_time;
842 int min_vbl, max_vbl;
846 /* scalers available on this crtc */
851 struct drm_plane base;
852 enum i9xx_plane_id i9xx_plane;
857 uint32_t frontbuffer_bit;
860 u32 base, cntl, size;
864 * NOTE: Do not place new plane state fields here (e.g., when adding
865 * new plane properties). New runtime state should now be placed in
866 * the intel_plane_state structure and accessed via plane_state.
869 void (*update_plane)(struct intel_plane *plane,
870 const struct intel_crtc_state *crtc_state,
871 const struct intel_plane_state *plane_state);
872 void (*disable_plane)(struct intel_plane *plane,
873 struct intel_crtc *crtc);
874 bool (*get_hw_state)(struct intel_plane *plane);
875 int (*check_plane)(struct intel_plane *plane,
876 struct intel_crtc_state *crtc_state,
877 struct intel_plane_state *state);
880 struct intel_watermark_params {
888 struct cxsr_latency {
894 u16 display_hpll_disable;
896 u16 cursor_hpll_disable;
899 #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)
900 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
901 #define to_intel_crtc_state(x) container_of(x, struct intel_crtc_state, base)
902 #define to_intel_connector(x) container_of(x, struct intel_connector, base)
903 #define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
904 #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
905 #define to_intel_plane(x) container_of(x, struct intel_plane, base)
906 #define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base)
907 #define intel_fb_obj(x) (x ? to_intel_framebuffer(x)->obj : NULL)
913 enum drm_dp_dual_mode_type type;
918 bool rgb_quant_range_selectable;
919 struct intel_connector *attached_connector;
922 struct intel_dp_mst_encoder;
923 #define DP_MAX_DOWNSTREAM_PORTS 0x10
927 * When platform provides two set of M_N registers for dp, we can
928 * program them and switch between them incase of DRRS.
929 * But When only one such register is provided, we have to program the
930 * required divider value on that registers itself based on the DRRS state.
932 * M1_N1 : Program dp_m_n on M1_N1 registers
933 * dp_m2_n2 on M2_N2 registers (If supported)
935 * M2_N2 : Program dp_m2_n2 on M1_N1 registers
936 * M2_N2 registers are not supported
940 /* Sets the m1_n1 and m2_n2 */
945 struct intel_dp_compliance_data {
947 uint8_t video_pattern;
948 uint16_t hdisplay, vdisplay;
952 struct intel_dp_compliance {
953 unsigned long test_type;
954 struct intel_dp_compliance_data test_data;
961 i915_reg_t output_reg;
962 i915_reg_t aux_ch_ctl_reg;
963 i915_reg_t aux_ch_data_reg[5];
971 bool channel_eq_status;
972 bool reset_link_params;
973 uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
974 uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
975 uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
976 uint8_t edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
978 int num_source_rates;
979 const int *source_rates;
980 /* sink rates as reported by DP_MAX_LINK_RATE/DP_SUPPORTED_LINK_RATES */
982 int sink_rates[DP_MAX_SUPPORTED_RATES];
983 bool use_rate_select;
984 /* intersection of source and sink rates */
985 int num_common_rates;
986 int common_rates[DP_MAX_SUPPORTED_RATES];
987 /* Max lane count for the current link */
988 int max_link_lane_count;
989 /* Max rate for the current link */
991 /* sink or branch descriptor */
992 struct drm_dp_desc desc;
993 struct drm_dp_aux aux;
994 enum intel_display_power_domain aux_power_domain;
995 uint8_t train_set[4];
996 int panel_power_up_delay;
997 int panel_power_down_delay;
998 int panel_power_cycle_delay;
999 int backlight_on_delay;
1000 int backlight_off_delay;
1001 struct delayed_work panel_vdd_work;
1002 bool want_panel_vdd;
1003 unsigned long last_power_on;
1004 unsigned long last_backlight_off;
1005 ktime_t panel_power_off_time;
1007 struct notifier_block edp_notifier;
1010 * Pipe whose power sequencer is currently locked into
1011 * this port. Only relevant on VLV/CHV.
1015 * Pipe currently driving the port. Used for preventing
1016 * the use of the PPS for any pipe currentrly driving
1017 * external DP as that will mess things up on VLV.
1019 enum pipe active_pipe;
1021 * Set if the sequencer may be reset due to a power transition,
1022 * requiring a reinitialization. Only relevant on BXT.
1025 struct edp_power_seq pps_delays;
1027 bool can_mst; /* this port supports mst */
1029 int active_mst_links;
1030 /* connector directly attached - won't be use for modeset in mst world */
1031 struct intel_connector *attached_connector;
1033 /* mst connector list */
1034 struct intel_dp_mst_encoder *mst_encoders[I915_MAX_PIPES];
1035 struct drm_dp_mst_topology_mgr mst_mgr;
1037 uint32_t (*get_aux_clock_divider)(struct intel_dp *dp, int index);
1039 * This function returns the value we have to program the AUX_CTL
1040 * register with to kick off an AUX transaction.
1042 uint32_t (*get_aux_send_ctl)(struct intel_dp *dp,
1045 uint32_t aux_clock_divider);
1047 /* This is called before a link training is starterd */
1048 void (*prepare_link_retrain)(struct intel_dp *intel_dp);
1050 /* Displayport compliance testing */
1051 struct intel_dp_compliance compliance;
1054 struct intel_lspcon {
1056 enum drm_lspcon_mode mode;
1059 struct intel_digital_port {
1060 struct intel_encoder base;
1061 u32 saved_port_bits;
1063 struct intel_hdmi hdmi;
1064 struct intel_lspcon lspcon;
1065 enum irqreturn (*hpd_pulse)(struct intel_digital_port *, bool);
1066 bool release_cl2_override;
1068 enum intel_display_power_domain ddi_io_power_domain;
1070 void (*write_infoframe)(struct drm_encoder *encoder,
1071 const struct intel_crtc_state *crtc_state,
1073 const void *frame, ssize_t len);
1074 void (*set_infoframes)(struct drm_encoder *encoder,
1076 const struct intel_crtc_state *crtc_state,
1077 const struct drm_connector_state *conn_state);
1078 bool (*infoframe_enabled)(struct drm_encoder *encoder,
1079 const struct intel_crtc_state *pipe_config);
1082 struct intel_dp_mst_encoder {
1083 struct intel_encoder base;
1085 struct intel_digital_port *primary;
1086 struct intel_connector *connector;
1089 static inline enum dpio_channel
1090 vlv_dport_to_channel(struct intel_digital_port *dport)
1092 switch (dport->base.port) {
1103 static inline enum dpio_phy
1104 vlv_dport_to_phy(struct intel_digital_port *dport)
1106 switch (dport->base.port) {
1117 static inline enum dpio_channel
1118 vlv_pipe_to_channel(enum pipe pipe)
1131 static inline struct intel_crtc *
1132 intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
1134 return dev_priv->pipe_to_crtc_mapping[pipe];
1137 static inline struct intel_crtc *
1138 intel_get_crtc_for_plane(struct drm_i915_private *dev_priv, enum i9xx_plane_id plane)
1140 return dev_priv->plane_to_crtc_mapping[plane];
1143 struct intel_load_detect_pipe {
1144 struct drm_atomic_state *restore_state;
1147 static inline struct intel_encoder *
1148 intel_attached_encoder(struct drm_connector *connector)
1150 return to_intel_connector(connector)->encoder;
1153 static inline struct intel_digital_port *
1154 enc_to_dig_port(struct drm_encoder *encoder)
1156 struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
1158 switch (intel_encoder->type) {
1159 case INTEL_OUTPUT_DDI:
1160 WARN_ON(!HAS_DDI(to_i915(encoder->dev)));
1161 case INTEL_OUTPUT_DP:
1162 case INTEL_OUTPUT_EDP:
1163 case INTEL_OUTPUT_HDMI:
1164 return container_of(encoder, struct intel_digital_port,
1171 static inline struct intel_dp_mst_encoder *
1172 enc_to_mst(struct drm_encoder *encoder)
1174 return container_of(encoder, struct intel_dp_mst_encoder, base.base);
1177 static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder)
1179 return &enc_to_dig_port(encoder)->dp;
1182 static inline struct intel_digital_port *
1183 dp_to_dig_port(struct intel_dp *intel_dp)
1185 return container_of(intel_dp, struct intel_digital_port, dp);
1188 static inline struct intel_lspcon *
1189 dp_to_lspcon(struct intel_dp *intel_dp)
1191 return &dp_to_dig_port(intel_dp)->lspcon;
1194 static inline struct intel_digital_port *
1195 hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
1197 return container_of(intel_hdmi, struct intel_digital_port, hdmi);
1200 static inline struct intel_plane_state *
1201 intel_atomic_get_new_plane_state(struct intel_atomic_state *state,
1202 struct intel_plane *plane)
1204 return to_intel_plane_state(drm_atomic_get_new_plane_state(&state->base,
1208 static inline struct intel_crtc_state *
1209 intel_atomic_get_old_crtc_state(struct intel_atomic_state *state,
1210 struct intel_crtc *crtc)
1212 return to_intel_crtc_state(drm_atomic_get_old_crtc_state(&state->base,
1216 static inline struct intel_crtc_state *
1217 intel_atomic_get_new_crtc_state(struct intel_atomic_state *state,
1218 struct intel_crtc *crtc)
1220 return to_intel_crtc_state(drm_atomic_get_new_crtc_state(&state->base,
1224 /* intel_fifo_underrun.c */
1225 bool intel_set_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
1226 enum pipe pipe, bool enable);
1227 bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
1228 enum pipe pch_transcoder,
1230 void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
1232 void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
1233 enum pipe pch_transcoder);
1234 void intel_check_cpu_fifo_underruns(struct drm_i915_private *dev_priv);
1235 void intel_check_pch_fifo_underruns(struct drm_i915_private *dev_priv);
1238 void gen5_enable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask);
1239 void gen5_disable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask);
1240 void gen6_mask_pm_irq(struct drm_i915_private *dev_priv, u32 mask);
1241 void gen6_unmask_pm_irq(struct drm_i915_private *dev_priv, u32 mask);
1242 void gen6_reset_rps_interrupts(struct drm_i915_private *dev_priv);
1243 void gen6_enable_rps_interrupts(struct drm_i915_private *dev_priv);
1244 void gen6_disable_rps_interrupts(struct drm_i915_private *dev_priv);
1246 static inline u32 gen6_sanitize_rps_pm_mask(const struct drm_i915_private *i915,
1249 return mask & ~i915->gt_pm.rps.pm_intrmsk_mbz;
1252 void intel_runtime_pm_disable_interrupts(struct drm_i915_private *dev_priv);
1253 void intel_runtime_pm_enable_interrupts(struct drm_i915_private *dev_priv);
1254 static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
1257 * We only use drm_irq_uninstall() at unload and VT switch, so
1258 * this is the only thing we need to check.
1260 return dev_priv->runtime_pm.irqs_enabled;
1263 int intel_get_crtc_scanline(struct intel_crtc *crtc);
1264 void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv,
1266 void gen8_irq_power_well_pre_disable(struct drm_i915_private *dev_priv,
1268 void gen9_reset_guc_interrupts(struct drm_i915_private *dev_priv);
1269 void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
1270 void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
1273 void intel_crt_init(struct drm_i915_private *dev_priv);
1274 void intel_crt_reset(struct drm_encoder *encoder);
1277 void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
1278 const struct intel_crtc_state *old_crtc_state,
1279 const struct drm_connector_state *old_conn_state);
1280 void hsw_fdi_link_train(struct intel_crtc *crtc,
1281 const struct intel_crtc_state *crtc_state);
1282 void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
1283 bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
1284 void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state);
1285 void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
1286 enum transcoder cpu_transcoder);
1287 void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state);
1288 void intel_ddi_disable_pipe_clock(const struct intel_crtc_state *crtc_state);
1289 struct intel_encoder *
1290 intel_ddi_get_crtc_new_encoder(struct intel_crtc_state *crtc_state);
1291 void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state);
1292 void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
1293 bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
1294 void intel_ddi_get_config(struct intel_encoder *encoder,
1295 struct intel_crtc_state *pipe_config);
1297 void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
1299 void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
1300 struct intel_crtc_state *crtc_state);
1301 u32 bxt_signal_levels(struct intel_dp *intel_dp);
1302 uint32_t ddi_signal_levels(struct intel_dp *intel_dp);
1303 u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder);
1305 unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
1306 int plane, unsigned int height);
1309 void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
1310 void intel_audio_codec_enable(struct intel_encoder *encoder,
1311 const struct intel_crtc_state *crtc_state,
1312 const struct drm_connector_state *conn_state);
1313 void intel_audio_codec_disable(struct intel_encoder *encoder,
1314 const struct intel_crtc_state *old_crtc_state,
1315 const struct drm_connector_state *old_conn_state);
1316 void i915_audio_component_init(struct drm_i915_private *dev_priv);
1317 void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
1318 void intel_audio_init(struct drm_i915_private *dev_priv);
1319 void intel_audio_deinit(struct drm_i915_private *dev_priv);
1322 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
1323 void skl_init_cdclk(struct drm_i915_private *dev_priv);
1324 void skl_uninit_cdclk(struct drm_i915_private *dev_priv);
1325 void cnl_init_cdclk(struct drm_i915_private *dev_priv);
1326 void cnl_uninit_cdclk(struct drm_i915_private *dev_priv);
1327 void bxt_init_cdclk(struct drm_i915_private *dev_priv);
1328 void bxt_uninit_cdclk(struct drm_i915_private *dev_priv);
1329 void icl_init_cdclk(struct drm_i915_private *dev_priv);
1330 void icl_uninit_cdclk(struct drm_i915_private *dev_priv);
1331 void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
1332 void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
1333 void intel_update_cdclk(struct drm_i915_private *dev_priv);
1334 void intel_update_rawclk(struct drm_i915_private *dev_priv);
1335 bool intel_cdclk_needs_modeset(const struct intel_cdclk_state *a,
1336 const struct intel_cdclk_state *b);
1337 bool intel_cdclk_changed(const struct intel_cdclk_state *a,
1338 const struct intel_cdclk_state *b);
1339 void intel_set_cdclk(struct drm_i915_private *dev_priv,
1340 const struct intel_cdclk_state *cdclk_state);
1341 void intel_dump_cdclk_state(const struct intel_cdclk_state *cdclk_state,
1342 const char *context);
1344 /* intel_display.c */
1345 void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
1346 void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
1347 enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc);
1348 void intel_update_rawclk(struct drm_i915_private *dev_priv);
1349 int vlv_get_hpll_vco(struct drm_i915_private *dev_priv);
1350 int vlv_get_cck_clock(struct drm_i915_private *dev_priv,
1351 const char *name, u32 reg, int ref_freq);
1352 int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
1353 const char *name, u32 reg);
1354 void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv);
1355 void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
1356 void intel_init_display_hooks(struct drm_i915_private *dev_priv);
1357 unsigned int intel_fb_xy_to_linear(int x, int y,
1358 const struct intel_plane_state *state,
1360 void intel_add_fb_offsets(int *x, int *y,
1361 const struct intel_plane_state *state, int plane);
1362 unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info);
1363 bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv);
1364 void intel_mark_busy(struct drm_i915_private *dev_priv);
1365 void intel_mark_idle(struct drm_i915_private *dev_priv);
1366 int intel_display_suspend(struct drm_device *dev);
1367 void intel_pps_unlock_regs_wa(struct drm_i915_private *dev_priv);
1368 void intel_encoder_destroy(struct drm_encoder *encoder);
1369 int intel_connector_init(struct intel_connector *);
1370 struct intel_connector *intel_connector_alloc(void);
1371 void intel_connector_free(struct intel_connector *connector);
1372 bool intel_connector_get_hw_state(struct intel_connector *connector);
1373 void intel_connector_attach_encoder(struct intel_connector *connector,
1374 struct intel_encoder *encoder);
1375 struct drm_display_mode *
1376 intel_encoder_current_mode(struct intel_encoder *encoder);
1378 enum pipe intel_get_pipe_from_connector(struct intel_connector *connector);
1379 int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
1380 struct drm_file *file_priv);
1381 enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
1384 intel_crtc_has_type(const struct intel_crtc_state *crtc_state,
1385 enum intel_output_type type)
1387 return crtc_state->output_types & (1 << type);
1390 intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
1392 return crtc_state->output_types &
1393 ((1 << INTEL_OUTPUT_DP) |
1394 (1 << INTEL_OUTPUT_DP_MST) |
1395 (1 << INTEL_OUTPUT_EDP));
1398 intel_wait_for_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
1400 drm_wait_one_vblank(&dev_priv->drm, pipe);
1403 intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, int pipe)
1405 const struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
1408 intel_wait_for_vblank(dev_priv, pipe);
1411 u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
1413 int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp);
1414 void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
1415 struct intel_digital_port *dport,
1416 unsigned int expected_mask);
1417 int intel_get_load_detect_pipe(struct drm_connector *connector,
1418 const struct drm_display_mode *mode,
1419 struct intel_load_detect_pipe *old,
1420 struct drm_modeset_acquire_ctx *ctx);
1421 void intel_release_load_detect_pipe(struct drm_connector *connector,
1422 struct intel_load_detect_pipe *old,
1423 struct drm_modeset_acquire_ctx *ctx);
1425 intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
1426 unsigned int rotation,
1428 unsigned long *out_flags);
1429 void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags);
1430 struct drm_framebuffer *
1431 intel_framebuffer_create(struct drm_i915_gem_object *obj,
1432 struct drm_mode_fb_cmd2 *mode_cmd);
1433 int intel_prepare_plane_fb(struct drm_plane *plane,
1434 struct drm_plane_state *new_state);
1435 void intel_cleanup_plane_fb(struct drm_plane *plane,
1436 struct drm_plane_state *old_state);
1437 int intel_plane_atomic_get_property(struct drm_plane *plane,
1438 const struct drm_plane_state *state,
1439 struct drm_property *property,
1441 int intel_plane_atomic_set_property(struct drm_plane *plane,
1442 struct drm_plane_state *state,
1443 struct drm_property *property,
1445 int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_state,
1446 struct drm_crtc_state *crtc_state,
1447 const struct intel_plane_state *old_plane_state,
1448 struct drm_plane_state *plane_state);
1450 void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv,
1453 int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
1454 const struct dpll *dpll);
1455 void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe);
1456 int lpt_get_iclkip(struct drm_i915_private *dev_priv);
1458 /* modesetting asserts */
1459 void assert_panel_unlocked(struct drm_i915_private *dev_priv,
1461 void assert_pll(struct drm_i915_private *dev_priv,
1462 enum pipe pipe, bool state);
1463 #define assert_pll_enabled(d, p) assert_pll(d, p, true)
1464 #define assert_pll_disabled(d, p) assert_pll(d, p, false)
1465 void assert_dsi_pll(struct drm_i915_private *dev_priv, bool state);
1466 #define assert_dsi_pll_enabled(d) assert_dsi_pll(d, true)
1467 #define assert_dsi_pll_disabled(d) assert_dsi_pll(d, false)
1468 void assert_fdi_rx_pll(struct drm_i915_private *dev_priv,
1469 enum pipe pipe, bool state);
1470 #define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true)
1471 #define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false)
1472 void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state);
1473 #define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
1474 #define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
1475 u32 intel_compute_tile_offset(int *x, int *y,
1476 const struct intel_plane_state *state, int plane);
1477 void intel_prepare_reset(struct drm_i915_private *dev_priv);
1478 void intel_finish_reset(struct drm_i915_private *dev_priv);
1479 void hsw_enable_pc8(struct drm_i915_private *dev_priv);
1480 void hsw_disable_pc8(struct drm_i915_private *dev_priv);
1481 void gen9_sanitize_dc_state(struct drm_i915_private *dev_priv);
1482 void bxt_enable_dc9(struct drm_i915_private *dev_priv);
1483 void bxt_disable_dc9(struct drm_i915_private *dev_priv);
1484 void gen9_enable_dc5(struct drm_i915_private *dev_priv);
1485 unsigned int skl_cdclk_get_vco(unsigned int freq);
1486 void skl_enable_dc6(struct drm_i915_private *dev_priv);
1487 void skl_disable_dc6(struct drm_i915_private *dev_priv);
1488 void intel_dp_get_m_n(struct intel_crtc *crtc,
1489 struct intel_crtc_state *pipe_config);
1490 void intel_dp_set_m_n(struct intel_crtc *crtc, enum link_m_n_set m_n);
1491 int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n);
1492 bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state, int target_clock,
1493 struct dpll *best_clock);
1494 int chv_calc_dpll_params(int refclk, struct dpll *pll_clock);
1496 bool intel_crtc_active(struct intel_crtc *crtc);
1497 bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state);
1498 void hsw_enable_ips(const struct intel_crtc_state *crtc_state);
1499 void hsw_disable_ips(const struct intel_crtc_state *crtc_state);
1500 enum intel_display_power_domain intel_port_to_power_domain(enum port port);
1501 void intel_mode_from_pipe_config(struct drm_display_mode *mode,
1502 struct intel_crtc_state *pipe_config);
1504 int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state);
1505 int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
1507 static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *state)
1509 return i915_ggtt_offset(state->vma);
1512 u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
1513 const struct intel_plane_state *plane_state);
1514 u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
1515 const struct intel_plane_state *plane_state);
1516 u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
1517 unsigned int rotation);
1518 int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,
1519 struct intel_plane_state *plane_state);
1520 int i9xx_check_plane_surface(struct intel_plane_state *plane_state);
1523 void intel_csr_ucode_init(struct drm_i915_private *);
1524 void intel_csr_load_program(struct drm_i915_private *);
1525 void intel_csr_ucode_fini(struct drm_i915_private *);
1526 void intel_csr_ucode_suspend(struct drm_i915_private *);
1527 void intel_csr_ucode_resume(struct drm_i915_private *);
1530 bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
1532 bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
1533 struct intel_connector *intel_connector);
1534 void intel_dp_set_link_params(struct intel_dp *intel_dp,
1535 int link_rate, uint8_t lane_count,
1537 int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
1538 int link_rate, uint8_t lane_count);
1539 void intel_dp_start_link_train(struct intel_dp *intel_dp);
1540 void intel_dp_stop_link_train(struct intel_dp *intel_dp);
1541 void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
1542 void intel_dp_encoder_reset(struct drm_encoder *encoder);
1543 void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
1544 void intel_dp_encoder_destroy(struct drm_encoder *encoder);
1545 int intel_dp_sink_crc(struct intel_dp *intel_dp,
1546 struct intel_crtc_state *crtc_state, u8 *crc);
1547 bool intel_dp_compute_config(struct intel_encoder *encoder,
1548 struct intel_crtc_state *pipe_config,
1549 struct drm_connector_state *conn_state);
1550 bool intel_dp_is_edp(struct intel_dp *intel_dp);
1551 bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
1552 enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
1554 void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
1555 const struct drm_connector_state *conn_state);
1556 void intel_edp_backlight_off(const struct drm_connector_state *conn_state);
1557 void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
1558 void intel_edp_panel_on(struct intel_dp *intel_dp);
1559 void intel_edp_panel_off(struct intel_dp *intel_dp);
1560 void intel_dp_mst_suspend(struct drm_device *dev);
1561 void intel_dp_mst_resume(struct drm_device *dev);
1562 int intel_dp_max_link_rate(struct intel_dp *intel_dp);
1563 int intel_dp_max_lane_count(struct intel_dp *intel_dp);
1564 int intel_dp_rate_select(struct intel_dp *intel_dp, int rate);
1565 void intel_dp_hot_plug(struct intel_encoder *intel_encoder);
1566 void intel_power_sequencer_reset(struct drm_i915_private *dev_priv);
1567 uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes);
1568 void intel_plane_destroy(struct drm_plane *plane);
1569 void intel_edp_drrs_enable(struct intel_dp *intel_dp,
1570 const struct intel_crtc_state *crtc_state);
1571 void intel_edp_drrs_disable(struct intel_dp *intel_dp,
1572 const struct intel_crtc_state *crtc_state);
1573 void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
1574 unsigned int frontbuffer_bits);
1575 void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
1576 unsigned int frontbuffer_bits);
1579 intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
1580 uint8_t dp_train_pat);
1582 intel_dp_set_signal_levels(struct intel_dp *intel_dp);
1583 void intel_dp_set_idle_link_train(struct intel_dp *intel_dp);
1585 intel_dp_voltage_max(struct intel_dp *intel_dp);
1587 intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing);
1588 void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
1589 uint8_t *link_bw, uint8_t *rate_select);
1590 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
1592 intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]);
1594 static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
1596 return ~((1 << lane_count) - 1) & 0xf;
1599 bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
1600 int intel_dp_link_required(int pixel_clock, int bpp);
1601 int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
1602 bool intel_digital_port_connected(struct intel_encoder *encoder);
1604 /* intel_dp_aux_backlight.c */
1605 int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
1607 /* intel_dp_mst.c */
1608 int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
1609 void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
1611 void intel_dsi_init(struct drm_i915_private *dev_priv);
1613 /* intel_dsi_dcs_backlight.c */
1614 int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);
1617 void intel_dvo_init(struct drm_i915_private *dev_priv);
1618 /* intel_hotplug.c */
1619 void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
1622 /* legacy fbdev emulation in intel_fbdev.c */
1623 #ifdef CONFIG_DRM_FBDEV_EMULATION
1624 extern int intel_fbdev_init(struct drm_device *dev);
1625 extern void intel_fbdev_initial_config_async(struct drm_device *dev);
1626 extern void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
1627 extern void intel_fbdev_fini(struct drm_i915_private *dev_priv);
1628 extern void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
1629 extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
1630 extern void intel_fbdev_restore_mode(struct drm_device *dev);
1632 static inline int intel_fbdev_init(struct drm_device *dev)
1637 static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
1641 static inline void intel_fbdev_unregister(struct drm_i915_private *dev_priv)
1645 static inline void intel_fbdev_fini(struct drm_i915_private *dev_priv)
1649 static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
1653 static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
1657 static inline void intel_fbdev_restore_mode(struct drm_device *dev)
1663 void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
1664 struct intel_atomic_state *state);
1665 bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
1666 void intel_fbc_pre_update(struct intel_crtc *crtc,
1667 struct intel_crtc_state *crtc_state,
1668 struct intel_plane_state *plane_state);
1669 void intel_fbc_post_update(struct intel_crtc *crtc);
1670 void intel_fbc_init(struct drm_i915_private *dev_priv);
1671 void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv);
1672 void intel_fbc_enable(struct intel_crtc *crtc,
1673 struct intel_crtc_state *crtc_state,
1674 struct intel_plane_state *plane_state);
1675 void intel_fbc_disable(struct intel_crtc *crtc);
1676 void intel_fbc_global_disable(struct drm_i915_private *dev_priv);
1677 void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
1678 unsigned int frontbuffer_bits,
1679 enum fb_op_origin origin);
1680 void intel_fbc_flush(struct drm_i915_private *dev_priv,
1681 unsigned int frontbuffer_bits, enum fb_op_origin origin);
1682 void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
1683 void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv);
1686 void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
1688 void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1689 struct intel_connector *intel_connector);
1690 struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
1691 bool intel_hdmi_compute_config(struct intel_encoder *encoder,
1692 struct intel_crtc_state *pipe_config,
1693 struct drm_connector_state *conn_state);
1694 void intel_hdmi_handle_sink_scrambling(struct intel_encoder *intel_encoder,
1695 struct drm_connector *connector,
1696 bool high_tmds_clock_ratio,
1698 void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
1699 void intel_infoframe_init(struct intel_digital_port *intel_dig_port);
1703 void intel_lvds_init(struct drm_i915_private *dev_priv);
1704 struct intel_encoder *intel_get_lvds_encoder(struct drm_device *dev);
1705 bool intel_is_dual_link_lvds(struct drm_device *dev);
1709 int intel_connector_update_modes(struct drm_connector *connector,
1711 int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
1712 void intel_attach_force_audio_property(struct drm_connector *connector);
1713 void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
1714 void intel_attach_aspect_ratio_property(struct drm_connector *connector);
1717 /* intel_overlay.c */
1718 void intel_setup_overlay(struct drm_i915_private *dev_priv);
1719 void intel_cleanup_overlay(struct drm_i915_private *dev_priv);
1720 int intel_overlay_switch_off(struct intel_overlay *overlay);
1721 int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
1722 struct drm_file *file_priv);
1723 int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
1724 struct drm_file *file_priv);
1725 void intel_overlay_reset(struct drm_i915_private *dev_priv);
1729 int intel_panel_init(struct intel_panel *panel,
1730 struct drm_display_mode *fixed_mode,
1731 struct drm_display_mode *alt_fixed_mode,
1732 struct drm_display_mode *downclock_mode);
1733 void intel_panel_fini(struct intel_panel *panel);
1734 void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
1735 struct drm_display_mode *adjusted_mode);
1736 void intel_pch_panel_fitting(struct intel_crtc *crtc,
1737 struct intel_crtc_state *pipe_config,
1739 void intel_gmch_panel_fitting(struct intel_crtc *crtc,
1740 struct intel_crtc_state *pipe_config,
1742 void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
1743 u32 level, u32 max);
1744 int intel_panel_setup_backlight(struct drm_connector *connector,
1746 void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
1747 const struct drm_connector_state *conn_state);
1748 void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
1749 void intel_panel_destroy_backlight(struct drm_connector *connector);
1750 enum drm_connector_status intel_panel_detect(struct drm_i915_private *dev_priv);
1751 extern struct drm_display_mode *intel_find_panel_downclock(
1752 struct drm_i915_private *dev_priv,
1753 struct drm_display_mode *fixed_mode,
1754 struct drm_connector *connector);
1756 #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
1757 int intel_backlight_device_register(struct intel_connector *connector);
1758 void intel_backlight_device_unregister(struct intel_connector *connector);
1759 #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
1760 static inline int intel_backlight_device_register(struct intel_connector *connector)
1764 static inline void intel_backlight_device_unregister(struct intel_connector *connector)
1767 #endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
1771 #define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
1772 void intel_psr_enable(struct intel_dp *intel_dp,
1773 const struct intel_crtc_state *crtc_state);
1774 void intel_psr_disable(struct intel_dp *intel_dp,
1775 const struct intel_crtc_state *old_crtc_state);
1776 void intel_psr_invalidate(struct drm_i915_private *dev_priv,
1777 unsigned frontbuffer_bits);
1778 void intel_psr_flush(struct drm_i915_private *dev_priv,
1779 unsigned frontbuffer_bits,
1780 enum fb_op_origin origin);
1781 void intel_psr_init(struct drm_i915_private *dev_priv);
1782 void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
1783 unsigned frontbuffer_bits);
1784 void intel_psr_compute_config(struct intel_dp *intel_dp,
1785 struct intel_crtc_state *crtc_state);
1787 /* intel_runtime_pm.c */
1788 int intel_power_domains_init(struct drm_i915_private *);
1789 void intel_power_domains_fini(struct drm_i915_private *);
1790 void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume);
1791 void intel_power_domains_suspend(struct drm_i915_private *dev_priv);
1792 void intel_power_domains_verify_state(struct drm_i915_private *dev_priv);
1793 void bxt_display_core_init(struct drm_i915_private *dev_priv, bool resume);
1794 void bxt_display_core_uninit(struct drm_i915_private *dev_priv);
1795 void intel_runtime_pm_enable(struct drm_i915_private *dev_priv);
1797 intel_display_power_domain_str(enum intel_display_power_domain domain);
1799 bool intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
1800 enum intel_display_power_domain domain);
1801 bool __intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
1802 enum intel_display_power_domain domain);
1803 void intel_display_power_get(struct drm_i915_private *dev_priv,
1804 enum intel_display_power_domain domain);
1805 bool intel_display_power_get_if_enabled(struct drm_i915_private *dev_priv,
1806 enum intel_display_power_domain domain);
1807 void intel_display_power_put(struct drm_i915_private *dev_priv,
1808 enum intel_display_power_domain domain);
1811 assert_rpm_device_not_suspended(struct drm_i915_private *dev_priv)
1813 WARN_ONCE(dev_priv->runtime_pm.suspended,
1814 "Device suspended during HW access\n");
1818 assert_rpm_wakelock_held(struct drm_i915_private *dev_priv)
1820 assert_rpm_device_not_suspended(dev_priv);
1821 WARN_ONCE(!atomic_read(&dev_priv->runtime_pm.wakeref_count),
1822 "RPM wakelock ref not held during HW access");
1826 * disable_rpm_wakeref_asserts - disable the RPM assert checks
1827 * @dev_priv: i915 device instance
1829 * This function disable asserts that check if we hold an RPM wakelock
1830 * reference, while keeping the device-not-suspended checks still enabled.
1831 * It's meant to be used only in special circumstances where our rule about
1832 * the wakelock refcount wrt. the device power state doesn't hold. According
1833 * to this rule at any point where we access the HW or want to keep the HW in
1834 * an active state we must hold an RPM wakelock reference acquired via one of
1835 * the intel_runtime_pm_get() helpers. Currently there are a few special spots
1836 * where this rule doesn't hold: the IRQ and suspend/resume handlers, the
1837 * forcewake release timer, and the GPU RPS and hangcheck works. All other
1838 * users should avoid using this function.
1840 * Any calls to this function must have a symmetric call to
1841 * enable_rpm_wakeref_asserts().
1844 disable_rpm_wakeref_asserts(struct drm_i915_private *dev_priv)
1846 atomic_inc(&dev_priv->runtime_pm.wakeref_count);
1850 * enable_rpm_wakeref_asserts - re-enable the RPM assert checks
1851 * @dev_priv: i915 device instance
1853 * This function re-enables the RPM assert checks after disabling them with
1854 * disable_rpm_wakeref_asserts. It's meant to be used only in special
1855 * circumstances otherwise its use should be avoided.
1857 * Any calls to this function must have a symmetric call to
1858 * disable_rpm_wakeref_asserts().
1861 enable_rpm_wakeref_asserts(struct drm_i915_private *dev_priv)
1863 atomic_dec(&dev_priv->runtime_pm.wakeref_count);
1866 void intel_runtime_pm_get(struct drm_i915_private *dev_priv);
1867 bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv);
1868 void intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv);
1869 void intel_runtime_pm_put(struct drm_i915_private *dev_priv);
1871 void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
1873 void chv_phy_powergate_lanes(struct intel_encoder *encoder,
1874 bool override, unsigned int mask);
1875 bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,
1876 enum dpio_channel ch, bool override);
1880 void intel_init_clock_gating(struct drm_i915_private *dev_priv);
1881 void intel_suspend_hw(struct drm_i915_private *dev_priv);
1882 int ilk_wm_max_level(const struct drm_i915_private *dev_priv);
1883 void intel_update_watermarks(struct intel_crtc *crtc);
1884 void intel_init_pm(struct drm_i915_private *dev_priv);
1885 void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv);
1886 void intel_pm_setup(struct drm_i915_private *dev_priv);
1887 void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
1888 void intel_gpu_ips_teardown(void);
1889 void intel_init_gt_powersave(struct drm_i915_private *dev_priv);
1890 void intel_cleanup_gt_powersave(struct drm_i915_private *dev_priv);
1891 void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv);
1892 void intel_enable_gt_powersave(struct drm_i915_private *dev_priv);
1893 void intel_disable_gt_powersave(struct drm_i915_private *dev_priv);
1894 void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv);
1895 void gen6_rps_busy(struct drm_i915_private *dev_priv);
1896 void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
1897 void gen6_rps_idle(struct drm_i915_private *dev_priv);
1898 void gen6_rps_boost(struct i915_request *rq, struct intel_rps_client *rps);
1899 void g4x_wm_get_hw_state(struct drm_device *dev);
1900 void vlv_wm_get_hw_state(struct drm_device *dev);
1901 void ilk_wm_get_hw_state(struct drm_device *dev);
1902 void skl_wm_get_hw_state(struct drm_device *dev);
1903 void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
1904 struct skl_ddb_allocation *ddb /* out */);
1905 void skl_pipe_wm_get_hw_state(struct drm_crtc *crtc,
1906 struct skl_pipe_wm *out);
1907 void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
1908 void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
1909 bool intel_can_enable_sagv(struct drm_atomic_state *state);
1910 int intel_enable_sagv(struct drm_i915_private *dev_priv);
1911 int intel_disable_sagv(struct drm_i915_private *dev_priv);
1912 bool skl_wm_level_equals(const struct skl_wm_level *l1,
1913 const struct skl_wm_level *l2);
1914 bool skl_ddb_allocation_overlaps(struct drm_i915_private *dev_priv,
1915 const struct skl_ddb_entry **entries,
1916 const struct skl_ddb_entry *ddb,
1918 bool ilk_disable_lp_wm(struct drm_device *dev);
1919 int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
1920 struct intel_crtc_state *cstate);
1921 void intel_init_ipc(struct drm_i915_private *dev_priv);
1922 void intel_enable_ipc(struct drm_i915_private *dev_priv);
1925 bool intel_sdvo_init(struct drm_i915_private *dev_priv,
1926 i915_reg_t reg, enum port port);
1929 /* intel_sprite.c */
1930 int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
1932 struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
1933 enum pipe pipe, int plane);
1934 int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
1935 struct drm_file *file_priv);
1936 void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state);
1937 void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
1938 void skl_update_plane(struct intel_plane *plane,
1939 const struct intel_crtc_state *crtc_state,
1940 const struct intel_plane_state *plane_state);
1941 void skl_disable_plane(struct intel_plane *plane, struct intel_crtc *crtc);
1942 bool skl_plane_get_hw_state(struct intel_plane *plane);
1943 bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
1944 enum pipe pipe, enum plane_id plane_id);
1947 void intel_tv_init(struct drm_i915_private *dev_priv);
1949 /* intel_atomic.c */
1950 int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
1951 const struct drm_connector_state *state,
1952 struct drm_property *property,
1954 int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
1955 struct drm_connector_state *state,
1956 struct drm_property *property,
1958 int intel_digital_connector_atomic_check(struct drm_connector *conn,
1959 struct drm_connector_state *new_state);
1960 struct drm_connector_state *
1961 intel_digital_connector_duplicate_state(struct drm_connector *connector);
1963 struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc *crtc);
1964 void intel_crtc_destroy_state(struct drm_crtc *crtc,
1965 struct drm_crtc_state *state);
1966 struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev);
1967 void intel_atomic_state_clear(struct drm_atomic_state *);
1969 static inline struct intel_crtc_state *
1970 intel_atomic_get_crtc_state(struct drm_atomic_state *state,
1971 struct intel_crtc *crtc)
1973 struct drm_crtc_state *crtc_state;
1974 crtc_state = drm_atomic_get_crtc_state(state, &crtc->base);
1975 if (IS_ERR(crtc_state))
1976 return ERR_CAST(crtc_state);
1978 return to_intel_crtc_state(crtc_state);
1981 static inline struct intel_crtc_state *
1982 intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
1983 struct intel_crtc *crtc)
1985 struct drm_crtc_state *crtc_state;
1987 crtc_state = drm_atomic_get_existing_crtc_state(state, &crtc->base);
1990 return to_intel_crtc_state(crtc_state);
1995 static inline struct intel_plane_state *
1996 intel_atomic_get_existing_plane_state(struct drm_atomic_state *state,
1997 struct intel_plane *plane)
1999 struct drm_plane_state *plane_state;
2001 plane_state = drm_atomic_get_existing_plane_state(state, &plane->base);
2003 return to_intel_plane_state(plane_state);
2006 int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
2007 struct intel_crtc *intel_crtc,
2008 struct intel_crtc_state *crtc_state);
2010 /* intel_atomic_plane.c */
2011 struct intel_plane_state *intel_create_plane_state(struct drm_plane *plane);
2012 struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
2013 void intel_plane_destroy_state(struct drm_plane *plane,
2014 struct drm_plane_state *state);
2015 extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
2016 int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
2017 struct intel_crtc_state *crtc_state,
2018 const struct intel_plane_state *old_plane_state,
2019 struct intel_plane_state *intel_state);
2022 void intel_color_init(struct drm_crtc *crtc);
2023 int intel_color_check(struct drm_crtc *crtc, struct drm_crtc_state *state);
2024 void intel_color_set_csc(struct drm_crtc_state *crtc_state);
2025 void intel_color_load_luts(struct drm_crtc_state *crtc_state);
2027 /* intel_lspcon.c */
2028 bool lspcon_init(struct intel_digital_port *intel_dig_port);
2029 void lspcon_resume(struct intel_lspcon *lspcon);
2030 void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
2032 /* intel_pipe_crc.c */
2033 int intel_pipe_crc_create(struct drm_minor *minor);
2034 #ifdef CONFIG_DEBUG_FS
2035 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name,
2036 size_t *values_cnt);
2038 #define intel_crtc_set_crc_source NULL
2040 extern const struct file_operations i915_display_crc_ctl_fops;
2041 #endif /* __INTEL_DRV_H__ */