11 Jan, 2012

1 commit

  • * 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (307 commits)
    drm/nouveau/pm: fix build with HWMON off
    gma500: silence gcc warnings in mid_get_vbt_data()
    drm/ttm: fix condition (and vs or)
    drm/radeon: double lock typo in radeon_vm_bo_rmv()
    drm/radeon: use after free in radeon_vm_bo_add()
    drm/sis|via: don't return stack garbage from free_mem ioctl
    drm/radeon/kms: remove pointless CS flags priority struct
    drm/radeon/kms: check if vm is supported in VA ioctl
    drm: introduce drm_can_sleep and use in intel/radeon drivers. (v2)
    radeon: Fix disabling PCI bus mastering on big endian hosts.
    ttm: fix agp since ttm tt rework
    agp: Fix multi-line warning message whitespace
    drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages.
    drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool.
    drm/radeon/kms: sync across multiple rings when doing bo moves v3
    drm/radeon/kms: Add support for multi-ring sync in CS ioctl (v2)
    drm/radeon: GPU virtual memory support v22
    drm: make DRM_UNLOCKED ioctls with their own mutex
    drm: no need to hold global mutex for static data
    drm/radeon/benchmark: common modes sweep ignores 640x480@32
    ...

    Fix up trivial conflicts in radeon/evergreen.c and vmwgfx/vmwgfx_kms.c

    Linus Torvalds
     

06 Jan, 2012

1 commit

  • So we have a few places where the drm drivers would like to sleep to
    be nice to the system, mainly in the modesetting paths, but we also
    have two cases were atomic modesetting must take place, panic writing
    and kernel debugger. So provide a central inline to determine if a
    sleep or delay should be used and use this in the intel and radeon drivers.

    v2: drop intel_drv.h MSLEEP macro, nobody uses it.

    Based on patch from Michel Dänzer

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43941

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

    Dave Airlie
     

20 Dec, 2011

1 commit


02 Dec, 2011

1 commit


11 Nov, 2011

2 commits

  • From fdf1fdebaa00f81de18c227f32f8074c8b352d50 Mon Sep 17 00:00:00 2001
    From: Arjan van de Ven
    Date: Sun, 30 Oct 2011 19:06:07 -0700
    Subject: [PATCH] drm: Make the per-driver file_operations struct const

    The DRM layer keeps a copy of struct file_operations inside its
    big driver struct... which prevents it from being consistent and static.
    For consistency (and the general security objective of having such things
    static), it's desirable to get this fixed.

    This patch splits out the file_operations field to its own struct,
    which is then "static const", and just stick a pointer to this into
    the driver struct, making it more consistent with how the rest of the
    kernel does this.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Dave Airlie

    Arjan van de Ven
     
  • Nouveau, when configured with debugfs, creates debugfs files for every
    channel, so structure holding list of files needs to be protected from
    simultaneous changes by multiple threads.

    Without this patch it's possible to hit kernel oops in
    drm_debugfs_remove_files just by running a couple of xterms with
    looped glxinfo.

    Signed-off-by: Marcin Slusarz
    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Marcin Slusarz
     

07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

01 Nov, 2011

2 commits

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • The pretty much brings in the kitchen sink along
    with it, so it should be avoided wherever reasonably possible in
    terms of being included from other commonly used
    files, as it results in a measureable increase on compile times.

    The worst culprit was probably device.h since it is used everywhere.
    This file also had an implicit dependency/usage of mutex.h which was
    masked by module.h, and is also fixed here at the same time.

    There are over a dozen other headers that simply declare the
    struct instead of pulling in the whole file, so follow their lead
    and simply make it a few more.

    Most of the implicit dependencies on module.h being present by
    these headers pulling it in have been now weeded out, so we can
    finally make this change with hopefully minimal breakage.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

30 Aug, 2011

1 commit


25 Jul, 2011

1 commit

  • These small changes should allow GEM to be used with non shmem objects as
    well as shmem objects. In the GMA500 case it allows the base framebuffer to
    appear as a GEM object and thus acquire a handle and work with KMS.

    For i915 it ought to be trivial to get back the wasted memory but putting the
    system fb back into stolen RAM and in general I can imagine it allowing the
    use of GEM and thus KMS with all the older cards that have their framebuffer
    firmly placed in video RAM.

    Signed-off-by: Alan Cox
    Tested-by: Rob Clark
    Signed-off-by: Dave Airlie

    Alan Cox
     

