tree: git://people.freedesktop.org/~airlied/linux.git i915-vtable-cleanup head: b0d0061aeef594fc572295c0e3c02ba91596cbf6 commit: b0d0061aeef594fc572295c0e3c02ba91596cbf6 [12/12] drm/i915/display: constify the audio functions config: i386-allyesconfig (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): git remote add drm git://people.freedesktop.org/~airlied/linux.git git fetch --no-tags drm i915-vtable-cleanup git checkout b0d0061aeef594fc572295c0e3c02ba91596cbf6 # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): drivers/gpu/drm/i915/display/intel_audio.c: In function 'intel_audio_codec_enable': drivers/gpu/drm/i915/display/intel_audio.c:852:24: error: 'dev_priv->audio_funcs' is a pointer; did you mean to use '->'? 852 | dev_priv->audio_funcs.audio_codec_enable(encoder, | ^ | -> drivers/gpu/drm/i915/display/intel_audio.c: In function 'intel_audio_codec_disable': drivers/gpu/drm/i915/display/intel_audio.c:897:24: error: 'dev_priv->audio_funcs' is a pointer; did you mean to use '->'? 897 | dev_priv->audio_funcs.audio_codec_disable(encoder, | ^ | -> drivers/gpu/drm/i915/display/intel_audio.c: At top level: drivers/gpu/drm/i915/display/intel_audio.c:919:46: error: expected '}' before ';' token 919 | .audio_codec_enable = g4x_audio_codec_enable; | ^ drivers/gpu/drm/i915/display/intel_audio.c:918:68: note: to match this '{' 918 | static const struct drm_i915_display_audio_funcs g4x_audio_funcs = { | ^ drivers/gpu/drm/i915/display/intel_audio.c:924:46: error: expected '}' before ';' token 924 | .audio_codec_enable = ilk_audio_codec_enable; | ^ drivers/gpu/drm/i915/display/intel_audio.c:923:68: note: to match this '{' 923 | static const struct drm_i915_display_audio_funcs ilk_audio_funcs = { | ^ drivers/gpu/drm/i915/display/intel_audio.c:929:46: error: expected '}' before ';' token 929 | .audio_codec_enable = hsw_audio_codec_enable; | ^ drivers/gpu/drm/i915/display/intel_audio.c:928:68: note: to match this '{' 928 | static const struct drm_i915_display_audio_funcs hsw_audio_funcs = { | ^ >> drivers/gpu/drm/i915/display/intel_audio.c:685:13: error: 'ilk_audio_codec_disable' defined but not used [-Werror=unused-function] 685 | static void ilk_audio_codec_disable(struct intel_encoder *encoder, | ^~~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/i915/display/intel_audio.c:486:13: error: 'hsw_audio_codec_disable' defined but not used [-Werror=unused-function] 486 | static void hsw_audio_codec_disable(struct intel_encoder *encoder, | ^~~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/i915/display/intel_audio.c:323:13: error: 'g4x_audio_codec_disable' defined but not used [-Werror=unused-function] 323 | static void g4x_audio_codec_disable(struct intel_encoder *encoder, | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors vim +/ilk_audio_codec_disable +685 drivers/gpu/drm/i915/display/intel_audio.c 12e87f23c6278ed drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2016-10-10 485 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 @486 static void hsw_audio_codec_disable(struct intel_encoder *encoder, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 487 const struct intel_crtc_state *old_crtc_state, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 488 const struct drm_connector_state *old_conn_state) 69bfe1a9b4dffca drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 489 { fac5e23e3c385fd drivers/gpu/drm/i915/intel_audio.c Chris Wilson 2016-07-04 490 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 491 enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; c25004964c5a8a0 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2018-06-12 492 u32 tmp; 69bfe1a9b4dffca drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 493 6385514932d5fc9 drivers/gpu/drm/i915/display/intel_audio.c Wambui Karuga 2020-01-21 494 drm_dbg_kms(&dev_priv->drm, "Disable audio codec on transcoder %s\n", 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 495 transcoder_name(cpu_transcoder)); 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 496 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 497 mutex_lock(&dev_priv->av_mutex); 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 498 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 499 /* Disable timestamps */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 500 tmp = intel_de_read(dev_priv, HSW_AUD_CFG(cpu_transcoder)); 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 501 tmp &= ~AUD_CONFIG_N_VALUE_INDEX; 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 502 tmp |= AUD_CONFIG_N_PROG_ENABLE; 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 503 tmp &= ~AUD_CONFIG_UPPER_N_MASK; 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 504 tmp &= ~AUD_CONFIG_LOWER_N_MASK; 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 505 if (intel_crtc_has_dp_encoder(old_crtc_state)) 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 506 tmp |= AUD_CONFIG_N_VALUE_INDEX; 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 507 intel_de_write(dev_priv, HSW_AUD_CFG(cpu_transcoder), tmp); 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 508 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 509 /* Invalidate ELD */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 510 tmp = intel_de_read(dev_priv, HSW_AUD_PIN_ELD_CP_VLD); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 511 tmp &= ~AUDIO_ELD_VALID(cpu_transcoder); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 512 tmp &= ~AUDIO_OUTPUT_ENABLE(cpu_transcoder); 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 513 intel_de_write(dev_priv, HSW_AUD_PIN_ELD_CP_VLD, tmp); 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 514 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 515 mutex_unlock(&dev_priv->av_mutex); 69bfe1a9b4dffca drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 516 } 69bfe1a9b4dffca drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 517 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 518 static unsigned int calc_hblank_early_prog(struct intel_encoder *encoder, 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 519 const struct intel_crtc_state *crtc_state) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 520 { 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 521 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 522 unsigned int link_clks_available, link_clks_required; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 523 unsigned int tu_data, tu_line, link_clks_active; d19b29be653691a drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 524 unsigned int h_active, h_total, hblank_delta, pixel_clk; d19b29be653691a drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 525 unsigned int fec_coeff, cdclk, vdsc_bpp; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 526 unsigned int link_clk, lanes; 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 527 unsigned int hblank_rise; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 528 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 529 h_active = crtc_state->hw.adjusted_mode.crtc_hdisplay; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 530 h_total = crtc_state->hw.adjusted_mode.crtc_htotal; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 531 pixel_clk = crtc_state->hw.adjusted_mode.crtc_clock; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 532 vdsc_bpp = crtc_state->dsc.compressed_bpp; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 533 cdclk = i915->cdclk.hw.cdclk; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 534 /* fec= 0.972261, using rounding multiplier of 1000000 */ 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 535 fec_coeff = 972261; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 536 link_clk = crtc_state->port_clock; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 537 lanes = crtc_state->lane_count; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 538 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 539 drm_dbg_kms(&i915->drm, "h_active = %u link_clk = %u :" 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 540 "lanes = %u vdsc_bpp = %u cdclk = %u\n", 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 541 h_active, link_clk, lanes, vdsc_bpp, cdclk); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 542 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 543 if (WARN_ON(!link_clk || !pixel_clk || !lanes || !vdsc_bpp || !cdclk)) 11ebc2321b8ef88 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-04-20 544 return 0; 11ebc2321b8ef88 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-04-20 545 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 546 link_clks_available = (h_total - h_active) * link_clk / pixel_clk - 28; 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 547 link_clks_required = DIV_ROUND_UP(192000 * h_total, 1000 * pixel_clk) * (48 / lanes + 2); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 548 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 549 if (link_clks_available > link_clks_required) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 550 hblank_delta = 32; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 551 else 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 552 hblank_delta = DIV64_U64_ROUND_UP(mul_u32_u32(5 * (link_clk + cdclk), pixel_clk), 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 553 mul_u32_u32(link_clk, cdclk)); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 554 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 555 tu_data = div64_u64(mul_u32_u32(pixel_clk * vdsc_bpp * 8, 1000000), 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 556 mul_u32_u32(link_clk * lanes, fec_coeff)); 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 557 tu_line = div64_u64(h_active * mul_u32_u32(link_clk, fec_coeff), 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 558 mul_u32_u32(64 * pixel_clk, 1000000)); 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 559 link_clks_active = (tu_line - 1) * 64 + tu_data; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 560 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 561 hblank_rise = (link_clks_active + 6 * DIV_ROUND_UP(link_clks_active, 250) + 4) * pixel_clk / link_clk; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 562 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 563 return h_active - hblank_rise + hblank_delta; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 564 } 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 565 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 566 static unsigned int calc_samples_room(const struct intel_crtc_state *crtc_state) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 567 { 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 568 unsigned int h_active, h_total, pixel_clk; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 569 unsigned int link_clk, lanes; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 570 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 571 h_active = crtc_state->hw.adjusted_mode.hdisplay; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 572 h_total = crtc_state->hw.adjusted_mode.htotal; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 573 pixel_clk = crtc_state->hw.adjusted_mode.clock; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 574 link_clk = crtc_state->port_clock; 41ee86d6ee82060 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 575 lanes = crtc_state->lane_count; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 576 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 577 return ((h_total - h_active) * link_clk - 12 * pixel_clk) / 2dd43144e824aff drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2020-04-29 578 (pixel_clk * (48 / lanes + 2)); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 579 } 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 580 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 581 static void enable_audio_dsc_wa(struct intel_encoder *encoder, 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 582 const struct intel_crtc_state *crtc_state) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 583 { 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 584 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 585 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 586 enum pipe pipe = crtc->pipe; 11ebc2321b8ef88 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-04-20 587 unsigned int hblank_early_prog, samples_room; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 588 unsigned int val; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 589 005e95377249cb6 drivers/gpu/drm/i915/display/intel_audio.c Matt Roper 2021-03-19 590 if (DISPLAY_VER(i915) < 11) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 591 return; 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 592 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 593 val = intel_de_read(i915, AUD_CONFIG_BE); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 594 93e7e61eb448318 drivers/gpu/drm/i915/display/intel_audio.c Lucas De Marchi 2021-04-12 595 if (DISPLAY_VER(i915) == 11) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 596 val |= HBLANK_EARLY_ENABLE_ICL(pipe); 005e95377249cb6 drivers/gpu/drm/i915/display/intel_audio.c Matt Roper 2021-03-19 597 else if (DISPLAY_VER(i915) >= 12) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 598 val |= HBLANK_EARLY_ENABLE_TGL(pipe); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 599 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 600 if (crtc_state->dsc.compression_enable && 31824c03faac432 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 601 crtc_state->hw.adjusted_mode.hdisplay >= 3840 && 31824c03faac432 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 602 crtc_state->hw.adjusted_mode.vdisplay >= 2160) { 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 603 /* Get hblank early enable value required */ 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 604 val &= ~HBLANK_START_COUNT_MASK(pipe); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 605 hblank_early_prog = calc_hblank_early_prog(encoder, crtc_state); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 606 if (hblank_early_prog < 32) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 607 val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_32); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 608 else if (hblank_early_prog < 64) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 609 val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_64); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 610 else if (hblank_early_prog < 96) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 611 val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_96); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 612 else 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 613 val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_128); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 614 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 615 /* Get samples room value required */ 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 616 val &= ~NUMBER_SAMPLES_PER_LINE_MASK(pipe); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 617 samples_room = calc_samples_room(crtc_state); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 618 if (samples_room < 3) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 619 val |= NUMBER_SAMPLES_PER_LINE(pipe, samples_room); f4c50deecaed632 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2021-05-04 620 else /* Program 0 i.e "All Samples available in buffer" */ 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 621 val |= NUMBER_SAMPLES_PER_LINE(pipe, 0x0); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 622 } 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 623 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 624 intel_de_write(i915, AUD_CONFIG_BE, val); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 625 } 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 626 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 627 #undef ROUNDING_FACTOR 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 628 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 629 static void hsw_audio_codec_enable(struct intel_encoder *encoder, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 630 const struct intel_crtc_state *crtc_state, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 631 const struct drm_connector_state *conn_state) 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 632 { 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 633 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 634 struct drm_connector *connector = conn_state->connector; 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 635 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; c25004964c5a8a0 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2018-06-12 636 const u8 *eld = connector->eld; c25004964c5a8a0 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2018-06-12 637 u32 tmp; f9f682ae3530f92 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 638 int len, i; 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 639 6385514932d5fc9 drivers/gpu/drm/i915/display/intel_audio.c Wambui Karuga 2020-01-21 640 drm_dbg_kms(&dev_priv->drm, 6385514932d5fc9 drivers/gpu/drm/i915/display/intel_audio.c Wambui Karuga 2020-01-21 641 "Enable audio codec on transcoder %s, %u bytes ELD\n", 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 642 transcoder_name(cpu_transcoder), drm_eld_size(eld)); 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 643 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 644 mutex_lock(&dev_priv->av_mutex); 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 645 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 646 /* Enable Audio WA for 4k DSC usecases */ 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 647 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP)) 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 648 enable_audio_dsc_wa(encoder, crtc_state); 48b8b04c791d1e3 drivers/gpu/drm/i915/display/intel_audio.c Uma Shankar 2020-04-16 649 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 650 /* Enable audio presence detect, invalidate ELD */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 651 tmp = intel_de_read(dev_priv, HSW_AUD_PIN_ELD_CP_VLD); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 652 tmp |= AUDIO_OUTPUT_ENABLE(cpu_transcoder); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 653 tmp &= ~AUDIO_ELD_VALID(cpu_transcoder); 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 654 intel_de_write(dev_priv, HSW_AUD_PIN_ELD_CP_VLD, tmp); 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 655 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 656 /* 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 657 * FIXME: We're supposed to wait for vblank here, but we have vblanks 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 658 * disabled during the mode set. The proper fix would be to push the 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 659 * rest of the setup into a vblank work item, queued here, but the 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 660 * infrastructure is not there yet. 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 661 */ 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 662 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 663 /* Reset ELD write address */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 664 tmp = intel_de_read(dev_priv, HSW_AUD_DIP_ELD_CTRL(cpu_transcoder)); c46f111f5171b63 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 665 tmp &= ~IBX_ELD_ADDRESS_MASK; 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 666 intel_de_write(dev_priv, HSW_AUD_DIP_ELD_CTRL(cpu_transcoder), tmp); 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 667 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 668 /* Up to 84 bytes of hw ELD buffer */ 938fd8aaf5d5489 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-28 669 len = min(drm_eld_size(eld), 84); 938fd8aaf5d5489 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-28 670 for (i = 0; i < len / 4; i++) 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 671 intel_de_write(dev_priv, HSW_AUD_EDID_DATA(cpu_transcoder), 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 672 *((const u32 *)eld + i)); 69bfe1a9b4dffca drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 673 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 674 /* ELD valid */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 675 tmp = intel_de_read(dev_priv, HSW_AUD_PIN_ELD_CP_VLD); 3904fb78a80da64 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2019-04-30 676 tmp |= AUDIO_ELD_VALID(cpu_transcoder); 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 677 intel_de_write(dev_priv, HSW_AUD_PIN_ELD_CP_VLD, tmp); 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 678 5fad84a7530f8e7 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-11-04 679 /* Enable timestamps */ 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 680 hsw_audio_config_update(encoder, crtc_state); 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 681 4a21ef7d1d2b19f drivers/gpu/drm/i915/intel_audio.c Libin Yang 2015-09-02 682 mutex_unlock(&dev_priv->av_mutex); 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 683 } 7c10a2b5876e014 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 684 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 @685 static void ilk_audio_codec_disable(struct intel_encoder *encoder, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 686 const struct intel_crtc_state *old_crtc_state, 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 687 const struct drm_connector_state *old_conn_state) 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 688 { 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 689 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 2225f3c6f1d793c drivers/gpu/drm/i915/display/intel_audio.c Maarten Lankhorst 2019-10-31 690 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 691 enum pipe pipe = crtc->pipe; 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 692 enum port port = encoder->port; c25004964c5a8a0 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2018-06-12 693 u32 tmp, eldv; f0f59a00a1c9be1 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2015-11-18 694 i915_reg_t aud_config, aud_cntrl_st2; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 695 6385514932d5fc9 drivers/gpu/drm/i915/display/intel_audio.c Wambui Karuga 2020-01-21 696 drm_dbg_kms(&dev_priv->drm, 6385514932d5fc9 drivers/gpu/drm/i915/display/intel_audio.c Wambui Karuga 2020-01-21 697 "Disable audio codec on [ENCODER:%d:%s], pipe %c\n", 66a990dd0c49b53 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2019-08-30 698 encoder->base.base.id, encoder->base.name, 66a990dd0c49b53 drivers/gpu/drm/i915/display/intel_audio.c Ville Syrjälä 2019-08-30 699 pipe_name(pipe)); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 700 9a3b466bb8f60ad drivers/gpu/drm/i915/display/intel_audio.c Pankaj Bharadiya 2020-01-28 701 if (drm_WARN_ON(&dev_priv->drm, port == PORT_A)) d3902c3eba3666f drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2015-05-04 702 return; d3902c3eba3666f drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2015-05-04 703 2d1fe0734087f0d drivers/gpu/drm/i915/intel_audio.c Joonas Lahtinen 2016-04-07 704 if (HAS_PCH_IBX(dev_priv)) { 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 705 aud_config = IBX_AUD_CFG(pipe); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 706 aud_cntrl_st2 = IBX_AUD_CNTL_ST2; 666a45379e2c29b drivers/gpu/drm/i915/intel_audio.c Wayne Boyer 2015-12-09 707 } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 708 aud_config = VLV_AUD_CFG(pipe); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 709 aud_cntrl_st2 = VLV_AUD_CNTL_ST2; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 710 } else { 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 711 aud_config = CPT_AUD_CFG(pipe); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 712 aud_cntrl_st2 = CPT_AUD_CNTRL_ST2; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 713 } 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 714 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 715 /* Disable timestamps */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 716 tmp = intel_de_read(dev_priv, aud_config); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 717 tmp &= ~AUD_CONFIG_N_VALUE_INDEX; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 718 tmp |= AUD_CONFIG_N_PROG_ENABLE; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 719 tmp &= ~AUD_CONFIG_UPPER_N_MASK; 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 720 tmp &= ~AUD_CONFIG_LOWER_N_MASK; 8ec47de21bfab96 drivers/gpu/drm/i915/intel_audio.c Ville Syrjälä 2017-10-30 721 if (intel_crtc_has_dp_encoder(old_crtc_state)) 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 722 tmp |= AUD_CONFIG_N_VALUE_INDEX; 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 723 intel_de_write(dev_priv, aud_config, tmp); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 724 82910ac6d575d4c drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 725 eldv = IBX_ELD_VALID(port); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 726 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 727 /* Invalidate ELD */ 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 728 tmp = intel_de_read(dev_priv, aud_cntrl_st2); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 729 tmp &= ~eldv; 49e659bcae79ff8 drivers/gpu/drm/i915/display/intel_audio.c Jani Nikula 2020-01-24 730 intel_de_write(dev_priv, aud_cntrl_st2, tmp); 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 731 } 495a5bb81d34694 drivers/gpu/drm/i915/intel_audio.c Jani Nikula 2014-10-27 732 :::::: The code at line 685 was first introduced by commit :::::: 8ec47de21bfab96790c4202ae8cdb5092ad7ec33 drm/i915: Pass around crtc and connector states for audio :::::: TO: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> :::::: CC: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip