rebased refactor of intel_display
Subsystems (3)
cover rebased refactor of intel_display
I inadvertently pushed some patches this morning that ended up conflicting with Dave's series [1], so here's a rebase.
Two patches in the end are missing Dave's Signed-off-by.
I also fixed some HDRTEST issues. Dave, could I persuade you to enable CONFIG_DRM_I915_WERROR=y when building i915 please? It'll keep the headers clean.
BR,
Jani.
[1] https://patchwork.freedesktop.org/series/85846/
Dave Airlie (11):
drm/i915: refactor some crtc code out of intel display. (v2) drm/i915: refactor pll code out into intel_dpll.c drm/i915: split fdi code out from intel_display.c drm/i915: refactor ddi translations into a separate file drm/i915: migrate hsw fdi code to new file. drm/i915: migrate skl planes code new file (v3) drm/i915: move pipe update code into crtc. drm/i915: split fb scalable checks into g4x and skl versions drm/i915: move is_ccs_modifier to an inline drm/i915: migrate pll enable/disable code to intel_dpll.[ch] drm/i915: migrate i9xx plane get config
drivers/gpu/drm/i915/Makefile | 7 +- drivers/gpu/drm/i915/display/i9xx_plane.c | 123 +- drivers/gpu/drm/i915/display/i9xx_plane.h | 4 + drivers/gpu/drm/i915/display/icl_dsi.c | 1 + drivers/gpu/drm/i915/display/intel_crt.c | 1 + drivers/gpu/drm/i915/display/intel_crtc.c | 564 +++ drivers/gpu/drm/i915/display/intel_crtc.h | 22 + drivers/gpu/drm/i915/display/intel_ddi.c | 1559 +----- drivers/gpu/drm/i915/display/intel_ddi.h | 8 +- .../drm/i915/display/intel_ddi_buf_trans.c | 1358 ++++++ .../drm/i915/display/intel_ddi_buf_trans.h | 100 + drivers/gpu/drm/i915/display/intel_display.c | 4193 +---------------- drivers/gpu/drm/i915/display/intel_display.h | 34 +- .../drm/i915/display/intel_display_types.h | 51 + drivers/gpu/drm/i915/display/intel_dp.c | 1 + drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/display/intel_dpll.c | 1872 ++++++++ drivers/gpu/drm/i915/display/intel_dpll.h | 41 + drivers/gpu/drm/i915/display/intel_fdi.c | 822 ++++ drivers/gpu/drm/i915/display/intel_fdi.h | 25 + drivers/gpu/drm/i915/display/intel_pps.c | 1 + drivers/gpu/drm/i915/display/intel_psr.c | 1 + drivers/gpu/drm/i915/display/intel_sprite.c | 1662 +------ drivers/gpu/drm/i915/display/intel_sprite.h | 6 +- .../drm/i915/display/skl_universal_plane.c | 2263 +++++++++ .../drm/i915/display/skl_universal_plane.h | 33 + drivers/gpu/drm/i915/display/vlv_dsi.c | 1 + drivers/gpu/drm/i915/intel_pm.c | 1 + 28 files changed, 7522 insertions(+), 7233 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_crtc.c create mode 100644 drivers/gpu/drm/i915/display/intel_crtc.h create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h create mode 100644 drivers/gpu/drm/i915/display/intel_dpll.c create mode 100644 drivers/gpu/drm/i915/display/intel_dpll.h create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.c create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.h create mode 100644 drivers/gpu/drm/i915/display/skl_universal_plane.c create mode 100644 drivers/gpu/drm/i915/display/skl_universal_plane.h
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/11 drm/i915: refactor some crtc code out of intel display. (v2)
From: Dave Airlie <[email protected]>
There may be more crtc code that can be pulled out, but this is a good start.
v2: move plane before this.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_crtc.c | 325 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_crtc.h | 22 ++ drivers/gpu/drm/i915/display/intel_display.c | 305 +---------------- 4 files changed, 349 insertions(+), 304 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_crtc.c create mode 100644 drivers/gpu/drm/i915/display/intel_crtc.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -200,6 +200,7 @@ i915-y += \ display/intel_color.o \ display/intel_combo_phy.o \ display/intel_connector.o \ + display/intel_crtc.o \ display/intel_csr.o \ display/intel_cursor.o \ display/intel_display.o \
drivers/gpu/drm/i915/display/intel_crtc.c new file +325 -0
325 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_crtc.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef _INTEL_CRTC_H_ +#define _INTEL_CRTC_H_ + +#include <linux/types.h> + +enum pipe ; +struct drm_i915_private ; +struct intel_crtc ; +struct intel_crtc_state ; + +u32 intel_crtc_max_vblank_count (const struct intel_crtc_state *crtc_state); +int intel_crtc_init (struct drm_i915_private *dev_priv,enum pipe pipe); +struct intel_crtc_state *intel_crtc_state_alloc (struct intel_crtc *crtc); +void intel_crtc_state_reset (struct intel_crtc_state *crtc_state, +struct intel_crtc *crtc); + +#endif
drivers/gpu/drm/i915/display/intel_display.c +1 -304
360 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/11 drm/i915: refactor pll code out into intel_dpll.c
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
This pulls a large chunk of the pll calculation code out of intel_display.c to a new file.
One function makes sense to be an inline, otherwise this is pretty much a straight copy cover. Also all the remaining hooks for g45 and older end up the same now.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_display.c | 1402 +---------------- drivers/gpu/drm/i915/display/intel_display.h | 3 + .../drm/i915/display/intel_display_types.h | 13 + drivers/gpu/drm/i915/display/intel_dpll.c | 1363 ++++++++++++++++ drivers/gpu/drm/i915/display/intel_dpll.h | 23 + 6 files changed, 1414 insertions(+), 1391 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_dpll.c create mode 100644 drivers/gpu/drm/i915/display/intel_dpll.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -206,6 +206,7 @@ i915-y += \ display/intel_display.o \ display/intel_display_power.o \ display/intel_dpio_phy.o \ + display/intel_dpll.o \ display/intel_dpll_mgr.o \ display/intel_dsb.o \ display/intel_fbc.o \
drivers/gpu/drm/i915/display/intel_display.c +11 -1391
1,500 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display.h +3 -0
@@ -651,6 +651,9 @@ u32 intel_plane_compute_aligned_offset(int *x, int *y, int color_plane);int intel_plane_pin_fb (struct intel_plane_state *plane_state);void intel_plane_unpin_fb (struct intel_plane_state *old_plane_state); +struct intel_encoder * +intel_get_crtc_new_encoder (const struct intel_atomic_state *state, +const struct intel_crtc_state *crtc_state);/* modesetting */ void intel_modeset_init_hw (struct drm_i915_private *i915);
drivers/gpu/drm/i915/display/intel_display_types.h +13 -0
@@ -1839,4 +1839,17 @@ to_intel_frontbuffer(struct drm_framebuffer *fb) return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL; } +static inline bool intel_panel_use_ssc (struct drm_i915_private *dev_priv) +{ +if (dev_priv->params.panel_use_ssc >=0 ) +return dev_priv->params.panel_use_ssc !=0 ; +return dev_priv->vbt.lvds_use_ssc + && !(dev_priv->quirks &QUIRK_LVDS_SSC_DISABLE ); +} + +static inline u32 i9xx_dpll_compute_fp (struct dpll *dpll) +{ +return dpll->n <<16 | dpll->m1 <<8 | dpll->m2; +} +#endif /* __INTEL_DISPLAY_TYPES_H__ */
drivers/gpu/drm/i915/display/intel_dpll.c new file +1363 -0
1,363 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dpll.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef _INTEL_DPLL_H_ +#define _INTEL_DPLL_H_ + +struct dpll ; +struct drm_i915_private ; +struct intel_crtc ; +struct intel_crtc_state ; + +void intel_dpll_init_clock_hook (struct drm_i915_private *dev_priv); +int vlv_calc_dpll_params (int refclk,struct dpll *clock); +int pnv_calc_dpll_params (int refclk,struct dpll *clock); +int i9xx_calc_dpll_params (int refclk,struct dpll *clock); +void vlv_compute_dpll (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config); +void chv_compute_dpll (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config); + +#endif
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/11 drm/i915: split fdi code out from intel_display.c
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
This just refactors out the fdi code to a separate file.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_display.c | 685 +----------------- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_fdi.c | 683 +++++++++++++++++ drivers/gpu/drm/i915/display/intel_fdi.h | 22 + 5 files changed, 718 insertions(+), 682 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.c create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -210,6 +210,7 @@ i915-y += \ display/intel_dpll_mgr.o \ display/intel_dsb.o \ display/intel_fbc.o \ + display/intel_fdi.o \ display/intel_fifo_underrun.o \ display/intel_frontbuffer.o \ display/intel_global_state.o \
drivers/gpu/drm/i915/display/intel_display.c +3 -682
721 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display_types.h +9 -0
@@ -1852,4 +1852,13 @@ static inline u32 i9xx_dpll_compute_fp(struct dpll *dpll) return dpll->n << 16 | dpll->m1 << 8 | dpll->m2; } +static inline u32 intel_fdi_link_freq (struct drm_i915_private *dev_priv, +const struct intel_crtc_state *pipe_config) +{ +if (HAS_DDI (dev_priv)) +return pipe_config->port_clock;/* SPLL */ +else +return dev_priv->fdi_pll_freq; +} +#endif /* __INTEL_DISPLAY_TYPES_H__ */
drivers/gpu/drm/i915/display/intel_fdi.c new file +683 -0
683 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_fdi.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef _INTEL_FDI_H_ +#define _INTEL_FDI_H_ + +struct drm_i915_private ; +struct intel_crtc ; +struct intel_crtc_state ; + +#define I915_DISPLAY_CONFIG_RETRY 1 +int ilk_fdi_compute_config (struct intel_crtc *intel_crtc, +struct intel_crtc_state *pipe_config); +void intel_fdi_normal_train (struct intel_crtc *crtc); +void ilk_fdi_disable (struct intel_crtc *crtc); +void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc); +void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state); +void intel_fdi_init_hook (struct drm_i915_private *dev_priv); + +#endif
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/11 drm/i915: refactor ddi translations into a separate file
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
Ville suggested this, these tables are probably better being standalone.
This fixes up the cnl/bxt interfaces to be like the others, the intel one I left alone since it has a few extra entrypoints.
v2 by Jani: fix intel_ddi_buf_trans.h header test
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_ddi.c | 1417 +---------------- .../drm/i915/display/intel_ddi_buf_trans.c | 1358 ++++++++++++++++ .../drm/i915/display/intel_ddi_buf_trans.h | 100 ++ 4 files changed, 1471 insertions(+), 1405 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -241,6 +241,7 @@ i915-y += \ display/icl_dsi.o \ display/intel_crt.o \ display/intel_ddi.o \ + display/intel_ddi_buf_trans.o \ display/intel_dp.o \ display/intel_dp_aux_backlight.o \ display/intel_dp_hdcp.o \
drivers/gpu/drm/i915/display/intel_ddi.c +12 -1405
1,479 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c new file +1358 -0
1,358 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h new file +100 -0
100 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/11 drm/i915: migrate hsw fdi code to new file.
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
Daniel asked for this, but it's a bit messy and I'm not sure how best to clean it up yet.
--- drivers/gpu/drm/i915/display/intel_crt.c | 1 + drivers/gpu/drm/i915/display/intel_ddi.c | 151 ++--------------------- drivers/gpu/drm/i915/display/intel_ddi.h | 8 +- drivers/gpu/drm/i915/display/intel_fdi.c | 139 +++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_fdi.h | 3 + 5 files changed, 156 insertions(+), 146 deletions(-)
drivers/gpu/drm/i915/display/intel_crt.c +1 -0
@@ -38,6 +38,7 @@#include "intel_crt.h" #include "intel_ddi.h" #include "intel_display_types.h" +#include "intel_fdi.h" #include "intel_fifo_underrun.h" #include "intel_gmbus.h" #include "intel_hotplug.h"
drivers/gpu/drm/i915/display/intel_ddi.c +7 -144
184 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_ddi.h +6 -2
@@ -17,6 +17,7 @@ struct intel_crtc_state;struct intel_dp ;struct intel_dpll_hw_state ;struct intel_encoder ; +struct intel_shared_dpll ;enum transcoder ; i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder,
@@ -27,8 +28,11 @@ void intel_ddi_fdi_post_disable(struct intel_atomic_state *state,struct intel_encoder *intel_encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state); -void hsw_fdi_link_train (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state); +u32 hsw_pll_to_ddi_pll_sel (const struct intel_shared_dpll *pll); +void intel_prepare_dp_ddi_buffers (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state); +void intel_wait_ddi_buf_idle (struct drm_i915_private *dev_priv, +enum port port);void intel_ddi_init (struct drm_i915_private *dev_priv,enum port port);bool intel_ddi_get_hw_state (struct intel_encoder *encoder,enum pipe *pipe); void intel_ddi_enable_transcoder_func(struct intel_encoder *encoder,
drivers/gpu/drm/i915/display/intel_fdi.c +139 -0
151 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_fdi.h +3 -0
@@ -9,6 +9,7 @@struct drm_i915_private ;struct intel_crtc ;struct intel_crtc_state ; +struct intel_encoder ;#define I915_DISPLAY_CONFIG_RETRY 1 int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
@@ -18,5 +19,7 @@ void ilk_fdi_disable(struct intel_crtc *crtc);void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc);void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state);void intel_fdi_init_hook (struct drm_i915_private *dev_priv); +void hsw_fdi_link_train (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state);#endif
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/11 drm/i915: migrate skl planes code new file (v3)
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
Rework the plane init calls to do the gen test one level higher.
Rework some of the plane helpers so they can live in new file, there is still some scope to clean up the plane/fb interactions later.
v2: drop atomic code back, rename file to Ville suggestions, add header file.
v3: move scaler bits back
--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 - drivers/gpu/drm/i915/display/icl_dsi.c | 1 + drivers/gpu/drm/i915/display/intel_crtc.c | 13 +- drivers/gpu/drm/i915/display/intel_ddi.c | 1 + drivers/gpu/drm/i915/display/intel_display.c | 956 +------ drivers/gpu/drm/i915/display/intel_display.h | 27 +- .../drm/i915/display/intel_display_types.h | 21 + drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/display/intel_psr.c | 1 + drivers/gpu/drm/i915/display/intel_sprite.c | 1343 +--------- drivers/gpu/drm/i915/display/intel_sprite.h | 6 +- .../drm/i915/display/skl_universal_plane.c | 2263 +++++++++++++++++ .../drm/i915/display/skl_universal_plane.h | 33 + drivers/gpu/drm/i915/display/vlv_dsi.c | 1 + drivers/gpu/drm/i915/intel_pm.c | 1 + 16 files changed, 2383 insertions(+), 2292 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/skl_universal_plane.c create mode 100644 drivers/gpu/drm/i915/display/skl_universal_plane.h
drivers/gpu/drm/i915/Makefile +2 -1
@@ -223,7 +223,8 @@ i915-y += \ display/intel_sprite.o \ display/intel_tc.o \ display/intel_vga.o \ - display/i9xx_plane.o + display/i9xx_plane.o \ + display/skl_universal_plane.o i915-$(CONFIG_ACPI) += \ display/intel_acpi.o \ display/intel_opregion.o
drivers/gpu/drm/i915/display/i9xx_plane.c +0 -4
@@ -578,10 +578,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)int num_formats;int ret, zpos; -if (INTEL_GEN (dev_priv) >=9 ) -return skl_universal_plane_create (dev_priv, pipe, -PLANE_PRIMARY ); - plane =intel_plane_alloc ();if (IS_ERR (plane))return plane;
drivers/gpu/drm/i915/display/icl_dsi.c +1 -0
@@ -35,6 +35,7 @@#include "intel_dsi.h" #include "intel_panel.h" #include "intel_vdsc.h" +#include "skl_universal_plane.h" static int header_credits_available (struct drm_i915_private *dev_priv,enum transcoder dsi_trans)
drivers/gpu/drm/i915/display/intel_crtc.c +11 -2
@@ -20,6 +20,7 @@#include "intel_pipe_crc.h" #include "intel_sprite.h" #include "i9xx_plane.h" +#include "skl_universal_plane.h" static void assert_vblank_disabled (struct drm_crtc *crtc) {
@@ -243,7 +244,11 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe) crtc->pipe = pipe; crtc->num_scalers =RUNTIME_INFO (dev_priv)->num_scalers[pipe]; - primary =intel_primary_plane_create (dev_priv, pipe); +if (INTEL_GEN (dev_priv) >=9 ) + primary =skl_universal_plane_create (dev_priv, pipe, +PLANE_PRIMARY ); +else + primary =intel_primary_plane_create (dev_priv, pipe);if (IS_ERR (primary)) { ret =PTR_ERR (primary); goto fail;
@@ -253,7 +258,11 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)for_each_sprite (dev_priv, pipe, sprite) {struct intel_plane *plane; - plane =intel_sprite_plane_create (dev_priv, pipe, sprite); +if (INTEL_GEN (dev_priv) >=9 ) + plane =skl_universal_plane_create (dev_priv, pipe, +PLANE_SPRITE0 + sprite); +else + plane =intel_sprite_plane_create (dev_priv, pipe, sprite);if (IS_ERR (plane)) { ret =PTR_ERR (plane); goto fail;
drivers/gpu/drm/i915/display/intel_ddi.c +1 -0
@@ -53,6 +53,7 @@#include "intel_sprite.h" #include "intel_tc.h" #include "intel_vdsc.h" +#include "skl_universal_plane.h" static const u8 index_to_dp_signal_levels[] = { [0 ] =DP_TRAIN_VOLTAGE_SWING_LEVEL_0 |DP_TRAIN_PRE_EMPH_LEVEL_0 ,
drivers/gpu/drm/i915/display/intel_display.c +25 -931
1,071 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display.h +14 -13
@@ -52,6 +52,7 @@ struct intel_crtc_state;struct intel_digital_port ;struct intel_dp ;struct intel_encoder ; +struct intel_initial_plane_config ;struct intel_load_detect_pipe ;struct intel_plane ;struct intel_plane_state ;
@@ -508,7 +509,6 @@ void intel_link_compute_m_n(u16 bpp, int nlanes,struct intel_link_m_n *m_n, bool constant_n, bool fec_enable);bool is_ccs_modifier (u64 modifier); -int intel_main_to_aux_plane (const struct drm_framebuffer *fb,int main_plane);void lpt_disable_clkout_dp (struct drm_i915_private *dev_priv);u32 intel_plane_fb_max_stride (struct drm_i915_private *dev_priv,u32 pixel_format,u64 modifier);
@@ -621,18 +621,7 @@ u32 skl_scaler_get_filter_select(enum drm_scaling_filter filter, int set);void skl_scaler_setup_filter (struct drm_i915_private *dev_priv,enum pipe pipe,int id,int set,enum drm_scaling_filter filter);void ilk_pfit_disable (const struct intel_crtc_state *old_crtc_state); -u32 glk_plane_color_ctl (const struct intel_crtc_state *crtc_state, -const struct intel_plane_state *plane_state); -u32 glk_plane_color_ctl_crtc (const struct intel_crtc_state *crtc_state); -u32 skl_plane_ctl (const struct intel_crtc_state *crtc_state, -const struct intel_plane_state *plane_state); -u32 skl_plane_ctl_crtc (const struct intel_crtc_state *crtc_state); -u32 skl_plane_stride (const struct intel_plane_state *plane_state, -int plane); -int skl_check_plane_surface (struct intel_plane_state *plane_state); -int skl_calc_main_surface_offset (const struct intel_plane_state *plane_state, -int *x,int *y,u32 *offset); -int skl_format_to_fourcc (int format,bool rgb_order,bool alpha); +int bdw_get_pipemisc_bpp (struct intel_crtc *crtc);unsigned int intel_plane_fence_y_offset (const struct intel_plane_state *plane_state);
@@ -655,6 +644,18 @@ struct intel_encoder * intel_get_crtc_new_encoder(const struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state); +unsigned int intel_surf_alignment (const struct drm_framebuffer *fb, +int color_plane); +void intel_fb_plane_get_subsampling (int *hsub,int *vsub, +const struct drm_framebuffer *fb, +int color_plane); +u32 intel_plane_adjust_aligned_offset (int *x,int *y, +const struct intel_plane_state *state, +int color_plane, +u32 old_offset,u32 new_offset); +unsigned int intel_tile_width_bytes (const struct drm_framebuffer *fb,int color_plane); +unsigned int intel_tile_height (const struct drm_framebuffer *fb,int color_plane); +/* modesetting */ void intel_modeset_init_hw (struct drm_i915_private *i915);int intel_modeset_init_noirq (struct drm_i915_private *i915);
drivers/gpu/drm/i915/display/intel_display_types.h +21 -0
@@ -37,6 +37,7 @@#include <drm/drm_dp_mst_helper.h> #include <drm/drm_encoder.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_probe_helper.h> #include <drm/drm_rect.h> #include <drm/drm_vblank.h>
@@ -1861,4 +1862,24 @@ static inline u32 intel_fdi_link_freq(struct drm_i915_private *dev_priv, return dev_priv->fdi_pll_freq; } +static inline bool is_ccs_plane (const struct drm_framebuffer *fb,int plane) +{ +if (!is_ccs_modifier (fb->modifier)) +return false; + +return plane >= fb->format->num_planes /2 ; +} + +static inline bool is_gen12_ccs_modifier (u64 modifier) +{ +return modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ; + +} + +static inline bool is_gen12_ccs_plane (const struct drm_framebuffer *fb,int plane) +{ +return is_gen12_ccs_modifier (fb->modifier) &&is_ccs_plane (fb, plane); +} +#endif /* __INTEL_DISPLAY_TYPES_H__ */
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -0
@@ -39,6 +39,7 @@#include "intel_dp_mst.h" #include "intel_dpio_phy.h" #include "intel_hdcp.h" +#include "skl_universal_plane.h" static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state,
drivers/gpu/drm/i915/display/intel_psr.c +1 -0
@@ -31,6 +31,7 @@#include "intel_psr.h" #include "intel_sprite.h" #include "intel_hdmi.h" +#include "skl_universal_plane.h" /** * DOC: Panel Self Refresh (PSR/SRD)
drivers/gpu/drm/i915/display/intel_sprite.c +5 -1338
1,388 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_sprite.h +3 -3
@@ -38,9 +38,6 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);int intel_plane_check_stride (const struct intel_plane_state *plane_state);int intel_plane_check_src_coordinates (struct intel_plane_state *plane_state);int chv_plane_check_rotation (const struct intel_plane_state *plane_state); -struct intel_plane * -skl_universal_plane_create (struct drm_i915_private *dev_priv, -enum pipe pipe,enum plane_id plane_id);static inline u8 icl_hdr_plane_mask (void ) {
@@ -59,4 +56,7 @@ int hsw_plane_min_cdclk(const struct intel_crtc_state *crtc_state,int vlv_plane_min_cdclk (const struct intel_crtc_state *crtc_state,const struct intel_plane_state *plane_state); +void skl_program_scaler (struct intel_plane *plane, +const struct intel_crtc_state *crtc_state, +const struct intel_plane_state *plane_state);#endif /* __INTEL_SPRITE_H__ */
drivers/gpu/drm/i915/display/skl_universal_plane.c new file +2263 -0
365 lines not on this page · raw message
drivers/gpu/drm/i915/display/skl_universal_plane.h new file +33 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Part of the diff is not shown here. View the raw message.
PATCH 8/11 drm/i915: split fb scalable checks into g4x and skl versions
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
This just cleans these up a bit.
--- drivers/gpu/drm/i915/display/intel_sprite.c | 7 +++---- drivers/gpu/drm/i915/display/skl_universal_plane.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +3 -4
@@ -1345,19 +1345,18 @@ g4x_plane_get_hw_state(struct intel_plane *plane,return ret; } -static bool intel_fb_scalable (const struct drm_framebuffer *fb) +static bool g4x_fb_scalable (const struct drm_framebuffer *fb) {if (!fb)return false;switch (fb->format->format) {case DRM_FORMAT_C8 : -return false;case DRM_FORMAT_XRGB16161616F :case DRM_FORMAT_ARGB16161616F :case DRM_FORMAT_XBGR16161616F :case DRM_FORMAT_ABGR16161616F : -return INTEL_GEN (to_i915 (fb->dev)) >=11 ; +return false;default :return true; }
@@ -1434,7 +1433,7 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state,int max_scale =DRM_PLANE_HELPER_NO_SCALING ;int ret; -if (intel_fb_scalable (plane_state->hw.fb)) { +if (g4x_fb_scalable (plane_state->hw.fb)) {if (INTEL_GEN (dev_priv) <7 ) { min_scale =1 ; max_scale =16 <<16 ;
drivers/gpu/drm/i915/display/skl_universal_plane.c +2 -2
@@ -1645,7 +1645,7 @@ static int skl_check_plane_surface(struct intel_plane_state *plane_state)return 0 ; } -static bool intel_fb_scalable (const struct drm_framebuffer *fb) +static bool skl_fb_scalable (const struct drm_framebuffer *fb) {if (!fb)return false;
@@ -1678,7 +1678,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,return ret;/* use scaler when colorkey is not required */ -if (!plane_state->ckey.flags &&intel_fb_scalable (fb)) { +if (!plane_state->ckey.flags &&skl_fb_scalable (fb)) { min_scale =1 ; max_scale =skl_plane_max_scale (dev_priv, fb); }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/11 drm/i915: move is_ccs_modifier to an inline
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
There is no need for this to be out of line.
--- drivers/gpu/drm/i915/display/intel_display.c | 8 -------- drivers/gpu/drm/i915/display/intel_display.h | 1 - drivers/gpu/drm/i915/display/intel_display_types.h | 8 ++++++++ 3 files changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +0 -8
@@ -1791,14 +1791,6 @@ intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) } } -bool is_ccs_modifier (u64 modifier) -{ -return modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_CCS || - modifier == I915_FORMAT_MOD_Yf_TILED_CCS; -} -static int gen12_ccs_aux_stride (struct drm_framebuffer *fb,int ccs_plane) { return DIV_ROUND_UP(fb->pitches[skl_ccs_to_main_plane(fb, ccs_plane)],
drivers/gpu/drm/i915/display/intel_display.h +0 -1
@@ -508,7 +508,6 @@ void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, struct intel_link_m_n *m_n, bool constant_n, bool fec_enable); -bool is_ccs_modifier (u64 modifier);void lpt_disable_clkout_dp (struct drm_i915_private *dev_priv);u32 intel_plane_fb_max_stride (struct drm_i915_private *dev_priv,u32 pixel_format,u64 modifier);
drivers/gpu/drm/i915/display/intel_display_types.h +8 -0
@@ -1862,6 +1862,14 @@ static inline u32 intel_fdi_link_freq(struct drm_i915_private *dev_priv,return dev_priv->fdi_pll_freq; } +static inline bool is_ccs_modifier (u64 modifier) +{ +return modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_CCS || + modifier == I915_FORMAT_MOD_Yf_TILED_CCS; +} +static inline bool is_ccs_plane (const struct drm_framebuffer *fb,int plane) {if (!is_ccs_modifier (fb->modifier))
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/11 drm/i915: move pipe update code into crtc.
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
Daniel suggested this should move here.
--- drivers/gpu/drm/i915/display/intel_crtc.c | 230 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_sprite.c | 228 ------------------- 2 files changed, 230 insertions(+), 228 deletions(-)
drivers/gpu/drm/i915/display/intel_crtc.c +230 -0
@@ -10,6 +10,9 @@#include <drm/drm_plane.h> #include <drm/drm_plane_helper.h> +#include "i915_trace.h" +#include "i915_vgpu.h" +#include "intel_atomic.h" #include "intel_atomic_plane.h" #include "intel_color.h"
@@ -17,7 +20,9 @@#include "intel_cursor.h" #include "intel_display_debugfs.h" #include "intel_display_types.h" +#include "intel_dsi.h" #include "intel_pipe_crc.h" +#include "intel_psr.h" #include "intel_sprite.h" #include "i9xx_plane.h" #include "skl_universal_plane.h"
@@ -332,3 +337,228 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)return ret; } + +int intel_usecs_to_scanlines (const struct drm_display_mode *adjusted_mode, +int usecs) +{ +/* paranoia */ +if (!adjusted_mode->crtc_htotal) +return 1 ; + +return DIV_ROUND_UP (usecs * adjusted_mode->crtc_clock, +1000 * adjusted_mode->crtc_htotal); +} + +/** +* intel_pipe_update_start() - start update of a set of display registers +* @new_crtc_state: the new crtc state +* +* Mark the start of an update to pipe registers that should be updated +* atomically regarding vblank. If the next vblank will happens within +* the next 100 us, this function waits until the vblank passes. +* +* After a successful call to this function, interrupts will be disabled +* until a subsequent call to intel_pipe_update_end(). That is done to +* avoid random delays. +*/ +void intel_pipe_update_start (const struct intel_crtc_state *new_crtc_state) +{ +struct intel_crtc *crtc =to_intel_crtc (new_crtc_state->uapi.crtc); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +const struct drm_display_mode *adjusted_mode = &new_crtc_state->hw.adjusted_mode; +long timeout =msecs_to_jiffies_timeout (1 ); +int scanline, min, max, vblank_start; +wait_queue_head_t *wq =drm_crtc_vblank_waitqueue (&crtc->base); +bool need_vlv_dsi_wa = (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv)) && +intel_crtc_has_type (new_crtc_state,INTEL_OUTPUT_DSI ); +DEFINE_WAIT (wait); +u32 psr_status; + +if (new_crtc_state->uapi.async_flip) +return ; + + vblank_start = adjusted_mode->crtc_vblank_start; +if (adjusted_mode->flags &DRM_MODE_FLAG_INTERLACE ) + vblank_start =DIV_ROUND_UP (vblank_start,2 ); + +/* FIXME needs to be calibrated sensibly */ + min = vblank_start -intel_usecs_to_scanlines (adjusted_mode, +VBLANK_EVASION_TIME_US ); + max = vblank_start -1 ; + +if (min <=0 || max <=0 ) + goto irq_disable; + +if (drm_WARN_ON (&dev_priv->drm,drm_crtc_vblank_get (&crtc->base))) + goto irq_disable; + +/* +* Wait for psr to idle out after enabling the VBL interrupts +* VBL interrupts will start the PSR exit and prevent a PSR +* re-entry as well. +*/ +if (intel_psr_wait_for_idle (new_crtc_state, &psr_status)) +drm_err (&dev_priv->drm, +"PSR idle timed out 0x%x, atomic update may fail\n" , + psr_status); + +local_irq_disable (); + + crtc->debug.min_vbl = min; + crtc->debug.max_vbl = max; +trace_intel_pipe_update_start (crtc); + +for (;;) { +/* +* prepare_to_wait() has a memory barrier, which guarantees +* other CPUs can see the task state update by the time we +* read the scanline. +*/ +prepare_to_wait (wq, &wait,TASK_UNINTERRUPTIBLE ); + + scanline =intel_get_crtc_scanline (crtc); +if (scanline < min || scanline > max) +break ; + +if (!timeout) { +drm_err (&dev_priv->drm, +"Potential atomic update failure on pipe %c\n" , +pipe_name (crtc->pipe)); +break ; + } + +local_irq_enable (); + + timeout =schedule_timeout (timeout); + +local_irq_disable (); + } + +finish_wait (wq, &wait); + +drm_crtc_vblank_put (&crtc->base); + +/* +* On VLV/CHV DSI the scanline counter would appear to +* increment approx. 1/3 of a scanline before start of vblank. +* The registers still get latched at start of vblank however. +* This means we must not write any registers on the first +* line of vblank (since not the whole line is actually in +* vblank). And unfortunately we can't use the interrupt to +* wait here since it will fire too soon. We could use the +* frame start interrupt instead since it will fire after the +* critical scanline, but that would require more changes +* in the interrupt code. So for now we'll just do the nasty +* thing and poll for the bad scanline to pass us by. +* +* FIXME figure out if BXT+ DSI suffers from this as well +*/ +while (need_vlv_dsi_wa && scanline == vblank_start) + scanline =intel_get_crtc_scanline (crtc); + + crtc->debug.scanline_start = scanline; + crtc->debug.start_vbl_time =ktime_get (); + crtc->debug.start_vbl_count =intel_crtc_get_vblank_counter (crtc); + +trace_intel_pipe_update_vblank_evaded (crtc); +return ; + +irq_disable: +local_irq_disable (); +} + +#if IS_ENABLED (CONFIG_DRM_I915_DEBUG_VBLANK_EVADE ) +static void dbg_vblank_evade (struct intel_crtc *crtc,ktime_t end) +{ +u64 delta =ktime_to_ns (ktime_sub (end, crtc->debug.start_vbl_time)); +unsigned int h; + + h =ilog2 (delta >>9 ); +if (h >=ARRAY_SIZE (crtc->debug.vbl.times)) + h =ARRAY_SIZE (crtc->debug.vbl.times) -1 ; + crtc->debug.vbl.times[h]++; + + crtc->debug.vbl.sum += delta; +if (!crtc->debug.vbl.min || delta < crtc->debug.vbl.min) + crtc->debug.vbl.min = delta; +if (delta > crtc->debug.vbl.max) + crtc->debug.vbl.max = delta; + +if (delta >1000 *VBLANK_EVASION_TIME_US ) { +drm_dbg_kms (crtc->base.dev, +"Atomic update on pipe (%c) took %lld us, max time under evasion is %u us\n" , +pipe_name (crtc->pipe), +div_u64 (delta,1000 ), +VBLANK_EVASION_TIME_US ); + crtc->debug.vbl.over++; + } +} +#else +static void dbg_vblank_evade (struct intel_crtc *crtc,ktime_t end) {} +#endif + +/** +* intel_pipe_update_end() - end update of a set of display registers +* @new_crtc_state: the new crtc state +* +* Mark the end of an update started with intel_pipe_update_start(). This +* re-enables interrupts and verifies the update was actually completed +* before a vblank. +*/ +void intel_pipe_update_end (struct intel_crtc_state *new_crtc_state) +{ +struct intel_crtc *crtc =to_intel_crtc (new_crtc_state->uapi.crtc); +enum pipe pipe = crtc->pipe; +int scanline_end =intel_get_crtc_scanline (crtc); +u32 end_vbl_count =intel_crtc_get_vblank_counter (crtc); +ktime_t end_vbl_time =ktime_get (); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); + +if (new_crtc_state->uapi.async_flip) +return ; + +trace_intel_pipe_update_end (crtc, end_vbl_count, scanline_end); + +/* +* Incase of mipi dsi command mode, we need to set frame update +* request for every commit. +*/ +if (INTEL_GEN (dev_priv) >=11 && +intel_crtc_has_type (new_crtc_state,INTEL_OUTPUT_DSI )) +icl_dsi_frame_update (new_crtc_state); + +/* We're still in the vblank-evade critical section, this can't race. +* Would be slightly nice to just grab the vblank count and arm the +* event outside of the critical section - the spinlock might spin for a +* while ... */ +if (new_crtc_state->uapi.event) { +drm_WARN_ON (&dev_priv->drm, +drm_crtc_vblank_get (&crtc->base) !=0 ); + +spin_lock (&crtc->base.dev->event_lock); +drm_crtc_arm_vblank_event (&crtc->base, + new_crtc_state->uapi.event); +spin_unlock (&crtc->base.dev->event_lock); + + new_crtc_state->uapi.event =NULL ; + } + +local_irq_enable (); + +if (intel_vgpu_active (dev_priv)) +return ; + +if (crtc->debug.start_vbl_count && + crtc->debug.start_vbl_count != end_vbl_count) { +drm_err (&dev_priv->drm, +"Atomic update failure on pipe %c (start=%u end=%u) time %lld us, min %d, max %d, scanline start %d, end %d\n" , +pipe_name (pipe), crtc->debug.start_vbl_count, + end_vbl_count, +ktime_us_delta (end_vbl_time, + crtc->debug.start_vbl_time), + crtc->debug.min_vbl, crtc->debug.max_vbl, + crtc->debug.scanline_start, scanline_end); + } + +dbg_vblank_evade (crtc, end_vbl_time); +}
drivers/gpu/drm/i915/display/intel_sprite.c +0 -228
237 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/11 drm/i915: migrate pll enable/disable code to intel_dpll.[ch]
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
This moves the older i9xx/vlv/chv enable/disable to dpll file.
!!! FIXME: Dave's s-o-b !!!
--- drivers/gpu/drm/i915/display/intel_display.c | 512 ------------------- drivers/gpu/drm/i915/display/intel_display.h | 3 - drivers/gpu/drm/i915/display/intel_dp.c | 1 + drivers/gpu/drm/i915/display/intel_dpll.c | 509 ++++++++++++++++++ drivers/gpu/drm/i915/display/intel_dpll.h | 18 + drivers/gpu/drm/i915/display/intel_pps.c | 1 + 6 files changed, 529 insertions(+), 515 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +0 -512
@@ -109,10 +109,6 @@ static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state);static void ilk_set_pipeconf (const struct intel_crtc_state *crtc_state);static void hsw_set_pipeconf (const struct intel_crtc_state *crtc_state);static void bdw_set_pipemisc (const struct intel_crtc_state *crtc_state); -static void vlv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config); -static void chv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config);static void ilk_pfit_enable (const struct intel_crtc_state *crtc_state);static void intel_modeset_setup_hw_state (struct drm_device *dev,struct drm_modeset_acquire_ctx *ctx);
@@ -565,224 +561,6 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,assert_pch_hdmi_disabled (dev_priv, pipe,PORT_D ,PCH_HDMID ); } -static void _vlv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); -intel_de_posting_read (dev_priv,DPLL (pipe)); -udelay (150 ); - -if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) -drm_err (&dev_priv->drm,"DPLL %d failed to lock\n" , pipe); -} - -static void vlv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -assert_panel_unlocked (dev_priv, pipe); - -if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) -_vlv_enable_pll (crtc, pipe_config); - -intel_de_write (dev_priv,DPLL_MD (pipe), - pipe_config->dpll_hw_state.dpll_md); -intel_de_posting_read (dev_priv,DPLL_MD (pipe)); -} - - -static void _chv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 tmp; - -vlv_dpio_get (dev_priv); - -/* Enable back the 10bit clock to display controller */ - tmp =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); - tmp |=DPIO_DCLKP_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), tmp); - -vlv_dpio_put (dev_priv); - -/* -* Need to wait > 100ns between dclkp clock enable bit and PLL enable. -*/ -udelay (1 ); - -/* Enable PLL */ -intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); - -/* Check PLL is locked */ -if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) -drm_err (&dev_priv->drm,"PLL %d failed to lock\n" , pipe); -} - -static void chv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -assert_panel_unlocked (dev_priv, pipe); - -if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) -_chv_enable_pll (crtc, pipe_config); - -if (pipe !=PIPE_A ) { -/* -* WaPixelRepeatModeFixForC0:chv -* -* DPLLCMD is AWOL. Use chicken bits to propagate -* the value from DPLLBMD to either pipe B or C. -*/ -intel_de_write (dev_priv,CBR4_VLV ,CBR_DPLLBMD_PIPE (pipe)); -intel_de_write (dev_priv,DPLL_MD (PIPE_B ), - pipe_config->dpll_hw_state.dpll_md); -intel_de_write (dev_priv,CBR4_VLV ,0 ); - dev_priv->chv_dpll_md[pipe] = pipe_config->dpll_hw_state.dpll_md; - -/* -* DPLLB VGA mode also seems to cause problems. -* We should always have it disabled. -*/ -drm_WARN_ON (&dev_priv->drm, - (intel_de_read (dev_priv,DPLL (PIPE_B )) & -DPLL_VGA_MODE_DIS ) ==0 ); - }else { -intel_de_write (dev_priv,DPLL_MD (pipe), - pipe_config->dpll_hw_state.dpll_md); -intel_de_posting_read (dev_priv,DPLL_MD (pipe)); - } -} - -static bool i9xx_has_pps (struct drm_i915_private *dev_priv) -{ -if (IS_I830 (dev_priv)) -return false; - -return IS_PINEVIEW (dev_priv) ||IS_MOBILE (dev_priv); -} - -static void i9xx_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -i915_reg_t reg =DPLL (crtc->pipe); -u32 dpll = crtc_state->dpll_hw_state.dpll; -int i; - -assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -if (i9xx_has_pps (dev_priv)) -assert_panel_unlocked (dev_priv, crtc->pipe); - -/* -* Apparently we need to have VGA mode enabled prior to changing -* the P1/P2 dividers. Otherwise the DPLL will keep using the old -* dividers, even though the register value does change. -*/ -intel_de_write (dev_priv, reg, dpll & ~DPLL_VGA_MODE_DIS ); -intel_de_write (dev_priv, reg, dpll); - -/* Wait for the clocks to stabilize. */ -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -if (INTEL_GEN (dev_priv) >=4 ) { -intel_de_write (dev_priv,DPLL_MD (crtc->pipe), - crtc_state->dpll_hw_state.dpll_md); - }else { -/* The pixel multiplier can only be updated once the -* DPLL is enabled and the clocks are stable. -* -* So write it again. -*/ -intel_de_write (dev_priv, reg, dpll); - } - -/* We do this three times for luck */ -for (i =0 ; i <3 ; i++) { -intel_de_write (dev_priv, reg, dpll); -intel_de_posting_read (dev_priv, reg); -udelay (150 );/* wait for warmup */ - } -} - -static void i9xx_disable_pll (const struct intel_crtc_state *crtc_state) -{ -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -/* Don't disable pipe or pipe PLLs if needed */ -if (IS_I830 (dev_priv)) -return ; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); - -intel_de_write (dev_priv,DPLL (pipe),DPLL_VGA_MODE_DIS ); -intel_de_posting_read (dev_priv,DPLL (pipe)); -} - -static void vlv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -u32 val; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, (enum transcoder )pipe); - - val =DPLL_INTEGRATED_REF_CLK_VLV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; -if (pipe !=PIPE_A ) - val |=DPLL_INTEGRATED_CRI_CLK_VLV ; - -intel_de_write (dev_priv,DPLL (pipe), val); -intel_de_posting_read (dev_priv,DPLL (pipe)); -} - -static void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 val; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, (enum transcoder )pipe); - - val =DPLL_SSC_REF_CLK_CHV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; -if (pipe !=PIPE_A ) - val |=DPLL_INTEGRATED_CRI_CLK_VLV ; - -intel_de_write (dev_priv,DPLL (pipe), val); -intel_de_posting_read (dev_priv,DPLL (pipe)); - -vlv_dpio_get (dev_priv); - -/* Disable 10bit clock to display controller */ - val =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); - val &= ~DPIO_DCLKP_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), val); - -vlv_dpio_put (dev_priv); -} -void vlv_wait_port_ready (struct drm_i915_private *dev_priv,struct intel_digital_port *dig_port,unsigned int expected_mask)
@@ -5709,35 +5487,6 @@ static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv) } } -static void vlv_pllb_recal_opamp (struct drm_i915_private *dev_priv,enum pipe - pipe) -{ -u32 reg_val; - -/* -* PLLB opamp always calibrates to max value of 0x3f, force enable it -* and set it to a reasonable value instead. -*/ - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); - reg_val &=0xffffff00 ; - reg_val |=0x00000030 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); - reg_val &=0x00ffffff ; - reg_val |=0x8c000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); - reg_val &=0xffffff00 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); - reg_val &=0x00ffffff ; - reg_val |=0xb0000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); -} -static void intel_pch_transcoder_set_m_n (const struct intel_crtc_state *crtc_state,const struct intel_link_m_n *m_n) {
@@ -5833,267 +5582,6 @@ void intel_dp_set_m_n(const struct intel_crtc_state *crtc_state, enum link_m_n_sintel_cpu_transcoder_set_m_n (crtc_state, dp_m_n, dp_m2_n2); } -static void vlv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -u32 mdiv; -u32 bestn, bestm1, bestm2, bestp1, bestp2; -u32 coreclk, reg_val; - -/* Enable Refclk */ -intel_de_write (dev_priv,DPLL (pipe), - pipe_config->dpll_hw_state.dpll & ~(DPLL_VCO_ENABLE |DPLL_EXT_BUFFER_ENABLE_VLV )); - -/* No need to actually set up the DPLL with DSI */ -if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) -return ; - -vlv_dpio_get (dev_priv); - - bestn = pipe_config->dpll.n; - bestm1 = pipe_config->dpll.m1; - bestm2 = pipe_config->dpll.m2; - bestp1 = pipe_config->dpll.p1; - bestp2 = pipe_config->dpll.p2; - -/* See eDP HDMI DPIO driver vbios notes doc */ - -/* PLL B needs special handling */ -if (pipe ==PIPE_B ) -vlv_pllb_recal_opamp (dev_priv, pipe); - -/* Set up Tx target for periodic Rcomp update */ -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9_BCAST ,0x0100000f ); - -/* Disable target IRef on PLL */ - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW8 (pipe)); - reg_val &=0x00ffffff ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW8 (pipe), reg_val); - -/* Disable fast lock */ -vlv_dpio_write (dev_priv, pipe,VLV_CMN_DW0 ,0x610 ); - -/* Set idtafcrecal before PLL is enabled */ - mdiv = ((bestm1 <<DPIO_M1DIV_SHIFT ) | (bestm2 &DPIO_M2DIV_MASK )); - mdiv |= ((bestp1 <<DPIO_P1_SHIFT ) | (bestp2 <<DPIO_P2_SHIFT )); - mdiv |= ((bestn <<DPIO_N_SHIFT )); - mdiv |= (1 <<DPIO_K_SHIFT ); - -/* -* Post divider depends on pixel clock rate, DAC vs digital (and LVDS, -* but we don't support that). -* Note: don't use the DAC post divider as it seems unstable. -*/ - mdiv |= (DPIO_POST_DIV_HDMIDP <<DPIO_POST_DIV_SHIFT ); -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); - - mdiv |=DPIO_ENABLE_CALIBRATION ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); - -/* Set HBR and RBR LPF coefficients */ -if (pipe_config->port_clock ==162000 || -intel_crtc_has_type (pipe_config,INTEL_OUTPUT_ANALOG ) || -intel_crtc_has_type (pipe_config,INTEL_OUTPUT_HDMI )) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), -0x009f0003 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), -0x00d0000f ); - -if (intel_crtc_has_dp_encoder (pipe_config)) { -/* Use SSC source */ -if (pipe ==PIPE_A ) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df40000 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df70000 ); - }else {/* HDMI or VGA */ -/* Use bend source */ -if (pipe ==PIPE_A ) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df70000 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df40000 ); - } - - coreclk =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW7 (pipe)); - coreclk = (coreclk &0x0000ff00 ) |0x01c00000 ; -if (intel_crtc_has_dp_encoder (pipe_config)) - coreclk |=0x01000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW7 (pipe), coreclk); - -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW11 (pipe),0x87871000 ); - -vlv_dpio_put (dev_priv); -} - -static void chv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 loopfilter, tribuf_calcntr; -u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; -u32 dpio_val; -int vco; - -/* Enable Refclk and SSC */ -intel_de_write (dev_priv,DPLL (pipe), - pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE ); - -/* No need to actually set up the DPLL with DSI */ -if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) -return ; - - bestn = pipe_config->dpll.n; - bestm2_frac = pipe_config->dpll.m2 &0x3fffff ; - bestm1 = pipe_config->dpll.m1; - bestm2 = pipe_config->dpll.m2 >>22 ; - bestp1 = pipe_config->dpll.p1; - bestp2 = pipe_config->dpll.p2; - vco = pipe_config->dpll.vco; - dpio_val =0 ; - loopfilter =0 ; - -vlv_dpio_get (dev_priv); - -/* p1 and p2 divider */ -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW13 (port), -5 <<DPIO_CHV_S1_DIV_SHIFT | - bestp1 <<DPIO_CHV_P1_DIV_SHIFT | - bestp2 <<DPIO_CHV_P2_DIV_SHIFT | -1 <<DPIO_CHV_K_DIV_SHIFT ); - -/* Feedback post-divider - m2 */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW0 (port), bestm2); - -/* Feedback refclk divider - n and m1 */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW1 (port), -DPIO_CHV_M1_DIV_BY_2 | -1 <<DPIO_CHV_N_DIV_SHIFT ); - -/* M2 fraction division */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW2 (port), bestm2_frac); - -/* M2 fraction division enable */ - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port)); - dpio_val &= ~(DPIO_CHV_FEEDFWD_GAIN_MASK |DPIO_CHV_FRAC_DIV_EN ); - dpio_val |= (2 <<DPIO_CHV_FEEDFWD_GAIN_SHIFT ); -if (bestm2_frac) - dpio_val |=DPIO_CHV_FRAC_DIV_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW3 (port), dpio_val); - -/* Program digital lock detect threshold */ - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW9 (port)); - dpio_val &= ~(DPIO_CHV_INT_LOCK_THRESHOLD_MASK | -DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ); - dpio_val |= (0x5 <<DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT ); -if (!bestm2_frac) - dpio_val |=DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ; -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW9 (port), dpio_val); - -/* Loop filter */ -if (vco ==5400000 ) { - loopfilter |= (0x3 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x8 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x1 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x9 ; - }else if (vco <=6200000 ) { - loopfilter |= (0x5 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0xB <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x9 ; - }else if (vco <=6480000 ) { - loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x8 ; - }else { -/* Not supported. Apply the same limits as in the max case */ - loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0 ; - } -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW6 (port), loopfilter); - - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW8 (port)); - dpio_val &= ~DPIO_CHV_TDC_TARGET_CNT_MASK ; - dpio_val |= (tribuf_calcntr <<DPIO_CHV_TDC_TARGET_CNT_SHIFT ); -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW8 (port), dpio_val); - -/* AFC Recal */ -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), -vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)) | -DPIO_AFC_RECAL ); - -vlv_dpio_put (dev_priv); -} - -/** -* vlv_force_pll_on - forcibly enable just the PLL -* @dev_priv: i915 private structure -* @pipe: pipe PLL to enable -* @dpll: PLL configuration -* -* Enable the PLL for @pipe using the supplied @dpll config. To be used -* in cases where we need the PLL enabled even when @pipe is not going to -* be enabled. -*/ -int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, -const struct dpll *dpll) -{ -struct intel_crtc *crtc =intel_get_crtc_for_pipe (dev_priv, pipe); -struct intel_crtc_state *pipe_config; - - pipe_config =intel_crtc_state_alloc (crtc); -if (!pipe_config) -return -ENOMEM ; - - pipe_config->cpu_transcoder = (enum transcoder )pipe; - pipe_config->pixel_multiplier =1 ; - pipe_config->dpll = *dpll; - -if (IS_CHERRYVIEW (dev_priv)) { -chv_compute_dpll (crtc, pipe_config); -chv_prepare_pll (crtc, pipe_config); -chv_enable_pll (crtc, pipe_config); - }else { -vlv_compute_dpll (crtc, pipe_config); -vlv_prepare_pll (crtc, pipe_config); -vlv_enable_pll (crtc, pipe_config); - } - -kfree (pipe_config); - -return 0 ; -} - -/** -* vlv_force_pll_off - forcibly disable just the PLL -* @dev_priv: i915 private structure -* @pipe: pipe PLL to disable -* -* Disable the PLL for @pipe. To be used in cases where we need -* the PLL enabled even when @pipe is not going to be enabled. -*/ -void vlv_force_pll_off (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -if (IS_CHERRYVIEW (dev_priv)) -chv_disable_pll (dev_priv, pipe); -else -vlv_disable_pll (dev_priv, pipe); -} - - -static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);
drivers/gpu/drm/i915/display/intel_display.h +0 -3
@@ -586,9 +586,6 @@ void intel_cleanup_plane_fb(struct drm_plane *plane,void assert_pch_transcoder_disabled (struct drm_i915_private *dev_priv,enum pipe pipe); -int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, -const struct dpll *dpll); -void vlv_force_pll_off (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);
drivers/gpu/drm/i915/display/intel_dp.c +1 -0
@@ -50,6 +50,7 @@#include "intel_dp.h" #include "intel_dp_link_training.h" #include "intel_dp_mst.h" +#include "intel_dpll.h" #include "intel_dpio_phy.h" #include "intel_fifo_underrun.h" #include "intel_hdcp.h"
drivers/gpu/drm/i915/display/intel_dpll.c +509 -0
523 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dpll.h +18 -0
@@ -10,6 +10,7 @@ struct dpll;struct drm_i915_private ;struct intel_crtc ;struct intel_crtc_state ; +enum pipe ;void intel_dpll_init_clock_hook (struct drm_i915_private *dev_priv);int vlv_calc_dpll_params (int refclk,struct dpll *clock);
@@ -20,4 +21,21 @@ void vlv_compute_dpll(struct intel_crtc *crtc,void chv_compute_dpll (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config); +int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, +const struct dpll *dpll); +void vlv_force_pll_off (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state); +void vlv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void chv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void vlv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe); +void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_disable_pll (const struct intel_crtc_state *crtc_state); +void vlv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void chv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +#endif
drivers/gpu/drm/i915/display/intel_pps.c +1 -0
@@ -6,6 +6,7 @@#include "i915_drv.h" #include "intel_display_types.h" #include "intel_dp.h" +#include "intel_dpll.h" #include "intel_pps.h" static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/11 drm/i915: migrate i9xx plane get config
In reply to Jani NikulaFrom: Dave Airlie <[email protected]>
Migrate this code out like the skylake code.
!!! FIXME: Dave's s-o-b !!!
--- drivers/gpu/drm/i915/display/i9xx_plane.c | 119 +++++++++++++++++++ drivers/gpu/drm/i915/display/i9xx_plane.h | 4 + drivers/gpu/drm/i915/display/intel_display.c | 119 ------------------- 3 files changed, 123 insertions(+), 119 deletions(-)
drivers/gpu/drm/i915/display/i9xx_plane.c +119 -0
@@ -698,3 +698,122 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)return ERR_PTR (ret); } +static int i9xx_format_to_fourcc (int format) +{ +switch (format) { +case DISPPLANE_8BPP : +return DRM_FORMAT_C8 ; +case DISPPLANE_BGRA555 : +return DRM_FORMAT_ARGB1555 ; +case DISPPLANE_BGRX555 : +return DRM_FORMAT_XRGB1555 ; +case DISPPLANE_BGRX565 : +return DRM_FORMAT_RGB565 ; +default : +case DISPPLANE_BGRX888 : +return DRM_FORMAT_XRGB8888 ; +case DISPPLANE_RGBX888 : +return DRM_FORMAT_XBGR8888 ; +case DISPPLANE_BGRA888 : +return DRM_FORMAT_ARGB8888 ; +case DISPPLANE_RGBA888 : +return DRM_FORMAT_ABGR8888 ; +case DISPPLANE_BGRX101010 : +return DRM_FORMAT_XRGB2101010 ; +case DISPPLANE_RGBX101010 : +return DRM_FORMAT_XBGR2101010 ; +case DISPPLANE_BGRA101010 : +return DRM_FORMAT_ARGB2101010 ; +case DISPPLANE_RGBA101010 : +return DRM_FORMAT_ABGR2101010 ; +case DISPPLANE_RGBX161616 : +return DRM_FORMAT_XBGR16161616F ; + } +} + +void +i9xx_get_initial_plane_config (struct intel_crtc *crtc, +struct intel_initial_plane_config *plane_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_plane *plane =to_intel_plane (crtc->base.primary); +enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; +enum pipe pipe; +u32 val, base, offset; +int fourcc, pixel_format; +unsigned int aligned_height; +struct drm_framebuffer *fb; +struct intel_framebuffer *intel_fb; + +if (!plane->get_hw_state (plane, &pipe)) +return ; + +drm_WARN_ON (dev, pipe != crtc->pipe); + + intel_fb =kzalloc (sizeof (*intel_fb),GFP_KERNEL ); +if (!intel_fb) { +drm_dbg_kms (&dev_priv->drm,"failed to alloc fb\n" ); +return ; + } + + fb = &intel_fb->base; + + fb->dev = dev; + + val =intel_de_read (dev_priv,DSPCNTR (i9xx_plane)); + +if (INTEL_GEN (dev_priv) >=4 ) { +if (val &DISPPLANE_TILED ) { + plane_config->tiling =I915_TILING_X ; + fb->modifier =I915_FORMAT_MOD_X_TILED ; + } + +if (val &DISPPLANE_ROTATE_180 ) + plane_config->rotation =DRM_MODE_ROTATE_180 ; + } + +if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B && + val &DISPPLANE_MIRROR ) + plane_config->rotation |=DRM_MODE_REFLECT_X ; + + pixel_format = val &DISPPLANE_PIXFORMAT_MASK ; + fourcc =i9xx_format_to_fourcc (pixel_format); + fb->format =drm_format_info (fourcc); + +if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { + offset =intel_de_read (dev_priv,DSPOFFSET (i9xx_plane)); + base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; + }else if (INTEL_GEN (dev_priv) >=4 ) { +if (plane_config->tiling) + offset =intel_de_read (dev_priv, +DSPTILEOFF (i9xx_plane)); +else + offset =intel_de_read (dev_priv, +DSPLINOFF (i9xx_plane)); + base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; + }else { + base =intel_de_read (dev_priv,DSPADDR (i9xx_plane)); + } + plane_config->base = base; + + val =intel_de_read (dev_priv,PIPESRC (pipe)); + fb->width = ((val >>16 ) &0xfff ) +1 ; + fb->height = ((val >>0 ) &0xfff ) +1 ; + + val =intel_de_read (dev_priv,DSPSTRIDE (i9xx_plane)); + fb->pitches[0 ] = val &0xffffffc0 ; + + aligned_height =intel_fb_align_height (fb,0 , fb->height); + + plane_config->size = fb->pitches[0 ] * aligned_height; + +drm_dbg_kms (&dev_priv->drm, +"%s/%s with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n" , + crtc->base.name, plane->base.name, fb->width, fb->height, + fb->format->cpp[0 ] *8 , base, fb->pitches[0 ], + plane_config->size); + + plane_config->fb = intel_fb; +} +
drivers/gpu/drm/i915/display/i9xx_plane.h +4 -0
@@ -10,6 +10,8 @@enum pipe ;struct drm_i915_private ; +struct intel_crtc ; +struct intel_initial_plane_config ;struct intel_plane ;struct intel_plane_state ;
@@ -21,4 +23,6 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state);struct intel_plane *intel_primary_plane_create (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_get_initial_plane_config (struct intel_crtc *crtc, +struct intel_initial_plane_config *plane_config);#endif
drivers/gpu/drm/i915/display/intel_display.c +0 -119
131 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for rebased refactor of intel_display
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display
URL : https://patchwork.freedesktop.org/series/85867/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 604e87846b3b drm/i915: refactor some crtc code out of intel display. (v2) -:32: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #32: new file mode 100644
-:332: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #332: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:296:
+ BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
-:333: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "dev_priv->pipe_to_crtc_mapping[pipe]" #333: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:297:
+ dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
-:339: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #339: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:303:
+ BUG_ON(i9xx_plane >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
-:340: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "dev_priv->plane_to_crtc_mapping[i9xx_plane]" #340: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:304:
+ dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
-:346: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #346: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:310:
+ drm_crtc_create_scaling_filter_property(&crtc->base,
+ BIT(DRM_SCALING_FILTER_DEFAULT) |
total: 0 errors, 3 warnings, 3 checks, 714 lines checkedc5a10aa1a6ad drm/i915: refactor pll code out into intel_dpll.c
-:1577: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #1577: FILE: drivers/gpu/drm/i915/display/intel_display_types.h:1847:
+ return dev_priv->vbt.lvds_use_ssc
+ && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
-:1587: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #1587:
new file mode 100644
-:1613: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations #1613: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:22:
+};
+static const struct intel_limit intel_limits_i8xx_dac = {
-:1678: CHECK:LINE_SPACING: Please don't use multiple blank lines #1678: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:87:
+
+
-:2250: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #2250: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:659:
+ for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) {
-:2321: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #2321: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:730:
+ if (m2 > INT_MAX/clock.m1)
^
-:2418: CHECK:BRACES: braces {} should be used on all arms of this statement #2418: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:827:
+ if (IS_PINEVIEW(dev_priv))
[...]
+ else {
[...]
-:2420: CHECK:BRACES: Unbalanced braces around else statement #2420: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:829:
+ else {
-:2538: CHECK:LINE_SPACING: Please don't use multiple blank lines #2538: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:947:
+
+
total: 0 errors, 2 warnings, 7 checks, 2919 lines checkedadc635930a19 drm/i915: split fdi code out from intel_display.c
-:778: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #778:
new file mode 100644
-:874: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #874: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:92:
+ BUG();
-:879: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #879: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:97:
+int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
+ struct intel_crtc_state *pipe_config)
-:911: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #911: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:129:
+ if (ret == -EINVAL && pipe_config->pipe_bpp > 6*3) {
^
-:912: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #912: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:130:
+ pipe_config->pipe_bpp -= 2*3;
^
-:961: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #961: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:179:
+ udelay(1000);
-:966: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #966: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:184:
+ intel_de_read(dev_priv, reg) | FDI_FS_ERRC_ENABLE | FDI_FE_ERRC_ENABLE);
-:983: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #983: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:201:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:983: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #983: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:201:
+ for train result */
-:990: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #990: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:208:
+ udelay(150);
-:1008: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1008: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:226:
+ udelay(150);
-:1044: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1044: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:262:
+ udelay(150);
-:1063: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #1063: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:281:
+
+}
-:1083: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #1083: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:301:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:1083: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #1083: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:301:
+ for train result */
-:1091: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1091: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:309:
+ udelay(150);
-:1120: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1120: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:338:
+ udelay(150);
-:1130: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1130: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:348:
+ udelay(500);
-:1143: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1143: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:361:
+ udelay(50);
-:1175: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1175: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:393:
+ udelay(150);
-:1185: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1185: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:403:
+ udelay(500);
-:1198: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1198: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:416:
+ udelay(50);
-:1220: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #1220: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:438:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:1220: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #1220: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:438:
+ for train result */
-:1228: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1228: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:446:
+ udelay(150);
-:1256: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #1256: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:474:
+ temp |= snb_b_fdi_train_param[j/2];
^
-:1352: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1352: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:570:
+ udelay(200);
-:1359: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1359: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:577:
+ udelay(200);
-:1368: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1368: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:586:
+ udelay(100);
-:1391: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1391: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:609:
+ udelay(100);
-:1399: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1399: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:617:
+ udelay(100);
-:1422: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1422: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:640:
+ udelay(100);
-:1451: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1451: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:669:
+ udelay(100);
total: 0 errors, 9 warnings, 24 checks, 1446 lines checked03c751a642be drm/i915: refactor ddi translations into a separate file
-:1522: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #1522:
new file mode 100644
-:1790: CHECK:LINE_SPACING: Please don't use multiple blank lines #1790: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:264:
+
+
-:2248: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2248: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:722:
+ return bdw_ddi_translations_edp;
+ } else {
-:2265: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2265: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:739:
+ return skl_u_ddi_translations_dp;
+ } else {
-:2286: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2286: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:760:
+ return kbl_u_ddi_translations_dp;
+ } else {
-:2310: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2310: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:784:
+ return skl_u_ddi_translations_edp;
+ } else {
-:2333: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2333: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:807:
+ return skl_y_ddi_translations_hdmi;
+ } else {
-:2488: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2488: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:962:
+ return cnl_ddi_translations_hdmi_1_05V;
+ } else {
-:2510: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2510: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:984:
+ return cnl_ddi_translations_dp_1_05V;
+ } else {
-:2533: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2533: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1007:
+ return cnl_ddi_translations_edp_1_05V;
+ } else {
-:2627: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2627: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1101:
+ return icl_mg_phy_ddi_translations_hbr2_hbr3;
+ } else {
-:2719: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2719: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1193:
+ return jsl_combo_phy_ddi_translations_edp_hbr2;
+ } else {
-:2761: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2761: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1235:
+ return tgl_uy_combo_phy_ddi_translations_dp_hbr2;
+ } else {
-:2823: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2823: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1297:
+ return tgl_dkl_phy_dp_ddi_trans_hbr2;
+ } else {
-:2989: ERROR:TRAILING_WHITESPACE: trailing whitespace #2989: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h:99:
+^I^I $
total: 1 errors, 13 warnings, 1 checks, 2944 lines checked e44a3e487e50 drm/i915: migrate hsw fdi code to new file. -:289: WARNING:LONG_LINE: line length of 123 exceeds 100 columns #289: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:583:
+ FDI_RX_PWRDN_LANE1_VAL(2) | FDI_RX_PWRDN_LANE0_VAL(2) | FDI_RX_TP1_TO_TP2_48 | FDI_RX_FDI_DELAY_90);
-:297: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #297: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:591:
+ udelay(220);
-:309: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #309: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:603:
+ * testing each value twice. */
-:321: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #321: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:615:
+ * port reversal bit */
-:323: WARNING:LONG_LINE: line length of 118 exceeds 100 columns #323: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:617:
+ DDI_BUF_CTL_ENABLE | ((crtc_state->fdi_lanes - 1) << 1) | DDI_BUF_TRANS_SELECT(i / 2));
-:326: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #326: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:620:
+ udelay(600);
-:337: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #337: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:631:
+ udelay(30);
total: 0 errors, 4 warnings, 3 checks, 376 lines checked e0e478e60136 drm/i915: migrate skl planes code new file (v3) -:1294: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #1294: FILE: drivers/gpu/drm/i915/display/intel_display_types.h:1878:
+
+}
-:2748: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #2748:
new file mode 100644
-:3221: CHECK:LINE_SPACING: Please don't use multiple blank lines #3221: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:469:
+
+
-:3282: WARNING:TYPO_SPELLING: 'Limted' may be misspelled - perhaps 'Limited'? #3282: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:530:
+ * BT.601 Limted range YCbCr -> full range RGB
^^^^^^
-:3728: CHECK:LINE_SPACING: Please don't use multiple blank lines #3728: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:976:
+
+
-:3831: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #3831: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1079:
+ (plane_state->color_plane[1].y << 16) | plane_state->color_plane[1].x);
-:4133: CHECK:LINE_SPACING: Please don't use multiple blank lines #4133: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1381:
+
+
-:4516: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4516: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1764:
+ return skl_planar_formats;
+ } else {
-:4529: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4529: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1777:
+ return glk_planar_formats;
+ } else {
-:4545: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4545: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1793:
+ return icl_sdr_y_plane_formats;
+ } else {
-:4859: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #4859: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:2107:
+ drm_plane_create_scaling_filter_property(&plane->base,
+ BIT(DRM_SCALING_FILTER_DEFAULT) |
total: 0 errors, 6 warnings, 5 checks, 4945 lines checkeda4bbb4337935 drm/i915: move pipe update code into crtc.
-:236: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #236: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:533:
+ * while ... */
total: 0 errors, 1 warnings, 0 checks, 483 lines checked0845353b71f8 drm/i915: split fb scalable checks into g4x and skl versions0d5e20703b44 drm/i915: move is_ccs_modifier to an inlinec6eed4d66621 drm/i915: migrate pll enable/disable code to intel_dpll.[ch]
-:637: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #637: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1399:
+ udelay(150);
-:655: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #655: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1417:
+ udelay(150); /* wait for warmup */
-:696: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #696: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1458:
+ udelay(150);
-:721: CHECK:LINE_SPACING: Please don't use multiple blank lines #721: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1483:
+
+
-:805: WARNING:LONG_LINE: line length of 106 exceeds 100 columns #805: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1567:
+ pipe_config->dpll_hw_state.dpll & ~(DPLL_VCO_ENABLE | DPLL_EXT_BUFFER_ENABLE_VLV));
-:858: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #858: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1620:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe),
+ 0x009f0003);
-:861: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #861: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1623:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe),
+ 0x00d0000f);
-:867: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #867: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1629:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df40000);
-:870: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #870: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1632:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df70000);
-:875: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #875: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1637:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df70000);
-:878: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #878: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1640:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df40000);
-:926: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #926: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1688:
+ vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW13(port),
+ 5 << DPIO_CHV_S1_DIV_SHIFT |
-:936: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #936: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1698:
+ vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW1(port),
+ DPIO_CHV_M1_DIV_BY_2 |
-:991: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #991: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1753:
+ vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port),
+ vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port)) |
-:1095: CHECK:LINE_SPACING: Please don't use multiple blank lines #1095: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1857:
+
+
-:1156: ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Dave Airlie <[email protected]>'
total: 1 errors, 1 warnings, 14 checks, 1110 lines checked6a2d5102588a drm/i915: migrate i9xx plane get config
-:295: ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Dave Airlie <[email protected]>'
total: 1 errors, 0 warnings, 0 checks, 267 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for rebased refactor of intel_display
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display
URL : https://patchwork.freedesktop.org/series/85867/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. - +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:714:28: warning: symbol 'bdw_get_buf_trans_edp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:728:28: warning: symbol 'skl_get_buf_trans_dp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:745:28: warning: symbol 'kbl_get_buf_trans_dp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:766:28: warning: symbol 'skl_get_buf_trans_edp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:798:28: warning: symbol 'skl_get_buf_trans_hdmi' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:813:5: warning: symbol 'skl_buf_trans_num_entries' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/intel_reset.c:1329:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block +drivers/gpu/drm/i915/gvt/mmio.c:295:23: warning: memcpy with byte count of 279040 +drivers/gpu/drm/i915/i915_perf.c:1450:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/i915_perf.c:1504:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/intel_wakeref.c:137:19: warning: context imbalance in 'wakeref_auto_timeout' - unexpected unlock +./include/linux/seqlock.h:843:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:843:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:869:16: warning: trying to copy expression type 31 +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for rebased refactor of intel_display
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display
URL : https://patchwork.freedesktop.org/series/85867/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9607 -> Patchwork_19355
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_19355 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_19355, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_19355:
### IGT changes ###
#### Possible regressions ####
* igt@i915_pm_rpm@module-reload:
- fi-kbl-guc: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9607/fi-kbl-guc/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/fi-kbl-guc/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_19355 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@module-reload:
- fi-byt-j1900: [PASS][3] -> [INCOMPLETE][4] ([i915#142] / [i915#2405])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9607/fi-byt-j1900/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/fi-byt-j1900/igt@[email protected]
* igt@prime_vgem@basic-gtt:
- fi-tgl-y: [PASS][5] -> [DMESG-WARN][6] ([i915#402]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9607/fi-tgl-y/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/fi-tgl-y/igt@[email protected]
* igt@runner@aborted:
- fi-byt-j1900: NOTRUN -> [FAIL][7] ([i915#1814] / [i915#2505])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/fi-byt-j1900/igt@[email protected]
#### Possible fixes ####
* igt@prime_vgem@basic-fence-flip:
- fi-tgl-y: [DMESG-WARN][8] ([i915#402]) -> [PASS][9] +2 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9607/fi-tgl-y/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/fi-tgl-y/igt@[email protected]
[i915#142]: https://gitlab.freedesktop.org/drm/intel/issues/142
[i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
[i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
[i915#2505]: https://gitlab.freedesktop.org/drm/intel/issues/2505
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
Participating hosts (41 -> 38)
------------------------------
Missing (3): fi-ctg-p8600 fi-bsw-cyan fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9607 -> Patchwork_19355
CI-20190529: 20190529
CI_DRM_9607: 1cd1433e50924f963a31d50a0bfcccb1f872544f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5957: 2a2b3418f7458dfa1fac255cc5c71603f617690a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19355: 6a2d5102588a78b3ecc507cb351ecb1b74368cfe @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
6a2d5102588a drm/i915: migrate i9xx plane get config c6eed4d66621 drm/i915: migrate pll enable/disable code to intel_dpll.[ch] 0d5e20703b44 drm/i915: move is_ccs_modifier to an inline 0845353b71f8 drm/i915: split fb scalable checks into g4x and skl versions a4bbb4337935 drm/i915: move pipe update code into crtc. e0e478e60136 drm/i915: migrate skl planes code new file (v3) e44a3e487e50 drm/i915: migrate hsw fdi code to new file. 03c751a642be drm/i915: refactor ddi translations into a separate file adc635930a19 drm/i915: split fdi code out from intel_display.c c5a10aa1a6ad drm/i915: refactor pll code out into intel_dpll.c 604e87846b3b drm/i915: refactor some crtc code out of intel display. (v2)
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19355/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 04/11] drm/i915: refactor ddi translations into a separate file
In reply to Jani NikulaQuoted 5 lines · Jani Nikula
From: Dave Airlie <[email protected]>
Ville suggested this, these tables are probably better being standalone.
Quoted 7 lines
This fixes up the cnl/bxt interfaces to be like the others, the intel one I left alone since it has a few extra entrypoints.
v2 by Jani: fix
intel_ddi_buf_trans.hheader testSigned-off-by Dave Airlie <[email protected]>Signed-off-by Jani Nikula <[email protected]>
Cool. Some pending patches will need a rebase but so be it.
Did a cursory scan and didn't spot any warts so
Quoted 2,990 lines
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_ddi.c | 1417 +---------------- .../drm/i915/display/intel_ddi_buf_trans.c | 1358 ++++++++++++++++ .../drm/i915/display/intel_ddi_buf_trans.h | 100 ++ 4 files changed, 1471 insertions(+), 1405 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c create mode 100644 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.hdrivers/gpu/drm/i915/Makefile +1
-0@@ -241,6 +241,7 @@ i915-y += \ display/icl_dsi.o \ display/intel_crt.o \ display/intel_ddi.o \ + display/intel_ddi_buf_trans.o \ display/intel_dp.o \ display/intel_dp_aux_backlight.o \ display/intel_dp_hdcp.o \drivers/gpu/drm/i915/display/intel_ddi.c +12
-1405@@ -33,6 +33,7 @@#include "intel_combo_phy.h" #include "intel_connector.h" #include "intel_ddi.h" +#include "intel_ddi_buf_trans.h" #include "intel_display_types.h" #include "intel_dp.h" #include "intel_dp_mst.h" @@ -52,12 +53,6 @@#include "intel_tc.h" #include "intel_vdsc.h" -struct ddi_buf_trans { -u32 trans1;/* balance leg enable, de-emph level */ -u32 trans2;/* vref sel, vswing */ -u8 i_boost;/* SKL: I_boost; valid: 0x0, 0x1, 0x3, 0x7 */ -}; -static const u8 index_to_dp_signal_levels[] = { [0 ] =DP_TRAIN_VOLTAGE_SWING_LEVEL_0 |DP_TRAIN_PRE_EMPH_LEVEL_0 , [1 ] =DP_TRAIN_VOLTAGE_SWING_LEVEL_0 |DP_TRAIN_PRE_EMPH_LEVEL_1 ,@@ -71,1389 +66,15 @@ static const u8 index_to_dp_signal_levels[] = { [9] = DP_TRAIN_VOLTAGE_SWING_LEVEL_3 | DP_TRAIN_PRE_EMPH_LEVEL_0, }; -/* HDMI/DVI modes ignore everything but the last 2 items. So we share -* them for both DP and FDI transports, allowing those ports to -* automatically adapt to HDMI connections as well -*/ -static const struct ddi_buf_trans hsw_ddi_translations_dp[] = { - {0x00FFFFFF ,0x0006000E ,0x0 }, - {0x00D75FFF ,0x0005000A ,0x0 }, - {0x00C30FFF ,0x00040006 ,0x0 }, - {0x80AAAFFF ,0x000B0000 ,0x0 }, - {0x00FFFFFF ,0x0005000A ,0x0 }, - {0x00D75FFF ,0x000C0004 ,0x0 }, - {0x80C30FFF ,0x000B0000 ,0x0 }, - {0x00FFFFFF ,0x00040006 ,0x0 }, - {0x80D75FFF ,0x000B0000 ,0x0 }, -}; - -static const struct ddi_buf_trans hsw_ddi_translations_fdi[] = { - {0x00FFFFFF ,0x0007000E ,0x0 }, - {0x00D75FFF ,0x000F000A ,0x0 }, - {0x00C30FFF ,0x00060006 ,0x0 }, - {0x00AAAFFF ,0x001E0000 ,0x0 }, - {0x00FFFFFF ,0x000F000A ,0x0 }, - {0x00D75FFF ,0x00160004 ,0x0 }, - {0x00C30FFF ,0x001E0000 ,0x0 }, - {0x00FFFFFF ,0x00060006 ,0x0 }, - {0x00D75FFF ,0x001E0000 ,0x0 }, -}; - -static const struct ddi_buf_trans hsw_ddi_translations_hdmi[] = { -/* Idx NT mV d T mV d db */ - {0x00FFFFFF ,0x0006000E ,0x0 },/* 0: 400 400 0 */ - {0x00E79FFF ,0x000E000C ,0x0 },/* 1: 400 500 2 */ - {0x00D75FFF ,0x0005000A ,0x0 },/* 2: 400 600 3.5 */ - {0x00FFFFFF ,0x0005000A ,0x0 },/* 3: 600 600 0 */ - {0x00E79FFF ,0x001D0007 ,0x0 },/* 4: 600 750 2 */ - {0x00D75FFF ,0x000C0004 ,0x0 },/* 5: 600 900 3.5 */ - {0x00FFFFFF ,0x00040006 ,0x0 },/* 6: 800 800 0 */ - {0x80E79FFF ,0x00030002 ,0x0 },/* 7: 800 1000 2 */ - {0x00FFFFFF ,0x00140005 ,0x0 },/* 8: 850 850 0 */ - {0x00FFFFFF ,0x000C0004 ,0x0 },/* 9: 900 900 0 */ - {0x00FFFFFF ,0x001C0003 ,0x0 },/* 10: 950 950 0 */ - {0x80FFFFFF ,0x00030002 ,0x0 },/* 11: 1000 1000 0 */ -}; - -static const struct ddi_buf_trans bdw_ddi_translations_edp[] = { - {0x00FFFFFF ,0x00000012 ,0x0 }, - {0x00EBAFFF ,0x00020011 ,0x0 }, - {0x00C71FFF ,0x0006000F ,0x0 }, - {0x00AAAFFF ,0x000E000A ,0x0 }, - {0x00FFFFFF ,0x00020011 ,0x0 }, - {0x00DB6FFF ,0x0005000F ,0x0 }, - {0x00BEEFFF ,0x000A000C ,0x0 }, - {0x00FFFFFF ,0x0005000F ,0x0 }, - {0x00DB6FFF ,0x000A000C ,0x0 }, -}; - -static const struct ddi_buf_trans bdw_ddi_translations_dp[] = { - {0x00FFFFFF ,0x0007000E ,0x0 }, - {0x00D75FFF ,0x000E000A ,0x0 }, - {0x00BEFFFF ,0x00140006 ,0x0 }, - {0x80B2CFFF ,0x001B0002 ,0x0 }, - {0x00FFFFFF ,0x000E000A ,0x0 }, - {0x00DB6FFF ,0x00160005 ,0x0 }, - {0x80C71FFF ,0x001A0002 ,0x0 }, - {0x00F7DFFF ,0x00180004 ,0x0 }, - {0x80D75FFF ,0x001B0002 ,0x0 }, -}; - -static const struct ddi_buf_trans bdw_ddi_translations_fdi[] = { - {0x00FFFFFF ,0x0001000E ,0x0 }, - {0x00D75FFF ,0x0004000A ,0x0 }, - {0x00C30FFF ,0x00070006 ,0x0 }, - {0x00AAAFFF ,0x000C0000 ,0x0 }, - {0x00FFFFFF ,0x0004000A ,0x0 }, - {0x00D75FFF ,0x00090004 ,0x0 }, - {0x00C30FFF ,0x000C0000 ,0x0 }, - {0x00FFFFFF ,0x00070006 ,0x0 }, - {0x00D75FFF ,0x000C0000 ,0x0 }, -}; - -static const struct ddi_buf_trans bdw_ddi_translations_hdmi[] = { -/* Idx NT mV d T mV df db */ - {0x00FFFFFF ,0x0007000E ,0x0 },/* 0: 400 400 0 */ - {0x00D75FFF ,0x000E000A ,0x0 },/* 1: 400 600 3.5 */ - {0x00BEFFFF ,0x00140006 ,0x0 },/* 2: 400 800 6 */ - {0x00FFFFFF ,0x0009000D ,0x0 },/* 3: 450 450 0 */ - {0x00FFFFFF ,0x000E000A ,0x0 },/* 4: 600 600 0 */ - {0x00D7FFFF ,0x00140006 ,0x0 },/* 5: 600 800 2.5 */ - {0x80CB2FFF ,0x001B0002 ,0x0 },/* 6: 600 1000 4.5 */ - {0x00FFFFFF ,0x00140006 ,0x0 },/* 7: 800 800 0 */ - {0x80E79FFF ,0x001B0002 ,0x0 },/* 8: 800 1000 2 */ - {0x80FFFFFF ,0x001B0002 ,0x0 },/* 9: 1000 1000 0 */ -}; - -/* Skylake H and S */ -static const struct ddi_buf_trans skl_ddi_translations_dp[] = { - {0x00002016 ,0x000000A0 ,0x0 }, - {0x00005012 ,0x0000009B ,0x0 }, - {0x00007011 ,0x00000088 ,0x0 }, - {0x80009010 ,0x000000C0 ,0x1 }, - {0x00002016 ,0x0000009B ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000C0 ,0x1 }, - {0x00002016 ,0x000000DF ,0x0 }, - {0x80005012 ,0x000000C0 ,0x1 }, -}; - -/* Skylake U */ -static const struct ddi_buf_trans skl_u_ddi_translations_dp[] = { - {0x0000201B ,0x000000A2 ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000CD ,0x1 }, - {0x80009010 ,0x000000C0 ,0x1 }, - {0x0000201B ,0x0000009D ,0x0 }, - {0x80005012 ,0x000000C0 ,0x1 }, - {0x80007011 ,0x000000C0 ,0x1 }, - {0x00002016 ,0x00000088 ,0x0 }, - {0x80005012 ,0x000000C0 ,0x1 }, -}; - -/* Skylake Y */ -static const struct ddi_buf_trans skl_y_ddi_translations_dp[] = { - {0x00000018 ,0x000000A2 ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000CD ,0x3 }, - {0x80009010 ,0x000000C0 ,0x3 }, - {0x00000018 ,0x0000009D ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, - {0x80007011 ,0x000000C0 ,0x3 }, - {0x00000018 ,0x00000088 ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, -}; - -/* Kabylake H and S */ -static const struct ddi_buf_trans kbl_ddi_translations_dp[] = { - {0x00002016 ,0x000000A0 ,0x0 }, - {0x00005012 ,0x0000009B ,0x0 }, - {0x00007011 ,0x00000088 ,0x0 }, - {0x80009010 ,0x000000C0 ,0x1 }, - {0x00002016 ,0x0000009B ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000C0 ,0x1 }, - {0x00002016 ,0x00000097 ,0x0 }, - {0x80005012 ,0x000000C0 ,0x1 }, -}; - -/* Kabylake U */ -static const struct ddi_buf_trans kbl_u_ddi_translations_dp[] = { - {0x0000201B ,0x000000A1 ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000CD ,0x3 }, - {0x80009010 ,0x000000C0 ,0x3 }, - {0x0000201B ,0x0000009D ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, - {0x80007011 ,0x000000C0 ,0x3 }, - {0x00002016 ,0x0000004F ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, -}; - -/* Kabylake Y */ -static const struct ddi_buf_trans kbl_y_ddi_translations_dp[] = { - {0x00001017 ,0x000000A1 ,0x0 }, - {0x00005012 ,0x00000088 ,0x0 }, - {0x80007011 ,0x000000CD ,0x3 }, - {0x8000800F ,0x000000C0 ,0x3 }, - {0x00001017 ,0x0000009D ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, - {0x80007011 ,0x000000C0 ,0x3 }, - {0x00001017 ,0x0000004C ,0x0 }, - {0x80005012 ,0x000000C0 ,0x3 }, -}; - -/* -* Skylake/Kabylake H and S -* eDP 1.4 low vswing translation parameters -*/ -static const struct ddi_buf_trans skl_ddi_translations_edp[] = { - {0x00000018 ,0x000000A8 ,0x0 }, - {0x00004013 ,0x000000A9 ,0x0 }, - {0x00007011 ,0x000000A2 ,0x0 }, - {0x00009010 ,0x0000009C ,0x0 }, - {0x00000018 ,0x000000A9 ,0x0 }, - {0x00006013 ,0x000000A2 ,0x0 }, - {0x00007011 ,0x000000A6 ,0x0 }, - {0x00000018 ,0x000000AB ,0x0 }, - {0x00007013 ,0x0000009F ,0x0 }, - {0x00000018 ,0x000000DF ,0x0 }, -}; - -/* -* Skylake/Kabylake U -* eDP 1.4 low vswing translation parameters -*/ -static const struct ddi_buf_trans skl_u_ddi_translations_edp[] = { - {0x00000018 ,0x000000A8 ,0x0 }, - {0x00004013 ,0x000000A9 ,0x0 }, - {0x00007011 ,0x000000A2 ,0x0 }, - {0x00009010 ,0x0000009C ,0x0 }, - {0x00000018 ,0x000000A9 ,0x0 }, - {0x00006013 ,0x000000A2 ,0x0 }, - {0x00007011 ,0x000000A6 ,0x0 }, - {0x00002016 ,0x000000AB ,0x0 }, - {0x00005013 ,0x0000009F ,0x0 }, - {0x00000018 ,0x000000DF ,0x0 }, -}; - -/* -* Skylake/Kabylake Y -* eDP 1.4 low vswing translation parameters -*/ -static const struct ddi_buf_trans skl_y_ddi_translations_edp[] = { - {0x00000018 ,0x000000A8 ,0x0 }, - {0x00004013 ,0x000000AB ,0x0 }, - {0x00007011 ,0x000000A4 ,0x0 }, - {0x00009010 ,0x000000DF ,0x0 }, - {0x00000018 ,0x000000AA ,0x0 }, - {0x00006013 ,0x000000A4 ,0x0 }, - {0x00007011 ,0x0000009D ,0x0 }, - {0x00000018 ,0x000000A0 ,0x0 }, - {0x00006012 ,0x000000DF ,0x0 }, - {0x00000018 ,0x0000008A ,0x0 }, -}; - -/* Skylake/Kabylake U, H and S */ -static const struct ddi_buf_trans skl_ddi_translations_hdmi[] = { - {0x00000018 ,0x000000AC ,0x0 }, - {0x00005012 ,0x0000009D ,0x0 }, - {0x00007011 ,0x00000088 ,0x0 }, - {0x00000018 ,0x000000A1 ,0x0 }, - {0x00000018 ,0x00000098 ,0x0 }, - {0x00004013 ,0x00000088 ,0x0 }, - {0x80006012 ,0x000000CD ,0x1 }, - {0x00000018 ,0x000000DF ,0x0 }, - {0x80003015 ,0x000000CD ,0x1 },/* Default */ - {0x80003015 ,0x000000C0 ,0x1 }, - {0x80000018 ,0x000000C0 ,0x1 }, -}; - -/* Skylake/Kabylake Y */ -static const struct ddi_buf_trans skl_y_ddi_translations_hdmi[] = { - {0x00000018 ,0x000000A1 ,0x0 }, - {0x00005012 ,0x000000DF ,0x0 }, - {0x80007011 ,0x000000CB ,0x3 }, - {0x00000018 ,0x000000A4 ,0x0 }, - {0x00000018 ,0x0000009D ,0x0 }, - {0x00004013 ,0x00000080 ,0x0 }, - {0x80006013 ,0x000000C0 ,0x3 }, - {0x00000018 ,0x0000008A ,0x0 }, - {0x80003015 ,0x000000C0 ,0x3 },/* Default */ - {0x80003015 ,0x000000C0 ,0x3 }, - {0x80000018 ,0x000000C0 ,0x3 }, -}; - -struct bxt_ddi_buf_trans { -u8 margin;/* swing value */ -u8 scale;/* scale value */ -u8 enable;/* scale enable */ -u8 deemphasis; -}; - -static const struct bxt_ddi_buf_trans bxt_ddi_translations_dp[] = { -/* Idx NT mV diff db */ - {52 ,0x9A ,0 ,128 , },/* 0: 400 0 */ - {78 ,0x9A ,0 ,85 , },/* 1: 400 3.5 */ - {104 ,0x9A ,0 ,64 , },/* 2: 400 6 */ - {154 ,0x9A ,0 ,43 , },/* 3: 400 9.5 */ - {77 ,0x9A ,0 ,128 , },/* 4: 600 0 */ - {116 ,0x9A ,0 ,85 , },/* 5: 600 3.5 */ - {154 ,0x9A ,0 ,64 , },/* 6: 600 6 */ - {102 ,0x9A ,0 ,128 , },/* 7: 800 0 */ - {154 ,0x9A ,0 ,85 , },/* 8: 800 3.5 */ - {154 ,0x9A ,1 ,128 , },/* 9: 1200 0 */ -}; - -static const struct bxt_ddi_buf_trans bxt_ddi_translations_edp[] = { -/* Idx NT mV diff db */ - {26 ,0 ,0 ,128 , },/* 0: 200 0 */ - {38 ,0 ,0 ,112 , },/* 1: 200 1.5 */ - {48 ,0 ,0 ,96 , },/* 2: 200 4 */ - {54 ,0 ,0 ,69 , },/* 3: 200 6 */ - {32 ,0 ,0 ,128 , },/* 4: 250 0 */ - {48 ,0 ,0 ,104 , },/* 5: 250 1.5 */ - {54 ,0 ,0 ,85 , },/* 6: 250 4 */ - {43 ,0 ,0 ,128 , },/* 7: 300 0 */ - {54 ,0 ,0 ,101 , },/* 8: 300 1.5 */ - {48 ,0 ,0 ,128 , },/* 9: 300 0 */ -}; - -/* BSpec has 2 recommended values - entries 0 and 8. -* Using the entry with higher vswing. -*/ -static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = { -/* Idx NT mV diff db */ - {52 ,0x9A ,0 ,128 , },/* 0: 400 0 */ - {52 ,0x9A ,0 ,85 , },/* 1: 400 3.5 */ - {52 ,0x9A ,0 ,64 , },/* 2: 400 6 */ - {42 ,0x9A ,0 ,43 , },/* 3: 400 9.5 */ - {77 ,0x9A ,0 ,128 , },/* 4: 600 0 */ - {77 ,0x9A ,0 ,85 , },/* 5: 600 3.5 */ - {77 ,0x9A ,0 ,64 , },/* 6: 600 6 */ - {102 ,0x9A ,0 ,128 , },/* 7: 800 0 */ - {102 ,0x9A ,0 ,85 , },/* 8: 800 3.5 */ - {154 ,0x9A ,1 ,128 , },/* 9: 1200 0 */ -}; - -struct cnl_ddi_buf_trans { -u8 dw2_swing_sel; -u8 dw7_n_scalar; -u8 dw4_cursor_coeff; -u8 dw4_post_cursor_2; -u8 dw4_post_cursor_1; -}; - -/* Voltage Swing Programming for VccIO 0.85V for DP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_0_85V[] = { -/* NT mV Trans mV db */ - {0xA ,0x5D ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x6A ,0x38 ,0x00 ,0x07 },/* 350 500 3.1 */ - {0xB ,0x7A ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ - {0x6 ,0x7C ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ - {0xA ,0x69 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xB ,0x7A ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ - {0x6 ,0x7C ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ - {0xB ,0x7D ,0x3C ,0x00 ,0x03 },/* 650 725 0.9 */ - {0x6 ,0x7C ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ - {0x6 ,0x7B ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 0.85V for HDMI */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_0_85V[] = { -/* NT mV Trans mV db */ - {0xA ,0x60 ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ - {0xB ,0x73 ,0x36 ,0x00 ,0x09 },/* 450 650 3.2 */ - {0x6 ,0x7F ,0x31 ,0x00 ,0x0E },/* 450 850 5.5 */ - {0xB ,0x73 ,0x3F ,0x00 ,0x00 },/* 650 650 0.0 */ - {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 650 850 2.3 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 850 850 0.0 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ -}; - -/* Voltage Swing Programming for VccIO 0.85V for eDP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_0_85V[] = { -/* NT mV Trans mV db */ - {0xA ,0x66 ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ - {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ - {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ - {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ - {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ - {0xA ,0x66 ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ - {0xB ,0x70 ,0x3C ,0x00 ,0x03 },/* 460 600 2.3 */ - {0xC ,0x75 ,0x3C ,0x00 ,0x03 },/* 537 700 2.3 */ - {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 0.95V for DP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_0_95V[] = { -/* NT mV Trans mV db */ - {0xA ,0x5D ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x6A ,0x38 ,0x00 ,0x07 },/* 350 500 3.1 */ - {0xB ,0x7A ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ - {0x6 ,0x7C ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ - {0xA ,0x69 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xB ,0x7A ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ - {0x6 ,0x7C ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ - {0xB ,0x7D ,0x3C ,0x00 ,0x03 },/* 650 725 0.9 */ - {0x6 ,0x7C ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ - {0x6 ,0x7B ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 0.95V for HDMI */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_0_95V[] = { -/* NT mV Trans mV db */ - {0xA ,0x5C ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ - {0xB ,0x69 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ - {0x5 ,0x76 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ - {0xA ,0x5E ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ - {0xB ,0x69 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ - {0xB ,0x79 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ - {0x6 ,0x7D ,0x32 ,0x00 ,0x0D },/* 600 1000 4.4 */ - {0x5 ,0x76 ,0x3F ,0x00 ,0x00 },/* 800 800 0.0 */ - {0x6 ,0x7D ,0x39 ,0x00 ,0x06 },/* 800 1000 1.9 */ - {0x6 ,0x7F ,0x39 ,0x00 ,0x06 },/* 850 1050 1.8 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 0.95V for eDP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_0_95V[] = { -/* NT mV Trans mV db */ - {0xA ,0x61 ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ - {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ - {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ - {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ - {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ - {0xA ,0x61 ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ - {0xB ,0x68 ,0x39 ,0x00 ,0x06 },/* 460 600 2.3 */ - {0xC ,0x6E ,0x39 ,0x00 ,0x06 },/* 537 700 2.3 */ - {0x4 ,0x7F ,0x3A ,0x00 ,0x05 },/* 460 600 2.3 */ - {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 1.05V for DP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_1_05V[] = { -/* NT mV Trans mV db */ - {0xA ,0x58 ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ - {0xB ,0x64 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ - {0x5 ,0x70 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ - {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 400 1050 8.4 */ - {0xB ,0x64 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ - {0x5 ,0x73 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ - {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 550 1050 5.6 */ - {0x5 ,0x76 ,0x3E ,0x00 ,0x01 },/* 850 900 0.5 */ - {0x6 ,0x7F ,0x36 ,0x00 ,0x09 },/* 750 1050 2.9 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 1.05V for HDMI */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_1_05V[] = { -/* NT mV Trans mV db */ - {0xA ,0x58 ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ - {0xB ,0x64 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ - {0x5 ,0x70 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ - {0xA ,0x5B ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ - {0xB ,0x64 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ - {0x5 ,0x73 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ - {0x6 ,0x7C ,0x32 ,0x00 ,0x0D },/* 600 1000 4.4 */ - {0x5 ,0x70 ,0x3F ,0x00 ,0x00 },/* 800 800 0.0 */ - {0x6 ,0x7C ,0x39 ,0x00 ,0x06 },/* 800 1000 1.9 */ - {0x6 ,0x7F ,0x39 ,0x00 ,0x06 },/* 850 1050 1.8 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ -}; - -/* Voltage Swing Programming for VccIO 1.05V for eDP */ -static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_1_05V[] = { -/* NT mV Trans mV db */ - {0xA ,0x5E ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ - {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ - {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ - {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ - {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ - {0xA ,0x5E ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ - {0xB ,0x64 ,0x39 ,0x00 ,0x06 },/* 460 600 2.3 */ - {0xE ,0x6A ,0x39 ,0x00 ,0x06 },/* 537 700 2.3 */ - {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ -}; - -/* icl_combo_phy_ddi_translations */ -static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hbr2[] = { -/* NT mV Trans mV db */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ - {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ - {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr2[] = { -/* NT mV Trans mV db */ - {0x0 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ - {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 200 250 1.9 */ - {0x1 ,0x7F ,0x33 ,0x00 ,0x0C },/* 200 300 3.5 */ - {0x9 ,0x7F ,0x31 ,0x00 ,0x0E },/* 200 350 4.9 */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ - {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 250 300 1.6 */ - {0x9 ,0x7F ,0x35 ,0x00 ,0x0A },/* 250 350 2.9 */ - {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ - {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ - {0x9 ,0x7F ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ -}; - -static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr3[] = { -/* NT mV Trans mV db */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ - {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ - {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_hdmi[] = { -/* NT mV Trans mV db */ - {0xA ,0x60 ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ - {0xB ,0x73 ,0x36 ,0x00 ,0x09 },/* 450 650 3.2 */ - {0x6 ,0x7F ,0x31 ,0x00 ,0x0E },/* 450 850 5.5 */ - {0xB ,0x73 ,0x3F ,0x00 ,0x00 },/* 650 650 0.0 ALS */ - {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 650 850 2.3 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 850 850 0.0 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ -}; - -static const struct cnl_ddi_buf_trans ehl_combo_phy_ddi_translations_dp[] = { -/* NT mV Trans mV db */ - {0xA ,0x33 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x47 ,0x36 ,0x00 ,0x09 },/* 350 500 3.1 */ - {0xC ,0x64 ,0x34 ,0x00 ,0x0B },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 350 900 8.2 */ - {0xA ,0x46 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x64 ,0x38 ,0x00 ,0x07 },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x32 ,0x00 ,0x0D },/* 500 900 5.1 */ - {0xC ,0x61 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x38 ,0x00 ,0x07 },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr[] = { -/* NT mV Trans mV db */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ - {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 200 250 1.9 */ - {0x1 ,0x7F ,0x33 ,0x00 ,0x0C },/* 200 300 3.5 */ - {0xA ,0x35 ,0x36 ,0x00 ,0x09 },/* 200 350 4.9 */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ - {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 250 300 1.6 */ - {0xA ,0x35 ,0x35 ,0x00 ,0x0A },/* 250 350 2.9 */ - {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ - {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ -}; - -static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr2[] = { -/* NT mV Trans mV db */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 250 1.9 */ - {0x1 ,0x7F ,0x3D ,0x00 ,0x02 },/* 200 300 3.5 */ - {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 200 350 4.9 */ - {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ - {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 300 1.6 */ - {0xA ,0x35 ,0x3A ,0x00 ,0x05 },/* 250 350 2.9 */ - {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ - {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ -}; - -static const struct cnl_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_rbr_hbr[] = { -/* NT mV Trans mV db */ - {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x48 ,0x35 ,0x00 ,0x0A },/* 350 500 3.1 */ - {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 350 900 8.2 */ - {0xA ,0x43 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x60 ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ - {0xC ,0x60 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { -/* NT mV Trans mV db */ - {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x48 ,0x35 ,0x00 ,0x0A },/* 350 500 3.1 */ - {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 350 900 8.2 */ - {0xA ,0x43 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x60 ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ - {0xC ,0x58 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -struct icl_mg_phy_ddi_buf_trans { -u32 cri_txdeemph_override_11_6; -u32 cri_txdeemph_override_5_0; -u32 cri_txdeemph_override_17_12; -}; - -static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_rbr_hbr[] = { -/* Voltage swing pre-emphasis */ - {0x18 ,0x00 ,0x00 },/* 0 0 */ - {0x1D ,0x00 ,0x05 },/* 0 1 */ - {0x24 ,0x00 ,0x0C },/* 0 2 */ - {0x2B ,0x00 ,0x14 },/* 0 3 */ - {0x21 ,0x00 ,0x00 },/* 1 0 */ - {0x2B ,0x00 ,0x08 },/* 1 1 */ - {0x30 ,0x00 ,0x0F },/* 1 2 */ - {0x31 ,0x00 ,0x03 },/* 2 0 */ - {0x34 ,0x00 ,0x0B },/* 2 1 */ - {0x3F ,0x00 ,0x00 },/* 3 0 */ -}; - -static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_hbr2_hbr3[] = { -/* Voltage swing pre-emphasis */ - {0x18 ,0x00 ,0x00 },/* 0 0 */ - {0x1D ,0x00 ,0x05 },/* 0 1 */ - {0x24 ,0x00 ,0x0C },/* 0 2 */ - {0x2B ,0x00 ,0x14 },/* 0 3 */ - {0x26 ,0x00 ,0x00 },/* 1 0 */ - {0x2C ,0x00 ,0x07 },/* 1 1 */ - {0x33 ,0x00 ,0x0C },/* 1 2 */ - {0x2E ,0x00 ,0x00 },/* 2 0 */ - {0x36 ,0x00 ,0x09 },/* 2 1 */ - {0x3F ,0x00 ,0x00 },/* 3 0 */ -}; - -static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_hdmi[] = { -/* HDMI Preset VS Pre-emph */ - {0x1A ,0x0 ,0x0 },/* 1 400mV 0dB */ - {0x20 ,0x0 ,0x0 },/* 2 500mV 0dB */ - {0x29 ,0x0 ,0x0 },/* 3 650mV 0dB */ - {0x32 ,0x0 ,0x0 },/* 4 800mV 0dB */ - {0x3F ,0x0 ,0x0 },/* 5 1000mV 0dB */ - {0x3A ,0x0 ,0x5 },/* 6 Full -1.5 dB */ - {0x39 ,0x0 ,0x6 },/* 7 Full -1.8 dB */ - {0x38 ,0x0 ,0x7 },/* 8 Full -2 dB */ - {0x37 ,0x0 ,0x8 },/* 9 Full -2.5 dB */ - {0x36 ,0x0 ,0x9 },/* 10 Full -3 dB */ -}; - -struct tgl_dkl_phy_ddi_buf_trans { -u32 dkl_vswing_control; -u32 dkl_preshoot_control; -u32 dkl_de_emphasis_control; -}; - -static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_dp_ddi_trans[] = { -/* VS pre-emp Non-trans mV Pre-emph dB */ - {0x7 ,0x0 ,0x00 },/* 0 0 400mV 0 dB */ - {0x5 ,0x0 ,0x05 },/* 0 1 400mV 3.5 dB */ - {0x2 ,0x0 ,0x0B },/* 0 2 400mV 6 dB */ - {0x0 ,0x0 ,0x18 },/* 0 3 400mV 9.5 dB */ - {0x5 ,0x0 ,0x00 },/* 1 0 600mV 0 dB */ - {0x2 ,0x0 ,0x08 },/* 1 1 600mV 3.5 dB */ - {0x0 ,0x0 ,0x14 },/* 1 2 600mV 6 dB */ - {0x2 ,0x0 ,0x00 },/* 2 0 800mV 0 dB */ - {0x0 ,0x0 ,0x0B },/* 2 1 800mV 3.5 dB */ - {0x0 ,0x0 ,0x00 },/* 3 0 1200mV 0 dB HDMI default */ -}; - -static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_dp_ddi_trans_hbr2[] = { -/* VS pre-emp Non-trans mV Pre-emph dB */ - {0x7 ,0x0 ,0x00 },/* 0 0 400mV 0 dB */ - {0x5 ,0x0 ,0x05 },/* 0 1 400mV 3.5 dB */ - {0x2 ,0x0 ,0x0B },/* 0 2 400mV 6 dB */ - {0x0 ,0x0 ,0x19 },/* 0 3 400mV 9.5 dB */ - {0x5 ,0x0 ,0x00 },/* 1 0 600mV 0 dB */ - {0x2 ,0x0 ,0x08 },/* 1 1 600mV 3.5 dB */ - {0x0 ,0x0 ,0x14 },/* 1 2 600mV 6 dB */ - {0x2 ,0x0 ,0x00 },/* 2 0 800mV 0 dB */ - {0x0 ,0x0 ,0x0B },/* 2 1 800mV 3.5 dB */ - {0x0 ,0x0 ,0x00 },/* 3 0 1200mV 0 dB HDMI default */ -}; - -static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_hdmi_ddi_trans[] = { -/* HDMI Preset VS Pre-emph */ - {0x7 ,0x0 ,0x0 },/* 1 400mV 0dB */ - {0x6 ,0x0 ,0x0 },/* 2 500mV 0dB */ - {0x4 ,0x0 ,0x0 },/* 3 650mV 0dB */ - {0x2 ,0x0 ,0x0 },/* 4 800mV 0dB */ - {0x0 ,0x0 ,0x0 },/* 5 1000mV 0dB */ - {0x0 ,0x0 ,0x5 },/* 6 Full -1.5 dB */ - {0x0 ,0x0 ,0x6 },/* 7 Full -1.8 dB */ - {0x0 ,0x0 ,0x7 },/* 8 Full -2 dB */ - {0x0 ,0x0 ,0x8 },/* 9 Full -2.5 dB */ - {0x0 ,0x0 ,0xA },/* 10 Full -3 dB */ -}; - -static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr[] = { -/* NT mV Trans mV db */ - {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ - {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7D ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ - {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr2[] = { -/* NT mV Trans mV db */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ - {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ - {0xA ,0x47 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x63 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x61 ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ - {0x6 ,0x7B ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans tgl_uy_combo_phy_ddi_translations_dp_hbr2[] = { -/* NT mV Trans mV db */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x36 ,0x00 ,0x09 },/* 350 500 3.1 */ - {0xC ,0x60 ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ - {0xC ,0x7F ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ - {0xC ,0x47 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x6F ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ - {0x6 ,0x7D ,0x32 ,0x00 ,0x0D },/* 500 900 5.1 */ - {0x6 ,0x60 ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -/* -* Cloned the HOBL entry to comply with the voltage and pre-emphasis entries -* that DisplayPort specification requires -*/ -static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_edp_hbr2_hobl[] = { -/* VS pre-emp */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 0 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 1 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 2 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 3 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 0 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 1 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 2 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 2 0 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 2 1 */ -}; - -static const struct cnl_ddi_buf_trans rkl_combo_phy_ddi_translations_dp_hbr[] = { -/* NT mV Trans mV db */ - {0xA ,0x2F ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ - {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ - {0x6 ,0x7D ,0x2A ,0x00 ,0x15 },/* 350 900 8.2 */ - {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x6E ,0x3E ,0x00 ,0x01 },/* 650 700 0.6 */ - {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static const struct cnl_ddi_buf_trans rkl_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { -/* NT mV Trans mV db */ - {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ - {0xA ,0x50 ,0x38 ,0x00 ,0x07 },/* 350 500 3.1 */ - {0xC ,0x61 ,0x33 ,0x00 ,0x0C },/* 350 700 6.0 */ - {0x6 ,0x7F ,0x2E ,0x00 ,0x11 },/* 350 900 8.2 */ - {0xA ,0x47 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ - {0xC ,0x5F ,0x38 ,0x00 ,0x07 },/* 500 700 2.9 */ - {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ - {0xC ,0x5F ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ - {0x6 ,0x7E ,0x36 ,0x00 ,0x09 },/* 600 900 3.5 */ - {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ -}; - -static bool is_hobl_buf_trans (const struct cnl_ddi_buf_trans *table) -{ -return table == tgl_combo_phy_ddi_translations_edp_hbr2_hobl; -} - -static const struct ddi_buf_trans * -bdw_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (dev_priv->vbt.edp.low_vswing) { - *n_entries =ARRAY_SIZE (bdw_ddi_translations_edp); -return bdw_ddi_translations_edp; - }else { - *n_entries =ARRAY_SIZE (bdw_ddi_translations_dp); -return bdw_ddi_translations_dp; - } -} - -static const struct ddi_buf_trans * -skl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (IS_SKL_ULX (dev_priv)) { - *n_entries =ARRAY_SIZE (skl_y_ddi_translations_dp); -return skl_y_ddi_translations_dp; - }else if (IS_SKL_ULT (dev_priv)) { - *n_entries =ARRAY_SIZE (skl_u_ddi_translations_dp); -return skl_u_ddi_translations_dp; - }else { - *n_entries =ARRAY_SIZE (skl_ddi_translations_dp); -return skl_ddi_translations_dp; - } -} - -static const struct ddi_buf_trans * -kbl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (IS_KBL_ULX (dev_priv) || -IS_CFL_ULX (dev_priv) || -IS_CML_ULX (dev_priv)) { - *n_entries =ARRAY_SIZE (kbl_y_ddi_translations_dp); -return kbl_y_ddi_translations_dp; - }else if (IS_KBL_ULT (dev_priv) || -IS_CFL_ULT (dev_priv) || -IS_CML_ULT (dev_priv)) { - *n_entries =ARRAY_SIZE (kbl_u_ddi_translations_dp); -return kbl_u_ddi_translations_dp; - }else { - *n_entries =ARRAY_SIZE (kbl_ddi_translations_dp); -return kbl_ddi_translations_dp; - } -} - -static const struct ddi_buf_trans * -skl_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (dev_priv->vbt.edp.low_vswing) { -if (IS_SKL_ULX (dev_priv) || -IS_KBL_ULX (dev_priv) || -IS_CFL_ULX (dev_priv) || -IS_CML_ULX (dev_priv)) { - *n_entries =ARRAY_SIZE (skl_y_ddi_translations_edp); -return skl_y_ddi_translations_edp; - }else if (IS_SKL_ULT (dev_priv) || -IS_KBL_ULT (dev_priv) || -IS_CFL_ULT (dev_priv) || -IS_CML_ULT (dev_priv)) { - *n_entries =ARRAY_SIZE (skl_u_ddi_translations_edp); -return skl_u_ddi_translations_edp; - }else { - *n_entries =ARRAY_SIZE (skl_ddi_translations_edp); -return skl_ddi_translations_edp; - } - } - -if (IS_KABYLAKE (dev_priv) || -IS_COFFEELAKE (dev_priv) || -IS_COMETLAKE (dev_priv)) -return kbl_get_buf_trans_dp (encoder, n_entries); -else -return skl_get_buf_trans_dp (encoder, n_entries); -} - -static const struct ddi_buf_trans * -skl_get_buf_trans_hdmi (struct drm_i915_private *dev_priv,int *n_entries) -{ -if (IS_SKL_ULX (dev_priv) || -IS_KBL_ULX (dev_priv) || -IS_CFL_ULX (dev_priv) || -IS_CML_ULX (dev_priv)) { - *n_entries =ARRAY_SIZE (skl_y_ddi_translations_hdmi); -return skl_y_ddi_translations_hdmi; - }else { - *n_entries =ARRAY_SIZE (skl_ddi_translations_hdmi); -return skl_ddi_translations_hdmi; - } -} - -static int skl_buf_trans_num_entries (enum port port,int n_entries) -{ -/* Only DDIA and DDIE can select the 10th register with DP */ -if (port ==PORT_A || port ==PORT_E ) -return min (n_entries,10 ); -else -return min (n_entries,9 ); -} - -static const struct ddi_buf_trans * -intel_ddi_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (IS_KABYLAKE (dev_priv) || -IS_COFFEELAKE (dev_priv) || -IS_COMETLAKE (dev_priv)) { -const struct ddi_buf_trans *ddi_translations = -kbl_get_buf_trans_dp (encoder, n_entries); - *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); -return ddi_translations; - }else if (IS_SKYLAKE (dev_priv)) { -const struct ddi_buf_trans *ddi_translations = -skl_get_buf_trans_dp (encoder, n_entries); - *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); -return ddi_translations; - }else if (IS_BROADWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (bdw_ddi_translations_dp); -return bdw_ddi_translations_dp; - }else if (IS_HASWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (hsw_ddi_translations_dp); -return hsw_ddi_translations_dp; - } - - *n_entries =0 ; -return NULL ; -} - -static const struct ddi_buf_trans * -intel_ddi_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (IS_GEN9_BC (dev_priv)) { -const struct ddi_buf_trans *ddi_translations = -skl_get_buf_trans_edp (encoder, n_entries); - *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); -return ddi_translations; - }else if (IS_BROADWELL (dev_priv)) { -return bdw_get_buf_trans_edp (encoder, n_entries); - }else if (IS_HASWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (hsw_ddi_translations_dp); -return hsw_ddi_translations_dp; - } - - *n_entries =0 ; -return NULL ; -} - -static const struct ddi_buf_trans * -intel_ddi_get_buf_trans_fdi (struct drm_i915_private *dev_priv, -int *n_entries) -{ -if (IS_BROADWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (bdw_ddi_translations_fdi); -return bdw_ddi_translations_fdi; - }else if (IS_HASWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (hsw_ddi_translations_fdi); -return hsw_ddi_translations_fdi; - } - - *n_entries =0 ; -return NULL ; -} - -static const struct ddi_buf_trans * -intel_ddi_get_buf_trans_hdmi (struct intel_encoder *encoder, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (IS_GEN9_BC (dev_priv)) { -return skl_get_buf_trans_hdmi (dev_priv, n_entries); - }else if (IS_BROADWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (bdw_ddi_translations_hdmi); -return bdw_ddi_translations_hdmi; - }else if (IS_HASWELL (dev_priv)) { - *n_entries =ARRAY_SIZE (hsw_ddi_translations_hdmi); -return hsw_ddi_translations_hdmi; - } - - *n_entries =0 ; -return NULL ; -} - -static const struct bxt_ddi_buf_trans * -bxt_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) -{ - *n_entries =ARRAY_SIZE (bxt_ddi_translations_dp); -return bxt_ddi_translations_dp; -} - -static const struct bxt_ddi_buf_trans * -bxt_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (dev_priv->vbt.edp.low_vswing) { - *n_entries =ARRAY_SIZE (bxt_ddi_translations_edp); -return bxt_ddi_translations_edp; - } - -return bxt_get_buf_trans_dp (encoder, n_entries); -} - -static const struct bxt_ddi_buf_trans * -bxt_get_buf_trans_hdmi (struct intel_encoder *encoder,int *n_entries) -{ - *n_entries =ARRAY_SIZE (bxt_ddi_translations_hdmi); -return bxt_ddi_translations_hdmi; -} - -static const struct cnl_ddi_buf_trans * -cnl_get_buf_trans_hdmi (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; - -if (voltage ==VOLTAGE_INFO_0_85V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_0_85V); -return cnl_ddi_translations_hdmi_0_85V; - }else if (voltage ==VOLTAGE_INFO_0_95V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_0_95V); -return cnl_ddi_translations_hdmi_0_95V; - }else if (voltage ==VOLTAGE_INFO_1_05V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_1_05V); -return cnl_ddi_translations_hdmi_1_05V; - }else { - *n_entries =1 ;/* shut up gcc */ -MISSING_CASE (voltage); - } -return NULL ; -} - -static const struct cnl_ddi_buf_trans * -cnl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; - -if (voltage ==VOLTAGE_INFO_0_85V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_0_85V); -return cnl_ddi_translations_dp_0_85V; - }else if (voltage ==VOLTAGE_INFO_0_95V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_0_95V); -return cnl_ddi_translations_dp_0_95V; - }else if (voltage ==VOLTAGE_INFO_1_05V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_1_05V); -return cnl_ddi_translations_dp_1_05V; - }else { - *n_entries =1 ;/* shut up gcc */ -MISSING_CASE (voltage); - } -return NULL ; -} - -static const struct cnl_ddi_buf_trans * -cnl_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; - -if (dev_priv->vbt.edp.low_vswing) { -if (voltage ==VOLTAGE_INFO_0_85V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_0_85V); -return cnl_ddi_translations_edp_0_85V; - }else if (voltage ==VOLTAGE_INFO_0_95V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_0_95V); -return cnl_ddi_translations_edp_0_95V; - }else if (voltage ==VOLTAGE_INFO_1_05V ) { - *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_1_05V); -return cnl_ddi_translations_edp_1_05V; - }else { - *n_entries =1 ;/* shut up gcc */ -MISSING_CASE (voltage); - } -return NULL ; - }else { -return cnl_get_buf_trans_dp (encoder, n_entries); - } -} - -static const struct cnl_ddi_buf_trans * -icl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); -return icl_combo_phy_ddi_translations_hdmi; -} - -static const struct cnl_ddi_buf_trans * -icl_get_combo_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hbr2); -return icl_combo_phy_ddi_translations_dp_hbr2; -} - -static const struct cnl_ddi_buf_trans * -icl_get_combo_buf_trans_edp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (crtc_state->port_clock >540000 ) { - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr3); -return icl_combo_phy_ddi_translations_edp_hbr3; - }else if (dev_priv->vbt.edp.low_vswing) { - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); -return icl_combo_phy_ddi_translations_edp_hbr2; - }else if (IS_DG1 (dev_priv) && crtc_state->port_clock >270000 ) { - *n_entries =ARRAY_SIZE (dg1_combo_phy_ddi_translations_dp_hbr2_hbr3); -return dg1_combo_phy_ddi_translations_dp_hbr2_hbr3; - }else if (IS_DG1 (dev_priv)) { - *n_entries =ARRAY_SIZE (dg1_combo_phy_ddi_translations_dp_rbr_hbr); -return dg1_combo_phy_ddi_translations_dp_rbr_hbr; - } - -return icl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -icl_get_combo_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return icl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -return icl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); -else -return icl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct icl_mg_phy_ddi_buf_trans * -icl_get_mg_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_hdmi); -return icl_mg_phy_ddi_translations_hdmi; -} - -static const struct icl_mg_phy_ddi_buf_trans * -icl_get_mg_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (crtc_state->port_clock >270000 ) { - *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_hbr2_hbr3); -return icl_mg_phy_ddi_translations_hbr2_hbr3; - }else { - *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_rbr_hbr); -return icl_mg_phy_ddi_translations_rbr_hbr; - } -} - -static const struct icl_mg_phy_ddi_buf_trans * -icl_get_mg_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return icl_get_mg_buf_trans_hdmi (encoder, crtc_state, n_entries); -else -return icl_get_mg_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -ehl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); -return icl_combo_phy_ddi_translations_hdmi; -} - -static const struct cnl_ddi_buf_trans * -ehl_get_combo_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (ehl_combo_phy_ddi_translations_dp); -return ehl_combo_phy_ddi_translations_dp; -} - -static const struct cnl_ddi_buf_trans * -ehl_get_combo_buf_trans_edp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (dev_priv->vbt.edp.low_vswing) { - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); -return icl_combo_phy_ddi_translations_edp_hbr2; - } - -return ehl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -ehl_get_combo_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return ehl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -return ehl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); -else -return ehl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -jsl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); -return icl_combo_phy_ddi_translations_hdmi; -} - -static const struct cnl_ddi_buf_trans * -jsl_get_combo_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hbr2); -return icl_combo_phy_ddi_translations_dp_hbr2; -} - -static const struct cnl_ddi_buf_trans * -jsl_get_combo_buf_trans_edp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (dev_priv->vbt.edp.low_vswing) { -if (crtc_state->port_clock >270000 ) { - *n_entries =ARRAY_SIZE (jsl_combo_phy_ddi_translations_edp_hbr2); -return jsl_combo_phy_ddi_translations_edp_hbr2; - }else { - *n_entries =ARRAY_SIZE (jsl_combo_phy_ddi_translations_edp_hbr); -return jsl_combo_phy_ddi_translations_edp_hbr; - } - } - -return jsl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -jsl_get_combo_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return jsl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -return jsl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); -else -return jsl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -tgl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); -return icl_combo_phy_ddi_translations_hdmi; -} - -static const struct cnl_ddi_buf_trans * -tgl_get_combo_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); - -if (crtc_state->port_clock >270000 ) { -if (IS_ROCKETLAKE (dev_priv)) { - *n_entries =ARRAY_SIZE (rkl_combo_phy_ddi_translations_dp_hbr2_hbr3); -return rkl_combo_phy_ddi_translations_dp_hbr2_hbr3; - }else if (IS_TGL_U (dev_priv) ||IS_TGL_Y (dev_priv)) { - *n_entries =ARRAY_SIZE (tgl_uy_combo_phy_ddi_translations_dp_hbr2); -return tgl_uy_combo_phy_ddi_translations_dp_hbr2; - }else { - *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_dp_hbr2); -return tgl_combo_phy_ddi_translations_dp_hbr2; - } - }else { -if (IS_ROCKETLAKE (dev_priv)) { - *n_entries =ARRAY_SIZE (rkl_combo_phy_ddi_translations_dp_hbr); -return rkl_combo_phy_ddi_translations_dp_hbr; - }else { - *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_dp_hbr); -return tgl_combo_phy_ddi_translations_dp_hbr; - } - } -} - -static const struct cnl_ddi_buf_trans * -tgl_get_combo_buf_trans_edp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_dp *intel_dp =enc_to_intel_dp (encoder); - -if (crtc_state->port_clock >540000 ) { - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr3); -return icl_combo_phy_ddi_translations_edp_hbr3; - }else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) { - *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_edp_hbr2_hobl); -return tgl_combo_phy_ddi_translations_edp_hbr2_hobl; - }else if (dev_priv->vbt.edp.low_vswing) { - *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); -return icl_combo_phy_ddi_translations_edp_hbr2; - } - -return tgl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct cnl_ddi_buf_trans * -tgl_get_combo_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return tgl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -return tgl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); -else -return tgl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); -} - -static const struct tgl_dkl_phy_ddi_buf_trans * -tgl_get_dkl_buf_trans_hdmi (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ - *n_entries =ARRAY_SIZE (tgl_dkl_phy_hdmi_ddi_trans); -return tgl_dkl_phy_hdmi_ddi_trans; -} - -static const struct tgl_dkl_phy_ddi_buf_trans * -tgl_get_dkl_buf_trans_dp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (crtc_state->port_clock >270000 ) { - *n_entries =ARRAY_SIZE (tgl_dkl_phy_dp_ddi_trans_hbr2); -return tgl_dkl_phy_dp_ddi_trans_hbr2; - }else { - *n_entries =ARRAY_SIZE (tgl_dkl_phy_dp_ddi_trans); -return tgl_dkl_phy_dp_ddi_trans; - } -} - -static const struct tgl_dkl_phy_ddi_buf_trans * -tgl_get_dkl_buf_trans (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -int *n_entries) -{ -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -return tgl_get_dkl_buf_trans_hdmi (encoder, crtc_state, n_entries); -else -return tgl_get_dkl_buf_trans_dp (encoder, crtc_state, n_entries); -} -static int intel_ddi_hdmi_level (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);int n_entries, level, default_entry; -enum phy phy =intel_port_to_phy (dev_priv, encoder->port); -if (INTEL_GEN (dev_priv) >=12 ) { -if (intel_phy_is_combo (dev_priv, phy)) -tgl_get_combo_buf_trans_hdmi (encoder, crtc_state, &n_entries); -else -tgl_get_dkl_buf_trans_hdmi (encoder, crtc_state, &n_entries); - default_entry = n_entries -1 ; - }else if (INTEL_GEN (dev_priv) ==11 ) { -if (intel_phy_is_combo (dev_priv, phy)) -icl_get_combo_buf_trans_hdmi (encoder, crtc_state, &n_entries); -else -icl_get_mg_buf_trans_hdmi (encoder, crtc_state, &n_entries); - default_entry = n_entries -1 ; - }else if (IS_CANNONLAKE (dev_priv)) { -cnl_get_buf_trans_hdmi (encoder, &n_entries); - default_entry = n_entries -1 ; - }else if (IS_GEN9_LP (dev_priv)) { -bxt_get_buf_trans_hdmi (encoder, &n_entries); - default_entry = n_entries -1 ; - }else if (IS_GEN9_BC (dev_priv)) { -intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); - default_entry =8 ; - }else if (IS_BROADWELL (dev_priv)) { -intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); - default_entry =7 ; - }else if (IS_HASWELL (dev_priv)) { -intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); - default_entry =6 ; - }else { -drm_WARN (&dev_priv->drm,1 ,"ddi translation table missing\n" ); + n_entries =intel_ddi_hdmi_num_entries (encoder, crtc_state, &default_entry); +if (n_entries ==0 )return 0 ; - } - -if (drm_WARN_ON_ONCE (&dev_priv->drm, n_entries ==0 )) -return 0 ; - level =intel_bios_hdmi_level_shift (encoder);if (level <0 ) level = default_entry;@@ -1636,6 +257,9 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);u32 temp, i, rx_ctl_val, ddi_pll_sel; +int n_entries; + +intel_ddi_get_buf_trans_fdi (dev_priv, &n_entries);intel_prepare_dp_ddi_buffers (encoder, crtc_state);@@ -1668,7 +292,7 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,/* Start the training iterating through available voltages and emphasis, * testing each value twice. */ -for (i =0 ; i <ARRAY_SIZE (hsw_ddi_translations_fdi) *2 ; i++) { +for (i =0 ; i < n_entries *2 ; i++) {/* Configure DP_TP_CTL with auto-training */ intel_de_write(dev_priv, DP_TP_CTL(PORT_E), DP_TP_CTL_FDI_AUTOTRAIN |@@ -1717,7 +341,7 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,* Leave things enabled even if we failed to train FDI. * Results in less fireworks from the state checker. */ -if (i ==ARRAY_SIZE (hsw_ddi_translations_fdi) *2 -1 ) { +if (i == n_entries *2 -1 ) {drm_err (&dev_priv->drm,"FDI link training failed!\n" );break ; }@@ -2479,13 +1103,7 @@ static void bxt_ddi_vswing_sequence(struct intel_encoder *encoder,enum port port = encoder->port;int n_entries; -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) - ddi_translations =bxt_get_buf_trans_hdmi (encoder, &n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) - ddi_translations =bxt_get_buf_trans_edp (encoder, &n_entries); -else - ddi_translations =bxt_get_buf_trans_dp (encoder, &n_entries); - + ddi_translations =bxt_get_buf_trans (encoder, crtc_state, &n_entries);if (drm_WARN_ON_ONCE (&dev_priv->drm, !ddi_translations))return ;if (drm_WARN_ON_ONCE (&dev_priv->drm, level >= n_entries))@@ -2522,15 +1140,9 @@ static u8 intel_ddi_dp_voltage_max(struct intel_dp *intel_dp,else icl_get_mg_buf_trans (encoder, crtc_state, &n_entries); }else if (IS_CANNONLAKE (dev_priv)) { -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -cnl_get_buf_trans_edp (encoder, &n_entries); -else -cnl_get_buf_trans_dp (encoder, &n_entries); +cnl_get_buf_trans (encoder, crtc_state, &n_entries); }else if (IS_GEN9_LP (dev_priv)) { -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) -bxt_get_buf_trans_edp (encoder, &n_entries); -else -bxt_get_buf_trans_dp (encoder, &n_entries); +bxt_get_buf_trans (encoder, crtc_state, &n_entries); }else {if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP ))intel_ddi_get_buf_trans_edp (encoder, &n_entries);@@ -2568,12 +1180,7 @@ static void cnl_ddi_vswing_program(struct intel_encoder *encoder,int n_entries, ln;u32 val; -if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) - ddi_translations =cnl_get_buf_trans_hdmi (encoder, &n_entries); -else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) - ddi_translations =cnl_get_buf_trans_edp (encoder, &n_entries); -else - ddi_translations =cnl_get_buf_trans_dp (encoder, &n_entries); + ddi_translations =cnl_get_buf_trans (encoder, crtc_state, &n_entries);if (drm_WARN_ON_ONCE (&dev_priv->drm, !ddi_translations))return ;drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c new file +1358
-0@@ -0,0 +1,1358 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation +*/ + +#include "i915_drv.h" +#include "intel_ddi.h" +#include "intel_ddi_buf_trans.h" +#include "intel_display_types.h" + +/* HDMI/DVI modes ignore everything but the last 2 items. So we share +* them for both DP and FDI transports, allowing those ports to +* automatically adapt to HDMI connections as well +*/ +static const struct ddi_buf_trans hsw_ddi_translations_dp[] = { + {0x00FFFFFF ,0x0006000E ,0x0 }, + {0x00D75FFF ,0x0005000A ,0x0 }, + {0x00C30FFF ,0x00040006 ,0x0 }, + {0x80AAAFFF ,0x000B0000 ,0x0 }, + {0x00FFFFFF ,0x0005000A ,0x0 }, + {0x00D75FFF ,0x000C0004 ,0x0 }, + {0x80C30FFF ,0x000B0000 ,0x0 }, + {0x00FFFFFF ,0x00040006 ,0x0 }, + {0x80D75FFF ,0x000B0000 ,0x0 }, +}; + +static const struct ddi_buf_trans hsw_ddi_translations_fdi[] = { + {0x00FFFFFF ,0x0007000E ,0x0 }, + {0x00D75FFF ,0x000F000A ,0x0 }, + {0x00C30FFF ,0x00060006 ,0x0 }, + {0x00AAAFFF ,0x001E0000 ,0x0 }, + {0x00FFFFFF ,0x000F000A ,0x0 }, + {0x00D75FFF ,0x00160004 ,0x0 }, + {0x00C30FFF ,0x001E0000 ,0x0 }, + {0x00FFFFFF ,0x00060006 ,0x0 }, + {0x00D75FFF ,0x001E0000 ,0x0 }, +}; + +static const struct ddi_buf_trans hsw_ddi_translations_hdmi[] = { +/* Idx NT mV d T mV d db */ + {0x00FFFFFF ,0x0006000E ,0x0 },/* 0: 400 400 0 */ + {0x00E79FFF ,0x000E000C ,0x0 },/* 1: 400 500 2 */ + {0x00D75FFF ,0x0005000A ,0x0 },/* 2: 400 600 3.5 */ + {0x00FFFFFF ,0x0005000A ,0x0 },/* 3: 600 600 0 */ + {0x00E79FFF ,0x001D0007 ,0x0 },/* 4: 600 750 2 */ + {0x00D75FFF ,0x000C0004 ,0x0 },/* 5: 600 900 3.5 */ + {0x00FFFFFF ,0x00040006 ,0x0 },/* 6: 800 800 0 */ + {0x80E79FFF ,0x00030002 ,0x0 },/* 7: 800 1000 2 */ + {0x00FFFFFF ,0x00140005 ,0x0 },/* 8: 850 850 0 */ + {0x00FFFFFF ,0x000C0004 ,0x0 },/* 9: 900 900 0 */ + {0x00FFFFFF ,0x001C0003 ,0x0 },/* 10: 950 950 0 */ + {0x80FFFFFF ,0x00030002 ,0x0 },/* 11: 1000 1000 0 */ +}; + +static const struct ddi_buf_trans bdw_ddi_translations_edp[] = { + {0x00FFFFFF ,0x00000012 ,0x0 }, + {0x00EBAFFF ,0x00020011 ,0x0 }, + {0x00C71FFF ,0x0006000F ,0x0 }, + {0x00AAAFFF ,0x000E000A ,0x0 }, + {0x00FFFFFF ,0x00020011 ,0x0 }, + {0x00DB6FFF ,0x0005000F ,0x0 }, + {0x00BEEFFF ,0x000A000C ,0x0 }, + {0x00FFFFFF ,0x0005000F ,0x0 }, + {0x00DB6FFF ,0x000A000C ,0x0 }, +}; + +static const struct ddi_buf_trans bdw_ddi_translations_dp[] = { + {0x00FFFFFF ,0x0007000E ,0x0 }, + {0x00D75FFF ,0x000E000A ,0x0 }, + {0x00BEFFFF ,0x00140006 ,0x0 }, + {0x80B2CFFF ,0x001B0002 ,0x0 }, + {0x00FFFFFF ,0x000E000A ,0x0 }, + {0x00DB6FFF ,0x00160005 ,0x0 }, + {0x80C71FFF ,0x001A0002 ,0x0 }, + {0x00F7DFFF ,0x00180004 ,0x0 }, + {0x80D75FFF ,0x001B0002 ,0x0 }, +}; + +static const struct ddi_buf_trans bdw_ddi_translations_fdi[] = { + {0x00FFFFFF ,0x0001000E ,0x0 }, + {0x00D75FFF ,0x0004000A ,0x0 }, + {0x00C30FFF ,0x00070006 ,0x0 }, + {0x00AAAFFF ,0x000C0000 ,0x0 }, + {0x00FFFFFF ,0x0004000A ,0x0 }, + {0x00D75FFF ,0x00090004 ,0x0 }, + {0x00C30FFF ,0x000C0000 ,0x0 }, + {0x00FFFFFF ,0x00070006 ,0x0 }, + {0x00D75FFF ,0x000C0000 ,0x0 }, +}; + +static const struct ddi_buf_trans bdw_ddi_translations_hdmi[] = { +/* Idx NT mV d T mV df db */ + {0x00FFFFFF ,0x0007000E ,0x0 },/* 0: 400 400 0 */ + {0x00D75FFF ,0x000E000A ,0x0 },/* 1: 400 600 3.5 */ + {0x00BEFFFF ,0x00140006 ,0x0 },/* 2: 400 800 6 */ + {0x00FFFFFF ,0x0009000D ,0x0 },/* 3: 450 450 0 */ + {0x00FFFFFF ,0x000E000A ,0x0 },/* 4: 600 600 0 */ + {0x00D7FFFF ,0x00140006 ,0x0 },/* 5: 600 800 2.5 */ + {0x80CB2FFF ,0x001B0002 ,0x0 },/* 6: 600 1000 4.5 */ + {0x00FFFFFF ,0x00140006 ,0x0 },/* 7: 800 800 0 */ + {0x80E79FFF ,0x001B0002 ,0x0 },/* 8: 800 1000 2 */ + {0x80FFFFFF ,0x001B0002 ,0x0 },/* 9: 1000 1000 0 */ +}; + +/* Skylake H and S */ +static const struct ddi_buf_trans skl_ddi_translations_dp[] = { + {0x00002016 ,0x000000A0 ,0x0 }, + {0x00005012 ,0x0000009B ,0x0 }, + {0x00007011 ,0x00000088 ,0x0 }, + {0x80009010 ,0x000000C0 ,0x1 }, + {0x00002016 ,0x0000009B ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000C0 ,0x1 }, + {0x00002016 ,0x000000DF ,0x0 }, + {0x80005012 ,0x000000C0 ,0x1 }, +}; + +/* Skylake U */ +static const struct ddi_buf_trans skl_u_ddi_translations_dp[] = { + {0x0000201B ,0x000000A2 ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000CD ,0x1 }, + {0x80009010 ,0x000000C0 ,0x1 }, + {0x0000201B ,0x0000009D ,0x0 }, + {0x80005012 ,0x000000C0 ,0x1 }, + {0x80007011 ,0x000000C0 ,0x1 }, + {0x00002016 ,0x00000088 ,0x0 }, + {0x80005012 ,0x000000C0 ,0x1 }, +}; + +/* Skylake Y */ +static const struct ddi_buf_trans skl_y_ddi_translations_dp[] = { + {0x00000018 ,0x000000A2 ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000CD ,0x3 }, + {0x80009010 ,0x000000C0 ,0x3 }, + {0x00000018 ,0x0000009D ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, + {0x80007011 ,0x000000C0 ,0x3 }, + {0x00000018 ,0x00000088 ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, +}; + +/* Kabylake H and S */ +static const struct ddi_buf_trans kbl_ddi_translations_dp[] = { + {0x00002016 ,0x000000A0 ,0x0 }, + {0x00005012 ,0x0000009B ,0x0 }, + {0x00007011 ,0x00000088 ,0x0 }, + {0x80009010 ,0x000000C0 ,0x1 }, + {0x00002016 ,0x0000009B ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000C0 ,0x1 }, + {0x00002016 ,0x00000097 ,0x0 }, + {0x80005012 ,0x000000C0 ,0x1 }, +}; + +/* Kabylake U */ +static const struct ddi_buf_trans kbl_u_ddi_translations_dp[] = { + {0x0000201B ,0x000000A1 ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000CD ,0x3 }, + {0x80009010 ,0x000000C0 ,0x3 }, + {0x0000201B ,0x0000009D ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, + {0x80007011 ,0x000000C0 ,0x3 }, + {0x00002016 ,0x0000004F ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, +}; + +/* Kabylake Y */ +static const struct ddi_buf_trans kbl_y_ddi_translations_dp[] = { + {0x00001017 ,0x000000A1 ,0x0 }, + {0x00005012 ,0x00000088 ,0x0 }, + {0x80007011 ,0x000000CD ,0x3 }, + {0x8000800F ,0x000000C0 ,0x3 }, + {0x00001017 ,0x0000009D ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, + {0x80007011 ,0x000000C0 ,0x3 }, + {0x00001017 ,0x0000004C ,0x0 }, + {0x80005012 ,0x000000C0 ,0x3 }, +}; + +/* +* Skylake/Kabylake H and S +* eDP 1.4 low vswing translation parameters +*/ +static const struct ddi_buf_trans skl_ddi_translations_edp[] = { + {0x00000018 ,0x000000A8 ,0x0 }, + {0x00004013 ,0x000000A9 ,0x0 }, + {0x00007011 ,0x000000A2 ,0x0 }, + {0x00009010 ,0x0000009C ,0x0 }, + {0x00000018 ,0x000000A9 ,0x0 }, + {0x00006013 ,0x000000A2 ,0x0 }, + {0x00007011 ,0x000000A6 ,0x0 }, + {0x00000018 ,0x000000AB ,0x0 }, + {0x00007013 ,0x0000009F ,0x0 }, + {0x00000018 ,0x000000DF ,0x0 }, +}; + +/* +* Skylake/Kabylake U +* eDP 1.4 low vswing translation parameters +*/ +static const struct ddi_buf_trans skl_u_ddi_translations_edp[] = { + {0x00000018 ,0x000000A8 ,0x0 }, + {0x00004013 ,0x000000A9 ,0x0 }, + {0x00007011 ,0x000000A2 ,0x0 }, + {0x00009010 ,0x0000009C ,0x0 }, + {0x00000018 ,0x000000A9 ,0x0 }, + {0x00006013 ,0x000000A2 ,0x0 }, + {0x00007011 ,0x000000A6 ,0x0 }, + {0x00002016 ,0x000000AB ,0x0 }, + {0x00005013 ,0x0000009F ,0x0 }, + {0x00000018 ,0x000000DF ,0x0 }, +}; + +/* +* Skylake/Kabylake Y +* eDP 1.4 low vswing translation parameters +*/ +static const struct ddi_buf_trans skl_y_ddi_translations_edp[] = { + {0x00000018 ,0x000000A8 ,0x0 }, + {0x00004013 ,0x000000AB ,0x0 }, + {0x00007011 ,0x000000A4 ,0x0 }, + {0x00009010 ,0x000000DF ,0x0 }, + {0x00000018 ,0x000000AA ,0x0 }, + {0x00006013 ,0x000000A4 ,0x0 }, + {0x00007011 ,0x0000009D ,0x0 }, + {0x00000018 ,0x000000A0 ,0x0 }, + {0x00006012 ,0x000000DF ,0x0 }, + {0x00000018 ,0x0000008A ,0x0 }, +}; + +/* Skylake/Kabylake U, H and S */ +static const struct ddi_buf_trans skl_ddi_translations_hdmi[] = { + {0x00000018 ,0x000000AC ,0x0 }, + {0x00005012 ,0x0000009D ,0x0 }, + {0x00007011 ,0x00000088 ,0x0 }, + {0x00000018 ,0x000000A1 ,0x0 }, + {0x00000018 ,0x00000098 ,0x0 }, + {0x00004013 ,0x00000088 ,0x0 }, + {0x80006012 ,0x000000CD ,0x1 }, + {0x00000018 ,0x000000DF ,0x0 }, + {0x80003015 ,0x000000CD ,0x1 },/* Default */ + {0x80003015 ,0x000000C0 ,0x1 }, + {0x80000018 ,0x000000C0 ,0x1 }, +}; + +/* Skylake/Kabylake Y */ +static const struct ddi_buf_trans skl_y_ddi_translations_hdmi[] = { + {0x00000018 ,0x000000A1 ,0x0 }, + {0x00005012 ,0x000000DF ,0x0 }, + {0x80007011 ,0x000000CB ,0x3 }, + {0x00000018 ,0x000000A4 ,0x0 }, + {0x00000018 ,0x0000009D ,0x0 }, + {0x00004013 ,0x00000080 ,0x0 }, + {0x80006013 ,0x000000C0 ,0x3 }, + {0x00000018 ,0x0000008A ,0x0 }, + {0x80003015 ,0x000000C0 ,0x3 },/* Default */ + {0x80003015 ,0x000000C0 ,0x3 }, + {0x80000018 ,0x000000C0 ,0x3 }, +}; + + +static const struct bxt_ddi_buf_trans bxt_ddi_translations_dp[] = { +/* Idx NT mV diff db */ + {52 ,0x9A ,0 ,128 , },/* 0: 400 0 */ + {78 ,0x9A ,0 ,85 , },/* 1: 400 3.5 */ + {104 ,0x9A ,0 ,64 , },/* 2: 400 6 */ + {154 ,0x9A ,0 ,43 , },/* 3: 400 9.5 */ + {77 ,0x9A ,0 ,128 , },/* 4: 600 0 */ + {116 ,0x9A ,0 ,85 , },/* 5: 600 3.5 */ + {154 ,0x9A ,0 ,64 , },/* 6: 600 6 */ + {102 ,0x9A ,0 ,128 , },/* 7: 800 0 */ + {154 ,0x9A ,0 ,85 , },/* 8: 800 3.5 */ + {154 ,0x9A ,1 ,128 , },/* 9: 1200 0 */ +}; + +static const struct bxt_ddi_buf_trans bxt_ddi_translations_edp[] = { +/* Idx NT mV diff db */ + {26 ,0 ,0 ,128 , },/* 0: 200 0 */ + {38 ,0 ,0 ,112 , },/* 1: 200 1.5 */ + {48 ,0 ,0 ,96 , },/* 2: 200 4 */ + {54 ,0 ,0 ,69 , },/* 3: 200 6 */ + {32 ,0 ,0 ,128 , },/* 4: 250 0 */ + {48 ,0 ,0 ,104 , },/* 5: 250 1.5 */ + {54 ,0 ,0 ,85 , },/* 6: 250 4 */ + {43 ,0 ,0 ,128 , },/* 7: 300 0 */ + {54 ,0 ,0 ,101 , },/* 8: 300 1.5 */ + {48 ,0 ,0 ,128 , },/* 9: 300 0 */ +}; + +/* BSpec has 2 recommended values - entries 0 and 8. +* Using the entry with higher vswing. +*/ +static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = { +/* Idx NT mV diff db */ + {52 ,0x9A ,0 ,128 , },/* 0: 400 0 */ + {52 ,0x9A ,0 ,85 , },/* 1: 400 3.5 */ + {52 ,0x9A ,0 ,64 , },/* 2: 400 6 */ + {42 ,0x9A ,0 ,43 , },/* 3: 400 9.5 */ + {77 ,0x9A ,0 ,128 , },/* 4: 600 0 */ + {77 ,0x9A ,0 ,85 , },/* 5: 600 3.5 */ + {77 ,0x9A ,0 ,64 , },/* 6: 600 6 */ + {102 ,0x9A ,0 ,128 , },/* 7: 800 0 */ + {102 ,0x9A ,0 ,85 , },/* 8: 800 3.5 */ + {154 ,0x9A ,1 ,128 , },/* 9: 1200 0 */ +}; + +/* Voltage Swing Programming for VccIO 0.85V for DP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_0_85V[] = { +/* NT mV Trans mV db */ + {0xA ,0x5D ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x6A ,0x38 ,0x00 ,0x07 },/* 350 500 3.1 */ + {0xB ,0x7A ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ + {0x6 ,0x7C ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ + {0xA ,0x69 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xB ,0x7A ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ + {0x6 ,0x7C ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ + {0xB ,0x7D ,0x3C ,0x00 ,0x03 },/* 650 725 0.9 */ + {0x6 ,0x7C ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ + {0x6 ,0x7B ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 0.85V for HDMI */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_0_85V[] = { +/* NT mV Trans mV db */ + {0xA ,0x60 ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ + {0xB ,0x73 ,0x36 ,0x00 ,0x09 },/* 450 650 3.2 */ + {0x6 ,0x7F ,0x31 ,0x00 ,0x0E },/* 450 850 5.5 */ + {0xB ,0x73 ,0x3F ,0x00 ,0x00 },/* 650 650 0.0 */ + {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 650 850 2.3 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 850 850 0.0 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ +}; + +/* Voltage Swing Programming for VccIO 0.85V for eDP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_0_85V[] = { +/* NT mV Trans mV db */ + {0xA ,0x66 ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ + {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ + {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ + {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ + {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ + {0xA ,0x66 ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ + {0xB ,0x70 ,0x3C ,0x00 ,0x03 },/* 460 600 2.3 */ + {0xC ,0x75 ,0x3C ,0x00 ,0x03 },/* 537 700 2.3 */ + {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 0.95V for DP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_0_95V[] = { +/* NT mV Trans mV db */ + {0xA ,0x5D ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x6A ,0x38 ,0x00 ,0x07 },/* 350 500 3.1 */ + {0xB ,0x7A ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ + {0x6 ,0x7C ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ + {0xA ,0x69 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xB ,0x7A ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ + {0x6 ,0x7C ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ + {0xB ,0x7D ,0x3C ,0x00 ,0x03 },/* 650 725 0.9 */ + {0x6 ,0x7C ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ + {0x6 ,0x7B ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 0.95V for HDMI */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_0_95V[] = { +/* NT mV Trans mV db */ + {0xA ,0x5C ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ + {0xB ,0x69 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ + {0x5 ,0x76 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ + {0xA ,0x5E ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ + {0xB ,0x69 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ + {0xB ,0x79 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ + {0x6 ,0x7D ,0x32 ,0x00 ,0x0D },/* 600 1000 4.4 */ + {0x5 ,0x76 ,0x3F ,0x00 ,0x00 },/* 800 800 0.0 */ + {0x6 ,0x7D ,0x39 ,0x00 ,0x06 },/* 800 1000 1.9 */ + {0x6 ,0x7F ,0x39 ,0x00 ,0x06 },/* 850 1050 1.8 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 0.95V for eDP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_0_95V[] = { +/* NT mV Trans mV db */ + {0xA ,0x61 ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ + {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ + {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ + {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ + {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ + {0xA ,0x61 ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ + {0xB ,0x68 ,0x39 ,0x00 ,0x06 },/* 460 600 2.3 */ + {0xC ,0x6E ,0x39 ,0x00 ,0x06 },/* 537 700 2.3 */ + {0x4 ,0x7F ,0x3A ,0x00 ,0x05 },/* 460 600 2.3 */ + {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 1.05V for DP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_dp_1_05V[] = { +/* NT mV Trans mV db */ + {0xA ,0x58 ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ + {0xB ,0x64 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ + {0x5 ,0x70 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ + {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 400 1050 8.4 */ + {0xB ,0x64 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ + {0x5 ,0x73 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ + {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 550 1050 5.6 */ + {0x5 ,0x76 ,0x3E ,0x00 ,0x01 },/* 850 900 0.5 */ + {0x6 ,0x7F ,0x36 ,0x00 ,0x09 },/* 750 1050 2.9 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 1.05V for HDMI */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_hdmi_1_05V[] = { +/* NT mV Trans mV db */ + {0xA ,0x58 ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ + {0xB ,0x64 ,0x37 ,0x00 ,0x08 },/* 400 600 3.5 */ + {0x5 ,0x70 ,0x31 ,0x00 ,0x0E },/* 400 800 6.0 */ + {0xA ,0x5B ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ + {0xB ,0x64 ,0x3F ,0x00 ,0x00 },/* 600 600 0.0 */ + {0x5 ,0x73 ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ + {0x6 ,0x7C ,0x32 ,0x00 ,0x0D },/* 600 1000 4.4 */ + {0x5 ,0x70 ,0x3F ,0x00 ,0x00 },/* 800 800 0.0 */ + {0x6 ,0x7C ,0x39 ,0x00 ,0x06 },/* 800 1000 1.9 */ + {0x6 ,0x7F ,0x39 ,0x00 ,0x06 },/* 850 1050 1.8 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1050 1050 0.0 */ +}; + +/* Voltage Swing Programming for VccIO 1.05V for eDP */ +static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_1_05V[] = { +/* NT mV Trans mV db */ + {0xA ,0x5E ,0x3A ,0x00 ,0x05 },/* 384 500 2.3 */ + {0x0 ,0x7F ,0x38 ,0x00 ,0x07 },/* 153 200 2.3 */ + {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 192 250 2.3 */ + {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 230 300 2.3 */ + {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 269 350 2.3 */ + {0xA ,0x5E ,0x3C ,0x00 ,0x03 },/* 446 500 1.0 */ + {0xB ,0x64 ,0x39 ,0x00 ,0x06 },/* 460 600 2.3 */ + {0xE ,0x6A ,0x39 ,0x00 ,0x06 },/* 537 700 2.3 */ + {0x2 ,0x7F ,0x3F ,0x00 ,0x00 },/* 400 400 0.0 */ +}; + +/* icl_combo_phy_ddi_translations */ +static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hbr2[] = { +/* NT mV Trans mV db */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ + {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ + {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ + {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr2[] = { +/* NT mV Trans mV db */ + {0x0 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ + {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 200 250 1.9 */ + {0x1 ,0x7F ,0x33 ,0x00 ,0x0C },/* 200 300 3.5 */ + {0x9 ,0x7F ,0x31 ,0x00 ,0x0E },/* 200 350 4.9 */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ + {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 250 300 1.6 */ + {0x9 ,0x7F ,0x35 ,0x00 ,0x0A },/* 250 350 2.9 */ + {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ + {0x9 ,0x7F ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ + {0x9 ,0x7F ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ +}; + +static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr3[] = { +/* NT mV Trans mV db */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ + {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ + {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ + {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_hdmi[] = { +/* NT mV Trans mV db */ + {0xA ,0x60 ,0x3F ,0x00 ,0x00 },/* 450 450 0.0 */ + {0xB ,0x73 ,0x36 ,0x00 ,0x09 },/* 450 650 3.2 */ + {0x6 ,0x7F ,0x31 ,0x00 ,0x0E },/* 450 850 5.5 */ + {0xB ,0x73 ,0x3F ,0x00 ,0x00 },/* 650 650 0.0 ALS */ + {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 650 850 2.3 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 850 850 0.0 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 850 3.0 */ +}; + +static const struct cnl_ddi_buf_trans ehl_combo_phy_ddi_translations_dp[] = { +/* NT mV Trans mV db */ + {0xA ,0x33 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x47 ,0x36 ,0x00 ,0x09 },/* 350 500 3.1 */ + {0xC ,0x64 ,0x34 ,0x00 ,0x0B },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 350 900 8.2 */ + {0xA ,0x46 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x64 ,0x38 ,0x00 ,0x07 },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x32 ,0x00 ,0x0D },/* 500 900 5.1 */ + {0xC ,0x61 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x38 ,0x00 ,0x07 },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr[] = { +/* NT mV Trans mV db */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ + {0x8 ,0x7F ,0x38 ,0x00 ,0x07 },/* 200 250 1.9 */ + {0x1 ,0x7F ,0x33 ,0x00 ,0x0C },/* 200 300 3.5 */ + {0xA ,0x35 ,0x36 ,0x00 ,0x09 },/* 200 350 4.9 */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ + {0x1 ,0x7F ,0x38 ,0x00 ,0x07 },/* 250 300 1.6 */ + {0xA ,0x35 ,0x35 ,0x00 ,0x0A },/* 250 350 2.9 */ + {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ + {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ +}; + +static const struct cnl_ddi_buf_trans jsl_combo_phy_ddi_translations_edp_hbr2[] = { +/* NT mV Trans mV db */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 200 0.0 */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 200 250 1.9 */ + {0x1 ,0x7F ,0x3D ,0x00 ,0x02 },/* 200 300 3.5 */ + {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 200 350 4.9 */ + {0x8 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 250 0.0 */ + {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 250 300 1.6 */ + {0xA ,0x35 ,0x3A ,0x00 ,0x05 },/* 250 350 2.9 */ + {0x1 ,0x7F ,0x3F ,0x00 ,0x00 },/* 300 300 0.0 */ + {0xA ,0x35 ,0x38 ,0x00 ,0x07 },/* 300 350 1.3 */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ +}; + +static const struct cnl_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_rbr_hbr[] = { +/* NT mV Trans mV db */ + {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x48 ,0x35 ,0x00 ,0x0A },/* 350 500 3.1 */ + {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 350 900 8.2 */ + {0xA ,0x43 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x60 ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ + {0xC ,0x60 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x37 ,0x00 ,0x08 },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans dg1_combo_phy_ddi_translations_dp_hbr2_hbr3[] = { +/* NT mV Trans mV db */ + {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x48 ,0x35 ,0x00 ,0x0A },/* 350 500 3.1 */ + {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x2C ,0x00 ,0x13 },/* 350 900 8.2 */ + {0xA ,0x43 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x60 ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x30 ,0x00 ,0x0F },/* 500 900 5.1 */ + {0xC ,0x58 ,0x3F ,0x00 ,0x00 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_rbr_hbr[] = { +/* Voltage swing pre-emphasis */ + {0x18 ,0x00 ,0x00 },/* 0 0 */ + {0x1D ,0x00 ,0x05 },/* 0 1 */ + {0x24 ,0x00 ,0x0C },/* 0 2 */ + {0x2B ,0x00 ,0x14 },/* 0 3 */ + {0x21 ,0x00 ,0x00 },/* 1 0 */ + {0x2B ,0x00 ,0x08 },/* 1 1 */ + {0x30 ,0x00 ,0x0F },/* 1 2 */ + {0x31 ,0x00 ,0x03 },/* 2 0 */ + {0x34 ,0x00 ,0x0B },/* 2 1 */ + {0x3F ,0x00 ,0x00 },/* 3 0 */ +}; + +static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_hbr2_hbr3[] = { +/* Voltage swing pre-emphasis */ + {0x18 ,0x00 ,0x00 },/* 0 0 */ + {0x1D ,0x00 ,0x05 },/* 0 1 */ + {0x24 ,0x00 ,0x0C },/* 0 2 */ + {0x2B ,0x00 ,0x14 },/* 0 3 */ + {0x26 ,0x00 ,0x00 },/* 1 0 */ + {0x2C ,0x00 ,0x07 },/* 1 1 */ + {0x33 ,0x00 ,0x0C },/* 1 2 */ + {0x2E ,0x00 ,0x00 },/* 2 0 */ + {0x36 ,0x00 ,0x09 },/* 2 1 */ + {0x3F ,0x00 ,0x00 },/* 3 0 */ +}; + +static const struct icl_mg_phy_ddi_buf_trans icl_mg_phy_ddi_translations_hdmi[] = { +/* HDMI Preset VS Pre-emph */ + {0x1A ,0x0 ,0x0 },/* 1 400mV 0dB */ + {0x20 ,0x0 ,0x0 },/* 2 500mV 0dB */ + {0x29 ,0x0 ,0x0 },/* 3 650mV 0dB */ + {0x32 ,0x0 ,0x0 },/* 4 800mV 0dB */ + {0x3F ,0x0 ,0x0 },/* 5 1000mV 0dB */ + {0x3A ,0x0 ,0x5 },/* 6 Full -1.5 dB */ + {0x39 ,0x0 ,0x6 },/* 7 Full -1.8 dB */ + {0x38 ,0x0 ,0x7 },/* 8 Full -2 dB */ + {0x37 ,0x0 ,0x8 },/* 9 Full -2.5 dB */ + {0x36 ,0x0 ,0x9 },/* 10 Full -3 dB */ +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_dp_ddi_trans[] = { +/* VS pre-emp Non-trans mV Pre-emph dB */ + {0x7 ,0x0 ,0x00 },/* 0 0 400mV 0 dB */ + {0x5 ,0x0 ,0x05 },/* 0 1 400mV 3.5 dB */ + {0x2 ,0x0 ,0x0B },/* 0 2 400mV 6 dB */ + {0x0 ,0x0 ,0x18 },/* 0 3 400mV 9.5 dB */ + {0x5 ,0x0 ,0x00 },/* 1 0 600mV 0 dB */ + {0x2 ,0x0 ,0x08 },/* 1 1 600mV 3.5 dB */ + {0x0 ,0x0 ,0x14 },/* 1 2 600mV 6 dB */ + {0x2 ,0x0 ,0x00 },/* 2 0 800mV 0 dB */ + {0x0 ,0x0 ,0x0B },/* 2 1 800mV 3.5 dB */ + {0x0 ,0x0 ,0x00 },/* 3 0 1200mV 0 dB HDMI default */ +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_dp_ddi_trans_hbr2[] = { +/* VS pre-emp Non-trans mV Pre-emph dB */ + {0x7 ,0x0 ,0x00 },/* 0 0 400mV 0 dB */ + {0x5 ,0x0 ,0x05 },/* 0 1 400mV 3.5 dB */ + {0x2 ,0x0 ,0x0B },/* 0 2 400mV 6 dB */ + {0x0 ,0x0 ,0x19 },/* 0 3 400mV 9.5 dB */ + {0x5 ,0x0 ,0x00 },/* 1 0 600mV 0 dB */ + {0x2 ,0x0 ,0x08 },/* 1 1 600mV 3.5 dB */ + {0x0 ,0x0 ,0x14 },/* 1 2 600mV 6 dB */ + {0x2 ,0x0 ,0x00 },/* 2 0 800mV 0 dB */ + {0x0 ,0x0 ,0x0B },/* 2 1 800mV 3.5 dB */ + {0x0 ,0x0 ,0x00 },/* 3 0 1200mV 0 dB HDMI default */ +}; + +static const struct tgl_dkl_phy_ddi_buf_trans tgl_dkl_phy_hdmi_ddi_trans[] = { +/* HDMI Preset VS Pre-emph */ + {0x7 ,0x0 ,0x0 },/* 1 400mV 0dB */ + {0x6 ,0x0 ,0x0 },/* 2 500mV 0dB */ + {0x4 ,0x0 ,0x0 },/* 3 650mV 0dB */ + {0x2 ,0x0 ,0x0 },/* 4 800mV 0dB */ + {0x0 ,0x0 ,0x0 },/* 5 1000mV 0dB */ + {0x0 ,0x0 ,0x5 },/* 6 Full -1.5 dB */ + {0x0 ,0x0 ,0x6 },/* 7 Full -1.8 dB */ + {0x0 ,0x0 ,0x7 },/* 8 Full -2 dB */ + {0x0 ,0x0 ,0x8 },/* 9 Full -2.5 dB */ + {0x0 ,0x0 ,0xA },/* 10 Full -3 dB */ +}; + +static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr[] = { +/* NT mV Trans mV db */ + {0xA ,0x32 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ + {0xC ,0x71 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7D ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ + {0xA ,0x4C ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x73 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ + {0xC ,0x6C ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_dp_hbr2[] = { +/* NT mV Trans mV db */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x4F ,0x37 ,0x00 ,0x08 },/* 350 500 3.1 */ + {0xC ,0x63 ,0x2F ,0x00 ,0x10 },/* 350 700 6.0 */ + {0x6 ,0x7F ,0x2B ,0x00 ,0x14 },/* 350 900 8.2 */ + {0xA ,0x47 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x63 ,0x34 ,0x00 ,0x0B },/* 500 700 2.9 */ + {0x6 ,0x7F ,0x2F ,0x00 ,0x10 },/* 500 900 5.1 */ + {0xC ,0x61 ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ + {0x6 ,0x7B ,0x35 ,0x00 ,0x0A },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +static const struct cnl_ddi_buf_trans tgl_uy_combo_phy_ddi_translations_dp_hbr2[] = { +/* NT mV Trans mV db */ + {0xA ,0x35 ,0x3F ,0x00 ,0x00 },/* 350 350 0.0 */ + {0xA ,0x4F ,0x36 ,0x00 ,0x09 },/* 350 500 3.1 */ + {0xC ,0x60 ,0x32 ,0x00 ,0x0D },/* 350 700 6.0 */ + {0xC ,0x7F ,0x2D ,0x00 ,0x12 },/* 350 900 8.2 */ + {0xC ,0x47 ,0x3F ,0x00 ,0x00 },/* 500 500 0.0 */ + {0xC ,0x6F ,0x36 ,0x00 ,0x09 },/* 500 700 2.9 */ + {0x6 ,0x7D ,0x32 ,0x00 ,0x0D },/* 500 900 5.1 */ + {0x6 ,0x60 ,0x3C ,0x00 ,0x03 },/* 650 700 0.6 */ + {0x6 ,0x7F ,0x34 ,0x00 ,0x0B },/* 600 900 3.5 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 900 900 0.0 */ +}; + +/* +* Cloned the HOBL entry to comply with the voltage and pre-emphasis entries +* that DisplayPort specification requires +*/ +static const struct cnl_ddi_buf_trans tgl_combo_phy_ddi_translations_edp_hbr2_hobl[] = { +/* VS pre-emp */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 0 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 1 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 2 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 0 3 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 0 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 1 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 1 2 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 2 0 */ + {0x6 ,0x7F ,0x3F ,0x00 ,0x00 },/* 2 1 */ +}; + +bool is_hobl_buf_trans (const struct cnl_ddi_buf_trans *table) +{ +return table == tgl_combo_phy_ddi_translations_edp_hbr2_hobl; +} + +const struct ddi_buf_trans * +bdw_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (dev_priv->vbt.edp.low_vswing) { + *n_entries =ARRAY_SIZE (bdw_ddi_translations_edp); +return bdw_ddi_translations_edp; + }else { + *n_entries =ARRAY_SIZE (bdw_ddi_translations_dp); +return bdw_ddi_translations_dp; + } +} + +const struct ddi_buf_trans * +skl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (IS_SKL_ULX (dev_priv)) { + *n_entries =ARRAY_SIZE (skl_y_ddi_translations_dp); +return skl_y_ddi_translations_dp; + }else if (IS_SKL_ULT (dev_priv)) { + *n_entries =ARRAY_SIZE (skl_u_ddi_translations_dp); +return skl_u_ddi_translations_dp; + }else { + *n_entries =ARRAY_SIZE (skl_ddi_translations_dp); +return skl_ddi_translations_dp; + } +} + +const struct ddi_buf_trans * +kbl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (IS_KBL_ULX (dev_priv) || +IS_CFL_ULX (dev_priv) || +IS_CML_ULX (dev_priv)) { + *n_entries =ARRAY_SIZE (kbl_y_ddi_translations_dp); +return kbl_y_ddi_translations_dp; + }else if (IS_KBL_ULT (dev_priv) || +IS_CFL_ULT (dev_priv) || +IS_CML_ULT (dev_priv)) { + *n_entries =ARRAY_SIZE (kbl_u_ddi_translations_dp); +return kbl_u_ddi_translations_dp; + }else { + *n_entries =ARRAY_SIZE (kbl_ddi_translations_dp); +return kbl_ddi_translations_dp; + } +} + +const struct ddi_buf_trans * +skl_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (dev_priv->vbt.edp.low_vswing) { +if (IS_SKL_ULX (dev_priv) || +IS_KBL_ULX (dev_priv) || +IS_CFL_ULX (dev_priv) || +IS_CML_ULX (dev_priv)) { + *n_entries =ARRAY_SIZE (skl_y_ddi_translations_edp); +return skl_y_ddi_translations_edp; + }else if (IS_SKL_ULT (dev_priv) || +IS_KBL_ULT (dev_priv) || +IS_CFL_ULT (dev_priv) || +IS_CML_ULT (dev_priv)) { + *n_entries =ARRAY_SIZE (skl_u_ddi_translations_edp); +return skl_u_ddi_translations_edp; + }else { + *n_entries =ARRAY_SIZE (skl_ddi_translations_edp); +return skl_ddi_translations_edp; + } + } + +if (IS_KABYLAKE (dev_priv) || +IS_COFFEELAKE (dev_priv) || +IS_COMETLAKE (dev_priv)) +return kbl_get_buf_trans_dp (encoder, n_entries); +else +return skl_get_buf_trans_dp (encoder, n_entries); +} + +const struct ddi_buf_trans * +skl_get_buf_trans_hdmi (struct drm_i915_private *dev_priv,int *n_entries) +{ +if (IS_SKL_ULX (dev_priv) || +IS_KBL_ULX (dev_priv) || +IS_CFL_ULX (dev_priv) || +IS_CML_ULX (dev_priv)) { + *n_entries =ARRAY_SIZE (skl_y_ddi_translations_hdmi); +return skl_y_ddi_translations_hdmi; + }else { + *n_entries =ARRAY_SIZE (skl_ddi_translations_hdmi); +return skl_ddi_translations_hdmi; + } +} + +int skl_buf_trans_num_entries (enum port port,int n_entries) +{ +/* Only DDIA and DDIE can select the 10th register with DP */ +if (port ==PORT_A || port ==PORT_E ) +return min (n_entries,10 ); +else +return min (n_entries,9 ); +} + +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (IS_KABYLAKE (dev_priv) || +IS_COFFEELAKE (dev_priv) || +IS_COMETLAKE (dev_priv)) { +const struct ddi_buf_trans *ddi_translations = +kbl_get_buf_trans_dp (encoder, n_entries); + *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); +return ddi_translations; + }else if (IS_SKYLAKE (dev_priv)) { +const struct ddi_buf_trans *ddi_translations = +skl_get_buf_trans_dp (encoder, n_entries); + *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); +return ddi_translations; + }else if (IS_BROADWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (bdw_ddi_translations_dp); +return bdw_ddi_translations_dp; + }else if (IS_HASWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (hsw_ddi_translations_dp); +return hsw_ddi_translations_dp; + } + + *n_entries =0 ; +return NULL ; +} + +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (IS_GEN9_BC (dev_priv)) { +const struct ddi_buf_trans *ddi_translations = +skl_get_buf_trans_edp (encoder, n_entries); + *n_entries =skl_buf_trans_num_entries (encoder->port, *n_entries); +return ddi_translations; + }else if (IS_BROADWELL (dev_priv)) { +return bdw_get_buf_trans_edp (encoder, n_entries); + }else if (IS_HASWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (hsw_ddi_translations_dp); +return hsw_ddi_translations_dp; + } + + *n_entries =0 ; +return NULL ; +} + +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_fdi (struct drm_i915_private *dev_priv, +int *n_entries) +{ +if (IS_BROADWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (bdw_ddi_translations_fdi); +return bdw_ddi_translations_fdi; + }else if (IS_HASWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (hsw_ddi_translations_fdi); +return hsw_ddi_translations_fdi; + } + + *n_entries =0 ; +return NULL ; +} + +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_hdmi (struct intel_encoder *encoder, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (IS_GEN9_BC (dev_priv)) { +return skl_get_buf_trans_hdmi (dev_priv, n_entries); + }else if (IS_BROADWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (bdw_ddi_translations_hdmi); +return bdw_ddi_translations_hdmi; + }else if (IS_HASWELL (dev_priv)) { + *n_entries =ARRAY_SIZE (hsw_ddi_translations_hdmi); +return hsw_ddi_translations_hdmi; + } + + *n_entries =0 ; +return NULL ; +} + +static const struct bxt_ddi_buf_trans * +bxt_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) +{ + *n_entries =ARRAY_SIZE (bxt_ddi_translations_dp); +return bxt_ddi_translations_dp; +} + +static const struct bxt_ddi_buf_trans * +bxt_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (dev_priv->vbt.edp.low_vswing) { + *n_entries =ARRAY_SIZE (bxt_ddi_translations_edp); +return bxt_ddi_translations_edp; + } + +return bxt_get_buf_trans_dp (encoder, n_entries); +} + +static const struct bxt_ddi_buf_trans * +bxt_get_buf_trans_hdmi (struct intel_encoder *encoder,int *n_entries) +{ + *n_entries =ARRAY_SIZE (bxt_ddi_translations_hdmi); +return bxt_ddi_translations_hdmi; +} + +const struct bxt_ddi_buf_trans * +bxt_get_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return bxt_get_buf_trans_hdmi (encoder, n_entries); +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return bxt_get_buf_trans_edp (encoder, n_entries); +return bxt_get_buf_trans_dp (encoder, n_entries); +} + +static const struct cnl_ddi_buf_trans * +cnl_get_buf_trans_hdmi (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; + +if (voltage ==VOLTAGE_INFO_0_85V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_0_85V); +return cnl_ddi_translations_hdmi_0_85V; + }else if (voltage ==VOLTAGE_INFO_0_95V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_0_95V); +return cnl_ddi_translations_hdmi_0_95V; + }else if (voltage ==VOLTAGE_INFO_1_05V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_hdmi_1_05V); +return cnl_ddi_translations_hdmi_1_05V; + }else { + *n_entries =1 ;/* shut up gcc */ +MISSING_CASE (voltage); + } +return NULL ; +} + +static const struct cnl_ddi_buf_trans * +cnl_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; + +if (voltage ==VOLTAGE_INFO_0_85V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_0_85V); +return cnl_ddi_translations_dp_0_85V; + }else if (voltage ==VOLTAGE_INFO_0_95V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_0_95V); +return cnl_ddi_translations_dp_0_95V; + }else if (voltage ==VOLTAGE_INFO_1_05V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_dp_1_05V); +return cnl_ddi_translations_dp_1_05V; + }else { + *n_entries =1 ;/* shut up gcc */ +MISSING_CASE (voltage); + } +return NULL ; +} + +static const struct cnl_ddi_buf_trans * +cnl_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +u32 voltage =intel_de_read (dev_priv,CNL_PORT_COMP_DW3 ) &VOLTAGE_INFO_MASK ; + +if (dev_priv->vbt.edp.low_vswing) { +if (voltage ==VOLTAGE_INFO_0_85V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_0_85V); +return cnl_ddi_translations_edp_0_85V; + }else if (voltage ==VOLTAGE_INFO_0_95V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_0_95V); +return cnl_ddi_translations_edp_0_95V; + }else if (voltage ==VOLTAGE_INFO_1_05V ) { + *n_entries =ARRAY_SIZE (cnl_ddi_translations_edp_1_05V); +return cnl_ddi_translations_edp_1_05V; + }else { + *n_entries =1 ;/* shut up gcc */ +MISSING_CASE (voltage); + } +return NULL ; + }else { +return cnl_get_buf_trans_dp (encoder, n_entries); + } +} + +const struct cnl_ddi_buf_trans * +cnl_get_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return cnl_get_buf_trans_hdmi (encoder, n_entries); +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return cnl_get_buf_trans_edp (encoder, n_entries); +return cnl_get_buf_trans_dp (encoder, n_entries); +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); +return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hbr2); +return icl_combo_phy_ddi_translations_dp_hbr2; +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans_edp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (crtc_state->port_clock >540000 ) { + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr3); +return icl_combo_phy_ddi_translations_edp_hbr3; + }else if (dev_priv->vbt.edp.low_vswing) { + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); +return icl_combo_phy_ddi_translations_edp_hbr2; + }else if (IS_DG1 (dev_priv) && crtc_state->port_clock >270000 ) { + *n_entries =ARRAY_SIZE (dg1_combo_phy_ddi_translations_dp_hbr2_hbr3); +return dg1_combo_phy_ddi_translations_dp_hbr2_hbr3; + }else if (IS_DG1 (dev_priv)) { + *n_entries =ARRAY_SIZE (dg1_combo_phy_ddi_translations_dp_rbr_hbr); +return dg1_combo_phy_ddi_translations_dp_rbr_hbr; + } + +return icl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return icl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); +else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return icl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); +else +return icl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +static const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_hdmi); +return icl_mg_phy_ddi_translations_hdmi; +} + +static const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (crtc_state->port_clock >270000 ) { + *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_hbr2_hbr3); +return icl_mg_phy_ddi_translations_hbr2_hbr3; + }else { + *n_entries =ARRAY_SIZE (icl_mg_phy_ddi_translations_rbr_hbr); +return icl_mg_phy_ddi_translations_rbr_hbr; + } +} + +const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return icl_get_mg_buf_trans_hdmi (encoder, crtc_state, n_entries); +else +return icl_get_mg_buf_trans_dp (encoder, crtc_state, n_entries); +} + +static const struct cnl_ddi_buf_trans * +ehl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); +return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +ehl_get_combo_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (ehl_combo_phy_ddi_translations_dp); +return ehl_combo_phy_ddi_translations_dp; +} + +static const struct cnl_ddi_buf_trans * +ehl_get_combo_buf_trans_edp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (dev_priv->vbt.edp.low_vswing) { + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); +return icl_combo_phy_ddi_translations_edp_hbr2; + } + +return ehl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +const struct cnl_ddi_buf_trans * +ehl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return ehl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); +else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return ehl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); +else +return ehl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); +return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hbr2); +return icl_combo_phy_ddi_translations_dp_hbr2; +} + +static const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans_edp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (dev_priv->vbt.edp.low_vswing) { +if (crtc_state->port_clock >270000 ) { + *n_entries =ARRAY_SIZE (jsl_combo_phy_ddi_translations_edp_hbr2); +return jsl_combo_phy_ddi_translations_edp_hbr2; + }else { + *n_entries =ARRAY_SIZE (jsl_combo_phy_ddi_translations_edp_hbr); +return jsl_combo_phy_ddi_translations_edp_hbr; + } + } + +return jsl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return jsl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); +else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return jsl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); +else +return jsl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +static const struct cnl_ddi_buf_trans * +tgl_get_combo_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi); +return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +tgl_get_combo_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); + +if (crtc_state->port_clock >270000 ) { +if (IS_TGL_U (dev_priv) ||IS_TGL_Y (dev_priv)) { + *n_entries =ARRAY_SIZE (tgl_uy_combo_phy_ddi_translations_dp_hbr2); +return tgl_uy_combo_phy_ddi_translations_dp_hbr2; + }else { + *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_dp_hbr2); +return tgl_combo_phy_ddi_translations_dp_hbr2; + } + }else { + *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_dp_hbr); +return tgl_combo_phy_ddi_translations_dp_hbr; + } +} + +static const struct cnl_ddi_buf_trans * +tgl_get_combo_buf_trans_edp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); + +if (crtc_state->port_clock >540000 ) { + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr3); +return icl_combo_phy_ddi_translations_edp_hbr3; + }else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) { + *n_entries =ARRAY_SIZE (tgl_combo_phy_ddi_translations_edp_hbr2_hobl); +return tgl_combo_phy_ddi_translations_edp_hbr2_hobl; + }else if (dev_priv->vbt.edp.low_vswing) { + *n_entries =ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2); +return icl_combo_phy_ddi_translations_edp_hbr2; + } + +return tgl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +const struct cnl_ddi_buf_trans * +tgl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return tgl_get_combo_buf_trans_hdmi (encoder, crtc_state, n_entries); +else if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP )) +return tgl_get_combo_buf_trans_edp (encoder, crtc_state, n_entries); +else +return tgl_get_combo_buf_trans_dp (encoder, crtc_state, n_entries); +} + +static const struct tgl_dkl_phy_ddi_buf_trans * +tgl_get_dkl_buf_trans_hdmi (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ + *n_entries =ARRAY_SIZE (tgl_dkl_phy_hdmi_ddi_trans); +return tgl_dkl_phy_hdmi_ddi_trans; +} + +static const struct tgl_dkl_phy_ddi_buf_trans * +tgl_get_dkl_buf_trans_dp (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (crtc_state->port_clock >270000 ) { + *n_entries =ARRAY_SIZE (tgl_dkl_phy_dp_ddi_trans_hbr2); +return tgl_dkl_phy_dp_ddi_trans_hbr2; + }else { + *n_entries =ARRAY_SIZE (tgl_dkl_phy_dp_ddi_trans); +return tgl_dkl_phy_dp_ddi_trans; + } +} + +const struct tgl_dkl_phy_ddi_buf_trans * +tgl_get_dkl_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries) +{ +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +return tgl_get_dkl_buf_trans_hdmi (encoder, crtc_state, n_entries); +else +return tgl_get_dkl_buf_trans_dp (encoder, crtc_state, n_entries); +} + +int intel_ddi_hdmi_num_entries (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *default_entry) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +enum phy phy =intel_port_to_phy (dev_priv, encoder->port); +int n_entries; + +if (INTEL_GEN (dev_priv) >=12 ) { +if (intel_phy_is_combo (dev_priv, phy)) +tgl_get_combo_buf_trans_hdmi (encoder, crtc_state, &n_entries); +else +tgl_get_dkl_buf_trans_hdmi (encoder, crtc_state, &n_entries); + *default_entry = n_entries -1 ; + }else if (INTEL_GEN (dev_priv) ==11 ) { +if (intel_phy_is_combo (dev_priv, phy)) +icl_get_combo_buf_trans_hdmi (encoder, crtc_state, &n_entries); +else +icl_get_mg_buf_trans_hdmi (encoder, crtc_state, &n_entries); + *default_entry = n_entries -1 ; + }else if (IS_CANNONLAKE (dev_priv)) { +cnl_get_buf_trans_hdmi (encoder, &n_entries); + *default_entry = n_entries -1 ; + }else if (IS_GEN9_LP (dev_priv)) { +bxt_get_buf_trans_hdmi (encoder, &n_entries); + *default_entry = n_entries -1 ; + }else if (IS_GEN9_BC (dev_priv)) { +intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); + *default_entry =8 ; + }else if (IS_BROADWELL (dev_priv)) { +intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); + *default_entry =7 ; + }else if (IS_HASWELL (dev_priv)) { +intel_ddi_get_buf_trans_hdmi (encoder, &n_entries); + *default_entry =6 ; + }else { +drm_WARN (&dev_priv->drm,1 ,"ddi translation table missing\n" ); +return 0 ; + } + +if (drm_WARN_ON_ONCE (&dev_priv->drm, n_entries ==0 )) +return 0 ; + +return n_entries; +}drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h new file +100
-0@@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef _INTEL_DDI_BUF_TRANS_H_ +#define _INTEL_DDI_BUF_TRANS_H_ + +#include <linux/types.h> + +struct intel_encoder ; +struct intel_crtc_state ; +struct drm_i915_private ; + +struct ddi_buf_trans { +u32 trans1;/* balance leg enable, de-emph level */ +u32 trans2;/* vref sel, vswing */ +u8 i_boost;/* SKL: I_boost; valid: 0x0, 0x1, 0x3, 0x7 */ +}; + +struct bxt_ddi_buf_trans { +u8 margin;/* swing value */ +u8 scale;/* scale value */ +u8 enable;/* scale enable */ +u8 deemphasis; +}; + +struct cnl_ddi_buf_trans { +u8 dw2_swing_sel; +u8 dw7_n_scalar; +u8 dw4_cursor_coeff; +u8 dw4_post_cursor_2; +u8 dw4_post_cursor_1; +}; + +struct icl_mg_phy_ddi_buf_trans { +u32 cri_txdeemph_override_11_6; +u32 cri_txdeemph_override_5_0; +u32 cri_txdeemph_override_17_12; +}; + +struct tgl_dkl_phy_ddi_buf_trans { +u32 dkl_vswing_control; +u32 dkl_preshoot_control; +u32 dkl_de_emphasis_control; +}; + +bool is_hobl_buf_trans (const struct cnl_ddi_buf_trans *table); + +int intel_ddi_hdmi_num_entries (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *default_entry); + +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_edp (struct intel_encoder *encoder,int *n_entries); +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_fdi (struct drm_i915_private *dev_priv, +int *n_entries); +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_hdmi (struct intel_encoder *encoder, +int *n_entries); +const struct ddi_buf_trans * +intel_ddi_get_buf_trans_dp (struct intel_encoder *encoder,int *n_entries); + +const struct bxt_ddi_buf_trans * +bxt_get_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); + +const struct cnl_ddi_buf_trans * +tgl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); +const struct tgl_dkl_phy_ddi_buf_trans * +tgl_get_dkl_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); +const struct cnl_ddi_buf_trans * +jsl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); +const struct cnl_ddi_buf_trans * +ehl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); +const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); +const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); + +const struct cnl_ddi_buf_trans * +cnl_get_buf_trans (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +int *n_entries); + +#endif Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 05/11] drm/i915: migrate hsw fdi code to new file.
In reply to Jani NikulaQuoted 8 lines · Jani Nikula
From: Dave Airlie <[email protected]>
Daniel asked for this, but it's a bit messy and I'm not sure how best to clean it up yet.
Signed-off-by Dave Airlie <[email protected]>[Jani: also moved fdi buf trans to intel_fdi.c.]Signed-off-by Jani Nikula <[email protected]>
I guess this is ok. Although the code is pretty ddi'ish.
Quoted 423 lines
--- drivers/gpu/drm/i915/display/intel_crt.c | 1 + drivers/gpu/drm/i915/display/intel_ddi.c | 151 ++--------------------- drivers/gpu/drm/i915/display/intel_ddi.h | 8 +- drivers/gpu/drm/i915/display/intel_fdi.c | 139 +++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_fdi.h | 3 + 5 files changed, 156 insertions(+), 146 deletions(-)drivers/gpu/drm/i915/display/intel_crt.c +1
-0@@ -38,6 +38,7 @@#include "intel_crt.h" #include "intel_ddi.h" #include "intel_display_types.h" +#include "intel_fdi.h" #include "intel_fifo_underrun.h" #include "intel_gmbus.h" #include "intel_hotplug.h" drivers/gpu/drm/i915/display/intel_ddi.c +7
-144@@ -36,10 +36,11 @@#include "intel_ddi_buf_trans.h" #include "intel_display_types.h" #include "intel_dp.h" -#include "intel_dp_mst.h" #include "intel_dp_link_training.h" +#include "intel_dp_mst.h" #include "intel_dpio_phy.h" #include "intel_dsi.h" +#include "intel_fdi.h" #include "intel_fifo_underrun.h" #include "intel_gmbus.h" #include "intel_hdcp.h" @@ -90,8 +91,8 @@ static int intel_ddi_hdmi_level(struct intel_encoder *encoder,* values in advance. This function programs the correct values for * DP/eDP/FDI use cases. */ -static void intel_prepare_dp_ddi_buffers (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +void intel_prepare_dp_ddi_buffers (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);u32 iboost_bit =0 ;@@ -153,8 +154,8 @@ static void intel_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder, ddi_translations[level].trans2); } -static void intel_wait_ddi_buf_idle (struct drm_i915_private *dev_priv, -enum port port) +void intel_wait_ddi_buf_idle (struct drm_i915_private *dev_priv, +enum port port) {if (IS_BROXTON (dev_priv)) {udelay (16 );@@ -182,7 +183,7 @@ static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv, port_name(port)); } -static u32 hsw_pll_to_ddi_pll_sel (const struct intel_shared_dpll *pll) +u32 hsw_pll_to_ddi_pll_sel (const struct intel_shared_dpll *pll) {switch (pll->info->id) {case DPLL_ID_WRPLL1 :@@ -242,144 +243,6 @@ static u32 icl_pll_to_ddi_clk_sel(struct intel_encoder *encoder, } } -/* Starting with Haswell, different DDI ports can work in FDI mode for -* connection to the PCH-located connectors. For this, it is necessary to train -* both the DDI port and PCH receiver for the desired DDI buffer settings. -* -* The recommended port to work in FDI mode is DDI E, which we use here. Also, -* please note that when FDI mode is active on DDI E, it shares 2 lines with -* DDI A (which is used for eDP) -*/ - -void hsw_fdi_link_train (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) -{ -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -u32 temp, i, rx_ctl_val, ddi_pll_sel; -int n_entries; - -intel_ddi_get_buf_trans_fdi (dev_priv, &n_entries); - -intel_prepare_dp_ddi_buffers (encoder, crtc_state); - -/* Set the FDI_RX_MISC pwrdn lanes and the 2 workarounds listed at the -* mode set "sequence for CRT port" document: -* - TP1 to TP2 time with the default value -* - FDI delay to 90h -* -* WaFDIAutoLinkSetTimingOverrride:hsw -*/ -intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), -FDI_RX_PWRDN_LANE1_VAL (2 ) |FDI_RX_PWRDN_LANE0_VAL (2 ) |FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); - -/* Enable the PCH Receiver FDI PLL */ - rx_ctl_val = dev_priv->fdi_rx_config |FDI_RX_ENHANCE_FRAME_ENABLE | -FDI_RX_PLL_ENABLE | -FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); -intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); -intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); -udelay (220 ); - -/* Switch from Rawclk to PCDclk */ - rx_ctl_val |=FDI_PCDCLK ; -intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); - -/* Configure Port Clock Select */ - ddi_pll_sel =hsw_pll_to_ddi_pll_sel (crtc_state->shared_dpll); -intel_de_write (dev_priv,PORT_CLK_SEL (PORT_E ), ddi_pll_sel); -drm_WARN_ON (&dev_priv->drm, ddi_pll_sel !=PORT_CLK_SEL_SPLL ); - -/* Start the training iterating through available voltages and emphasis, -* testing each value twice. */ -for (i =0 ; i < n_entries *2 ; i++) { -/* Configure DP_TP_CTL with auto-training */ -intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), -DP_TP_CTL_FDI_AUTOTRAIN | -DP_TP_CTL_ENHANCED_FRAME_ENABLE | -DP_TP_CTL_LINK_TRAIN_PAT1 | -DP_TP_CTL_ENABLE ); - -/* Configure and enable DDI_BUF_CTL for DDI E with next voltage. -* DDI E does not support port reversal, the functionality is -* achieved on the PCH side in FDI_RX_CTL, so no need to set the -* port reversal bit */ -intel_de_write (dev_priv,DDI_BUF_CTL (PORT_E ), -DDI_BUF_CTL_ENABLE | ((crtc_state->fdi_lanes -1 ) <<1 ) |DDI_BUF_TRANS_SELECT (i /2 )); -intel_de_posting_read (dev_priv,DDI_BUF_CTL (PORT_E )); - -udelay (600 ); - -/* Program PCH FDI Receiver TU */ -intel_de_write (dev_priv,FDI_RX_TUSIZE1 (PIPE_A ),TU_SIZE (64 )); - -/* Enable PCH FDI Receiver with auto-training */ - rx_ctl_val |=FDI_RX_ENABLE |FDI_LINK_TRAIN_AUTO ; -intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); -intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); - -/* Wait for FDI receiver lane calibration */ -udelay (30 ); - -/* Unset FDI_RX_MISC pwrdn lanes */ - temp =intel_de_read (dev_priv,FDI_RX_MISC (PIPE_A )); - temp &= ~(FDI_RX_PWRDN_LANE1_MASK |FDI_RX_PWRDN_LANE0_MASK ); -intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), temp); -intel_de_posting_read (dev_priv,FDI_RX_MISC (PIPE_A )); - -/* Wait for FDI auto training time */ -udelay (5 ); - - temp =intel_de_read (dev_priv,DP_TP_STATUS (PORT_E )); -if (temp &DP_TP_STATUS_AUTOTRAIN_DONE ) { -drm_dbg_kms (&dev_priv->drm, -"FDI link training done on step %d\n" , i); -break ; - } - -/* -* Leave things enabled even if we failed to train FDI. -* Results in less fireworks from the state checker. -*/ -if (i == n_entries *2 -1 ) { -drm_err (&dev_priv->drm,"FDI link training failed!\n" ); -break ; - } - - rx_ctl_val &= ~FDI_RX_ENABLE ; -intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); -intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); - - temp =intel_de_read (dev_priv,DDI_BUF_CTL (PORT_E )); - temp &= ~DDI_BUF_CTL_ENABLE ; -intel_de_write (dev_priv,DDI_BUF_CTL (PORT_E ), temp); -intel_de_posting_read (dev_priv,DDI_BUF_CTL (PORT_E )); - -/* Disable DP_TP_CTL and FDI_RX_CTL and retry */ - temp =intel_de_read (dev_priv,DP_TP_CTL (PORT_E )); - temp &= ~(DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_MASK ); - temp |=DP_TP_CTL_LINK_TRAIN_PAT1 ; -intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), temp); -intel_de_posting_read (dev_priv,DP_TP_CTL (PORT_E )); - -intel_wait_ddi_buf_idle (dev_priv,PORT_E ); - -/* Reset FDI_RX_MISC pwrdn lanes */ - temp =intel_de_read (dev_priv,FDI_RX_MISC (PIPE_A )); - temp &= ~(FDI_RX_PWRDN_LANE1_MASK |FDI_RX_PWRDN_LANE0_MASK ); - temp |=FDI_RX_PWRDN_LANE1_VAL (2 ) |FDI_RX_PWRDN_LANE0_VAL (2 ); -intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), temp); -intel_de_posting_read (dev_priv,FDI_RX_MISC (PIPE_A )); - } - -/* Enable normal pixel sending for FDI */ -intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), -DP_TP_CTL_FDI_AUTOTRAIN | -DP_TP_CTL_LINK_TRAIN_NORMAL | -DP_TP_CTL_ENHANCED_FRAME_ENABLE | -DP_TP_CTL_ENABLE ); -} -static void intel_ddi_init_dp_buf_reg (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {drivers/gpu/drm/i915/display/intel_ddi.h +6
-2@@ -17,6 +17,7 @@ struct intel_crtc_state;struct intel_dp ;struct intel_dpll_hw_state ;struct intel_encoder ; +struct intel_shared_dpll ;enum transcoder ; i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder,@@ -27,8 +28,11 @@ void intel_ddi_fdi_post_disable(struct intel_atomic_state *state,struct intel_encoder *intel_encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state); -void hsw_fdi_link_train (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state); +u32 hsw_pll_to_ddi_pll_sel (const struct intel_shared_dpll *pll); +void intel_prepare_dp_ddi_buffers (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state); +void intel_wait_ddi_buf_idle (struct drm_i915_private *dev_priv, +enum port port);void intel_ddi_init (struct drm_i915_private *dev_priv,enum port port);bool intel_ddi_get_hw_state (struct intel_encoder *encoder,enum pipe *pipe); void intel_ddi_enable_transcoder_func(struct intel_encoder *encoder,drivers/gpu/drm/i915/display/intel_fdi.c +139
-0@@ -3,6 +3,8 @@* Copyright © 2020 Intel Corporation */ #include "intel_atomic.h" +#include "intel_ddi.h" +#include "intel_ddi_buf_trans.h" #include "intel_display_types.h" #include "intel_fdi.h" @@ -550,6 +552,143 @@ static void ivb_manual_fdi_link_train(struct intel_crtc *crtc,drm_dbg_kms (&dev_priv->drm,"FDI train done.\n" ); } +/* Starting with Haswell, different DDI ports can work in FDI mode for +* connection to the PCH-located connectors. For this, it is necessary to train +* both the DDI port and PCH receiver for the desired DDI buffer settings. +* +* The recommended port to work in FDI mode is DDI E, which we use here. Also, +* please note that when FDI mode is active on DDI E, it shares 2 lines with +* DDI A (which is used for eDP) +*/ +void hsw_fdi_link_train (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +u32 temp, i, rx_ctl_val, ddi_pll_sel; +int n_entries; + +intel_ddi_get_buf_trans_fdi (dev_priv, &n_entries); + +intel_prepare_dp_ddi_buffers (encoder, crtc_state); + +/* Set the FDI_RX_MISC pwrdn lanes and the 2 workarounds listed at the +* mode set "sequence for CRT port" document: +* - TP1 to TP2 time with the default value +* - FDI delay to 90h +* +* WaFDIAutoLinkSetTimingOverrride:hsw +*/ +intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), +FDI_RX_PWRDN_LANE1_VAL (2 ) |FDI_RX_PWRDN_LANE0_VAL (2 ) |FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); + +/* Enable the PCH Receiver FDI PLL */ + rx_ctl_val = dev_priv->fdi_rx_config |FDI_RX_ENHANCE_FRAME_ENABLE | +FDI_RX_PLL_ENABLE | +FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); +intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); +intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); +udelay (220 ); + +/* Switch from Rawclk to PCDclk */ + rx_ctl_val |=FDI_PCDCLK ; +intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); + +/* Configure Port Clock Select */ + ddi_pll_sel =hsw_pll_to_ddi_pll_sel (crtc_state->shared_dpll); +intel_de_write (dev_priv,PORT_CLK_SEL (PORT_E ), ddi_pll_sel); +drm_WARN_ON (&dev_priv->drm, ddi_pll_sel !=PORT_CLK_SEL_SPLL ); + +/* Start the training iterating through available voltages and emphasis, +* testing each value twice. */ +for (i =0 ; i < n_entries *2 ; i++) { +/* Configure DP_TP_CTL with auto-training */ +intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), +DP_TP_CTL_FDI_AUTOTRAIN | +DP_TP_CTL_ENHANCED_FRAME_ENABLE | +DP_TP_CTL_LINK_TRAIN_PAT1 | +DP_TP_CTL_ENABLE ); + +/* Configure and enable DDI_BUF_CTL for DDI E with next voltage. +* DDI E does not support port reversal, the functionality is +* achieved on the PCH side in FDI_RX_CTL, so no need to set the +* port reversal bit */ +intel_de_write (dev_priv,DDI_BUF_CTL (PORT_E ), +DDI_BUF_CTL_ENABLE | ((crtc_state->fdi_lanes -1 ) <<1 ) |DDI_BUF_TRANS_SELECT (i /2 )); +intel_de_posting_read (dev_priv,DDI_BUF_CTL (PORT_E )); + +udelay (600 ); + +/* Program PCH FDI Receiver TU */ +intel_de_write (dev_priv,FDI_RX_TUSIZE1 (PIPE_A ),TU_SIZE (64 )); + +/* Enable PCH FDI Receiver with auto-training */ + rx_ctl_val |=FDI_RX_ENABLE |FDI_LINK_TRAIN_AUTO ; +intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); +intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); + +/* Wait for FDI receiver lane calibration */ +udelay (30 ); + +/* Unset FDI_RX_MISC pwrdn lanes */ + temp =intel_de_read (dev_priv,FDI_RX_MISC (PIPE_A )); + temp &= ~(FDI_RX_PWRDN_LANE1_MASK |FDI_RX_PWRDN_LANE0_MASK ); +intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), temp); +intel_de_posting_read (dev_priv,FDI_RX_MISC (PIPE_A )); + +/* Wait for FDI auto training time */ +udelay (5 ); + + temp =intel_de_read (dev_priv,DP_TP_STATUS (PORT_E )); +if (temp &DP_TP_STATUS_AUTOTRAIN_DONE ) { +drm_dbg_kms (&dev_priv->drm, +"FDI link training done on step %d\n" , i); +break ; + } + +/* +* Leave things enabled even if we failed to train FDI. +* Results in less fireworks from the state checker. +*/ +if (i == n_entries *2 -1 ) { +drm_err (&dev_priv->drm,"FDI link training failed!\n" ); +break ; + } + + rx_ctl_val &= ~FDI_RX_ENABLE ; +intel_de_write (dev_priv,FDI_RX_CTL (PIPE_A ), rx_ctl_val); +intel_de_posting_read (dev_priv,FDI_RX_CTL (PIPE_A )); + + temp =intel_de_read (dev_priv,DDI_BUF_CTL (PORT_E )); + temp &= ~DDI_BUF_CTL_ENABLE ; +intel_de_write (dev_priv,DDI_BUF_CTL (PORT_E ), temp); +intel_de_posting_read (dev_priv,DDI_BUF_CTL (PORT_E )); + +/* Disable DP_TP_CTL and FDI_RX_CTL and retry */ + temp =intel_de_read (dev_priv,DP_TP_CTL (PORT_E )); + temp &= ~(DP_TP_CTL_ENABLE |DP_TP_CTL_LINK_TRAIN_MASK ); + temp |=DP_TP_CTL_LINK_TRAIN_PAT1 ; +intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), temp); +intel_de_posting_read (dev_priv,DP_TP_CTL (PORT_E )); + +intel_wait_ddi_buf_idle (dev_priv,PORT_E ); + +/* Reset FDI_RX_MISC pwrdn lanes */ + temp =intel_de_read (dev_priv,FDI_RX_MISC (PIPE_A )); + temp &= ~(FDI_RX_PWRDN_LANE1_MASK |FDI_RX_PWRDN_LANE0_MASK ); + temp |=FDI_RX_PWRDN_LANE1_VAL (2 ) |FDI_RX_PWRDN_LANE0_VAL (2 ); +intel_de_write (dev_priv,FDI_RX_MISC (PIPE_A ), temp); +intel_de_posting_read (dev_priv,FDI_RX_MISC (PIPE_A )); + } + +/* Enable normal pixel sending for FDI */ +intel_de_write (dev_priv,DP_TP_CTL (PORT_E ), +DP_TP_CTL_FDI_AUTOTRAIN | +DP_TP_CTL_LINK_TRAIN_NORMAL | +DP_TP_CTL_ENHANCED_FRAME_ENABLE | +DP_TP_CTL_ENABLE ); +} +void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state) {struct intel_crtc *intel_crtc =to_intel_crtc (crtc_state->uapi.crtc);drivers/gpu/drm/i915/display/intel_fdi.h +3
-0@@ -9,6 +9,7 @@struct drm_i915_private ;struct intel_crtc ;struct intel_crtc_state ; +struct intel_encoder ;#define I915_DISPLAY_CONFIG_RETRY 1 int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,@@ -18,5 +19,7 @@ void ilk_fdi_disable(struct intel_crtc *crtc);void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc);void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state);void intel_fdi_init_hook (struct drm_i915_private *dev_priv); +void hsw_fdi_link_train (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state);#endif Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 06/11] drm/i915: migrate skl planes code new file (v3)
In reply to Jani NikulaQuoted 18 lines · Jani Nikula
From: Dave Airlie <[email protected]>
Rework the plane init calls to do the gen test one level higher.
Rework some of the plane helpers so they can live in new file, there is still some scope to clean up the plane/fb interactions later.
v2: drop atomic code back, rename file to Ville suggestions, add header file.
v3: move scaler bits backSigned-off-by Dave Airlie <[email protected]>[Jani: fixed up sparse warnings.]Signed-off-by Jani Nikula <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>---
<snip>
drivers/gpu/drm/i915/display/intel_display.c intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, · line 2903
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-10-unsigned int -intel_plane_fence_y_offset (const struct intel_plane_state *plane_state) -{ -int x =0 , y =0 ; - -intel_plane_adjust_aligned_offset (&x, &y, plane_state,0 , - plane_state->color_plane[0 ].offset,0 ); - -return y; -}
This getting moved around is messing up the diff.
<snip>
drivers/gpu/drm/i915/display/intel_display.c static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, · line 4396
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-8@@ -4386,15 +3633,6 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,return 0 ; } -void skl_scaler_disable (const struct intel_crtc_state *old_crtc_state) -{ -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc); -int i; - -for (i =0 ; i < crtc->num_scalers; i++) -skl_detach_scaler (crtc, i); -}
Same here.
<snip>
drivers/gpu/drm/i915/display/intel_dp_mst.c line 42
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +1
-0@@ -39,6 +39,7 @@#include "intel_dp_mst.h" #include "intel_dpio_phy.h" #include "intel_hdcp.h" +#include "skl_universal_plane.h"
Why is this here?
drivers/gpu/drm/i915/display/intel_psr.c line 34
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +0
-0static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state,drivers/gpu/drm/i915/display/intel_psr.c +1
-0@@ -31,6 +31,7 @@#include "intel_psr.h" #include "intel_sprite.h" #include "intel_hdmi.h" +#include "skl_universal_plane.h"
Is this due to the psr damage stuff?
<snip>
drivers/gpu/drm/i915/display/vlv_dsi.c line 41
Quoted 9 lines
drivers/gpu/drm/i915/display/vlv_dsi.c +1
-0@@ -38,6 +38,7 @@#include "intel_fifo_underrun.h" #include "intel_panel.h" #include "intel_sideband.h" +#include "skl_universal_plane.h"
Why do we need this here?
Quoted 22 lines
drivers/gpu/drm/i915/display/vlv_dsi.c +0
-0/* return pixels in terms of txbyteclkhs */ static u16 txbyteclkhs(u16 pixels, int bpp, int lane_count,drivers/gpu/drm/i915/intel_pm.c +1
-0@@ -38,6 +38,7 @@#include "display/intel_display_types.h" #include "display/intel_fbc.h" #include "display/intel_sprite.h" +#include "display/skl_universal_plane.h" #include "gt/intel_llc.h" Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 09/11] drm/i915: move is_ccs_modifier to an inline
In reply to Jani NikulaQuoted 6 lines · Jani Nikula
From: Dave Airlie <[email protected]>
There is no need for this to be out of line.
Signed-off-by Dave Airlie <[email protected]>Signed-off-by Jani Nikula <[email protected]>
Quoted 63 lines
--- drivers/gpu/drm/i915/display/intel_display.c | 8 -------- drivers/gpu/drm/i915/display/intel_display.h | 1 - drivers/gpu/drm/i915/display/intel_display_types.h | 8 ++++++++ 3 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-8@@ -1791,14 +1791,6 @@ intel_get_format_info(const struct drm_mode_fb_cmd2 *cmd) } } -bool is_ccs_modifier (u64 modifier) -{ -return modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_CCS || - modifier == I915_FORMAT_MOD_Yf_TILED_CCS; -} -static int gen12_ccs_aux_stride (struct drm_framebuffer *fb,int ccs_plane) { return DIV_ROUND_UP(fb->pitches[skl_ccs_to_main_plane(fb, ccs_plane)],drivers/gpu/drm/i915/display/intel_display.h +0
-1@@ -508,7 +508,6 @@ void intel_link_compute_m_n(u16 bpp, int nlanes, int pixel_clock, int link_clock, struct intel_link_m_n *m_n, bool constant_n, bool fec_enable); -bool is_ccs_modifier (u64 modifier);void lpt_disable_clkout_dp (struct drm_i915_private *dev_priv);u32 intel_plane_fb_max_stride (struct drm_i915_private *dev_priv,u32 pixel_format,u64 modifier);drivers/gpu/drm/i915/display/intel_display_types.h +8
-0@@ -1862,6 +1862,14 @@ static inline u32 intel_fdi_link_freq(struct drm_i915_private *dev_priv,return dev_priv->fdi_pll_freq; } +static inline bool is_ccs_modifier (u64 modifier) +{ +return modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_CCS || + modifier == I915_FORMAT_MOD_Yf_TILED_CCS; +} +static inline bool is_ccs_plane (const struct drm_framebuffer *fb,int plane) {if (!is_ccs_modifier (fb->modifier))Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 10/11] drm/i915: migrate pll enable/disable code to intel_dpll.[ch]
In reply to Jani NikulaQuoted 7 lines · Jani Nikula
From: Dave Airlie <[email protected]>
This moves the older i9xx/vlv/chv enable/disable to dpll file.
!!! FIXME: Dave's s-o-b !!!
Signed-off-by Jani Nikula <[email protected]>
Quoted 1,161 lines
--- drivers/gpu/drm/i915/display/intel_display.c | 512 ------------------- drivers/gpu/drm/i915/display/intel_display.h | 3 - drivers/gpu/drm/i915/display/intel_dp.c | 1 + drivers/gpu/drm/i915/display/intel_dpll.c | 509 ++++++++++++++++++ drivers/gpu/drm/i915/display/intel_dpll.h | 18 + drivers/gpu/drm/i915/display/intel_pps.c | 1 + 6 files changed, 529 insertions(+), 515 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-512@@ -109,10 +109,6 @@ static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state);static void ilk_set_pipeconf (const struct intel_crtc_state *crtc_state);static void hsw_set_pipeconf (const struct intel_crtc_state *crtc_state);static void bdw_set_pipemisc (const struct intel_crtc_state *crtc_state); -static void vlv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config); -static void chv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config);static void ilk_pfit_enable (const struct intel_crtc_state *crtc_state);static void intel_modeset_setup_hw_state (struct drm_device *dev,struct drm_modeset_acquire_ctx *ctx);@@ -565,224 +561,6 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,assert_pch_hdmi_disabled (dev_priv, pipe,PORT_D ,PCH_HDMID ); } -static void _vlv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); -intel_de_posting_read (dev_priv,DPLL (pipe)); -udelay (150 ); - -if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) -drm_err (&dev_priv->drm,"DPLL %d failed to lock\n" , pipe); -} - -static void vlv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -assert_panel_unlocked (dev_priv, pipe); - -if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) -_vlv_enable_pll (crtc, pipe_config); - -intel_de_write (dev_priv,DPLL_MD (pipe), - pipe_config->dpll_hw_state.dpll_md); -intel_de_posting_read (dev_priv,DPLL_MD (pipe)); -} - - -static void _chv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 tmp; - -vlv_dpio_get (dev_priv); - -/* Enable back the 10bit clock to display controller */ - tmp =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); - tmp |=DPIO_DCLKP_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), tmp); - -vlv_dpio_put (dev_priv); - -/* -* Need to wait > 100ns between dclkp clock enable bit and PLL enable. -*/ -udelay (1 ); - -/* Enable PLL */ -intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); - -/* Check PLL is locked */ -if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) -drm_err (&dev_priv->drm,"PLL %d failed to lock\n" , pipe); -} - -static void chv_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -assert_panel_unlocked (dev_priv, pipe); - -if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) -_chv_enable_pll (crtc, pipe_config); - -if (pipe !=PIPE_A ) { -/* -* WaPixelRepeatModeFixForC0:chv -* -* DPLLCMD is AWOL. Use chicken bits to propagate -* the value from DPLLBMD to either pipe B or C. -*/ -intel_de_write (dev_priv,CBR4_VLV ,CBR_DPLLBMD_PIPE (pipe)); -intel_de_write (dev_priv,DPLL_MD (PIPE_B ), - pipe_config->dpll_hw_state.dpll_md); -intel_de_write (dev_priv,CBR4_VLV ,0 ); - dev_priv->chv_dpll_md[pipe] = pipe_config->dpll_hw_state.dpll_md; - -/* -* DPLLB VGA mode also seems to cause problems. -* We should always have it disabled. -*/ -drm_WARN_ON (&dev_priv->drm, - (intel_de_read (dev_priv,DPLL (PIPE_B )) & -DPLL_VGA_MODE_DIS ) ==0 ); - }else { -intel_de_write (dev_priv,DPLL_MD (pipe), - pipe_config->dpll_hw_state.dpll_md); -intel_de_posting_read (dev_priv,DPLL_MD (pipe)); - } -} - -static bool i9xx_has_pps (struct drm_i915_private *dev_priv) -{ -if (IS_I830 (dev_priv)) -return false; - -return IS_PINEVIEW (dev_priv) ||IS_MOBILE (dev_priv); -} - -static void i9xx_enable_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -i915_reg_t reg =DPLL (crtc->pipe); -u32 dpll = crtc_state->dpll_hw_state.dpll; -int i; - -assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); - -/* PLL is protected by panel, make sure we can write it */ -if (i9xx_has_pps (dev_priv)) -assert_panel_unlocked (dev_priv, crtc->pipe); - -/* -* Apparently we need to have VGA mode enabled prior to changing -* the P1/P2 dividers. Otherwise the DPLL will keep using the old -* dividers, even though the register value does change. -*/ -intel_de_write (dev_priv, reg, dpll & ~DPLL_VGA_MODE_DIS ); -intel_de_write (dev_priv, reg, dpll); - -/* Wait for the clocks to stabilize. */ -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -if (INTEL_GEN (dev_priv) >=4 ) { -intel_de_write (dev_priv,DPLL_MD (crtc->pipe), - crtc_state->dpll_hw_state.dpll_md); - }else { -/* The pixel multiplier can only be updated once the -* DPLL is enabled and the clocks are stable. -* -* So write it again. -*/ -intel_de_write (dev_priv, reg, dpll); - } - -/* We do this three times for luck */ -for (i =0 ; i <3 ; i++) { -intel_de_write (dev_priv, reg, dpll); -intel_de_posting_read (dev_priv, reg); -udelay (150 );/* wait for warmup */ - } -} - -static void i9xx_disable_pll (const struct intel_crtc_state *crtc_state) -{ -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; - -/* Don't disable pipe or pipe PLLs if needed */ -if (IS_I830 (dev_priv)) -return ; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); - -intel_de_write (dev_priv,DPLL (pipe),DPLL_VGA_MODE_DIS ); -intel_de_posting_read (dev_priv,DPLL (pipe)); -} - -static void vlv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -u32 val; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, (enum transcoder )pipe); - - val =DPLL_INTEGRATED_REF_CLK_VLV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; -if (pipe !=PIPE_A ) - val |=DPLL_INTEGRATED_CRI_CLK_VLV ; - -intel_de_write (dev_priv,DPLL (pipe), val); -intel_de_posting_read (dev_priv,DPLL (pipe)); -} - -static void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 val; - -/* Make sure the pipe isn't still relying on us */ -assert_pipe_disabled (dev_priv, (enum transcoder )pipe); - - val =DPLL_SSC_REF_CLK_CHV | -DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; -if (pipe !=PIPE_A ) - val |=DPLL_INTEGRATED_CRI_CLK_VLV ; - -intel_de_write (dev_priv,DPLL (pipe), val); -intel_de_posting_read (dev_priv,DPLL (pipe)); - -vlv_dpio_get (dev_priv); - -/* Disable 10bit clock to display controller */ - val =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); - val &= ~DPIO_DCLKP_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), val); - -vlv_dpio_put (dev_priv); -} -void vlv_wait_port_ready (struct drm_i915_private *dev_priv,struct intel_digital_port *dig_port,unsigned int expected_mask)@@ -5709,35 +5487,6 @@ static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv) } } -static void vlv_pllb_recal_opamp (struct drm_i915_private *dev_priv,enum pipe - pipe) -{ -u32 reg_val; - -/* -* PLLB opamp always calibrates to max value of 0x3f, force enable it -* and set it to a reasonable value instead. -*/ - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); - reg_val &=0xffffff00 ; - reg_val |=0x00000030 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); - reg_val &=0x00ffffff ; - reg_val |=0x8c000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); - reg_val &=0xffffff00 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); - - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); - reg_val &=0x00ffffff ; - reg_val |=0xb0000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); -} -static void intel_pch_transcoder_set_m_n (const struct intel_crtc_state *crtc_state,const struct intel_link_m_n *m_n) {@@ -5833,267 +5582,6 @@ void intel_dp_set_m_n(const struct intel_crtc_state *crtc_state, enum link_m_n_sintel_cpu_transcoder_set_m_n (crtc_state, dp_m_n, dp_m2_n2); } -static void vlv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -u32 mdiv; -u32 bestn, bestm1, bestm2, bestp1, bestp2; -u32 coreclk, reg_val; - -/* Enable Refclk */ -intel_de_write (dev_priv,DPLL (pipe), - pipe_config->dpll_hw_state.dpll & ~(DPLL_VCO_ENABLE |DPLL_EXT_BUFFER_ENABLE_VLV )); - -/* No need to actually set up the DPLL with DSI */ -if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) -return ; - -vlv_dpio_get (dev_priv); - - bestn = pipe_config->dpll.n; - bestm1 = pipe_config->dpll.m1; - bestm2 = pipe_config->dpll.m2; - bestp1 = pipe_config->dpll.p1; - bestp2 = pipe_config->dpll.p2; - -/* See eDP HDMI DPIO driver vbios notes doc */ - -/* PLL B needs special handling */ -if (pipe ==PIPE_B ) -vlv_pllb_recal_opamp (dev_priv, pipe); - -/* Set up Tx target for periodic Rcomp update */ -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9_BCAST ,0x0100000f ); - -/* Disable target IRef on PLL */ - reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW8 (pipe)); - reg_val &=0x00ffffff ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW8 (pipe), reg_val); - -/* Disable fast lock */ -vlv_dpio_write (dev_priv, pipe,VLV_CMN_DW0 ,0x610 ); - -/* Set idtafcrecal before PLL is enabled */ - mdiv = ((bestm1 <<DPIO_M1DIV_SHIFT ) | (bestm2 &DPIO_M2DIV_MASK )); - mdiv |= ((bestp1 <<DPIO_P1_SHIFT ) | (bestp2 <<DPIO_P2_SHIFT )); - mdiv |= ((bestn <<DPIO_N_SHIFT )); - mdiv |= (1 <<DPIO_K_SHIFT ); - -/* -* Post divider depends on pixel clock rate, DAC vs digital (and LVDS, -* but we don't support that). -* Note: don't use the DAC post divider as it seems unstable. -*/ - mdiv |= (DPIO_POST_DIV_HDMIDP <<DPIO_POST_DIV_SHIFT ); -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); - - mdiv |=DPIO_ENABLE_CALIBRATION ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); - -/* Set HBR and RBR LPF coefficients */ -if (pipe_config->port_clock ==162000 || -intel_crtc_has_type (pipe_config,INTEL_OUTPUT_ANALOG ) || -intel_crtc_has_type (pipe_config,INTEL_OUTPUT_HDMI )) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), -0x009f0003 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), -0x00d0000f ); - -if (intel_crtc_has_dp_encoder (pipe_config)) { -/* Use SSC source */ -if (pipe ==PIPE_A ) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df40000 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df70000 ); - }else {/* HDMI or VGA */ -/* Use bend source */ -if (pipe ==PIPE_A ) -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df70000 ); -else -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), -0x0df40000 ); - } - - coreclk =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW7 (pipe)); - coreclk = (coreclk &0x0000ff00 ) |0x01c00000 ; -if (intel_crtc_has_dp_encoder (pipe_config)) - coreclk |=0x01000000 ; -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW7 (pipe), coreclk); - -vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW11 (pipe),0x87871000 ); - -vlv_dpio_put (dev_priv); -} - -static void chv_prepare_pll (struct intel_crtc *crtc, -const struct intel_crtc_state *pipe_config) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -enum dpio_channel port =vlv_pipe_to_channel (pipe); -u32 loopfilter, tribuf_calcntr; -u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; -u32 dpio_val; -int vco; - -/* Enable Refclk and SSC */ -intel_de_write (dev_priv,DPLL (pipe), - pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE ); - -/* No need to actually set up the DPLL with DSI */ -if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) -return ; - - bestn = pipe_config->dpll.n; - bestm2_frac = pipe_config->dpll.m2 &0x3fffff ; - bestm1 = pipe_config->dpll.m1; - bestm2 = pipe_config->dpll.m2 >>22 ; - bestp1 = pipe_config->dpll.p1; - bestp2 = pipe_config->dpll.p2; - vco = pipe_config->dpll.vco; - dpio_val =0 ; - loopfilter =0 ; - -vlv_dpio_get (dev_priv); - -/* p1 and p2 divider */ -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW13 (port), -5 <<DPIO_CHV_S1_DIV_SHIFT | - bestp1 <<DPIO_CHV_P1_DIV_SHIFT | - bestp2 <<DPIO_CHV_P2_DIV_SHIFT | -1 <<DPIO_CHV_K_DIV_SHIFT ); - -/* Feedback post-divider - m2 */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW0 (port), bestm2); - -/* Feedback refclk divider - n and m1 */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW1 (port), -DPIO_CHV_M1_DIV_BY_2 | -1 <<DPIO_CHV_N_DIV_SHIFT ); - -/* M2 fraction division */ -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW2 (port), bestm2_frac); - -/* M2 fraction division enable */ - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port)); - dpio_val &= ~(DPIO_CHV_FEEDFWD_GAIN_MASK |DPIO_CHV_FRAC_DIV_EN ); - dpio_val |= (2 <<DPIO_CHV_FEEDFWD_GAIN_SHIFT ); -if (bestm2_frac) - dpio_val |=DPIO_CHV_FRAC_DIV_EN ; -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW3 (port), dpio_val); - -/* Program digital lock detect threshold */ - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW9 (port)); - dpio_val &= ~(DPIO_CHV_INT_LOCK_THRESHOLD_MASK | -DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ); - dpio_val |= (0x5 <<DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT ); -if (!bestm2_frac) - dpio_val |=DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ; -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW9 (port), dpio_val); - -/* Loop filter */ -if (vco ==5400000 ) { - loopfilter |= (0x3 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x8 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x1 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x9 ; - }else if (vco <=6200000 ) { - loopfilter |= (0x5 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0xB <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x9 ; - }else if (vco <=6480000 ) { - loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0x8 ; - }else { -/* Not supported. Apply the same limits as in the max case */ - loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); - loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); - loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); - tribuf_calcntr =0 ; - } -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW6 (port), loopfilter); - - dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW8 (port)); - dpio_val &= ~DPIO_CHV_TDC_TARGET_CNT_MASK ; - dpio_val |= (tribuf_calcntr <<DPIO_CHV_TDC_TARGET_CNT_SHIFT ); -vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW8 (port), dpio_val); - -/* AFC Recal */ -vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), -vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)) | -DPIO_AFC_RECAL ); - -vlv_dpio_put (dev_priv); -} - -/** -* vlv_force_pll_on - forcibly enable just the PLL -* @dev_priv: i915 private structure -* @pipe: pipe PLL to enable -* @dpll: PLL configuration -* -* Enable the PLL for @pipe using the supplied @dpll config. To be used -* in cases where we need the PLL enabled even when @pipe is not going to -* be enabled. -*/ -int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, -const struct dpll *dpll) -{ -struct intel_crtc *crtc =intel_get_crtc_for_pipe (dev_priv, pipe); -struct intel_crtc_state *pipe_config; - - pipe_config =intel_crtc_state_alloc (crtc); -if (!pipe_config) -return -ENOMEM ; - - pipe_config->cpu_transcoder = (enum transcoder )pipe; - pipe_config->pixel_multiplier =1 ; - pipe_config->dpll = *dpll; - -if (IS_CHERRYVIEW (dev_priv)) { -chv_compute_dpll (crtc, pipe_config); -chv_prepare_pll (crtc, pipe_config); -chv_enable_pll (crtc, pipe_config); - }else { -vlv_compute_dpll (crtc, pipe_config); -vlv_prepare_pll (crtc, pipe_config); -vlv_enable_pll (crtc, pipe_config); - } - -kfree (pipe_config); - -return 0 ; -} - -/** -* vlv_force_pll_off - forcibly disable just the PLL -* @dev_priv: i915 private structure -* @pipe: pipe PLL to disable -* -* Disable the PLL for @pipe. To be used in cases where we need -* the PLL enabled even when @pipe is not going to be enabled. -*/ -void vlv_force_pll_off (struct drm_i915_private *dev_priv,enum pipe pipe) -{ -if (IS_CHERRYVIEW (dev_priv)) -chv_disable_pll (dev_priv, pipe); -else -vlv_disable_pll (dev_priv, pipe); -} - - -static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);drivers/gpu/drm/i915/display/intel_display.h +0
-3@@ -586,9 +586,6 @@ void intel_cleanup_plane_fb(struct drm_plane *plane,void assert_pch_transcoder_disabled (struct drm_i915_private *dev_priv,enum pipe pipe); -int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, -const struct dpll *dpll); -void vlv_force_pll_off (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);drivers/gpu/drm/i915/display/intel_dp.c +1
-0@@ -50,6 +50,7 @@#include "intel_dp.h" #include "intel_dp_link_training.h" #include "intel_dp_mst.h" +#include "intel_dpll.h" #include "intel_dpio_phy.h" #include "intel_fifo_underrun.h" #include "intel_hdcp.h" drivers/gpu/drm/i915/display/intel_dpll.c +509
-0@@ -3,11 +3,13 @@* Copyright © 2020 Intel Corporation */ #include <linux/kernel.h> +#include "intel_crtc.h" #include "intel_display_types.h" #include "intel_display.h" #include "intel_dpll.h" #include "intel_lvds.h" #include "intel_panel.h" +#include "intel_sideband.h" struct intel_limit { struct {@@ -1361,3 +1363,510 @@ intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv)else dev_priv->display.crtc_compute_clock = i8xx_crtc_compute_clock; } + +static bool i9xx_has_pps (struct drm_i915_private *dev_priv) +{ +if (IS_I830 (dev_priv)) +return false; + +return IS_PINEVIEW (dev_priv) ||IS_MOBILE (dev_priv); +} + +void i9xx_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +i915_reg_t reg =DPLL (crtc->pipe); +u32 dpll = crtc_state->dpll_hw_state.dpll; +int i; + +assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); + +/* PLL is protected by panel, make sure we can write it */ +if (i9xx_has_pps (dev_priv)) +assert_panel_unlocked (dev_priv, crtc->pipe); + +/* +* Apparently we need to have VGA mode enabled prior to changing +* the P1/P2 dividers. Otherwise the DPLL will keep using the old +* dividers, even though the register value does change. +*/ +intel_de_write (dev_priv, reg, dpll & ~DPLL_VGA_MODE_DIS ); +intel_de_write (dev_priv, reg, dpll); + +/* Wait for the clocks to stabilize. */ +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +if (INTEL_GEN (dev_priv) >=4 ) { +intel_de_write (dev_priv,DPLL_MD (crtc->pipe), + crtc_state->dpll_hw_state.dpll_md); + }else { +/* The pixel multiplier can only be updated once the +* DPLL is enabled and the clocks are stable. +* +* So write it again. +*/ +intel_de_write (dev_priv, reg, dpll); + } + +/* We do this three times for luck */ +for (i =0 ; i <3 ; i++) { +intel_de_write (dev_priv, reg, dpll); +intel_de_posting_read (dev_priv, reg); +udelay (150 );/* wait for warmup */ + } +} + +static void vlv_pllb_recal_opamp (struct drm_i915_private *dev_priv, +enum pipe pipe) +{ +u32 reg_val; + +/* +* PLLB opamp always calibrates to max value of 0x3f, force enable it +* and set it to a reasonable value instead. +*/ + reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); + reg_val &=0xffffff00 ; + reg_val |=0x00000030 ; +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); + + reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); + reg_val &=0x00ffffff ; + reg_val |=0x8c000000 ; +vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); + + reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW9 (1 )); + reg_val &=0xffffff00 ; +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9 (1 ), reg_val); + + reg_val =vlv_dpio_read (dev_priv, pipe,VLV_REF_DW13 ); + reg_val &=0x00ffffff ; + reg_val |=0xb0000000 ; +vlv_dpio_write (dev_priv, pipe,VLV_REF_DW13 , reg_val); +} + +static void _vlv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); +intel_de_posting_read (dev_priv,DPLL (pipe)); +udelay (150 ); + +if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) +drm_err (&dev_priv->drm,"DPLL %d failed to lock\n" , pipe); +} + +void vlv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); + +/* PLL is protected by panel, make sure we can write it */ +assert_panel_unlocked (dev_priv, pipe); + +if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) +_vlv_enable_pll (crtc, pipe_config); + +intel_de_write (dev_priv,DPLL_MD (pipe), + pipe_config->dpll_hw_state.dpll_md); +intel_de_posting_read (dev_priv,DPLL_MD (pipe)); +} + + +static void _chv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; +enum dpio_channel port =vlv_pipe_to_channel (pipe); +u32 tmp; + +vlv_dpio_get (dev_priv); + +/* Enable back the 10bit clock to display controller */ + tmp =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); + tmp |=DPIO_DCLKP_EN ; +vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), tmp); + +vlv_dpio_put (dev_priv); + +/* +* Need to wait > 100ns between dclkp clock enable bit and PLL enable. +*/ +udelay (1 ); + +/* Enable PLL */ +intel_de_write (dev_priv,DPLL (pipe), pipe_config->dpll_hw_state.dpll); + +/* Check PLL is locked */ +if (intel_de_wait_for_set (dev_priv,DPLL (pipe),DPLL_LOCK_VLV ,1 )) +drm_err (&dev_priv->drm,"PLL %d failed to lock\n" , pipe); +} + +void chv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +assert_pipe_disabled (dev_priv, pipe_config->cpu_transcoder); + +/* PLL is protected by panel, make sure we can write it */ +assert_panel_unlocked (dev_priv, pipe); + +if (pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) +_chv_enable_pll (crtc, pipe_config); + +if (pipe !=PIPE_A ) { +/* +* WaPixelRepeatModeFixForC0:chv +* +* DPLLCMD is AWOL. Use chicken bits to propagate +* the value from DPLLBMD to either pipe B or C. +*/ +intel_de_write (dev_priv,CBR4_VLV ,CBR_DPLLBMD_PIPE (pipe)); +intel_de_write (dev_priv,DPLL_MD (PIPE_B ), + pipe_config->dpll_hw_state.dpll_md); +intel_de_write (dev_priv,CBR4_VLV ,0 ); + dev_priv->chv_dpll_md[pipe] = pipe_config->dpll_hw_state.dpll_md; + +/* +* DPLLB VGA mode also seems to cause problems. +* We should always have it disabled. +*/ +drm_WARN_ON (&dev_priv->drm, + (intel_de_read (dev_priv,DPLL (PIPE_B )) & +DPLL_VGA_MODE_DIS ) ==0 ); + }else { +intel_de_write (dev_priv,DPLL_MD (pipe), + pipe_config->dpll_hw_state.dpll_md); +intel_de_posting_read (dev_priv,DPLL_MD (pipe)); + } +} + +void vlv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +u32 mdiv; +u32 bestn, bestm1, bestm2, bestp1, bestp2; +u32 coreclk, reg_val; + +/* Enable Refclk */ +intel_de_write (dev_priv,DPLL (pipe), + pipe_config->dpll_hw_state.dpll & ~(DPLL_VCO_ENABLE |DPLL_EXT_BUFFER_ENABLE_VLV )); + +/* No need to actually set up the DPLL with DSI */ +if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) +return ; + +vlv_dpio_get (dev_priv); + + bestn = pipe_config->dpll.n; + bestm1 = pipe_config->dpll.m1; + bestm2 = pipe_config->dpll.m2; + bestp1 = pipe_config->dpll.p1; + bestp2 = pipe_config->dpll.p2; + +/* See eDP HDMI DPIO driver vbios notes doc */ + +/* PLL B needs special handling */ +if (pipe ==PIPE_B ) +vlv_pllb_recal_opamp (dev_priv, pipe); + +/* Set up Tx target for periodic Rcomp update */ +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW9_BCAST ,0x0100000f ); + +/* Disable target IRef on PLL */ + reg_val =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW8 (pipe)); + reg_val &=0x00ffffff ; +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW8 (pipe), reg_val); + +/* Disable fast lock */ +vlv_dpio_write (dev_priv, pipe,VLV_CMN_DW0 ,0x610 ); + +/* Set idtafcrecal before PLL is enabled */ + mdiv = ((bestm1 <<DPIO_M1DIV_SHIFT ) | (bestm2 &DPIO_M2DIV_MASK )); + mdiv |= ((bestp1 <<DPIO_P1_SHIFT ) | (bestp2 <<DPIO_P2_SHIFT )); + mdiv |= ((bestn <<DPIO_N_SHIFT )); + mdiv |= (1 <<DPIO_K_SHIFT ); + +/* +* Post divider depends on pixel clock rate, DAC vs digital (and LVDS, +* but we don't support that). +* Note: don't use the DAC post divider as it seems unstable. +*/ + mdiv |= (DPIO_POST_DIV_HDMIDP <<DPIO_POST_DIV_SHIFT ); +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); + + mdiv |=DPIO_ENABLE_CALIBRATION ; +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW3 (pipe), mdiv); + +/* Set HBR and RBR LPF coefficients */ +if (pipe_config->port_clock ==162000 || +intel_crtc_has_type (pipe_config,INTEL_OUTPUT_ANALOG ) || +intel_crtc_has_type (pipe_config,INTEL_OUTPUT_HDMI )) +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), +0x009f0003 ); +else +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW10 (pipe), +0x00d0000f ); + +if (intel_crtc_has_dp_encoder (pipe_config)) { +/* Use SSC source */ +if (pipe ==PIPE_A ) +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), +0x0df40000 ); +else +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), +0x0df70000 ); + }else {/* HDMI or VGA */ +/* Use bend source */ +if (pipe ==PIPE_A ) +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), +0x0df70000 ); +else +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW5 (pipe), +0x0df40000 ); + } + + coreclk =vlv_dpio_read (dev_priv, pipe,VLV_PLL_DW7 (pipe)); + coreclk = (coreclk &0x0000ff00 ) |0x01c00000 ; +if (intel_crtc_has_dp_encoder (pipe_config)) + coreclk |=0x01000000 ; +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW7 (pipe), coreclk); + +vlv_dpio_write (dev_priv, pipe,VLV_PLL_DW11 (pipe),0x87871000 ); + +vlv_dpio_put (dev_priv); +} + +void chv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +enum dpio_channel port =vlv_pipe_to_channel (pipe); +u32 loopfilter, tribuf_calcntr; +u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; +u32 dpio_val; +int vco; + +/* Enable Refclk and SSC */ +intel_de_write (dev_priv,DPLL (pipe), + pipe_config->dpll_hw_state.dpll & ~DPLL_VCO_ENABLE ); + +/* No need to actually set up the DPLL with DSI */ +if ((pipe_config->dpll_hw_state.dpll &DPLL_VCO_ENABLE ) ==0 ) +return ; + + bestn = pipe_config->dpll.n; + bestm2_frac = pipe_config->dpll.m2 &0x3fffff ; + bestm1 = pipe_config->dpll.m1; + bestm2 = pipe_config->dpll.m2 >>22 ; + bestp1 = pipe_config->dpll.p1; + bestp2 = pipe_config->dpll.p2; + vco = pipe_config->dpll.vco; + dpio_val =0 ; + loopfilter =0 ; + +vlv_dpio_get (dev_priv); + +/* p1 and p2 divider */ +vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW13 (port), +5 <<DPIO_CHV_S1_DIV_SHIFT | + bestp1 <<DPIO_CHV_P1_DIV_SHIFT | + bestp2 <<DPIO_CHV_P2_DIV_SHIFT | +1 <<DPIO_CHV_K_DIV_SHIFT ); + +/* Feedback post-divider - m2 */ +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW0 (port), bestm2); + +/* Feedback refclk divider - n and m1 */ +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW1 (port), +DPIO_CHV_M1_DIV_BY_2 | +1 <<DPIO_CHV_N_DIV_SHIFT ); + +/* M2 fraction division */ +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW2 (port), bestm2_frac); + +/* M2 fraction division enable */ + dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW3 (port)); + dpio_val &= ~(DPIO_CHV_FEEDFWD_GAIN_MASK |DPIO_CHV_FRAC_DIV_EN ); + dpio_val |= (2 <<DPIO_CHV_FEEDFWD_GAIN_SHIFT ); +if (bestm2_frac) + dpio_val |=DPIO_CHV_FRAC_DIV_EN ; +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW3 (port), dpio_val); + +/* Program digital lock detect threshold */ + dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW9 (port)); + dpio_val &= ~(DPIO_CHV_INT_LOCK_THRESHOLD_MASK | +DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ); + dpio_val |= (0x5 <<DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT ); +if (!bestm2_frac) + dpio_val |=DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE ; +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW9 (port), dpio_val); + +/* Loop filter */ +if (vco ==5400000 ) { + loopfilter |= (0x3 <<DPIO_CHV_PROP_COEFF_SHIFT ); + loopfilter |= (0x8 <<DPIO_CHV_INT_COEFF_SHIFT ); + loopfilter |= (0x1 <<DPIO_CHV_GAIN_CTRL_SHIFT ); + tribuf_calcntr =0x9 ; + }else if (vco <=6200000 ) { + loopfilter |= (0x5 <<DPIO_CHV_PROP_COEFF_SHIFT ); + loopfilter |= (0xB <<DPIO_CHV_INT_COEFF_SHIFT ); + loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); + tribuf_calcntr =0x9 ; + }else if (vco <=6480000 ) { + loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); + loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); + loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); + tribuf_calcntr =0x8 ; + }else { +/* Not supported. Apply the same limits as in the max case */ + loopfilter |= (0x4 <<DPIO_CHV_PROP_COEFF_SHIFT ); + loopfilter |= (0x9 <<DPIO_CHV_INT_COEFF_SHIFT ); + loopfilter |= (0x3 <<DPIO_CHV_GAIN_CTRL_SHIFT ); + tribuf_calcntr =0 ; + } +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW6 (port), loopfilter); + + dpio_val =vlv_dpio_read (dev_priv, pipe,CHV_PLL_DW8 (port)); + dpio_val &= ~DPIO_CHV_TDC_TARGET_CNT_MASK ; + dpio_val |= (tribuf_calcntr <<DPIO_CHV_TDC_TARGET_CNT_SHIFT ); +vlv_dpio_write (dev_priv, pipe,CHV_PLL_DW8 (port), dpio_val); + +/* AFC Recal */ +vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), +vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)) | +DPIO_AFC_RECAL ); + +vlv_dpio_put (dev_priv); +} + +/** +* vlv_force_pll_on - forcibly enable just the PLL +* @dev_priv: i915 private structure +* @pipe: pipe PLL to enable +* @dpll: PLL configuration +* +* Enable the PLL for @pipe using the supplied @dpll config. To be used +* in cases where we need the PLL enabled even when @pipe is not going to +* be enabled. +*/ +int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, +const struct dpll *dpll) +{ +struct intel_crtc *crtc =intel_get_crtc_for_pipe (dev_priv, pipe); +struct intel_crtc_state *pipe_config; + + pipe_config =intel_crtc_state_alloc (crtc); +if (!pipe_config) +return -ENOMEM ; + + pipe_config->cpu_transcoder = (enum transcoder )pipe; + pipe_config->pixel_multiplier =1 ; + pipe_config->dpll = *dpll; + +if (IS_CHERRYVIEW (dev_priv)) { +chv_compute_dpll (crtc, pipe_config); +chv_prepare_pll (crtc, pipe_config); +chv_enable_pll (crtc, pipe_config); + }else { +vlv_compute_dpll (crtc, pipe_config); +vlv_prepare_pll (crtc, pipe_config); +vlv_enable_pll (crtc, pipe_config); + } + +kfree (pipe_config); + +return 0 ; +} + +void vlv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) +{ +u32 val; + +/* Make sure the pipe isn't still relying on us */ +assert_pipe_disabled (dev_priv, (enum transcoder )pipe); + + val =DPLL_INTEGRATED_REF_CLK_VLV | +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; +if (pipe !=PIPE_A ) + val |=DPLL_INTEGRATED_CRI_CLK_VLV ; + +intel_de_write (dev_priv,DPLL (pipe), val); +intel_de_posting_read (dev_priv,DPLL (pipe)); +} + +void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe) +{ +enum dpio_channel port =vlv_pipe_to_channel (pipe); +u32 val; + +/* Make sure the pipe isn't still relying on us */ +assert_pipe_disabled (dev_priv, (enum transcoder )pipe); + + val =DPLL_SSC_REF_CLK_CHV | +DPLL_REF_CLK_ENABLE_VLV |DPLL_VGA_MODE_DIS ; +if (pipe !=PIPE_A ) + val |=DPLL_INTEGRATED_CRI_CLK_VLV ; + +intel_de_write (dev_priv,DPLL (pipe), val); +intel_de_posting_read (dev_priv,DPLL (pipe)); + +vlv_dpio_get (dev_priv); + +/* Disable 10bit clock to display controller */ + val =vlv_dpio_read (dev_priv, pipe,CHV_CMN_DW14 (port)); + val &= ~DPIO_DCLKP_EN ; +vlv_dpio_write (dev_priv, pipe,CHV_CMN_DW14 (port), val); + +vlv_dpio_put (dev_priv); +} + +void i9xx_disable_pll (const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; + +/* Don't disable pipe or pipe PLLs if needed */ +if (IS_I830 (dev_priv)) +return ; + +/* Make sure the pipe isn't still relying on us */ +assert_pipe_disabled (dev_priv, crtc_state->cpu_transcoder); + +intel_de_write (dev_priv,DPLL (pipe),DPLL_VGA_MODE_DIS ); +intel_de_posting_read (dev_priv,DPLL (pipe)); +} + + +/** +* vlv_force_pll_off - forcibly disable just the PLL +* @dev_priv: i915 private structure +* @pipe: pipe PLL to disable +* +* Disable the PLL for @pipe. To be used in cases where we need +* the PLL enabled even when @pipe is not going to be enabled. +*/ +void vlv_force_pll_off (struct drm_i915_private *dev_priv,enum pipe pipe) +{ +if (IS_CHERRYVIEW (dev_priv)) +chv_disable_pll (dev_priv, pipe); +else +vlv_disable_pll (dev_priv, pipe); +}drivers/gpu/drm/i915/display/intel_dpll.h +18
-0@@ -10,6 +10,7 @@ struct dpll;struct drm_i915_private ;struct intel_crtc ;struct intel_crtc_state ; +enum pipe ;void intel_dpll_init_clock_hook (struct drm_i915_private *dev_priv);int vlv_calc_dpll_params (int refclk,struct dpll *clock);@@ -20,4 +21,21 @@ void vlv_compute_dpll(struct intel_crtc *crtc,void chv_compute_dpll (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config); +int vlv_force_pll_on (struct drm_i915_private *dev_priv,enum pipe pipe, +const struct dpll *dpll); +void vlv_force_pll_off (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state); +void vlv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void chv_enable_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void vlv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe); +void chv_disable_pll (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_disable_pll (const struct intel_crtc_state *crtc_state); +void vlv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +void chv_prepare_pll (struct intel_crtc *crtc, +const struct intel_crtc_state *pipe_config); +#endif drivers/gpu/drm/i915/display/intel_pps.c +1
-0@@ -6,6 +6,7 @@#include "i915_drv.h" #include "intel_display_types.h" #include "intel_dp.h" +#include "intel_dpll.h" #include "intel_pps.h" static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv,Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 11/11] drm/i915: migrate i9xx plane get config
In reply to Jani NikulaQuoted 7 lines · Jani Nikula
From: Dave Airlie <[email protected]>
Migrate this code out like the skylake code.
!!! FIXME: Dave's s-o-b !!!
Signed-off-by Jani Nikula <[email protected]>
Quoted 297 lines
--- drivers/gpu/drm/i915/display/i9xx_plane.c | 119 +++++++++++++++++++ drivers/gpu/drm/i915/display/i9xx_plane.h | 4 + drivers/gpu/drm/i915/display/intel_display.c | 119 ------------------- 3 files changed, 123 insertions(+), 119 deletions(-)drivers/gpu/drm/i915/display/i9xx_plane.c +119
-0@@ -698,3 +698,122 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)return ERR_PTR (ret); } +static int i9xx_format_to_fourcc (int format) +{ +switch (format) { +case DISPPLANE_8BPP : +return DRM_FORMAT_C8 ; +case DISPPLANE_BGRA555 : +return DRM_FORMAT_ARGB1555 ; +case DISPPLANE_BGRX555 : +return DRM_FORMAT_XRGB1555 ; +case DISPPLANE_BGRX565 : +return DRM_FORMAT_RGB565 ; +default : +case DISPPLANE_BGRX888 : +return DRM_FORMAT_XRGB8888 ; +case DISPPLANE_RGBX888 : +return DRM_FORMAT_XBGR8888 ; +case DISPPLANE_BGRA888 : +return DRM_FORMAT_ARGB8888 ; +case DISPPLANE_RGBA888 : +return DRM_FORMAT_ABGR8888 ; +case DISPPLANE_BGRX101010 : +return DRM_FORMAT_XRGB2101010 ; +case DISPPLANE_RGBX101010 : +return DRM_FORMAT_XBGR2101010 ; +case DISPPLANE_BGRA101010 : +return DRM_FORMAT_ARGB2101010 ; +case DISPPLANE_RGBA101010 : +return DRM_FORMAT_ABGR2101010 ; +case DISPPLANE_RGBX161616 : +return DRM_FORMAT_XBGR16161616F ; + } +} + +void +i9xx_get_initial_plane_config (struct intel_crtc *crtc, +struct intel_initial_plane_config *plane_config) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_plane *plane =to_intel_plane (crtc->base.primary); +enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; +enum pipe pipe; +u32 val, base, offset; +int fourcc, pixel_format; +unsigned int aligned_height; +struct drm_framebuffer *fb; +struct intel_framebuffer *intel_fb; + +if (!plane->get_hw_state (plane, &pipe)) +return ; + +drm_WARN_ON (dev, pipe != crtc->pipe); + + intel_fb =kzalloc (sizeof (*intel_fb),GFP_KERNEL ); +if (!intel_fb) { +drm_dbg_kms (&dev_priv->drm,"failed to alloc fb\n" ); +return ; + } + + fb = &intel_fb->base; + + fb->dev = dev; + + val =intel_de_read (dev_priv,DSPCNTR (i9xx_plane)); + +if (INTEL_GEN (dev_priv) >=4 ) { +if (val &DISPPLANE_TILED ) { + plane_config->tiling =I915_TILING_X ; + fb->modifier =I915_FORMAT_MOD_X_TILED ; + } + +if (val &DISPPLANE_ROTATE_180 ) + plane_config->rotation =DRM_MODE_ROTATE_180 ; + } + +if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B && + val &DISPPLANE_MIRROR ) + plane_config->rotation |=DRM_MODE_REFLECT_X ; + + pixel_format = val &DISPPLANE_PIXFORMAT_MASK ; + fourcc =i9xx_format_to_fourcc (pixel_format); + fb->format =drm_format_info (fourcc); + +if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { + offset =intel_de_read (dev_priv,DSPOFFSET (i9xx_plane)); + base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; + }else if (INTEL_GEN (dev_priv) >=4 ) { +if (plane_config->tiling) + offset =intel_de_read (dev_priv, +DSPTILEOFF (i9xx_plane)); +else + offset =intel_de_read (dev_priv, +DSPLINOFF (i9xx_plane)); + base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; + }else { + base =intel_de_read (dev_priv,DSPADDR (i9xx_plane)); + } + plane_config->base = base; + + val =intel_de_read (dev_priv,PIPESRC (pipe)); + fb->width = ((val >>16 ) &0xfff ) +1 ; + fb->height = ((val >>0 ) &0xfff ) +1 ; + + val =intel_de_read (dev_priv,DSPSTRIDE (i9xx_plane)); + fb->pitches[0 ] = val &0xffffffc0 ; + + aligned_height =intel_fb_align_height (fb,0 , fb->height); + + plane_config->size = fb->pitches[0 ] * aligned_height; + +drm_dbg_kms (&dev_priv->drm, +"%s/%s with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n" , + crtc->base.name, plane->base.name, fb->width, fb->height, + fb->format->cpp[0 ] *8 , base, fb->pitches[0 ], + plane_config->size); + + plane_config->fb = intel_fb; +} +drivers/gpu/drm/i915/display/i9xx_plane.h +4
-0@@ -10,6 +10,8 @@enum pipe ;struct drm_i915_private ; +struct intel_crtc ; +struct intel_initial_plane_config ;struct intel_plane ;struct intel_plane_state ;@@ -21,4 +23,6 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state);struct intel_plane *intel_primary_plane_create (struct drm_i915_private *dev_priv,enum pipe pipe); +void i9xx_get_initial_plane_config (struct intel_crtc *crtc, +struct intel_initial_plane_config *plane_config);#endif drivers/gpu/drm/i915/display/intel_display.c +0
-119@@ -2162,39 +2162,6 @@ intel_plane_compute_gtt(struct intel_plane_state *plane_state)return intel_plane_check_stride (plane_state); } -static int i9xx_format_to_fourcc (int format) -{ -switch (format) { -case DISPPLANE_8BPP : -return DRM_FORMAT_C8 ; -case DISPPLANE_BGRA555 : -return DRM_FORMAT_ARGB1555 ; -case DISPPLANE_BGRX555 : -return DRM_FORMAT_XRGB1555 ; -case DISPPLANE_BGRX565 : -return DRM_FORMAT_RGB565 ; -default : -case DISPPLANE_BGRX888 : -return DRM_FORMAT_XRGB8888 ; -case DISPPLANE_RGBX888 : -return DRM_FORMAT_XBGR8888 ; -case DISPPLANE_BGRA888 : -return DRM_FORMAT_ARGB8888 ; -case DISPPLANE_RGBA888 : -return DRM_FORMAT_ABGR8888 ; -case DISPPLANE_BGRX101010 : -return DRM_FORMAT_XRGB2101010 ; -case DISPPLANE_RGBX101010 : -return DRM_FORMAT_XBGR2101010 ; -case DISPPLANE_BGRA101010 : -return DRM_FORMAT_ARGB2101010 ; -case DISPPLANE_RGBA101010 : -return DRM_FORMAT_ABGR2101010 ; -case DISPPLANE_RGBX161616 : -return DRM_FORMAT_XBGR16161616F ; - } -} -static struct i915_vma *initial_plane_vma (struct drm_i915_private *i915,struct intel_initial_plane_config *plane_config)@@ -5850,92 +5817,6 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc, pipe_config->port_clock =vlv_calc_dpll_params (refclk, &clock); } -static void -i9xx_get_initial_plane_config (struct intel_crtc *crtc, -struct intel_initial_plane_config *plane_config) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_plane *plane =to_intel_plane (crtc->base.primary); -enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; -enum pipe pipe; -u32 val, base, offset; -int fourcc, pixel_format; -unsigned int aligned_height; -struct drm_framebuffer *fb; -struct intel_framebuffer *intel_fb; - -if (!plane->get_hw_state (plane, &pipe)) -return ; - -drm_WARN_ON (dev, pipe != crtc->pipe); - - intel_fb =kzalloc (sizeof (*intel_fb),GFP_KERNEL ); -if (!intel_fb) { -drm_dbg_kms (&dev_priv->drm,"failed to alloc fb\n" ); -return ; - } - - fb = &intel_fb->base; - - fb->dev = dev; - - val =intel_de_read (dev_priv,DSPCNTR (i9xx_plane)); - -if (INTEL_GEN (dev_priv) >=4 ) { -if (val &DISPPLANE_TILED ) { - plane_config->tiling =I915_TILING_X ; - fb->modifier =I915_FORMAT_MOD_X_TILED ; - } - -if (val &DISPPLANE_ROTATE_180 ) - plane_config->rotation =DRM_MODE_ROTATE_180 ; - } - -if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B && - val &DISPPLANE_MIRROR ) - plane_config->rotation |=DRM_MODE_REFLECT_X ; - - pixel_format = val &DISPPLANE_PIXFORMAT_MASK ; - fourcc =i9xx_format_to_fourcc (pixel_format); - fb->format =drm_format_info (fourcc); - -if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { - offset =intel_de_read (dev_priv,DSPOFFSET (i9xx_plane)); - base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; - }else if (INTEL_GEN (dev_priv) >=4 ) { -if (plane_config->tiling) - offset =intel_de_read (dev_priv, -DSPTILEOFF (i9xx_plane)); -else - offset =intel_de_read (dev_priv, -DSPLINOFF (i9xx_plane)); - base =intel_de_read (dev_priv,DSPSURF (i9xx_plane)) &0xfffff000 ; - }else { - base =intel_de_read (dev_priv,DSPADDR (i9xx_plane)); - } - plane_config->base = base; - - val =intel_de_read (dev_priv,PIPESRC (pipe)); - fb->width = ((val >>16 ) &0xfff ) +1 ; - fb->height = ((val >>0 ) &0xfff ) +1 ; - - val =intel_de_read (dev_priv,DSPSTRIDE (i9xx_plane)); - fb->pitches[0 ] = val &0xffffffc0 ; - - aligned_height =intel_fb_align_height (fb,0 , fb->height); - - plane_config->size = fb->pitches[0 ] * aligned_height; - -drm_dbg_kms (&dev_priv->drm, -"%s/%s with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n" , - crtc->base.name, plane->base.name, fb->width, fb->height, - fb->format->cpp[0 ] *8 , base, fb->pitches[0 ], - plane_config->size); - - plane_config->fb = intel_fb; -} -static void chv_crtc_clock_get (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config) {Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for rebased refactor of intel_display (rev2)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display (rev2)
URL : https://patchwork.freedesktop.org/series/85867/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 0142c754f498 drm/i915: refactor some crtc code out of intel display. (v2) -:32: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #32: new file mode 100644
-:332: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #332: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:296:
+ BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
-:333: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "dev_priv->pipe_to_crtc_mapping[pipe]" #333: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:297:
+ dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
-:339: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #339: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:303:
+ BUG_ON(i9xx_plane >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
-:340: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "dev_priv->plane_to_crtc_mapping[i9xx_plane]" #340: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:304:
+ dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
-:346: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #346: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:310:
+ drm_crtc_create_scaling_filter_property(&crtc->base,
+ BIT(DRM_SCALING_FILTER_DEFAULT) |
total: 0 errors, 3 warnings, 3 checks, 714 lines checked4f1099b73aa4 drm/i915: refactor pll code out into intel_dpll.c
-:1577: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #1577: FILE: drivers/gpu/drm/i915/display/intel_display_types.h:1847:
+ return dev_priv->vbt.lvds_use_ssc
+ && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
-:1587: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #1587:
new file mode 100644
-:1613: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations #1613: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:22:
+};
+static const struct intel_limit intel_limits_i8xx_dac = {
-:1678: CHECK:LINE_SPACING: Please don't use multiple blank lines #1678: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:87:
+
+
-:2250: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #2250: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:659:
+ for (clock.m1 = limit->m1.min; clock.m1 <= limit->m1.max; clock.m1++) {
-:2321: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #2321: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:730:
+ if (m2 > INT_MAX/clock.m1)
^
-:2418: CHECK:BRACES: braces {} should be used on all arms of this statement #2418: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:827:
+ if (IS_PINEVIEW(dev_priv))
[...]
+ else {
[...]
-:2420: CHECK:BRACES: Unbalanced braces around else statement #2420: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:829:
+ else {
-:2538: CHECK:LINE_SPACING: Please don't use multiple blank lines #2538: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:947:
+
+
total: 0 errors, 2 warnings, 7 checks, 2919 lines checkedfdbe353d5856 drm/i915: split fdi code out from intel_display.c
-:778: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #778:
new file mode 100644
-:874: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #874: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:92:
+ BUG();
-:879: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #879: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:97:
+int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
+ struct intel_crtc_state *pipe_config)
-:911: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #911: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:129:
+ if (ret == -EINVAL && pipe_config->pipe_bpp > 6*3) {
^
-:912: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #912: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:130:
+ pipe_config->pipe_bpp -= 2*3;
^
-:961: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #961: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:179:
+ udelay(1000);
-:966: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #966: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:184:
+ intel_de_read(dev_priv, reg) | FDI_FS_ERRC_ENABLE | FDI_FE_ERRC_ENABLE);
-:983: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #983: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:201:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:983: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #983: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:201:
+ for train result */
-:990: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #990: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:208:
+ udelay(150);
-:1008: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1008: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:226:
+ udelay(150);
-:1044: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1044: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:262:
+ udelay(150);
-:1063: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #1063: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:281:
+
+}
-:1083: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #1083: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:301:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:1083: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #1083: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:301:
+ for train result */
-:1091: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1091: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:309:
+ udelay(150);
-:1120: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1120: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:338:
+ udelay(150);
-:1130: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1130: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:348:
+ udelay(500);
-:1143: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1143: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:361:
+ udelay(50);
-:1175: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1175: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:393:
+ udelay(150);
-:1185: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1185: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:403:
+ udelay(500);
-:1198: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1198: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:416:
+ udelay(50);
-:1220: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines #1220: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:438:
+ /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
+ for train result */
-:1220: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #1220: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:438:
+ for train result */
-:1228: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1228: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:446:
+ udelay(150);
-:1256: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #1256: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:474:
+ temp |= snb_b_fdi_train_param[j/2];
^
-:1352: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1352: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:570:
+ udelay(200);
-:1359: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1359: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:577:
+ udelay(200);
-:1368: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1368: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:586:
+ udelay(100);
-:1391: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1391: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:609:
+ udelay(100);
-:1399: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1399: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:617:
+ udelay(100);
-:1422: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1422: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:640:
+ udelay(100);
-:1451: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #1451: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:669:
+ udelay(100);
total: 0 errors, 9 warnings, 24 checks, 1446 lines checked6f246741f3a7 drm/i915: refactor ddi translations into a separate file
-:1526: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #1526:
new file mode 100644
-:1794: CHECK:LINE_SPACING: Please don't use multiple blank lines #1794: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:264:
+
+
-:2252: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2252: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:722:
+ return bdw_ddi_translations_edp;
+ } else {
-:2269: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2269: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:739:
+ return skl_u_ddi_translations_dp;
+ } else {
-:2290: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2290: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:760:
+ return kbl_u_ddi_translations_dp;
+ } else {
-:2314: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2314: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:784:
+ return skl_u_ddi_translations_edp;
+ } else {
-:2337: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2337: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:807:
+ return skl_y_ddi_translations_hdmi;
+ } else {
-:2492: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2492: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:962:
+ return cnl_ddi_translations_hdmi_1_05V;
+ } else {
-:2514: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2514: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:984:
+ return cnl_ddi_translations_dp_1_05V;
+ } else {
-:2537: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2537: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1007:
+ return cnl_ddi_translations_edp_1_05V;
+ } else {
-:2631: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2631: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1101:
+ return icl_mg_phy_ddi_translations_hbr2_hbr3;
+ } else {
-:2723: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2723: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1193:
+ return jsl_combo_phy_ddi_translations_edp_hbr2;
+ } else {
-:2765: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2765: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1235:
+ return tgl_uy_combo_phy_ddi_translations_dp_hbr2;
+ } else {
-:2827: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #2827: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:1297:
+ return tgl_dkl_phy_dp_ddi_trans_hbr2;
+ } else {
-:2993: ERROR:TRAILING_WHITESPACE: trailing whitespace #2993: FILE: drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h:99:
+^I^I $
total: 1 errors, 13 warnings, 1 checks, 2944 lines checked eeac5b1660dd drm/i915: migrate hsw fdi code to new file. -:293: WARNING:LONG_LINE: line length of 123 exceeds 100 columns #293: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:583:
+ FDI_RX_PWRDN_LANE1_VAL(2) | FDI_RX_PWRDN_LANE0_VAL(2) | FDI_RX_TP1_TO_TP2_48 | FDI_RX_FDI_DELAY_90);
-:301: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #301: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:591:
+ udelay(220);
-:313: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #313: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:603:
+ * testing each value twice. */
-:325: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #325: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:615:
+ * port reversal bit */
-:327: WARNING:LONG_LINE: line length of 118 exceeds 100 columns #327: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:617:
+ DDI_BUF_CTL_ENABLE | ((crtc_state->fdi_lanes - 1) << 1) | DDI_BUF_TRANS_SELECT(i / 2));
-:330: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #330: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:620:
+ udelay(600);
-:341: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #341: FILE: drivers/gpu/drm/i915/display/intel_fdi.c:631:
+ udelay(30);
total: 0 errors, 4 warnings, 3 checks, 376 lines checked 39f3ea9c90b3 drm/i915: migrate skl planes code new file (v3) -:1294: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #1294: FILE: drivers/gpu/drm/i915/display/intel_display_types.h:1878:
+
+}
-:2748: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #2748:
new file mode 100644
-:3221: CHECK:LINE_SPACING: Please don't use multiple blank lines #3221: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:469:
+
+
-:3282: WARNING:TYPO_SPELLING: 'Limted' may be misspelled - perhaps 'Limited'? #3282: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:530:
+ * BT.601 Limted range YCbCr -> full range RGB
^^^^^^
-:3728: CHECK:LINE_SPACING: Please don't use multiple blank lines #3728: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:976:
+
+
-:3831: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #3831: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1079:
+ (plane_state->color_plane[1].y << 16) | plane_state->color_plane[1].x);
-:4133: CHECK:LINE_SPACING: Please don't use multiple blank lines #4133: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1381:
+
+
-:4516: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4516: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1764:
+ return skl_planar_formats;
+ } else {
-:4529: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4529: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1777:
+ return glk_planar_formats;
+ } else {
-:4545: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #4545: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:1793:
+ return icl_sdr_y_plane_formats;
+ } else {
-:4859: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #4859: FILE: drivers/gpu/drm/i915/display/skl_universal_plane.c:2107:
+ drm_plane_create_scaling_filter_property(&plane->base,
+ BIT(DRM_SCALING_FILTER_DEFAULT) |
total: 0 errors, 6 warnings, 5 checks, 4945 lines checkede83bd5fb9898 drm/i915: move pipe update code into crtc.
-:236: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #236: FILE: drivers/gpu/drm/i915/display/intel_crtc.c:533:
+ * while ... */
total: 0 errors, 1 warnings, 0 checks, 483 lines checkedd9f0fdb2f780 drm/i915: split fb scalable checks into g4x and skl versionsd9c9a600e163 drm/i915: move is_ccs_modifier to an inline6f933fa8c210 drm/i915: migrate pll enable/disable code to intel_dpll.[ch]
-:641: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #641: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1399:
+ udelay(150);
-:659: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #659: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1417:
+ udelay(150); /* wait for warmup */
-:700: CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst #700: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1458:
+ udelay(150);
-:725: CHECK:LINE_SPACING: Please don't use multiple blank lines #725: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1483:
+
+
-:809: WARNING:LONG_LINE: line length of 106 exceeds 100 columns #809: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1567:
+ pipe_config->dpll_hw_state.dpll & ~(DPLL_VCO_ENABLE | DPLL_EXT_BUFFER_ENABLE_VLV));
-:862: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #862: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1620:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe),
+ 0x009f0003);
-:865: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #865: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1623:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe),
+ 0x00d0000f);
-:871: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #871: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1629:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df40000);
-:874: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #874: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1632:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df70000);
-:879: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #879: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1637:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df70000);
-:882: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #882: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1640:
+ vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
+ 0x0df40000);
-:930: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #930: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1688:
+ vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW13(port),
+ 5 << DPIO_CHV_S1_DIV_SHIFT |
-:940: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #940: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1698:
+ vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW1(port),
+ DPIO_CHV_M1_DIV_BY_2 |
-:995: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #995: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1753:
+ vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port),
+ vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port)) |
-:1099: CHECK:LINE_SPACING: Please don't use multiple blank lines #1099: FILE: drivers/gpu/drm/i915/display/intel_dpll.c:1857:
+
+
-:1160: ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Dave Airlie <[email protected]>'
total: 1 errors, 1 warnings, 14 checks, 1110 lines checked08d07ca5c399 drm/i915: migrate i9xx plane get config
-:299: ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Dave Airlie <[email protected]>'
total: 1 errors, 0 warnings, 0 checks, 267 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for rebased refactor of intel_display (rev2)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display (rev2)
URL : https://patchwork.freedesktop.org/series/85867/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. - +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:714:28: warning: symbol 'bdw_get_buf_trans_edp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:728:28: warning: symbol 'skl_get_buf_trans_dp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:745:28: warning: symbol 'kbl_get_buf_trans_dp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:766:28: warning: symbol 'skl_get_buf_trans_edp' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:798:28: warning: symbol 'skl_get_buf_trans_hdmi' was not declared. Should it be static? +drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c:813:5: warning: symbol 'skl_buf_trans_num_entries' was not declared. Should it be static? +drivers/gpu/drm/i915/gem/i915_gem_stolen.c:624:5: warning: symbol '__i915_gem_object_create_stolen' was not declared. Should it be static? +drivers/gpu/drm/i915/gem/i915_gem_stolen.c:649:5: warning: symbol '_i915_gem_object_stolen_init' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/intel_reset.c:1328:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block +drivers/gpu/drm/i915/gvt/mmio.c:295:23: warning: memcpy with byte count of 279040 +drivers/gpu/drm/i915/i915_perf.c:1450:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/i915_perf.c:1504:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/intel_wakeref.c:137:19: warning: context imbalance in 'wakeref_auto_timeout' - unexpected unlock +./include/linux/seqlock.h:843:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:843:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:869:16: warning: trying to copy expression type 31 +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block +./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for rebased refactor of intel_display (rev2)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display (rev2)
URL : https://patchwork.freedesktop.org/series/85867/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9622 -> Patchwork_19367
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/index.html
Known issues
------------
Here are the changes found in Patchwork_19367 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@fork-gfx0:
- fi-tgl-y: NOTRUN -> [SKIP][1] ([fdo#109315] / [i915#2575]) +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-tgl-y/igt@amdgpu/[email protected]
* igt@amdgpu/amd_cs_nop@sync-gfx0:
- fi-bsw-n3050: NOTRUN -> [SKIP][2] ([fdo#109271]) +17 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-bsw-n3050/igt@amdgpu/[email protected]
* igt@gem_exec_fence@basic-busy@bcs0:
- fi-apl-guc: NOTRUN -> [SKIP][3] ([fdo#109271]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-apl-guc/igt@gem_exec_fence@[email protected]
* igt@gem_huc_copy@huc-copy:
- fi-byt-j1900: NOTRUN -> [SKIP][4] ([fdo#109271]) +27 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-byt-j1900/igt@[email protected]
* igt@gem_tiled_blits@basic:
- fi-tgl-y: [PASS][5] -> [DMESG-WARN][6] ([i915#402]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/fi-tgl-y/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-tgl-y/igt@[email protected]
* igt@i915_hangman@error-state-basic:
- fi-apl-guc: NOTRUN -> [DMESG-WARN][7] ([i915#1610])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-apl-guc/igt@[email protected]
* igt@i915_selftest@live@hangcheck:
- fi-icl-y: [PASS][8] -> [INCOMPLETE][9] ([i915#926])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/fi-icl-y/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-icl-y/igt@i915_selftest@[email protected]
* igt@kms_chamelium@hdmi-crc-fast:
- fi-byt-j1900: NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +8 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-byt-j1900/igt@[email protected]
* igt@runner@aborted:
- fi-apl-guc: NOTRUN -> [FAIL][11] ([i915#2426])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-apl-guc/igt@[email protected]
- fi-icl-y: NOTRUN -> [FAIL][12] ([i915#1580] / [i915#2295] / [i915#2724])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-icl-y/igt@[email protected]
#### Possible fixes ####
* igt@debugfs_test@read_all_entries:
- fi-tgl-y: [DMESG-WARN][13] ([i915#402]) -> [PASS][14] +2 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/fi-tgl-y/igt@debugfs_test@read_all_entries.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-tgl-y/igt@debugfs_test@read_all_entries.html
* igt@gem_exec_suspend@basic-s3:
- fi-tgl-u2: [FAIL][15] ([i915#1888]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/fi-tgl-u2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-tgl-u2/igt@[email protected]
* igt@i915_selftest@live@execlists:
- fi-bsw-n3050: [INCOMPLETE][17] ([i915#2940]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/fi-bsw-n3050/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/fi-bsw-n3050/igt@i915_selftest@[email protected]
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1580]: https://gitlab.freedesktop.org/drm/intel/issues/1580
[i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2724]: https://gitlab.freedesktop.org/drm/intel/issues/2724
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#926]: https://gitlab.freedesktop.org/drm/intel/issues/926
Participating hosts (40 -> 39)
------------------------------
Additional (2): fi-byt-j1900 fi-apl-guc
Missing (3): fi-bsw-cyan fi-bdw-samus fi-hsw-4200u
Build changes
-------------
* Linux: CI_DRM_9622 -> Patchwork_19367
CI-20190529: 20190529
CI_DRM_9622: 1612b668c881dacf505c6f56c7b2a39d9e0d903a @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5959: c5cf0734c4f6c1fa17a6a15b5aa721c3a0b8c494 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19367: 08d07ca5c39955dfe0da7c54314e62d533609891 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
08d07ca5c399 drm/i915: migrate i9xx plane get config 6f933fa8c210 drm/i915: migrate pll enable/disable code to intel_dpll.[ch] d9c9a600e163 drm/i915: move is_ccs_modifier to an inline d9f0fdb2f780 drm/i915: split fb scalable checks into g4x and skl versions e83bd5fb9898 drm/i915: move pipe update code into crtc. 39f3ea9c90b3 drm/i915: migrate skl planes code new file (v3) eeac5b1660dd drm/i915: migrate hsw fdi code to new file. 6f246741f3a7 drm/i915: refactor ddi translations into a separate file fdbe353d5856 drm/i915: split fdi code out from intel_display.c 4f1099b73aa4 drm/i915: refactor pll code out into intel_dpll.c 0142c754f498 drm/i915: refactor some crtc code out of intel display. (v2)
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for rebased refactor of intel_display (rev2)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: rebased refactor of intel_display (rev2)
URL : https://patchwork.freedesktop.org/series/85867/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9622_full -> Patchwork_19367_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_19367_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_persistence@close-replace-race:
- shard-glk: [PASS][1] -> [TIMEOUT][2] ([i915#2918])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-glk7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk7/igt@[email protected]
* igt@gem_ctx_persistence@legacy-engines-persistence:
- shard-hsw: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#1099]) +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-hsw4/igt@[email protected]
* igt@gem_exec_whisper@basic-contexts-priority:
- shard-glk: [PASS][4] -> [DMESG-WARN][5] ([i915#118] / [i915#95])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-glk9/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk3/igt@[email protected]
* igt@gem_fenced_exec_thrash@too-many-fences:
- shard-snb: [PASS][6] -> [INCOMPLETE][7] ([i915#2055])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-snb5/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-snb5/igt@[email protected]
* igt@gem_userptr_blits@vma-merge:
- shard-glk: NOTRUN -> [INCOMPLETE][8] ([i915#2502] / [i915#2667])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk9/igt@[email protected]
- shard-hsw: NOTRUN -> [FAIL][9] ([i915#2724])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-hsw6/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][10] -> [FAIL][11] ([i915#454])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-iclb2/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-iclb4/igt@[email protected]
- shard-skl: NOTRUN -> [FAIL][12] ([i915#454])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl1/igt@[email protected]
* igt@kms_async_flips@test-time-stamp:
- shard-tglb: [PASS][13] -> [FAIL][14] ([i915#2574])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb3/igt@[email protected]
* igt@kms_big_fb@y-tiled-addfb-size-overflow:
- shard-hsw: NOTRUN -> [SKIP][15] ([fdo#109271]) +243 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-hsw6/igt@[email protected]
* igt@kms_ccs@pipe-c-bad-aux-stride:
- shard-skl: NOTRUN -> [SKIP][16] ([fdo#109271] / [fdo#111304])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_color@pipe-a-ctm-0-5:
- shard-skl: [PASS][17] -> [DMESG-WARN][18] ([i915#1982]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl10/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl1/igt@[email protected]
* igt@kms_color_chamelium@pipe-c-ctm-limited-range:
- shard-hsw: NOTRUN -> [SKIP][19] ([fdo#109271] / [fdo#111827]) +20 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-hsw6/igt@[email protected]
* igt@kms_color_chamelium@pipe-d-ctm-0-25:
- shard-skl: NOTRUN -> [SKIP][20] ([fdo#109271] / [fdo#111827]) +8 similar issues
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-64x21-random:
- shard-skl: NOTRUN -> [FAIL][21] ([i915#54]) +2 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-64x21-offscreen:
- shard-skl: [PASS][22] -> [FAIL][23] ([i915#54]) +5 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl8/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl3/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-skl: [PASS][24] -> [FAIL][25] ([i915#2346])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl3/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl8/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
- shard-tglb: [PASS][26] -> [FAIL][27] ([i915#2346])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb5/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb7/igt@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs:
- shard-glk: NOTRUN -> [FAIL][28] ([i915#2628])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk9/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-cpu:
- shard-glk: NOTRUN -> [SKIP][29] ([fdo#109271]) +14 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk9/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-move:
- shard-skl: NOTRUN -> [SKIP][30] ([fdo#109271]) +52 similar issues
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl8/igt@[email protected]
* igt@kms_hdr@bpc-switch:
- shard-skl: [PASS][31] -> [FAIL][32] ([i915#1188])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl3/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl7/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
- shard-skl: NOTRUN -> [FAIL][33] ([i915#265])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [PASS][34] -> [FAIL][35] ([fdo#108145] / [i915#265])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl8/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl3/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: NOTRUN -> [FAIL][36] ([fdo#108145] / [i915#265])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl9/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][37] -> [SKIP][38] ([fdo#109441]) +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-iclb1/igt@kms_psr@psr2_cursor_render.html
* igt@prime_vgem@sync@vcs0:
- shard-tglb: [PASS][39] -> [INCOMPLETE][40] ([i915#409])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb2/igt@prime_vgem@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb3/igt@prime_vgem@[email protected]
* igt@sysfs_heartbeat_interval@mixed@vcs0:
- shard-skl: [PASS][41] -> [FAIL][42] ([i915#1731])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl1/igt@sysfs_heartbeat_interval@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl5/igt@sysfs_heartbeat_interval@[email protected]
* igt@sysfs_heartbeat_interval@mixed@vecs0:
- shard-kbl: [PASS][43] -> [INCOMPLETE][44] ([i915#1731])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-kbl3/igt@sysfs_heartbeat_interval@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-kbl7/igt@sysfs_heartbeat_interval@[email protected]
#### Possible fixes ####
* igt@api_intel_bb@render-ccs:
- shard-apl: [INCOMPLETE][45] ([i915#2405] / [i915#2499]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-apl3/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-apl2/igt@[email protected]
* {igt@gem_exec_fair@basic-none-share@rcs0}:
- shard-tglb: [FAIL][47] ([i915#2842]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb2/igt@gem_exec_fair@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb6/igt@gem_exec_fair@[email protected]
* {igt@gem_exec_fair@basic-none@vcs0}:
- shard-apl: [FAIL][49] ([i915#2842]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-apl2/igt@gem_exec_fair@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-apl7/igt@gem_exec_fair@[email protected]
* {igt@gem_exec_fair@basic-throttle@rcs0}:
- shard-glk: [FAIL][51] ([i915#2842]) -> [PASS][52] +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-glk5/igt@gem_exec_fair@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk8/igt@gem_exec_fair@[email protected]
* igt@gem_exec_flush@basic-uc-set-default:
- shard-skl: [DMESG-WARN][53] ([i915#1982]) -> [PASS][54] +1 similar issue
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl4/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl4/igt@[email protected]
* igt@gem_workarounds@suspend-resume-context:
- shard-skl: [INCOMPLETE][55] ([i915#146] / [i915#198] / [i915#2295]) -> [PASS][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl9/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@gen9_exec_parse@allowed-single:
- shard-glk: [DMESG-WARN][57] ([i915#1436] / [i915#716]) -> [PASS][58] +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-glk5/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-glk9/igt@[email protected]
* igt@i915_pm_rpm@system-suspend-modeset:
- shard-skl: [INCOMPLETE][59] ([i915#151]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl8/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-256x85-random:
- shard-skl: [FAIL][61] ([i915#54]) -> [PASS][62] +9 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl9/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl10/igt@[email protected]
* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [FAIL][63] ([i915#1188]) -> [PASS][64] +1 similar issue
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl8/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl3/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-skl: [INCOMPLETE][65] ([i915#198]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-skl2/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-skl9/igt@[email protected]
* igt@kms_plane_cursor@pipe-b-viewport-size-64:
- shard-kbl: [DMESG-WARN][67] ([i915#180] / [i915#78]) -> [PASS][68] +1 similar issue
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-kbl2/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-kbl1/igt@[email protected]
* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [SKIP][69] ([fdo#109441]) -> [PASS][70] +2 similar issues
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-iclb3/igt@kms_psr@psr2_sprite_plane_move.html
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
#### Warnings ####
* igt@i915_pm_rc6_residency@rc6-fence:
- shard-iclb: [WARN][71] ([i915#1804] / [i915#2684]) -> [WARN][72] ([i915#2684])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-iclb3/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-iclb2/igt@[email protected]
* igt@runner@aborted:
- shard-kbl: ([FAIL][73], [FAIL][74]) ([i915#1814] / [i915#2295]) -> ([FAIL][75], [FAIL][76]) ([i915#1814] / [i915#2295] / [i915#2505])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-kbl7/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-kbl1/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-kbl3/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-kbl6/igt@[email protected]
- shard-tglb: ([FAIL][77], [FAIL][78]) ([i915#1602] / [i915#2295] / [i915#2667]) -> ([FAIL][79], [FAIL][80], [FAIL][81]) ([i915#1602] / [i915#1764] / [i915#2295] / [i915#2426] / [i915#2667] / [i915#409])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb8/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9622/shard-tglb3/igt@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb2/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb3/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/shard-tglb8/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111304]: https://bugs.freedesktop.org/show_bug.cgi?id=111304
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#1731]: https://gitlab.freedesktop.org/drm/intel/issues/1731
[i915#1764]: https://gitlab.freedesktop.org/drm/intel/issues/1764
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
[i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2055]: https://gitlab.freedesktop.org/drm/intel/issues/2055
[i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2499]: https://gitlab.freedesktop.org/drm/intel/issues/2499
[i915#2502]: https://gitlab.freedesktop.org/drm/intel/issues/2502
[i915#2505]: https://gitlab.freedesktop.org/drm/intel/issues/2505
[i915#2574]: https://gitlab.freedesktop.org/drm/intel/issues/2574
[i915#2628]: https://gitlab.freedesktop.org/drm/intel/issues/2628
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#2667]: https://gitlab.freedesktop.org/drm/intel/issues/2667
[i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
[i915#2724]: https://gitlab.freedesktop.org/drm/intel/issues/2724
[i915#2822]: https://gitlab.freedesktop.org/drm/intel/issues/2822
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2849]: https://gitlab.freedesktop.org/drm/intel/issues/2849
[i915#2918]: https://gitlab.freedesktop.org/drm/intel/issues/2918
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#409]: https://gitlab.freedesktop.org/drm/intel/issues/409
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#78]: https://gitlab.freedesktop.org/drm/intel/issues/78
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_9622 -> Patchwork_19367
CI-20190529: 20190529
CI_DRM_9622: 1612b668c881dacf505c6f56c7b2a39d9e0d903a @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5959: c5cf0734c4f6c1fa17a6a15b5aa721c3a0b8c494 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19367: 08d07ca5c39955dfe0da7c54314e62d533609891 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19367/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 03/11] drm/i915: split fdi code out from intel_display.c
In reply to Jani NikulaQuoted 8 lines · Jani Nikula
From: Dave Airlie <[email protected]>
This just refactors out the fdi code to a separate file.
Signed-off-by Dave Airlie <[email protected]>[Jani: cleaned up intel_fdi.h a bit.]Signed-off-by Jani Nikula <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>
Thanks for the patches and review, pushed the first three for starters.
BR,
Jani.
Quoted 1,488 lines
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/display/intel_display.c | 685 +----------------- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_fdi.c | 683 +++++++++++++++++ drivers/gpu/drm/i915/display/intel_fdi.h | 22 + 5 files changed, 718 insertions(+), 682 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.c create mode 100644 drivers/gpu/drm/i915/display/intel_fdi.hdrivers/gpu/drm/i915/Makefile +1
-0@@ -210,6 +210,7 @@ i915-y += \ display/intel_dpll_mgr.o \ display/intel_dsb.o \ display/intel_fbc.o \ + display/intel_fdi.o \ display/intel_fifo_underrun.o \ display/intel_frontbuffer.o \ display/intel_global_state.o \drivers/gpu/drm/i915/display/intel_display.c +3
-682@@ -74,6 +74,7 @@#include "intel_display_types.h" #include "intel_dp_link_training.h" #include "intel_fbc.h" +#include "intel_fdi.h" #include "intel_fbdev.h" #include "intel_fifo_underrun.h" #include "intel_frontbuffer.h" @@ -173,16 +174,6 @@ static void intel_update_czclk(struct drm_i915_private *dev_priv) dev_priv->czclk_freq); } -/* units of 100MHz */ -static u32 intel_fdi_link_freq (struct drm_i915_private *dev_priv, -const struct intel_crtc_state *pipe_config) -{ -if (HAS_DDI (dev_priv)) -return pipe_config->port_clock;/* SPLL */ -else -return dev_priv->fdi_pll_freq; -} -/* WA Display #0827: Gen9:all */ static void skl_wa_827 (struct drm_i915_private *dev_priv,enum pipe pipe,bool enable)@@ -3727,532 +3718,6 @@ static void icl_set_pipe_chicken(struct intel_crtc *crtc)intel_de_write (dev_priv,PIPE_CHICKEN (pipe), tmp); } -static void intel_fdi_normal_train (struct intel_crtc *crtc) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -i915_reg_t reg; -u32 temp; - -/* enable normal train */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if (IS_IVYBRIDGE (dev_priv)) { - temp &= ~FDI_LINK_TRAIN_NONE_IVB ; - temp |=FDI_LINK_TRAIN_NONE_IVB |FDI_TX_ENHANCE_FRAME_ENABLE ; - }else { - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_NONE |FDI_TX_ENHANCE_FRAME_ENABLE ; - } -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if (HAS_PCH_CPT (dev_priv)) { - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp |=FDI_LINK_TRAIN_NORMAL_CPT ; - }else { - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_NONE ; - } -intel_de_write (dev_priv, reg, temp |FDI_RX_ENHANCE_FRAME_ENABLE ); - -/* wait one idle pattern time */ -intel_de_posting_read (dev_priv, reg); -udelay (1000 ); - -/* IVB wants error correction enabled */ -if (IS_IVYBRIDGE (dev_priv)) -intel_de_write (dev_priv, reg, -intel_de_read (dev_priv, reg) |FDI_FS_ERRC_ENABLE |FDI_FE_ERRC_ENABLE ); -} - -/* The FDI link training functions for ILK/Ibexpeak. */ -static void ilk_fdi_link_train (struct intel_crtc *crtc, -const struct intel_crtc_state *crtc_state) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -i915_reg_t reg; -u32 temp, tries; - -/* FDI needs bits from pipe first */ -assert_pipe_enabled (dev_priv, crtc_state->cpu_transcoder); - -/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit -for train result */ - reg =FDI_RX_IMR (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_RX_SYMBOL_LOCK ; - temp &= ~FDI_RX_BIT_LOCK ; -intel_de_write (dev_priv, reg, temp); -intel_de_read (dev_priv, reg); -udelay (150 ); - -/* enable CPU FDI TX and PCH FDI RX */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_DP_PORT_WIDTH_MASK ; - temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; -intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; -intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -/* Ironlake workaround, enable clock pointer after FDI enable*/ -intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), -FDI_RX_PHASE_SYNC_POINTER_OVR ); -intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), -FDI_RX_PHASE_SYNC_POINTER_OVR |FDI_RX_PHASE_SYNC_POINTER_EN ); - - reg =FDI_RX_IIR (pipe); -for (tries =0 ; tries <5 ; tries++) { - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); - -if ((temp &FDI_RX_BIT_LOCK )) { -drm_dbg_kms (&dev_priv->drm,"FDI train 1 done.\n" ); -intel_de_write (dev_priv, reg, temp |FDI_RX_BIT_LOCK ); -break ; - } - } -if (tries ==5 ) -drm_err (&dev_priv->drm,"FDI train 1 fail!\n" ); - -/* Train 2 */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_2 ; -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_2 ; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - - reg =FDI_RX_IIR (pipe); -for (tries =0 ; tries <5 ; tries++) { - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); - -if (temp &FDI_RX_SYMBOL_LOCK ) { -intel_de_write (dev_priv, reg, - temp |FDI_RX_SYMBOL_LOCK ); -drm_dbg_kms (&dev_priv->drm,"FDI train 2 done.\n" ); -break ; - } - } -if (tries ==5 ) -drm_err (&dev_priv->drm,"FDI train 2 fail!\n" ); - -drm_dbg_kms (&dev_priv->drm,"FDI train done\n" ); - -} - -static const int snb_b_fdi_train_param[] = { -FDI_LINK_TRAIN_400MV_0DB_SNB_B , -FDI_LINK_TRAIN_400MV_6DB_SNB_B , -FDI_LINK_TRAIN_600MV_3_5DB_SNB_B , -FDI_LINK_TRAIN_800MV_0DB_SNB_B , -}; - -/* The FDI link training functions for SNB/Cougarpoint. */ -static void gen6_fdi_link_train (struct intel_crtc *crtc, -const struct intel_crtc_state *crtc_state) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -i915_reg_t reg; -u32 temp, i, retry; - -/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit -for train result */ - reg =FDI_RX_IMR (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_RX_SYMBOL_LOCK ; - temp &= ~FDI_RX_BIT_LOCK ; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -/* enable CPU FDI TX and PCH FDI RX */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_DP_PORT_WIDTH_MASK ; - temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; - temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; -/* SNB-B */ - temp |=FDI_LINK_TRAIN_400MV_0DB_SNB_B ; -intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); - -intel_de_write (dev_priv,FDI_RX_MISC (pipe), -FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if (HAS_PCH_CPT (dev_priv)) { - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; - }else { - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; - } -intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -for (i =0 ; i <4 ; i++) { - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; - temp |= snb_b_fdi_train_param[i]; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (500 ); - -for (retry =0 ; retry <5 ; retry++) { - reg =FDI_RX_IIR (pipe); - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); -if (temp &FDI_RX_BIT_LOCK ) { -intel_de_write (dev_priv, reg, - temp |FDI_RX_BIT_LOCK ); -drm_dbg_kms (&dev_priv->drm, -"FDI train 1 done.\n" ); -break ; - } -udelay (50 ); - } -if (retry <5 ) -break ; - } -if (i ==4 ) -drm_err (&dev_priv->drm,"FDI train 1 fail!\n" ); - -/* Train 2 */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_2 ; -if (IS_GEN (dev_priv,6 )) { - temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; -/* SNB-B */ - temp |=FDI_LINK_TRAIN_400MV_0DB_SNB_B ; - } -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if (HAS_PCH_CPT (dev_priv)) { - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp |=FDI_LINK_TRAIN_PATTERN_2_CPT ; - }else { - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_2 ; - } -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -for (i =0 ; i <4 ; i++) { - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; - temp |= snb_b_fdi_train_param[i]; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (500 ); - -for (retry =0 ; retry <5 ; retry++) { - reg =FDI_RX_IIR (pipe); - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); -if (temp &FDI_RX_SYMBOL_LOCK ) { -intel_de_write (dev_priv, reg, - temp |FDI_RX_SYMBOL_LOCK ); -drm_dbg_kms (&dev_priv->drm, -"FDI train 2 done.\n" ); -break ; - } -udelay (50 ); - } -if (retry <5 ) -break ; - } -if (i ==4 ) -drm_err (&dev_priv->drm,"FDI train 2 fail!\n" ); - -drm_dbg_kms (&dev_priv->drm,"FDI train done.\n" ); -} - -/* Manual link training for Ivy Bridge A0 parts */ -static void ivb_manual_fdi_link_train (struct intel_crtc *crtc, -const struct intel_crtc_state *crtc_state) -{ -struct drm_device *dev = crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = crtc->pipe; -i915_reg_t reg; -u32 temp, i, j; - -/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit -for train result */ - reg =FDI_RX_IMR (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_RX_SYMBOL_LOCK ; - temp &= ~FDI_RX_BIT_LOCK ; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (150 ); - -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR before link train 0x%x\n" , -intel_de_read (dev_priv,FDI_RX_IIR (pipe))); - -/* Try each vswing and preemphasis setting twice before moving on */ -for (j =0 ; j <ARRAY_SIZE (snb_b_fdi_train_param) *2 ; j++) { -/* disable first in case we need to retry */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~(FDI_LINK_TRAIN_AUTO |FDI_LINK_TRAIN_NONE_IVB ); - temp &= ~FDI_TX_ENABLE ; -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_AUTO ; - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp &= ~FDI_RX_ENABLE ; -intel_de_write (dev_priv, reg, temp); - -/* enable CPU FDI TX and PCH FDI RX */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_DP_PORT_WIDTH_MASK ; - temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); - temp |=FDI_LINK_TRAIN_PATTERN_1_IVB ; - temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; - temp |= snb_b_fdi_train_param[j/2 ]; - temp |=FDI_COMPOSITE_SYNC ; -intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); - -intel_de_write (dev_priv,FDI_RX_MISC (pipe), -FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; - temp |=FDI_COMPOSITE_SYNC ; -intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (1 );/* should be 0.5us */ - -for (i =0 ; i <4 ; i++) { - reg =FDI_RX_IIR (pipe); - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); - -if (temp &FDI_RX_BIT_LOCK || - (intel_de_read (dev_priv, reg) &FDI_RX_BIT_LOCK )) { -intel_de_write (dev_priv, reg, - temp |FDI_RX_BIT_LOCK ); -drm_dbg_kms (&dev_priv->drm, -"FDI train 1 done, level %i.\n" , - i); -break ; - } -udelay (1 );/* should be 0.5us */ - } -if (i ==4 ) { -drm_dbg_kms (&dev_priv->drm, -"FDI train 1 fail on vswing %d\n" , j /2 ); -continue ; - } - -/* Train 2 */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE_IVB ; - temp |=FDI_LINK_TRAIN_PATTERN_2_IVB ; -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp |=FDI_LINK_TRAIN_PATTERN_2_CPT ; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (2 );/* should be 1.5us */ - -for (i =0 ; i <4 ; i++) { - reg =FDI_RX_IIR (pipe); - temp =intel_de_read (dev_priv, reg); -drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); - -if (temp &FDI_RX_SYMBOL_LOCK || - (intel_de_read (dev_priv, reg) &FDI_RX_SYMBOL_LOCK )) { -intel_de_write (dev_priv, reg, - temp |FDI_RX_SYMBOL_LOCK ); -drm_dbg_kms (&dev_priv->drm, -"FDI train 2 done, level %i.\n" , - i); - goto train_done; - } -udelay (2 );/* should be 1.5us */ - } -if (i ==4 ) -drm_dbg_kms (&dev_priv->drm, -"FDI train 2 fail on vswing %d\n" , j /2 ); - } - -train_done: -drm_dbg_kms (&dev_priv->drm,"FDI train done.\n" ); -} - -static void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state) -{ -struct intel_crtc *intel_crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (intel_crtc->base.dev); -enum pipe pipe = intel_crtc->pipe; -i915_reg_t reg; -u32 temp; - -/* enable PCH FDI RX PLL, wait warmup plus DMI latency */ - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~(FDI_DP_PORT_WIDTH_MASK | (0x7 <<16 )); - temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); - temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; -intel_de_write (dev_priv, reg, temp |FDI_RX_PLL_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (200 ); - -/* Switch from Rawclk to PCDclk */ - temp =intel_de_read (dev_priv, reg); -intel_de_write (dev_priv, reg, temp |FDI_PCDCLK ); - -intel_de_posting_read (dev_priv, reg); -udelay (200 ); - -/* Enable CPU FDI TX PLL, always on for Ironlake */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if ((temp &FDI_TX_PLL_ENABLE ) ==0 ) { -intel_de_write (dev_priv, reg, temp |FDI_TX_PLL_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (100 ); - } -} - -static void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc) -{ -struct drm_device *dev = intel_crtc->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -enum pipe pipe = intel_crtc->pipe; -i915_reg_t reg; -u32 temp; - -/* Switch from PCDclk to Rawclk */ - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -intel_de_write (dev_priv, reg, temp & ~FDI_PCDCLK ); - -/* Disable CPU FDI TX PLL */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -intel_de_write (dev_priv, reg, temp & ~FDI_TX_PLL_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (100 ); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -intel_de_write (dev_priv, reg, temp & ~FDI_RX_PLL_ENABLE ); - -/* Wait for the clocks to turn off. */ -intel_de_posting_read (dev_priv, reg); -udelay (100 ); -} - -static void ilk_fdi_disable (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; -i915_reg_t reg; -u32 temp; - -/* disable CPU FDI tx and PCH FDI rx */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -intel_de_write (dev_priv, reg, temp & ~FDI_TX_ENABLE ); -intel_de_posting_read (dev_priv, reg); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~(0x7 <<16 ); - temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; -intel_de_write (dev_priv, reg, temp & ~FDI_RX_ENABLE ); - -intel_de_posting_read (dev_priv, reg); -udelay (100 ); - -/* Ironlake workaround, disable clock pointer after downing FDI */ -if (HAS_PCH_IBX (dev_priv)) -intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), -FDI_RX_PHASE_SYNC_POINTER_OVR ); - -/* still set train pattern 1 */ - reg =FDI_TX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; -intel_de_write (dev_priv, reg, temp); - - reg =FDI_RX_CTL (pipe); - temp =intel_de_read (dev_priv, reg); -if (HAS_PCH_CPT (dev_priv)) { - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; - temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; - }else { - temp &= ~FDI_LINK_TRAIN_NONE ; - temp |=FDI_LINK_TRAIN_PATTERN_1 ; - } -/* BPC in FDI rx is consistent with that in PIPECONF */ - temp &= ~(0x07 <<16 ); - temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; -intel_de_write (dev_priv, reg, temp); - -intel_de_posting_read (dev_priv, reg); -udelay (100 ); -} -bool intel_has_pending_fb_unpin (struct drm_i915_private *dev_priv) {struct drm_crtc *crtc;@@ -6659,143 +6124,6 @@ static void intel_connector_verify_state(struct intel_crtc_state *crtc_state, } } -static int pipe_required_fdi_lanes (struct intel_crtc_state *crtc_state) -{ -if (crtc_state->hw.enable && crtc_state->has_pch_encoder) -return crtc_state->fdi_lanes; - -return 0 ; -} - -static int ilk_check_fdi_lanes (struct drm_device *dev,enum pipe pipe, -struct intel_crtc_state *pipe_config) -{ -struct drm_i915_private *dev_priv =to_i915 (dev); -struct drm_atomic_state *state = pipe_config->uapi.state; -struct intel_crtc *other_crtc; -struct intel_crtc_state *other_crtc_state; - -drm_dbg_kms (&dev_priv->drm, -"checking fdi config on pipe %c, lanes %i\n" , -pipe_name (pipe), pipe_config->fdi_lanes); -if (pipe_config->fdi_lanes >4 ) { -drm_dbg_kms (&dev_priv->drm, -"invalid fdi lane config on pipe %c: %i lanes\n" , -pipe_name (pipe), pipe_config->fdi_lanes); -return -EINVAL ; - } - -if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { -if (pipe_config->fdi_lanes >2 ) { -drm_dbg_kms (&dev_priv->drm, -"only 2 lanes on haswell, required: %i lanes\n" , - pipe_config->fdi_lanes); -return -EINVAL ; - }else { -return 0 ; - } - } - -if (INTEL_NUM_PIPES (dev_priv) ==2 ) -return 0 ; - -/* Ivybridge 3 pipe is really complicated */ -switch (pipe) { -case PIPE_A : -return 0 ; -case PIPE_B : -if (pipe_config->fdi_lanes <=2 ) -return 0 ; - - other_crtc =intel_get_crtc_for_pipe (dev_priv,PIPE_C ); - other_crtc_state = -intel_atomic_get_crtc_state (state, other_crtc); -if (IS_ERR (other_crtc_state)) -return PTR_ERR (other_crtc_state); - -if (pipe_required_fdi_lanes (other_crtc_state) >0 ) { -drm_dbg_kms (&dev_priv->drm, -"invalid shared fdi lane config on pipe %c: %i lanes\n" , -pipe_name (pipe), pipe_config->fdi_lanes); -return -EINVAL ; - } -return 0 ; -case PIPE_C : -if (pipe_config->fdi_lanes >2 ) { -drm_dbg_kms (&dev_priv->drm, -"only 2 lanes on pipe %c: required %i lanes\n" , -pipe_name (pipe), pipe_config->fdi_lanes); -return -EINVAL ; - } - - other_crtc =intel_get_crtc_for_pipe (dev_priv,PIPE_B ); - other_crtc_state = -intel_atomic_get_crtc_state (state, other_crtc); -if (IS_ERR (other_crtc_state)) -return PTR_ERR (other_crtc_state); - -if (pipe_required_fdi_lanes (other_crtc_state) >2 ) { -drm_dbg_kms (&dev_priv->drm, -"fdi link B uses too many lanes to enable link C\n" ); -return -EINVAL ; - } -return 0 ; -default : -BUG (); - } -} - -#define RETRY 1 -static int ilk_fdi_compute_config (struct intel_crtc *intel_crtc, -struct intel_crtc_state *pipe_config) -{ -struct drm_device *dev = intel_crtc->base.dev; -struct drm_i915_private *i915 =to_i915 (dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -int lane, link_bw, fdi_dotclock, ret; -bool needs_recompute = false; - -retry: -/* FDI is a binary signal running at ~2.7GHz, encoding -* each output octet as 10 bits. The actual frequency -* is stored as a divider into a 100MHz clock, and the -* mode pixel clock is stored in units of 1KHz. -* Hence the bw of each lane in terms of the mode signal -* is: -*/ - link_bw =intel_fdi_link_freq (i915, pipe_config); - - fdi_dotclock = adjusted_mode->crtc_clock; - - lane =ilk_get_lanes_required (fdi_dotclock, link_bw, - pipe_config->pipe_bpp); - - pipe_config->fdi_lanes = lane; - -intel_link_compute_m_n (pipe_config->pipe_bpp, lane, fdi_dotclock, - link_bw, &pipe_config->fdi_m_n, false, false); - - ret =ilk_check_fdi_lanes (dev, intel_crtc->pipe, pipe_config); -if (ret == -EDEADLK ) -return ret; - -if (ret == -EINVAL && pipe_config->pipe_bpp >6 *3 ) { - pipe_config->pipe_bpp -=2 *3 ; -drm_dbg_kms (&i915->drm, -"fdi link bw constraint, reducing pipe bpp to %i\n" , - pipe_config->pipe_bpp); - needs_recompute = true; - pipe_config->bw_constrained = true; - - goto retry; - } - -if (needs_recompute) -return RETRY ; - -return ret; -} -bool hsw_crtc_state_ips_capable (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);@@ -11322,7 +10650,7 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,return ret; } -if (ret ==RETRY ) { +if (ret ==I915_DISPLAY_CONFIG_RETRY ) {if (drm_WARN (&i915->drm, !retry,"loop in pipe configuration computation\n" ))return -EINVAL ;@@ -15121,14 +14449,7 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv) dev_priv->display.crtc_disable = i9xx_crtc_disable; } -if (IS_GEN (dev_priv,5 )) { - dev_priv->display.fdi_link_train = ilk_fdi_link_train; - }else if (IS_GEN (dev_priv,6 )) { - dev_priv->display.fdi_link_train = gen6_fdi_link_train; - }else if (IS_IVYBRIDGE (dev_priv)) { -/* FIXME: detect B0+ stepping and use auto training */ - dev_priv->display.fdi_link_train = ivb_manual_fdi_link_train; - } +intel_fdi_init_hook (dev_priv);if (INTEL_GEN (dev_priv) >=9 ) { dev_priv->display.commit_modeset_enables = skl_commit_modeset_enables;drivers/gpu/drm/i915/display/intel_display_types.h +9
-0@@ -1852,4 +1852,13 @@ static inline u32 i9xx_dpll_compute_fp(struct dpll *dpll) return dpll->n << 16 | dpll->m1 << 8 | dpll->m2; } +static inline u32 intel_fdi_link_freq (struct drm_i915_private *dev_priv, +const struct intel_crtc_state *pipe_config) +{ +if (HAS_DDI (dev_priv)) +return pipe_config->port_clock;/* SPLL */ +else +return dev_priv->fdi_pll_freq; +} +#endif /* __INTEL_DISPLAY_TYPES_H__ */ drivers/gpu/drm/i915/display/intel_fdi.c new file +683
-0@@ -0,0 +1,683 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation +*/ +#include "intel_atomic.h" +#include "intel_display_types.h" +#include "intel_fdi.h" + +/* units of 100MHz */ +static int pipe_required_fdi_lanes (struct intel_crtc_state *crtc_state) +{ +if (crtc_state->hw.enable && crtc_state->has_pch_encoder) +return crtc_state->fdi_lanes; + +return 0 ; +} + +static int ilk_check_fdi_lanes (struct drm_device *dev,enum pipe pipe, +struct intel_crtc_state *pipe_config) +{ +struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_atomic_state *state = pipe_config->uapi.state; +struct intel_crtc *other_crtc; +struct intel_crtc_state *other_crtc_state; + +drm_dbg_kms (&dev_priv->drm, +"checking fdi config on pipe %c, lanes %i\n" , +pipe_name (pipe), pipe_config->fdi_lanes); +if (pipe_config->fdi_lanes >4 ) { +drm_dbg_kms (&dev_priv->drm, +"invalid fdi lane config on pipe %c: %i lanes\n" , +pipe_name (pipe), pipe_config->fdi_lanes); +return -EINVAL ; + } + +if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { +if (pipe_config->fdi_lanes >2 ) { +drm_dbg_kms (&dev_priv->drm, +"only 2 lanes on haswell, required: %i lanes\n" , + pipe_config->fdi_lanes); +return -EINVAL ; + }else { +return 0 ; + } + } + +if (INTEL_NUM_PIPES (dev_priv) ==2 ) +return 0 ; + +/* Ivybridge 3 pipe is really complicated */ +switch (pipe) { +case PIPE_A : +return 0 ; +case PIPE_B : +if (pipe_config->fdi_lanes <=2 ) +return 0 ; + + other_crtc =intel_get_crtc_for_pipe (dev_priv,PIPE_C ); + other_crtc_state = +intel_atomic_get_crtc_state (state, other_crtc); +if (IS_ERR (other_crtc_state)) +return PTR_ERR (other_crtc_state); + +if (pipe_required_fdi_lanes (other_crtc_state) >0 ) { +drm_dbg_kms (&dev_priv->drm, +"invalid shared fdi lane config on pipe %c: %i lanes\n" , +pipe_name (pipe), pipe_config->fdi_lanes); +return -EINVAL ; + } +return 0 ; +case PIPE_C : +if (pipe_config->fdi_lanes >2 ) { +drm_dbg_kms (&dev_priv->drm, +"only 2 lanes on pipe %c: required %i lanes\n" , +pipe_name (pipe), pipe_config->fdi_lanes); +return -EINVAL ; + } + + other_crtc =intel_get_crtc_for_pipe (dev_priv,PIPE_B ); + other_crtc_state = +intel_atomic_get_crtc_state (state, other_crtc); +if (IS_ERR (other_crtc_state)) +return PTR_ERR (other_crtc_state); + +if (pipe_required_fdi_lanes (other_crtc_state) >2 ) { +drm_dbg_kms (&dev_priv->drm, +"fdi link B uses too many lanes to enable link C\n" ); +return -EINVAL ; + } +return 0 ; +default : +BUG (); + } +} + +int ilk_fdi_compute_config (struct intel_crtc *intel_crtc, +struct intel_crtc_state *pipe_config) +{ +struct drm_device *dev = intel_crtc->base.dev; +struct drm_i915_private *i915 =to_i915 (dev); +const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +int lane, link_bw, fdi_dotclock, ret; +bool needs_recompute = false; + +retry: +/* FDI is a binary signal running at ~2.7GHz, encoding +* each output octet as 10 bits. The actual frequency +* is stored as a divider into a 100MHz clock, and the +* mode pixel clock is stored in units of 1KHz. +* Hence the bw of each lane in terms of the mode signal +* is: +*/ + link_bw =intel_fdi_link_freq (i915, pipe_config); + + fdi_dotclock = adjusted_mode->crtc_clock; + + lane =ilk_get_lanes_required (fdi_dotclock, link_bw, + pipe_config->pipe_bpp); + + pipe_config->fdi_lanes = lane; + +intel_link_compute_m_n (pipe_config->pipe_bpp, lane, fdi_dotclock, + link_bw, &pipe_config->fdi_m_n, false, false); + + ret =ilk_check_fdi_lanes (dev, intel_crtc->pipe, pipe_config); +if (ret == -EDEADLK ) +return ret; + +if (ret == -EINVAL && pipe_config->pipe_bpp >6 *3 ) { + pipe_config->pipe_bpp -=2 *3 ; +drm_dbg_kms (&i915->drm, +"fdi link bw constraint, reducing pipe bpp to %i\n" , + pipe_config->pipe_bpp); + needs_recompute = true; + pipe_config->bw_constrained = true; + + goto retry; + } + +if (needs_recompute) +return I915_DISPLAY_CONFIG_RETRY ; + +return ret; +} + +void intel_fdi_normal_train (struct intel_crtc *crtc) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +i915_reg_t reg; +u32 temp; + +/* enable normal train */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if (IS_IVYBRIDGE (dev_priv)) { + temp &= ~FDI_LINK_TRAIN_NONE_IVB ; + temp |=FDI_LINK_TRAIN_NONE_IVB |FDI_TX_ENHANCE_FRAME_ENABLE ; + }else { + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_NONE |FDI_TX_ENHANCE_FRAME_ENABLE ; + } +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if (HAS_PCH_CPT (dev_priv)) { + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp |=FDI_LINK_TRAIN_NORMAL_CPT ; + }else { + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_NONE ; + } +intel_de_write (dev_priv, reg, temp |FDI_RX_ENHANCE_FRAME_ENABLE ); + +/* wait one idle pattern time */ +intel_de_posting_read (dev_priv, reg); +udelay (1000 ); + +/* IVB wants error correction enabled */ +if (IS_IVYBRIDGE (dev_priv)) +intel_de_write (dev_priv, reg, +intel_de_read (dev_priv, reg) |FDI_FS_ERRC_ENABLE |FDI_FE_ERRC_ENABLE ); +} + +/* The FDI link training functions for ILK/Ibexpeak. */ +static void ilk_fdi_link_train (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +i915_reg_t reg; +u32 temp, tries; + +/* FDI needs bits from pipe first */ +assert_pipe_enabled (dev_priv, crtc_state->cpu_transcoder); + +/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit +for train result */ + reg =FDI_RX_IMR (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_RX_SYMBOL_LOCK ; + temp &= ~FDI_RX_BIT_LOCK ; +intel_de_write (dev_priv, reg, temp); +intel_de_read (dev_priv, reg); +udelay (150 ); + +/* enable CPU FDI TX and PCH FDI RX */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_DP_PORT_WIDTH_MASK ; + temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; +intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; +intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +/* Ironlake workaround, enable clock pointer after FDI enable*/ +intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), +FDI_RX_PHASE_SYNC_POINTER_OVR ); +intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), +FDI_RX_PHASE_SYNC_POINTER_OVR |FDI_RX_PHASE_SYNC_POINTER_EN ); + + reg =FDI_RX_IIR (pipe); +for (tries =0 ; tries <5 ; tries++) { + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); + +if ((temp &FDI_RX_BIT_LOCK )) { +drm_dbg_kms (&dev_priv->drm,"FDI train 1 done.\n" ); +intel_de_write (dev_priv, reg, temp |FDI_RX_BIT_LOCK ); +break ; + } + } +if (tries ==5 ) +drm_err (&dev_priv->drm,"FDI train 1 fail!\n" ); + +/* Train 2 */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_2 ; +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_2 ; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + + reg =FDI_RX_IIR (pipe); +for (tries =0 ; tries <5 ; tries++) { + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); + +if (temp &FDI_RX_SYMBOL_LOCK ) { +intel_de_write (dev_priv, reg, + temp |FDI_RX_SYMBOL_LOCK ); +drm_dbg_kms (&dev_priv->drm,"FDI train 2 done.\n" ); +break ; + } + } +if (tries ==5 ) +drm_err (&dev_priv->drm,"FDI train 2 fail!\n" ); + +drm_dbg_kms (&dev_priv->drm,"FDI train done\n" ); + +} + +static const int snb_b_fdi_train_param[] = { +FDI_LINK_TRAIN_400MV_0DB_SNB_B , +FDI_LINK_TRAIN_400MV_6DB_SNB_B , +FDI_LINK_TRAIN_600MV_3_5DB_SNB_B , +FDI_LINK_TRAIN_800MV_0DB_SNB_B , +}; + +/* The FDI link training functions for SNB/Cougarpoint. */ +static void gen6_fdi_link_train (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +i915_reg_t reg; +u32 temp, i, retry; + +/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit +for train result */ + reg =FDI_RX_IMR (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_RX_SYMBOL_LOCK ; + temp &= ~FDI_RX_BIT_LOCK ; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +/* enable CPU FDI TX and PCH FDI RX */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_DP_PORT_WIDTH_MASK ; + temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; + temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; +/* SNB-B */ + temp |=FDI_LINK_TRAIN_400MV_0DB_SNB_B ; +intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); + +intel_de_write (dev_priv,FDI_RX_MISC (pipe), +FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if (HAS_PCH_CPT (dev_priv)) { + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; + }else { + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; + } +intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +for (i =0 ; i <4 ; i++) { + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; + temp |= snb_b_fdi_train_param[i]; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (500 ); + +for (retry =0 ; retry <5 ; retry++) { + reg =FDI_RX_IIR (pipe); + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); +if (temp &FDI_RX_BIT_LOCK ) { +intel_de_write (dev_priv, reg, + temp |FDI_RX_BIT_LOCK ); +drm_dbg_kms (&dev_priv->drm, +"FDI train 1 done.\n" ); +break ; + } +udelay (50 ); + } +if (retry <5 ) +break ; + } +if (i ==4 ) +drm_err (&dev_priv->drm,"FDI train 1 fail!\n" ); + +/* Train 2 */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_2 ; +if (IS_GEN (dev_priv,6 )) { + temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; +/* SNB-B */ + temp |=FDI_LINK_TRAIN_400MV_0DB_SNB_B ; + } +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if (HAS_PCH_CPT (dev_priv)) { + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp |=FDI_LINK_TRAIN_PATTERN_2_CPT ; + }else { + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_2 ; + } +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +for (i =0 ; i <4 ; i++) { + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; + temp |= snb_b_fdi_train_param[i]; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (500 ); + +for (retry =0 ; retry <5 ; retry++) { + reg =FDI_RX_IIR (pipe); + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); +if (temp &FDI_RX_SYMBOL_LOCK ) { +intel_de_write (dev_priv, reg, + temp |FDI_RX_SYMBOL_LOCK ); +drm_dbg_kms (&dev_priv->drm, +"FDI train 2 done.\n" ); +break ; + } +udelay (50 ); + } +if (retry <5 ) +break ; + } +if (i ==4 ) +drm_err (&dev_priv->drm,"FDI train 2 fail!\n" ); + +drm_dbg_kms (&dev_priv->drm,"FDI train done.\n" ); +} + +/* Manual link training for Ivy Bridge A0 parts */ +static void ivb_manual_fdi_link_train (struct intel_crtc *crtc, +const struct intel_crtc_state *crtc_state) +{ +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = crtc->pipe; +i915_reg_t reg; +u32 temp, i, j; + +/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit +for train result */ + reg =FDI_RX_IMR (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_RX_SYMBOL_LOCK ; + temp &= ~FDI_RX_BIT_LOCK ; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (150 ); + +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR before link train 0x%x\n" , +intel_de_read (dev_priv,FDI_RX_IIR (pipe))); + +/* Try each vswing and preemphasis setting twice before moving on */ +for (j =0 ; j <ARRAY_SIZE (snb_b_fdi_train_param) *2 ; j++) { +/* disable first in case we need to retry */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~(FDI_LINK_TRAIN_AUTO |FDI_LINK_TRAIN_NONE_IVB ); + temp &= ~FDI_TX_ENABLE ; +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_AUTO ; + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp &= ~FDI_RX_ENABLE ; +intel_de_write (dev_priv, reg, temp); + +/* enable CPU FDI TX and PCH FDI RX */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_DP_PORT_WIDTH_MASK ; + temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); + temp |=FDI_LINK_TRAIN_PATTERN_1_IVB ; + temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK ; + temp |= snb_b_fdi_train_param[j/2 ]; + temp |=FDI_COMPOSITE_SYNC ; +intel_de_write (dev_priv, reg, temp |FDI_TX_ENABLE ); + +intel_de_write (dev_priv,FDI_RX_MISC (pipe), +FDI_RX_TP1_TO_TP2_48 |FDI_RX_FDI_DELAY_90 ); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; + temp |=FDI_COMPOSITE_SYNC ; +intel_de_write (dev_priv, reg, temp |FDI_RX_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (1 );/* should be 0.5us */ + +for (i =0 ; i <4 ; i++) { + reg =FDI_RX_IIR (pipe); + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); + +if (temp &FDI_RX_BIT_LOCK || + (intel_de_read (dev_priv, reg) &FDI_RX_BIT_LOCK )) { +intel_de_write (dev_priv, reg, + temp |FDI_RX_BIT_LOCK ); +drm_dbg_kms (&dev_priv->drm, +"FDI train 1 done, level %i.\n" , + i); +break ; + } +udelay (1 );/* should be 0.5us */ + } +if (i ==4 ) { +drm_dbg_kms (&dev_priv->drm, +"FDI train 1 fail on vswing %d\n" , j /2 ); +continue ; + } + +/* Train 2 */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE_IVB ; + temp |=FDI_LINK_TRAIN_PATTERN_2_IVB ; +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp |=FDI_LINK_TRAIN_PATTERN_2_CPT ; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (2 );/* should be 1.5us */ + +for (i =0 ; i <4 ; i++) { + reg =FDI_RX_IIR (pipe); + temp =intel_de_read (dev_priv, reg); +drm_dbg_kms (&dev_priv->drm,"FDI_RX_IIR 0x%x\n" , temp); + +if (temp &FDI_RX_SYMBOL_LOCK || + (intel_de_read (dev_priv, reg) &FDI_RX_SYMBOL_LOCK )) { +intel_de_write (dev_priv, reg, + temp |FDI_RX_SYMBOL_LOCK ); +drm_dbg_kms (&dev_priv->drm, +"FDI train 2 done, level %i.\n" , + i); + goto train_done; + } +udelay (2 );/* should be 1.5us */ + } +if (i ==4 ) +drm_dbg_kms (&dev_priv->drm, +"FDI train 2 fail on vswing %d\n" , j /2 ); + } + +train_done: +drm_dbg_kms (&dev_priv->drm,"FDI train done.\n" ); +} + +void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *intel_crtc =to_intel_crtc (crtc_state->uapi.crtc); +struct drm_i915_private *dev_priv =to_i915 (intel_crtc->base.dev); +enum pipe pipe = intel_crtc->pipe; +i915_reg_t reg; +u32 temp; + +/* enable PCH FDI RX PLL, wait warmup plus DMI latency */ + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~(FDI_DP_PORT_WIDTH_MASK | (0x7 <<16 )); + temp |=FDI_DP_PORT_WIDTH (crtc_state->fdi_lanes); + temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; +intel_de_write (dev_priv, reg, temp |FDI_RX_PLL_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (200 ); + +/* Switch from Rawclk to PCDclk */ + temp =intel_de_read (dev_priv, reg); +intel_de_write (dev_priv, reg, temp |FDI_PCDCLK ); + +intel_de_posting_read (dev_priv, reg); +udelay (200 ); + +/* Enable CPU FDI TX PLL, always on for Ironlake */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if ((temp &FDI_TX_PLL_ENABLE ) ==0 ) { +intel_de_write (dev_priv, reg, temp |FDI_TX_PLL_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (100 ); + } +} + +void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc) +{ +struct drm_device *dev = intel_crtc->base.dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +enum pipe pipe = intel_crtc->pipe; +i915_reg_t reg; +u32 temp; + +/* Switch from PCDclk to Rawclk */ + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +intel_de_write (dev_priv, reg, temp & ~FDI_PCDCLK ); + +/* Disable CPU FDI TX PLL */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +intel_de_write (dev_priv, reg, temp & ~FDI_TX_PLL_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (100 ); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +intel_de_write (dev_priv, reg, temp & ~FDI_RX_PLL_ENABLE ); + +/* Wait for the clocks to turn off. */ +intel_de_posting_read (dev_priv, reg); +udelay (100 ); +} + +void ilk_fdi_disable (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +enum pipe pipe = crtc->pipe; +i915_reg_t reg; +u32 temp; + +/* disable CPU FDI tx and PCH FDI rx */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +intel_de_write (dev_priv, reg, temp & ~FDI_TX_ENABLE ); +intel_de_posting_read (dev_priv, reg); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~(0x7 <<16 ); + temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; +intel_de_write (dev_priv, reg, temp & ~FDI_RX_ENABLE ); + +intel_de_posting_read (dev_priv, reg); +udelay (100 ); + +/* Ironlake workaround, disable clock pointer after downing FDI */ +if (HAS_PCH_IBX (dev_priv)) +intel_de_write (dev_priv,FDI_RX_CHICKEN (pipe), +FDI_RX_PHASE_SYNC_POINTER_OVR ); + +/* still set train pattern 1 */ + reg =FDI_TX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; +intel_de_write (dev_priv, reg, temp); + + reg =FDI_RX_CTL (pipe); + temp =intel_de_read (dev_priv, reg); +if (HAS_PCH_CPT (dev_priv)) { + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT ; + temp |=FDI_LINK_TRAIN_PATTERN_1_CPT ; + }else { + temp &= ~FDI_LINK_TRAIN_NONE ; + temp |=FDI_LINK_TRAIN_PATTERN_1 ; + } +/* BPC in FDI rx is consistent with that in PIPECONF */ + temp &= ~(0x07 <<16 ); + temp |= (intel_de_read (dev_priv,PIPECONF (pipe)) &PIPECONF_BPC_MASK ) <<11 ; +intel_de_write (dev_priv, reg, temp); + +intel_de_posting_read (dev_priv, reg); +udelay (100 ); +} + +void +intel_fdi_init_hook (struct drm_i915_private *dev_priv) +{ +if (IS_GEN (dev_priv,5 )) { + dev_priv->display.fdi_link_train = ilk_fdi_link_train; + }else if (IS_GEN (dev_priv,6 )) { + dev_priv->display.fdi_link_train = gen6_fdi_link_train; + }else if (IS_IVYBRIDGE (dev_priv)) { +/* FIXME: detect B0+ stepping and use auto training */ + dev_priv->display.fdi_link_train = ivb_manual_fdi_link_train; + } +}drivers/gpu/drm/i915/display/intel_fdi.h new file +22
-0@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2020 Intel Corporation +*/ + +#ifndef _INTEL_FDI_H_ +#define _INTEL_FDI_H_ + +struct drm_i915_private ; +struct intel_crtc ; +struct intel_crtc_state ; + +#define I915_DISPLAY_CONFIG_RETRY 1 +int ilk_fdi_compute_config (struct intel_crtc *intel_crtc, +struct intel_crtc_state *pipe_config); +void intel_fdi_normal_train (struct intel_crtc *crtc); +void ilk_fdi_disable (struct intel_crtc *crtc); +void ilk_fdi_pll_disable (struct intel_crtc *intel_crtc); +void ilk_fdi_pll_enable (const struct intel_crtc_state *crtc_state); +void intel_fdi_init_hook (struct drm_i915_private *dev_priv); + +#endif
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Dave Airlie
maintainerRe: [Intel-gfx] [PATCH 06/11] drm/i915: migrate skl planes code new file (v3)
In reply to Ville SyrjäläQuoted 39 lines · Ville Syrjälä
Quoted 18 lines · Jani Nikula
From: Dave Airlie <[email protected]>
Rework the plane init calls to do the gen test one level higher.
Rework some of the plane helpers so they can live in new file, there is still some scope to clean up the plane/fb interactions later.
v2: drop atomic code back, rename file to Ville suggestions, add header file.
v3: move scaler bits backSigned-off-by Dave Airlie <[email protected]>[Jani: fixed up sparse warnings.]Signed-off-by Jani Nikula <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>---
<snip>
drivers/gpu/drm/i915/display/intel_display.c intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, · line 2903
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-10-unsigned int -intel_plane_fence_y_offset (const struct intel_plane_state *plane_state) -{ -int x =0 , y =0 ; - -intel_plane_adjust_aligned_offset (&x, &y, plane_state,0 , - plane_state->color_plane[0 ].offset,0 ); - -return y; -}This getting moved around is messing up the diff.
<snip>
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0@@ -4386,15 +3633,6 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,return 0 ; }
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, · line 4396
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-8-void skl_scaler_disable (const struct intel_crtc_state *old_crtc_state) -{ -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc); -int i; - -for (i =0 ; i < crtc->num_scalers; i++) -skl_detach_scaler (crtc, i); -}Same here.
Wierd not sure how to generate it better.
Quoted 13 lines
<snip>
drivers/gpu/drm/i915/display/intel_dp_mst.c line 42
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +1
-0@@ -39,6 +39,7 @@#include "intel_dp_mst.h" #include "intel_dpio_phy.h" #include "intel_hdcp.h" +#include "skl_universal_plane.h" Why is this here?
Not sure, probably left over from moving scaler, dropped it now.
Quoted 15 lines
drivers/gpu/drm/i915/display/intel_psr.c line 34
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_dp_mst.c +0
-0static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state,drivers/gpu/drm/i915/display/intel_psr.c +1
-0@@ -31,6 +31,7 @@#include "intel_psr.h" #include "intel_sprite.h" #include "intel_hdmi.h" +#include "skl_universal_plane.h" Is this due to the psr damage stuff?
intel_psr2_program_plane_sel_fetch calls skl_calc_main_surface_offset
Quoted 14 lines
<snip>
drivers/gpu/drm/i915/display/vlv_dsi.c line 41
Quoted 9 lines
drivers/gpu/drm/i915/display/vlv_dsi.c +1
-0@@ -38,6 +38,7 @@#include "intel_fifo_underrun.h" #include "intel_panel.h" #include "intel_sideband.h" +#include "skl_universal_plane.h" Why do we need this here?
Oops as well, dropped it.
Dave.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx