Skip to content
  1. Jan 15, 2016
  2. Jan 14, 2016
  3. Jan 13, 2016
  4. Jan 12, 2016
    • Ville Syrjälä's avatar
      drm/i915: Use MI_BATCH_BUFFER_START on 830/845 · 9d611c03
      Ville Syrjälä authored
      
      
      MI_BATCH_BUFFER is nasty since it requires that userspace pass in the
      correct batch length.
      
      Let's switch to using MI_BATCH_BUFFER_START instead (like we do on
      other platforms). Then we don't have to specify the batch length
      at all, and the CS will instead execute until it sees the
      MI_BATCH_BUFFER_END.
      
      We still need the batch length since we do the CS TLB workaround
      and copy the batch into the permanently pinned scratch object
      and execute it from there. But for this we can simply use the
      batch object length when the user hasn't specified the actual
      batch length. So specifying the batch length becomes just a
      way to optimize the batch copy a little bit.
      
      We lost batch_len from a bunch of igts (including the quiesce batch)
      so without this igt is utterly broken on 830/845. Also some igts such
      as gem_cpu_reloc never specified the batch_len and so didn't work.
      With MI_BATCH_BUFFER_START we don't have to fix up igt every time
      someone forgets that 830/845 exist.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1450110229-30450-11-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      9d611c03
    • Ville Syrjälä's avatar
      drm/i915: Expect child dev size of 22 bytes for VBT < 106 · 7244f309
      Ville Syrjälä authored
      
      
      My 830 has VBT version 105 with child device size of 22 bytes.
      Let's assume that's correct and adjust our expectations.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1450110229-30450-9-git-send-email-ville.syrjala@linux.intel.com
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      7244f309
    • Ville Syrjälä's avatar
      drm/i915: Allow 27 bytes child_dev for VBT <109 · 52b69c84
      Ville Syrjälä authored
      
      
      My 85x has VBT version 108 which has a child dev size of 27 bytes.
      Let's allow that without printing an error.
      
      We still want to reject the actual parsin since for that we need
      the child device size to be at least 33 bytes. So we should still
      check for that, but let's make it print a debug message only instead
      of an error.
      
      While at it, toss in a BUILD_BUG_ON() to verify our struct
      old_child_dev_config is in fact 33 bytes.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1450110229-30450-8-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      52b69c84
    • Ville Syrjälä's avatar
      drm/i915: Wait for pipe to start before sampling vblank timestamps on gen2 · b7792d8b
      Ville Syrjälä authored
      
      
      We use the vblank timestamps to generate the vblank frame counter value
      on gen2. That means we need the pipe scanout position to be accurate
      when we call drm_crtc_vblank_on(), otherwise the frame counter
      guesstimate may jump when the pipe actually start.
      
      What I observed on my 85x is that the DSL initially reads 0, and when
      the pipe actually starts DSL jumps to vblank_start. On gen2 DSL==0 means
      actually vtotal-1 (see update_scanline_offset()), so if we initially
      get vtotal-1, and then very quickly vblank_start (or thereabouts), the
      scanout position will appear to jump backwards by approximately one
      vblank length. Which means the frame counter guesstimate will also
      jump backwards. That's no good, so let's make sure the pipe has
      started before we call drm_crtc_vblank_on().
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1450110229-30450-5-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b7792d8b
    • Ville Syrjälä's avatar
      drm/i915: Cleanup phys status page too · 7d3fdfff
      Ville Syrjälä authored
      Restore the lost phys status page cleanup.
      
      Fixes the following splat with DMA_API_DEBUG=y:
      
      WARNING: CPU: 0 PID: 21615 at ../lib/dma-debug.c:974 dma_debug_device_change+0x190/0x1f0()
      pci 0000:00:02.0: DMA-API: device driver has pending DMA allocations while released from device [count=1]
                     One of leaked entries details: [device address=0x0000000023163000] [size=4096 bytes] [mapped with DMA_BIDIRECTIONAL] [mapped as coherent]
      Modules linked in: i915(-) i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm sha256_generic hmac drbg ctr ccm sch_fq_codel binfmt_misc joydev mousedev arc4 ath5k iTCO_wdt mac80211 smsc_ircc2 ath snd_intel8x0m snd_intel8x0 snd_ac97_codec ac97_bus psmouse snd_pcm input_leds i2c_i801 pcspkr snd_timer cfg80211 snd soundcore i2c_core ehci_pci firewire_ohci ehci_hcd firewire_core lpc_ich 8139too rfkill crc_itu_t mfd_core mii usbcore rng_core intel_agp intel_gtt usb_common agpgart irda crc_ccitt fujitsu_laptop led_class parport_pc video parport evdev backlight
      CPU: 0 PID: 21615 Comm: rmmod Tainted: G     U          4.4.0-rc4-mgm-ovl+ #4
      Hardware name: FUJITSU SIEMENS LIFEBOOK S6120/FJNB16C, BIOS Version 1.26  05/10/2004
       e31a3de0 e31a3de0 e31a3d9c c128d4bd e31a3dd0 c1045a0c c15e00c4 e31a3dfc
       0000546f c15dfad2 000003ce c12b3740 000003ce c12b3740 00000000 00000001
       f61fb8a0 e31a3de8 c1045a83 00000009 e31a3de0 c15e00c4 e31a3dfc e31a3e4c
      Call Trace:
       [<c128d4bd>] dump_stack+0x16/0x19
       [<c1045a0c>] warn_slowpath_common+0x8c/0xd0
       [<c12b3740>] ? dma_debug_device_change+0x190/0x1f0
       [<c12b3740>] ? dma_debug_device_change+0x190/0x1f0
       [<c1045a83>] warn_slowpath_fmt+0x33/0x40
       [<c12b3740>] dma_debug_device_change+0x190/0x1f0
       [<c1065499>] notifier_call_chain+0x59/0x70
       [<c10655af>] __blocking_notifier_call_chain+0x3f/0x80
       [<c106560f>] blocking_notifier_call_chain+0x1f/0x30
       [<c134cfb3>] __device_release_driver+0xc3/0xf0
       [<c134d0d7>] driver_detach+0x97/0xa0
       [<c134c440>] bus_remove_driver+0x40/0x90
       [<c134db18>] driver_unregister+0x28/0x60
       [<c1079e8c>] ? trace_hardirqs_on_caller+0x12c/0x1d0
       [<c12c0618>] pci_unregister_driver+0x18/0x80
       [<f83e96e7>] drm_pci_exit+0x87/0xb0 [drm]
       [<f8b3be2d>] i915_exit+0x1b/0x1ee [i915]
       [<c10b999c>] SyS_delete_module+0x14c/0x210
       [<c1079e8c>] ? trace_hardirqs_on_caller+0x12c/0x1d0
       [<c115a9bd>] ? ____fput+0xd/0x10
       [<c1002014>] do_fast_syscall_32+0xa4/0x450
       [<c149f6fa>] sysenter_past_esp+0x3b/0x5d
      ---[ end trace c2ecbc77760f10a0 ]---
      Mapped at:
       [<c12b3183>] debug_dma_alloc_coherent+0x33/0x90
       [<f83e989c>] drm_pci_alloc+0x18c/0x1e0 [drm]
       [<f8acd59f>] intel_init_ring_buffer+0x2af/0x490 [i915]
       [<f8acd8b0>] intel_init_render_ring_buffer+0x130/0x750 [i915]
       [<f8aaea4e>] i915_gem_init_rings+0x1e/0x110 [i915]
      
      v2: s/BUG_ON/WARN_ON/ since dim doens't like the former anymore
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Fixes: 5c6c6003
      
       ("drm/i915: Remove DRI1 ring accessors and API")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Link: http://patchwork.freedesktop.org/patch/msgid/1452538112-5331-1-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7d3fdfff
    • Ville Syrjälä's avatar
      drm/i915: Kill intel_prepare_ddi() · 6a7e4f99
      Ville Syrjälä authored
      
      
      Move the ddi buffer translation programming to occur from the encoder
      .pre_enable() hook, for just the ddi port we are enabling. Previously
      we used to reprogram the translations for all ddi ports during
      init and during power well enabling.
      
      v2: s/intel_prepare_ddi_buffers/intel_prepare_ddi_buffer/ (Daniel)
          Resolve conflicts due to  dev_priv->atomic_cdclk_freq
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      6a7e4f99
    • Ville Syrjälä's avatar
      drm/i915: Reject >9 ddi translation entried if port != A/E on SKL · 10afa0b6
      Ville Syrjälä authored
      
      
      Only DDI A and E support 10 translation entries in DP mode. For the
      other ports the tenth entry is reserved for HDMI.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449597590-6971-9-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      10afa0b6
    • Ville Syrjälä's avatar
      drm/i915: Pass around dev_priv for ddi buffer programming · 78ab0bae
      Ville Syrjälä authored
      
      
      Make the ddi buffer programming code a bit more neat by passing
      around dev_priv instead of dev.
      
      v2: Resolve conflicts due to KBL
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1)
      78ab0bae
    • Ville Syrjälä's avatar
      drm/i915: Eliminate duplicated skl_get_buf_trans_dp() · cd1101cb
      Ville Syrjälä authored
      
      
      skl_get_buf_trans_edp() effectively contains another copy of
      skl_get_buf_trans_dp(). Remove the duplication and just call
      skl_get_buf_trans_dp() from  skl_get_buf_trans_edp().
      
      v2: Resolve conflicts due to KBL
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1)
      cd1101cb
    • Ville Syrjälä's avatar
      drm/i915: Remove pointless 'ddi_translations' local variable · acee2998
      Ville Syrjälä authored
      
      
      skl_get_buf_trans_*() don't need the 'ddi_translations' local variable
      since all they with is assign and return. Just return the right thing
      directly and get rid of the local variable.
      
      v2: Resolve conflicts due to KBL
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1)
      acee2998
    • Ville Syrjälä's avatar
      drm/i915: Store max lane count in intel_digital_port · ccb1a831
      Ville Syrjälä authored
      
      
      Rather than having open coded checks for the DDI A/E configuration,
      just store the max supported lane count in intel_digital_port.
      
      We had an open coded check for DDI A, but not for DDI E. So we may
      have been vilating the DDI E max lane count.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      ccb1a831
    • Ville Syrjälä's avatar
      drm/i915: Check max number of lanes when registering DDI ports · 10e7bec3
      Ville Syrjälä authored
      
      
      DDI A and E share some of the lanes, so check that we have enough
      lanes for the purpose we need before registering the encoders.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449597590-6971-3-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      10e7bec3
    • Ville Syrjälä's avatar
      drm/i915: Pass the correct encoder to intel_ddi_clk_select() with MST · d919161b
      Ville Syrjälä authored
      We're supposed to pass the primary DP encoder to intel_ddi_clk_select(),
      not the fake MST encoder. Do so.
      
      There's no real bug here though, since intel_ddi_clk_select() only
      checks if the encoder type is EDP (which it isn't for either the
      primary DP encoder or the fake MST encoder), and it gets the DDI port
      via intel_ddi_get_encoder_port() (which knows how to do the
      fake->primary->port dance itself).
      
      Fixes: e404ba8d
      
       ("drm/i915: Setup DDI clk for MST on SKL")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449597590-6971-2-git-send-email-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d919161b
    • Tvrtko Ursulin's avatar
      drm/i915/bdw+: Replace list_del+list_add_tail with list_move_tail · 7eb08a25
      Tvrtko Ursulin authored
      
      
      Same effect for slightly less source code and resulting binary.
      
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452521321-4032-2-git-send-email-tvrtko.ursulin@linux.intel.com
      7eb08a25
    • Jani Nikula's avatar
      drm/i915/dsi: add debug printing of the new sequence block names · bc95ce7f
      Jani Nikula authored
      
      
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452006497-28517-1-git-send-email-jani.nikula@intel.com
      bc95ce7f
    • Jani Nikula's avatar
      drm/i915/dsi: reduce tedious repetition · c67fed85
      Jani Nikula authored
      
      
      Make it a bit tidier and safer.
      
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/cab24a84811ddbae72d8c3a5f59d29f57b1d3aad.1450702954.git.jani.nikula@intel.com
      c67fed85
    • Jani Nikula's avatar
      drm/i915/dsi: skip unknown elements for sequence block v3+ · 40795782
      Jani Nikula authored
      
      
      The sequence block has sizes of elements after the operation byte since
      sequence block v3. Use it to skip elements we don't support yet.
      
      v2: remove redundant exec_elem[operation_byte] check (Daniel)
      
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452006408-27688-1-git-send-email-jani.nikula@intel.com
      40795782
    • Jani Nikula's avatar
      drm/i915/bios: add support for MIPI sequence block v3 · 2a33d934
      Jani Nikula authored
      
      
      The changes since the sequence block v2 are:
      
      * The whole MIPI bios data block has a separate 32-bit size field since
        v3, stored after the version. This facilitates big sequences.
      
      * The size of the panel specific sequence blocks has grown to 32
        bits. This facilitates big sequences.
      
      * The elements within sequences now have an 8-bit size field following
        the operation byte. This facilitates skipping unknown new operation
        bytes, i.e. forward compatibility.
      
      v2 (of the patch): use DRM_ERROR for unknown operation byte
      v3 (of the patch): even more bounds checking (Ville)
      
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452518102-3154-1-git-send-email-jani.nikula@intel.com
      2a33d934