13 Jul, 2011

1 commit

  • drm_pci_device_is_pcie duplicates the funcationality of pci_is_pcie.
    Convert callers of the former to the latter. This has the side benefit
    of removing an unnecessary search in the PCI configuration space due to
    using a saved PCIe capability offset.

    [airlied: update for new callsite]

    Signed-off-by: Jon Mason
    Signed-off-by: Dave Airlie

    Jon Mason
     

21 Jun, 2011

1 commit


28 Apr, 2011

3 commits

  • In the absence of configuration data for providing the fixed mode for
    a panel, I would like to be able to pass such modes along a separate
    module paramenter. To do so, I then need to parse a modeline from a
    string, which drm is already capable of. Export that capability to the
    drivers.

    Signed-off-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Chris Wilson
     
  • Add __attribute__((format (printf, 4, 5))) to drm_ut_debug_printk
    and fix fallout.

    Signed-off-by: Joe Perches
    Signed-off-by: Dave Airlie

    Joe Perches
     
  • Reduce drm text size ~1% by using drm_err and
    printf extension %pV to emit error messages.

    Remove unused macro DRM_MEM_ERROR.

    $ size drivers/gpu/drm/built-in.o*
    text data bss dec hex filename
    361159 9663 256 371078 5a986 drivers/gpu/drm/built-in.o.new
    365416 9663 256 375335 5ba27 drivers/gpu/drm/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Dave Airlie

    Joe Perches
     

31 Mar, 2011

1 commit


14 Mar, 2011

1 commit

  • * 'intel/drm-intel-next' of ../drm-next: (755 commits)
    drm/i915: Only wait on a pending flip if we intend to write to the buffer
    drm/i915/dp: Sanity check eDP existence
    drm/i915: Rebind the buffer if its alignment constraints changes with tiling
    drm/i915: Disable GPU semaphores by default
    drm/i915: Do not overflow the MMADDR write FIFO
    Revert "drm/i915: fix corruptions on i8xx due to relaxed fencing"
    drm/i915: Don't save/restore hardware status page address register
    drm/i915: don't store the reg value for HWS_PGA
    drm/i915: fix memory corruption with GM965 and >4GB RAM
    Linux 2.6.38-rc7
    Revert "TPM: Long default timeout fix"
    drm/i915: Re-enable GPU semaphores for SandyBridge mobile
    drm/i915: Replace vblank PM QoS with "Interrupt-Based AGPBUSY#"
    Revert "drm/i915: Use PM QoS to prevent C-State starvation of gen3 GPU"
    drm/i915: Allow relocation deltas outside of target bo
    drm/i915: Silence an innocuous compiler warning for an unused variable
    fs/block_dev.c: fix new kernel-doc warning
    ACPI: Fix build for CONFIG_NET unset
    mm: must include
    x86: Use u32 instead of long to set reset vector back to 0
    ...

    Conflicts:
    drivers/gpu/drm/i915/i915_gem.c

    Dave Airlie
     

04 Mar, 2011

1 commit

  • We're coming to see a need to have a set of generic capability checks in
    the core DRM, in addition to the driver-specific ioctls that already
    exist.

    This patch defines an ioctl to do as such, but does not yet define any
    capabilities.

    [airlied: drop the driver callback for now.]

    Signed-off-by: Ben Skeggs
    Signed-off-by: Dave Airlie

    Ben Skeggs
     

28 Feb, 2011

1 commit


07 Feb, 2011

3 commits

  • This adds an initial framework to plug USB graphics devices
    into the drm/kms subsystem.

    I've started writing a displaylink driver using this interface.

    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • This abstracts the pci/platform interface out a step further,
    we can go further but this is far enough for now to allow USB
    to be plugged in.

    The drivers now just call the init code directly for their
    device type.

    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • This is just an idea that might or might not be a good idea,
    it basically adds two ioctls to create a dumb and map a dumb buffer
    suitable for scanout. The handle can be passed to the KMS ioctls to create
    a framebuffer.

    It looks to me like it would be useful in the following cases:
    a) in development drivers - we can always provide a shadowfb fallback.
    b) libkms users - we can clean up libkms a lot and avoid linking
    to libdrm_*.
    c) plymouth via libkms is a lot easier.

    Userspace bits would be just calls + mmaps. We could probably
    mark these handles somehow as not being suitable for acceleartion
    so as top stop people who are dumber than dumb.

    Signed-off-by: Dave Airlie

    Dave Airlie
     

