2017-12-21 21:57:30 +00:00
/*
2019-08-28 22:12:12 +05:30
* Copyright © 2006 - 2019 Intel Corporation
2017-12-21 21:57:30 +00:00
*
* Permission is hereby granted , free of charge , to any person obtaining a
* copy of this software and associated documentation files ( the " Software " ) ,
* to deal in the Software without restriction , including without limitation
* the rights to use , copy , modify , merge , publish , distribute , sublicense ,
* and / or sell copies of the Software , and to permit persons to whom the
* Software is furnished to do so , subject to the following conditions :
*
* The above copyright notice and this permission notice ( including the next
* paragraph ) shall be included in all copies or substantial portions of the
* Software .
*
* THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
* IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER
* LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING
* FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE .
*
*/
# ifndef _INTEL_DISPLAY_H_
# define _INTEL_DISPLAY_H_
2018-09-05 15:57:05 +02:00
# include <drm/drm_util.h>
2019-08-06 13:07:22 +03:00
enum link_m_n_set ;
2020-10-20 21:44:25 +05:30
enum drm_scaling_filter ;
2019-08-06 13:07:22 +03:00
struct dpll ;
struct drm_connector ;
struct drm_device ;
2019-09-18 18:07:07 +03:00
struct drm_display_mode ;
2019-08-06 13:07:22 +03:00
struct drm_encoder ;
struct drm_file ;
2019-09-13 22:31:54 +03:00
struct drm_format_info ;
2019-08-06 13:07:22 +03:00
struct drm_framebuffer ;
struct drm_i915_gem_object ;
2019-05-03 22:31:43 +03:00
struct drm_i915_private ;
2020-02-25 15:31:31 +02:00
struct drm_mode_fb_cmd2 ;
2019-08-06 13:07:22 +03:00
struct drm_modeset_acquire_ctx ;
struct drm_plane ;
struct drm_plane_state ;
2021-05-06 19:19:24 +03:00
struct i915_address_space ;
2019-08-06 13:07:22 +03:00
struct i915_ggtt_view ;
2020-01-20 19:47:26 +02:00
struct intel_atomic_state ;
2019-08-06 13:07:22 +03:00
struct intel_crtc ;
struct intel_crtc_state ;
struct intel_digital_port ;
struct intel_dp ;
struct intel_encoder ;
2021-02-05 16:48:36 +02:00
struct intel_initial_plane_config ;
2019-08-06 13:07:22 +03:00
struct intel_load_detect_pipe ;
struct intel_plane ;
2019-05-09 15:21:56 +03:00
struct intel_plane_state ;
2019-08-06 13:07:22 +03:00
struct intel_remapped_info ;
struct intel_rotation_info ;
2019-05-03 22:31:43 +03:00
2018-07-27 12:36:47 -07:00
enum i915_gpio {
GPIOA ,
GPIOB ,
GPIOC ,
GPIOD ,
GPIOE ,
GPIOF ,
GPIOG ,
GPIOH ,
__GPIOI_UNUSED ,
GPIOJ ,
GPIOK ,
GPIOL ,
GPIOM ,
2019-07-11 10:31:11 -07:00
GPION ,
GPIOO ,
2018-07-27 12:36:47 -07:00
} ;
2018-11-20 11:23:25 +02:00
/*
* Keep the pipe enum values fixed : the code assumes that PIPE_A = 0 , the
* rest have consecutive values and match the enum values of transcoders
* with a 1 : 1 transcoder - > pipe mapping .
*/
2017-12-21 21:57:30 +00:00
enum pipe {
INVALID_PIPE = - 1 ,
PIPE_A = 0 ,
PIPE_B ,
PIPE_C ,
2019-07-11 10:30:55 -07:00
PIPE_D ,
2017-12-21 21:57:30 +00:00
_PIPE_EDP ,
I915_MAX_PIPES = _PIPE_EDP
} ;
# define pipe_name(p) ((p) + 'A')
enum transcoder {
2019-10-18 10:27:20 -07:00
INVALID_TRANSCODER = - 1 ,
2018-11-20 11:23:25 +02:00
/*
* The following transcoders have a 1 : 1 transcoder - > pipe mapping ,
* keep their values fixed : the code assumes that TRANSCODER_A = 0 , the
* rest have consecutive values and match the enum values of the pipes
* they map to .
*/
TRANSCODER_A = PIPE_A ,
TRANSCODER_B = PIPE_B ,
TRANSCODER_C = PIPE_C ,
2019-07-11 10:30:55 -07:00
TRANSCODER_D = PIPE_D ,
2018-11-20 11:23:25 +02:00
/*
* The following transcoders can map to any pipe , their enum value
* doesn ' t need to stay fixed .
*/
2017-12-21 21:57:30 +00:00
TRANSCODER_EDP ,
2018-10-15 17:27:56 +03:00
TRANSCODER_DSI_0 ,
TRANSCODER_DSI_1 ,
TRANSCODER_DSI_A = TRANSCODER_DSI_0 , /* legacy DSI */
TRANSCODER_DSI_C = TRANSCODER_DSI_1 , /* legacy DSI */
2017-12-21 21:57:30 +00:00
I915_MAX_TRANSCODERS
} ;
static inline const char * transcoder_name ( enum transcoder transcoder )
{
switch ( transcoder ) {
case TRANSCODER_A :
return " A " ;
case TRANSCODER_B :
return " B " ;
case TRANSCODER_C :
return " C " ;
2019-07-11 10:30:55 -07:00
case TRANSCODER_D :
return " D " ;
2017-12-21 21:57:30 +00:00
case TRANSCODER_EDP :
return " EDP " ;
case TRANSCODER_DSI_A :
return " DSI A " ;
case TRANSCODER_DSI_C :
return " DSI C " ;
default :
return " <invalid> " ;
}
}
static inline bool transcoder_is_dsi ( enum transcoder transcoder )
{
return transcoder = = TRANSCODER_DSI_A | | transcoder = = TRANSCODER_DSI_C ;
}
/*
* Global legacy plane identifier . Valid only for primary / sprite
* planes on pre - g4x , and only for primary planes on g4x - bdw .
*/
enum i9xx_plane_id {
PLANE_A ,
PLANE_B ,
PLANE_C ,
} ;
# define plane_name(p) ((p) + 'A')
2018-12-31 16:56:41 +02:00
# define sprite_name(p, s) ((p) * RUNTIME_INFO(dev_priv)->num_sprites[(p)] + (s) + 'A')
2017-12-21 21:57:30 +00:00
/*
* Per - pipe plane identifier .
* I915_MAX_PLANES in the enum below is the maximum ( across all platforms )
* number of planes per CRTC . Not all platforms really have this many planes ,
* which means some arrays of size I915_MAX_PLANES may have unused entries
* between the topmost sprite plane and the cursor plane .
*
* This is expected to be passed to various register macros
* ( eg . PLANE_CTL ( ) , PS_PLANE_SEL ( ) , etc . ) so adjust with care .
*/
enum plane_id {
PLANE_PRIMARY ,
PLANE_SPRITE0 ,
PLANE_SPRITE1 ,
PLANE_SPRITE2 ,
2018-10-18 13:51:28 +02:00
PLANE_SPRITE3 ,
PLANE_SPRITE4 ,
PLANE_SPRITE5 ,
2017-12-21 21:57:30 +00:00
PLANE_CURSOR ,
I915_MAX_PLANES ,
} ;
# define for_each_plane_id_on_crtc(__crtc, __p) \
for ( ( __p ) = PLANE_PRIMARY ; ( __p ) < I915_MAX_PLANES ; ( __p ) + + ) \
for_each_if ( ( __crtc ) - > plane_ids_mask & BIT ( __p ) )
2021-04-16 20:10:09 +03:00
# define for_each_dbuf_slice(__dev_priv, __slice) \
2020-05-19 16:11:15 +03:00
for ( ( __slice ) = DBUF_S1 ; ( __slice ) < I915_MAX_DBUF_SLICES ; ( __slice ) + + ) \
2021-04-16 20:10:09 +03:00
for_each_if ( INTEL_INFO ( __dev_priv ) - > dbuf . slice_mask & BIT ( __slice ) )
2020-05-19 16:11:15 +03:00
2021-04-16 20:10:09 +03:00
# define for_each_dbuf_slice_in_mask(__dev_priv, __slice, __mask) \
for_each_dbuf_slice ( ( __dev_priv ) , ( __slice ) ) \
for_each_if ( ( __mask ) & BIT ( __slice ) )
2020-05-19 16:11:15 +03:00
2019-08-28 22:12:12 +05:30
enum port {
PORT_NONE = - 1 ,
PORT_A = 0 ,
PORT_B ,
PORT_C ,
PORT_D ,
PORT_E ,
PORT_F ,
PORT_G ,
PORT_H ,
PORT_I ,
2020-10-28 23:33:06 +02:00
/* tgl+ */
PORT_TC1 = PORT_D ,
PORT_TC2 ,
PORT_TC3 ,
PORT_TC4 ,
PORT_TC5 ,
PORT_TC6 ,
2019-08-28 22:12:12 +05:30
I915_MAX_PORTS
} ;
# define port_name(p) ((p) + 'A')
2018-07-04 17:08:17 +02:00
/*
* Ports identifier referenced from other drivers .
* Expected to remain stable over time
*/
static inline const char * port_identifier ( enum port port )
{
switch ( port ) {
case PORT_A :
return " Port A " ;
case PORT_B :
return " Port B " ;
case PORT_C :
return " Port C " ;
case PORT_D :
return " Port D " ;
case PORT_E :
return " Port E " ;
case PORT_F :
return " Port F " ;
2019-07-11 10:31:06 -07:00
case PORT_G :
return " Port G " ;
case PORT_H :
return " Port H " ;
case PORT_I :
return " Port I " ;
2018-07-04 17:08:17 +02:00
default :
return " <invalid> " ;
}
}
2018-05-21 17:25:37 -07:00
enum tc_port {
2020-10-28 23:33:05 +02:00
TC_PORT_NONE = - 1 ,
TC_PORT_1 = 0 ,
TC_PORT_2 ,
TC_PORT_3 ,
TC_PORT_4 ,
TC_PORT_5 ,
TC_PORT_6 ,
2018-05-21 17:25:37 -07:00
I915_MAX_TC_PORTS
} ;
2019-06-28 17:36:16 +03:00
enum tc_port_mode {
TC_PORT_TBT_ALT ,
TC_PORT_DP_ALT ,
2018-07-24 17:28:10 -07:00
TC_PORT_LEGACY ,
} ;
2017-12-21 21:57:30 +00:00
enum dpio_channel {
DPIO_CH0 ,
DPIO_CH1
} ;
enum dpio_phy {
DPIO_PHY0 ,
DPIO_PHY1 ,
DPIO_PHY2 ,
} ;
2018-02-22 20:10:30 +02:00
enum aux_ch {
AUX_CH_A ,
AUX_CH_B ,
AUX_CH_C ,
AUX_CH_D ,
2018-06-11 17:25:12 -07:00
AUX_CH_E , /* ICL+ */
2018-02-22 20:10:30 +02:00
AUX_CH_F ,
2019-10-08 15:09:05 -07:00
AUX_CH_G ,
2020-07-01 00:55:50 +03:00
AUX_CH_H ,
AUX_CH_I ,
2020-10-28 23:33:08 +02:00
/* tgl+ */
AUX_CH_USBC1 = AUX_CH_D ,
AUX_CH_USBC2 ,
AUX_CH_USBC3 ,
AUX_CH_USBC4 ,
AUX_CH_USBC5 ,
AUX_CH_USBC6 ,
2018-02-22 20:10:30 +02:00
} ;
# define aux_ch_name(a) ((a) + 'A')
2017-12-21 21:57:30 +00:00
/* Used by dp and fdi links */
struct intel_link_m_n {
u32 tu ;
u32 gmch_m ;
u32 gmch_n ;
u32 link_m ;
u32 link_n ;
} ;
2019-07-09 11:39:30 -07:00
enum phy {
PHY_NONE = - 1 ,
PHY_A = 0 ,
PHY_B ,
PHY_C ,
PHY_D ,
PHY_E ,
PHY_F ,
2019-07-11 10:31:07 -07:00
PHY_G ,
PHY_H ,
PHY_I ,
2019-07-09 11:39:30 -07:00
I915_MAX_PHYS
} ;
# define phy_name(a) ((a) + 'A')
2019-07-11 22:57:05 -07:00
enum phy_fia {
FIA1 ,
FIA2 ,
FIA3 ,
} ;
2017-12-21 21:57:30 +00:00
# define for_each_pipe(__dev_priv, __p) \
2020-02-24 18:09:58 +05:30
for ( ( __p ) = 0 ; ( __p ) < I915_MAX_PIPES ; ( __p ) + + ) \
for_each_if ( INTEL_INFO ( __dev_priv ) - > pipe_mask & BIT ( __p ) )
2017-12-21 21:57:30 +00:00
# define for_each_pipe_masked(__dev_priv, __p, __mask) \
2020-02-24 18:09:58 +05:30
for_each_pipe ( __dev_priv , __p ) \
2017-12-21 21:57:30 +00:00
for_each_if ( ( __mask ) & BIT ( __p ) )
2020-03-18 19:02:35 +02:00
# define for_each_cpu_transcoder(__dev_priv, __t) \
2018-04-03 14:24:18 -07:00
for ( ( __t ) = 0 ; ( __t ) < I915_MAX_TRANSCODERS ; ( __t ) + + ) \
2020-03-18 19:02:35 +02:00
for_each_if ( INTEL_INFO ( __dev_priv ) - > cpu_transcoder_mask & BIT ( __t ) )
# define for_each_cpu_transcoder_masked(__dev_priv, __t, __mask) \
for_each_cpu_transcoder ( __dev_priv , __t ) \
for_each_if ( ( __mask ) & BIT ( __t ) )
2018-04-03 14:24:18 -07:00
2017-12-21 21:57:30 +00:00
# define for_each_sprite(__dev_priv, __p, __s) \
for ( ( __s ) = 0 ; \
2018-12-31 16:56:41 +02:00
( __s ) < RUNTIME_INFO ( __dev_priv ) - > num_sprites [ ( __p ) ] ; \
2017-12-21 21:57:30 +00:00
( __s ) + + )
2019-11-01 15:43:33 +02:00
# define for_each_port(__port) \
for ( ( __port ) = PORT_A ; ( __port ) < I915_MAX_PORTS ; ( __port ) + + )
# define for_each_port_masked(__port, __ports_mask) \
for_each_port ( __port ) \
2017-12-21 21:57:30 +00:00
for_each_if ( ( __ports_mask ) & BIT ( __port ) )
2019-07-09 11:39:32 -07:00
# define for_each_phy_masked(__phy, __phys_mask) \
for ( ( __phy ) = PHY_A ; ( __phy ) < I915_MAX_PHYS ; ( __phy ) + + ) \
for_each_if ( ( __phys_mask ) & BIT ( __phy ) )
2017-12-21 21:57:30 +00:00
# define for_each_crtc(dev, crtc) \
list_for_each_entry ( crtc , & ( dev ) - > mode_config . crtc_list , head )
# define for_each_intel_plane(dev, intel_plane) \
list_for_each_entry ( intel_plane , \
& ( dev ) - > mode_config . plane_list , \
base . head )
# define for_each_intel_plane_mask(dev, intel_plane, plane_mask) \
list_for_each_entry ( intel_plane , \
& ( dev ) - > mode_config . plane_list , \
base . head ) \
for_each_if ( ( plane_mask ) & \
2019-10-04 13:34:52 +02:00
drm_plane_mask ( & intel_plane - > base ) )
2017-12-21 21:57:30 +00:00
# define for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) \
list_for_each_entry ( intel_plane , \
& ( dev ) - > mode_config . plane_list , \
base . head ) \
for_each_if ( ( intel_plane ) - > pipe = = ( intel_crtc ) - > pipe )
# define for_each_intel_crtc(dev, intel_crtc) \
list_for_each_entry ( intel_crtc , \
& ( dev ) - > mode_config . crtc_list , \
base . head )
# define for_each_intel_crtc_mask(dev, intel_crtc, crtc_mask) \
list_for_each_entry ( intel_crtc , \
& ( dev ) - > mode_config . crtc_list , \
base . head ) \
2018-06-26 22:47:11 +03:00
for_each_if ( ( crtc_mask ) & drm_crtc_mask ( & intel_crtc - > base ) )
2017-12-21 21:57:30 +00:00
# define for_each_intel_encoder(dev, intel_encoder) \
list_for_each_entry ( intel_encoder , \
& ( dev ) - > mode_config . encoder_list , \
base . head )
2019-11-29 20:54:34 +02:00
# define for_each_intel_encoder_mask(dev, intel_encoder, encoder_mask) \
list_for_each_entry ( intel_encoder , \
& ( dev ) - > mode_config . encoder_list , \
base . head ) \
for_each_if ( ( encoder_mask ) & \
drm_encoder_mask ( & intel_encoder - > base ) )
2021-02-09 10:14:36 -08:00
# define for_each_intel_encoder_mask_with_psr(dev, intel_encoder, encoder_mask) \
2021-02-04 15:40:14 +02:00
list_for_each_entry ( ( intel_encoder ) , & ( dev ) - > mode_config . encoder_list , base . head ) \
for_each_if ( ( ( encoder_mask ) & drm_encoder_mask ( & ( intel_encoder ) - > base ) ) & & \
intel_encoder_can_psr ( intel_encoder ) )
2018-07-05 19:43:50 +03:00
# define for_each_intel_dp(dev, intel_encoder) \
for_each_intel_encoder ( dev , intel_encoder ) \
for_each_if ( intel_encoder_is_dp ( intel_encoder ) )
2021-02-09 10:14:36 -08:00
# define for_each_intel_encoder_with_psr(dev, intel_encoder) \
2021-02-04 15:40:14 +02:00
for_each_intel_encoder ( ( dev ) , ( intel_encoder ) ) \
for_each_if ( intel_encoder_can_psr ( intel_encoder ) )
2017-12-21 21:57:30 +00:00
# define for_each_intel_connector_iter(intel_connector, iter) \
while ( ( intel_connector = to_intel_connector ( drm_connector_list_iter_next ( iter ) ) ) )
# define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \
list_for_each_entry ( ( intel_encoder ) , & ( dev ) - > mode_config . encoder_list , base . head ) \
for_each_if ( ( intel_encoder ) - > base . crtc = = ( __crtc ) )
# define for_each_connector_on_encoder(dev, __encoder, intel_connector) \
list_for_each_entry ( ( intel_connector ) , & ( dev ) - > mode_config . connector_list , base . head ) \
for_each_if ( ( intel_connector ) - > base . encoder = = ( __encoder ) )
2018-11-14 23:07:20 +02:00
# define for_each_old_intel_plane_in_state(__state, plane, old_plane_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . dev - > mode_config . num_total_plane & & \
( ( plane ) = to_intel_plane ( ( __state ) - > base . planes [ __i ] . ptr ) , \
( old_plane_state ) = to_intel_plane_state ( ( __state ) - > base . planes [ __i ] . old_state ) , 1 ) ; \
( __i ) + + ) \
for_each_if ( plane )
2017-12-21 21:57:30 +00:00
# define for_each_new_intel_plane_in_state(__state, plane, new_plane_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . dev - > mode_config . num_total_plane & & \
( ( plane ) = to_intel_plane ( ( __state ) - > base . planes [ __i ] . ptr ) , \
( new_plane_state ) = to_intel_plane_state ( ( __state ) - > base . planes [ __i ] . new_state ) , 1 ) ; \
( __i ) + + ) \
for_each_if ( plane )
# define for_each_new_intel_crtc_in_state(__state, crtc, new_crtc_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . dev - > mode_config . num_crtc & & \
( ( crtc ) = to_intel_crtc ( ( __state ) - > base . crtcs [ __i ] . ptr ) , \
( new_crtc_state ) = to_intel_crtc_state ( ( __state ) - > base . crtcs [ __i ] . new_state ) , 1 ) ; \
( __i ) + + ) \
for_each_if ( crtc )
# define for_each_oldnew_intel_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . dev - > mode_config . num_total_plane & & \
( ( plane ) = to_intel_plane ( ( __state ) - > base . planes [ __i ] . ptr ) , \
( old_plane_state ) = to_intel_plane_state ( ( __state ) - > base . planes [ __i ] . old_state ) , \
( new_plane_state ) = to_intel_plane_state ( ( __state ) - > base . planes [ __i ] . new_state ) , 1 ) ; \
( __i ) + + ) \
for_each_if ( plane )
2018-11-27 18:59:00 +02:00
# define for_each_oldnew_intel_crtc_in_state(__state, crtc, old_crtc_state, new_crtc_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . dev - > mode_config . num_crtc & & \
( ( crtc ) = to_intel_crtc ( ( __state ) - > base . crtcs [ __i ] . ptr ) , \
( old_crtc_state ) = to_intel_crtc_state ( ( __state ) - > base . crtcs [ __i ] . old_state ) , \
( new_crtc_state ) = to_intel_crtc_state ( ( __state ) - > base . crtcs [ __i ] . new_state ) , 1 ) ; \
( __i ) + + ) \
for_each_if ( crtc )
2019-08-23 01:20:43 -07:00
# define for_each_oldnew_intel_crtc_in_state_reverse(__state, crtc, old_crtc_state, new_crtc_state, __i) \
for ( ( __i ) = ( __state ) - > base . dev - > mode_config . num_crtc - 1 ; \
( __i ) > = 0 & & \
( ( crtc ) = to_intel_crtc ( ( __state ) - > base . crtcs [ __i ] . ptr ) , \
( old_crtc_state ) = to_intel_crtc_state ( ( __state ) - > base . crtcs [ __i ] . old_state ) , \
( new_crtc_state ) = to_intel_crtc_state ( ( __state ) - > base . crtcs [ __i ] . new_state ) , 1 ) ; \
( __i ) - - ) \
for_each_if ( crtc )
2019-10-04 13:34:53 +02:00
# define intel_atomic_crtc_state_for_each_plane_state( \
plane , plane_state , \
crtc_state ) \
2019-10-31 12:26:00 +01:00
for_each_intel_plane_mask ( ( ( crtc_state ) - > uapi . state - > dev ) , ( plane ) , \
( ( crtc_state ) - > uapi . plane_mask ) ) \
2019-10-04 13:34:53 +02:00
for_each_if ( ( plane_state = \
2019-10-31 12:26:00 +01:00
to_intel_plane_state ( __drm_atomic_get_current_plane_state ( ( crtc_state ) - > uapi . state , & plane - > base ) ) ) )
2019-10-04 13:34:53 +02:00
2019-10-29 18:24:44 -07:00
# define for_each_new_intel_connector_in_state(__state, connector, new_connector_state, __i) \
for ( ( __i ) = 0 ; \
( __i ) < ( __state ) - > base . num_connector ; \
( __i ) + + ) \
for_each_if ( ( __state ) - > base . connectors [ __i ] . ptr & & \
( ( connector ) = to_intel_connector ( ( __state ) - > base . connectors [ __i ] . ptr ) , \
( new_connector_state ) = to_intel_digital_connector_state ( ( __state ) - > base . connectors [ __i ] . new_state ) , 1 ) )
2020-11-24 22:11:54 +02:00
int intel_atomic_add_affected_planes ( struct intel_atomic_state * state ,
struct intel_crtc * crtc ) ;
2020-01-20 19:47:26 +02:00
u8 intel_calc_active_pipes ( struct intel_atomic_state * state ,
u8 active_pipes ) ;
2018-11-28 13:36:21 -08:00
void intel_link_compute_m_n ( u16 bpp , int nlanes ,
2017-12-21 21:57:30 +00:00
int pixel_clock , int link_clock ,
struct intel_link_m_n * m_n ,
2019-09-25 10:21:09 +02:00
bool constant_n , bool fec_enable ) ;
2019-05-03 22:31:43 +03:00
void lpt_disable_clkout_dp ( struct drm_i915_private * dev_priv ) ;
2019-05-09 15:21:57 +03:00
u32 intel_plane_fb_max_stride ( struct drm_i915_private * dev_priv ,
u32 pixel_format , u64 modifier ) ;
2019-09-18 18:07:07 +03:00
enum drm_mode_status
intel_mode_valid_max_plane_size ( struct drm_i915_private * dev_priv ,
2020-11-17 11:47:05 -08:00
const struct drm_display_mode * mode ,
bool bigjoiner ) ;
2019-07-09 11:39:30 -07:00
enum phy intel_port_to_phy ( struct drm_i915_private * i915 , enum port port ) ;
2019-10-18 10:27:20 -07:00
bool is_trans_port_sync_mode ( const struct intel_crtc_state * state ) ;
2019-05-03 22:31:43 +03:00
2019-08-06 13:07:22 +03:00
void intel_plane_destroy ( struct drm_plane * plane ) ;
2020-01-28 18:28:48 +02:00
void intel_enable_pipe ( const struct intel_crtc_state * new_crtc_state ) ;
2019-12-13 21:52:17 +02:00
void intel_disable_pipe ( const struct intel_crtc_state * old_crtc_state ) ;
2019-08-06 13:07:22 +03:00
void i830_enable_pipe ( struct drm_i915_private * dev_priv , enum pipe pipe ) ;
void i830_disable_pipe ( struct drm_i915_private * dev_priv , enum pipe pipe ) ;
enum pipe intel_crtc_pch_transcoder ( struct intel_crtc * crtc ) ;
int vlv_get_hpll_vco ( struct drm_i915_private * dev_priv ) ;
int vlv_get_cck_clock ( struct drm_i915_private * dev_priv ,
const char * name , u32 reg , int ref_freq ) ;
int vlv_get_cck_clock_hpll ( struct drm_i915_private * dev_priv ,
const char * name , u32 reg ) ;
2020-01-28 18:28:48 +02:00
void lpt_pch_enable ( const struct intel_crtc_state * crtc_state ) ;
2019-08-06 13:07:22 +03:00
void lpt_disable_pch_transcoder ( struct drm_i915_private * dev_priv ) ;
void lpt_disable_iclkip ( struct drm_i915_private * dev_priv ) ;
void intel_init_display_hooks ( struct drm_i915_private * dev_priv ) ;
unsigned int intel_fb_xy_to_linear ( int x , int y ,
const struct intel_plane_state * state ,
int plane ) ;
unsigned int intel_fb_align_height ( const struct drm_framebuffer * fb ,
int color_plane , unsigned int height ) ;
void intel_add_fb_offsets ( int * x , int * y ,
const struct intel_plane_state * state , int plane ) ;
unsigned int intel_rotation_info_size ( const struct intel_rotation_info * rot_info ) ;
unsigned int intel_remapped_info_size ( const struct intel_remapped_info * rem_info ) ;
bool intel_has_pending_fb_unpin ( struct drm_i915_private * dev_priv ) ;
int intel_display_suspend ( struct drm_device * dev ) ;
void intel_encoder_destroy ( struct drm_encoder * encoder ) ;
struct drm_display_mode *
intel_encoder_current_mode ( struct intel_encoder * encoder ) ;
bool intel_phy_is_combo ( struct drm_i915_private * dev_priv , enum phy phy ) ;
bool intel_phy_is_tc ( struct drm_i915_private * dev_priv , enum phy phy ) ;
enum tc_port intel_port_to_tc ( struct drm_i915_private * dev_priv ,
enum port port ) ;
int intel_get_pipe_from_crtc_id_ioctl ( struct drm_device * dev , void * data ,
struct drm_file * file_priv ) ;
2019-12-24 00:40:09 -08:00
int ilk_get_lanes_required ( int target_clock , int link_bw , int bpp ) ;
2019-08-06 13:07:22 +03:00
void vlv_wait_port_ready ( struct drm_i915_private * dev_priv ,
2020-06-30 21:50:54 -07:00
struct intel_digital_port * dig_port ,
2019-08-06 13:07:22 +03:00
unsigned int expected_mask ) ;
int intel_get_load_detect_pipe ( struct drm_connector * connector ,
struct intel_load_detect_pipe * old ,
struct drm_modeset_acquire_ctx * ctx ) ;
void intel_release_load_detect_pipe ( struct drm_connector * connector ,
struct intel_load_detect_pipe * old ,
struct drm_modeset_acquire_ctx * ctx ) ;
struct i915_vma *
2021-03-23 16:50:11 +01:00
intel_pin_and_fence_fb_obj ( struct drm_framebuffer * fb , bool phys_cursor ,
2019-08-06 13:07:22 +03:00
const struct i915_ggtt_view * view ,
bool uses_fence ,
unsigned long * out_flags ) ;
void intel_unpin_fb_vma ( struct i915_vma * vma , unsigned long flags ) ;
struct drm_framebuffer *
intel_framebuffer_create ( struct drm_i915_gem_object * obj ,
struct drm_mode_fb_cmd2 * mode_cmd ) ;
int intel_prepare_plane_fb ( struct drm_plane * plane ,
struct drm_plane_state * new_state ) ;
void intel_cleanup_plane_fb ( struct drm_plane * plane ,
struct drm_plane_state * old_state ) ;
void assert_pch_transcoder_disabled ( struct drm_i915_private * dev_priv ,
enum pipe pipe ) ;
int lpt_get_iclkip ( struct drm_i915_private * dev_priv ) ;
bool intel_fuzzy_clock_check ( int clock1 , int clock2 ) ;
2020-11-06 14:55:24 -08:00
void intel_display_prepare_reset ( struct drm_i915_private * dev_priv ) ;
2020-11-06 14:55:25 -08:00
void intel_display_finish_reset ( struct drm_i915_private * dev_priv ) ;
2019-08-06 13:07:22 +03:00
void intel_dp_get_m_n ( struct intel_crtc * crtc ,
struct intel_crtc_state * pipe_config ) ;
void intel_dp_set_m_n ( const struct intel_crtc_state * crtc_state ,
enum link_m_n_set m_n ) ;
int intel_dotclock_calculate ( int link_freq , const struct intel_link_m_n * m_n ) ;
bool hsw_crtc_state_ips_capable ( const struct intel_crtc_state * crtc_state ) ;
void hsw_enable_ips ( const struct intel_crtc_state * crtc_state ) ;
void hsw_disable_ips ( const struct intel_crtc_state * crtc_state ) ;
enum intel_display_power_domain intel_port_to_power_domain ( enum port port ) ;
enum intel_display_power_domain
intel_aux_power_domain ( struct intel_digital_port * dig_port ) ;
2020-04-14 12:49:50 -07:00
enum intel_display_power_domain
intel_legacy_aux_to_power_domain ( enum aux_ch aux_ch ) ;
2019-08-06 13:07:22 +03:00
void intel_crtc_arm_fifo_underrun ( struct intel_crtc * crtc ,
struct intel_crtc_state * crtc_state ) ;
2019-12-24 00:40:09 -08:00
void ilk_pfit_disable ( const struct intel_crtc_state * old_crtc_state ) ;
2021-02-05 16:48:36 +02:00
2019-08-06 13:07:22 +03:00
int bdw_get_pipemisc_bpp ( struct intel_crtc * crtc ) ;
2020-04-29 13:10:25 +03:00
unsigned int intel_plane_fence_y_offset ( const struct intel_plane_state * plane_state ) ;
2019-08-06 13:07:22 +03:00
2019-12-21 14:05:43 +02:00
bool
intel_format_info_is_yuv_semiplanar ( const struct drm_format_info * info ,
2021-01-13 16:11:58 +02:00
u64 modifier ) ;
2019-12-21 14:05:43 +02:00
2020-12-21 11:04:48 +02:00
int intel_plane_pin_fb ( struct intel_plane_state * plane_state ) ;
void intel_plane_unpin_fb ( struct intel_plane_state * old_plane_state ) ;
2021-01-14 13:13:46 +02:00
struct intel_encoder *
intel_get_crtc_new_encoder ( const struct intel_atomic_state * state ,
const struct intel_crtc_state * crtc_state ) ;
2020-12-21 11:04:48 +02:00
2021-02-05 16:48:36 +02:00
unsigned int intel_surf_alignment ( const struct drm_framebuffer * fb ,
int color_plane ) ;
unsigned int intel_tile_width_bytes ( const struct drm_framebuffer * fb , int color_plane ) ;
2021-02-12 20:27:55 -08:00
void intel_display_driver_register ( struct drm_i915_private * i915 ) ;
void intel_display_driver_unregister ( struct drm_i915_private * i915 ) ;
2019-08-06 13:07:22 +03:00
/* modesetting */
2019-09-20 21:54:21 +03:00
void intel_modeset_init_hw ( struct drm_i915_private * i915 ) ;
2020-02-24 14:08:28 +02:00
int intel_modeset_init_noirq ( struct drm_i915_private * i915 ) ;
2020-09-02 17:30:20 +03:00
int intel_modeset_init_nogem ( struct drm_i915_private * i915 ) ;
2019-09-20 21:54:21 +03:00
int intel_modeset_init ( struct drm_i915_private * i915 ) ;
2019-09-20 21:54:18 +03:00
void intel_modeset_driver_remove ( struct drm_i915_private * i915 ) ;
2020-02-14 15:50:57 +02:00
void intel_modeset_driver_remove_noirq ( struct drm_i915_private * i915 ) ;
2020-09-02 17:30:22 +03:00
void intel_modeset_driver_remove_nogem ( struct drm_i915_private * i915 ) ;
2019-08-06 13:07:22 +03:00
void intel_display_resume ( struct drm_device * dev ) ;
void intel_init_pch_refclk ( struct drm_i915_private * dev_priv ) ;
/* modesetting asserts */
void assert_panel_unlocked ( struct drm_i915_private * dev_priv ,
enum pipe pipe ) ;
void assert_pll ( struct drm_i915_private * dev_priv ,
enum pipe pipe , bool state ) ;
# define assert_pll_enabled(d, p) assert_pll(d, p, true)
# define assert_pll_disabled(d, p) assert_pll(d, p, false)
void assert_dsi_pll ( struct drm_i915_private * dev_priv , bool state ) ;
# define assert_dsi_pll_enabled(d) assert_dsi_pll(d, true)
# define assert_dsi_pll_disabled(d) assert_dsi_pll(d, false)
void assert_fdi_rx_pll ( struct drm_i915_private * dev_priv ,
enum pipe pipe , bool state ) ;
# define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true)
# define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false)
2019-11-12 18:38:12 +02:00
void assert_pipe ( struct drm_i915_private * dev_priv ,
enum transcoder cpu_transcoder , bool state ) ;
# define assert_pipe_enabled(d, t) assert_pipe(d, t, true)
# define assert_pipe_disabled(d, t) assert_pipe(d, t, false)
2019-08-06 13:07:22 +03:00
2019-08-08 16:42:42 +03:00
/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and
* WARN_ON ( ) ) for hw state sanity checks to check for unexpected conditions
* which may not necessarily be a user visible problem . This will either
* WARN ( ) or DRM_ERROR ( ) depending on the verbose_checks moduleparam , to
* enable distros and users to tailor their preferred amount of i915 abrt
* spam .
*/
# define I915_STATE_WARN(condition, format...) ({ \
int __ret_warn_on = ! ! ( condition ) ; \
if ( unlikely ( __ret_warn_on ) ) \
if ( ! WARN ( i915_modparams . verbose_state_checks , format ) ) \
DRM_ERROR ( format ) ; \
unlikely ( __ret_warn_on ) ; \
} )
# define I915_STATE_WARN_ON(x) \
I915_STATE_WARN ( ( x ) , " %s " , " WARN_ON( " __stringify ( x ) " ) " )
2017-12-21 21:57:30 +00:00
# endif