1. 20 Feb, 2019 14 commits
    • Ramalingam C's avatar
      drm/i915: Implement HDCP2.2 repeater authentication · d849178e
      Ramalingam C authored
      Implements the HDCP2.2 repeaters authentication steps such as verifying
      the downstream topology and sending stream management information.
      
      v2: Rebased.
      v3:
        -EINVAL is returned for topology error and rollover scenario.
        Endianness conversion func from drm_hdcp.h is used [Uma]
      v4:
        Rebased as part of patches reordering.
        Defined the mei service functions [Daniel]
      v5:
        Redefined the mei service functions as per comp redesign.
      v6:
        %s/uintxx_t/uxx
        Check for comp_master is removed.
      v7:
        Adjust to the new mei interface.
        style issue fixed.
      v8:
        drm_hdcp.h change is moved into separate patch [Daniel]
      v9:
        %s/__swab16/cpu_to_be16. [Tomas]
        Reviewed-by Uma.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-9-git-send-email-ramalingam.c@intel.com
      d849178e
    • Ramalingam C's avatar
      drm/i915: Implement HDCP2.2 receiver authentication · bd90d7c7
      Ramalingam C authored
      Implements HDCP2.2 authentication for hdcp2.2 receivers, with
      following steps:
      	Authentication and Key exchange (AKE).
      	Locality Check (LC).
      	Session Key Exchange(SKE).
      	DP Errata for stream type configuration for receivers.
      
      At AKE, the HDCP Receiver’s public key certificate is verified by the
      HDCP Transmitter. A Master Key k m is exchanged.
      
      At LC, the HDCP Transmitter enforces locality on the content by
      requiring that the Round Trip Time (RTT) between a pair of messages
      is not more than 20 ms.
      
      At SKE, The HDCP Transmitter exchanges Session Key ks with
      the HDCP Receiver.
      
      In DP HDCP2.2 encryption and decryption logics use the stream type as
      one of the parameter. So Before enabling the Encryption DP HDCP2.2
      receiver needs to be communicated with stream type. This is added to
      spec as ERRATA.
      
      This generic implementation is complete only with the hdcp2 specific
      functions defined at hdcp_shim.
      
      v2: Rebased.
      v3:
        %s/PARING/PAIRING
        Coding style fixing [Uma]
      v4:
        Rebased as part of patch reordering.
        Defined the functions for mei services. [Daniel]
      v5:
        Redefined the mei service functions as per comp redesign.
        Required intel_hdcp members are defined [Sean Paul]
      v6:
        Typo of cipher is Fixed [Uma]
        %s/uintxx_t/uxx
        Check for comp_master is removed.
      v7:
        Adjust to the new interface.
        Avoid using bool structure members. [Tomas]
      v8: Rebased.
      v9:
        bool is used in struct intel_hdcp [Daniel]
        config_stream_type is redesigned [Daniel]
        Reviewed-by Uma.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-8-git-send-email-ramalingam.c@intel.com
      bd90d7c7
    • Ramalingam C's avatar
      drm/i915: Enable and Disable of HDCP2.2 · 49a630b0
      Ramalingam C authored
      Considering that HDCP2.2 is more secure than HDCP1.4, When a setup
      supports HDCP2.2 and HDCP1.4, HDCP2.2 will be enabled.
      
      When HDCP2.2 enabling fails and HDCP1.4 is supported, HDCP1.4 is
      enabled.
      
      This change implements a sequence of enabling and disabling of
      HDCP2.2 authentication and HDCP2.2 port encryption.
      
      v2:
        Included few optimization suggestions [Chris Wilson]
        Commit message is updated as per the rebased version.
        intel_wait_for_register is used instead of wait_for. [Chris Wilson]
      v3:
        Extra comment added and Style issue fixed [Uma]
      v4:
        Rebased as part of patch reordering.
        HDCP2 encryption status is tracked.
        HW state check is moved into WARN_ON [Daniel]
      v5:
        Redefined the mei service functions as per comp redesign.
        Merged patches related to hdcp2.2 enabling and disabling [Sean Paul].
        Required shim functionality is defined [Sean Paul]
      v6:
        Return values are handles [Uma]
        Realigned the code.
        Check for comp_master is removed.
      v7:
        HDCP2.2 is attempted only if mei interface is up.
        Adjust to the new interface
        Avoid bool usage in struct [Tomas]
      v8:
        mei_binded status check is removed.
        %s/hdcp2_in_use/hdcp2_encrypted
      v9:
        bool is used in struct intel_hdcp. [Daniel]
      v10:
        panel is replaced with sink [Uma]
        Mei interface decided the hdcp2_capability.
        WARN_ON if hdcp_enable is called when hdcp state is ENABLED.
        Reviewed-by Uma.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-7-git-send-email-ramalingam.c@intel.com
      49a630b0
    • Ramalingam C's avatar
      drm/i915: hdcp1.4 CP_IRQ handling and SW encryption tracking · 09d56393
      Ramalingam C authored
      "hdcp_encrypted" flag is defined to denote the HDCP1.4 encryption status.
      This SW tracking is used to determine the need for real hdcp1.4 disable
      and hdcp_check_link upon CP_IRQ.
      
      On CP_IRQ we filter the CP_IRQ related to the states like Link failure
      and reauthentication req etc and handle them in hdcp_check_link.
      CP_IRQ corresponding to the authentication msg availability are ignored.
      
      WARN_ON is added for the abrupt stop of HDCP encryption of a port.
      
      v2:
        bool is used in struct for the cleaner coding. [Daniel]
        check_link work_fn is scheduled for cp_irq handling [Daniel]
      v3:
        rebased.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-6-git-send-email-ramalingam.c@intel.com
      09d56393
    • Ramalingam C's avatar
      drm/i915: MEI interface implementation · 9055aac7
      Ramalingam C authored
      Defining the mei-i915 interface functions and initialization of
      the interface.
      
      v2:
        Adjust to the new interface changes. [Tomas]
        Added further debug logs for the failures at MEI i/f.
        port in hdcp_port data is equipped to handle -ve values.
      v3:
        mei comp is matched for global i915 comp master. [Daniel]
        In hdcp_shim hdcp_protocol() is replaced with const variable. [Daniel]
        mei wrappers are adjusted as per the i/f change [Daniel]
      v4:
        port initialization is done only at hdcp2_init only [Danvet]
      v5:
        I915 registers a subcomponent to be matched with mei_hdcp [Daniel]
      v6:
        HDCP_disable for all connectors incase of comp_unbind.
        Tear down HDCP comp interface at i915_unload [Daniel]
      v7:
        Component init and fini are moved out of connector ops [Daniel]
        hdcp_disable is not called from unbind. [Daniel]
      v8:
        subcomponent name is dropped as it is already merged.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> [v11]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-5-git-send-email-ramalingam.c@intel.com
      9055aac7
    • Ramalingam C's avatar
      drm/i915: Initialize HDCP2.2 · 04707f97
      Ramalingam C authored
      Add the HDCP2.2 initialization to the existing HDCP1.4 stack.
      
      v2:
        mei interface handle is protected with mutex. [Chris Wilson]
      v3:
        Notifiers are used for the mei interface state.
      v4:
        Poll for mei client device state
        Error msg for out of mem [Uma]
        Inline req for init function removed [Uma]
      v5:
        Rebase as Part of reordering.
        Component is used for the I915 and MEI_HDCP interface [Daniel]
      v6:
        HDCP2.2 uses the I915 component master to communicate with mei_hdcp
      	- [Daniel]
        Required HDCP2.2 variables defined [Sean Paul]
      v7:
        intel_hdcp2.2_init returns void [Uma]
        Realigning the codes.
      v8:
        Avoid using bool structure members.
        MEI interface related changes are moved into separate patch.
        Commit msg is updated accordingly.
        intel_hdcp_exit is defined and used from i915_unload
      v9:
        Movement of the hdcp_check_link is moved to new patch [Daniel]
        intel_hdcp2_exit is removed as mei_comp will be unbind in i915_unload.
      v10:
        bool is used in struct to make coding simpler. [Daniel]
        hdmi hdcp init is placed correctly after encoder attachment.
      v11:
        hdcp2_capability check is moved into hdcp.c [Tomas]
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-4-git-send-email-ramalingam.c@intel.com
      04707f97
    • Ramalingam C's avatar
      drm/i915: Gathering the HDCP1.4 routines together · 4c719c25
      Ramalingam C authored
      All HDCP1.4 routines are gathered together, followed by the generic
      functions those can be extended for HDCP2.2 too.
      Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Reviewed-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-2-git-send-email-ramalingam.c@intel.com
      4c719c25
    • Chris Wilson's avatar
      drm/i915: Avoid reset lock in writing fence registers · c1d1746f
      Chris Wilson authored
      The idea of taking the reset lock around writing the fence register was
      to serialise the mmio write we also perform during the reset where those
      registers get clobbered. However, the lock is overkill as write tearing
      between reset and fence_update() is harmless; the final value of the
      fence register is the same. A race between revoke_fences() and
      fence_update() is also harmless at this point as on the fault path where
      this is necessary, we acquire the reset lock to coordinate ourselves in
      the upper layer.
      
      The danger of acquiring the reset lock again in fence_update() is that
      we may recurse from the shrinker along the i915_gem_fault() path.
      
      <4> [125.739646] ============================================
      <4> [125.739652] WARNING: possible recursive locking detected
      <4> [125.739659] 5.0.0-rc6-ga6e4cbf00557-drmtip_223+ #1 Tainted: G     U
      <4> [125.739666] --------------------------------------------
      <4> [125.739672] gem_mmap_gtt/1017 is trying to acquire lock:
      <4> [125.739679] 00000000a730190a (&dev_priv->gpu_error.reset_backoff_srcu){+.+.}, at: i915_reset_trylock+0x0/0x310 [i915]
      <4> [125.739848]
      but task is already holding lock:
      <4> [125.739854] 00000000a730190a (&dev_priv->gpu_error.reset_backoff_srcu){+.+.}, at: i915_reset_trylock+0x192/0x310 [i915]
      <4> [125.739918]
      other info that might help us debug this:
      <4> [125.739925]  Possible unsafe locking scenario:
      
      <4> [125.739930]        CPU0
      <4> [125.739934]        ----
      <4> [125.739937]   lock(&dev_priv->gpu_error.reset_backoff_srcu);
      <4> [125.739944]   lock(&dev_priv->gpu_error.reset_backoff_srcu);
      <4> [125.739950]
       *** DEADLOCK ***
      
      <4> [125.739958]  May be due to missing lock nesting notation
      
      <4> [125.739966] 5 locks held by gem_mmap_gtt/1017:
      <4> [125.739972]  #0: 00000000471f682c (&mm->mmap_sem){++++}, at: __do_page_fault+0x133/0x500
      <4> [125.739987]  #1: 0000000026542685 (&dev->struct_mutex){+.+.}, at: i915_gem_fault+0x1f6/0x860 [i915]
      <4> [125.740061]  #2: 00000000a730190a (&dev_priv->gpu_error.reset_backoff_srcu){+.+.}, at: i915_reset_trylock+0x192/0x310 [i915]
      <4> [125.740126]  #3: 00000000c828eb4f (fs_reclaim){+.+.}, at: fs_reclaim_acquire.part.25+0x0/0x30
      <4> [125.740140]  #4: 000000002d360d65 (shrinker_rwsem){++++}, at: shrink_slab+0x1cb/0x2c0
      <4> [125.740151]
      stack backtrace:
      <4> [125.740159] CPU: 1 PID: 1017 Comm: gem_mmap_gtt Tainted: G     U            5.0.0-rc6-ga6e4cbf00557-drmtip_223+ #1
      <4> [125.740170] Hardware name: Dell Inc.                 OptiPlex 745                 /0GW726, BIOS 2.3.1  05/21/2007
      <4> [125.740180] Call Trace:
      <4> [125.740189]  dump_stack+0x67/0x9b
      <4> [125.740199]  __lock_acquire+0xc75/0x1b00
      <4> [125.740209]  ? arch_tlb_finish_mmu+0x2a/0xa0
      <4> [125.740216]  ? tlb_finish_mmu+0x1a/0x30
      <4> [125.740222]  ? zap_page_range_single+0xe2/0x130
      <4> [125.740230]  ? lock_acquire+0xa6/0x1c0
      <4> [125.740237]  lock_acquire+0xa6/0x1c0
      <4> [125.740296]  ? i915_clear_error_registers+0x280/0x280 [i915]
      <4> [125.740357]  i915_reset_trylock+0x44/0x310 [i915]
      <4> [125.740417]  ? i915_clear_error_registers+0x280/0x280 [i915]
      <4> [125.740426]  ? lockdep_hardirqs_on+0xe0/0x1b0
      <4> [125.740434]  ? _raw_spin_unlock_irqrestore+0x39/0x60
      <4> [125.740499]  fence_update+0x218/0x470 [i915]
      <4> [125.740571]  i915_vma_unbind+0xa6/0x550 [i915]
      <4> [125.740640]  i915_gem_object_unbind+0xfa/0x190 [i915]
      <4> [125.740711]  i915_gem_shrink+0x2dc/0x590 [i915]
      <4> [125.740722]  ? ___preempt_schedule+0x16/0x18
      <4> [125.740792]  ? i915_gem_shrinker_scan+0xc9/0x130 [i915]
      <4> [125.740861]  i915_gem_shrinker_scan+0xc9/0x130 [i915]
      <4> [125.740870]  do_shrink_slab+0x143/0x3f0
      <4> [125.740878]  shrink_slab+0x228/0x2c0
      <4> [125.740886]  shrink_node+0x167/0x450
      <4> [125.740894]  do_try_to_free_pages+0xc4/0x340
      <4> [125.740902]  try_to_free_pages+0xdc/0x2e0
      <4> [125.740911]  __alloc_pages_nodemask+0x662/0x1110
      <4> [125.740921]  ? reacquire_held_locks+0xb5/0x1b0
      <4> [125.740928]  ? reacquire_held_locks+0xb5/0x1b0
      <4> [125.740986]  ? i915_reset_trylock+0x192/0x310 [i915]
      <4> [125.741045]  ? i915_memcpy_init_early+0x30/0x30 [i915]
      <4> [125.741054]  pte_alloc_one+0x12/0x70
      <4> [125.741060]  __pte_alloc+0x11/0xf0
      <4> [125.741067]  apply_to_page_range+0x37e/0x440
      <4> [125.741127]  remap_io_mapping+0x6c/0x100 [i915]
      <4> [125.741196]  i915_gem_fault+0x5a9/0x860 [i915]
      <4> [125.741204]  ? ptlock_alloc+0x15/0x30
      <4> [125.741212]  __do_fault+0x2c/0xb0
      <4> [125.741218]  __handle_mm_fault+0x8ee/0xfa0
      <4> [125.741227]  handle_mm_fault+0x196/0x3a0
      <4> [125.741235]  __do_page_fault+0x246/0x500
      <4> [125.741243]  ? page_fault+0x8/0x30
      <4> [125.741250]  page_fault+0x1e/0x30
      <4> [125.741256] RIP: 0033:0x55d0cc456e12
      <4> [125.741264] Code: b0 df ff ff 89 c2 8b 85 70 df ff ff 01 c2 8b 85 70 df ff ff 48 98 48 8d 0c 85 00 00 00 00 48 8b 85 e0 df ff ff 48 01 c8 f7 d2 <89> 10 83 85 70 df ff ff 01 81 bd 70 df ff ff ff 03 00 00 7e be 48
      <4> [125.741280] RSP: 002b:00007ffc1bab7ab0 EFLAGS: 00010206
      <4> [125.741287] RAX: 00007fc787cb6000 RBX: 0000000000000000 RCX: 0000000000000000
      <4> [125.741295] RDX: 00000000ffffffff RSI: 0000000000005401 RDI: 0000000000000002
      <4> [125.741303] RBP: 00007ffc1bab9b70 R08: 00007ffc1bab7920 R09: 000000000000001b
      <4> [125.741310] R10: 7165722074736554 R11: 0000000000000246 R12: 000055d0cc454a80
      <4> [125.741318] R13: 00007ffc1bab9f60 R14: 0000000000000000 R15: 0000000000000000
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109665Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190219122215.8941-4-chris@chris-wilson.co.uk
      c1d1746f
    • Chris Wilson's avatar
      drm/i915: Beware temporary wedging when determining -EIO · c41166f9
      Chris Wilson authored
      At a few points in our uABI, we check to see if the driver is wedged and
      report -EIO back to the user in that case. However, as we perform the
      check and reset asynchronously (where once before they were both
      serialised by the struct_mutex), we may instead see the temporary wedging
      used to cancel inflight rendering to avoid a deadlock during reset
      (caused by either us timing out in our reset handler,
      i915_wedge_on_timeout or with malice aforethought in intel_reset_prepare
      for a stuck modeset). If we suspect this is the case, that is we see a
      wedged driver *and* reset in progress, then wait until the reset is
      resolved before reporting upon the wedged status.
      
      v2: might_sleep() (Mika)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109580Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190220145637.23503-1-chris@chris-wilson.co.uk
      c41166f9
    • Joonas Lahtinen's avatar
    • Joonas Lahtinen's avatar
      Merge tag 'topic/mei-hdcp-2019-02-19' of... · b08e776c
      Joonas Lahtinen authored
      Merge tag 'topic/mei-hdcp-2019-02-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next-queued
      
      Prep patches + headers for the mei-hdcp/i915 component interfaces
      
      Also contains the prep work in the component helpers plus adjustements
      for the snd-hda/i915 component interface.
      
      Plus one small static inline in the drm_hdcp.h header that both i915
      and mei_hdcp will need.
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      From: Daniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190219071619.GA11016@phenom.ffwll.local
      b08e776c
    • Joonas Lahtinen's avatar
      Merge drm/drm-next into drm-intel-next-queued · d0781a89
      Joonas Lahtinen authored
      Doing a backmerge to be able to merge topic/mei-hdcp-2019-02-19 PR.
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      d0781a89
    • Dave Airlie's avatar
      Merge https://gitlab.freedesktop.org/drm/msm into drm-next · a5f2fafe
      Dave Airlie authored
      On the display side, cleanups and fixes to enabled modifiers
      (QCOM_COMPRESSED).  And otherwise mostly misc fixes all around.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Rob Clark <robdclark@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGuZ5uBKpf=fHvKpTiD10nychuEY8rnE+HeRz0QMvtY5_A@mail.gmail.com
      a5f2fafe
    • Dave Airlie's avatar
      Merge branch 'linux-5.1' of git://github.com/skeggsb/linux into drm-next · 71f4e45a
      Dave Airlie authored
      Various fixes/cleanups, along with initial support for SVM features
      utilising HMM address-space mirroring and device memory migration.
      There's a lot more work to do in these areas, both in terms of
      features and efficiency, but these can slowly trickle in later down
      the track.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Ben Skeggs <skeggsb@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv5bsB4rRY1Gqa_Bp_KAd-v_q1rGZ4nYmOAQhceL0Nr-Xg@mail.gmail.com
      71f4e45a
  2. 19 Feb, 2019 26 commits