Skip to content
Commit 7dce8ec5 authored by Daniel Vetter's avatar Daniel Vetter Committed by Rajeshkumar Ramasamy
Browse files

drm/vgem: use shmem helpers

commit 8cf64e2aa0394d5bbb6941ba000d00496789d771 from
https://nv-tegra.nvidia.com/r/3rdparty/canonical/linux-jammy.git jetson_36.3

BugLink: https://bugs.launchpad.net/bugs/2034622

Aside from deleting lots of code the real motivation here is to switch
the mmap over to VM_PFNMAP, to be more consistent with what real gpu
drivers do. They're all VM_PFNMAP, which means get_user_pages doesn't
work, and even if you try and there's a struct page behind that,
touching it and mucking around with its refcount can upset drivers
real bad.

v2: Review from Thomas:
- sort #include
- drop more dead code that I didn't spot somehow

v3: select DRM_GEM_SHMEM_HELPER to make it build (intel-gfx-ci)

v4: I got tricked by 0cf2ef46

 ("drm/shmem-helper: Use cached
mappings by default"), and we need WC in vgem because vgem doesn't
have explicit begin/end cpu access ioctls.

Also add a comment why exactly vgem has to use wc.

v5: Don't set obj->base.funcs, it will default to drm_gem_shmem_funcs
(Thomas)

v6: vgem also needs an MMU for remapping

v7: I absolutely butchered the rebases over the vgem mmap change and
revert and broke the patch. Actually go back to v6 from before the
vgem mmap changes.

http://nvbugs/4262148

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Melissa Wen <melissa.srw@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210812131412.2487363-4-daniel.vetter@ffwll.ch

(cherry picked from commit 45d9c8dd

)
Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
Reviewed-by: default avatarBrad Griffis <bgriffis@nvidia.com>
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Acked-by: default avatarJacob Martin <jacob.martin@canonical.com>
Acked-by: default avatarNoah Wager <noah.wager@canonical.com>
Signed-off-by: default avatarJacob Martin <jacob.martin@canonical.com>
Signed-off-by: default avatarRajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
parent 0a2882bc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment