summaryrefslogtreecommitdiff
path: root/drivers/staging/omapdrm/omap_drv.h
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-12-06 01:19:22 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-08 23:04:21 (GMT)
commitf7f9f4536a09f9f73c800663df2e600c9405e1ef (patch)
tree690d369e969039a54fec3a813d60b7acf5ea8207 /drivers/staging/omapdrm/omap_drv.h
parent71e8831f6407542afd1d8888d3cca13e677034ef (diff)
downloadlinux-fsl-qoriq-f7f9f4536a09f9f73c800663df2e600c9405e1ef.tar.xz
drm/omap: add GEM support for tiled/dmm buffers
TILER/DMM provides two features for omapdrm GEM objects: 1) providing a physically contiguous view to discontiguous memory for hw initiators that cannot otherwise support discontiguous buffers (DSS scanout, IVAHD video decode/encode, etc) 2) providing untiling for 2d tiled buffers, which are used in some cases to provide rotation and reduce memory bandwidth for hw initiators that tend to access data in 2d block patterns. For 2d tiled buffers, there are some additional complications when it comes to userspace mmap'ings. For non-tiled buffers, the original (potentially physically discontiguous) pages are used to back the mmap. For tiled buffers, we need to mmap via the tiler/dmm region to provide an unswizzled view of the buffer. But (a) the buffer is not necessarily pinned in TILER all the time (it can be unmapped when there is no DMA access to the buffer), and (b) when they are they are pinned, they not necessarily page aligned from the perspective of the CPU. And non-page aligned userspace buffer mapping is evil. To solve this, we reserve one or more small regions in each of the 2d containers when the driver is loaded to use as a "user-GART" where we can create a second page-aligned mapping of parts of the buffer being accessed from userspace. Page faulting is used to evict and remap different regions of whichever buffers are being accessed from user- space. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/omapdrm/omap_drv.h')
-rw-r--r--drivers/staging/omapdrm/omap_drv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index c8f2752..9d0783d 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -84,6 +84,8 @@ struct drm_connector *omap_framebuffer_get_next_connector(
void omap_framebuffer_flush(struct drm_framebuffer *fb,
int x, int y, int w, int h);
+void omap_gem_init(struct drm_device *dev);
+void omap_gem_deinit(struct drm_device *dev);
struct drm_gem_object *omap_gem_new(struct drm_device *dev,
union omap_gem_size gsize, uint32_t flags);
@@ -109,6 +111,7 @@ int omap_gem_get_paddr(struct drm_gem_object *obj,
dma_addr_t *paddr, bool remap);
int omap_gem_put_paddr(struct drm_gem_object *obj);
uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj);
+size_t omap_gem_mmap_size(struct drm_gem_object *obj);
static inline int align_pitch(int pitch, int width, int bpp)
{