History log of /drivers/gpu/drm/qxl/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c572aaf46f71f63ae5914d4e194a955e0ba1b519 16-Oct-2014 Marc-André Lureau <marcandre.lureau@gmail.com> qxl: don't create too large primary surface

Limit primary to qemu vgamem size, to avoid reaching
qemu guest bug "requested primary larger than framebuffer"
on resizing screen too large to fit.

Remove unneeded and misleading variables.

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1127552

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
7a42e83d36d2d0a68622320900dc4e880b1d920a 01-Oct-2014 Dave Airlie <airlied@redhat.com> Merge branch 'for-airlied-next' of git://people.freedesktop.org/~mlankhorst/linux into drm-next

fixups for nouveau and fencing

* 'for-airlied-next' of git://people.freedesktop.org/~mlankhorst/linux:
drm/nouveau: export reservation_object from dmabuf to ttm
drm/ttm: add reservation_object as argument to ttm_bo_init
drm: Pass dma-buf as argument to gem_prime_import_sg_table
drm/nouveau: assign fence_chan->name correctly
drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync
drm/nouveau: bump driver patchlevel to 1.2.1
f4f4e3e3e9f3bde110067b9e4487cb267d90055a 09-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/ttm: add reservation_object as argument to ttm_bo_init

This allows importing reservation objects from dma-bufs.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_object.c
b5e9c1a25fcf8a0d664606251a53b5caa6a19d08 09-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm: Pass dma-buf as argument to gem_prime_import_sg_table

Allows importing dma_reservation_objects from a dma-buf.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_drv.h
xl_prime.c
f38e34ac54569756963827434d4b18b9ad9d8b95 14-Sep-2014 Fabian Frederick <fabf@skynet.be> drm/qxl: use container_of to resolve qxl_fbdev from drm_fb_helper

Use container_of instead of casting first structure member.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
xl_fb.c
d9fc9413f97f5c615256a5657ec667c064c07a70 23-Sep-2014 Daniel Vetter <daniel.vetter@ffwll.ch> drm: Extract <drm/drm_gem.h>

v2: Don't forget git add, noticed by David.

Cc: David Herrmann <dh.herrmann@gmail.com>

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
884c6dabb0eafe7227f099c9e78e514191efaf13 23-Sep-2014 Daniel Vetter <daniel.vetter@ffwll.ch> drm/<ttm-based-drivers>: Don't call drm_mmap

Really, the legacy buffer api should be dead, especially for all these
newfangled drivers. I suspect this is copypasta from the transitioning
days, which probably originated in radeon.

Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Rashika <rashika.kheria@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabian Frederick <fabf@skynet.be>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ttm.c
ae9c0af2c0ea92e57013ab2dd7271ba7d6b2a833 04-Sep-2014 Christian König <christian.koenig@amd.com> drm/ttm: allow fence to be added as shared

This patch adds a new flag to the ttm_validate_buffer list to
add the fence as shared to the reservation object.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
xl_release.c
915b4d11b8b9e7b84ba4a4645b6cc7fbc0c071cf 29-Aug-2014 David Herrmann <dh.herrmann@gmail.com> drm: add driver->set_busid() callback

One step closer to dropping all the drm_bus_* code:
Add a driver->set_busid() callback and make all drivers use the generic
helpers. Nouveau is the only driver that uses two different bus-types with
the same drm_driver. This is totally broken if both buses are available on
the same machine (unlikely, but lets be safe). Therefore, we create two
different drivers for each platform during module_init() and set the
set_busid() callback respectively.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.c
58b21c22c66dd223d27405d54b47102a27bda0b7 03-Sep-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/qxl: Fix crash in eviction from qxl_release_fence_buffer_objects

This crash was already here before the conversion, but qxl never leaked
hard enough to hit this.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_release.c
b75402c9f98a431ae352a223153825513eac9600 03-Sep-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/qxl: fix gaping memory hole

This is how you implement a memory sieve in a driver. ;-)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_release.c
d7e4d671369263381dd3a02e1f240f675be6b1f5 03-Sep-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/qxl: Remove release_lock stupidity

The locking of release_lock was stupid; t should have been be called with
fence_lock_irq if it was legitimately used. Unfortunately it never protected
anything except the fence implementation correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_debugfs.c
xl_release.c
47c1296829505d119d7d58dd23d39cc5db344f12 08-Aug-2014 Andreas Pokorny <andreas.pokorny@canonical.com> drm/qxl: enables gem prime helpers for qxl using dummy driver callbacks

As there should not be any other virtual device that might share buffers,
the callbacks remain empty stubs. Still prime can be used to transfer buffers
between processes that use qxl.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
akefile
xl_drv.c
xl_drv.h
xl_prime.c
058e9f5c8236ad740ab984588b507758e5feee6d 08-Aug-2014 Andreas Pokorny <andreas.pokorny@canonical.com> drm/qxl: simple crtc page flipping emulated using buffer copy

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_drv.c
xl_kms.c
f2c24b83ae90292d315aa7ac029c6ce7929e01aa 02-Apr-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/ttm: flip the switch, and convert to dma_fence

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_debugfs.c
xl_drv.h
xl_kms.c
xl_object.h
xl_release.c
xl_ttm.c
2f453ed4038526172292fb3250b638b3782c7f2b 02-Apr-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/qxl: rework to new fence interface

Final driver! \o/

This is not a proper dma_fence because the hardware may never signal
anything, so don't use dma-buf with qxl, ever.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
akefile
xl_cmd.c
xl_debugfs.c
xl_drv.h
xl_fence.c
xl_kms.c
xl_object.c
xl_release.c
xl_ttm.c
1f0dc9a59afeccb96a35ebec36661266260f5eee 09-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/ttm: kill off some members to ttm_validate_buffer

This reorders the list to keep track of what buffers are reserved,
so previous members are always unreserved.

This gets rid of some bookkeeping that's no longer needed,
while simplifying the code some.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_release.c
58b4d720c1620bbf09e42b4f218dcb2d0d8cdf3e 09-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/ttm: add interruptible parameter to ttm_eu_reserve_buffers

It seems some drivers really want this as a parameter,
like vmwgfx.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_release.c
dd7cfd641228abb2669d8d047d5ec377b1835900 21-Jan-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/ttm: kill fence_lock

No users are left, kill it off! :D
Conversion to the reservation api is next on the list, after
that the functionality can be restored with rcu.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
xl_cmd.c
xl_fence.c
xl_object.h
xl_release.c
f1217ed09f827e42a49ffa6a5aab672aa6f57a65 27-Aug-2014 Christian König <christian.koenig@amd.com> drm/ttm: move fpfn and lpfn into each placement v2

This allows us to more fine grained specify where to place the buffer object.

v2: rebased on drm-next, add bochs changes as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
xl_drv.h
xl_object.c
xl_ttm.c
9baa3c34ac4e27f7e062f266f50cc5dbea26a6c1 08-Aug-2014 Benoit Taine <benoit.taine@lip6.fr> PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use

We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines. This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// <smpl>

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// </smpl>

[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
xl_drv.c
5d42f82a9b8c5168d75cf59307cd271feca94464 05-Aug-2014 Dave Airlie <airlied@redhat.com> Merge tag 'v3.16' into drm-next

Linux 3.16

backmerge requested by i915, nouveau and radeon authors

Conflicts:
drivers/gpu/drm/i915/i915_gem_render_state.c
drivers/gpu/drm/i915/intel_drv.h
ee3939e07920f4a5405aba5f40529fd0fdd1dfb5 21-Jul-2014 Thierry Reding <treding@nvidia.com> drm/ttm: Fix a few sparse warnings

The final parameter to ttm_bo_reserve() is a pointer, therefore callers
should use NULL instead of 0.

Fixes a bunch of sparse warnings of this type:

warning: Using plain integer as NULL pointer

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_object.h
fbb60fe35ad579b511de8604b06a30b43846473b 12-May-2014 Jason Wang <jasowang@redhat.com> drm/qxl: return IRQ_NONE if it was not our irq

Return IRQ_NONE if it was not our irq. This is necessary for the case
when qxl is sharing irq line with a device A in a crash kernel. If qxl
is initialized before A and A's irq was raised during this gap,
returning IRQ_HANDLED in this case will cause this irq to be raised
again after EOI since kernel think it was handled but in fact it was
not.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_irq.c
10a231026574f9ec9761b6435394b8830b485e4e 27-Jun-2014 Thierry Reding <treding@nvidia.com> drm: Introduce drm_fb_helper_prepare()

To implement hotplug detection in a race-free manner, drivers must call
drm_kms_helper_poll_init() before hotplug events can be triggered. Such
events can be triggered right after any of the encoders or connectors
are initialized. At the same time, if the drm_fb_helper_hotplug_event()
helper is used by a driver, then the poll helper requires some parts of
the FB helper to be initialized to prevent a crash.

At the same time, drm_fb_helper_init() requires information that is not
necessarily available at such an early stage (number of CRTCs and
connectors), so it cannot be used yet.

Add a new helper, drm_fb_helper_prepare(), that initializes the bare
minimum needed to allow drm_kms_helper_poll_init() to execute and any
subsequent hotplug events to be processed properly.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_fb.c
3a4938799dec32783759b0c66ee3bb8c82dd9937 27-Jun-2014 Thierry Reding <treding@nvidia.com> drm: Constify struct drm_fb_helper_funcs

There's no need for this to be modifiable. Make it const so that it can
be put into the .rodata section.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_fb.c
34ea3d386347cd6de4c2fa2491dd85c9e753e7e4 29-May-2014 Thomas Wood <thomas.wood@intel.com> drm: add register and unregister functions for connectors

Introduce generic functions to register and unregister connectors. This
provides a common place to add and remove associated user space
interfaces.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
xl_display.c
f95aeb17f57c4c98b7f33627e5f51353fd094a93 09-Jun-2014 Damien Lespiau <damien.lespiau@intel.com> drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE()

I cannot see a need to provide a DRM_ version of ARRAY_SIZE(), only used
in a few places. I suspect its usage has been spread by copy & paste
rather than anything else.

Let's just remove it for plain ARRAY_SIZE().

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
52571ad5f4c57067ac593a6bdb1f7a35ed032d27 03-Jun-2014 David Mansfield <spice@dm.cobite.com> drm/qxl: use surface_id 0 for primary surface on all monitors

spice-server and downstream code expect that the primary surface
will always have surface_id = 0, while in reality, once allocated, the
surface_id in qxl.ko is NEVER 0. In a dual head environment, all
monitors render portions of the primary surface.

However, when the monitor config events are generated and sent,
the primary surface is only mapped to the correct identifier
(i.e. 0) for the primary head (where crtc index is 0).

The fix is to look at the "primary" flag in the bo and always
use id 0, irrespective of which head is being configured.

[airlied: qxl hw really needs to be fixed to scanout surfaces]

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
444c9a08bf787e8236e132fab7eceeb2f065aa4c 01-May-2014 Dave Airlie <airlied@redhat.com> Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next

Next pull request, this time more of the drm de-midlayering work. The big
thing is that his patch series here removes everything from drm_bus except
the set_busid callback. Thierry has a few more patches on top of this to
make that one optional to.

With that we can ditch all the non-pci drm_bus implementations, which
Thierry has already done for the fake tegra host1x drm_bus.

Reviewed by Thierry, Laurent and David and now also survived some testing
on my intel boxes to make sure the irq fumble is fixed correctly ;-) The
last minute rebase was just to add the r-b tags from Thierry for the 2
patches I've redone.

* 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm:
drm/<drivers>: don't set driver->dev_priv_size to 0
drm: Remove dev->kdriver
drm: remove drm_bus->get_name
drm: rip out dev->devname
drm: inline drm_pci_set_unique
drm: remove bus->get_irq implementations
drm: pass the irq explicitly to drm_irq_install
drm/irq: Look up the pci irq directly in the drm_control ioctl
drm/irq: track the irq installed in drm_irq_install in dev->irq
drm: rename dev->count_lock to dev->buf_lock
drm: Rip out totally bogus vga_switcheroo->can_switch locking
drm: kill drm_bus->bus_type
drm: remove drm_dev_to_irq from drivers
drm/irq: remove cargo-culted locking from irq_install/uninstall
drm/irq: drm_control is a legacy ioctl, so pci devices only
drm/pci: fold in irq_by_busid support
drm/irq: simplify irq checks in drm_wait_vblank
2c9b25c59796e9e5f01193d15dde501e9af59714 08-Feb-2014 Christian Engelmayer <cengelma@gmx.at> drm: qxl: Remove unused device pointer

Remove occurrences of unused struct qxl_device pointer in functions
qxl_ttm_fault() and qxl_init_mem_type().

