aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_gem.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-02UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/David Howells1-1/+1
Convert #include "..." to #include <path/...> in drivers/gpu/. Signed-off-by: David Howells <[email protected]> Acked-by: Dave Airlie <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Dave Jones <[email protected]>
2012-10-02UAPI: (Scripted) Remove redundant DRM UAPI header #inclusions from drivers/gpu/.David Howells1-1/+0
Remove redundant DRM UAPI header #inclusions from drivers/gpu/. Remove redundant #inclusions of core DRM UAPI headers (drm.h, drm_mode.h and drm_sarea.h). They are now #included via drmP.h and drm_crtc.h via a preceding patch. Without this patch and the patch to make include the UAPI headers from the core headers, after the UAPI split, the DRM C sources cannot find these UAPI headers because the DRM code relies on specific -I flags to make #include "..." work on headers in include/drm/ - but that does not work after the UAPI split without adding more -I flags. Signed-off-by: David Howells <[email protected]> Acked-by: Dave Airlie <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Dave Jones <[email protected]>
2012-09-13drm/exynos: fixed page align bug.Inki Dae1-1/+1
do not align in page unit at dumb creation. the align is done by exynos_drm_gem_create() to be called commonly. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-09-13drm/exynos: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(.. [1]Thomas Meyer1-1/+1
The semantic patch that makes this change is available in scripts/coccinelle/api/err_cast.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-07-27drm/exynos: fixed exception to page allocation failureInki Dae1-1/+1
this patch corrects to deallocate the pages allocated already at alloc_page failure. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-07-27drm/exynos: use __free_page() to deallocate memoryInki Dae1-15/+6
this patch uses __free_page() to deallocate the pages allocated by alloc_page() and the pages doesn't need set_parge_dirty() and mark_page_accessed() because they aren't from page cache so removes them. this patch has a pair with previous patch below, http://www.spinics.net/lists/dri-devel/msg24382.html Changelog v2: remove unnecessary arguments. Changelog v3: fix npages type. - npages can have negative value. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-07-27drm/exynos: do not release memory region from exporter.Inki Dae1-0/+10
the region should be released by exporter once dmabuf's refcount becomes 0. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-07-27drm/exynos: use alloc_page() to allocate pages.Inki Dae1-11/+3
shmem_read_mapping_page_gfp() first tries to allocate pages from page cache so if pages are allocated from page cache then these pages could have valid cache line. after that cpu may read garbage data from cache once gpu operation is completed with allocated pages. so with this patch, Non-contiguous memory allocation request allocates pages from highmem through alloc_page() with GFP_HIGHUSER_MOVABLE. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-07-27drm/exynos: fix buffer pitch calculationCooper Yuan1-1/+1
Signed-off-by: Cooper Yuan <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-06-05drm/exynos: Don't cast GEM object to Exynos GEM object when not neededLaurent Pinchart1-6/+3
The exynos_drm_gem_dumb_map_offset() doesn't need to access any Exynos-specific GEM object fields, don't cast the GEM object. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-05-08drm/exynos: added a feature to get gem buffer information.Inki Dae1-0/+26
this patch adds a feature to get a gem buffer information and user application can get the gem buffer information simply in runtime through gem handle. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-05-08drm/exynos: added drm prime feature.Inki Dae1-2/+12
this patch adds exynos specific codes for DRM Prime feature. with this patch, user application can get file descriptor from gem handle through DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl command(export) and also gem handle from file descriptor through DRM_IOCTL_PRIME_FD_TO_HANLDE(import) ioctl command. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-05-08drm/exynos: added cache attribute support for gem.Inki Dae1-10/+39
with this patch, user application can set cache attribute(such as cachable, writecombime or non-cachable) of the memory region allocated by gem framework. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-04-27Merge branch 'exynos-drm-fixes' of ↵Dave Airlie1-25/+5
git://git.infradead.org/users/kmpark/linux-2.6-samsung into drm-fixes From Inki Dae: this patch set fixes gem allocation and mapping issue between user space and physical memory region. * 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-2.6-samsung: drm/exynos: added missed vm area region mapping type. drm/exynos: fixed exynos_drm_gem_map_pages bug. drm/exynos: fixed duplicatd memory allocation bug.
2012-04-23drm/exynos: added missed vm area region mapping type.Inki Dae1-0/+2
with this patch, if the memory region is physically non-continuous then VM_MIXEDMAP is set to vm->vm_flags otherwise VM_PFNMAP. we had missed this flag setting. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-04-23drm/exynos: fixed exynos_drm_gem_map_pages bug.Inki Dae1-13/+3
this patch fixes the problem that the physical memory region to be mapped to user space could be exceeded. if page fault address was placed at between buffer start and end then memory region to be mapped would be exceeded. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-04-23drm/exynos: fixed duplicatd memory allocation bug.Inki Dae1-12/+0
the gem was already allocated at gem allocation time but is allocated at page fault handler so this patch fixes the problem that gem was allocated one more time. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-04-20VM: add "vm_mmap()" helper functionLinus Torvalds1-3/+1
This continues the theme started with vm_brk() and vm_munmap(): vm_mmap() does the same thing as do_mmap(), but additionally does the required VM locking. This uninlines (and rewrites it to be clearer) do_mmap(), which sadly duplicates it in mm/mmap.c and mm/nommu.c. But that way we don't have to export our internal do_mmap_pgoff() function. Some day we hopefully don't have to export do_mmap() either, if all modular users can become the simpler vm_mmap() instead. We're actually very close to that already, with the notable exception of the (broken) use in i810, and a couple of stragglers in binfmt_elf. Signed-off-by: Linus Torvalds <[email protected]>
2012-04-03drm/exynos: fixed page align and code clean.Inki Dae1-9/+36
1M section, 64k page count also should be rounded up so this patch rounds up them and caculates page count of them properly and also checks memory flags from user. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2012-03-20drm/exynos: remove module of exynos drm subdrvJoonyoung Shim1-4/+0
The exynos drm driver has several subdrv. They each can be module but it causes unfixed probe order of exynodr drm driver and each subdrv. It also needs some weird codes such as exynos_drm_fbdev_reinit and exynos_drm_mode_group_reinit. This patch can remove weird codes and clear codes through we doesn't modularity each subdrv. Also this removes unnecessary codes related module. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-03-20drm/exynos: added new funtion to get/put dma address.Inki Dae1-0/+58
this function would be used for drm based 2d acceleration driver to get/put dma address through gem handle. when exynos_drm_get_dma_address is called reference count of gem object would be increased not to be released by gem close and when exynos_drm_put_dma_address is called the reference count of this gem object would be decreased to be released. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-03-20drm/exynos: update gem and buffer framework.Inki Dae1-29/+272
with this patch, we can allocate physically continuous or non-continuous memory and also it creates scatterlist for iommu support so allocated memory region can be mapped to iommu page table using scatterlist. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-03-05drm: drop setting vm_file to filpDave Airlie1-1/+0
Talking to Al Viro on irc, we can see no possible reason for doing this, the upper mmap code does it. The code has been there since first import into drm tree I can find. Al tracked down this as a requirement pre 2.3.51 hasn't been needed since. Acked-by: Al Viro <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2011-12-29drm/exynos: Split creation of gem object and gem handleJoonyoung Shim1-54/+76
exynos_drm_gem_create function created gem object with gem handle but it can be called externally without gem handle creation through this patch. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-12-29drm/exynos: Fix a fake mmap offset creationJoonyoung Shim1-24/+14
Make a fake mmap offset only when it needs. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-12-29drm/exynos: gem code cleanupJoonyoung Shim1-57/+56
This cleans codes of exynos gem - indents and order function and so on. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-11-17drm/exynos: fixed wrong err ptr usage and destroy call in execeptionSeung-Woo Kim1-10/+5
- exynos_drm_buf_create() returns err pointer so NULL check is wrong. - Case that exynos_gem_obj is not created, destroy call in exception handle lable uses this pointer. so instead buffer is directly used. Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2011-11-15drm/exynos: changed buffer structure.Inki Dae1-12/+13
the purpose of this patch is to consider IOMMU support in the future. EXYNOS4 SoC supports IOMMU also so the address for DMA could be physical address with IOMMU or device address with IOMMU. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-11-15drm/exynos: use gem create function genericallyInki Dae1-30/+49
this patch addes exynos_drm_gem_init() creating and initialzing a gem. allocation functions could use this function to create new gem and it changes size type of exynos_drm_gem_create structure to 64bit and also corrects comments to exynos_drm_gem_create structure. Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Kyungmin Park <[email protected]>
2011-10-05DRM: add DRM Driver for Samsung SoC EXYNOS4210.Inki Dae1-0/+415
This patch is a DRM Driver for Samsung SoC Exynos4210 and now enables only FIMD yet but we will add HDMI support also in the future. this patch is based on git repository below: git://people.freedesktop.org/~airlied/linux.git branch name: drm-next commit-id: 88ef4e3f4f616462b78a7838eb3ffc3818d30f67 you can refer to our working repository below: http://git.infradead.org/users/kmpark/linux-2.6-samsung branch name: samsung-drm We tried to re-use lowlevel codes of the FIMD driver(s3c-fb.c based on Linux framebuffer) but couldn't so because lowlevel codes of s3c-fb.c are included internally and so FIMD module of this driver has its own lowlevel codes. We used GEM framework for buffer management and DMA APIs(dma_alloc_*) for buffer allocation so we can allocate physically continuous memory for DMA through it and also we could use CMA later if CMA is applied to mainline. Refer to this link for CMA(Continuous Memory Allocator): http://lkml.org/lkml/2011/7/20/45 this driver supports only physically continuous memory(non-iommu). Links to previous versions of the patchset: v1: < https://lwn.net/Articles/454380/ > v2: < http://www.spinics.net/lists/kernel/msg1224275.html > v3: < http://www.spinics.net/lists/dri-devel/msg13755.html > v4: < http://permalink.gmane.org/gmane.comp.video.dri.devel/60439 > v5: < http://comments.gmane.org/gmane.comp.video.dri.devel/60802 > Changelog v2: DRM: add DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl command. this feature maps user address space to physical memory region once user application requests DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl. DRM: code clean and add exception codes. Changelog v3: DRM: Support multiple irq. FIMD and HDMI have their own irq handler but DRM Framework can regiter only one irq handler this patch supports mutiple irq for Samsung SoC. DRM: Consider modularization. each DRM, FIMD could be built as a module. DRM: Have indenpendent crtc object. crtc isn't specific to SoC Platform so this patch gets a crtc to be used as common object. created crtc could be attached to any encoder object. DRM: code clean and add exception codes. Changelog v4: DRM: remove is_defult from samsung_fb. is_default isn't used for default framebuffer. DRM: code refactoring to fimd module. this patch is be considered with multiple display objects and would use its own request_irq() to register a irq handler instead of drm framework's one. DRM: remove find_samsung_drm_gem_object() DRM: move kernel private data structures and definitions to driver folder. samsung_drm.h would contain only public information for userspace ioctl interface. DRM: code refactoring to gem modules. buffer module isn't dependent of gem module anymore. DRM: fixed security issue. DRM: remove encoder porinter from specific connector. samsung connector doesn't need to have generic encoder. DRM: code clean and add exception codes. Changelog v5: DRM: updated fimd(display controller) driver. added various pixel formats, color key and pixel blending features. DRM: removed end_buf_off from samsung_drm_overlay structure. this variable isn't used and end buffer address would be calculated by each sub driver. DRM: use generic function for mmap_offset. replaced samsung_drm_gem_create_mmap_offset() and samsung_drm_free_mmap_offset() with generic ones applied to mainline recentrly. DRM: removed unnecessary codes and added exception codes. DRM: added comments and code clean. Changelog v6: DRM: added default config options. DRM: added padding for 64-bit align. DRM: changed prefix 'samsung' to 'exynos' Signed-off-by: Inki Dae <[email protected]> Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Rob Clark <[email protected]> Signed-off-by: Dave Airlie <[email protected]>