1. 20 11月, 2015 1 次提交
    • L
      drm/i915: Fix oops caused by fbdev initialization failure · 54632abe
      Lukas Wunner 提交于
      intelfb_create() is called once on driver initialization. If it fails,
      ifbdev->helper.fbdev, ifbdev->fb or ifbdev->fb->obj may be NULL.
      
      Further up in the call stack, intel_fbdev_initial_config() calls
      intel_fbdev_fini() to tear down the ifbdev on failure. This calls
      intel_fbdev_destroy() which dereferences ifbdev->fb. Fix the ensuing
      oops.
      
      Also check in these functions if ifbdev is not NULL to avoid oops:
      
      i915_gem_framebuffer_info() is called on access to debugfs file
      "i915_gem_framebuffer" and dereferences ifbdev, ifbdev->helper.fb
      and ifbdev->helper.fb->obj.
      
      intel_connector_add_to_fbdev() / intel_connector_remove_from_fbdev()
      are called when registering / unregistering an mst connector and
      dereference ifbdev.
      
      v3: Drop additional null pointer checks in intel_fbdev_set_suspend(),
          intel_fbdev_output_poll_changed() and intel_fbdev_restore_mode()
          since they already check if ifbdev is not NULL, which is sufficient
          now that intel_fbdev_fini() is called on initialization failure.
          (Requested by Daniel Vetter <daniel.vetter@ffwll.ch>)
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Link: http://patchwork.freedesktop.org/patch/msgid/d05f0edf121264a9d0adb8ca713fd8cc4ae068bf.1447938059.git.lukas@wunner.deSigned-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      54632abe
  2. 11 11月, 2015 1 次提交
  3. 09 11月, 2015 2 次提交
  4. 02 11月, 2015 1 次提交
  5. 09 10月, 2015 1 次提交
    • P
      drm/i915: don't allocate fbcon from stolen memory if it's too big · 3badb49f
      Paulo Zanoni 提交于
      Technology has evolved and now we have eDP panels with 3200x1800
      resolution. In the meantime, the BIOS guys didn't change the default
      32mb for stolen memory. On top of that, we can't assume our users will
      be able to increase the default stolen memory size to more than 32mb -
      I'm not even sure all BIOSes allow that.
      
      So just the fbcon buffer alone eats 22mb of my stolen memroy, and due
      to the BDW/SKL restriction of not using the last 8mb of stolen memory,
      all that's left for FBC is 2mb! Since fbcon is not the coolest feature
      ever, I think it's better to save our precious stolen resource to FBC
      and the other guys.
      
      On the other hand, we really want to use as much stolen memory as
      possible, since on some older systems the stolen memory may be a
      considerable percentage of the total available memory.
      
      This patch tries to achieve a little balance using a simple heuristic:
      if the fbcon wants more than half of the available stolen memory,
      don't use stolen memory in order to leave some for FBC and the other
      features.
      
      The long term plan should be to implement a way to set priorities for
      stolen memory allocation and then evict low priority users when the
      high priority ones need the memory. While we still don't have that,
      let's try to make FBC usable with the simple solution.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3badb49f
  6. 17 9月, 2015 1 次提交
  7. 14 9月, 2015 2 次提交
  8. 15 8月, 2015 1 次提交
    • M
      drm/i915/gtt: Allow >= 4GB offsets in X86_32 · 088e0df4
      Michel Thierry 提交于
      Similar to commit c44ef60e ("drm/i915/gtt:
      Allow >= 4GB sizes for vm"), i915_gem_obj_offset and i915_gem_obj_ggtt_offset
      return an unsigned long, which in only 4-bytes long in 32-bit kernels.
      
      Change return type (and other related offset variables) to u64.
      
      Since Global GTT is always limited to 4GB, this change would not be required
      in i915_gem_obj_ggtt_offset, but this is done for consistency.
      
      v2: Remove unnecessary offset variable in do_pin, as we already have
          vma->node.start (Chris).
          Update GGTT offset too (Tvrtko).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      088e0df4
  9. 06 8月, 2015 2 次提交
    • A
      drm/i915: Use new drm_fb_helper functions · 21cff148
      Archit Taneja 提交于
      Use the newly created wrapper drm_fb_helper functions instead of calling
      core fbdev functions directly. They also simplify the fb_info creation.
      
      v3:
      - Don't touch remove_conflicting_framebuffers
      
      v2:
      - No changes
      
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      21cff148
    • D
      drm/fbdev: Return -EBUSY when oopsing · c50bfd08
      Daniel Vetter 提交于
      Trying to do anything with kms drivers when oopsing has become a
      failing proposition. But since we can end up in the fbdev code simply
      due to the console unblanking that's done unconditionally just
      removing our panic handler isn't enough. We need to block all fbdev
      callbacks when oopsing.
      
      There was already one in the blank handler, but it failed silently.
      That makes it impossible for drivers (like i915) who subclass these
      functions to figure this out.
      
      Instead consistently return -EBUSY so that everyone knows that we
      really don't want to be bothered right now. This also allows us to
      remove a pile of FIXMEs from the i915 fbdev code (since due to the
      failure code they now won't attempt to grab dangerous locks any more).
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      c50bfd08
  10. 14 7月, 2015 2 次提交
  11. 10 7月, 2015 2 次提交
    • R
      drm/i915: fbdev restore mode needs to invalidate frontbuffer · d04df732
      Rodrigo Vivi 提交于
      This fbdev restore mode was another corner case that was now
      calling frontbuffer flip and flush and making we miss
      screen updates with PSR enabled.
      
      So let's also add the invalidate hack here while we don't have
      a reliable dirty fbdev op.
      
      v2: As pointed by Paulo: removed seg fault risk, used fb_helper
          when possible and put brackets on if.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Testcase: igt/kms_fbcon_fbt/psr
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d04df732
    • R
      drm/i915: fbdev_set_par reliably invalidating frontbuffer · aba6da3e
      Rodrigo Vivi 提交于
      fbdev_set_par is called when fbcon is taking over control.
      In the past frontbuffer was being invalidated on
      set_to_gtt_domain, but it moved to set_domain fixing that case,
      but left this behind and broken in
      
      commit 031b698a
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Jun 26 19:35:16 2015 +0200
      
          drm/i915: Unconditionally do fb tracking invalidate in set_domain
      
      Note that even before this commit it wasn't perfect since the
      invalidate was omitted if the fbcon was already in the GTT domain,
      which it usually was.
      
      Since we are also invalidating in other fbdev cases this one
      was masked here. At least until now that I found this corner
      case: On boot with plymouth doing a splash screen
      when returning to the console frontbuffer wans't being invalidated
      causing missed screen updates with PSR enabled.
      
      So this patch fixes this issue.
      
      v2: Make invalidate directly and unconditionally and
          fix commit message indicating the set_domain fix
          as pointed out by Daniel.
      v3: Remove unecessary if(obj) added by mistake
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Try to clarify commit message a bit and make it clear the
      referenced commit made this worse.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      aba6da3e
  12. 23 6月, 2015 1 次提交
    • J
      drm/i915: Update i915_gem_object_sync() to take a request structure · 91af127f
      John Harrison 提交于
      The plan is to pass requests around as the basic submission tracking structure
      rather than rings and contexts. This patch updates the i915_gem_object_sync()
      code path.
      
      v2: Much more complex patch to share a single request between the sync and the
      page flip. The _sync() function now supports lazy allocation of the request
      structure. That is, if one is passed in then that will be used. If one is not,
      then a request will be allocated and passed back out. Note that the _sync() code
      does not necessarily require a request. Thus one will only be created until
      certain situations. The reason the lazy allocation must be done within the
      _sync() code itself is because the decision to need one or not is not really
      something that code above can second guess (except in the case where one is
      definitely not required because no ring is passed in).
      
      The call chains above _sync() now support passing a request through which most
      callers passing in NULL and assuming that no request will be required (because
      they also pass in NULL for the ring and therefore can't be generating any ring
      code).
      
      The exeception is intel_crtc_page_flip() which now supports having a request
      returned from _sync(). If one is, then that request is shared by the page flip
      (if the page flip is of a type to need a request). If _sync() does not generate
      a request but the page flip does need one, then the page flip path will create
      its own request.
      
      v3: Updated comment description to be clearer about 'to_req' parameter (Tomas
      Elf review request). Rebased onto newer tree that significantly changed the
      synchronisation code.
      
      v4: Updated comments from review feedback (Tomas Elf)
      
      For: VIZ-5115
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NTomas Elf <tomas.elf@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      91af127f
  13. 22 6月, 2015 1 次提交
  14. 29 5月, 2015 1 次提交
    • R
      drm/i915: Another fbdev hack to avoid PSR on fbcon. · d9a946b5
      Rodrigo Vivi 提交于
      With unified modeset and flip paths introduced recently when switching
      to fbcon PSR was being disabled on fb_set_par path but re-enabled on
      fb_pan_display one, causing missed screen updates and un unusable
      console.
      
      Regression introduced with:
      
      commit bb546623
      Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Date:   Tue Apr 21 17:13:13 2015 +0300
      
          drm/i915: Unify modeset and flip paths of intel_crtc_set_config()
      
      Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d9a946b5
  15. 23 3月, 2015 1 次提交
  16. 18 3月, 2015 1 次提交
    • R
      drm/i915: Make sure we invalidate frontbuffer on fbcon. · 03e515f7
      Rodrigo Vivi 提交于
      There are some cases like suspend/resume or dpms off/on sequences
      that can flush frontbuffer bits. In these cases features that relies
      on frontbuffer tracking can start working and user can stop getting
      screen updates on fbcon having impression the system is frozen.
      
      So, let's make sure we also invalidate frontbuffer on fbdev blank.
      
      v2: Daniel was right, backtrace didn't show other path than this blank
      one so let's make sure frontbuffer bits gets invalidate here instead of
      on random write operations that doesn't garantee we track all frontbuffer
      writes.
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      [danvet: Exchange code comments for one that complains about the
      locking, like in set_par.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      03e515f7
  17. 14 2月, 2015 1 次提交
  18. 27 1月, 2015 5 次提交
    • D
      drm/i915: Rename plane_config to initial_plane_config · 5724dbd1
      Damien Lespiau 提交于
      This vfunc and related structure are only used for fast boot, so let's
      rename them to not take them as general purpose ones.
      
      v2: Fix conflicts caused by the introduction of struct intel_crtc_state
      
      Reviewed-By: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
      Suggested-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5724dbd1
    • D
      drm/i915: Use a common function for computing the fb height alignment · ec2c981e
      Damien Lespiau 提交于
      If we need to change the fb height constraints, it sounds like a good
      idea to have to do it in one place only.
      
      v2: v2: Rebase on top of Ander's "Make intel_crtc->config a pointer"
      
      Reviewed-By: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ec2c981e
    • D
      drm/i915: Change plane_config to store a tiling_mode · 49af449b
      Damien Lespiau 提交于
      Rather than having "tiled" meaning "is it X-tiled?" convert the field to
      explicitely store the tiling mode. The code doesn't have to change much
      as 1 is conveniently I915_TILING_X.
      
      This is to accommodate future changes around tiling modes and scannout
      buffers.
      
      v2: Rebase on top of Ander's "Make intel_crtc->config a pointer"
      
      Reviewed-By: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      49af449b
    • A
      drm/i915: Make intel_crtc->config a pointer · 6e3c9717
      Ander Conselvan de Oliveira 提交于
      To match the semantics of drm_crtc->state, which this will eventually
      become. The allocation of the memory for config will be fixed in a
      followup patch. By adding the extra _config field to intel_crtc it was
      possible to generate this entire patch with the cocci script below.
      
      @@ @@
      struct intel_crtc {
      ...
      -struct intel_crtc_state config;
      +struct intel_crtc_state _config;
      +struct intel_crtc_state *config;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -memset(&crtc->config, 0, sizeof(crtc->config));
      +memset(crtc->config, 0, sizeof(*crtc->config));
      @@ @@
      __intel_set_mode(...) {
      <...
      -to_intel_crtc(crtc)->config = *pipe_config;
      +(*(to_intel_crtc(crtc)->config)) = *pipe_config;
      ...>
      }
      @@ @@
      intel_crtc_init(...) {
      ...
      WARN_ON(drm_crtc_index(&intel_crtc->base) != intel_crtc->pipe);
      +intel_crtc->config = &intel_crtc->_config;
      return;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -&crtc->config
      +crtc->config
      @@ struct intel_crtc *crtc; identifier member; @@
      -crtc->config.member
      +crtc->config->member
      @@ expression E; @@
      -&(to_intel_crtc(E)->config)
      +to_intel_crtc(E)->config
      @@ expression E; identifier member; @@
      -to_intel_crtc(E)->config.member
      +to_intel_crtc(E)->config->member
      
      v2: Clarify manual changes by splitting them into another patch. (Matt)
          Improve cocci script to generate even more of the changes. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6e3c9717
    • A
      drm/i915: Embedded struct drm_crtc_state in intel_crtc_state · 2d112de7
      Ander Conselvan de Oliveira 提交于
      And get rid of the duplicate mode structures. This patch was generated
      with the following semantic patch:
      
      @@ @@
      struct intel_crtc_state {
      +struct drm_crtc_state base;
      +
      ...
      -struct drm_display_mode requested_mode;
      -struct drm_display_mode adjusted_mode;
      ...
      }
      @@ struct intel_crtc_state *state; @@
      -state->adjusted_mode
      +state->base.adjusted_mode
      @@ struct intel_crtc_state *state; @@
      -state->requested_mode
      +state->base.mode
      @@ struct intel_crtc_state state; @@
      -state.adjusted_mode
      +state.base.adjusted_mode
      @@ struct intel_crtc_state state; @@
      -state.requested_mode
      +state.base.mode
      @@ struct drm_crtc *crtc; @@
      -to_intel_crtc(crtc)->config.adjusted_mode
      +to_intel_crtc(crtc)->config.base.adjusted_mode
      @@ identifier member; expression E; @@
      -PIPE_CONF_CHECK_FLAGS(adjusted_mode.member, E);
      +PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.member, E);
      @@ identifier member; @@
      -PIPE_CONF_CHECK_I(adjusted_mode.member);
      +PIPE_CONF_CHECK_I(base.adjusted_mode.member);
      @@ identifier member; @@
      -PIPE_CONF_CHECK_CLOCK_FUZZY(adjusted_mode.member);
      +PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.member);
      
      v2: Completely generate the patch with cocci. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2d112de7
  19. 09 12月, 2014 1 次提交
  20. 08 11月, 2014 1 次提交
  21. 03 9月, 2014 2 次提交
  22. 13 8月, 2014 1 次提交
    • C
      drm/i915: Localise the fbdev console lock frobbing · 82e3b8c1
      Chris Wilson 提交于
      Rather than take and release the console_lock() around a non-existent
      DRM_I915_FBDEV, move the lock acquisation into the callee where it will
      be compiled out by the config option entirely. This includes moving the
      deferred fb_set_suspend() dance and encapsulating it entirely within
      intel_fbdev.c.
      
      v2: Use an integral work item so that we can explicitly flush the work
      upon suspend/unload.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      [danvet: Add the flush_work in fbdev_fini per the mailing list
      discussion. And s/BUG_ON/WARN_ON/ because.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      82e3b8c1
  23. 24 7月, 2014 1 次提交
  24. 22 7月, 2014 1 次提交
    • D
      drm/i915: add DP 1.2 MST support (v0.7) · 0e32b39c
      Dave Airlie 提交于
      This adds DP 1.2 MST support on Haswell systems.
      
      Notes:
      a) this reworks irq handling for DP MST ports, so that we can
      avoid the mode config locking in the current hpd handlers, as
      we need to process up/down msgs at a better time.
      
      Changes since v0.1:
      use PORT_PCH_HOTPLUG to detect short vs long pulses
      add a workqueue to deal with digital events as they can get blocked on the
      main workqueue beyong mode_config mutex
      fix a bunch of modeset checker warnings
      acks irqs in the driver
      cleanup the MST encoders
      
      Changes since v0.2:
      check irq status again in work handler
      move around bring up and tear down to fix DPMS on/off
      use path properties.
      
      Changes since v0.3:
      updates for mst apis
      more state checker fixes
      irq handling improvements
      fbcon handling support
      improved reference counting of link - fixes redocking.
      
      Changes since v0.4:
      handle gpu reset hpd reinit without oopsing
      check link status on HPD irqs
      fix suspend/resume
      
      Changes since v0.5:
      use proper functions to get max link/lane counts
      fix another checker backtrace - due to connectors disappearing.
      set output type in more places fro, unknown->displayport
      don't talk to devices if no HPD asserted
      check mst on short irqs only
      check link status properly
      rebase onto prepping irq changes.
      drop unsued force_act
      
      Changes since v0.6:
      cleanup unused struct entry.
      
      [airlied: fix some sparse warnings].
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0e32b39c
  25. 08 7月, 2014 2 次提交
  26. 02 7月, 2014 1 次提交
  27. 19 6月, 2014 1 次提交
  28. 13 6月, 2014 1 次提交
  29. 05 6月, 2014 1 次提交