aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/qxl
AgeCommit message (Collapse)AuthorFilesLines
2015-10-16Merge commit '06d1ee32a4d25356a710b49d5e95dbdd68bdf505' of ↵Dave Airlie3-13/+22
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next Backmerge the drm-fixes pull from Linus's tree into drm-next. This is to fix some conflicts and make future pulls cleaner
2015-10-07drm/qxl: avoid dependency lockFrediano Ziglio1-3/+1
qxl_bo_unref calls drm_gem_object_unreference_unlocked which locks dev->struct_mutex. However this lock could be already locked if the call came from qxl_gem_object_free. As we don't need to call qxl_bo_ref/qxl_bo_unref cause qxl_release_list_add will hold a reference by itself avoid to call them and the possible deadlock. Signed-off-by: Frediano Ziglio <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-10-07drm/qxl: avoid buffer reservation in qxl_crtc_page_flipFrediano Ziglio1-1/+9
This avoid a dependency lock error. According to https://lwn.net/Articles/548909/ users of WW mutex API should avoid using different context. When a buffer is reserved with qxl_bo_reserve a ww_mutex_lock without context is used. However during qxl_draw_dirty_fb different locks with specific context are used. This is detected during a machine booting with a debug kernel with lock dependency checking enabled. Like many other function in this file to avoid this problem object pinning is used. Once the object is pinned is not necessary to keep the lock so it can be released avoiding the locking problem. Signed-off-by: Frediano Ziglio <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-10-07drm/qxl: fix framebuffer dirty rectangle tracking.Gerd Hoffmann1-8/+11
Commit "c0fe07a drm/qxl: rewrite framebuffer support" has a bug in the dirty rectangle tracking: Instead of ignoring an empty dirty rectangle when adding a new dirty region the dirty region gets extended to the upper left corner. Fix it. Cc: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-10-06drm/irq: Use unsigned int pipe in public APIThierry Reding1-3/+4
This continues the pattern started in commit cc1ef118fc09 ("drm/irq: Make pipe unsigned and name consistent"). This is applied to the public APIs and driver callbacks, so pretty much all drivers need to be updated to match the new prototypes. Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Russell King <[email protected]> Cc: Inki Dae <[email protected]> Cc: Jianwei Wang <[email protected]> Cc: Alison Wang <[email protected]> Cc: Patrik Jakobsson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: David Airlie <[email protected]> Cc: Rob Clark <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Mark Yao <[email protected]> Cc: Benjamin Gaignard <[email protected]> Cc: Vincent Abriou <[email protected]> Cc: Thomas Hellstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-01drm/qxl: recreate the primary surface when the bo is not primaryFabiano Fidêncio1-1/+1
When disabling/enabling a crtc the primary area must be updated independently of which crtc has been disabled/enabled. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1264735 Signed-off-by: Fabiano Fidêncio <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2015-09-24drm/qxl: only report first monitor as connected if we have no stateDave Airlie1-5/+7
If the server isn't new enough to give us state, report the first monitor as always connected, otherwise believe the server side. Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2015-09-11drm/qxl: validate monitors config modesJonathon Jongsma2-26/+42
Due to some recent changes in drm_helper_probe_single_connector_modes_merge_bits(), old custom modes were not being pruned properly. In current kernels, drm_mode_validate_basic() is called to sanity-check each mode in the list. If the sanity-check passes, the mode's status gets set to to MODE_OK. In older kernels this check was not done, so old custom modes would still have a status of MODE_UNVERIFIED at this point, and would therefore be pruned later in the function. As a result of this new behavior, the list of modes for a device always includes every custom mode ever configured for the device, with the largest one listed first. Since desktop environments usually choose the first preferred mode when a hotplug event is emitted, this had the result of making it very difficult for the user to reduce the size of the display. The qxl driver did implement the mode_valid connector function, but it was empty. In order to restore the old behavior where old custom modes are pruned, we implement a proper mode_valid function for the qxl driver. This function now checks each mode against the last configured custom mode and the list of standard modes. If the mode doesn't match any of these, its status is set to MODE_BAD so that it will be pruned as expected. Signed-off-by: Jonathon Jongsma <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2015-08-11drm/qxl: Don't take dev->struct_mutex in bo_force_deleteDaniel Vetter1-3/+1
It really doesn't protect anything which doesn't have other locks already. It also doesn't seem to be wired up into the driver unload code fwiw, but that's a different issue. Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-08-06drm/qxl: Use new drm_fb_helper functionsArchit Taneja1-27/+13
Use the newly created wrapper drm_fb_helper functions instead of calling core fbdev functions directly. They also simplify the fb_info creation. Cc: David Airlie <[email protected]> Cc: Frediano Ziglio <[email protected]> Cc: Maarten Lankhorst <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-06-05drm/qxl: Propagate correctly errors from qxlhw_handle_to_boFrediano Ziglio1-19/+14
This function could return a NULL pointer in case of handle not present and in case of out of memory conditions however caller function always returned EINVAL error hiding a possible ENOMEM. This patch change the function to return the error instead to be able to propagate the error instead of assuming EINVAL. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Simplify cleaning qxl processing commandFrediano Ziglio1-10/+3
In qxlhw_handle_to_bo we incremented counters twice, one time for release object and one for reloc_info. In the main function however reloc_info references was drop much earlier than release so keeping the pointer only on release is safe and make cleaning process easier. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Move main reference counter to GEM object instead of TTM onesFrediano Ziglio2-9/+12
qxl_bo structure has two reference counters, one in the GEM object and another in the TTM object. The GEM object keep a counter to the TTM object so when GEM counter reached zero the TTM counter (using qxl_bo_unref) was decremented. The qxl object is fully freed (both GEM and TTM part are cleaned) when the TTM counter reach zero. One issue was that surface idr structure has no owning on qxl_bo objects however it contains a pointer to qxl_bo object. This caused some nasty race condition for instance qxl_bo object was reaped even after counter was already zero. This patch fix these races moving main counter (the one used by qxl_bo_(un)ref) to GEM object which cleanup routine (qxl_gem_object_free) remove the idr pointer (using qxl_surface_evict) when the counters are still valid. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Remove format string errorsFrediano Ziglio4-4/+4
Enable format string checks for qxl_io_log and remove resulting warnings which could lead to memory errors on different platform or just printing wrong information. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Handle correctly failures in qxl_alloc_relase_reservedFrediano Ziglio1-2/+7
Free resources correctly if function fails Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Fix return for qxl_release_allocFrediano Ziglio1-1/+1
This function return handle to allocated release object which is an int. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Handle all errors in qxl_surface_evictFrediano Ziglio1-4/+4
Only EBUSY error was handled. This could cause code to believe reserve was successful while it failed. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Avoid double free on errorFrediano Ziglio1-2/+0
Is we are not able to get source bo object from handle we free destination bo object and call cleanup code however destination object was already inserted in reloc_info array (num_relocs was already incremented) so on cleanup we free destination again. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Fix print statement not using uninitialized variableFrediano Ziglio1-1/+1
reloc_info[i] is not still initialized in the print statement. Signed-off-by: Frediano Ziglio <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Do not leak memory if qxl_release_list_add failsFrediano Ziglio1-1/+3
If the function fails reference counter to the object is not decremented causing leaks. This is hard to spot as it happens only on very low memory situations. Signed-off-by: Frediano Ziglio <[email protected]> Cc: [email protected] Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-06-05drm/qxl: Do not cause spice-server to clean our objectsFrediano Ziglio1-0/+1
If objects are moved back from system memory to VRAM (and spice id created again) memory is already initialized so we need to set flag to not clear memory. If you don't do it after a while using desktop many images turns to black or transparents. Signed-off-by: Frediano Ziglio <[email protected]> Cc: [email protected] Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-05-07drm/qxl: rewrite framebuffer supportGerd Hoffmann1-218/+57
Completely different approach: Instead of encoding each and every framebuffer update as spice operation simply update the shadow framebuffer and maintain a dirty rectangle. Also schedule a worker to push an update for the dirty rectangle as spice operation. Usually a bunch of dirty rectangle updates are collected before the worker actually runs. What changes: Updates get batched now. Instead of sending tons of small updates a few large ones are sent. When the same region is updated multiple times within a short timeframe (scrolling multiple lines for example) we send a single update only. Spice server has an easier job now: The dependency tree for display operations which spice server maintains for lazy rendering is alot smaller now. Spice server's image compression probably works better too with the larger image blits. Net effect: framebuffer console @ qxldrmfb is an order of magnitude faster now. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2015-05-04drm/qxl: Fix qxl_noop_get_vblank_counter()Mario Kleiner1-1/+1
This breaks under the vblank timestamp cleanup patch by Daniel Vetter. Also it is pointless to return anything but zero (or any other constant) if the function doesn't actually query a hw vblank counter. The bogus return of the current drm vblank counter via direct readout or via drm_vblank_count() is found in many of the new kms drivers, but it does exactly nothing different from returning any arbitrary constant - it's a no operation. Let's simply return 0 - Easy and fast. Signed-off-by: Mario Kleiner <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-04-07drm/qxl: constify all struct drm_*_helper funcs pointersJani Nikula1-1/+1
They are not to be modified. Generated using the semantic patch: @@ @@ ( const struct drm_crtc_helper_funcs * | - struct drm_crtc_helper_funcs * + const struct drm_crtc_helper_funcs * ) @@ @@ ( const struct drm_encoder_helper_funcs * | - struct drm_encoder_helper_funcs * + const struct drm_encoder_helper_funcs * ) @@ @@ ( const struct drm_connector_helper_funcs * | - struct drm_connector_helper_funcs * + const struct drm_connector_helper_funcs * ) @@ @@ ( const struct drm_plane_helper_funcs * | - struct drm_plane_helper_funcs * + const struct drm_plane_helper_funcs * ) Signed-off-by: Jani Nikula <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-01-21drm/fb-helper: Propagate errors from initial config failureThierry Reding1-6/+16
Make drm_fb_helper_initial_config() return an int rather than a bool so that the error can be properly propagated. While at it, update drivers to propagate errors further rather than just ignore them. v2: - cirrus: No cleanup is required, the top-level cirrus_driver_load() will do it as part of cirrus_driver_unload() in its cleanup path. Reported-by: Fengguang Wu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Patrik Jakobsson <[email protected]> Cc: Rob Clark <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Christian König <[email protected]> Cc: Ben Skeggs <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Reviewed-by: Christian König <[email protected]> [danvet: Squash in simplification patch from kbuild.] Signed-off-by: Daniel Vetter <[email protected]>
2014-12-03drm/ttm: optionally move duplicates to a separate listChristian König1-1/+2
This patch adds an optional list_head parameter to ttm_eu_reserve_buffers. If specified duplicates in the execbuf list are no longer reported as errors, but moved to this list instead. Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2014-11-15drm/qxl: drop unused mode private pointerDave Airlie1-7/+0
This was pointless, forgot to remove the code. Signed-off-by: Dave Airlie <[email protected]>
2014-11-15drm/qxl: use suggested x/y offset properties to pass guest prefsDave Airlie1-0/+28
This passes the guest preferences for a where to place the outputs through to userspace. Userspace would need to be updated to take note of this information, X server and GNOME. Signed-off-by: Dave Airlie <[email protected]>
2014-11-05drm: Move drm_crtc_init from drm_crtc.h to drm_plane_helper.hDaniel Vetter1-0/+1
Just a bit of OCD cleanup on headers - this function isn't the core interface any more but just a helper for drivers who haven't yet transitioned to universal planes. Put the declaration at the right spot and sprinkle necessary #includes over all drivers. Maybe this helps to encourage driver maintainers to do the switch. v2: Fix #include ordering for tegra, reported by 0-day builder. v3: Include required headers, reported by Thierry. Cc: Matt Roper <[email protected]> Cc: Thierry Reding <[email protected]> Reviewed-by: Matt Roper <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2014-10-22qxl: don't create too large primary surfaceMarc-André Lureau1-8/+8
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 <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2014-10-01Merge branch 'for-airlied-next' of ↵Dave Airlie3-3/+3
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
2014-09-30drm/ttm: add reservation_object as argument to ttm_bo_initMaarten Lankhorst1-1/+1
This allows importing reservation objects from dma-bufs. Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-30drm: Pass dma-buf as argument to gem_prime_import_sg_tableMaarten Lankhorst2-2/+2
Allows importing dma_reservation_objects from a dma-buf. Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-24drm/qxl: use container_of to resolve qxl_fbdev from drm_fb_helperFabian Frederick1-1/+2
Use container_of instead of casting first structure member. Signed-off-by: Fabian Frederick <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2014-09-24drm: Extract <drm/drm_gem.h>Daniel Vetter1-0/+2
v2: Don't forget git add, noticed by David. Cc: David Herrmann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Acked-by: David Herrmann <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-09-24drm/<ttm-based-drivers>: Don't call drm_mmapDaniel Vetter1-1/+1
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" <[email protected]> Cc: David Herrmann <[email protected]> Cc: Rashika <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Fabian Frederick <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Christian Engelmayer <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: David Herrmann <[email protected]> Acked-by: Ben Skeggs <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-09-11drm/ttm: allow fence to be added as sharedChristian König1-0/+1
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 <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2014-09-10drm: add driver->set_busid() callbackDavid Herrmann1-0/+2
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 <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-09-03drm/qxl: Fix crash in eviction from qxl_release_fence_buffer_objectsMaarten Lankhorst1-1/+1
This crash was already here before the conversion, but qxl never leaked hard enough to hit this. Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-03drm/qxl: fix gaping memory holeMaarten Lankhorst1-4/+6
This is how you implement a memory sieve in a driver. ;-) Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-03drm/qxl: Remove release_lock stupidityMaarten Lankhorst2-8/+3
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 <[email protected]>
2014-09-03drm/qxl: enables gem prime helpers for qxl using dummy driver callbacksAndreas Pokorny4-2/+97
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-09-03drm/qxl: simple crtc page flipping emulated using buffer copyAndreas Pokorny3-4/+79
Signed-off-by: Andreas Pokorny <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-09-02drm/ttm: flip the switch, and convert to dma_fenceMaarten Lankhorst6-115/+5
Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-02drm/qxl: rework to new fence interfaceMaarten Lankhorst9-175/+220
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 <[email protected]>
2014-09-01drm/ttm: kill off some members to ttm_validate_bufferMaarten Lankhorst1-1/+0
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 <[email protected]>
2014-09-01drm/ttm: add interruptible parameter to ttm_eu_reserve_buffersMaarten Lankhorst1-1/+1
It seems some drivers really want this as a parameter, like vmwgfx. Signed-off-by: Maarten Lankhorst <[email protected]>
2014-09-01drm/ttm: kill fence_lockMaarten Lankhorst4-10/+0
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 <[email protected]>
2014-08-27drm/ttm: move fpfn and lpfn into each placement v2Christian König3-11/+16
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2014-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine1-1/+1
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 <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>