1. 14 5月, 2014 1 次提交
  2. 24 4月, 2014 1 次提交
  3. 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
  4. 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
  5. 06 3月, 2014 3 次提交
  6. 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
  7. 07 1月, 2014 1 次提交
  8. 18 12月, 2013 1 次提交
  9. 28 11月, 2013 1 次提交
  10. 27 11月, 2013 1 次提交
  11. 21 10月, 2013 1 次提交
  12. 12 10月, 2013 1 次提交
  13. 01 10月, 2013 3 次提交
  14. 07 8月, 2013 1 次提交
  15. 09 7月, 2013 1 次提交
    • B
      drm/i915: Getter/setter for object attributes · f343c5f6
      Ben Widawsky 提交于
      Soon we want to gut a lot of our existing assumptions how many address
      spaces an object can live in, and in doing so, embed the drm_mm_node in
      the object (and later the VMA).
      
      It's possible in the future we'll want to add more getter/setter
      methods, but for now this is enough to enable the VMAs.
      
      v2: Reworked commit message (Ben)
      Added comments to the main functions (Ben)
      sed -i "s/i915_gem_obj_set_color/i915_gem_obj_ggtt_set_color/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_bound/i915_gem_obj_ggtt_bound/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_size/i915_gem_obj_ggtt_size/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_offset/i915_gem_obj_ggtt_offset/" drivers/gpu/drm/i915/*.[ch]
      (Daniel)
      
      v3: Rebased on new reserve_node patch
      Changed DRM_DEBUG_KMS to actually work (will need fixing later)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f343c5f6
  16. 17 6月, 2013 1 次提交
  17. 10 6月, 2013 1 次提交
  18. 03 6月, 2013 2 次提交
  19. 08 5月, 2013 1 次提交
  20. 07 4月, 2013 1 次提交
  21. 27 3月, 2013 1 次提交
  22. 23 3月, 2013 1 次提交
  23. 05 3月, 2013 1 次提交
  24. 14 2月, 2013 3 次提交
  25. 27 1月, 2013 1 次提交
  26. 21 1月, 2013 2 次提交
    • D
      drm: revamp framebuffer cleanup interfaces · 36206361
      Daniel Vetter 提交于
      We have two classes of framebuffer
      - Created by the driver (atm only for fbdev), and the driver holds
        onto the last reference count until destruction.
      - Created by userspace and associated with a given fd. These
        framebuffers will be reaped when their assoiciated fb is closed.
      
      Now these two cases are set up differently, the framebuffers are on
      different lists and hence destruction needs to clean up different
      things. Also, for userspace framebuffers we remove them from any
      current usage, whereas for internal framebuffers it is assumed that
      the driver has done this already.
      
      Long story short, we need two different ways to cleanup such drivers.
      Three functions are involved in total:
      - drm_framebuffer_remove: Convenience function which removes the fb
        from all active usage and then drops the passed-in reference.
      - drm_framebuffer_unregister_private: Will remove driver-private
        framebuffers from relevant lists and drop the corresponding
        references. Should be called for driver-private framebuffers before
        dropping the last reference (or like for a lot of the drivers where
        the fbdev is embedded someplace else, before doing the cleanup
        manually).
      - drm_framebuffer_cleanup: Final cleanup for both classes of fbs,
        should be called by the driver's ->destroy callback once the last
        reference is gone.
      
      This patch just rolls out the new interfaces and updates all drivers
      (by adding calls to drm_framebuffer_unregister_private at all the
      right places)- no functional changes yet. Follow-on patches will move
      drm core code around and update the lifetime management for
      framebuffers, so that we are no longer required to keep framebuffers
      alive by locking mode_config.mutex.
      
      I've also updated the kerneldoc already.
      
      vmwgfx seems to again be a bit special, at least I haven't figured out
      how the fbdev support in that driver works. It smells like it's
      external though.
      
      v2: The i915 driver creates another private framebuffer in the
      load-detect code. Adjust its cleanup code, too.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      36206361
    • D
      drm/i915: use drm_modeset_lock_all · a0e99e68
      Daniel Vetter 提交于
      Two exceptions:
      - debugfs files only read information which is not related to crtc, so
        can stay on the modeset_config lock.
      - Same holds for the edp vdd work in intel_dp.c. Add a corresponding
        WARN_ON and a comment next to the intel_dp struct fields for
        documentation.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a0e99e68