1. 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
  2. 09 12月, 2014 1 次提交
  3. 08 11月, 2014 1 次提交
  4. 03 9月, 2014 2 次提交
  5. 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
  6. 24 7月, 2014 1 次提交
  7. 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
  8. 08 7月, 2014 2 次提交
  9. 02 7月, 2014 1 次提交
  10. 19 6月, 2014 1 次提交
  11. 13 6月, 2014 1 次提交
  12. 05 6月, 2014 1 次提交
  13. 04 6月, 2014 1 次提交
  14. 15 5月, 2014 1 次提交
  15. 14 5月, 2014 2 次提交
  16. 24 4月, 2014 1 次提交
  17. 02 4月, 2014 1 次提交
    • C
      drm/i915: Fix the computation of required fb size for pipe · bc104d1f
      Chris Wilson 提交于
      The computation of required framebuffer size in
      
      commit d978ef14
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Mar 7 08:57:51 2014 -0800
      
          drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12
      
      is too optimistic, and would rely on the invariant fb being
      reconstructed to exactly fit each pipe (and probably ignore hardware
      limits). Instead, we want to compute the upper bound on what the display
      engine will access and ensure that is within the inherited framebuffer.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bc104d1f
  18. 08 3月, 2014 2 次提交
    • J
      drm/i915: remove early fb allocation dependency on CONFIG_FB v2 · 484b41dd
      Jesse Barnes 提交于
      By stuffing the fb allocation into the crtc, we get mode set lifetime
      refcounting for free, but have to handle the initial pin & fence
      slightly differently.  It also means we can move the shared fb handling
      into the core rather than leaving it out in the fbdev code.
      
      v2: null out crtc->fb on error (Daniel)
          take fbdev fb ref and remove unused error path (Daniel)
      Requested-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      484b41dd
    • J
      drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12 · d978ef14
      Jesse Barnes 提交于
      Retrieve current framebuffer config info from the regs and create an fb
      object for the buffer the BIOS or boot loader left us.  This should
      allow for smooth transitions to userspace apps once we finish the
      initial configuration construction.
      
      v2: check for non-native modes and adjust (Jesse)
          fixup aperture and cmap frees (Imre)
          use unlocked unref if init_bios fails (Jesse)
          fix curly brace around DSPADDR check (Imre)
          comment failure path for pin_and_fence (Imre)
      v3: fixup fixup of aperture frees (Chris)
      v4: update to current bits (locking & pin_and_fence hack) (Jesse)
      v5: move fb config fetch to display code (Jesse)
          re-order hw state readout on initial load to suit fb inherit (Jesse)
          re-add pin_and_fence in fbdev code to make sure we refcount properly (Je
      v6: rename to plane_config (Daniel)
          check for valid object when initializing BIOS fb (Jesse)
          split from plane_config readout and other display changes (Jesse)
          drop use_bios_fb option (Chris)
          update comments (Jesse)
          rework fbdev_init_bios for clarity (Jesse)
          drop fb obj ref under lock (Chris)
      v7: use fb object from plane_config instead (Ville)
          take ref on fb object (Jesse)
      v8: put under i915_fastboot option (Jesse)
          fix fb ptr checking (Jesse)
          inform drm_fb_helper if we fail to enable a connector (Jesse)
          drop unnecessary enabled[] modifications in failure cases (Chris)
          split from BIOS connector config readout (Daniel)
          don't memset the fb buffer if preallocated (Chris)
          alloc ifbdev up front and pass to init_bios (Chris)
          check for bad ifbdev in restore_mode too (Chris)
      v9: fix up !fastboot bpp setting (Jesse)
          fix up !fastboot helper alloc (Jesse)
          make sure BIOS fb is sufficient for biggest active pipe (Jesse)
      v10:fix up size calculation for proposed fbs (Chris)
          go back to two pass pipe fb assignment (Chris)
          add warning for active pipes w/o fbs (Chris)
          clean up num_pipes checks in fbdev_init and fbdev_restore_mode (Chris)
          move i915.fastboot into fbdev_init (Chris)
      v11:make BIOS connector config usage unconditional (Daniel)
      v12:fix up fb vs pipe size checking (Chris)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d978ef14
  19. 06 3月, 2014 3 次提交
  20. 13 2月, 2014 6 次提交
    • J
      drm/i915: don't preserve inherited configs with nothing on v2 · 02f5eebb
      Jesse Barnes 提交于
      It can be corrected later and may be what was actually desired, but
      generally isn't, so if we find nothing is enabled, let the core DRM fb
      helper figure something out.
      
      v2: free the array too (Jesse)
      
      Note that this also undoes any changes in case we bail out due to hw
      cloning.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      02f5eebb
    • J
      drm/i915: allow re-use BIOS connector config for initial fbdev config v3 · eb1bfe80
      Jesse Barnes 提交于
      The BIOS or boot loader will generally create an initial display
      configuration for us that includes some set of active pipes and
      displays.  This routine tries to figure out which pipes and connectors
      are active and stuffs them into the crtcs and modes array given to us by
      the drm_fb_helper code.
      
      The overall sequence is:
        intel_fbdev_init - from driver load
          intel_fbdev_init_bios - initialize the intel_fbdev using BIOS data
          drm_fb_helper_init - build fb helper structs
          drm_fb_helper_single_add_all_connectors - more fb helper structs
        intel_fbdev_initial_config - apply the config
          drm_fb_helper_initial_config - call ->probe then register_framebuffer()
              drm_setup_crtcs - build crtc config for fbdev
                intel_fb_initial_config - find active connectors etc
              drm_fb_helper_single_fb_probe - set up fbdev
                intelfb_create - re-use or alloc fb, build out fbdev structs
      
      v2: use BIOS connector config unconditionally if possible (Daniel)
          check for crtc cloning and reject (Daniel)
          fix up comments (Daniel)
      v3: use command line args and preferred modes first (Ville)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Re-add the WARN_ON for a missing encoder crtc - the state
      sanitizer should take care of this. And spell-ocd the comments.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eb1bfe80
    • I
      drm/i915: unbind fbs from crtcs during driver unload · 9d661251
      Imre Deak 提交于
      So far during driver unload we called drm_framebuffer_cleanup() for the
      fbdev fb, which only removes the fb from the drm fb list regardless of
      its reference count, but leaves the fb bound on an active crtc. Since
      the fb's backing storage was freed this could mean we scan some random
      memory content out afterwards. It's not a big issue since the fb is
      allocated from stolen memory and afaik there is no other user for that
      than i915. It's still cleaner to properly unbind the fb and disable the
      crtc, which is what drm_framebuffer_remove() does.
      
      Note that after
      
      commit 88891eb1e9eca0ba619518bed31580f91e9cf84d
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Feb 10 18:00:38 2014 +0100
      
      we call drm_framebuffer_cleanup() only after dropping the last reference
      on the fb, but that won't happen since we don't unbind the fb. This
      results in a drm core warn about a leaked fb.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9d661251
    • D
      drm/i915: Fix error path leak in fbdev fb allocation · a8bb6818
      Daniel Vetter 提交于
      In Jesse's patch to switch the fbdev framebuffer from an embedded
      struct to a pointer the kfree in case of an error was missed. Fix this
      up by using our own internal fb allocation helper directly instead of
      reinventing that wheel.
      
      We need a to_intel_framebuffer cast unfortunately since all the other
      callers of _create still look better whith using a drm_framebuffer as
      return pointer.
      
      v2: Add an unlocked __intel_framebuffer_create function since our
      dev->struct_mutex locking is too much a mess. With ppgtt we even need
      it to take a look at the global gtt offset of pinned objects, since
      the vma list might chance from underneath us. At least with the
      current global gtt lookup functions. Reported by Mika.
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a8bb6818
    • D
      drm/i915: Use normal fb deref for the fbcon framebuffer · ef2d633e
      Daniel Vetter 提交于
      Now that it's a normally kmalloce buffer we can use the usual cleanup
      paths. The upside here is that if we get the refcounting wrong will be
      able to catch it, since the drm core will complain about leftover
      framebuffers and kref about underflows.
      
      v2: Kill intel_framebuffer_fini - no longer needed now that we
      refcount all fbs properly and only confusing.
      
      v3: We actually still need to call unregister_private to remove the fb
      from the idr and drop the idr reference - the final unref doesn't do
      that. So much for remembering my own fb liftime rules. Reported by
      Imre Deak.
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ef2d633e
    • J
      drm/i915: alloc intel_fb in the intel_fbdev struct · 8bcd4553
      Jesse Barnes 提交于
      Allocate this struct instead, so we can re-use another allocated
      elsewhere if needed.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: WARN_ON if there's no backing storage attached to an fb,
      that's a bug.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8bcd4553
  21. 07 1月, 2014 1 次提交
  22. 18 12月, 2013 1 次提交
  23. 28 11月, 2013 1 次提交
  24. 27 11月, 2013 1 次提交
  25. 21 10月, 2013 1 次提交