Detected by Coverity: CID 1019128, CID 1019129.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ttm.c
b87577b7c768683736eea28f70779e8c75b4df62 01-May-2014 Dave Airlie <airlied@redhat.com> drm: try harder to avoid regression when merging mode bits

For QXL hw we really want the bits to be replaced as we change
the preferred mode on the fly, and the same goes for virgl when
I get to it, however the original fix for this seems to have caused
a wierd regression on Intel G33 that in a stunning display of failure
at opposition to his normal self, Daniel failed to diagnose.

So we are left doing this, ugly ugly ugly ugly, Daniel you fixed
that G33 yet?, ugly, ugly.

Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
3c8413951cbd8a2d855740823fc547c97b845f6f 03-Nov-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm/<drivers>: don't set driver->dev_priv_size to 0

Especially not on modesetting drivers - this is used to size
the driver private structure for legacy drm buffers.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
xl_drv.c
bb0f1b5c1695b4399cfd2359c114ae63edbb3ad8 03-Nov-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm: pass the irq explicitly to drm_irq_install

Unfortunately this requires a drm-wide change, and I didn't see a sane
way around that. Luckily it's fairly simple, we just need to inline
the respective get_irq implementation from either drm_pci.c or
drm_platform.c.

With that we can now also remove drm_dev_to_irq from drm_irq.c.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
xl_irq.c
c75230833ce4fbbfaa257c07b55f97912fb1dc02 20-Feb-2014 Thomas Hellstrom <thellstrom@vmware.com> drm/ttm: Hide the implementation details of reservation

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
xl_release.c
2844ea3f252331cc0ecf3ae74f6226db2f580f8a 02-Apr-2014 Dave Airlie <airlied@redhat.com> Merge branch 'primary-plane' of git://people.freedesktop.org/~robclark/linux into drm-next

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)
41ccec352f3c823931a7d9d2a9c7880c14d7415a 01-Apr-2014 Maarten Lankhorst <maarten.lankhorst@canonical.com> drm/qxl: unset a pointer in sync_obj_unref

This fixes a BUG_ON(bo->sync_obj != NULL); in ttm_bo_release_list.

Cc: stable@vger.kernel.org #v3.10+

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ttm.c
f4510a2752b75ad5847b7935b68c233cab497f97 02-Apr-2014 Matt Roper <matthew.d.roper@intel.com> drm: Replace crtc fb with primary plane fb (v3)

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: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
xl_display.c
44d847b7439bdea0b6c5640446427daa3ebcc7fa 13-Aug-2013 David Herrmann <dh.herrmann@gmail.com> drm: init TTM dev_mapping in ttm_bo_device_init()

With dev->anon_inode we have a global address_space ready for operation
right from the beginning. Therefore, there is no need to do a delayed
setup with TTM. Instead, set dev_mapping during initialization in
ttm_bo_device_init() and remove any "if (dev_mapping)" conditions.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xl_object.c
xl_ttm.c
6796cb16c088905bf3af40548fda68c09e6f6ee5 03-Jan-2014 David Herrmann <dh.herrmann@gmail.com> drm: use anon-inode instead of relying on cdevs

DRM drivers share a common address_space across all character-devices of a
single DRM device. This allows simple buffer eviction and mapping-control.
However, DRM core currently waits for the first ->open() on any char-dev
to mark the underlying inode as backing inode of the device. This delayed
initialization causes ugly conditions all over the place:
if (dev->dev_mapping)
do_sth();

To avoid delayed initialization and to stop reusing the inode of the
char-dev, we allocate an anonymous inode for each DRM device and reset
filp->f_mapping to it on ->open().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xl_object.c
xl_ttm.c
9b0cd304f26b9fca140de15deeac2bf357d1f388 30-Jan-2014 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux

Pull drm updates from Dave Airlie:
"Been a bit busy, first week of kids school, and waiting on other trees
to go in before I could send this, so its a bit later than I'd
normally like.

Highlights:
- core:
timestamp fixes, lots of misc cleanups
- new drivers:
bochs virtual vga
- vmwgfx:
major overhaul for their nextgen virt gpu.
- i915:
runtime D3 on HSW, watermark fixes, power well work, fbc fixes,
bdw is no longer prelim.
- nouveau:
gk110/208 acceleration, more pm groundwork, old overlay support
- radeon:
dpm rework and clockgating for CIK, pci config reset, big endian
fixes
- tegra:
panel support and DSI support, build as module, prime.
- armada, omap, gma500, rcar, exynos, mgag200, cirrus, ast:
fixes
- msm:
hdmi support for mdp5"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (595 commits)
drm/nouveau: resume display if any later suspend bits fail
drm/nouveau: fix lock unbalance in nouveau_crtc_page_flip
drm/nouveau: implement hooks for needed for drm vblank timestamping support
drm/nouveau/disp: add a method to fetch info needed by drm vblank timestamping
drm/nv50: fill in crtc mode struct members from crtc_mode_fixup
drm/radeon/dce8: workaround for atom BlankCrtc table
drm/radeon/DCE4+: clear bios scratch dpms bit (v2)
drm/radeon: set si_notify_smc_display_change properly
drm/radeon: fix DAC interrupt handling on DCE5+
drm/radeon: clean up active vram sizing
drm/radeon: skip async dma init on r6xx
drm/radeon/runpm: don't runtime suspend non-PX cards
drm/radeon: add ring to fence trace functions
drm/radeon: add missing trace point
drm/radeon: fix VMID use tracking
drm: ast,cirrus,mgag200: use drm_can_sleep
drm/gma500: Lock struct_mutex around cursor updates
drm/i915: Fix the offset issue for the stolen GEM objects
DRM: armada: fix missing DRM_KMS_FB_HELPER select
drm/i915: Decouple GPU error reporting from ring initialisation
...
bb1281f2aae08e5ef23eb0692c8833e95579cdf2 23-Jan-2014 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial

Pull trivial tree updates from Jiri Kosina:
"Usual rocket science stuff from trivial.git"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
neighbour.h: fix comment
sched: Fix warning on make htmldocs caused by wait.h
slab: struct kmem_cache is protected by slab_mutex
doc: Fix typo in USB Gadget Documentation
of/Kconfig: Spelling s/one/once/
mkregtable: Fix sscanf handling
lp5523, lp8501: comment improvements
thermal: rcar: comment spelling
treewide: fix comments and printk msgs
IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart()
Documentation: update /proc/uptime field description
Documentation: Fix size parameter for snprintf
arm: fix comment header and macro name
asm-generic: uaccess: Spelling s/a ny/any/
mtd: onenand: fix comment header
doc: driver-model/platform.txt: fix a typo
drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text
doc: Fix typo (acces_process_vm -> access_process_vm)
treewide: Fix typos in printk
drivers/gpu/drm/qxl/Kconfig: reformat the help text
...
c5416d661daa9ccef4f42259ad0d48e28b5f950f 20-Dec-2013 Randy Dunlap <rdunlap@infradead.org> gpu: fix qxl missing crc32_le