31 Jan, 2011

1 commit

  • Hugh Dickins found that characters in xterm were going missing and oft
    delayed. Being the curious type, he managed to associate this with the
    new high-precision vblank patches; disabling these he found, restored
    the orderliness of his characters.

    The oddness begins when one realised that Hugh was not using vblanks at
    all on his system (fvwm and some xterms). Instead, all he had to go on
    were warning of a pipe underrun, curiously enough at around 60Hz. He
    poked and found that in addition to the underrun warning, the hardware
    was flagging the start of a new frame, a vblank, which in turn was
    kicking off the pending vblank processing code.

    There is little we can do for the underruns on Hugh's machine, a
    Crestline [965GM], which must have its FIFO watermarks set to 8.
    However, we do not need to process the vblank if we know that they are
    disabled...

    Reported-by: Hugh Dickins
    Signed-off-by: Chris Wilson

    Chris Wilson
     

05 Jan, 2011

1 commit


17 Dec, 2010

1 commit


24 Nov, 2010

1 commit


22 Nov, 2010

1 commit

  • The DRI2 swap & sync implementation needs precise
    vblank counts and precise timestamps corresponding
    to those vblank counts. For conformance to the OpenML
    OML_sync_control extension specification the DRM
    timestamp associated with a vblank count should
    correspond to the start of video scanout of the first
    scanline of the video frame following the vblank
    interval for that vblank count.

    Therefore we need to carry around precise timestamps
    for vblanks. Currently the DRM and KMS drivers generate
    timestamps ad-hoc via do_gettimeofday() in some
    places. The resulting timestamps are sometimes not
    very precise due to interrupt handling delays, they
    don't conform to OML_sync_control and some are wrong,
    as they aren't taken synchronized to the vblank.

    This patch implements support inside the drm core
    for precise and robust timestamping. It consists
    of the following interrelated pieces.

    1. Vblank timestamp caching:

    A per-crtc ringbuffer stores the most recent vblank
    timestamps corresponding to vblank counts.

    The ringbuffer can be read out lock-free via the
    accessor function:

    struct timeval timestamp;
    vblankcount = drm_vblank_count_and_time(dev, crtcid, ×tamp).

    The function returns the current vblank count and
    the corresponding timestamp for start of video
    scanout following the vblank interval. It can be
    used anywhere between enclosing drm_vblank_get(dev, crtcid)
    and drm_vblank_put(dev,crtcid) statements. It is used
    inside the drmWaitVblank ioctl and in the vblank event
    queueing and handling. It should be used by kms drivers for
    timestamping of bufferswap completion.

    The timestamp ringbuffer is reinitialized each time
    vblank irq's get reenabled in drm_vblank_get()/
    drm_update_vblank_count(). It is invalidated when
    vblank irq's get disabled.

    The ringbuffer is updated inside drm_handle_vblank()
    at each vblank irq.

    2. Calculation of precise vblank timestamps:

    drm_get_last_vbltimestamp() is used to compute the
    timestamp for the end of the most recent vblank (if
    inside active scanout), or the expected end of the
    current vblank interval (if called inside a vblank
    interval). The function calls into a new optional kms
    driver entry point dev->driver->get_vblank_timestamp()
    which is supposed to provide the precise timestamp.
    If a kms driver doesn't implement the entry point or
    if the call fails, a simple do_gettimeofday() timestamp
    is returned as crude approximation of the true vblank time.

    A new drm module parameter drm.timestamp_precision_usec
    allows to disable high precision timestamps (if set to
    zero) or to specify the maximum acceptable error in
    the timestamps in microseconds.

    Kms drivers could implement their get_vblank_timestamp()
    function in a gpu specific way, as long as returned
    timestamps conform to OML_sync_control, e.g., by use
    of gpu specific hardware timestamps.

    Optionally, kms drivers can simply wrap and use the new
    utility function drm_calc_vbltimestamp_from_scanoutpos().
    This function calls a new optional kms driver function
    dev->driver->get_scanout_position() which returns the
    current horizontal and vertical video scanout position
    of the crtc. The scanout position together with the
    drm_display_timing of the current video mode is used
    to calculate elapsed time relative to start of active scanout
    for the current video frame. This elapsed time is subtracted
    from the current do_gettimeofday() time to get the timestamp
    corresponding to start of video scanout. Currently
    non-interlaced, non-doublescan video modes, with or
    without panel scaling are handled correctly. Interlaced/
    doublescan modes are tbd in a future patch.

    3. Filtering of redundant vblank irq's and removal of
    some race-conditions in the vblank irq enable/disable path:

    Some gpu's (e.g., Radeon R500/R600) send spurious vblank
    irq's outside the vblank if vblank irq's get reenabled.
    These get detected by use of the vblank timestamps and
    filtered out to avoid miscounting of vblanks.

    Some race-conditions between the vblank irq enable/disable
    functions, the vblank irq handler and the gpu itself (updating
    its hardware vblank counter in the "wrong" moment) are
    fixed inside vblank_disable_and_save() and
    drm_update_vblank_count() by use of the vblank timestamps and
    a new spinlock dev->vblank_time_lock.

    The time until vblank irq disable is now configurable via
    a new drm module parameter drm.vblankoffdelay to allow
    experimentation with timeouts that are much shorter than
    the current 5 seconds and should allow longer vblank off
    periods for better power savings.

    Followup patches will use these new functions to
    implement precise timestamping for the intel and radeon
    kms drivers.

    Signed-off-by: Mario Kleiner
    Signed-off-by: Dave Airlie

    Mario Kleiner
     

