aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2011-10-14 13:29:46 +0900
committerDave Airlie <airlied@redhat.com>2011-10-18 10:01:17 +0100
commit19c8b8343d9cb9674fa47103bf2a4abb43757e65 (patch)
tree5a8e495b34cc6f035f95971216ee03e90de21402 /drivers/gpu/drm/exynos/exynos_drm_fbdev.c
parentdrm/radeon: Move r100_*_*reg out of line (diff)
downloadlinux-dev-19c8b8343d9cb9674fa47103bf2a4abb43757e65.tar.xz
linux-dev-19c8b8343d9cb9674fa47103bf2a4abb43757e65.zip
drm/exynos: fixed overlay data updating.
this patch adds common members to overlay structure and makes each driver such as fimd or hdmi driver set them to its own structure. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fbdev.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ac43bfc9e1f0..61345154b6f5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -33,6 +33,7 @@
#include "exynos_drm_drv.h"
#include "exynos_drm_fb.h"
+#include "exynos_drm_buf.h"
#define MAX_CONNECTOR 4
#define PREFERRED_BPP 32
@@ -83,7 +84,7 @@ static struct fb_ops exynos_drm_fb_ops = {
.fb_setcmap = drm_fb_helper_setcmap,
};
-static void exynos_drm_fbdev_update(struct drm_fb_helper *helper,
+static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
struct drm_framebuffer *fb,
unsigned int fb_width,
unsigned int fb_height)
@@ -91,8 +92,9 @@ static void exynos_drm_fbdev_update(struct drm_fb_helper *helper,
struct fb_info *fbi = helper->fbdev;
struct drm_device *dev = helper->dev;
struct exynos_drm_fbdev *exynos_fb = to_exynos_fbdev(helper);
- struct exynos_drm_buffer_info buffer_info;
+ struct exynos_drm_buf_entry *entry;
unsigned int size = fb_width * fb_height * (fb->bits_per_pixel >> 3);
+ unsigned long offset;
DRM_DEBUG_KMS("%s\n", __FILE__);
@@ -101,15 +103,22 @@ static void exynos_drm_fbdev_update(struct drm_fb_helper *helper,
drm_fb_helper_fill_fix(fbi, fb->pitch, fb->depth);
drm_fb_helper_fill_var(fbi, helper, fb_width, fb_height);
- exynos_drm_fb_update_buf_off(fb, fbi->var.xoffset, fbi->var.yoffset,
- &buffer_info);
+ entry = exynos_drm_fb_get_buf(fb);
+ if (!entry) {
+ DRM_LOG_KMS("entry is null.\n");
+ return -EFAULT;
+ }
- dev->mode_config.fb_base = buffer_info.base_addr;
+ offset = fbi->var.xoffset * (fb->bits_per_pixel >> 3);
+ offset += fbi->var.yoffset * fb->pitch;
- fbi->screen_base = buffer_info.vaddr;
+ dev->mode_config.fb_base = entry->paddr;
+ fbi->screen_base = entry->vaddr + offset;
+ fbi->fix.smem_start = entry->paddr + offset;
fbi->screen_size = size;
- fbi->fix.smem_start = buffer_info.paddr;
fbi->fix.smem_len = size;
+
+ return 0;
}
static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
@@ -162,8 +171,10 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
goto out;
}
- exynos_drm_fbdev_update(helper, helper->fb, sizes->fb_width,
+ ret = exynos_drm_fbdev_update(helper, helper->fb, sizes->fb_width,
sizes->fb_height);
+ if (ret < 0)
+ fb_dealloc_cmap(&fbi->cmap);
/*
* if failed, all resources allocated above would be released by
@@ -224,10 +235,8 @@ static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
}
helper->fb = exynos_fbdev->fb;
- exynos_drm_fbdev_update(helper, helper->fb, sizes->fb_width,
+ return exynos_drm_fbdev_update(helper, helper->fb, sizes->fb_width,
sizes->fb_height);
-
- return 0;
}
static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,