Fix build error: qxl uses crc32 functions so it needs to select
CRC32.

Also use angle quotes around a kernel header file name.

drivers/built-in.o: In function `qxl_display_read_client_monitors_config':
(.text+0x19d754): undefined reference to `crc32_le'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
config
xl_display.c
0662e4c2c2fbddd10cdec05fe68eb2c03e6dbcc9 06-Jan-2014 Rashika <rashika.kheria@gmail.com> drivers: gpu: Mark function as static in qxl_kms.c

Mark function qxl_device_init() as static in drm/qxl/qxl_kms.c because
it is not used outside this file.

This eliminates the following warning in drm/qxl/qxl_kms.c:
drivers/gpu/drm/qxl/qxl_kms.c:118:5: warning: no previous prototype for ‘qxl_device_init’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_kms.c
488574dbc47e0f570330c8c2b56ae299c28ade14 20-Dec-2013 Randy Dunlap <rdunlap@infradead.org> gpu: fix qxl missing crc32_le

Fix build error: qxl uses crc32 functions so it needs to select
CRC32.

Also use angle quotes around a kernel header file name.

drivers/built-in.o: In function `qxl_display_read_client_monitors_config':
(.text+0x19d754): undefined reference to `crc32_le'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
config
xl_display.c
949b6183412cad3270a9f4bcddd7756e6ec64404 16-Dec-2013 Antonio Ospite <ospite@studenti.unina.it> drivers/gpu/drm/qxl/Kconfig: reformat the help text

Reformat the help text to follow the style of the other Kconfig files,
and also fix indentation for the "select" lines.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
config
1d6ac185c32134233f77ce44800ceb4ab9361401 11-Dec-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm: Kill DRM_COPY_(TO|FROM)_USER

Less yelling ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
e9f0d76f3bcd4dda7136baaaaf45bda3b13ff40f 11-Dec-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm: Kill DRM_IRQ_ARGS

I've killed them a long time ago in drm/i915, let's get rid of this
remnant of shared drm core days for good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_irq.c
73e9efd4bddbf42d2938a150ba680b73b6126b77 04-Dec-2013 Ville Syrjälä <ville.syrjala@linux.intel.com> drm: Push dirtyfb ioctl kms locking down to drivers

Not all drivers will need take all the modeset locks for dirtyfb, so
push the locking down to the drivers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
1b28c3e628315ac0d9ef2d3fac0403f05ae692db 28-Nov-2013 Dave Airlie <airlied@redhat.com> drm/qxl: fix memory leak in release list handling

wow no idea how I got this far without seeing this,
leaking the entries in the list makes kmalloc-64 slab grow.

References: https://bugzilla.kernel.org/show_bug.cgi?id=65121
Cc: stable@vger.kernel.org
Reported-by: Matthew Stapleton <matthew4196@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_release.c
4695b03970df378dcb93fe3e7158381f1e980fa2 11-Oct-2013 Dave Airlie <airlied@redhat.com> qxl: add a connector property to denote hotplug should rescan modes.

So GNOME userspace has an issue with when it rescans for modes on hotplug
events, if the monitor has no EDID it assumes that nothing has changed on
EDID as with real hw we'd never have new modes without a new EDID, and they
kind off rely on the behaviour now, however with virtual GPUs we would
like to rescan the modes and get a new preferred mode on hotplug events
to handle dynamic guest resizing (where you resize the host window and the
guest resizes with it).

This is a simple property we can make userspace watch for to trigger new
behaviour based on it, and can be used to replaced EDID hacks in virtual
drivers.

Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com> (on irc)
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_drv.h
d9bbf1895f354c8641824e1dd10d0501efd34790 11-Oct-2013 Gerd Hoffmann <kraxel@redhat.com> drm/qxl: add some surface memory logging

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_kms.c
xl_ttm.c
35541782dcc1e502d1864075eded7b3bb23b7268 11-Oct-2013 Gerd Hoffmann <kraxel@redhat.com> drm/qxl: support 64bit surface bar

qxl devices can have a 64bit surface bar, which is quite handy if
you need a bit more surface memory. So try to use it if it is
present. Note that this bar might be mapped above 4g.

QEMU command line to check that out:

qemu-system-x86_64 -m 4g \
-vga qxl -global qxl-vga.vram64_size_mb=512 \
$otheroptions

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_kms.c
cc87509d87696d7cd393882f5dedea01e03e41a9 04-Nov-2013 Dave Airlie <airlied@redhat.com> qxl: avoid an oops in the deferred io code.

If we are using deferred io due to plymouth or X.org fbdev driver
we will oops in memcpy due to this pointless multiply here,

removing it fixes fbdev to start and not oops.

Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_fb.c
be51e4a78155ff6c5d9299bf726e86b554e21117 25-Oct-2013 Dave Airlie <airlied@redhat.com> Merge tag 'drm-intel-next-2013-10-18' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

