1. 04 Apr, 2014 5 commits
    • Laurent Pinchart's avatar
      drm: gem-cma: Fix warnings due to improper printk formats · f4d1b021
      Laurent Pinchart authored
      Use the %pad printk specifier to print dma_addr_t variables. This fixes
      warnings on platforms where dma_addr_t has a different size than int or
      size_t.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      f4d1b021
    • Laurent Pinchart's avatar
      drm/cma: Use dma_mmap_writecombine() to mmap buffer · b65e64f7
      Laurent Pinchart authored
      The GEM CMA helpers uses a custom mmap implementation based on
      remap_pfn_range(). While this works when the buffer DMA and physical
      addresses are identical, it fails to take IOMMU into account and tries
      to mmap the buffer to userspace using the DMA virtual address instead of
      the physical address. This results in mapping random physical pages when
      the device is behind an IOMMU.
      
      Use the DMA mapping dma_mmap_writecombine() function instead.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Tested-by: default avatarPhilipp Zabel <philipp.zabel@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      b65e64f7
    • Michel Dänzer's avatar
      drm/mm: Fix search for smallest hole satisfying constraints · 145bccd2
      Michel Dänzer authored
      entry->size is the size of the node, not the size of the hole after it.
      So the code would actually find the hole which can satisfy the
      constraints and which is preceded by the smallest node, not the smallest
      hole satisfying the constraints.
      Reported-by: default avatar"Huang, FrankR" <FrankR.Huang@amd.com>
      Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      145bccd2
    • Shawn Guo's avatar
      drm/cma: include <drm/drmP.h> as needed · 740c22ae
      Shawn Guo authored
      The following error and warnings will be seen when compiling a C file
      which includes <drm/drm_gem_cma_helper.h> but without <drm/drmP.h>
      being included before.
      
      include/drm/drm_gem_cma_helper.h:5:24: error: field ‘base’ has incomplete type
      include/drm/drm_gem_cma_helper.h: In function ‘to_drm_gem_cma_obj’:
      include/drm/drm_gem_cma_helper.h:16:9: warning: initialization from incompatible pointer type [enabled by default]
      include/drm/drm_gem_cma_helper.h: At top level:
      include/drm/drm_gem_cma_helper.h:24:34: warning: ‘struct drm_mode_create_dumb’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:24:34: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
      include/drm/drm_gem_cma_helper.h:24:34: warning: ‘struct drm_device’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:24:34: warning: ‘struct drm_file’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:28:10: warning: ‘struct drm_device’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:28:10: warning: ‘struct drm_file’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:35:3: warning: ‘struct drm_device’ declared inside parameter list [enabled by default]
      include/drm/drm_gem_cma_helper.h:46:14: warning: ‘struct drm_device’ declared inside parameter list [enabled by default]
      
      Fix them by including <drm/drmP.h> in drm_gem_cma_helper.h.
      Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      740c22ae
    • Takashi Iwai's avatar
      drm: Prefer noninterlace cmdline mode unless explicitly specified · c683f427
      Takashi Iwai authored
      Currently drm_pick_cmdline_mode() doesn't care about the interlace
      when the given mode line has no "i" suffix.  That is, when there are
      multiple entries for the same resolution, an interlace mode might be
      picked up just depending on the assigned order, and there is no way to
      exclude it.
      
      This patch changes the logic for the mode selection, to prefer the
      noninterlace mode unless the interlace mode is explicitly given.
      When no matching mode is found, it still tries the interlace mode as
      fallback.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      c683f427
  2. 03 Apr, 2014 12 commits
  3. 02 Apr, 2014 20 commits
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2014-03-21' of git://anongit.freedesktop.org/drm-intel into drm-next · 66e514c1
      Dave Airlie authored
      - Inherit/reuse firmwar framebuffers (for real this time) from Jesse, less
        flicker for fastbooting.
      - More flexible cloning for hdmi (Ville).
      - Some PPGTT fixes from Ben.
      - Ring init fixes from Naresh Kumar.
      - set_cache_level regression fixes for the vma conversion from Ville&Chris.
      - Conversion to the new dp aux helpers (Jani).
      - Unification of runtime pm with pc8 support from Paulo, prep work for runtime
        pm on other platforms than HSW.
      - Larger cursor sizes (Sagar Kamble).
      - Piles of improvements and fixes all over, as usual.
      
      * tag 'drm-intel-next-2014-03-21' of git://anongit.freedesktop.org/drm-intel: (75 commits)
        drm/i915: Include a note about the dangers of I915_READ64/I915_WRITE64
        drm/i915/sdvo: fix questionable return value check
        drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
        drm/i915: Enabling 128x128 and 256x256 ARGB Cursor Support
        drm/i915: Print how many objects are shared in per-process stats
        drm/i915: Per-process stats work better when evaluated per-process
        drm/i915: remove rps local variables
        drm/i915: Remove extraneous MMIO for RPS
        drm/i915: Rename and comment all the RPS *stuff*
        drm/i915: Store the HW min frequency as min_freq
        drm/i915: Fix coding style for RPS
        drm/i915: Reorganize the overclock code
        drm/i915: init pm.suspended earlier
        drm/i915: update the PC8 and runtime PM documentation
        drm/i915: rename __hsw_do_{en, dis}able_pc8
        drm/i915: kill struct i915_package_c8
        drm/i915: move pc8.irqs_disabled to pm.irqs_disabled
        drm/i915: remove dev_priv->pc8.enabled
        drm/i915: don't get/put PC8 when getting/putting power wells
        drm/i915: make intel_aux_display_runtime_get get runtime PM, not PC8
        ...
      
      Conflicts:
      	drivers/gpu/drm/i915/intel_display.c
      	drivers/gpu/drm/i915/intel_dp.c
      66e514c1
    • Dave Airlie's avatar
      Merge branch 'primary-plane' of git://people.freedesktop.org/~robclark/linux into drm-next · 2844ea3f
      Dave Airlie authored
      Here's the latest iteration of the universal planes work, which I believe is
      finally ready for merging.  Aside from the minor driver patches to use the
      new drm_for_each_legacy_plane() macro for plane loops, these should all have
      an r-b from Rob Clark now.
      
      Actual userspace-visibility is currently hidden behind a
      drm.universal_planes module parameter so that we can do some experimental
      testing of this before flipping it on universally.
      
      * 'primary-plane' of git://people.freedesktop.org/~robclark/linux:
        drm/doc: Update plane documentation and add plane helper library
        drm: Allow userspace to ask for universal plane list (v2)
        drm: Remove unused drm_crtc->fb
        drm: Replace crtc fb with primary plane fb (v3)
        drm/msm: Switch to universal plane API's
        drm: Add drm_crtc_init_with_planes() (v2)
        drm: Add plane type property (v2)
        drm: Add drm_universal_plane_init()
        drm: Add primary plane helpers (v3)
        drm: Make drm_crtc_check_viewport non-static
        drm/shmobile: Restrict plane loops to only operate on legacy planes
        drm/i915: Restrict plane loops to only operate on overlay planes (v2)
        drm/exynos: Restrict plane loops to only operate on overlay planes (v2)
        drm: Add support for multiple plane types (v2)
      2844ea3f
    • Daniel Vetter's avatar
      drm/crtc-helper: don't disable disconnected outputs · e3d6ddb3
      Daniel Vetter authored
      This is the equivalent change in the crtc helpers as done to the i915
      modeset infrastructure in
      
      commit b0a2658a
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Dec 18 09:37:54 2012 +0100
      
          drm/i915: don't disable disconnected outputs
      
      This was originally introduced to make encoder sharing on radone
      easier for userspace, but:
      
      - It is policy and as such belongs into userspace. E.g. personally I'm
        fairly annoyed that a flaky cable results in permanent changes of
        the desktop layout, so I'll kick out DEs which do this. Worse if the
        kernel also tries to be clever.
      
      - It's inconsistent: We only kill disconnected outputs on setCrtc
        (which userspace might also call when just changing the
        framebuffer), but not when e.g. we receive a hpd event or in the
        output poll worker.
      
      - It's unexpected behaviour for the userspace driver, at least in the
        intel ddx we've had tons of bugs where the driver fell over and
        killed the X session becuase pageflips/vblanks suddenly stopped
        working. We've had to fix this by wrapping every single setCrtc int
        a big "recover kms state from the kernel again" operation.
      
      - It's suprising for the kernel, too: It took a few mails between Rob,
        Matt and me for them to notice that little dragon wreaking havoc
        with the universal plane framebuffer refcounting.
      
      - Userspace can cope with it and e.g. Gnome already kills disconnected
        outputs and reconfigures the desktop automatically. And since there
        have been no regression reports for the i915 change from over 1 year
        ago I think all other DEs are also ready.
      
      Note that the lines removed in this patch go back to
      
      commit a3a0544b
      Author: Dave Airlie <airlied@redhat.com>
      Date:   Mon Aug 31 15:16:30 2009 +1000
      
          drm/kms: add explicit encoder disable function and detach harder.
      
      Unfortunately the patch itself doesn't explain a hole lot about why it
      was added ...
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      e3d6ddb3
    • Daniel Vetter's avatar
      drm/crtc-helpers: fix dpms on logic · 177cf92d
      Daniel Vetter authored
      This was introduced in
      
      commit 25f397a4
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Jul 19 18:57:11 2013 +0200
      
          drm/crtc-helper: explicit DPMS on after modeset
      
      but due to a bit of rebase fail on my side the patch actually merged
      put one hunk on the wrong side of a break statement. Fix this up.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      177cf92d
    • Maarten Lankhorst's avatar
      drm/qxl: unset a pointer in sync_obj_unref · 41ccec35
      Maarten Lankhorst authored
      This fixes a BUG_ON(bo->sync_obj != NULL); in ttm_bo_release_list.
      
      Cc: stable@vger.kernel.org #v3.10+
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      41ccec35
    • Lespiau, Damien's avatar
      drm: Specify a bit more the DRM_CAP_CURSOR_{WIDTH, HEIGHT} caps · bfe8b573
      Lespiau, Damien authored
      Earlier this week, there was a bit of confusion about those new
      capabilities, to the point I think it's better to document the intention
      and API contract.
      
      The comment documents the current situation:
       - the radeon driver returns the only valid size for the hw
       - i915 returns the maximun cursor size
       - other drivers fall back to returning 64x64
      
      The common contract is to return a valid cursor size.
      
      Cc: Sagar Kamble <sagar.a.kamble@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      bfe8b573
    • Dave Airlie's avatar
      drm/nouveau: don't suspend/resume display on runtime s/r · 05c63c2f
      Dave Airlie authored
      This should ensure we don't hit a locking problem when someone
      wakes us up via a connector, we should never go into suspend
      while the display is on anyways.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      05c63c2f
    • Matt Roper's avatar
    • Matt Roper's avatar
      drm: Allow userspace to ask for universal plane list (v2) · 681e7ec7
      Matt Roper authored
      Userspace clients which wish to receive all DRM planes (primary and
      cursor planes in addition to the traditional overlay planes) may set the
      DRM_CLIENT_CAP_UNIVERSAL_PLANES capability.
      
      v2: Hide behind drm.universal_planes module option [suggested by
          Daniel Vetter]
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      681e7ec7
    • Matt Roper's avatar
      drm: Remove unused drm_crtc->fb · 780f5984
      Matt Roper authored
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      780f5984
    • Matt Roper's avatar
      drm: Replace crtc fb with primary plane fb (v3) · f4510a27
      Matt Roper authored
      Now that CRTC's have a primary plane, there's no need to track the
      framebuffer in the CRTC.  Replace all references to the CRTC fb with the
      primary plane's fb.
      
      This patch was generated by the Coccinelle semantic patching tool using
      the following rules:
      
              @@ struct drm_crtc C; @@
              -   (C).fb
              +   C.primary->fb
      
              @@ struct drm_crtc *C; @@
              -   (C)->fb
              +   C->primary->fb
      
      v3: Generate patch via coccinelle.  Actual removal of crtc->fb has been
          moved to a subsequent patch.
      
      v2: Fixup several lingering crtc->fb instances that were missed in the
          first patch iteration.  [Rob Clark]
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      f4510a27
    • Matt Roper's avatar
      drm/msm: Switch to universal plane API's · 2d82d188
      Matt Roper authored
      Use drm_universal_plane_init() and drm_crtc_init_with_planes() rather
      than the legacy drm_plane_init() / drm_crtc_init().  This will ensure
      that the proper primary plane is registered with the DRM (and eventually
      exposed to userspace in future patches).
      
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      2d82d188
    • Matt Roper's avatar
      drm: Add drm_crtc_init_with_planes() (v2) · e13161af
      Matt Roper authored
      Add a new drm_crtc_init_with_planes() to allow drivers to provide
      specific primary and cursor planes at CRTC initialization.  The existing
      drm_crtc_init() interface remains to avoid driver churn in existing
      drivers; it will initialize the CRTC with a plane helper-created primary
      plane and no cursor plane.
      
      v2:
        - Move drm_crtc_init() to plane helper file so that nothing in the DRM
          core depends on helpers.  [suggested by Daniel Vetter]
        - Keep cursor parameter to drm_crtc_init_with_planes() a void* until
          we actually add cursor support.  [suggested by Daniel Vetter]
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      e13161af
    • Rob Clark's avatar
      drm: Add plane type property (v2) · 9922ab5a
      Rob Clark authored
      Add a plane type property to allow userspace to distinguish plane types.
      
      v2: Driver-specific churn eliminated now that drm_plane_init() and
          drm_universal_plane_init() were separated out in a previous patch.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      9922ab5a
    • Matt Roper's avatar
      drm: Add drm_universal_plane_init() · dc415ff9
      Matt Roper authored
      Add a new plane initialization interface for universal plane support
      that allows a specific plane type (primary, cursor, or overlay) to
      be specified.
      
      drm_plane_init() remains as a compatibility API to reduce churn in
      existing drivers.  The 'bool priv' parameter has been changed to
      'bool is_primary' under the assumption that all existing uses of
      private planes were representing primary planes.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      dc415ff9
    • Matt Roper's avatar
      drm: Add primary plane helpers (v3) · c103d1cf
      Matt Roper authored
      When we expose non-overlay planes to userspace, they will become
      accessible via standard userspace plane API's.  We should be able to
      handle the standard plane operations against primary planes in a generic
      way via the modeset handler.
      
      Drivers that can program primary planes more efficiently, that want to
      use their own primary plane structure to track additional information,
      or that don't have the limitations assumed by the helpers are free to
      provide their own implementation of some or all of these handlers.
      
      v3: Tweak kerneldoc formatting slightly to avoid ugliness
      v2:
       - Move plane helpers to a new file (drm_plane_helper.c)
       - Tighten checks on update handler (check for scaling, CRTC coverage,
         subpixel positioning)
       - Pass proper panning parameters to modeset interface
       - Disallow disabling primary plane (and thus CRTC) if other planes are
         still active on the CRTC.
       - Use a minimal format list that should work on all hardware/drivers.
         Drivers may call this function with a more accurate plane list to
         enable additional formats they can support.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      c103d1cf
    • Matt Roper's avatar
      drm: Make drm_crtc_check_viewport non-static · af93629d
      Matt Roper authored
      This function will be used by the universal plane helpers and may also
      be useful for individual drivers.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      af93629d
    • Matt Roper's avatar
      drm/shmobile: Restrict plane loops to only operate on legacy planes · 2b79dc13
      Matt Roper authored
      Ensure that existing driver loops over all planes do not change behavior
      when we begin adding new types of planes (primary and cursor) to the DRM
      plane list in future patches.
      Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      2b79dc13
    • Matt Roper's avatar
      drm/i915: Restrict plane loops to only operate on overlay planes (v2) · af2b653b
      Matt Roper authored
      Ensure that existing driver loops over all planes do not change behavior
      when we begin adding new types of planes (primary and cursor) to the DRM
      plane list in future patches.
      
      v2: Switch to using drm_for_each_legacy_plane()
      
      Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      af2b653b
    • Matt Roper's avatar
      drm/exynos: Restrict plane loops to only operate on overlay planes (v2) · 0886327a
      Matt Roper authored
      Ensure that existing driver loops over all planes do not change behavior
      when we begin adding new types of planes (primary and cursor) to the DRM
      plane list in future patches.
      
      v2: Switch to using drm_for_each_legacy_plane()
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      0886327a
  4. 01 Apr, 2014 1 commit
  5. 31 Mar, 2014 2 commits