2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 15:13:55 +08:00
linux-next/drivers/gpu/drm
Daniel Vetter 8b93d1d7db drm/shmem-helper: Switch to vmf_insert_pfn
We want to stop gup, which isn't the case if we use vmf_insert_page
and VM_MIXEDMAP, because that does not set pte_special.

The motivation here is to stop get_user_pages from working on buffer
object mmaps in general. Quoting some discussion with Thomas:

On Thu, Jul 22, 2021 at 08:22:43PM +0200, Thomas Zimmermann wrote:
> Am 13.07.21 um 22:51 schrieb Daniel Vetter:
> > We want to stop gup, which isn't the case if we use vmf_insert_page
>
> What is gup?

get_user_pages. It pins memory wherever it is, which badly wreaks at least
ttm and could also cause trouble with cma allocations. In both cases
becaue we can't move/reuse these pages anymore.

Now get_user_pages fails when the memory isn't considered "normal", like
with VM_PFNMAP and using vm_insert_pfn. For consistency across all dma-buf
I'm trying (together with Christian König) to roll this out everywhere,
for fewer surprises.

E.g. for 5.14 iirc we merged a patch to do the same for ttm, where it
closes an actual bug (ttm gets really badly confused when there's suddenly
pinned pages where it thought it can move them).

cma allcoations already use VM_PFNMAP (because that's what dma_mmap is
using underneath), as is anything that's using remap_pfn_range. Worst case
we have to revert this patch for shmem helpers if it breaks something, but
I hope that's not the case. On the ttm side we've also had some fallout
that we needed to paper over with clever tricks.
v2: With this shmem gem helpers now definitely need CONFIG_MMU (0day)

v3: add more depends on MMU. For usb drivers this is a bit awkward,
but really it's correct: To be able to provide a contig mapping of
buffers to userspace on !MMU platforms we'd need to use the cma
helpers for these drivers on those platforms. As-is this wont work.

Also not exactly sure why vm_insert_page doesn't go boom, because that
definitely wont fly in practice since the pages are non-contig to
begin with.