- CRC support from Damien and He Shuang. Long term this should allow us to
test an awful lot modesetting corner cases automatically. So for me as
the maintainer this is really big.
- HDMI audio fix from Jani.
- VLV dpll computation code refactoring from Ville.
- Fixups for the gpu booster from last time around (Chris).
- Some cleanups in the context code from Ben.
- More watermark work from Ville (we'll be getting there ...).
- vblank timestamp improvements from Ville.
- CONFIG_FB=n support, including drm core changes to make the fbdev
helpers optional.
- DP link training improvements (Jani).
- mmio vtable from Ben, prep work for future hw.

* tag 'drm-intel-next-2013-10-18' of git://people.freedesktop.org/~danvet/drm-intel: (132 commits)
drm/i915/dp: don't mention eDP bpp clamping if it doesn't affect bpp
drm/i915: remove dead code in ironlake_crtc_mode_set
drm/i915: crc support for hsw
drm/i915: fix CRC debugfs setup
drm/i915: wait one vblank when disabling CRCs
drm/i915: use ->get_vblank_counter for the crc frame counter
drm/i915: wire up CRC interrupt for ilk/snb
drm/i915: add CRC #defines for ilk/snb
drm/i915: extract display_pipe_crc_update
drm/i915: don't Oops in debugfs for I915_FBDEV=n
drm/i915: set HDMI pixel clock in audio configuration
drm/i915: pass mode to ELD write vfuncs
cpufreq: Add dummy cpufreq_cpu_get/put for CONFIG_CPU_FREQ=n
drm/i915: check gem bo size when creating framebuffers
drm/i915: Use unsigned long for obj->user_pin_count
drm/i915: prevent tiling changes on framebuffer backing storage
drm/i915: grab dev->struct_mutex around framebuffer_init
drm/i915: vlv: fix VGA hotplug after modeset
drm: add support for additional stereo 3D modes
drm/i915: preserve dispaly init order on ByT
...
5cab51cb3381157e652bb85e3e87adb44497c672 18-Oct-2013 Marc-André Lureau <marcandre.lureau@gmail.com> drm/qxl: fix disabling extra monitors from client

To disable a monitor, a Spice client sends a monitor config with the
monitor resolution to 0x0.

However, before qxl_crtc_disable() is reached after the hotplug event,
it can happen that another monitor is reconfigured, and
qxl_send_monitors_config() is called with the old config, which will
re-enable the monitor on the client.

Reset config if monitor is found disconnected, during
drm_helper_hpd_irq_event().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
a40a60d912a101e8dfb08ee15eb02430aaf6112b 18-Oct-2013 Marc-André Lureau <marcandre.lureau@gmail.com> drm/qxl: remove unnecessary check

All hard-coded resolutions are passing this check.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
b080742393e2c19c603ccd651f10d58b32455749 18-Oct-2013 Marc-André Lureau <marcandre.lureau@gmail.com> drm/qxl: prefer the monitor config resolution

By default, 1024x768 is the preferred resolution. However, when a
monitor config is given, it should be the only preferred resolution.

Note that the monitor config resolution is passed to
qxl_add_common_modes() to avoid adding a duplicate mode without the
preferred resolution. That would discard the previous monitor config
preferred bit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
4fdb086924db46489b1af679e2a06683f73c9cbc 18-Oct-2013 Marc-André Lureau <marcandre.lureau@gmail.com> drm/qxl: notify that the monitor config changed

drm_helper_hpd_irq_event() only notifies when the connector status
changed. However, Spice monitor config can change while the connector is
connected, to support arbitrary resolution. Do an hotplug event if it
wasn't done by drm_helper_hpd_irq_event().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
92b6f89f6b85f433ddac1f4a9eb0962dc96380fe 08-Oct-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm: Add separate Kconfig option for fbdev helpers

For drivers which might want to disable fbdev legacy support.

Select the new option in all drivers for now, so this shouldn't result
in any change. Drivers need some work anyway to make fbdev support
optional (if they have it implemented, that is), so the recommended
way to expose this is by adding per-driver options. At least as long
as most drivers don't support disabling the fbdev support.

v2: Update for new drm drivers msm and rcar-du. Note that Rob's msm
driver can already take advantage of this, which allows us to build
msm without any fbdev depencies in the kernel!

v3: Move the MODULE_* stuff from the fbdev helper file to
drm_crtc_helper.c.

Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Acked-by: Dave Airlie <airlied@linux.ie>
Reviewed-by: Chon Ming Lee <chon.ming.lee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
config
16eb5f4379b2097438a224381be3b4d9e56ac979 02-Oct-2013 David Herrmann <dh.herrmann@gmail.com> drm: kill ->gem_init_object() and friends

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 <airlied@gmail.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Ben Skeggs <skeggsb@gmail.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.c
xl_drv.h
xl_gem.c
acb4652703f0a452405a3ab9319594eddc41391b 25-Aug-2013 David Herrmann <dh.herrmann@gmail.com> drm: verify vma access in TTM+GEM drivers

GEM does already a good job in tracking access to gem buffers via handles
and drm_vma access management. However, TTM drivers currently do not
verify this during mmap().

TTM provides the verify_access() callback to test this. So fix all drivers
to actually call into gem+vma to verify access instead of always returning
0.

All drivers assume that user-space can only get access to TTM buffers via
GEM handles. So whenever the verify_access() callback is called from
ttm_bo_mmap(), the buffer must have a valid embedded gem object. This is
true for all TTM+GEM drivers. But that's why this patch doesn't touch pure
TTM drivers (ie, vmwgfx).

v2: Switch to drm_vma_node_verify_access() to correctly return -EACCES if
access was denied.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ttm.c
b0e898ac555e96e7863a5ee95d70f3625f1db5e2 08-Aug-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm: remove FASYNC support

So I've stumbled over drm_fasync and wondered what it does. Digging
that up is quite a story.

First I've had to read up on what this does and ended up being rather
bewildered why peopled loved signals so much back in the days that
they've created SIGIO just for that ...

Then I wondered how this ever works, and what that strange "No-op."
comment right above it should mean. After all calling the core fasync
helper is pretty obviously not a noop. After reading through the
kernels FASYNC implementation I've noticed that signals are only sent
out to the processes attached with FASYNC by calling kill_fasync.

No merged drm driver has ever done that.

After more digging I've found out that the only driver that ever used
this is the so called GAMMA driver. I've frankly never heard of such a
gpu brand ever before. Now FASYNC seems to not have been the only bad
thing with that driver, since Dave Airlie removed it from the drm
driver with prejudice:

commit 1430163b4bbf7b00367ea1066c1c5fe85dbeefed
Author: Dave Airlie <airlied@linux.ie>
Date: Sun Aug 29 12:04:35 2004 +0000

Drop GAMMA DRM from a great height ...

Long story short, the drm fasync support seems to be doing absolutely
nothing. And the only user of it was never merged into the upstream
kernel. And we don't need any fops->fasync callback since the fcntl
implementation in the kernel already implements the noop case
correctly.

So stop this particular cargo-cult and rip it all out.

v2: Kill drm_fasync assignments in rcar (newly added) and imx drivers
(somehow I've missed that one in staging). Also drop the reference in
the drm DocBook. ARM compile-fail reported by Rob Clark.

v3: Move the removal of dev->buf_asnyc assignment in drm_setup to this
patch here.

v4: Actually git add ... tsk.

Cc: Dave Airlie <airlied@linux.ie>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Rob Clark <robdclark@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.c
f547b22aaf4f429089b3d5a987b94a2bd8c92eb1 14-Aug-2013 David Herrmann <dh.herrmann@gmail.com> drm/qxl: remove unused object_pin/unpin() helpers

These two helpers are unused. Remove them. They rely on
gem_obj->driver_private, which is set to NULL during setup. As this field
isn't used by the driver, anymore, we can remove this assignment as well.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_gem.c
xl_object.c
1dda8d02acbba80444a98e71d9d419232c109e94 19-Aug-2013 Dave Airlie <airlied@redhat.com> Merge remote-tracking branch 'pfdo/drm-rcar-for-v3.12' into drm-next

Merge the rcar stable branch that is being shared with the arm-soc tree.

Signed-off-by: Dave Airlie <airlied@redhat.com>
* pfdo/drm-rcar-for-v3.12: (220 commits)
drm/rcar-du: Add FBDEV emulation support
drm/rcar-du: Add internal LVDS encoder support
drm/rcar-du: Configure RGB output routing to DPAD0
drm/rcar-du: Rework output routing support
drm/rcar-du: Add support for DEFR8 register
drm/rcar-du: Add support for multiple groups
drm/rcar-du: Fix buffer pitch alignment for R8A7790 DU
drm/rcar-du: Add support for the R8A7790 DU
drm/rcar-du: Move output routing configuration to group
drm/rcar-du: Remove register definitions for the second channel
drm/rcar-du: Use dynamic number of CRTCs instead of CRTCs array size
drm/rcar-du: Introduce CRTCs groups
drm/rcar-du: Rename rcar_du_plane_(init|register) to rcar_du_planes_*
drm/rcar-du: Create rcar_du_planes structure
drm/rcar-du: Rename platform data fields to match what they describe
drm/rcar-du: Merge LVDS and VGA encoder code
drm/rcar-du: Split VGA encoder and connector
drm/rcar-du: Split LVDS encoder and connector
drm/rcar-du: Clarify comment regarding plane Y source coordinate
drm/rcar-du: Support per-CRTC clock and IRQ
...

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/qxl/qxl_release.c
baa7094355a10b432bbccacb925da4bdac861c8d 02-Aug-2013 Rob Clark <robdclark@gmail.com> drm: const'ify ioctls table (v2)

Because, there is no reason for it not to be const.

v1: original
v2: fix compile break in vmwgfx, and couple related cleanups suggested
by Ville Syrjälä

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_ioctl.c
43387b37fa2d0f368142b8fa8c9440da92e5381b 16-Jul-2013 Daniel Vetter <daniel.vetter@ffwll.ch> drm/gem: create drm_gem_dumb_destroy

All the gem based kms drivers really want the same function to
destroy a dumb framebuffer backing storage object.

So give it to them and roll it out in all drivers.

This still leaves the option open for kms drivers which don't use GEM
for backing storage, but it does decently simplify matters for gem
drivers.

Acked-by: Inki Dae <inki.dae@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Ben Skeggs <skeggsb@gmail.com>
Reviwed-by: Rob Clark <robdclark@gmail.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.c
xl_drv.h
xl_dumb.c
72525b3f333de54fa0c42ef87f27861e41478f1e 24-Jul-2013 David Herrmann <dh.herrmann@gmail.com> drm/ttm: convert to unified vma offset manager

Use the new vma-manager infrastructure. This doesn't change any
implementation details as the vma-offset-manager is nearly copied 1-to-1
from TTM.

The vm_lock is moved into the offset manager so we can drop it from TTM.
During lookup, we use the vma locking helpers to take a reference to the
found object.
In all other scenarios, locking stays the same as before. We always
guarantee that drm_vma_offset_remove() is called only during destruction.
Hence, helpers like drm_vma_node_offset_addr() are always safe as long as
the node has a valid offset.

This also drops the addr_space_offset member as it is a copy of vm_start
in vma_node objects. Use the accessor functions instead.

v4:
- remove vm_lock
- use drm_vma_offset_lock_lookup() to protect lookup (instead of vm_lock)

Cc: Dave Airlie <airlied@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Martin Peres <martin.peres@labri.fr>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
xl_object.h
xl_release.c
8002db6336dd361fc13214e9515fe5d52ff294ee 23-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: convert qxl driver to proper use for reservations

The recent addition of lockdep support to reservations and their subsequent
use by TTM showed up a number of potential problems with the way qxl was using
TTM objects.

a) it was allocating objects, and reserving them later without validating
underneath the reservation, which meant in extreme conditions the objects could
be evicted before the reservation ever used them.

b) it was reserving objects straight after allocating them, but with no
ability to back off should the reservations fail. It now allocates the necessary
objects then does a complete reservation pass on them to avoid deadlocks.

