aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2011-11-12 01:23:32 -0500
committerInki Dae <inki.dae@samsung.com>2011-11-15 00:58:46 -0500
commit2c871127e994a678b82104a4110eb7fcc87f05ad (patch)
tree76ec83f5dc4232b57202eb916009932ed1b471bc /drivers/gpu/drm/exynos/exynos_drm_fbdev.c
parentc7493668eeced636afabfed57dfead8329c3d7fa (diff)
drm/exynos: changed buffer structure.
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 <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fbdev.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 0effd77d569..836f4100818 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -33,6 +33,7 @@
33 33
34#include "exynos_drm_drv.h" 34#include "exynos_drm_drv.h"
35#include "exynos_drm_fb.h" 35#include "exynos_drm_fb.h"
36#include "exynos_drm_gem.h"
36#include "exynos_drm_buf.h" 37#include "exynos_drm_buf.h"
37 38
38#define MAX_CONNECTOR 4 39#define MAX_CONNECTOR 4
@@ -90,7 +91,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
90 struct fb_info *fbi = helper->fbdev; 91 struct fb_info *fbi = helper->fbdev;
91 struct drm_device *dev = helper->dev; 92 struct drm_device *dev = helper->dev;
92 struct exynos_drm_fbdev *exynos_fb = to_exynos_fbdev(helper); 93 struct exynos_drm_fbdev *exynos_fb = to_exynos_fbdev(helper);
93 struct exynos_drm_buf_entry *entry; 94 struct exynos_drm_gem_buf *buffer;
94 unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3); 95 unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3);
95 unsigned long offset; 96 unsigned long offset;
96 97
@@ -101,18 +102,18 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
101 drm_fb_helper_fill_fix(fbi, fb->pitch, fb->depth); 102 drm_fb_helper_fill_fix(fbi, fb->pitch, fb->depth);
102 drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); 103 drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height);
103 104
104 entry = exynos_drm_fb_get_buf(fb); 105 buffer = exynos_drm_fb_get_buf(fb);
105 if (!entry) { 106 if (!buffer) {
106 DRM_LOG_KMS("entry is null.\n"); 107 DRM_LOG_KMS("buffer is null.\n");
107 return -EFAULT; 108 return -EFAULT;
108 } 109 }
109 110
110 offset = fbi->var.xoffset * (fb->bits_per_pixel >> 3); 111 offset = fbi->var.xoffset * (fb->bits_per_pixel >> 3);
111 offset += fbi->var.yoffset * fb->pitch; 112 offset += fbi->var.yoffset * fb->pitch;
112 113
113 dev->mode_config.fb_base = entry->paddr; 114 dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
114 fbi->screen_base = entry->vaddr + offset; 115 fbi->screen_base = buffer->kvaddr + offset;
115 fbi->fix.smem_start = entry->paddr + offset; 116 fbi->fix.smem_start = (unsigned long)(buffer->dma_addr + offset);
116 fbi->screen_size = size; 117 fbi->screen_size = size;
117 fbi->fix.smem_len = size; 118 fbi->fix.smem_len = size;
118 119