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/sched/clock.h>
32 #include <drm/drm_atomic.h>
33 #include <drm/drm_crtc.h>
34 #include <drm/drm_dp_dual_mode_helper.h>
35 #include <drm/drm_dp_mst_helper.h>
36 #include <drm/drm_encoder.h>
37 #include <drm/drm_fb_helper.h>
38 #include <drm/drm_probe_helper.h>
39 #include <drm/drm_rect.h>
40 #include <drm/drm_vblank.h>
41 #include <drm/i915_drm.h>
42 #include <drm/i915_mei_hdcp_interface.h>
43 #include <media/cec-notifier.h>
50 * Display related stuff
53 /* these are outputs from the chip - integrated only
54 external chips are via DVO or SDVO output */
55 enum intel_output_type {
56 INTEL_OUTPUT_UNUSED = 0,
57 INTEL_OUTPUT_ANALOG = 1,
59 INTEL_OUTPUT_SDVO = 3,
60 INTEL_OUTPUT_LVDS = 4,
61 INTEL_OUTPUT_TVOUT = 5,
62 INTEL_OUTPUT_HDMI = 6,
66 INTEL_OUTPUT_DDI = 10,
67 INTEL_OUTPUT_DP_MST = 11,
70 struct intel_framebuffer {
71 struct drm_framebuffer base;
72 struct intel_rotation_info rot_info;
74 /* for each plane in the normal GTT view */
78 /* for each plane in the rotated GTT view */
81 unsigned int pitch; /* pixels */
86 struct drm_fb_helper helper;
87 struct intel_framebuffer *fb;
89 unsigned long vma_flags;
90 async_cookie_t cookie;
93 /* Whether or not fbdev hpd processing is temporarily suspended */
94 bool hpd_suspended : 1;
95 /* Set when a hotplug was received while HPD processing was
100 /* Protects hpd_suspended */
101 struct mutex hpd_lock;
104 struct intel_encoder {
105 struct drm_encoder base;
107 enum intel_output_type type;
109 unsigned int cloneable;
110 bool (*hotplug)(struct intel_encoder *encoder,
111 struct intel_connector *connector);
112 enum intel_output_type (*compute_output_type)(struct intel_encoder *,
113 struct intel_crtc_state *,
114 struct drm_connector_state *);
115 int (*compute_config)(struct intel_encoder *,
116 struct intel_crtc_state *,
117 struct drm_connector_state *);
118 void (*update_prepare)(struct intel_atomic_state *,
119 struct intel_encoder *,
120 struct intel_crtc *);
121 void (*pre_pll_enable)(struct intel_encoder *,
122 const struct intel_crtc_state *,
123 const struct drm_connector_state *);
124 void (*pre_enable)(struct intel_encoder *,
125 const struct intel_crtc_state *,
126 const struct drm_connector_state *);
127 void (*enable)(struct intel_encoder *,
128 const struct intel_crtc_state *,
129 const struct drm_connector_state *);
130 void (*update_complete)(struct intel_atomic_state *,
131 struct intel_encoder *,
132 struct intel_crtc *);
133 void (*disable)(struct intel_encoder *,
134 const struct intel_crtc_state *,
135 const struct drm_connector_state *);
136 void (*post_disable)(struct intel_encoder *,
137 const struct intel_crtc_state *,
138 const struct drm_connector_state *);
139 void (*post_pll_disable)(struct intel_encoder *,
140 const struct intel_crtc_state *,
141 const struct drm_connector_state *);
142 void (*update_pipe)(struct intel_encoder *,
143 const struct intel_crtc_state *,
144 const struct drm_connector_state *);
145 /* Read out the current hw state of this connector, returning true if
146 * the encoder is active. If the encoder is enabled it also set the pipe
147 * it is connected to in the pipe parameter. */
148 bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe);
149 /* Reconstructs the equivalent mode flags for the current hardware
150 * state. This must be called _after_ display->get_pipe_config has
151 * pre-filled the pipe config. Note that intel_encoder->base.crtc must
152 * be set correctly before calling this function. */
153 void (*get_config)(struct intel_encoder *,
154 struct intel_crtc_state *pipe_config);
156 * Acquires the power domains needed for an active encoder during
157 * hardware state readout.
159 void (*get_power_domains)(struct intel_encoder *encoder,
160 struct intel_crtc_state *crtc_state);
162 * Called during system suspend after all pending requests for the
163 * encoder are flushed (for example for DP AUX transactions) and
164 * device interrupts are disabled.
166 void (*suspend)(struct intel_encoder *);
168 enum hpd_pin hpd_pin;
169 enum intel_display_power_domain power_domain;
170 /* for communication with audio component; protected by av_mutex */
171 const struct drm_connector *audio_connector;
175 struct drm_display_mode *fixed_mode;
176 struct drm_display_mode *downclock_mode;
185 bool combination_mode; /* gen 2/4 only */
187 bool alternate_pwm_increment; /* lpt+ */
190 bool util_pin_active_low; /* bxt+ */
191 u8 controller; /* bxt+ only */
192 struct pwm_device *pwm;
194 struct backlight_device *device;
196 /* Connector and platform specific backlight functions */
197 int (*setup)(struct intel_connector *connector, enum pipe pipe);
198 u32 (*get)(struct intel_connector *connector);
199 void (*set)(const struct drm_connector_state *conn_state, u32 level);
200 void (*disable)(const struct drm_connector_state *conn_state);
201 void (*enable)(const struct intel_crtc_state *crtc_state,
202 const struct drm_connector_state *conn_state);
203 u32 (*hz_to_pwm)(struct intel_connector *connector, u32 hz);
204 void (*power)(struct intel_connector *, bool enable);
208 struct intel_digital_port;
210 enum check_link_response {
211 HDCP_LINK_PROTECTED = 0,
212 HDCP_TOPOLOGY_CHANGE,
213 HDCP_LINK_INTEGRITY_FAILURE,
218 * This structure serves as a translation layer between the generic HDCP code
219 * and the bus-specific code. What that means is that HDCP over HDMI differs
220 * from HDCP over DP, so to account for these differences, we need to
221 * communicate with the receiver through this shim.
223 * For completeness, the 2 buses differ in the following ways:
225 * HDCP registers on the receiver are set via DP AUX for DP, and
226 * they are set via DDC for HDMI.
227 * - Receiver register offsets
228 * The offsets of the registers are different for DP vs. HDMI
229 * - Receiver register masks/offsets
230 * For instance, the ready bit for the KSV fifo is in a different
231 * place on DP vs HDMI
232 * - Receiver register names
233 * Seriously. In the DP spec, the 16-bit register containing
234 * downstream information is called BINFO, on HDMI it's called
235 * BSTATUS. To confuse matters further, DP has a BSTATUS register
236 * with a completely different definition.
238 * On HDMI, the ksv fifo is read all at once, whereas on DP it must
239 * be read 3 keys at a time
241 * Since Aksv is hidden in hardware, there's different procedures
242 * to send it over DP AUX vs DDC
244 struct intel_hdcp_shim {
245 /* Outputs the transmitter's An and Aksv values to the receiver. */
246 int (*write_an_aksv)(struct intel_digital_port *intel_dig_port, u8 *an);
248 /* Reads the receiver's key selection vector */
249 int (*read_bksv)(struct intel_digital_port *intel_dig_port, u8 *bksv);
252 * Reads BINFO from DP receivers and BSTATUS from HDMI receivers. The
253 * definitions are the same in the respective specs, but the names are
254 * different. Call it BSTATUS since that's the name the HDMI spec
255 * uses and it was there first.
257 int (*read_bstatus)(struct intel_digital_port *intel_dig_port,
260 /* Determines whether a repeater is present downstream */
261 int (*repeater_present)(struct intel_digital_port *intel_dig_port,
262 bool *repeater_present);
264 /* Reads the receiver's Ri' value */
265 int (*read_ri_prime)(struct intel_digital_port *intel_dig_port, u8 *ri);
267 /* Determines if the receiver's KSV FIFO is ready for consumption */
268 int (*read_ksv_ready)(struct intel_digital_port *intel_dig_port,
271 /* Reads the ksv fifo for num_downstream devices */
272 int (*read_ksv_fifo)(struct intel_digital_port *intel_dig_port,
273 int num_downstream, u8 *ksv_fifo);
275 /* Reads a 32-bit part of V' from the receiver */
276 int (*read_v_prime_part)(struct intel_digital_port *intel_dig_port,
279 /* Enables HDCP signalling on the port */
280 int (*toggle_signalling)(struct intel_digital_port *intel_dig_port,
283 /* Ensures the link is still protected */
284 bool (*check_link)(struct intel_digital_port *intel_dig_port);
286 /* Detects panel's hdcp capability. This is optional for HDMI. */
287 int (*hdcp_capable)(struct intel_digital_port *intel_dig_port,
290 /* HDCP adaptation(DP/HDMI) required on the port */
291 enum hdcp_wired_protocol protocol;
293 /* Detects whether sink is HDCP2.2 capable */
294 int (*hdcp_2_2_capable)(struct intel_digital_port *intel_dig_port,
297 /* Write HDCP2.2 messages */
298 int (*write_2_2_msg)(struct intel_digital_port *intel_dig_port,
299 void *buf, size_t size);
301 /* Read HDCP2.2 messages */
302 int (*read_2_2_msg)(struct intel_digital_port *intel_dig_port,
303 u8 msg_id, void *buf, size_t size);
306 * Implementation of DP HDCP2.2 Errata for the communication of stream
307 * type to Receivers. In DP HDCP2.2 Stream type is one of the input to
308 * the HDCP2.2 Cipher for En/De-Cryption. Not applicable for HDMI.
310 int (*config_stream_type)(struct intel_digital_port *intel_dig_port,
311 bool is_repeater, u8 type);
313 /* HDCP2.2 Link Integrity Check */
314 int (*check_2_2_link)(struct intel_digital_port *intel_dig_port);
318 const struct intel_hdcp_shim *shim;
319 /* Mutex for hdcp state of the connector */
322 struct delayed_work check_work;
323 struct work_struct prop_work;
325 /* HDCP1.4 Encryption status */
328 /* HDCP2.2 related definitions */
329 /* Flag indicates whether this connector supports HDCP2.2 or not. */
330 bool hdcp2_supported;
332 /* HDCP2.2 Encryption status */
333 bool hdcp2_encrypted;
336 * Content Stream Type defined by content owner. TYPE0(0x0) content can
337 * flow in the link protected by HDCP2.2 or HDCP1.4, where as TYPE1(0x1)
338 * content can flow only through a link protected by HDCP2.2.
341 struct hdcp_port_data port_data;
347 * Count of ReceiverID_List received. Initialized to 0 at AKE_INIT.
348 * Incremented after processing the RepeaterAuth_Send_ReceiverID_List.
349 * When it rolls over re-auth has to be triggered.
354 * Count of RepeaterAuth_Stream_Manage msg propagated.
355 * Initialized to 0 on AKE_INIT. Incremented after every successful
356 * transmission of RepeaterAuth_Stream_Manage message. When it rolls
357 * over re-Auth has to be triggered.
362 * Work queue to signal the CP_IRQ. Used for the waiters to read the
363 * available information from HDCP DP sink.
365 wait_queue_head_t cp_irq_queue;
366 atomic_t cp_irq_count;
367 int cp_irq_count_cached;
370 struct intel_connector {
371 struct drm_connector base;
373 * The fixed encoder this connector is connected to.
375 struct intel_encoder *encoder;
377 /* ACPI device id for ACPI and driver cooperation */
380 /* Reads out the current hw, returning true if the connector is enabled
381 * and active (i.e. dpms ON state). */
382 bool (*get_hw_state)(struct intel_connector *);
384 /* Panel info for eDP and LVDS */
385 struct intel_panel panel;
387 /* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */
389 struct edid *detect_edid;
391 /* since POLL and HPD connectors may use the same HPD line keep the native
392 state of connector->polled in case hotplug storm detection changes it */
395 void *port; /* store this opaque as its illegal to dereference it */
397 struct intel_dp *mst_port;
399 /* Work struct to schedule a uevent on link train failure */
400 struct work_struct modeset_retry_work;
402 struct intel_hdcp hdcp;
405 struct intel_digital_connector_state {
406 struct drm_connector_state base;
408 enum hdmi_force_audio force_audio;
412 #define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base)
426 struct intel_atomic_state {
427 struct drm_atomic_state base;
429 intel_wakeref_t wakeref;
433 * Logical state of cdclk (used for all scaling, watermark,
434 * etc. calculations and checks). This is computed as if all
435 * enabled crtcs were active.
437 struct intel_cdclk_state logical;
440 * Actual state of cdclk, can be different from the logical
441 * state only when all crtc's are DPMS off.
443 struct intel_cdclk_state actual;
446 bool force_min_cdclk_changed;
447 /* pipe to which cd2x update is synchronized */
451 bool dpll_set, modeset;
454 * Does this transaction change the pipes that are active? This mask
455 * tracks which CRTC's have changed their active state at the end of
456 * the transaction (not counting the temporary disable during modesets).
457 * This mask should only be non-zero when intel_state->modeset is true,
458 * but the converse is not necessarily true; simply changing a mode may
459 * not flip the final active status of any CRTC's
461 unsigned int active_pipe_changes;
463 unsigned int active_crtcs;
464 /* minimum acceptable cdclk for each pipe */
465 int min_cdclk[I915_MAX_PIPES];
466 /* minimum acceptable voltage level for each pipe */
467 u8 min_voltage_level[I915_MAX_PIPES];
469 struct intel_shared_dpll_state shared_dpll[I915_NUM_PLLS];
472 * Current watermarks can't be trusted during hardware readout, so
473 * don't bother calculating intermediate watermarks.
475 bool skip_intermediate_wm;
477 bool rps_interactive;
480 struct skl_ddb_values wm_results;
482 struct i915_sw_fence commit_ready;
484 struct llist_node freed;
487 struct intel_plane_state {
488 struct drm_plane_state base;
489 struct i915_ggtt_view view;
490 struct i915_vma *vma;
492 #define PLANE_HAS_FENCE BIT(0)
498 * bytes for 0/180 degree rotation
499 * pixels for 90/270 degree rotation
505 /* plane control register */
508 /* plane color control register */
513 * = -1 : not using a scaler
514 * >= 0 : using a scalers
516 * plane requiring a scaler:
517 * - During check_plane, its bit is set in
518 * crtc_state->scaler_state.scaler_users by calling helper function
519 * update_scaler_plane.
520 * - scaler_id indicates the scaler it got assigned.
522 * plane doesn't require a scaler:
523 * - this can happen when scaling is no more required or plane simply
525 * - During check_plane, corresponding bit is reset in
526 * crtc_state->scaler_state.scaler_users by calling helper function
527 * update_scaler_plane.
534 * ICL planar formats require 2 planes that are updated as pairs.
535 * This member is used to make sure the other plane is also updated
536 * when required, and for update_slave() to find the correct
537 * plane_state to pass as argument.
539 struct intel_plane *linked_plane;
543 * If set don't update use the linked plane's state for updating
544 * this plane during atomic commit with the update_slave() callback.
546 * It's also used by the watermark code to ignore wm calculations on
547 * this plane. They're calculated by the linked plane's wm code.
551 struct drm_intel_sprite_colorkey ckey;
554 struct intel_initial_plane_config {
555 struct intel_framebuffer *fb;
562 struct intel_scaler {
567 struct intel_crtc_scaler_state {
568 #define SKL_NUM_SCALERS 2
569 struct intel_scaler scalers[SKL_NUM_SCALERS];
572 * scaler_users: keeps track of users requesting scalers on this crtc.
574 * If a bit is set, a user is using a scaler.
575 * Here user can be a plane or crtc as defined below:
576 * bits 0-30 - plane (bit position is index from drm_plane_index)
579 * Instead of creating a new index to cover planes and crtc, using
580 * existing drm_plane_index for planes which is well less than 31
581 * planes and bit 31 for crtc. This should be fine to cover all
584 * intel_atomic_setup_scalers will setup available scalers to users
585 * requesting scalers. It will gracefully fail if request exceeds
588 #define SKL_CRTC_INDEX 31
589 unsigned scaler_users;
591 /* scaler used by crtc for panel fitting purpose */
595 /* drm_mode->private_flags */
596 #define I915_MODE_FLAG_INHERITED (1<<0)
597 /* Flag to get scanline using frame time stamps */
598 #define I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP (1<<1)
599 /* Flag to use the scanline counter instead of the pixel counter */
600 #define I915_MODE_FLAG_USE_SCANLINE_COUNTER (1<<2)
602 struct intel_pipe_wm {
603 struct intel_wm_level wm[5];
607 bool sprites_enabled;
611 struct skl_plane_wm {
612 struct skl_wm_level wm[8];
613 struct skl_wm_level uv_wm[8];
614 struct skl_wm_level trans_wm;
619 struct skl_plane_wm planes[I915_MAX_PLANES];
626 VLV_WM_LEVEL_DDR_DVFS,
630 struct vlv_wm_state {
631 struct g4x_pipe_wm wm[NUM_VLV_WM_LEVELS];
632 struct g4x_sr_wm sr[NUM_VLV_WM_LEVELS];
637 struct vlv_fifo_state {
638 u16 plane[I915_MAX_PLANES];
648 struct g4x_wm_state {
649 struct g4x_pipe_wm wm;
651 struct g4x_sr_wm hpll;
657 struct intel_crtc_wm_state {
661 * Intermediate watermarks; these can be
662 * programmed immediately since they satisfy
663 * both the current configuration we're
664 * switching away from and the new
665 * configuration we're switching to.
667 struct intel_pipe_wm intermediate;
670 * Optimal watermarks, programmed post-vblank
671 * when this state is committed.
673 struct intel_pipe_wm optimal;
677 /* gen9+ only needs 1-step wm programming */
678 struct skl_pipe_wm optimal;
679 struct skl_ddb_entry ddb;
680 struct skl_ddb_entry plane_ddb_y[I915_MAX_PLANES];
681 struct skl_ddb_entry plane_ddb_uv[I915_MAX_PLANES];
685 /* "raw" watermarks (not inverted) */
686 struct g4x_pipe_wm raw[NUM_VLV_WM_LEVELS];
687 /* intermediate watermarks (inverted) */
688 struct vlv_wm_state intermediate;
689 /* optimal watermarks (inverted) */
690 struct vlv_wm_state optimal;
691 /* display FIFO split */
692 struct vlv_fifo_state fifo_state;
696 /* "raw" watermarks */
697 struct g4x_pipe_wm raw[NUM_G4X_WM_LEVELS];
698 /* intermediate watermarks */
699 struct g4x_wm_state intermediate;
700 /* optimal watermarks */
701 struct g4x_wm_state optimal;
706 * Platforms with two-step watermark programming will need to
707 * update watermark programming post-vblank to switch from the
708 * safe intermediate watermarks to the optimal final
711 bool need_postvbl_update;
714 enum intel_output_format {
715 INTEL_OUTPUT_FORMAT_INVALID,
716 INTEL_OUTPUT_FORMAT_RGB,
717 INTEL_OUTPUT_FORMAT_YCBCR420,
718 INTEL_OUTPUT_FORMAT_YCBCR444,
721 struct intel_crtc_state {
722 struct drm_crtc_state base;
725 * quirks - bitfield with hw state readout quirks
727 * For various reasons the hw state readout code might not be able to
728 * completely faithfully read out the current state. These cases are
729 * tracked with quirk flags so that fastboot and state checker can act
732 #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
733 unsigned long quirks;
735 unsigned fb_bits; /* framebuffers to flip */
736 bool update_pipe; /* can a fast modeset be performed? */
738 bool update_wm_pre, update_wm_post; /* watermarks are updated */
739 bool fb_changed; /* fb on any of the planes is changed */
740 bool fifo_changed; /* FIFO split is changed */
742 /* Pipe source size (ie. panel fitter input size)
743 * All planes will be positioned inside this space,
744 * and get clipped at the edges. */
745 int pipe_src_w, pipe_src_h;
748 * Pipe pixel rate, adjusted for
749 * panel fitter/pipe scaler downscaling.
751 unsigned int pixel_rate;
753 /* Whether to set up the PCH/FDI. Note that we never allow sharing
754 * between pch encoders and cpu encoders. */
755 bool has_pch_encoder;
757 /* Are we sending infoframes on the attached port */
760 /* CPU Transcoder for the pipe. Currently this can only differ from the
761 * pipe on Haswell and later (where we have a special eDP transcoder)
762 * and Broxton (where we have special DSI transcoders). */
763 enum transcoder cpu_transcoder;
766 * Use reduced/limited/broadcast rbg range, compressing from the full
767 * range fed into the crtcs.
769 bool limited_color_range;
771 /* Bitmask of encoder types (enum intel_output_type)
772 * driven by the pipe.
774 unsigned int output_types;
776 /* Whether we should send NULL infoframes. Required for audio. */
779 /* Audio enabled on this pipe. Only valid if either has_hdmi_sink or
780 * has_dp_encoder is set. */
784 * Enable dithering, used when the selected pipe bpp doesn't match the
790 * Dither gets enabled for 18bpp which causes CRC mismatch errors for
791 * compliance video pattern tests.
792 * Disable dither only if it is a compliance test request for
795 bool dither_force_disable;
797 /* Controls for the clock computation, to override various stages. */
800 /* SDVO TV has a bunch of special case. To make multifunction encoders
801 * work correctly, we need to track this at runtime.*/
805 * crtc bandwidth limit, don't increase pipe bpp or clock if not really
806 * required. This is set in the 2nd loop of calling encoder's
807 * ->compute_config if the first pick doesn't work out.
811 /* Settings for the intel dpll used on pretty much everything but
815 /* Selected dpll when shared or NULL. */
816 struct intel_shared_dpll *shared_dpll;
818 /* Actual register state of the dpll, for shared dpll cross-checking. */
819 struct intel_dpll_hw_state dpll_hw_state;
822 * ICL reserved DPLLs for the CRTC/port. The active PLL is selected by
823 * setting shared_dpll and dpll_hw_state to one of these reserved ones.
825 struct icl_port_dpll {
826 struct intel_shared_dpll *pll;
827 struct intel_dpll_hw_state hw_state;
828 } icl_port_dplls[ICL_PORT_DPLL_COUNT];
830 /* DSI PLL registers */
836 struct intel_link_m_n dp_m_n;
838 /* m2_n2 for eDP downclock */
839 struct intel_link_m_n dp_m2_n2;
846 * Frequence the dpll for the port should run at. Differs from the
847 * adjusted dotclock e.g. for DP or 12bpc hdmi mode. This is also
848 * already multiplied by pixel_multiplier.
852 /* Used by SDVO (and if we ever fix it, HDMI). */
853 unsigned pixel_multiplier;
858 * Used by platforms having DP/HDMI PHY with programmable lane
859 * latency optimization.
861 u8 lane_lat_optim_mask;
863 /* minimum acceptable voltage level */
864 u8 min_voltage_level;
866 /* Panel fitter controls for gen2-gen4 + VLV */
870 u32 lvds_border_bits;
873 /* Panel fitter placement and size for Ironlake+ */
881 /* FDI configuration, only valid if has_pch_encoder is set. */
883 struct intel_link_m_n fdi_m_n;
895 struct intel_crtc_scaler_state scaler_state;
897 /* w/a for waiting 2 vblanks during crtc enable */
898 enum pipe hsw_workaround_pipe;
900 /* IVB sprite scaling w/a (WaCxSRDisabledForSpriteScaling:ivb) */
903 struct intel_crtc_wm_state wm;
905 u32 data_rate[I915_MAX_PLANES];
907 /* Gamma mode programmed on the pipe */
911 /* CSC mode programmed on the pipe */
918 /* bitmask of visible planes (enum plane_id) */
923 /* bitmask of planes that will be updated during the commit */
929 union hdmi_infoframe avi;
930 union hdmi_infoframe spd;
931 union hdmi_infoframe hdmi;
932 union hdmi_infoframe drm;
935 /* HDMI scrambling status */
936 bool hdmi_scrambling;
938 /* HDMI High TMDS char rate ratio */
939 bool hdmi_high_tmds_clock_ratio;
941 /* Output format RGB/YCBCR etc */
942 enum intel_output_format output_format;
944 /* Output down scaling is done in LSPCON device */
945 bool lspcon_downsampling;
947 /* enable pipe gamma? */
950 /* enable pipe csc? */
953 /* Display Stream compression state */
955 bool compression_enable;
960 struct drm_dsc_config dp_dsc_cfg;
962 /* Forward Error correction State */
967 struct drm_crtc base;
970 * Whether the crtc and the connected output pipeline is active. Implies
971 * that crtc->enabled is set, i.e. the current mode configuration has
972 * some outputs connected to this crtc.
976 unsigned long long enabled_power_domains;
977 struct intel_overlay *overlay;
979 struct intel_crtc_state *config;
981 /* Access to these should be protected by dev_priv->irq_lock. */
982 bool cpu_fifo_underrun_disabled;
983 bool pch_fifo_underrun_disabled;
985 /* per-pipe watermark state */
987 /* watermarks currently being used */
989 struct intel_pipe_wm ilk;
990 struct vlv_wm_state vlv;
991 struct g4x_wm_state g4x;
998 unsigned start_vbl_count;
999 ktime_t start_vbl_time;
1000 int min_vbl, max_vbl;
1004 /* scalers available on this crtc */
1008 struct intel_plane {
1009 struct drm_plane base;
1010 enum i9xx_plane_id i9xx_plane;
1015 u32 frontbuffer_bit;
1018 u32 base, cntl, size;
1022 * NOTE: Do not place new plane state fields here (e.g., when adding
1023 * new plane properties). New runtime state should now be placed in
1024 * the intel_plane_state structure and accessed via plane_state.
1027 unsigned int (*max_stride)(struct intel_plane *plane,
1028 u32 pixel_format, u64 modifier,
1029 unsigned int rotation);
1030 void (*update_plane)(struct intel_plane *plane,
1031 const struct intel_crtc_state *crtc_state,
1032 const struct intel_plane_state *plane_state);
1033 void (*update_slave)(struct intel_plane *plane,
1034 const struct intel_crtc_state *crtc_state,
1035 const struct intel_plane_state *plane_state);
1036 void (*disable_plane)(struct intel_plane *plane,
1037 const struct intel_crtc_state *crtc_state);
1038 bool (*get_hw_state)(struct intel_plane *plane, enum pipe *pipe);
1039 int (*check_plane)(struct intel_crtc_state *crtc_state,
1040 struct intel_plane_state *plane_state);
1043 struct intel_watermark_params {
1051 struct cxsr_latency {
1052 bool is_desktop : 1;
1057 u16 display_hpll_disable;
1059 u16 cursor_hpll_disable;
1062 #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)
1063 #define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
1064 #define to_intel_crtc_state(x) container_of(x, struct intel_crtc_state, base)
1065 #define to_intel_connector(x) container_of(x, struct intel_connector, base)
1066 #define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
1067 #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
1068 #define to_intel_plane(x) container_of(x, struct intel_plane, base)
1069 #define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base)
1070 #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL)
1073 i915_reg_t hdmi_reg;
1076 enum drm_dp_dual_mode_type type;
1081 struct intel_connector *attached_connector;
1082 struct cec_notifier *cec_notifier;
1085 struct intel_dp_mst_encoder;
1086 #define DP_MAX_DOWNSTREAM_PORTS 0x10
1089 * enum link_m_n_set:
1090 * When platform provides two set of M_N registers for dp, we can
1091 * program them and switch between them incase of DRRS.
1092 * But When only one such register is provided, we have to program the
1093 * required divider value on that registers itself based on the DRRS state.
1095 * M1_N1 : Program dp_m_n on M1_N1 registers
1096 * dp_m2_n2 on M2_N2 registers (If supported)
1098 * M2_N2 : Program dp_m2_n2 on M1_N1 registers
1099 * M2_N2 registers are not supported
1103 /* Sets the m1_n1 and m2_n2 */
1108 struct intel_dp_compliance_data {
1111 u16 hdisplay, vdisplay;
1115 struct intel_dp_compliance {
1116 unsigned long test_type;
1117 struct intel_dp_compliance_data test_data;
1124 i915_reg_t output_reg;
1132 bool reset_link_params;
1133 u8 dpcd[DP_RECEIVER_CAP_SIZE];
1134 u8 psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
1135 u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
1136 u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
1137 u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE];
1140 int num_source_rates;
1141 const int *source_rates;
1142 /* sink rates as reported by DP_MAX_LINK_RATE/DP_SUPPORTED_LINK_RATES */
1144 int sink_rates[DP_MAX_SUPPORTED_RATES];
1145 bool use_rate_select;
1146 /* intersection of source and sink rates */
1147 int num_common_rates;
1148 int common_rates[DP_MAX_SUPPORTED_RATES];
1149 /* Max lane count for the current link */
1150 int max_link_lane_count;
1151 /* Max rate for the current link */
1153 /* sink or branch descriptor */
1154 struct drm_dp_desc desc;
1155 struct drm_dp_aux aux;
1157 int panel_power_up_delay;
1158 int panel_power_down_delay;
1159 int panel_power_cycle_delay;
1160 int backlight_on_delay;
1161 int backlight_off_delay;
1162 struct delayed_work panel_vdd_work;
1163 bool want_panel_vdd;
1164 unsigned long last_power_on;
1165 unsigned long last_backlight_off;
1166 ktime_t panel_power_off_time;
1168 struct notifier_block edp_notifier;
1171 * Pipe whose power sequencer is currently locked into
1172 * this port. Only relevant on VLV/CHV.
1176 * Pipe currently driving the port. Used for preventing
1177 * the use of the PPS for any pipe currentrly driving
1178 * external DP as that will mess things up on VLV.
1180 enum pipe active_pipe;
1182 * Set if the sequencer may be reset due to a power transition,
1183 * requiring a reinitialization. Only relevant on BXT.
1186 struct edp_power_seq pps_delays;
1188 bool can_mst; /* this port supports mst */
1190 int active_mst_links;
1191 /* connector directly attached - won't be use for modeset in mst world */
1192 struct intel_connector *attached_connector;
1194 /* mst connector list */
1195 struct intel_dp_mst_encoder *mst_encoders[I915_MAX_PIPES];
1196 struct drm_dp_mst_topology_mgr mst_mgr;
1198 u32 (*get_aux_clock_divider)(struct intel_dp *dp, int index);
1200 * This function returns the value we have to program the AUX_CTL
1201 * register with to kick off an AUX transaction.
1203 u32 (*get_aux_send_ctl)(struct intel_dp *dp, int send_bytes,
1204 u32 aux_clock_divider);
1206 i915_reg_t (*aux_ch_ctl_reg)(struct intel_dp *dp);
1207 i915_reg_t (*aux_ch_data_reg)(struct intel_dp *dp, int index);
1209 /* This is called before a link training is starterd */
1210 void (*prepare_link_retrain)(struct intel_dp *intel_dp);
1212 /* Displayport compliance testing */
1213 struct intel_dp_compliance compliance;
1215 /* Display stream compression testing */
1219 enum lspcon_vendor {
1221 LSPCON_VENDOR_PARADE
1224 struct intel_lspcon {
1226 enum drm_lspcon_mode mode;
1227 enum lspcon_vendor vendor;
1230 struct intel_digital_port {
1231 struct intel_encoder base;
1232 u32 saved_port_bits;
1234 struct intel_hdmi hdmi;
1235 struct intel_lspcon lspcon;
1236 enum irqreturn (*hpd_pulse)(struct intel_digital_port *, bool);
1237 bool release_cl2_override;
1239 /* Used for DP and ICL+ TypeC/DP and TypeC/HDMI ports. */
1241 enum intel_display_power_domain ddi_io_power_domain;
1242 struct mutex tc_lock; /* protects the TypeC port mode */
1243 intel_wakeref_t tc_lock_wakeref;
1244 int tc_link_refcount;
1245 bool tc_legacy_port:1;
1246 char tc_port_name[8];
1247 enum tc_port_mode tc_mode;
1249 void (*write_infoframe)(struct intel_encoder *encoder,
1250 const struct intel_crtc_state *crtc_state,
1252 const void *frame, ssize_t len);
1253 void (*read_infoframe)(struct intel_encoder *encoder,
1254 const struct intel_crtc_state *crtc_state,
1256 void *frame, ssize_t len);
1257 void (*set_infoframes)(struct intel_encoder *encoder,
1259 const struct intel_crtc_state *crtc_state,
1260 const struct drm_connector_state *conn_state);
1261 u32 (*infoframes_enabled)(struct intel_encoder *encoder,
1262 const struct intel_crtc_state *pipe_config);
1265 struct intel_dp_mst_encoder {
1266 struct intel_encoder base;
1268 struct intel_digital_port *primary;
1269 struct intel_connector *connector;
1272 static inline enum dpio_channel
1273 vlv_dport_to_channel(struct intel_digital_port *dport)
1275 switch (dport->base.port) {
1286 static inline enum dpio_phy
1287 vlv_dport_to_phy(struct intel_digital_port *dport)
1289 switch (dport->base.port) {
1300 static inline enum dpio_channel
1301 vlv_pipe_to_channel(enum pipe pipe)
1314 static inline struct intel_crtc *
1315 intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
1317 return dev_priv->pipe_to_crtc_mapping[pipe];
1320 static inline struct intel_crtc *
1321 intel_get_crtc_for_plane(struct drm_i915_private *dev_priv, enum i9xx_plane_id plane)
1323 return dev_priv->plane_to_crtc_mapping[plane];
1326 struct intel_load_detect_pipe {
1327 struct drm_atomic_state *restore_state;
1330 static inline struct intel_encoder *
1331 intel_attached_encoder(struct drm_connector *connector)
1333 return to_intel_connector(connector)->encoder;
1336 static inline bool intel_encoder_is_dig_port(struct intel_encoder *encoder)
1338 switch (encoder->type) {
1339 case INTEL_OUTPUT_DDI:
1340 case INTEL_OUTPUT_DP:
1341 case INTEL_OUTPUT_EDP:
1342 case INTEL_OUTPUT_HDMI:
1349 static inline struct intel_digital_port *
1350 enc_to_dig_port(struct drm_encoder *encoder)
1352 struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
1354 if (intel_encoder_is_dig_port(intel_encoder))
1355 return container_of(encoder, struct intel_digital_port,
1361 static inline struct intel_digital_port *
1362 conn_to_dig_port(struct intel_connector *connector)
1364 return enc_to_dig_port(&intel_attached_encoder(&connector->base)->base);
1367 static inline struct intel_dp_mst_encoder *
1368 enc_to_mst(struct drm_encoder *encoder)
1370 return container_of(encoder, struct intel_dp_mst_encoder, base.base);
1373 static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder)
1375 return &enc_to_dig_port(encoder)->dp;
1378 static inline bool intel_encoder_is_dp(struct intel_encoder *encoder)
1380 switch (encoder->type) {
1381 case INTEL_OUTPUT_DP:
1382 case INTEL_OUTPUT_EDP:
1384 case INTEL_OUTPUT_DDI:
1385 /* Skip pure HDMI/DVI DDI encoders */
1386 return i915_mmio_reg_valid(enc_to_intel_dp(&encoder->base)->output_reg);
1392 static inline struct intel_lspcon *
1393 enc_to_intel_lspcon(struct drm_encoder *encoder)
1395 return &enc_to_dig_port(encoder)->lspcon;
1398 static inline struct intel_digital_port *
1399 dp_to_dig_port(struct intel_dp *intel_dp)
1401 return container_of(intel_dp, struct intel_digital_port, dp);
1404 static inline struct intel_lspcon *
1405 dp_to_lspcon(struct intel_dp *intel_dp)
1407 return &dp_to_dig_port(intel_dp)->lspcon;
1410 static inline struct drm_i915_private *
1411 dp_to_i915(struct intel_dp *intel_dp)
1413 return to_i915(dp_to_dig_port(intel_dp)->base.base.dev);
1416 static inline struct intel_digital_port *
1417 hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
1419 return container_of(intel_hdmi, struct intel_digital_port, hdmi);
1422 static inline struct intel_plane_state *
1423 intel_atomic_get_plane_state(struct intel_atomic_state *state,
1424 struct intel_plane *plane)
1426 struct drm_plane_state *ret =
1427 drm_atomic_get_plane_state(&state->base, &plane->base);
1430 return ERR_CAST(ret);
1432 return to_intel_plane_state(ret);
1435 static inline struct intel_plane_state *
1436 intel_atomic_get_old_plane_state(struct intel_atomic_state *state,
1437 struct intel_plane *plane)
1439 return to_intel_plane_state(drm_atomic_get_old_plane_state(&state->base,
1443 static inline struct intel_plane_state *
1444 intel_atomic_get_new_plane_state(struct intel_atomic_state *state,
1445 struct intel_plane *plane)
1447 return to_intel_plane_state(drm_atomic_get_new_plane_state(&state->base,
1451 static inline struct intel_crtc_state *
1452 intel_atomic_get_old_crtc_state(struct intel_atomic_state *state,
1453 struct intel_crtc *crtc)
1455 return to_intel_crtc_state(drm_atomic_get_old_crtc_state(&state->base,
1459 static inline struct intel_crtc_state *
1460 intel_atomic_get_new_crtc_state(struct intel_atomic_state *state,
1461 struct intel_crtc *crtc)
1463 return to_intel_crtc_state(drm_atomic_get_new_crtc_state(&state->base,
1467 /* intel_display.c */
1468 void intel_plane_destroy(struct drm_plane *plane);
1469 void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
1470 void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);
1471 enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc);
1472 int vlv_get_hpll_vco(struct drm_i915_private *dev_priv);
1473 int vlv_get_cck_clock(struct drm_i915_private *dev_priv,
1474 const char *name, u32 reg, int ref_freq);
1475 int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
1476 const char *name, u32 reg);
1477 void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv);
1478 void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
1479 void intel_init_display_hooks(struct drm_i915_private *dev_priv);
1480 unsigned int intel_fb_xy_to_linear(int x, int y,
1481 const struct intel_plane_state *state,
1483 unsigned int intel_fb_align_height(const struct drm_framebuffer *fb,
1484 int color_plane, unsigned int height);
1485 void intel_add_fb_offsets(int *x, int *y,
1486 const struct intel_plane_state *state, int plane);
1487 unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info);
1488 unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info);
1489 bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv);
1490 int intel_display_suspend(struct drm_device *dev);
1491 void intel_pps_unlock_regs_wa(struct drm_i915_private *dev_priv);
1492 void intel_encoder_destroy(struct drm_encoder *encoder);
1493 struct drm_display_mode *
1494 intel_encoder_current_mode(struct intel_encoder *encoder);
1495 bool intel_port_is_combophy(struct drm_i915_private *dev_priv, enum port port);
1496 bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy);
1497 bool intel_port_is_tc(struct drm_i915_private *dev_priv, enum port port);
1498 bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy);
1499 enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,
1501 int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
1502 struct drm_file *file_priv);
1503 enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
1506 intel_crtc_has_type(const struct intel_crtc_state *crtc_state,
1507 enum intel_output_type type)
1509 return crtc_state->output_types & (1 << type);
1512 intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
1514 return crtc_state->output_types &
1515 ((1 << INTEL_OUTPUT_DP) |
1516 (1 << INTEL_OUTPUT_DP_MST) |
1517 (1 << INTEL_OUTPUT_EDP));
1520 intel_wait_for_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
1522 drm_wait_one_vblank(&dev_priv->drm, pipe);
1525 intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, int pipe)
1527 const struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
1530 intel_wait_for_vblank(dev_priv, pipe);
1533 u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
1535 int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp);
1536 void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
1537 struct intel_digital_port *dport,
1538 unsigned int expected_mask);
1539 int intel_get_load_detect_pipe(struct drm_connector *connector,
1540 const struct drm_display_mode *mode,
1541 struct intel_load_detect_pipe *old,
1542 struct drm_modeset_acquire_ctx *ctx);
1543 void intel_release_load_detect_pipe(struct drm_connector *connector,
1544 struct intel_load_detect_pipe *old,
1545 struct drm_modeset_acquire_ctx *ctx);
1547 intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
1548 const struct i915_ggtt_view *view,
1550 unsigned long *out_flags);
1551 void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags);
1552 struct drm_framebuffer *
1553 intel_framebuffer_create(struct drm_i915_gem_object *obj,
1554 struct drm_mode_fb_cmd2 *mode_cmd);
1555 int intel_prepare_plane_fb(struct drm_plane *plane,
1556 struct drm_plane_state *new_state);
1557 void intel_cleanup_plane_fb(struct drm_plane *plane,
1558 struct drm_plane_state *old_state);
1560 void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv,
1563 int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
1564 const struct dpll *dpll);
1565 void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe);
1566 int lpt_get_iclkip(struct drm_i915_private *dev_priv);
1567 bool intel_fuzzy_clock_check(int clock1, int clock2);
1569 /* modesetting asserts */
1570 void assert_panel_unlocked(struct drm_i915_private *dev_priv,
1572 void assert_pll(struct drm_i915_private *dev_priv,
1573 enum pipe pipe, bool state);
1574 #define assert_pll_enabled(d, p) assert_pll(d, p, true)
1575 #define assert_pll_disabled(d, p) assert_pll(d, p, false)
1576 void assert_dsi_pll(struct drm_i915_private *dev_priv, bool state);
1577 #define assert_dsi_pll_enabled(d) assert_dsi_pll(d, true)
1578 #define assert_dsi_pll_disabled(d) assert_dsi_pll(d, false)
1579 void assert_fdi_rx_pll(struct drm_i915_private *dev_priv,
1580 enum pipe pipe, bool state);
1581 #define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true)
1582 #define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false)
1583 void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state);
1584 #define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
1585 #define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
1586 void intel_prepare_reset(struct drm_i915_private *dev_priv);
1587 void intel_finish_reset(struct drm_i915_private *dev_priv);
1588 void intel_dp_get_m_n(struct intel_crtc *crtc,
1589 struct intel_crtc_state *pipe_config);
1590 void intel_dp_set_m_n(const struct intel_crtc_state *crtc_state,
1591 enum link_m_n_set m_n);
1592 void intel_dp_ycbcr_420_enable(struct intel_dp *intel_dp,
1593 const struct intel_crtc_state *crtc_state);
1594 int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n);
1595 bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state,
1596 struct dpll *best_clock);
1597 int chv_calc_dpll_params(int refclk, struct dpll *pll_clock);
1599 bool intel_crtc_active(struct intel_crtc *crtc);
1600 bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state);
1601 void hsw_enable_ips(const struct intel_crtc_state *crtc_state);
1602 void hsw_disable_ips(const struct intel_crtc_state *crtc_state);
1603 enum intel_display_power_domain intel_port_to_power_domain(enum port port);
1604 enum intel_display_power_domain
1605 intel_aux_power_domain(struct intel_digital_port *dig_port);
1606 void intel_mode_from_pipe_config(struct drm_display_mode *mode,
1607 struct intel_crtc_state *pipe_config);
1608 void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc,
1609 struct intel_crtc_state *crtc_state);
1611 u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_center);
1612 int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state);
1613 int skl_max_scale(const struct intel_crtc_state *crtc_state,
1616 static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *state)
1618 return i915_ggtt_offset(state->vma);
1621 u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
1622 const struct intel_plane_state *plane_state);
1623 u32 glk_plane_color_ctl_crtc(const struct intel_crtc_state *crtc_state);
1624 u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
1625 const struct intel_plane_state *plane_state);
1626 u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state);
1627 u32 skl_plane_stride(const struct intel_plane_state *plane_state,
1629 int skl_check_plane_surface(struct intel_plane_state *plane_state);
1630 int i9xx_check_plane_surface(struct intel_plane_state *plane_state);
1631 int skl_format_to_fourcc(int format, bool rgb_order, bool alpha);
1632 unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
1633 u32 pixel_format, u64 modifier,
1634 unsigned int rotation);
1635 int bdw_get_pipemisc_bpp(struct intel_crtc *crtc);
1637 #endif /* __INTEL_DRV_H__ */