1. 20 Nov, 2014 7 commits
    • Tetsuo Handa's avatar
      drm/ttm: Avoid memory allocation from shrinker functions. · 881fdaa5
      Tetsuo Handa authored
      Andrew Morton wrote:
      > On Wed, 12 Nov 2014 13:08:55 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
      >
      > > Andrew Morton wrote:
      > > > Poor ttm guys - this is a bit of a trap we set for them.
      > >
      > > Commit a91576d7 ("drm/ttm: Pass GFP flags in order to avoid deadlock.")
      > > changed to use sc->gfp_mask rather than GFP_KERNEL.
      > >
      > > -       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *),
      > > -                       GFP_KERNEL);
      > > +       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
      > >
      > > But this bug is caused by sc->gfp_mask containing some flags which are not
      > > in GFP_KERNEL, right? Then, I think
      > >
      > > -       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
      > > +       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp & GFP_KERNEL);
      > >
      > > would hide this bug.
      > >
      > > But I think we should use GFP_ATOMIC (or drop __GFP_WAIT flag)
      >
      > Well no - ttm_page_pool_free() should stop calling kmalloc altogether.
      > Just do
      >
      > 	struct page *pages_to_free[16];
      >
      > and rework the code to free 16 pages at a time.  Easy.
      
      Well, ttm code wants to process 512 pages at a time for performance.
      Memory footprint increased by 512 * sizeof(struct page *) buffer is
      only 4096 bytes. What about using static buffer like below?
      ----------
      >From d3cb5393c9c8099d6b37e769f78c31af1541fe8c Mon Sep 17 00:00:00 2001
      From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Date: Thu, 13 Nov 2014 22:21:54 +0900
      Subject: [PATCH] drm/ttm: Avoid memory allocation from shrinker functions.
      
      Commit a91576d7 ("drm/ttm: Pass GFP flags in order to avoid
      deadlock.") caused BUG_ON() due to sc->gfp_mask containing flags
      which are not in GFP_KERNEL.
      
        https://bugzilla.kernel.org/show_bug.cgi?id=87891
      
      Changing from sc->gfp_mask to (sc->gfp_mask & GFP_KERNEL) would
      avoid the BUG_ON(), but avoiding memory allocation from shrinker
      function is better and reliable fix.
      
      Shrinker function is already serialized by global lock, and
      clean up function is called after shrinker function is unregistered.
      Thus, we can use static buffer when called from shrinker function
      and clean up function.
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [2.6.35+]
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      881fdaa5
    • Fabian Frederick's avatar
      drm: remove unnecessary sizeof(u8) · 2b0a3c40
      Fabian Frederick authored
      sizeof(u8) is always 1.
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      2b0a3c40
    • Boris BREZILLON's avatar
      drm: omapdrm: remove unused variable · aeb24cc0
      Boris BREZILLON authored
      Commit f9b9faf6d94dd29eab8c128905c7d091f955481d "drm: flip-work: change
      drm_flip_work_init prototype" changed the drm_flip_work_init prototype
      to a void function, which makes 'ret' an unused variable.
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      aeb24cc0
    • Gerd Hoffmann's avatar
      bochs: add page_flip · 3ce733b9
      Gerd Hoffmann authored
      Implement crtc page_flip callback for bochsdrm.  The qemu stdvga has no
      vblank signaling, so we have to fake it.  We do so by instantly calling
      drm_send_vblank_event.  Tested with kmscon.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      3ce733b9
    • Gerd Hoffmann's avatar
      bochs: fix bochsdrmfb mmap · 49b70a31
      Gerd Hoffmann authored
      Remove the mapping offset from the bo backing the fbdev framebuffer.
      Wire up fbdev mmap function to map the backing bo using ttm_fbdev_mmap.
      With that patch in place mmap(/dev/fb0) works as expected.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      49b70a31
    • Gerd Hoffmann's avatar
      bochs: add endian switching support · 9ecdb039
      Gerd Hoffmann authored
      Recently (qemu 2.2+) the qemu stdvga got a register to switch the vga
      framebuffer endianness.  This patch adds code to explicitly set the
      endianness of the framebuffer.  In most cases this has no effect as
      the default is guest architecture endianness.  It is needed though in
      case a architecture supports both big and little endian, i.e. for
      ppc64le.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      9ecdb039
    • Gerd Hoffmann's avatar
      bochs: little cleanup · fbd2f9fe
      Gerd Hoffmann authored
      Drop some leftover, commented code.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      fbd2f9fe
  2. 16 Nov, 2014 22 commits
  3. 15 Nov, 2014 1 commit
  4. 14 Nov, 2014 10 commits
    • Dave Airlie's avatar
      Merge tag 'drm/gem-cma/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux into drm-next · ca5a71de
      Dave Airlie authored
      drm: Sanitize DRM_IOCTL_MODE_CREATE_DUMB input
      
      Some drivers erroneously treat the .pitch and .size fields of struct
      drm_mode_create_dumb as inputs. While the include/uapi/drm/drm_mode.h
      header has a comment denoting them as outputs, that seemingly wasn't
      enough to make drivers use them properly.
      
      The result is that some userspace doesn't explicitly zero out those
      fields, assuming that the kernel won't use them. That causes problems
      since the data within the structure might be uninitialized, so bogus
      data may end up confusing drivers (ridiculously large values for the
      pitch, ...).
      
      This series attempts to improve the situation by fixing all drivers to
      not use the output fields. Furthermore to spare new drivers this bad
      surprise, the DRM core now zeros out these fields prior to handing the
      data structure to the driver.
      
      Lessons learned from this are that future IOCTLs should be properly
      documented (in the DRM DocBook for example) and should be rigorously
      defined. To prevent misuse like this, userspace should be required to
      zero out all output fields. The kernel should check for this and fail
      if that's not the case.
      
      * tag 'drm/gem-cma/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux:
        drm/cma: Remove call to drm_gem_free_mmap_offset()
        drm: Sanitize DRM_IOCTL_MODE_CREATE_DUMB input
        drm/rcar: gem: dumb: pitch is an output
        drm/omap: gem: dumb: pitch is an output
        drm/cma: Introduce drm_gem_cma_dumb_create_internal()
        drm/doc: Add GEM/CMA helpers to kerneldoc
        drm/doc: mm: Fix indentation
        drm/gem: Fix a few kerneldoc typos
      ca5a71de
    • Dave Airlie's avatar
      drm/qxl: use suggested x/y offset properties to pass guest prefs · 7dea0941
      Dave Airlie authored
      This passes the guest preferences for a where to place the
      outputs through to userspace. Userspace would need to be updated
      to take note of this information, X server and GNOME.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      7dea0941
    • Dave Airlie's avatar
      drm: add properties for suggested x/y offset for connectors. (v2) · 5bb2bbf5
      Dave Airlie authored
      Virtual GPUs would like to give the guest some indication where on the screen
      the outputs are layed out. So far we only provide modes, these
      properties could be exposed to userspace so the desktop environment
      could use them as hints to set the correct offsets.
      
      v2: rename properties to be more consistent.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      5bb2bbf5
    • Daniel Vetter's avatar
      drm: Simplify return value handling in drm_crtc.c · baf698b0
      Daniel Vetter authored
      While looking through drm_crtc.c to double-check make locking changes
      I've noticed that there's a few other places that would now benefit
      from simplified return value handling.
      
      So let's flatten the control flow and replace and always 0 ret with 0
      where possible.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      baf698b0
    • Dave Airlie's avatar
      Merge tag 'drm/tegra/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux into drm-next · b0654103
      Dave Airlie authored
      drm/tegra: Changes for v3.19-rc1
      
      The highlights in this pull request are:
      
        * IOMMU support: The Tegra DRM driver can now deal with discontiguous
          buffers if an IOMMU exists in the system. That means it can allocate
          using drm_gem_get_pages() and will map them into IOVA space via the
          IOMMU API. Similarly, non-contiguous PRIME buffers can be imported
          from a different driver, which allows better integration with gk20a
          (nouveau) and less hacks.
      
        * Universal planes: This is precursory work for atomic modesetting and
          will allow hardware cursor support to be implemented on pre-Tegra114
          where RGB cursors were not supported.
      
        * DSI ganged-mode support: The DSI controller can now gang up with a
          second DSI controller to drive high resolution DSI panels.
      
      Besides those bigger changes there is a slew of fixes, cleanups, plugged
      memory leaks and so on.
      
      * tag 'drm/tegra/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux: (44 commits)
        drm/tegra: gem: Check before freeing CMA memory
        drm/tegra: fb: Add error codes to error messages
        drm/tegra: fb: Properly release GEM objects on failure
        drm/tegra: Detach panel when a connector is removed
        drm/tegra: Plug memory leak
        drm/tegra: gem: Use more consistent data types
        drm/tegra: fb: Do not destroy framebuffer
        drm/tegra: gem: dumb: pitch and size are outputs
        drm/tegra: Enable the hotplug interrupt only when necessary
        drm/tegra: dc: Universal plane support
        drm/tegra: dc: Registers are 32 bits wide
        drm/tegra: dc: Factor out DC, window and cursor commit
        drm/tegra: Add IOMMU support
        drm/tegra: Fix error handling cleanup
        drm/tegra: gem: Use dma_mmap_writecombine()
        drm/tegra: gem: Remove redundant drm_gem_free_mmap_offset()
        drm/tegra: gem: Cleanup tegra_bo_create_with_handle()
        drm/tegra: gem: Extract tegra_bo_alloc_object()
        drm/tegra: dsi: Set up PHY_TIMING & BTA_TIMING registers earlier
        drm/tegra: dsi: Replace 1000000 by USEC_PER_SEC
        ...
      b0654103
    • Dave Airlie's avatar
      Merge tag 'drm/fixes/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux into drm-next · 4fb2ac6e
      Dave Airlie authored
      drm: Miscellaneous fixes for v3.19-rc1
      
      This is a small collection of fixes that I've been carrying around for a
      while now. Many of these have been posted and reviewed or acked. The few
      that haven't I deemed too trivial to bother.
      
      * tag 'drm/fixes/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux:
        video/hdmi: Relicense header under MIT license
        drm/gma500: mdfld: Reuse video/mipi_display.h
        drm: Make drm_mode_create_tv_properties() signature consistent
        drm: Implement drm_get_pci_dev() dummy for !PCI
        drm/prime: Use unsigned type for number of pages
        drm/gem: Fix typo in kerneldoc
        drm: Use const data when creating blob properties
        drm: Use size_t for blob property sizes
      4fb2ac6e
    • Dave Airlie's avatar
      Merge tag 'drm/panel/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux into drm-next · 8aa3dc3c
      Dave Airlie authored
      drm/panel: Changes for v3.19-rc1
      
      This contains support for a couple of new panels, updates for some GPIO
      API changes and a bunch of updates to the MIPI DSI support that should
      make it easier to write panel drivers in the future.
      
      * tag 'drm/panel/for-3.19-rc1' of git://people.freedesktop.org/~tagr/linux: (31 commits)
        drm/panel: Add Sharp LQ101R1SX01 support
        drm/dsi: Do not require .owner field to be set
        drm/dsi: Resolve MIPI DSI device from phandle
        drm/dsi: Implement DCS set_{column,page}_address commands
        drm/dsi: Implement DCS {get,set}_pixel_format commands
        drm/dsi: Implement DCS get_power_mode command
        drm/dsi: Implement DCS soft_reset command
        drm/dsi: Implement DCS nop command
        drm/dsi: Add to DocBook documentation
        drm/dsi: Implement some standard DCS commands
        drm/dsi: Implement generic read and write commands
        drm/panel: s6e8aa0: Use standard MIPI DSI function
        drm/dsi: Add mipi_dsi_set_maximum_return_packet_size() helper
        drm/dsi: Constify mipi_dsi_msg
        drm/dsi: Make mipi_dsi_dcs_{read,write}() symmetrical
        drm/dsi: Add DSI transfer helper
        drm/dsi: Add message to packet translator
        drm/dsi: Introduce packet format helpers
        drm/panel: s6e8aa0: Fix build warnings on 64-bit
        drm/panel: ld9040: Fix build warnings on 64-bit
        ...
      8aa3dc3c
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2014-11-07-fixups' of... · fd172d0c
      Dave Airlie authored
      Merge tag 'drm-intel-next-2014-11-07-fixups' of git://anongit.freedesktop.org/drm-intel into drm-next
      
      - skl watermarks code (Damien, Vandana, Pradeep)
      - reworked audio codec /eld handling code (Jani)
      - rework the mmio_flip code to use the vblank evade logic and wait for rendering
        using the standard wait_seqno interface (Ander)
      - skl forcewake support (Zhe Wang)
      - refactor the chv interrupt code to use functions shared with vlv (Ville)
      - prep work for different global gtt views (Tvrtko Ursulin)
      - precompute the display PLL config before touching hw state (Ander)
      - completely reworked panel power sequencer code for chv/vlv (Ville)
      - pre work to split the plane update code into a prepare and commit phase
        (Gustavo Padovan)
      - golden context for skl (Armin Reese)
      - as usual tons of fixes and improvements all over
      
      * tag 'drm-intel-next-2014-11-07-fixups' of git://anongit.freedesktop.org/drm-intel: (135 commits)
        drm/i915: Use correct pipe config to update pll dividers. V2
        drm/i915: Plug memory leak in intel_shared_dpll_start_config()
        drm/i915: Update DRIVER_DATE to 20141107
        drm/i915: Add gen to the gpu hang ecode
        drm/i915: Cache HPLL frequency on VLV/CHV
        Revert "drm/i915/vlv: Remove check for Old Ack during forcewake"
        drm/i915: Make mmio flip wait for seqno in the work function
        drm/i915: Make __wait_seqno non-static and rename to __i915_wait_seqno
        drm/i915: Move the .global_resources() hook call into modeset_update_crtc_power_domains()
        drm/i915/audio: add DOC comment describing HDA over HDMI/DP
        drm/i915: make pipe/port based audio valid accessors easier to use
        drm/i915/audio: add audio codec enable debug log for g4x
        drm/i915/audio: add audio codec disable on g4x
        drm/i915: enable audio codec after port
        drm/i915/audio: add vlv/chv/gen5-7 audio codec disable sequence
        drm/i915/audio: rewrite vlv/chv and gen 5-7 audio codec enable sequence
        drm/i915/skl: Enable Gen9 RC6
        drm/i915/skl: Gen9 Forcewake
        drm/i915/skl: Log the order in which we flush the pipes in the WM code
        drm/i915/skl: Flush the WM configuration
        ...
      fd172d0c
    • Chris Wilson's avatar
      drm/dp/mst: Handle invalid link bandwidth from DPCD gracefully · b853fdb3
      Chris Wilson authored
      Don't BUG out if the link reports an invalid (or plain unknown)
      bandwidth value, but report the failure and fail gracefully.
      
      Fixes a trivial compiler warning in case the BUG is ever compiled away.
      
      Link: http://lkml.kernel.org/p/1415785566-12758-1-git-send-email-geert@linux-m68k.orgSigned-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      b853fdb3
    • Rob Clark's avatar
      drm/atomic: rip out unnecessary locking checks · db883628
      Rob Clark authored
      For async commit, it is *intentional* that those locks are not held.
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      db883628