aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx
AgeCommit message (Collapse)AuthorFilesLines
2018-12-05drm/vmwgfx: Fix a layout race conditionThomas Hellstrom3-37/+39
This fixes a layout update race condition. We make sure the crtc mutex is locked before we dereference crtc->state. Otherwise the state might change under us. Since now we're already holding the crtc mutexes when reading the gui coordinates, protect them with the crtc mutexes rather than with the requested_layout mutex. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Deepak Rawat <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-12-05drm/vmwgfx: Fix up the implicit display unit handlingThomas Hellstrom6-292/+99
Make the connector is_implicit property immutable. As far as we know, no user-space application is writing to it. Also move the verification that all implicit display units scan out from the same framebuffer to atomic_check(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-12-05drm/vmwgfx: Don't clear mode::type anymoreDeepak Rawat5-28/+3
With kernel commit "drm/modes: Kill off the oddball DRM_MODE_TYPE_CRTC_C vs. DRM_MODE_TYPE_BUILTIN handling", no need to clear mode::type for user-space bug. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Use atomic helper function for dirty fb IOCTLDeepak Rawat1-64/+18
USe new atomic helper for dirty fb IOCTL which make use of damage interface. Note that this is only done for STDU and SOU, for legacy display unit still using old interface. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Enable FB_DAMAGE_CLIPS property for SOU primary planeDeepak Rawat1-0/+2
SOU primary plane now support damage clips, enable it for user-space. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Update comments for sou plane update functionDeepak Rawat1-15/+3
Update comments to sync with code. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Use the new interface for SOU plane updateDeepak Rawat1-12/+5
With new interface to do plane update on SOU available, use that instead of old kms_dirty. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Implement SOU plane update for BO backed fbDeepak Rawat1-0/+101
Using the new interface implement SOU plane update for BO backed fb. v2: Rebase to new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Implement SOU plane update for surface backed fbDeepak Rawat2-0/+172
Using the new interface implement SOU plane update for surface backed fb. v2: Rebase to new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Enable FB_DAMAGE_CLIPS property for STDU primary planeDeepak Rawat1-0/+1
STDU primary plane now support damage clips, enable it for user-space. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Update comments for stdu plane updateDeepak Rawat1-15/+3
Update the comments to sync with code. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Use the new interface for STDU plane updateDeepak Rawat1-34/+20
With new interface to do plane update on STDU available, use that instead of old kms_dirty. v2: Use fence from new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Implement STDU plane update for BO backed fbDeepak Rawat2-0/+227
Using the new interface implement STDU plane update for BO backed fb. v2: Rebase to new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Implement STDU plane update for surface backed fbDeepak Rawat1-1/+181
Using the new interface implement STDU plane update for surface backed fb. v2: Rebase to new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-12-05drm/vmwgfx: Add a new interface for plane update on a display unitDeepak Rawat2-0/+233
Add a new struct vmw_du_update_plane similar to vmw_kms_dirty which represent the flow of operations needed to update a display unit from surface or bo (blit a new framebuffer). v2: - Kernel doc correction. - Rebase. v3: Rebase to new resource validation. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-11-19Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie3-71/+4
into drm-next New features for 4.21: amdgpu: - Support for SDMA paging queue on vega - Put compute EOP buffers into vram for better performance - Share more code with amdkfd - Support for scanout with DCC on gfx9 - Initial kerneldoc for DC - Updated SMU firmware support for gfx8 chips - Rework CSA handling for eventual support for preemption - XGMI PSP support - Clean up RLC handling - Enable GPU reset by default on VI, SOC15 dGPUs - Ring and IB test cleanups amdkfd: - Share more code with amdgpu ttm: - Move global init out of the drivers scheduler: - Track if schedulers are ready for work - Timeout/fault handling changes to facilitate GPU recovery Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-11-12iommu/vtd: Cleanup dma_remapping.h headerLu Baolu1-1/+1
Commit e61d98d8dad00 ("x64, x2apic/intr-remap: Intel vt-d, IOMMU code reorganization") moved dma_remapping.h from drivers/pci/ to current place. It is entirely VT-d specific, but uses a generic name. This merges dma_remapping.h with include/linux/intel-iommu.h and removes dma_remapping.h as the result. Cc: Ashok Raj <[email protected]> Cc: Jacob Pan <[email protected]> Cc: Sohil Mehta <[email protected]> Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Liu, Yi L <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
2018-11-05drm/ttm: initialize globals during device init (v2)Christian König3-40/+1
Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. v2: fix up vbox (Alex) Signed-off-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2018-11-05drm/ttm: use a static ttm_mem_global instanceChristian König3-31/+3
As the name says we only need one global instance of ttm_mem_global. Drop all the driver initialization and just use a single exported instance which is initialized during BO global initialization. Signed-off-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2018-11-05drm/ttm: Rename ttm_bo_global_{init,release}() to ttm_bo_global_ref_{,}()Thomas Zimmermann1-2/+2
The functions ttm_bo_global_init() and ttm_bo_global_release() do not receive an argument of type struct ttm_bo_global. Both take a struct drm_global_reference that contains points to a struct ttm_bo_global_ref. Renaming them reflects this. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2018-10-24Merge drm/drm-next into drm-misc-nextSean Paul27-1169/+3569
4.19 is out, Lyude asked for a backmerge, and it's been a while. All very good reasons on their own :-) Signed-off-by: Sean Paul <[email protected]>
2018-10-05drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_checkThomas Hellstrom1-12/+12
Use the correct helper and also return early on helper success rather than on helper failure. Also explicitly return 0 in the case of no fb. v2: Check for !fb after updating state->visible (Ville). Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> (v1) Reported-by: Dan Carpenter <[email protected]> Reported-by: Daniel Vetter <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: VMware Graphics <[email protected]> Cc: Sinclair Yeh <[email protected]> Cc: Thomas Hellstrom <[email protected]> Acked-by: Thomas Hellstrom <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-10-05drm/atomic-helper: Unexport drm_atomic_helper_best_encoderDaniel Vetter3-3/+0
It's the default. The exported version was kinda a transition state, before we made this the default. To stop new atomic drivers from using it (instead of just relying on the default) let's unexport it. v2: rename the default implementation to a more fitting name and add a comment (Laurent) Signed-off-by: Daniel Vetter <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: VMware Graphics <[email protected]> Cc: Sinclair Yeh <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Neil Armstrong <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Hans Verkuil <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Russell King <[email protected]> Cc: Jernej Skrabec <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Pierre-Hugues Husson <[email protected]> Cc: Fabio Estevam <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-10-04Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux ↵Dave Airlie27-1169/+3569
into drm-next Mostly code reorganizations and optimizations for vmwgfx. - Move TTM code that's only used by vmwgfx to vmwgfx - Break out the vmwgfx buffer- and resource validation code to a separate source file - Get rid of a number of atomic operations during command buffer validation. From: Thomas Hellstrom <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-09-28drm/vmwgfx: Make user resource lookups reference-free during validationThomas Hellstrom3-133/+187
Make the process of looking up a user resource and adding it to the validation list reference-free unless when it's actually added to the validation list where a single reference is taken. This saves two locked atomic operations per command stream buffer object handle lookup, unless there is a lookup cache hit. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-28drm/vmwgfx: Don't refcount cotable lookups during command buffer validationThomas Hellstrom4-10/+6
The typical pattern of these lookups are -Lookup -Put on validate list if not already there. -Unreference And since we are the exclusive user of the context during lookup time, we can be sure that the resource will stay alive during the sequence. So avoid taking a reference during lookup, and also avoid unreferencing when done. There are two users outside of command buffer validation and those are refcounted explicitly. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-28drm/vmwgfx: Don't refcount command-buffer managed resource lookups during ↵Thomas Hellstrom2-45/+27
command buffer validation The typical pattern of these lookups are -Lookup -Put on validate list if not already there. -Unreference And since we are the exclusive user of the context during lookup time, we can be sure that the resource will stay alive during the sequence. So avoid taking a reference during lookup, and also avoid unreferencing when done. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-28drm/vmwgfx: Make buffer object lookups reference-free during validationThomas Hellstrom1-55/+30
Make the process of looking up a buffer object and adding it to the validation list reference-free unless when it's actually added to the validation list where a single reference is taken. This saves two locked atomic operations per command stream buffer object handle lookup. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-28drm/vmwgfx: Look up user buffer objects without taking a referenceThomas Hellstrom2-0/+53
Identically to how we look up ttm base objects witout reference, provide the same functionality to vmw user buffer objects which derive from them. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-28drm/vmwgfx: Adapt validation code for reference-free lookupsThomas Hellstrom2-6/+74
Adapt the validation code so that vmw_validation_add[res|bo] can be called under an rcu read lock (non-sleeping) and with rcu-only protected resource- or buffer object pointers. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Look up objects without taking a referenceThomas Hellstrom2-0/+50
Typically when we look up objects under the rcu lock, we take a reference to make sure the returned object pointer is valid. Now provide a function to look up an object and instead of taking a reference to it, keep the rcu lock held when returning the object pointer. This means that the object pointer is valid as long as the rcu lock is held, but the object may be doomed (its refcount may be zero). Any persistent usage of the object pointer outside of the rcu lock requires a reference to be taken using kref_get_unless_zero(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Make the object handles idr-generatedThomas Hellstrom10-62/+65
Instead of generating user-space object handles based on a, possibly processed, hash of the kernel address of the object, use idr to generate and lookup those handles. This might improve somewhat on security since we loose all connections to the object's kernel address. Also idr is designed to do just this. As a todo-item, since user-space handles are now generated in sequence, we can probably use a much simpler hash function to hash them. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-09-27drm/vmwgfx: Remove the user resource destructor checkThomas Hellstrom1-3/+0
We were checking that the resource destructor matched that of the intended object type, to make sure the looked up resource was of the right type. But we already have an object type check in place which makes sure the resource is of the right type. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-09-27drm/vmwgfx: Remove the resource avail fieldThomas Hellstrom10-73/+68
This field was previously used to prevent a lookup of a resource before its constructor had run to its end. This was mainly intended for an interface that is now removed that allowed looking up a resource by its device id. Currently all affected resources are added to the lookup mechanism (its TTM prime object is initialized) late in the constructor where it's OK to look up the resource. This means we can change the device resource_lock to an ordinary spinlock instead of an rwlock and remove a locking sequence during lookup. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-09-27drm/vmwgfx: Replace unconditional mutex unlocked warnings with lockdep ↵Thomas Hellstrom3-6/+6
counterpart Replace instances of WARN_ON[_ONCE](!mutex_is_held()) with lockdep_assert_held(). This makes sure the checking process actually holds the mutex and also removes the checks from release builds Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-09-27drm/vmwgfx: Reduce the size of buffer object relocationsThomas Hellstrom1-4/+5
With the new allocator this leads to less consumed memory for each user-space command submission Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
2018-09-27drm/vmwgfx: Use a validation context allocator for relocations and validationsThomas Hellstrom4-64/+132
A common trait of these objects are that they are allocated during the command validation phase and freed after command submission. Furthermore they are accessed by a single thread only. So provide a simple unprotected stack-like allocator from which these objects can be allocated. Their memory is freed with the validation context when the command submission is done. Note that the mm subsystem maintains a per-cpu cache of single pages to make single page allocation and freeing efficient. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Use new validation interface for the modesetting code v2Thomas Hellstrom4-216/+86
Strip the old KMS helpers and use the new validation interface also in the modesetting code. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Deepak Rawat <[email protected]> #v1 Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Adapt execbuf to the new validation apiThomas Hellstrom3-594/+360
Strip the old execbuf validation functionality and use the new API instead. Also use the new API for a now removed execbuf function that was called from the kms code. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Modify the resource validation interfaceThomas Hellstrom5-9/+12
Allow selecting interruptible or uninterruptible waits to match expectations of callers. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Deepak Rawat <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
2018-09-27drm/vmwgfx: Add a validation module v2Thomas Hellstrom3-0/+862
Isolate the functionality needed for reservation, validation and fencing of vmwgfx buffer objects and resources and publish an API for this. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]> #v1
2018-09-27drm/ttm, drm/vmwgfx: Move the lock- and object functionality to the vmwgfx ↵Thomas Hellstrom9-6/+1663
driver No other driver is using this functionality so move it out of TTM and into the vmwgfx driver. Update includes and remove exports. Also annotate to remove false static analyzer lock balance warnings. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Christian König <[email protected]>
2018-09-27BackMerge v4.19-rc5 into drm-nextDave Airlie4-48/+45
Sean Paul requested an -rc5 backmerge from some sun4i fixes. Signed-off-by: Dave Airlie <[email protected]>
2018-09-20drm/vmwgfx: Fix buffer object evictionThomas Hellstrom1-1/+1
Commit 19be55701071 ("drm/ttm: add operation ctx to ttm_bo_validate v2") introduced a regression where the vmwgfx driver refused to evict a buffer that was still busy instead of waiting for it to become idle. Fix this. Cc: <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Christian König <[email protected]>
2018-09-20drm/vmwgfx: Don't impose STDU limits on framebuffer sizeDeepak Rawat2-35/+14
If framebuffers are larger, we create bounce surfaces that are within STDU limits. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-09-20drm/vmwgfx: limit mode size for all display unit to texture_maxDeepak Rawat1-3/+7
For all display units, limit mode size exposed to texture_max_width/ height as this is the maximum framebuffer size that virtual device can create. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-09-20drm/vmwgfx: limit screen size to stdu_max during check_modesetDeepak Rawat1-8/+22
For STDU individual screen target size is limited by SVGA_REG_SCREENTARGET_MAX_WIDTH/HEIGHT registers so add that limit during atomic check_modeset. An additional limit is placed in the update_layout ioctl to avoid requesting layouts that current user-space typically can't support. Also modified the comments to reflect current limitation on topology. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-09-20drm/vmwgfx: don't check for old_crtc_state enable statusDeepak Rawat1-1/+1
During atomic check to prepare the new topology no need to check if old_crtc_state was enabled or not. This will cause atomic_check to fail because due to connector routing a crtc can be in atomic_state even if there was no change to enable status. Detected this issue with igt run. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-08-27Merge drm/drm-next into drm-misc-nextSean Paul32-2591/+3914
Now that 4.19-rc1 is cut, backmerge it into -misc-next. Signed-off-by: Sean Paul <[email protected]>
2018-08-26Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-daxLinus Torvalds1-29/+12
Pull IDA updates from Matthew Wilcox: "A better IDA API: id = ida_alloc(ida, GFP_xxx); ida_free(ida, id); rather than the cumbersome ida_simple_get(), ida_simple_remove(). The new IDA API is similar to ida_simple_get() but better named. The internal restructuring of the IDA code removes the bitmap preallocation nonsense. I hope the net -200 lines of code is convincing" * 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax: (29 commits) ida: Change ida_get_new_above to return the id ida: Remove old API test_ida: check_ida_destroy and check_ida_alloc test_ida: Convert check_ida_conv to new API test_ida: Move ida_check_max test_ida: Move ida_check_leaf idr-test: Convert ida_check_nomem to new API ida: Start new test_ida module target/iscsi: Allocate session IDs from an IDA iscsi target: fix session creation failure handling drm/vmwgfx: Convert to new IDA API dmaengine: Convert to new IDA API ppc: Convert vas ID allocation to new IDA API media: Convert entity ID allocation to new IDA API ppc: Convert mmu context allocation to new IDA API Convert net_namespace to new IDA API cb710: Convert to new IDA API rsxx: Convert to new IDA API osd: Convert to new IDA API sd: Convert to new IDA API ...