01 Nov, 2010

1 commit


06 Oct, 2010

1 commit


01 Oct, 2010

3 commits

  • Only drm/i915 does the bookkeeping that makes the information useful,
    and the information maintained is driver specific, so move it out of the
    core and into its single user.

    Signed-off-by: Chris Wilson
    Cc: Dave Airlie

    Chris Wilson
     
  • In order to be fully threadsafe we need to check that the drm_gem_object
    refcount is still 0 after acquiring the mutex in order to call the free
    function. Otherwise, we may encounter scenarios like:

    Thread A: Thread B:
    drm_gem_close
    unreference_unlocked
    kref_put mutex_lock
    ... i915_gem_evict
    ... kref_get -> BUG
    ... i915_gem_unbind
    ... kref_put
    ... i915_gem_object_free
    ... mutex_unlock
    mutex_lock
    i915_gem_object_free -> BUG
    i915_gem_object_unbind
    kfree
    mutex_unlock

    Note that no driver is currently using the free_unlocked vfunc and it is
    scheduled for removal, hasten that process.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30454
    Reported-and-Tested-by: Magnus Kessler
    Signed-off-by: Chris Wilson
    Cc: stable@kernel.org
    Signed-off-by: Dave Airlie

    Chris Wilson
     
  • There were lots of places being inconsistent since handle count
    looked like a kref but it really wasn't.

    Fix this my just making handle count an atomic on the object,
    and have it increase the normal object kref.

    Now i915/radeon/nouveau drivers can drop the normal reference on
    userspace object creation, and have the handle hold it.

    This patch fixes a memory leak or corruption on unload, because
    the driver had no way of knowing if a handle had been actually
    added for this object, and the fbcon object needed to know this
    to clean itself up properly.

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

    Dave Airlie
     

28 Sep, 2010

1 commit

  • Hook the GEM vm open/close ops into the generic drm vm open/close so
    that the private vma entries are created and destroy appropriately.
    Fixes the leak of the drm_vma_entries during the lifetime of the filp.

    Reported-by: Matt Mackall
    Cc: Jesse Barnes
    Signed-off-by: Chris Wilson
    Acked-by: Jesse Barnes
    Cc: stable@kernel.org
    Signed-off-by: Dave Airlie

    Chris Wilson
     

30 Aug, 2010

6 commits

  • Every driver used the default implementation. Fold that one into
    the only callsite and drop the callback.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Totally unused.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • There's no point in jumping through two indirections. So kill one
    and call the kernels agp functions directly.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • The information supplied by userspace through these ioctls is only
    accessible by dev->drw_idr. But there's no in-tree user of that.
    Also userspace does not really care about return values of these ioctls,
    either. Only hw/xfree86/dri/dri.c from the xserver actually checks the
    return from adddraw and keeps on trying to create a kernel drawable
    every time somebody creates a dri drawable. But since that's now a noop,
    who cares.

    Therefore it's safe to replace these three ioctls with noops and rip
    out the implementation.

    Signed-off-by: Daniel Vetter
    Reviewed-by: Kristian Høgsberg
    Reviewed-by: Michel Dänzer
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Only used by ioctl, not by any in-tree drivers.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • All drivers happily copy&pasted the default implementation without
    checking whether this callback is used at all. It's not. Sigh.

    Kill it.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter