summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_buf.c
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2012-04-23 21:01:28 +0900
committerInki Dae <inki.dae@samsung.com>2012-05-08 18:46:32 +0900
commitb2df26c10b16afe2eed904f2b85a4d2047531d30 (patch)
tree7defbfd77192157460c0d212a308d83d4358274c /drivers/gpu/drm/exynos/exynos_drm_buf.c
parentc01d73faad2f775036f0b37c753254479b79cbe6 (diff)
downloadblackbird-obmc-linux-b2df26c10b16afe2eed904f2b85a4d2047531d30.tar.gz
blackbird-obmc-linux-b2df26c10b16afe2eed904f2b85a4d2047531d30.zip
drm/exynos: added drm prime feature.
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 <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_buf.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_buf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c b/drivers/gpu/drm/exynos/exynos_drm_buf.c
index de8d2090bce3..b3cb0a69fbf2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_buf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c
@@ -35,7 +35,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
unsigned int flags, struct exynos_drm_gem_buf *buf)
{
dma_addr_t start_addr;
- unsigned int npages, page_size, i = 0;
+ unsigned int npages, i = 0;
struct scatterlist *sgl;
int ret = 0;
@@ -53,13 +53,13 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
if (buf->size >= SZ_1M) {
npages = buf->size >> SECTION_SHIFT;
- page_size = SECTION_SIZE;
+ buf->page_size = SECTION_SIZE;
} else if (buf->size >= SZ_64K) {
npages = buf->size >> 16;
- page_size = SZ_64K;
+ buf->page_size = SZ_64K;
} else {
npages = buf->size >> PAGE_SHIFT;
- page_size = PAGE_SIZE;
+ buf->page_size = PAGE_SIZE;
}
buf->sgt = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
@@ -96,9 +96,9 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
while (i < npages) {
buf->pages[i] = phys_to_page(start_addr);
- sg_set_page(sgl, buf->pages[i], page_size, 0);
+ sg_set_page(sgl, buf->pages[i], buf->page_size, 0);
sg_dma_address(sgl) = start_addr;
- start_addr += page_size;
+ start_addr += buf->page_size;
sgl = sg_next(sgl);
i++;
}
OpenPOWER on IntegriCloud