Skip to content
  1. Jan 26, 2021
  2. Jan 22, 2021
    • Radhakrishna Sripada's avatar
      drm/i915/tgl: Add Clear Color support for TGL Render Decompression · d1e2775e
      Radhakrishna Sripada authored
      
      
      Render Decompression is supported with Y-Tiled main surface. The CCS is
      linear and has 4 bits of data for each main surface cache line pair, a
      ratio of 1:256. Additional Clear Color information is passed from the
      user-space through an offset in the GEM BO. Add a new modifier to identify
      and parse new Clear Color information and extend Gen12 render decompression
      functionality to the newly added modifier.
      
      v2: Fix has_alpha flag for modifiers, omit CC modifier during initial
          plane config(Matt). Fix Lookup error.
      v3: Fix the panic while running kms_cube
      v4: Add alignment check and reuse the comments for ge12_ccs_formats(Matt)
      v5: Fix typos and wrap comments(Matt)
      v6:
      - Use format block descriptors to get the subsampling calculations for
        the CCS surface right.
      - Use helpers to convert between main and CCS surfaces.
      - Prevent coordinate checks for the CC surface.
      - Simplify reading CC value from surface map, add description of CC val
        layout.
      - Remove redundant ccval variable from skl_program_plane().
      v7:
      - Move the CC value readout after syncing against any GPU write on the
        FB obj (Nanley, Chris)
      - Make sure the CC value readout works on platforms w/o struct pages
        (dGFX) and other non-coherent platforms wrt. CPU reads (none atm).
        (Chris)
      v8:
      - Rebase on the function param order change of
        i915_gem_object_read_from_page().
      - Clarify code comment on the clear color value format and the required
        FB obj pinning/syncing by the caller.
      - Remove redundant variables in
        intel_atomic_prepare_plane_clear_colors().
      v9:
      - Fix s/sizeof(&ccval)/sizeof(ccval)/ typo.
      
      Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Cc: Ville Syrjala <ville.syrjala@intel.com>
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Rafael Antognolli <rafael.antognolli@intel.com>
      Cc: Nanley G Chery <nanley.g.chery@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210115213952.1040398-1-imre.deak@intel.com
      d1e2775e
    • Imre Deak's avatar
      drm/i915/gem: Add a helper to read data from a GEM object page · 5fbc2c2b
      Imre Deak authored
      
      
      Add a simple helper to read data with the CPU from the page of a GEM
      object. Do the read either via a kmap if the object has struct pages
      or an iomap otherwise. This is needed by the next patch, reading a u64
      value from the object (w/o requiring the obj to be mapped to the GPU).
      
      Suggested by Chris.
      
      v2 (Chris):
      - Sanitize the type and order of func params.
      - Avoid consts requiring too many casts.
      - Use BUG_ON instead of WARN_ON, simplify the conditions.
      - Fix __iomem sparse errors.
      - Leave locking/syncing/pinning up to the caller, require only that the
        caller has pinned the object pages.
      - Check for iomem backing store before reading via an iomap.
      v3:
      - Fix offset passed to io_mapping_map_wc() missing a mem.region.start
        delta. (Chris, Matthew)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210120213834.1435710-1-imre.deak@intel.com
      5fbc2c2b
    • Radhakrishna Sripada's avatar
      drm/framebuffer: Format modifier for Intel Gen 12 render compression with Clear Color · 87199e4c
      Radhakrishna Sripada authored
      
      
      Gen12 display can decompress surfaces compressed by render engine with
      Clear Color, add a new modifier as the driver needs to know the surface
      was compressed by render engine.
      
      V2: Description changes as suggested by Rafael.
      V3: Mention the Clear Color size of 64 bits in the comments(DK)
      v4: Fix trailing whitespaces
      v5: Explain Clear Color in the documentation.
      v6: Documentation Nitpicks(Nanley)
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
      Cc: Rafael Antognolli <rafael.antognolli@intel.com>
      Cc: Nanley Chery <nanley.g.chery@intel.com>
      Signed-off-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Acked-by: default avatarNanley Chery <nanley.g.chery@intel.com>
      Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114201314.783648-2-imre.deak@intel.com
      87199e4c
    • Anshuman Gupta's avatar
      drm/i915/hdcp: Fix uninitialized symbol · 40a6cead
      Anshuman Gupta authored
      
      
      Move (num_hdcp_streams > 0) condition to stream_encryption()
      code block, where it actually belongs.
      This fixes the static analysis error of uninitialized symbol 'ret'.
      
      v2:
      - return 0 as the return value is already checked. [Ankit]
      
      Cc: Ramalingam C <ramalingam.c@intel.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
      Signed-off-by: default avatarAnshuman Gupta <anshuman.gupta@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210120103032.15198-1-anshuman.gupta@intel.com
      40a6cead
    • Anshuman Gupta's avatar
      drm/i915/hdcp: Fix WARN_ON(data->k > INTEL_NUM_PIPES) · 7fde594f
      Anshuman Gupta authored
      
      
      Initialize no. of streams transmitted on a port to zero
      such that intel_hdcp_required_content_stream() can
      prepared the content stream after subsequemt attmept to
      enable hdcp after a HDCP failure.
      
      v2:
      - Initialize k at top level instead of else branch. [Jani]
      
      Cc: Ramalingam C <ramalingam.c@intel.com>
      Signed-off-by: default avatarAnshuman Gupta <anshuman.gupta@intel.com>
      Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210119064655.1605-2-anshuman.gupta@intel.com
      7fde594f
    • Lyude Paul's avatar
      drm/i915/dp: Don't use DPCD backlights that need PWM enable/disable · fe7d52bc
      Lyude Paul authored
      
      
      We haven't yet implemented support for backlights that need to be
      enabled/disabled via PWM instead of AUX, which means we'll break things if
      we enable DPCD backlight control on these machines. Luckily though since
      most of these machines work fine just using the plain PWM backlight
      controls anyway, there shouldn't be any issue with just leaving DPCD
      backlight controls disabled in such situations.
      
      This should fix the issues with PWM being left on that were being observed
      on fi-bdw-samus.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatar"Ville Syrjälä" <ville.syrjala@linux.intel.com>
      Fixes: 4a8d7990 ("drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now)")
      Testcase: igt/gem_exec_suspend/basic-s0 # fi-bdw-samus
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210121183644.2627282-1-lyude@redhat.com
      fe7d52bc
    • Ville Syrjälä's avatar
      drm/i915: Unify the sanity checks for the buf trans tables · 85da0292
      Ville Syrjälä authored
      
      
      Get rid of the "I like my random new style best" approach and unify
      the handling for the DDI buf trans table sanity checks once again.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201207203512.1718-2-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      85da0292
    • Ville Syrjälä's avatar
      drm/i915: Fix ICL MG PHY vswing handling · 5ec34647
      Ville Syrjälä authored
      The MH PHY vswing table does have all the entries these days. Get
      rid of the old hacks in the code which claim otherwise.
      
      This hack was totally bogus anyway. The correct way to handle the
      lack of those two entries would have been to declare our max
      vswing and pre-emph to both be level 2.
      
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Cc: Clinton Taylor <clinton.a.taylor@intel.com>
      Fixes: 9f7ffa29
      
       ("drm/i915/tc/icl: Update TC vswing tables")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201207203512.1718-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      5ec34647
  3. Jan 21, 2021
  4. Jan 20, 2021
    • Lyude Paul's avatar
      drm/dp: Revert "drm/dp: Introduce EDID-based quirks" · 7c553f8b
      Lyude Paul authored
      This reverts commit 0883ce81
      
      . Originally
      these quirks were added because of the issues with using the eDP
      backlight interfaces on certain laptop panels, which made it impossible
      to properly probe for DPCD backlight support without having a whitelist
      for panels that we know have working VESA backlight control interfaces
      over DPCD. As well, it should be noted it was impossible to use the
      normal sink OUI for recognizing these panels as none of them actually
      filled out their OUIs, hence needing to resort to checking EDIDs.
      
      At the time we weren't really sure why certain panels had issues with
      DPCD backlight controls, but we eventually figured out that there was a
      second interface that these problematic laptop panels actually did work
      with and advertise properly: Intel's proprietary backlight interface for
      HDR panels. So far the testing we've done hasn't brought any panels to
      light that advertise this interface and don't support it properly, which
      means we finally have a real solution to this problem.
      
      As a result, we now have no need for the force DPCD backlight quirk, and
      furthermore this also removes the need for any kind of EDID quirk
      checking in DRM. So, let's just revert it for now since we were the only
      driver using this.
      
      v3:
      * Rebase
      v2:
      * Fix indenting error picked up by checkpatch in
        intel_edp_init_connector()
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Cc: thaytan@noraisin.net
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-6-lyude@redhat.com
      7c553f8b
    • Lyude Paul's avatar
      drm/i915/dp: Allow forcing specific interfaces through enable_dpcd_backlight · 2227816e
      Lyude Paul authored
      
      
      Since we now support controlling panel backlights through DPCD using
      both the standard VESA interface, and Intel's proprietary HDR backlight
      interface, we should allow the user to be able to explicitly choose
      between one or the other in the event that we're wrong about panels
      reliably reporting support for the Intel HDR interface.
      
      So, this commit adds support for this by introducing two new
      enable_dpcd_backlight options: 2 which forces i915 to only probe for the
      VESA interface, and 3 which forces i915 to only probe for the Intel
      backlight interface (might be useful if we find panels in the wild that
      report the VESA interface in their VBT, but actually only support the
      Intel backlight interface).
      
      v3:
      * Rebase
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Cc: thaytan@noraisin.net
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-5-lyude@redhat.com
      2227816e
    • Lyude Paul's avatar
      drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now) · 4a8d7990
      Lyude Paul authored
      
      
      So-recently a bunch of laptops on the market have started using DPCD
      backlight controls instead of the traditional DDI backlight controls.
      Originally we thought we had this handled by adding VESA backlight
      control support to i915, but the story ended up being a lot more
      complicated then that.
      
      Simply put-there's two main backlight interfaces Intel can see in the
      wild. Intel's proprietary HDR backlight interface, and the standard VESA
      backlight interface. Note that many panels have been observed to report
      support for both backlight interfaces, but testing has shown far more
      panels work with the Intel HDR backlight interface at the moment.
      Additionally, the VBT appears to be capable of reporting support for the
      VESA backlight interface but not the Intel HDR interface which needs to
      be probed by setting the right magic OUI.
      
      On top of that however, there's also actually two different variants of
      the Intel HDR backlight interface. The first uses the AUX channel for
      controlling the brightness of the screen in both SDR and HDR mode, and
      the second only uses the AUX channel for setting the brightness level in
      HDR mode - relying on PWM for setting the brightness level in SDR mode.
      
      For the time being we've been using EDIDs to maintain a list of quirks
      for panels that safely do support the VESA backlight interface. Adding
      support for Intel's HDR backlight interface in addition however, should
      finally allow us to auto-detect eDP backlight controls properly so long
      as we probe like so:
      
      * If the panel's VBT reports VESA backlight support, assume it really
        does support it
      * If the panel's VBT reports DDI backlight controls:
        * First probe for Intel's HDR backlight interface
        * If that fails, probe for VESA's backlight interface
        * If that fails, assume no DPCD backlight control
      * If the panel's VBT reports any other backlight type: just assume it
        doesn't have DPCD backlight controls
      
      Changes since v4:
      * Fix checkpatch issues
      Changes since v3:
      * Stop using drm_device and use drm_i915_private instead
      * Don't forget to return from intel_dp_aux_hdr_get_backlight() if we fail
        to read the current backlight mode from the DPCD
      * s/uint8_t/u8/
      * Remove unneeded parenthesis in intel_dp_aux_hdr_enable_backlight()
      * Use drm_dbg_kms() in intel_dp_aux_init_backlight_funcs()
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Cc: thaytan@noraisin.net
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-4-lyude@redhat.com
      4a8d7990
    • Lyude Paul's avatar
      drm/i915: Keep track of pwm-related backlight hooks separately · a575c00e
      Lyude Paul authored
      
      
      Currently, every different type of backlight hook that i915 supports is
      pretty straight forward - you have a backlight, probably through PWM
      (but maybe DPCD), with a single set of platform-specific hooks that are
      used for controlling it.
      
      HDR backlights, in particular VESA and Intel's HDR backlight
      implementations, can end up being more complicated. With Intel's
      proprietary interface, HDR backlight controls always run through the
      DPCD. When the backlight is in SDR backlight mode however, the driver
      may need to bypass the TCON and control the backlight directly through
      PWM.
      
      So, in order to support this we'll need to split our backlight callbacks
      into two groups: a set of high-level backlight control callbacks in
      intel_panel, and an additional set of pwm-specific backlight control
      callbacks. This also implies a functional changes for how these
      callbacks are used:
      
      * We now keep track of two separate backlight level ranges, one for the
        high-level backlight, and one for the pwm backlight range
      * We also keep track of backlight enablement and PWM backlight
        enablement separately
      * Since the currently set backlight level might not be the same as the
        currently programmed PWM backlight level, we stop setting
        panel->backlight.level with the currently programmed PWM backlight
        level in panel->backlight.pwm_funcs->setup(). Instead, we rely
        on the higher level backlight control functions to retrieve the
        current PWM backlight level (in this case, intel_pwm_get_backlight()).
        Note that there are still a few PWM backlight setup callbacks that
        do actually need to retrieve the current PWM backlight level, although
        we no longer save this value in panel->backlight.level like before.
      
      Additionally, we drop the call to lpt_get_backlight() in
      lpt_setup_backlight(), and avoid unconditionally writing the PWM value that
      we get from it and only write it back if we're in CPU mode, and switching
      to PCH mode. The reason for this is because in the original codepath for
      this, it was expected that the intel_panel_bl_funcs->setup() hook would be
      responsible for fetching the initial backlight level. On lpt systems, the
      only time we could ever be in PCH backlight mode is during the initial
      driver load - meaning that outside of the setup() hook, lpt_get_backlight()
      will always be the callback used for retrieving the current backlight
      level. After this patch we still need to fetch and write-back the PCH
      backlight value if we're switching from CPU mode to PCH, but because
      intel_pwm_setup_backlight() will retrieve the backlight level after setup()
      using the get() hook, which always ends up being lpt_get_backlight(). Thus
      - an additional call to lpt_get_backlight() in lpt_setup_backlight() is
      made redundant.
      
      v9:
      * Drop the intel_panel_invert_pwm_level() call in lpt_setup_backlight()
      * Remove leftover detritus from lpt_setup_backlight()
      v8:
      * Go back to getting initial brightness level with
        intel_pwm_get_backlight(), the other fix we had was definitely wrong.
      v7:
      * Use panel->backlight.pwm_funcs->get() to get the backlight level in
        intel_pwm_setup_backlight(), lest we upset lockdep
      * Rebase
      * Rename intel_panel_sanitize_pwm_level() to intel_panel_invert_pwm_level()
      v6:
      * Make sure to grab connection_mutex before calling
        intel_pwm_get_backlight() in intel_pwm_setup_backlight()
      v5:
      * Fix indenting warnings from checkpatch
      v4:
      * Fix commit message
      * Remove outdated comment in intel_panel.c
      * Rename pwm_(min|max) to pwm_level_(min|max)
      * Use intel_pwm_get_backlight() in intel_pwm_setup_backlight() instead of
        indirection
      * Don't move intel_dp_aux_init_bcklight_funcs() call to bottom of
        intel_panel_init_backlight_funcs() quite yet
      v3:
      * Reuse intel_panel_bl_funcs() for pwm_funcs
      * Explain why we drop lpt_get_backlight()
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Cc: thaytan@noraisin.net
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-3-lyude@redhat.com
      a575c00e
    • Ville Syrjälä's avatar
      drm/i915: Reuse the async_flip() hook for the async flip disable w/a · 68fd1faa
      Ville Syrjälä authored
      
      
      On some platforms we need to trigger an extra async flip with
      the async flip bit disabled, and then wait for the next vblank
      until the async flip bit off state will actually latch.
      
      Currently the w/a is just open coded for skl+ universal planes.
      Instead of doing that lets reuse the .async_flip() hook for this
      purpose since it needs to write the exact same set of registers.
      In order to do this we'll just have the caller pass in the state
      of the async flip bit explicitly.
      
      Cc: Karthik B S <karthik.b.s@intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210111163711.12913-8-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarKarthik B S <karthik.b.s@intel.com>
      68fd1faa
    • Ville Syrjälä's avatar
      drm/i915: Move the async_flip bit setup into the .async_flip() hook · 6cc3bb75
      Ville Syrjälä authored
      
      
      Set up the async flip PLANE_CTL bit directly in the
      .async_flip() hook. Neither .update_plane() nor .disable_plane()
      ever need to set this so having it done by skl_plane_ctl_crtc()
      is rather pointless.
      
      Cc: Karthik B S <karthik.b.s@intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210111163711.12913-7-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarKarthik B S <karthik.b.s@intel.com>
      6cc3bb75
    • Ville Syrjälä's avatar
      drm/i915: Add plane vfuncs to enable/disable flip_done interrupt · 8693ee2e
      Ville Syrjälä authored
      
      
      Prepare for more platforms with async flip support by turning
      the flip_done interrupt enable/disable into plane vfuncs.
      
      Cc: Karthik B S <karthik.b.s@intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210111163711.12913-6-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarKarthik B S <karthik.b.s@intel.com>
      8693ee2e
    • Ville Syrjälä's avatar
      drm/i915: Generalize the async flip capability check · 30b61720
      Ville Syrjälä authored
      
      
      Only assign the plane->async_flip() vfunc when the plane supports
      async flips. For now we keep this artificially limited to the primary
      plane since thats the only thing the legacy page flip uapi can target
      and there is no async flip support in the atomic uapi yet.
      
      Cc: Karthik B S <karthik.b.s@intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210111163711.12913-5-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarKarthik B S <karthik.b.s@intel.com>
      30b61720
    • Ville Syrjälä's avatar
      drm/i915: Drop redundant parens · 33ef04fa
      Ville Syrjälä authored
      
      
      Drop the pointless extra parens.
      
      Cc: Karthik B S <karthik.b.s@intel.com>
      Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210111163711.12913-4-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarKarthik B S <karthik.b.s@intel.com>
      33ef04fa