v4: Explain the entire motivation a lot more (Thomas)

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210812131412.2487363-2-daniel.vetter@ffwll.ch
2021-08-12 21:41:10 +02:00
..
amd drm/amdgpu: Convert to Linux IRQ interfaces 2021-08-10 20:00:44 +02:00
arm drm/arm/hdlcd: Convert to Linux IRQ interfaces 2021-08-10 20:00:51 +02:00
armada drm/aperture: Pass DRM driver structure instead of driver name 2021-07-01 11:11:55 +02:00
aspeed drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
ast drm/ast: Use offset-adjusted shadow-plane mappings 2021-08-08 20:27:06 +02:00
atmel-hlcdc drm/atmel-hlcdc: Convert to Linux IRQ interfaces 2021-08-10 20:00:58 +02:00
bridge drm/bridge: ti-sn65dsi86: Avoid creating multiple connectors 2021-08-12 09:56:09 -07:00
etnaviv drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr 2021-07-01 08:53:25 +02:00
exynos drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
fsl-dcu drm/fsl-dcu: Convert to Linux IRQ interfaces 2021-08-10 20:13:25 +02:00
gma500 drm/gma500: Convert to Linux IRQ interfaces 2021-08-10 20:13:32 +02:00
gud drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
hisilicon drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
hyperv drm/hyperv: Use offset-adjusted shadow-plane mappings 2021-08-08 20:27:27 +02:00
i2c
i810 drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
i915 Linux 5.14-rc3 2021-07-26 09:27:59 +10:00
imx drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
ingenic drm/ingenic: Use standard drm_atomic_helper_commit_tail 2021-08-11 15:49:15 +02:00
kmb drm/kmb: Convert to Linux IRQ interfaces 2021-08-10 20:13:37 +02:00
lib
lima drm-misc-next for v5.15: 2021-07-21 11:58:28 +10:00
mcde drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
mediatek drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
meson drm-misc-next for v5.15: 2021-07-21 11:58:28 +10:00
mga drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
mgag200 drm/mgag200: Use offset-adjusted shadow-plane mappings 2021-08-08 20:27:30 +02:00
msm drm/msm: Convert to Linux IRQ interfaces 2021-08-10 20:13:41 +02:00
mxsfb drm/mxsfb: Convert to Linux IRQ interfaces 2021-08-10 20:13:45 +02:00
nouveau drm: nouveau: fix disp.c build when NOUVEAU_BACKLIGHT is not enabled 2021-08-05 14:46:04 +02:00
omapdrm drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
panel drm/panel: simple: add LOGIC Technologies LTTD800480070-L6WH-RT 2021-08-05 20:45:30 +02:00
panfrost drm/panfrost: devfreq: Don't display error for EPROBE_DEFER 2021-07-23 12:06:29 +01:00
pl111 drm/pl111: Remove unused including <linux/version.h> 2021-07-31 20:52:01 +02:00
qxl drm-misc-next for v5.15: 2021-07-21 11:58:28 +10:00
r128 drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
radeon drm/radeon: Convert to Linux IRQ interfaces 2021-08-10 20:13:49 +02:00
rcar-du drm: rcar-du: lvds: Use dev_err_probe() 2021-07-28 16:33:32 +03:00
rockchip drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
savage
scheduler drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr 2021-07-01 08:53:25 +02:00
selftests drm: Fix oops in damage self-tests by mocking damage property 2021-08-02 11:15:11 +02:00
shmobile drm/shmobile: Convert to Linux IRQ interfaces 2021-07-25 11:01:12 +02:00
sis
sti drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
stm drm/stm: dsi: compute the transition time from LP to HS and back 2021-07-19 15:35:55 +02:00
sun4i drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
tdfx
tegra drm/bridge: Centralize error message when bridge attach fails 2021-07-28 16:33:12 +03:00
tidss drm/tidss: Convert to Linux IRQ interfaces 2021-08-10 20:13:49 +02:00
tilcdc drm/tilcdc: Convert to Linux IRQ interfaces 2021-08-10 20:13:53 +02:00
tiny drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
ttm Linux 5.14-rc3 2021-07-26 09:27:59 +10:00
tve200 drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
udl drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
v3d drm/v3d: Expose performance counters to userspace 2021-07-21 00:19:59 +01:00
vboxvideo drm/vbox: Use offset-adjusted shadow-plane mappings 2021-08-08 20:27:49 +02:00
vc4 drm/vc4: Convert to Linux IRQ interfaces 2021-08-10 20:13:53 +02:00
vgem Revert "drm/vgem: Implement mmap as GEM object function" 2021-07-13 13:15:52 +02:00
via drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
virtio drm/virtio: set non-cross device blob uuid_state 2021-08-12 14:58:31 +02:00
vkms drm/vkms: Use offset-adjusted shadow-plane mappings and output 2021-08-08 20:27:52 +02:00
vmwgfx drm/vmwgfx: Replace "vmw_num_pages" with "PFN_UP" 2021-08-09 17:30:35 -04:00
xen drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
xlnx drm/xlnx: Don't set struct drm_device.irq_enabled 2021-06-29 15:40:53 +02:00
zte drm/zte: Don't set struct drm_device.irq_enabled 2021-06-29 15:40:53 +02:00
drm_agpsupport.c
drm_aperture.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_auth.c drm: add lockdep assert to drm_is_current_master_locked 2021-08-05 12:08:15 +02:00
drm_blend.c
drm_bridge_connector.c
drm_bridge.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_bufs.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_cache.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_client_modeset.c
drm_client.c
drm_color_mgmt.c
drm_connector.c drm: avoid circular locks in drm_mode_getconnector 2021-07-20 20:13:56 +02:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h Backmerge remote-tracking branch 'drm/drm-next' into drm-misc-next 2021-07-27 12:48:17 +02:00
drm_crtc.c
drm_damage_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_debugfs_crc.c
drm_debugfs.c drm: avoid blocking in drm_clients_info's rcu section 2021-07-20 20:14:42 +02:00
drm_displayid.c
drm_dma.c
drm_dp_aux_bus.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/dp_mst: Fix return code on sideband message failure 2021-07-27 18:58:28 -04:00
drm_drv.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_dsc.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_file.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_flip_work.c
drm_format_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_fourcc.c
drm_framebuffer.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_gem_atomic_helper.c drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_shmem_helper.c drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_gem.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_hashtab.c
drm_hdcp.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_internal.h
drm_ioc32.c
drm_ioctl.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_irq.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_kms_helper_common.c
drm_lease.c drm: clean up unused kerneldoc in drm_lease.c 2021-07-30 11:55:41 +02:00
drm_legacy_misc.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_legacy.h
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Use framebuffer dma-buf helpers 2021-07-23 20:17:59 +02:00
drm_mipi_dsi.c
drm_mm.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_mode_config.c
drm_mode_object.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_modes.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c drm/of: free the iterator object on failure 2021-07-15 10:54:04 +01:00
drm_panel_orientation_quirks.c
drm_panel.c drm/dp: Move panel DP AUX backlight support to drm_dp_helper 2021-07-13 06:38:37 -07:00
drm_pci.c
drm_plane_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_plane.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_prime.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_print.c
drm_probe_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_property.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Support custom CRTC state 2021-08-08 20:14:08 +02:00
drm_syncobj.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_vm.c
drm_vma_manager.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_writeback.c
Kconfig drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
Makefile drm/bochs: Move to tiny/ 2021-07-05 08:54:44 +02:00