21 Nov, 2013

1 commit


20 Nov, 2013

1 commit

  • Addresses
    "[BUG] completely bonkers use of set_need_resched + VM_FAULT_NOPAGE".

    In the first occurence it was used to try to be nice while releasing the
    mmap_sem and retrying the fault to work around a locking inversion.
    The second occurence was never used.

    There has been some discussion whether we should change the locking order to
    mmap_sem -> bo_reserve. This patch doesn't address that issue, and leaves
    that locking order undefined. The solution that we release the mmap_sem if
    tryreserve fails and wait for the buffer to become unreserved is something
    we want in any case, and follows how the core vm system waits for pages
    to be come unlocked while releasing the mmap_sem.

    The code also outlines what needs to be changed if we want to establish the
    locking order as mmap_sem -> bo::reserve.

    One slight issue that remains with this code is that the fault handler might
    be prone to starvation if another thread countinously reserves the buffer.
    IMO that usage pattern is highly unlikely.

    Signed-off-by: Thomas Hellstrom

    Thomas Hellstrom
     

18 Nov, 2013

2 commits


10 Nov, 2013

1 commit

  • So here's the Broadwell pull request. From a kernel driver pov there's
    two areas with big changes in Broadwell:
    - Completely new enumerated interrupt bits. On the plus side it now looks
    fairly unform and sane.
    - Completely new pagetable layout.

    To ensure minimal impact on existing platforms we've refactored both the
    irq and low-level gtt handling code a lot in anticipation of the bdw push.
    So now bdw enabling in these areas just plugs in a bunch of vfuncs.

    Otherwise it's all fairly harmless adjusting of switch cases and
    if-ladders to shovel bdw into the right blocks. So minimized impact on
    existing platforms. I've also merged the bdw-stage1 branch into our
    -nightly integration branch for the past week to make sure we don't break
    anything.

    Note that there's still quite a flurry or patches floating around, but
    I've figured I'll push this out. I plan to keep the bdw fixes separate
    from my usual -fixes stream so that you can reject them easily in case it
    still looks like too much churn. Also, bdw is for now hidden behind the
    preliminary hw enabling module option. So there's no real pressure to get
    follow-up patches all into 3.13.

    * tag 'bdw-stage1-2013-11-08-v2' of git://people.freedesktop.org/~danvet/drm-intel: (75 commits)
    drm/i915: Mask the vblank interrupt on bdw by default
    drm/i915: Wire up cpu fifo underrun reporting support for bdw
    drm/i915: Optimize gen8_enable|disable_vblank functions
    drm/i915: Wire up pipe CRC support for bdw
    drm/i915: Wire up PCH interrupts for bdw
    drm/i915: Wire up port A aux channel
    drm/i915: Fix up the bdw pipe interrupt enable lists
    drm/i915: Optimize pipe irq handling on bdw
    drm/i915/bdw: Take render error interrupt out of the mask
    drm/i915/bdw: Add BDW PCH check first
    drm/i915: Use hsw_crt_get_config on BDW
    drm/i915/bdw: Change dp aux timeout to 600us on DDIA
    drm/i915/bdw: Enable trickle feed on Broadwell
    drm/i915/bdw: WaSingleSubspanDispatchOnAALinesAndPoints
    drm/i915/bdw: conservative SBE VUE cache mode
    drm/i915/bdw: Limit SDE poly depth FIFO to 2
    drm/i915/bdw: Sampler power bypass disable
    ddrm/i915/bdw: Disable centroid pixel perf optimization
    drm/i915/bdw: BWGTLB clock gate disable
    drm/i915/bdw: Implement edp PSR workarounds
    ...

    Dave Airlie
     

09 Nov, 2013

3 commits

  • This adds the pci ids for hawaii.

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • All the BARs have the ability to grow.

    v2: Pulled out the simulator workaround to a separate patch.
    Rebased.

    v3: Rebase onto latest vlv patches from Jesse.

    v4: Rebased on top of the early stolen quirk patch from Jesse.

    v5: Use the new macro names.
    s/INTEL_BDW_PCI_IDS_D/INTEL_BDW_D_IDS
    s/INTEL_BDW_PCI_IDS_M/INTEL_BDW_M_IDS
    It's Jesse's fault for not following the convention I originally set.

    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Cc: Jesse Barnes
    Signed-off-by: Ben Widawsky
    Signed-off-by: Daniel Vetter

    Ben Widawsky
     
  • v2: Squash in "drm/i915/bdw: Add BDW to the HAS_DDI check" as
    suggested by Damien.

    v3: Squash in VEBOX enabling from Zhao Yakui

    v4: Rebase on top of Jesse's patch to extract all pci ids to
    include/drm/i915_pciids.h.

    v4: Replace Halo by its marketing moniker Iris. Requested by Ben.

    v5: Switch from info->has*ring to info->ring_mask.

    v6: Add 0x16X2 variant (which is newer than this patch)
    Rename to use new naming scheme (Chris)
    Remove Simulator PCI ids. These snuck in during rebase (Chris)

    v7: Fix poor sed job from v6
    Make the desktop variants use the desktop macro (Rebase error). Notice
    that this makes no functional difference - it's just confusing.

    Cc: Chris Wilson
    Signed-off-by: Ben Widawsky
    Reviewed-by: Mika Kuoppala
    Signed-off-by: Daniel Vetter

    Ben Widawsky
     

06 Nov, 2013

9 commits

  • Used by the vmwgfx driver

    Signed-off-by: Thomas Hellstrom
    Reviewed-by: Jakob Bornecrantz
    Reviewed-by: Konrad Rzeszutek Wilk

    Thomas Hellstrom
     
  • drm_get_minor() is only used in one file. Make it static and add a
    kernel-doc comment which documents the current semantics.

    Signed-off-by: David Herrmann
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • Allow passing NULL as minor to simplify DRM destruction paths. Also remove
    the double-pointer reset as it is no longer needed. drm_put_minor() is
    only called when the underlying object is destroyed. Hence, resetting
    minors to NULL is not necessary.

    As drm_put_minor() is no longer used by other DRM files, we can make it
    static, too.

    Signed-off-by: David Herrmann
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • Replace the sparse array of booleans with a bitfield.

    Signed-off-by: Chris Wilson
    Reviewed-by: David Herrmann
    Signed-off-by: Dave Airlie

    Chris Wilson
     
  • When a second process opens the device and master transferrence is
    complete, we walk the list of open devices and remove their
    authentication. This also revokes our root privilege. Instead of simply
    dropping the authentication, this patch reverts the authenticated state
    back to its original value.

    Signed-off-by: Chris Wilson
    Reviewed-by: David Herrmann
    Signed-off-by: Dave Airlie

    Chris Wilson
     
  • New helper function to set the preferred video mode. Can be called
    after drm_add_modes_noedid if you don't want the largest supported
    video mode be used by default.

    Signed-off-by: Gerd Hoffmann
    Signed-off-by: Dave Airlie

    Gerd Hoffmann
     
  • Those structures are not used anywhere.

    Signed-off-by: Damien Lespiau
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Dave Airlie

    Lespiau, Damien
     
  • Those functions are just reading data from those pointers.

    Signed-off-by: Damien Lespiau
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Dave Airlie

    Lespiau, Damien
     
  • A change in locking of some kms drivers (currently intel-kms) make
    the old approach too inaccurate and also incompatible with the
    PREEMPT_RT realtime kernel patchset.

    The driver->get_scanout_position() method of intel-kms now needs
    to aquire a spinlock, which clashes badly with the former
    preempt_disable() calls in the drm, and it also introduces larger
    delays and timing uncertainty on a contended lock than acceptable.

    This patch changes the prototype of driver->get_scanout_position()
    to require/allow kms drivers to perform the ktime_get() system time
    queries which go along with actual scanout position readout in a way
    that provides maximum precision and to return those timestamps to
    the drm. kms drivers implementations of get_scanout_position() are
    asked to implement timestamping and scanoutpos readout in a way
    that is as precise as possible and compatible with preempt_disable()
    on a PREMPT_RT kernel. A driver should follow this pattern in
    get_scanout_position() for precision and compatibility:

    spin_lock...(...);
    preempt_disable_rt(); // On a PREEMPT_RT kernel, otherwise omit.
    if (stime) *stime = ktime_get();
    ... Minimum amount of MMIO register reads to get scanout position ...
    ... no taking of locks allowed here! ...
    if (etime) *etime = ktime_get();
    preempt_enable_rt(); // On PREEMPT_RT kernel, otherwise omit.
    spin_unlock...(...);

    v2: Fix formatting of new multi-line code comments.

    Signed-off-by: Mario Kleiner
    Reviewed-by: Ville Syrjälä
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Mario Kleiner
     

05 Nov, 2013