c) it had two lists per release tracking objects, unnecessary complicating
the reservation process.

This patch removes the dual object tracking, adds reservations ticket support
to the release and fence object handling. It then ports the internal fb
drawing code and the userspace facing ioctl to use the new interfaces properly,
along with cleanup up the error path handling in some codepaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_display.c
xl_draw.c
xl_drv.h
xl_fence.c
xl_image.c
xl_ioctl.c
xl_object.c
xl_object.h
xl_release.c
4f49ec92be64ad1d96cf5d26fc8276f9849202a3 23-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: allow creation of pre-pinned objects and use for releases.

In order to fix an issue with reservations we need to create the releases
as pre-pinned objects, this changes the placement interface and bo creation
interface to allow creating pinned objects to save nested reservations later.

This is just a stepping stone to main fix which follows to actually fix how
qxl deals with reservations.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_gem.c
xl_ioctl.c
xl_object.c
xl_object.h
xl_release.c
xl_ttm.c
0665f9f852b4ac05f2f62046a169f0f5b9212317 22-Jul-2013 Dave Airlie <airlied@redhat.com> drm/qxl: add delayed fb operations

Due to the nature of qxl hw we cannot queue operations while in an irq
context, so we queue these operations as best we can until atomic allocations
fail, and dequeue them later in a work queue.

Daniel looked over the locking on the list and agrees it should be sufficent.

The atomic allocs use no warn, as the last thing we want if we haven't memory
to allocate space for a printk in an irq context is more printks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_fb.c
2e17c5a97e231f3cb426f4b7895eab5be5c5442e 10-Jul-2013 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux

Pull drm updates from Dave Airlie:
"Okay this is the big one, I was stalled on the fbdev pull req as I
stupidly let fbdev guys merge a patch I required to fix a warning with
some patches I had, they ended up merging the patch from the wrong
place, but the warning should be fixed. In future I'll just take the
patch myself!

