1. 25 Sep, 2019 1 commit
    • Maarten Lankhorst's avatar
      drm/i915/dp: Fix dsc bpp calculations, v5. · ed06efb8
      Maarten Lankhorst authored
      
      
      There was a integer wraparound when mode_clock became too high,
      and we didn't correct for the FEC overhead factor when dividing,
      with the calculations breaking at HBR3.
      
      As a result our calculated bpp was way too high, and the link width
      limitation never came into effect.
      
      Print out the resulting bpp calcululations as a sanity check, just
      in case we ever have to debug it later on again.
      
      We also used the wrong factor for FEC. While bspec mentions 2.4%,
      all the calculations use 1/0.972261, and the same ratio should be
      applied to data M/N as well, so use it there when FEC is enabled.
      
      This fixes the FIFO underrun we are seeing with FEC enabled.
      
      Changes since v2:
      - Handle fec_enable in intel_link_compute_m_n, so only data M/N is adjusted. (Ville)
      - Fix initial hardware readout for FEC. (Ville)
      Changes since v3:
      - Remove bogus fec_to_mode_clock. (Ville)
      Changes since v4:
      - Use the correct register for icl. (Ville)
      - Split hw readout to a separate patch.
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: d9218c8f ("drm/i915/dp: Add helpers for Compressed BPP and Slice Count for DSC")
      Cc: <stable@vger.kernel.org> # v5.0+
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190925082110.17439-1-maarten.lankhorst@linux.intel.com
      
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      ed06efb8
  2. 20 Sep, 2019 1 commit
  3. 19 Sep, 2019 1 commit
    • Ville Syrjälä's avatar
      drm/i915: Don't advertise modes that exceed the max plane size · 2d20411e
      Ville Syrjälä authored
      
      
      Modern platforms allow the transcoders hdisplay/vdisplay to exceed the
      planes' max resolution. This has the nasty implication that modes on the
      connectors' mode list may not be usable when the user asks for a
      fullscreen plane. Seeing as that is the most common use case it seems
      prudent to filter out modes that don't allow for fullscreen planes to
      be enabled.
      
      Let's do that in the connetor .mode_valid() hook so that normally
      such modes are kept hidden but the user is still able to forcibly
      specify such a mode if they know they don't need fullscreen planes.
      
      This is in line with ealier policies regarding certain clock limits.
      The idea is to prevent the casual user from encountering a mode that
      would fail under typical conditions, but allow the expert user to
      force things if they so wish.
      
      Maybe in the future we should consider automagically using two
      planes when one can't cover the entire screen? Wouldn't be a
      great match for the current uapi with explicit planes though,
      but I guess no worse than using two pipes (which we apparently
      have to in the future anyway). Either that or we'd have to
      teach userspace to do it for us.
      
      v2: Fix icl+ max plane heigth (Manasi)
      
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Leho Kraav <leho@kraav.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190918150707.32420-1-ville.syrjala@linux.intel.com
      2d20411e
  4. 05 Sep, 2019 1 commit
  5. 02 Sep, 2019 1 commit
  6. 30 Aug, 2019 1 commit
  7. 28 Aug, 2019 1 commit
  8. 27 Aug, 2019 1 commit
  9. 22 Aug, 2019 1 commit
  10. 21 Aug, 2019 3 commits
  11. 16 Aug, 2019 1 commit
  12. 09 Aug, 2019 1 commit
  13. 07 Aug, 2019 2 commits
  14. 26 Jul, 2019 1 commit
    • Gustavo A. R. Silva's avatar
      drm/i915: Mark expected switch fall-throughs · 2defb94e
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/gpu/drm/i915/gem/i915_gem_mman.c: In function ‘i915_gem_fault’:
      drivers/gpu/drm/i915/gem/i915_gem_mman.c:342:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (!i915_terminally_wedged(i915))
            ^
      drivers/gpu/drm/i915/gem/i915_gem_mman.c:345:2: note: here
        case -EAGAIN:
        ^~~~
      
      drivers/gpu/drm/i915/gem/i915_gem_pages.c: In function ‘i915_gem_object_map’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/gem/i915_gem_pages.c:270:3: note: in expansion of macro ‘MISSING_CASE’
         MISSING_CASE(type);
         ^~~~~~~~~~~~
      drivers/gpu/drm/i915/gem/i915_gem_pages.c:272:2: note: here
        case I915_MAP_WB:
        ^~~~
      
      drivers/gpu/drm/i915/i915_gpu_error.c: In function ‘error_record_engine_registers’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/i915_gpu_error.c:1196:5: note: in expansion of macro ‘MISSING_CASE’
           MISSING_CASE(engine->id);
           ^~~~~~~~~~~~
      drivers/gpu/drm/i915/i915_gpu_error.c:1197:4: note: here
          case RCS0:
          ^~~~
      
      drivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_get_fia_supported_lane_count’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/display/intel_dp.c:233:3: note: in expansion of macro ‘MISSING_CASE’
         MISSING_CASE(lane_info);
         ^~~~~~~~~~~~
      drivers/gpu/drm/i915/display/intel_dp.c:234:2: note: here
        case 1:
        ^~~~
      
      drivers/gpu/drm/i915/display/intel_display.c: In function ‘check_digital_port_conflicts’:
        CC [M]  drivers/gpu/drm/nouveau/nvkm/engine/disp/cursgv100.o
      drivers/gpu/drm/i915/display/intel_display.c:12043:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
          if (WARN_ON(!HAS_DDI(to_i915(dev))))
             ^
      drivers/gpu/drm/i915/display/intel_display.c:12046:3: note: here
         case INTEL_OUTPUT_DP:
         ^~~~
      
      Also, notice that the Makefile is modified to stop ignoring
      fall-through warnings. The -Wimplicit-fallthrough option
      will be enabled globally in v5.3.
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      2defb94e
  15. 15 Jul, 2019 2 commits
  16. 12 Jul, 2019 1 commit
  17. 11 Jul, 2019 2 commits
  18. 05 Jul, 2019 1 commit
  19. 01 Jul, 2019 3 commits
  20. 17 Jun, 2019 1 commit
  21. 12 Jun, 2019 1 commit
  22. 07 Jun, 2019 2 commits
  23. 05 Jun, 2019 1 commit
  24. 23 May, 2019 4 commits
    • Gwan-gyeong Mun's avatar
      drm/i915/dp: Support DP ports YUV 4:2:0 output to GEN11 · 47d0ccec
      Gwan-gyeong Mun authored
      
      
      Bspec describes that GEN10 only supports capability of YUV 4:2:0 output to
      HDMI port and GEN11 supports capability of YUV 4:2:0 output to both DP and
      HDMI ports.
      
      v2: Minor style fix.
      Signed-off-by: default avatarGwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190521121721.32010-7-gwan-gyeong.mun@intel.com
      47d0ccec
    • Gwan-gyeong Mun's avatar
      drm/i915/dp: Change a link bandwidth computation for DP · 16668f48
      Gwan-gyeong Mun authored
      
      
      Data M/N calculations were assumed a bpp as RGB format. But when we are
      using YCbCr 4:2:0 output format on DP, we should change bpp calculations
      as YCbCr 4:2:0 format. The pipe_bpp value was assumed RGB format,
      therefore, it was multiplied with 3. But YCbCr 4:2:0 requires a multiplier
      value to 1.5.
      Therefore we need to divide pipe_bpp to 2 while DP output uses YCbCr4:2:0
      format.
       - RGB format bpp = bpc x 3
       - YCbCr 4:2:0 format bpp = bpc x 1.5
      
      But Link M/N values are calculated and applied based on the Full Clock for
      YCbCr 4:2:0. And DP YCbCr 4:2:0 does not need to pixel clock double for
      a dotclock caluation. Only for HDMI YCbCr 4:2:0 needs to pixel clock double
      for a dot clock calculation.
      
      It only affects dp and edp port which use YCbCr 4:2:0 output format.
      And for now, it does not consider a use case of DSC + YCbCr 4:2:0.
      
      v2:
        Addressed review comments from Ville.
        Remove a changing of pipe_bpp on intel_ddi_set_pipe_settings().
        Because the pipe is running at the full bpp, keep pipe_bpp as RGB
        even though YCbCr 4:2:0 output format is used.
        Add a link bandwidth computation for YCbCr4:2:0 output format.
      
      v3:
        Addressed reivew comments from Ville.
        In order to make codes simple, it adds and uses intel_dp_output_bpp()
        function.
      
      v6:
        Link M/N values are calculated and applied based on the Full Clock for
        YCbCr420. The Bit per Pixel needs to be adjusted for YUV420 mode as it
        requires only half of the RGB case.
          - Link M/N values are calculated and applied based on the Full Clock
          - Data M/N values needs to be calculated considering the data is half
            due to subsampling
        Remove a doubling of pixel clock on a dot clock calculator for
        DP YCbCr 4:2:0.
        Rebase and remove a duplicate setting of vsc_sdp.DB17.
        Add a setting of dynamic range bit to  vsc_sdp.DB17.
        Change Content Type bit to "Graphics" from "Not defined".
        Change a dividing of pipe_bpp to muliplying to constant values on a
        switch-case statement.
      
      v7:
        Addressed review comments from Ville.
        Move a setting of dynamic range bit and a setting of bpc which is based
        on pipe_bpp to a "drm/i915/dp: Program VSC Header and DB for Pixel
        Encoding/Colorimetry Format" commit.
        Change Content Type bit to "Not defined" from "Graphics".
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarGwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190521121721.32010-6-gwan-gyeong.mun@intel.com
      16668f48
    • Gwan-gyeong Mun's avatar
      drm/i915/dp: Program VSC Header and DB for Pixel Encoding/Colorimetry Format · 3c053a96
      Gwan-gyeong Mun authored
      
      
      Function intel_pixel_encoding_setup_vsc handles vsc header and data block
      setup for pixel encoding / colorimetry format.
      
      Setup VSC header and data block in function intel_pixel_encoding_setup_vsc
      for pixel encoding / colorimetry format as per dp 1.4a spec,
      section 2.2.5.7.1, table 2-119: VSC SDP Header Bytes, section 2.2.5.7.5,
      table 2-120:VSC SDP Payload for DB16 through DB18.
      
      v2:
        Minor style fix. [Maarten]
        Refer to commit ids instead of patchwork. [Maarten]
      
      v6: Rebase
      
      v7:
        Rebase and addressed review comments from Ville.
        Use a structure initializer instead of memset().
        Fix non-standard comment format.
        Remove a referring to specific commit.
        Add a setting of dynamic range bit to  vsc_sdp.DB17.
        Add a setting of bpc which is based on pipe_bpp.
        Remove duplicated checking of connector's ycbcr_420_allowed from
        intel_pixel_encoding_setup_vsc(). It is already checked from
        intel_dp_ycbcr420_config().
        Remove comments for VSC_SDP_EXTENSION_FOR_COLORIMETRY_SUPPORTED. It is
        already implemented on intel_dp_get_colorimetry_status().
      
      v8:
        A missing of setting bpc to VSC setup is the pretty fatal case, it
        replaces DRM_DEBUG_KMS() to MISSING_CASE(). [Maarten]
      
      v9: Use a changed member name of struct dp_sdp. it renamed to db from DB.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarGwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190521121721.32010-4-gwan-gyeong.mun@intel.com
      3c053a96
    • Gwan-gyeong Mun's avatar
      drm/i915/dp: Add a config function for YCBCR420 outputs · 8e9d645c
      Gwan-gyeong Mun authored
      
      
      This patch checks a support of YCBCR420 outputs on an encoder level.
      If the input mode is YCBCR420-only mode then it prepares DP as an YCBCR420
      output, else it continues with RGB output mode.
      It set output_format to INTEL_OUTPUT_FORMAT_YCBCR420 in order to using
      a pipe scaler as RGB to YCbCr 4:4:4.
      
      v2:
        Addressed review comments from Ville.
        Style fixed with few naming.
        %s/config/crtc_state/
        %s/intel_crtc/crtc/
        If lscon is active, it makes not to call intel_dp_ycbcr420_config()
        to avoid to clobber of lspcon_ycbcr420_config() routine.
        And it move the 420_only check into the intel_dp_ycbcr420_config().
      
      v3: Fix uninitialized return value and it is reported by Dan Carpenter.
      
      v4:
        Addressed review comments from Ville.
        In order to avoid the extra indentation, it inverts if-clause on
        intel_dp_ycbcr420_config().
        Remove the error print where no errors print are allowed.
      
      v6: Rebase
      
      v7:
        Move intel_dp_get_colorimetry_status() to intel_dp from intel_psr.
        intel_dp_get_colorimetry_status() checks
        VSC_SDP_EXTENSION_FOR_COLORIMETRY_SUPPORTED bit in the
        DPRX_FEATURE_ENUMERATION_LIST register.
        And intel_dp_ycbcr420_config() uses intel_dp_get_colorimetry_status().
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarGwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190521121721.32010-2-gwan-gyeong.mun@intel.com
      8e9d645c
  25. 17 May, 2019 1 commit
  26. 14 May, 2019 4 commits