aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
AgeCommit message (Collapse)AuthorFilesLines
2020-11-10drm: omapdrm: Replace HTTP links with HTTPS onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-11-25drm/omapdrm: Drop dma_buf->k(un)mapDaniel Vetter1-21/+0
No in-tree users left. Note that this is one of the few (if only) implementations of dma-buf that provided a kmap, but not a vmap implemenation. Given that the only real user (in-tree at least) of kmap was tegra, and it's impossible to buy a chip with tegra host1x and ompadrm on the same SoC, there's no problem here. Acked-by: Tomi Valkeinen <[email protected]> Acked-by: Sumit Semwal <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-11drm/omap: remove OMAP_BO_TILED defineTomi Valkeinen1-1/+1
OMAP_BO_TILED does not make sense, as OMAP_BO_TILED_* values are not bitmasks but normal values. As we already have OMAP_BO_TILED_MASK for the mask, we can remove OMAP_BO_TILED and use OMAP_BO_TILED_MASK instead. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Jean-Jacques Hiblot <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-07-22Merge v5.3-rc1 into drm-misc-nextMaxime Ripard1-12/+1
Noralf needs some SPI patches in 5.3 to merge some work on tinydrm. Signed-off-by: Maxime Ripard <[email protected]>
2019-07-17drm/omapdrm: drop use of drmP.hSam Ravnborg1-0/+3
Drop use of the deprecated header drmP.h. Rearranged list of include files to match rest of DRM too. The drmP.h file was deleted from the header file, and the necessary includes was added to the .c files to fix build. Signed-off-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-21drm/prime: Align gem_prime_export with obj_funcs.exportDaniel Vetter1-3/+2
The idea is that gem_prime_export is deprecated in favor of obj_funcs.export. That's much easier to do if both have matching function signatures. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Russell King <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Christian König" <[email protected]> Cc: "David (ChunMing) Zhou" <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Eric Anholt <[email protected]> Cc: "Michel Dänzer" <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Huang Rui <[email protected]> Cc: Felix Kuehling <[email protected]> Cc: Hawking Zhang <[email protected]> Cc: Feifei Xu <[email protected]> Cc: Jim Qu <[email protected]> Cc: Evan Quan <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Jilayne Lovejoy <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Mikulas Patocka <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Junwei Zhang <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234Thomas Gleixner1-12/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 503 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-02drm/omap: Replace drm_gem_object_{un/reference} with put,get functionsThomas Zimmermann1-1/+1
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: Thomas Zimmermann <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2018-06-25drm/omap: remove now unused functionsChristian König1-17/+0
Some functions are unused after removal of the kmap_atomic DMA-buf interface. Signed-off-by: Christian König <[email protected]> Fixes: f664a5269542 ("dma-buf: remove kmap_atomic interface") Link: https://patchwork.freedesktop.org/series/45245/ Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2018-06-20dma-buf: remove kmap_atomic interfaceChristian König1-2/+0
Neither used nor correctly implemented anywhere. Just completely remove the interface. Signed-off-by: Christian König <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Sumit Semwal <[email protected]> Link: https://patchwork.freedesktop.org/patch/226645/
2017-12-19drm: omapdrm: Remove filename from header and fix copyright tagAndrew F. Davis1-3/+1
Having the filename in the header serves little purpose and is often wrong after renames as it is here in several places, just drop it from all omapdrm files. While we are here unify the copyright tags to the TI recommended style. Signed-off-by: Andrew F. Davis <[email protected]>
2017-08-15drm/omap: dma-buf: Constify dma_buf_ops structures.Arvind Yadav1-1/+1
dma_buf_ops are not supposed to change at runtime. All functions working with dma_buf_ops provided by <linux/dma-buf.h> work with const dma_buf_ops. So mark the non-const structs as const. File size before: text data bss dec hex filename 1240 112 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o File size After adding 'const': text data bss dec hex filename 1352 0 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Take GEM object reference when exporting dmabufLaurent Pinchart1-12/+2
To ensure that neither the GEM object nor the DRM device goes away while a GEM object exported through dma-buf is still accessible, references must be taken to both the GEM object and the DRM device at export time. The dma-buf release handler already releases the GEM object, but the export handler doesn't take a corresponding reference, which results in a refcount underflow. Fix this by replacing the custom implementation by drm_gem_dmabuf_export() and drm_gem_dmabuf_release() that handle reference counting for us. Fixes: 6ad11bc3a0b8 ("staging: drm/omap: dmabuf/prime support") Signed-off-by: Laurent Pinchart <[email protected]>
2017-06-02drm: omapdrm: Map pages for DMA in DMA_TO_DEVICE directionLaurent Pinchart1-2/+2
The display engine only reads from memory, there's no need to use bidirectional DMA mappings. Use DMA_TO_DEVICE instead. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename GEM DMA sync functionsLaurent Pinchart1-3/+3
The omap_gem_cpu_sync() function operates at a page level, while the omap_gem_dma_sync() function operates at a buffer level. Rename them to omap_gem_cpu_sync_page() and omap_gem_dma_sync_buffer() respectively to avoid confusion. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename omap_gem_(get|put)_paddr() to omap_gem_(un)pin()Laurent Pinchart1-3/+3
The reflects the purpose of the function better. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Rename occurrences of paddr to dma_addrLaurent Pinchart1-4/+4
The fields, variables and functions deal with DMA addresses, name them accordingly. The omap_gem_get_paddr() and omap_gem_put_paddr() will be addressed differently separately. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-06-02drm: omapdrm: Remove remap argument to omap_gem_get_paddr()Laurent Pinchart1-1/+1
The function is always called with the remap argument set to true. Hardcode that behaviour and remove it. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2017-04-20dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macroLogan Gunthorpe1-4/+4
Seeing the kunmap_atomic dma_buf_ops share the same name with a macro in highmem.h, the former can be aliased if any dma-buf user includes that header. I'm personally trying to include highmem.h inside scatterlist.h and this breaks the dma-buf code proper. Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. To maintain consistency I've renamed all four of kmap* and kunmap* to be map* and unmap*. (Even though only kmap_atomic presently conflicts.) [1] https://www.spinics.net/lists/target-devel/msg15070.html Signed-off-by: Logan Gunthorpe <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Acked-by: Daniel Vetter <[email protected]> Acked-by: Sumit Semwal <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-03-13drm/omap: fix dmabuf mmap for dma_alloc'ed buffersTomi Valkeinen1-3/+0
omap_gem_dmabuf_mmap() returns an error (with a WARN) when called for a buffer which is allocated with dma_alloc_*(). This prevents dmabuf mmap from working on SoCs without DMM, e.g. AM4 and OMAP3. I could not find any reason for omap_gem_dmabuf_mmap() rejecting such buffers, and just removing the if() fixes the limitation. Signed-off-by: Tomi Valkeinen <[email protected]>
2016-03-24Merge tag 'topic/drm-misc-2016-03-22' of ↵Dave Airlie1-2/+3
git://anongit.freedesktop.org/drm-intel into drm-next Bunch of small fixupes all over. Plus a dma-buf patch that Sumit asked me to cherry-pick since that's the only one he had in his tree. There's a sparse issue outstanding in the color mgr stuff, but Lionel is still working on something that actually appeases sparse. * tag 'topic/drm-misc-2016-03-22' of git://anongit.freedesktop.org/drm-intel: dma-buf/fence: fix fence_is_later v2 dma-buf: Update docs for SYNC ioctl drm: remove excess description dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() drm/atmel-hlcdc: use helper to get crtc state drm/atomic: use helper to get crtc state
2016-03-19dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()Chris Wilson1-2/+3
Drivers, especially i915.ko, can fail during the initial migration of a dma-buf for CPU access. However, the error code from the driver was not being propagated back to ioctl and so userspace was blissfully ignorant of the failure. Rendering corruption ensues. Whilst fixing the ioctl to return the error code from dma_buf_start_cpu_access(), also do the same for dma_buf_end_cpu_access(). For most drivers, dma_buf_end_cpu_access() cannot fail. i915.ko however, as most drivers would, wants to avoid being uninterruptible (as would be required to guarrantee no failure when flushing the buffer to the device). As userspace already has to handle errors from the SYNC_IOCTL, take advantage of this to be able to restart the syscall across signals. This fixes a coherency issue for i915.ko as well as reducing the uninterruptible hold upon its BKL, the struct_mutex. Fixes commit c11e391da2a8fe973c3c2398452000bed505851e Author: Daniel Vetter <[email protected]> Date: Thu Feb 11 20:04:51 2016 -0200 dma-buf: Add ioctls to allow userspace to flush Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible Testcase: igt/prime_mmap_coherency/ioctl-errors Signed-off-by: Chris Wilson <[email protected]> Cc: Tiago Vignatti <[email protected]> Cc: Stéphane Marchesin <[email protected]> Cc: David Herrmann <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Daniel Vetter <[email protected]> CC: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-03-05Merge tag 'omapdrm-4.6' of ↵Dave Airlie1-10/+43
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next omapdrm changes for v4.6 * HDMI interlace output support * DMAbuf import support * Big refactoring leading to removal of legacy code * Various non-critical fixes * tag 'omapdrm-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (76 commits) drm/omap: no need to select OMAP2_DSS drm/omap: gem: Fix omap_gem_new() error path drm/omap: remove -Werror from Makefile drm/omap: remove dispc_ovl_check() drm/omap: remove dss compat code drm/omap: remove last uses of omap_overlay_manager drm/omap: DSI: remove uses of omap_overlay_manager drm/omap: VENC: remove uses of omap_overlay_manager drm/omap: SDI: remove uses of omap_overlay_manager drm/omap: HDMI4: remove uses of omap_overlay_manager drm/omap: HDMI5: remove uses of omap_overlay_manager drm/omap: DPI: remove uses of omap_overlay_manager drm/omap: remove extra manager checks on disconnect drm/omap: remove extra check in dpi and sdi drm/omap: convert dss_mgr_unregister_framedone_handler to accept omap_channel drm/omap: convert dss_mgr_register_framedone_handler to accept omap_channel drm/omap: convert dss_mgr_start_update to accept omap_channel drm/omap: convert dss_mgr_disable to accept omap_channel drm/omap: convert dss_mgr_enable to accept omap_channel drm/omap: convert dss_mgr_set_lcd_config to accept omap_channel ...
2016-03-03drm/omap: gem: Implement dma_buf importLaurent Pinchart1-10/+43
OMAP GEM objects backed by dma_buf reuse the current OMAP GEM object support as much as possible. If the imported buffer is physically contiguous its physical address will be used directly, reusing the OMAP_BO_MEM_DMA_API code paths. Otherwise it will be mapped through the TILER using a pages list created from the scatterlist instead of the shmem backing storage. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2016-02-09dma-buf: Remove range-based flushTiago Vignatti1-2/+2
This patch removes range-based information used for optimizations in begin_cpu_access and end_cpu_access. We don't have any user nor implementation using range-based flush. It seems a consensus that if we ever want something like that again (or even more robust using 2D, 3D sub-range regions) we can use the upcoming dma-buf sync ioctl for such. Cc: Sumit Semwal <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Tiago Vignatti <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-10-16drm/gem: Drop struct_mutex requirement from drm_gem_mmap_objDaniel Vetter1-3/+0
Since commit 131e663bd6f1055caaff128f9aa5071d227eeb72 Author: Daniel Vetter <[email protected]> Date: Thu Jul 9 23:32:33 2015 +0200 drm/gem: rip out drm vma accounting for gem mmaps there is no need for this any more. v2: Fixup compile noise spotted by 0-day build. Link: http://mid.gmane.org/[email protected] Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-06-12drm: omapdrm: Clean up #include'sLaurent Pinchart1-2/+2
Use the <...> include style instead of "..." for DRM headers and sort the headers alphabetically to ease detection of duplicates. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-04-21dma-buf: cleanup dma_buf_export() to make it easily extensibleSumit Semwal1-1/+8
At present, dma_buf_export() takes a series of parameters, which makes it difficult to add any new parameters for exporters, if required. Make it simpler by moving all these parameters into a struct, and pass the struct * as parameter to dma_buf_export(). While at it, unite dma_buf_export_named() with dma_buf_export(), and change all callers accordingly. Reviewed-by: Maarten Lankhorst <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Dave Airlie <[email protected]> Signed-off-by: Sumit Semwal <[email protected]>
2015-03-20drm: omapdrm: Fix indentation of structure and array initializersLaurent Pinchart1-10/+10
Indenting by one tab is enough. Signed-off-by: Laurent Pinchart <[email protected]>
2014-07-08dma-buf: use reservation objectsMaarten Lankhorst1-1/+1
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> #drivers/media/v4l2-core/ Acked-by: Thomas Hellstrom <[email protected]> #drivers/gpu/drm/ttm Acked-by: Sumit Semwal <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Vincent Stehlé <[email protected]> #drivers/gpu/drm/armada/ Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-06-28drm/gem: add mutex lock when using drm_gem_mmap_objYoungJun Cho1-0/+3
The drm_gem_mmap_obj() has to be protected with dev->struct_mutex, but some caller functions do not. So it adds mutex lock to missing callers and adds assertion to check whether drm_gem_mmap_obj() is called with mutex lock or not. Signed-off-by: YoungJun Cho <[email protected]> Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-06-08drm/omap: Use drm_gem_mmap_obj() to implement dma-buf mmapLaurent Pinchart1-29/+3
The dma-buf mmap code was copied from the GEM mmap implementation. Replace it with the new drm_gem_mmap_obj() function. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Clark <[email protected]>
2013-05-01drm: prime: fix refcounting on the dmabuf import error pathImre Deak1-1/+0
In commit be8a42ae60 we inroduced a refcount problem, where on the drm_gem_prime_fd_to_handle() error path we'll call dma_buf_put() for self imported dma buffers. Fix this by taking a reference on the dma buffer in the .gem_import hook instead of assuming the caller had taken one. Besides fixing the bug this is also more logical. Signed-off-by: Imre Deak <[email protected]> Cc: [email protected] Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-04-11drm/omap: add statics to a few structsTomi Valkeinen1-1/+1
Some static structs are not marked as static. Add it. Signed-off-by: Tomi Valkeinen <[email protected]>
2013-02-16drm/omap: move out of stagingRob Clark1-0/+225
Now that the omapdss interface has been reworked so that omapdrm can use dispc directly, we have been able to fix the remaining functional kms issues with omapdrm. And in the mean time the PM sequencing and many other of that open issues have been solved. So I think it makes sense to finally move omapdrm out of staging. Signed-off-by: Rob Clark <[email protected]>