1 commit

  • drm/tegra: Changes for v3.13-rc1

    The biggest part of the changes is the decoupling of the host1x and DRM
    drivers followed by the move of Tegra DRM back to drivers/gpu/drm/tegra
    from whence it came. There is a lot of cleanup as well, and the drivers
    can now be properly unloaded and reloaded.

    HDMI support for the Tegra114 SoC was contributed by Mikko Perttunen.

    gr2d support was extended to Tegra114 and the gr3d driver that has been
    in the works for quite some time finally made it in. All pieces to run
    an OpenGL driver on top of an upstream kernel are now available.

    Support for syncpoint bases was added by Arto Merilainen. This is useful
    for synchronizing between command streams from different engines such as
    gr2d and gr3d.

    Erik Faye-Lund and Wei Yongjun contributed various small fixes. Thanks!

    * tag 'drm/for-3.13-rc1' of git://anongit.freedesktop.org/tegra/linux: (45 commits)
    drm/tegra: Reserve syncpoint base for gr3d
    drm/tegra: Reserve base for gr2d
    drm/tegra: Deliver syncpoint base to user space
    gpu: host1x: Add syncpoint base support
    gpu: host1x: Add 'flags' field to syncpt request
    drm/tegra: Disable clock on probe failure
    gpu: host1x: Disable clock on probe failure
    drm/tegra: Support bottom-up buffer objects
    drm/tegra: Add support for tiled buffer objects
    drm/tegra: Add 3D support
    drm/tegra: Introduce tegra_drm_submit()
    drm/tegra: Use symbolic names for gr2d registers
    drm/tegra: Start connectors with correct DPMS mode
    drm/tegra: hdmi: Enable VDD earlier for hotplug/DDC
    drm/tegra: hdmi: Fix build warnings
    drm/tegra: hdmi: Detect DVI-only displays
    drm/tegra: Add Tegra114 HDMI support
    drm/tegra: hdmi: Parameterize based on compatible property
    drm/tegra: hdmi: Rename tegra{2,3} to tegra{20,30}
    gpu: host1x: Add support for Tegra114
    ...

    Dave Airlie
     

31 Oct, 2013

1 commit

  • The Tegra DRM driver currently uses some infrastructure to defer the DRM
    core initialization until all required devices have registered. The same
    infrastructure can potentially be used by any other driver that requires
    more than a single sub-device of the host1x module.

    Make the infrastructure more generic and keep only the DRM specific code
    in the DRM part of the driver. Eventually this will make it easy to move
    the DRM driver part back to the DRM subsystem.

    Signed-off-by: Thierry Reding

    Thierry Reding
     

23 Oct, 2013

1 commit


22 Oct, 2013

2 commits

  • This adds support for the Armada 510 display subsystem found on the
    Marvell Dove devices. This IP is re-used across several different Marvell
    SoCs with various tweaks, and this driver has been structured to allow
    the other IPs to re-use the bulk of this code; further work in this area
    is expected from interested parties.

    This has been extensively tested on the SolidRun Cubox platform and
    appears to work well there.

    [airlied: update for api changes merged previous to this]

    Dave Airlie
     
  • So drm was abusing device lifetimes, by having embedded device structures
    in the minor and connector it meant that the lifetime of the internal drm
    objects (drm_minor and drm_connector) were tied to the lifetime of the device
    files in sysfs, so if something kept those files opened the current code
    would kfree the objects and things would go downhill from there.

    Now in reality there is no need for these lifetimes to be so intertwined,
    especailly with hotplugging of devices where we wish to remove the sysfs
    and userspace facing pieces before we can unwind the internal objects due
    to open userspace files or mmaps, so split the objects out so the struct
    device is no longer embedded and do what fbdev does and just allocate
    and remove the sysfs inodes separately.

    Signed-off-by: Dave Airlie

    Dave Airlie
     

12 Oct, 2013

1 commit

  • This patch adds support for the pair of LCD controllers on the Marvell
    Armada 510 SoCs. This driver supports:
    - multiple contiguous scanout buffers for video and graphics
    - shm backed cacheable buffer objects for X pixmaps for Vivante GPU
    acceleration
    - dual lcd0 and lcd1 crt operation
    - video overlay on each LCD crt via DRM planes
    - page flipping of the main scanout buffers
    - DRM prime for buffer export/import

    This driver is trivial to extend to other Armada SoCs.

    Included in this commit is the core driver with no output support; output
    support is platform and encoder driver dependent.

    Tested-by: Sebastian Hesselbarth
    Reviewed-by: Rob Clark
    Signed-off-by: Russell King

    Russell King
     

10 Oct, 2013

1 commit

  • The conflict in intel_drv.h tripped me up a bit since a patch in dinq
    moves all the functions around, but another one in drm-next removes a
    single function. So I'ev figured backing this into a backmerge would
    be good.

    i915_dma.c is just adjacent lines changed, nothing nefarious there.

    Conflicts:
    drivers/gpu/drm/i915/i915_dma.c
    drivers/gpu/drm/i915/intel_drv.h

    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

09 Oct, 2013

15 commits

  • Signed-off-by: Jani Nikula
    Reviewed-by: Ville Syrjälä
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Jani Nikula
     
  • The user of these counters was killed in

    commit d79cdc8312689b39c6d83718c1c196af4b3cd18c
    Author: Daniel Vetter
    Date: Thu Aug 8 15:41:32 2013 +0200

    drm: no-op out GET_STATS ioctl

    so clean up the leftovers as well.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • We can get the PCI vendor and device IDs via dev->pdev. So we can drop
    the duplicated information.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • The only user of ctx_count is the via driver, and we can replace that
    use with list_is_singular().

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • 'map_count' and 'work' are never used. Kill them both.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • irq_enabled is only ever 0 or 1, so make it a bool.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • drm_vblank_init() is too ugly. Make it a bit easier on the eye by
    collecting all the per-crtc vblank counters, timestamps etc. to
    a structure and just allocate an array of those.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • vblank_enabled is only ever 0 or 1, so make it a bool.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • vblank_inmodeset is a bitmask, with only two bits mind you, but better
    make it unsigned anyway.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • vblank_disable_allowed is only ever 0 or 1, so make it a bool.

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • Analog to drm_dev_register(), we now provide drm_dev_unregister() which
    does the reverse. drm_dev_put() is still in place and combines the calls
    to drm_dev_unregister() and drm_dev_free() so buses don't have to change.

    *_get() and *_put() are used for reference-counting in the kernel.
    However, drm_dev_put() definitely does not do any kind of ref-counting.
    Hence, use the more appropriate *_register(), *_unregister(), *_alloc()
    and *_free() names.

    Signed-off-by: David Herrmann
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • The error paths in DRM bus drivers currently leak memory as they don't
    correctly revert drm_dev_alloc(). Introduce drm_dev_free() to free DRM
    devices which haven't been registered, yet.

    We must be careful not to introduce any side-effects with cleanups done in
    drm_dev_free(). drm_ht_remove(), drm_ctxbitmap_cleanup() and
    drm_gem_destroy() are all fine in that regard.

    Signed-off-by: David Herrmann
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • All bus drivers do device setup themselves. This requires us to adjust all
    of them if we introduce new core features. Thus, merge all these into a
    uniform drm_dev_register() helper.

    Note that this removes the drm_lastclose() error path for AGP as it is
    horribly broken. Moreover, no bus driver called this in any other error
    path either. Instead, we use the recently introduced AGP cleanup helpers.

    We also keep a DRIVER_MODESET condition around pci_set_drvdata() to keep
    semantics.

    [airlied: keep passing flags through so drivers don't oops on load]

    Signed-off-by: David Herrmann
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • Instead of managing device allocation+initialization in each bus-driver,
    we should do that in a central place. drm_fill_in_dev() already does most
    of it, but also requires the global drm lock for partial AGP device
    registration.

    Split both apart so we have a clean device initialization/allocation
    phase, and a registration phase.

    Signed-off-by: David Herrmann
    Signed-off-by: Dave Airlie

    David Herrmann
     
  • All drivers embed gem-objects into their own buffer objects. There is no
    reason to keep drm_gem_object_alloc(), gem->driver_private and
    ->gem_init_object() anymore.

    New drivers are highly encouraged to do the same. There is no benefit in
    allocating gem-objects separately.

    Cc: Dave Airlie
    Cc: Alex Deucher
    Cc: Daniel Vetter
    Cc: Jerome Glisse
    Cc: Rob Clark
    Cc: Inki Dae
    Cc: Ben Skeggs
    Cc: Patrik Jakobsson
    Signed-off-by: David Herrmann
    Acked-by: Alex Deucher
    Signed-off-by: Dave Airlie

    David Herrmann
     

01 Oct, 2013

1 commit