Outside drm:

There are some snd changes for the HDMI audio interactions on haswell,
they've been acked for inclusion via my tree. This relies on the
wound/wait tree from Ingo which is already merged.

Major changes:

AMD finally released the dynamic power management code for all their
GPUs from r600->present day, this is great, off by default for now but
also a huge amount of code, in fact it is most of this pull request.

Since it landed there has been a lot of community testing and Alex has
sent a lot of fixes for any bugs found so far. I suspect radeon might
now be the biggest kernel driver ever :-P p.s. radeon.dpm=1 to enable
dynamic powermanagement for anyone.

New drivers:

Renesas r-car display unit.

Other highlights:

- core: GEM CMA prime support, use new w/w mutexs for TTM
reservations, cursor hotspot, doc updates
- dvo chips: chrontel 7010B support
- i915: Haswell (fbc, ips, vecs, watermarks, audio powerwell),
Valleyview (enabled by default, rc6), lots of pll reworking, 30bpp
support (this time for sure)
- nouveau: async buffer object deletion, context/register init
updates, kernel vp2 engine support, GF117 support, GK110 accel
support (with external nvidia ucode), context cleanups.
- exynos: memory leak fixes, Add S3C64XX SoC series support, device
tree updates, common clock framework support,
- qxl: cursor hotspot support, multi-monitor support, suspend/resume
support
- mgag200: hw cursor support, g200 mode limiting
- shmobile: prime support
- tegra: fixes mostly

I've been banging on this quite a lot due to the size of it, and it
seems to okay on everything I've tested it on."

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (811 commits)
drm/radeon/dpm: implement vblank_too_short callback for si
drm/radeon/dpm: implement vblank_too_short callback for cayman
drm/radeon/dpm: implement vblank_too_short callback for btc
drm/radeon/dpm: implement vblank_too_short callback for evergreen
drm/radeon/dpm: implement vblank_too_short callback for 7xx
drm/radeon/dpm: add checks against vblank time
drm/radeon/dpm: add helper to calculate vblank time
drm/radeon: remove stray line in old pm code
drm/radeon/dpm: fix display_gap programming on rv7xx
drm/nvc0/gr: fix gpc firmware regression
drm/nouveau: fix minor thinko causing bo moves to not be async on kepler
drm/radeon/dpm: implement force performance level for TN
drm/radeon/dpm: implement force performance level for ON/LN
drm/radeon/dpm: implement force performance level for SI
drm/radeon/dpm: implement force performance level for cayman
drm/radeon/dpm: implement force performance levels for 7xx/eg/btc
drm/radeon/dpm: add infrastructure to force performance levels
drm/radeon: fix surface setup on r1xx
drm/radeon: add support for 3d perf states on older asics
drm/radeon: set default clocks for SI when DPM is disabled
...
5ff91e442652ec33a648c3b9ae5025faaff1e813 05-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: use drm helper hotplug support

This uses the helper to deal with hotplug so fbdev gets included.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_kms.c
d84300bf793471cc20c7553601c45d6f70dd2b1e 04-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: add suspend/resume/hibernate support.

This adds suspend/resume and hibernate support for the KMS driver. it evicts
all the objects, turns off the outputs, and waits for the hw to go idle,

On resume, it resets the memslots, rings, monitors object and forces modeset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.c
xl_drv.h
xl_object.c
b86487a6b671ff7107fbf6d3ff10c2da970cd1c3 04-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: add fb and ttm entry points for use by suspend/resume.

This just ports some APIs like radeon uses to provide hooks for s/r to
call.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_fb.c
xl_object.c
1e209117dbe00d3d87db1c5266f177eaa60451c8 04-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: add ring prep code for s/r

This prepare the ring code for s/r additions, the release ring will need
reinitialising.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_drv.h
c9fdda2a2b7a8875db3eebd89e428aa760afb897 04-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: prepare memslot code for suspend/resume

this splits out initing the hw memslots from the guest info, and
creates an entrypoint for s/r to use.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_drv.h
xl_kms.c
2bd6ce84e1b4799be1f328a165d0b8a4fdfd2141 04-Jul-2013 Dave Airlie <airlied@redhat.com> qxl: split monitors_config object creation out.

This splits the creation of the monitors config object out so we can
re-use it across suspend/resume later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_drv.h
c927215543eb8f67c2c0102db147c299189c9957 02-Jul-2013 Dave Airlie <airlied@redhat.com> drm/qxl: set time on drawables from userspace

This just sets the qxl time on the drawables.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
07f8d9bdb235836d0a255d20f387bc3afa99180f 02-Jul-2013 Dave Airlie <airlied@redhat.com> drm/qxl: add support for > 1 output

This adds support for a default of 4 heads, with a command line
parameter to change the default number.

It also overhauls the modesetting code to handle this case properly,
and send the correct things to the hardware at the right time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_display.c
xl_drv.c
xl_drv.h
xl_fb.c
5b8788c1740fae8416e7e045301d99676d20bd64 01-Jul-2013 Dave Airlie <airlied@redhat.com> drm/qxl: make dynamic resizing work properly.

qxl has a feature to allow the userspace driver do arbitrary resizes
when the viewer resizes, this fixes it by removing unnecessary code
from the kernel side.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
18097b91aaff215e843f04b84ec2c686270bb55f 28-Jun-2013 Dave Airlie <airlied@redhat.com> drm/qxl: add missing access check for execbuffer ioctl

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
5e338405119a80aa59e811626739122d1c15045d 27-Jun-2013 Maarten Lankhorst <m.b.lankhorst@gmail.com> drm/ttm: convert to the reservation api

Now that the code is compatible in semantics, flip the switch.
Use ww_mutex instead of the homegrown implementation.

ww_mutex uses -EDEADLK to signal that the caller has to back off,
and -EALREADY to indicate this buffer is already held by the caller.

ttm used -EAGAIN and -EDEADLK for those, respectively. So some changes
were needed to handle this correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_object.h
c0a608023006c5bc3512a374bb84a224a399786b 20-Jun-2013 Dave Airlie <airlied@redhat.com> drm/qxl: add support for cursor hotspot.

This uses the cursor hotspot info from userspace and passes
it to the qxl hw layer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
fb85ac4da8d202f89e0635e4ac2ac680d662be98 27-May-2013 Ville Syrjälä <ville.syrjala@linux.intel.com> drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers

