aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/ttm_object.h
AgeCommit message (Collapse)AuthorFilesLines
2019-08-15drm/vmwgfx: drop use of drmP.h in header filesSam Ravnborg1-3/+4
To facilitate removal of drmP.h in the .c files remove the use from header files first. Fix fallout in the other files. Sorted include files in blocks and sorted files within each block in alphabetical order. This revealed a dependency from an uapi header to a header located below drivers/gpu/drm/vmwgfx/. Added FIXME to remind someone to fix this. Signed-off-by: Sam Ravnborg <[email protected]> Cc: VMware Graphics <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Reviewed-by: Deepak Rawat <[email protected]> Signed-off-by: Deepak Rawat <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]>
2018-09-27drm/vmwgfx: Look up objects without taking a referenceThomas Hellstrom1-0/+15
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 Hellstrom1-3/+10
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/ttm, drm/vmwgfx: Move the lock- and object functionality to the vmwgfx ↵Thomas Hellstrom1-0/+353
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]>