- 06 10月, 2021 1 次提交
-
-
由 Jeremy Cline 提交于
nouveau_bo_init() is backed by ttm_bo_init() and ferries its return code back to the caller. On failures, ttm_bo_init() invokes the provided destructor which should de-initialize and free the memory. Thus, when nouveau_bo_init() returns an error the gem object has already been released and the memory freed by nouveau_bo_del_ttm(). Fixes: 019cbd4a ("drm/nouveau: Initialize GEM object before TTM object") Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: NJeremy Cline <jcline@redhat.com> Reviewed-by: NLyude Paul <lyude@redhat.com> Reviewed-by: NKarol Herbst <kherbst@redhat.com> Signed-off-by: NKarol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201203000220.18238-1-jcline@redhat.comSigned-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
-
- 06 6月, 2021 1 次提交
-
-
由 Christian König 提交于
The functions can be called both in _rcu context as well as while holding the lock. v2: add some kerneldoc as suggested by Daniel v3: fix indentation Signed-off-by: NChristian König <christian.koenig@amd.com> Reviewed-by: NJason Ekstrand <jason@jlekstrand.net> Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210602111714.212426-7-christian.koenig@amd.com
-
- 02 6月, 2021 1 次提交
-
-
由 Christian König 提交于
When we want to decouble resource management from buffer management we need to be able to handle resources separately. Add a resource pointer and rename bo->mem so that all code needs to change to access the pointer instead. No functional change. Signed-off-by: NChristian König <christian.koenig@amd.com> Reviewed-by: NMatthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210430092508.60710-4-christian.koenig@amd.com
-
- 27 5月, 2021 1 次提交
-
-
由 Thomas Zimmermann 提交于
Moving the driver-specific mmap code into a GEM object function allows for using DRM helpers for various mmap callbacks. The GEM object function is provided by GEM TTM helpers. Nouveau's implementation of verify_access is unused and has been removed. Access permissions are validated by the DRM helpers. As a side effect, nouveau_ttm_vm_ops and nouveau_ttm_fault() are now implemented in nouveau's GEM code. Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de> Reviewed-by: NChristian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210525151055.8174-5-tzimmermann@suse.de
-
- 19 4月, 2021 1 次提交
-
-
由 Christian König 提交于
Change a couple of cases where it makes more sense to use the base size instead of the number of pages in the resource. Signed-off-by: NChristian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210413135248.1266-1-christian.koenig@amd.comReviewed-by: NMatthew Auld <matthew.auld@intel.com>
-
- 26 11月, 2020 1 次提交
-
-
由 Matti Hamalainen 提交于
Commit 03e0d26f ("drm/nouveau: slowpath for pushbuf ioctl") included a logic-bug which results in the relocations not actually getting applied at all as the call to nouveau_gem_pushbuf_reloc_apply() is never reached. This causes a regression with graphical corruption, triggered when relocations need to be done (for example after a suspend/resume cycle.) Fix by setting *apply_relocs value only if there were more than 0 relocations. Additionally, the never reached code had a leftover u_free() call, which, after fixing the logic, now got called and resulted in a double-free. Fix by removing one u_free(), moving the other and adding check for errors. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: nouveau@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: NMatti Hamalainen <ccr@tnsp.org> Fixes: 03e0d26f ("drm/nouveau: slowpath for pushbuf ioctl") References: https://gitlab.freedesktop.org/drm/nouveau/-/issues/11Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201120152338.1203257-1-ccr@tnsp.org
-
- 09 11月, 2020 1 次提交
-
-
由 Thomas Zimmermann 提交于
This patch replaces the vmap/vunmap's use of raw pointers in GEM object functions with instances of struct dma_buf_map. GEM backends are converted as well. For most of them, this simply changes the returned type. TTM-based drivers now return information about the location of the memory, either system or I/O memory. GEM VRAM helpers and qxl now use ttm_bo_vmap() et al. Amdgpu, nouveau and radeon use drm_gem_ttm_vmap() et al instead of implementing their own vmap callbacks. v7: * init QXL cursor to mapped BO buffer (kernel test robot) v5: * update vkms after switch to shmem v4: * use ttm_bo_vmap(), drm_gem_ttm_vmap(), et al. (Daniel, Christian) * fix a trailing { in drm_gem_vmap() * remove several empty functions instead of converting them (Daniel) * comment uses of raw pointers with a TODO (Daniel) * TODO list: convert more helpers to use struct dma_buf_map Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de> Acked-by: NChristian König <christian.koenig@amd.com> Tested-by: NSam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201103093015.1063-7-tzimmermann@suse.de
-
- 30 10月, 2020 1 次提交
-
-
由 Karol Herbst 提交于
we can't use nouveau_bo_ref here as no ttm object was allocated and nouveau_bo_ref mainly deals with that. Simply deallocate the object. Signed-off-by: NKarol Herbst <kherbst@redhat.com> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 25 9月, 2020 1 次提交
-
-
由 Thomas Zimmermann 提交于
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in nouveau. Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de> Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch> Acked-by: NChristian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-11-tzimmermann@suse.de
-
- 24 9月, 2020 1 次提交
-
-
由 Christian König 提交于
According to Ben this is most likely just a leftover. Signed-off-by: NChristian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/391078/?series=81804&rev=1Reviewed-by: NDave Airlie <airlied@redhat.com>
-
- 11 9月, 2020 1 次提交
-
-
由 Christian König 提交于
Those are going to be removed, stop using them here. Instead use the GEM flags from the UAPI. Signed-off-by: NChristian König <christian.koenig@amd.com> Reviewed-by: NDave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/389825/?series=81551&rev=1
-
- 24 7月, 2020 2 次提交
-
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com> Reviewed-by: NLyude Paul <lyude@redhat.com>
-
由 Aditya Pakki 提交于
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the ref count before returning the error. Signed-off-by: NAditya Pakki <pakki001@umn.edu> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 26 6月, 2020 1 次提交
-
-
由 Nirmoy Das 提交于
Store ttm bo->offset in struct nouveau_bo instead. Signed-off-by: NNirmoy Das <nirmoy.das@amd.com> Acked-by: NChristian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/372932/Signed-off-by: NChristian König <christian.koenig@amd.com>
-
- 22 5月, 2020 2 次提交
-
-
由 Dinghao Liu 提交于
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Dinghao Liu 提交于
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 20 5月, 2020 1 次提交
-
-
由 Emil Velikov 提交于
Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Ben Skeggs <bskeggs@redhat.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: NEmil Velikov <emil.velikov@collabora.com> Acked-by: NSam Ravnborg <sam@ravnborg.org> Acked-by: NThomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-26-emil.l.velikov@gmail.com
-
- 29 1月, 2020 2 次提交
-
-
由 Ben Skeggs 提交于
This is useful for debugging GPU hangs. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 06 11月, 2019 1 次提交
-
-
由 Daniel Vetter 提交于
We can't copy_*_user while holding reservations, that will (soon even for nouveau) lead to deadlocks. And it breaks the cross-driver contract around dma_resv. Fix this by adding a slowpath for when we need relocations, and by pushing the writeback of the new presumed offsets to the very end. Aside from "it compiles" entirely untested unfortunately. Cc: Ilia Mirkin <imirkin@alum.mit.edu> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: nouveau@lists.freedesktop.org Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: NDave Airlie <airlied@gmail.com> Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191104173801.2972-2-daniel.vetter@ffwll.ch
-
- 17 9月, 2019 2 次提交
-
-
由 Thierry Reding 提交于
When the last reference to a TTM BO is dropped, ttm_bo_release() will acquire the DMA reservation object's wound/wait mutex while trying to clean up (ttm_bo_cleanup_refs_or_queue() via ttm_bo_release()). It is therefore essential that drm_gem_object_release() be called after the TTM BO has been uninitialized, otherwise drm_gem_object_release() has already destroyed the wound/wait mutex (via dma_resv_fini()). Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Thierry Reding 提交于
Commit 019cbd4a ("drm/nouveau: Initialize GEM object before TTM object") introduced a subtle change in how the buffer allocation size is handled. Prior to that change, the size would get aligned to at least a page, whereas after that change a non-page-aligned size would get passed through unmodified. This ultimately causes a BUG_ON() to trigger in drm_gem_private_object_init() and crashes the system. Fix this by restoring the code that align the allocation size. Fixes: 019cbd4a ("drm/nouveau: Initialize GEM object before TTM object") Reported-by: NIlia Mirkin <imirkin@alum.mit.edu> Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 21 8月, 2019 1 次提交
-
-
由 Thierry Reding 提交于
TTM assumes that drivers initialize the embedded GEM object before calling the ttm_bo_init() function. This is not currently the case in the Nouveau driver. Fix this by splitting up nouveau_bo_new() into nouveau_bo_alloc() and nouveau_bo_init() so that the GEM can be initialized before TTM BO initialization when necessary. Fixes: b96f3e7c ("drm/ttm: use gem vma_node") Acked-by: NGerd Hoffmann <kraxel@redhat.com> Acked-by: NBen Skeggs <bskeggs@redhat.com> Signed-off-by: NThierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190814093524.GA31345@ulmo
-
- 13 8月, 2019 1 次提交
-
-
由 Christian König 提交于
Be more consistent with the naming of the other DMA-buf objects. Signed-off-by: NChristian König <christian.koenig@amd.com> Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/323401/
-
- 06 8月, 2019 3 次提交
-
-
由 Gerd Hoffmann 提交于
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Reviewed-by: NChristian König <christian.koenig@amd.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190805140119.7337-15-kraxel@redhat.com
-
由 Gerd Hoffmann 提交于
Drop vma_node from ttm_buffer_object, use the gem struct (base.vma_node) instead. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Reviewed-by: NChristian König <christian.koenig@amd.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190805140119.7337-9-kraxel@redhat.com
-
由 Gerd Hoffmann 提交于
Drop drm_gem_object from nouveau_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Acked-by: NChristian König <christian.koenig@amd.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190805140119.7337-7-kraxel@redhat.com
-
- 20 2月, 2019 1 次提交
-
-
由 Ben Skeggs 提交于
For a channel to make use of SVM features, it requires a different GPU MMU configuration than we would normally use, which is not desirable to switch to unless a client is actively going to use SVM. In order to supporting SVM without more extensive changes to the userspace interfaces, the SVM_INIT ioctl needs to replace the previous configuration safely. The only way we can currently do this safely, accounting for some unlikely failure conditions, is to allocate the new VMM without destroying the last one, and prioritising the SVM-enabled configuration in the code that cares. This will get cleaned up again further down the track. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 29 1月, 2019 1 次提交
-
-
由 Thomas Zimmermann 提交于
The function ttm_bo_put releases a reference to a TTM buffer object. The function's name is more aligned to the Linux kernel convention of naming ref-counting function _get and _put. A call to ttm_bo_unref takes the address of the TTM BO object's pointer and clears the pointer's value to NULL. This is not necessary in most cases and sometimes even worked around by the calling code. A call to ttm_bo_put only releases the reference without clearing the pointer. Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de> Reviewed-by: NChristian König <christian.koenig@amd.com> Reviewed-by: NHuang Rui <ray.huang@amd.com> Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
-
- 16 7月, 2018 2 次提交
-
-
由 Thomas Zimmermann 提交于
This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces. Signed-off-by: NThomas Zimmermann <tdz@users.sourceforge.net> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Dan Carpenter 提交于
The bo array has req->nr_buffers elements so the > should be >= so we don't read beyond the end of the array. Fixes: a1606a95 ("drm/nouveau: new gem pushbuf interface, bump to 0.0.16") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 18 5月, 2018 3 次提交
-
-
由 Ben Skeggs 提交于
As VMAs are per-client, unlike buffers, this allows us to avoid referencing foreign fences (those that belong to another client/driver) from the client deferred work handler, and prevent some not-fun race conditions that can be triggered when a fence stalls. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
An upcoming patch will use these to fix issues related to the deferred unmapping of GEM objects. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
We previously only did this for push buffers, but an upcoming patch will need to attach fences to all VMAs to resolve another issue. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
- 07 12月, 2017 1 次提交
-
-
由 Christian König 提交于
Just another alias for ttm_bo_unreserve. Signed-off-by: NChristian König <christian.koenig@amd.com> Reviewed-and-Tested-by: NMichel Dänzer <michel.daenzer@amd.com> Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
-
- 02 11月, 2017 5 次提交
-
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
VMAs are about to not take references on the VMM they belong to, which means more care is required when handling delayed unmapping. Queuing it on the client workqueue ensures all pending VMA unmaps will have completed before the VMM is destroyed. Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-
由 Ben Skeggs 提交于
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
-