Many of the drivers didn't implement palette/gamma handling, but were forced
to provide stubs for the hooks to avoid drm_fb_helper from oopsing. Now that
the hooks are optional, we can eliminate all the stubs.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
xl_display.c
xl_fb.c
970fa986fadb1165cf38b45b70e98302a3bee497 30-May-2013 Dave Airlie <airlied@redhat.com> drm/qxl: fix build warnings on 32-bit

Just the usual printk related warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
xl_kms.c
c89b65e7fffef745bdd36c372aa0dea778fecbab 27-May-2013 Andrew Jones <drjones@redhat.com> qxl: fix Kconfig deps - select FB_DEFERRED_IO

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
config
b90ed1e931c4d11cf32710c8a310b603effb5b11 09-May-2013 Dave Airlie <airlied@redhat.com> qxl: fix bug with object eviction and update area

if the surface is evicted, this validation will happen
to the wrong place, I noticed this with other work I was
doing, haven't seen it go wrong in practice.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ioctl.c
b2b4465d8bade681491e225fa6a5dc050820b004 12-May-2013 Dave Airlie <airlied@gmail.com> drm/qxl: drop active_user_framebuffer as its unneeded

This was a bogus way to figure out what the active framebuffer was,
just check if the underlying bo is the primary bo.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_drv.h
d7292a07a1b3d0b31a54a3e949ed4dd99e9a85e8 12-May-2013 Dave Airlie <airlied@gmail.com> qxl: drop unused variable.

this boolean isn't used anymore so drop it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_drv.h
a6ac1bc341e499ad5296f265dfa8eba5afbf4191 14-May-2013 Dave Airlie <airlied@redhat.com> drm/qxl: fix ioport interactions for kernel submitted commands.

So qxl has ioports, but it really really really doesn't want you
to write to them twice, but if you write and get a signal before
the irq arrives to let you know its completed, you have to think
ahead and avoid writing another time.

However this works fine for update area where really multiple
writes aren't the end of the world, however with create primary
surface, you can't ever do multiple writes. So this stop internal
kernel writes from doing interruptible waits, because otherwise
we have no idea if this write is a new one or a continuation of
a previous one.

virtual hw sucks more than real hw.

This fixes lockups and VM crashes when resizing and starting/stopping
X.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
307b9c022720f9de90d58e51743e01e9a42aec59 03-May-2013 Dave Airlie <airlied@redhat.com> qxl: update to new idr interfaces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_release.c
caaa0352c41f0e21b48b902894ae8e585435587d 28-Apr-2013 David Rientjes <rientjes@google.com> drivers, drm: fix qxl build error when debugfs is disabled

Fix build error when CONFIG_DEBUG_FS is disabled:

drivers/gpu/drm/qxl/qxl_debugfs.c: In function 'qxl_debugfs_init':
drivers/gpu/drm/qxl/qxl_debugfs.c:76:2: error: implicit declaration of function 'drm_debugfs_create_files'
drivers/gpu/drm/qxl/qxl_debugfs.c: In function 'qxl_debugfs_takedown':
drivers/gpu/drm/qxl/qxl_debugfs.c:84:2: error: implicit declaration of function 'drm_debugfs_remove_files'

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_debugfs.c
e1adc78caf440d3f6be81a947c2b913e73514a68 18-Apr-2013 Dave Airlie <airlied@redhat.com> drm/qxl: fix build with debugfs turned off.

Reported-by: Randy Dunlap
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_ttm.c
62c8ba7c58e4163f975c5f8b5a3dd5f306a2deda 16-Apr-2013 Dave Airlie <airlied@redhat.com> drm/qxl: fix smatch warnings

drivers/gpu/drm/qxl/qxl_display.c:99 qxl_alloc_client_monitors_config() error: dereferencing freed memory 'qdev->client_monitors_config'
drivers/gpu/drm/qxl/qxl_object.c:66 qxl_ttm_placement_from_domain() warn: bitwise AND condition is false here
drivers/gpu/drm/qxl/qxl_ioctl.c:353 qxl_clientcap_ioctl() warn: buffer overflow 'qdev->rom->client_capabilities' 58 <= 58

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_display.c
xl_ioctl.c
xl_object.c
6d01f1f54c01877baad11389291c1aeab9c11e0f 16-Apr-2013 Dave Airlie <airlied@redhat.com> drm/qxl: make lots of things static.

/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h:414:9: sparse: preprocessor token offsetof redefined
include/linux/stddef.h:17:9: this was the original definition
>> drivers/gpu/drm/qxl/qxl_drv.c:49:5: sparse: symbol 'qxl_modeset' was not declared. Should it be static?

Reported-by: kbuild test robot.
Signed-off-by: Dave Airlie <airlied@redhat.com>
xl_cmd.c
xl_display.c
xl_drv.c
xl_fb.c
xl_gem.c
xl_ioctl.c
xl_kms.c
xl_release.c
xl_ttm.c
f64122c1f6ade301585569863b4b3b18f6e4e332 25-Feb-2013 Dave Airlie <airlied@gmail.com> drm: add new QXL driver. (v1.4)

QXL is a paravirtual graphics device used by the Spice virtual desktop
interface.

The drivers uses GEM and TTM to manage memory, the qxl hw fencing however
is quite different than normal TTM expects, we have to keep track of a number
of non-linear fence ids per bo that we need to have released by the hardware.

The releases are freed from a workqueue that wakes up and processes the
release ring.

releases are suballocated from a BO, there are 3 release categories, drawables,
surfaces and cursor cmds. The hw also has 3 rings for commands, cursor and release handling.

The hardware also have a surface id tracking mechnaism and the driver encapsulates it completely inside the kernel, userspace never sees the actual hw surface
ids.

This requires a newer version of the QXL userspace driver, so shouldn't be
enabled until that has been placed into your distro of choice.

Authors: Dave Airlie, Alon Levy

v1.1: fixup some issues in the ioctl interface with padding
v1.2: add module device table
v1.3: fix nomodeset, fbcon leak, dumb bo create, release ring irq,
don't try flush release ring (broken hw), fix -modesetting.
v1.4: fbcon cpu usage reduction + suitable accel flags.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
config
akefile
xl_cmd.c
xl_debugfs.c
xl_dev.h
xl_display.c
xl_draw.c
xl_drv.c
xl_drv.h
xl_dumb.c
xl_fb.c
xl_fence.c
xl_gem.c
xl_image.c
xl_ioctl.c
xl_irq.c
xl_kms.c
xl_object.c
xl_object.h
xl_release.c
xl_ttm.c