diff options
author | Frederic Plourde <frederic.plourde@collabora.co.uk> | 2011-07-29 14:07:08 -0400 |
---|---|---|
committer | Sebastien Jan <s-jan@ti.com> | 2011-08-02 15:12:54 +0200 |
commit | 73d879953eb8b982a2a5d36213068c760b5de474 (patch) | |
tree | 068dacc4a6f5a922b7937fb8f2695657403cea8b /drivers | |
parent | 8a25c4f8509ab12e8c95bf15ca01f8e5dcae97f2 (diff) |
DRM port to 2.6.35 : initial patch from robClark
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/omap/omap_connector.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/omap/omap_crtc.c | 158 | ||||
-rw-r--r-- | drivers/gpu/drm/omap/omap_fb.c | 193 | ||||
-rw-r--r-- | drivers/gpu/drm/omap/omap_fbdev.c | 67 | ||||
-rw-r--r-- | drivers/gpu/drm/omap/omap_gpu.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/omap/omap_gpu_priv.h | 15 |
6 files changed, 175 insertions, 277 deletions
diff --git a/drivers/gpu/drm/omap/omap_connector.c b/drivers/gpu/drm/omap/omap_connector.c index 68f2dc72833b..fda6b7598514 100644 --- a/drivers/gpu/drm/omap/omap_connector.c +++ b/drivers/gpu/drm/omap/omap_connector.c @@ -107,7 +107,7 @@ enum drm_connector_status omap_connector_detect( ret = connector_status_disconnected; } - DBG("%s: %d", omap_connector->dssdev->name, ret); + VERB("%s: %d (force=%d)", omap_connector->dssdev->name, ret, force); return ret; } diff --git a/drivers/gpu/drm/omap/omap_crtc.c b/drivers/gpu/drm/omap/omap_crtc.c index 26485ebf3f89..b3380bbb0f73 100644 --- a/drivers/gpu/drm/omap/omap_crtc.c +++ b/drivers/gpu/drm/omap/omap_crtc.c @@ -30,9 +30,55 @@ struct omap_crtc { struct drm_crtc base; struct omap_overlay *ovl; struct omap_overlay_info info; + int id; }; -static int commit (struct drm_crtc *crtc); +/* push changes down to dss2 */ +static int commit(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + struct omap_overlay *ovl = omap_crtc->ovl; + struct omap_overlay_info *info = &omap_crtc->info; + int ret; + + DBG("%s", omap_crtc->ovl->name); + DBG("%dx%d -> %dx%d (%d)", info->width, info->height, info->out_width, + info->out_height, info->screen_width); + DBG("%d,%d %p %08x", info->pos_x, info->pos_y, info->vaddr, + info->paddr); + + /* NOTE: do we want to do this at all here, or just wait + * for dpms(ON) since other CRTC's may not have their mode + * set yet, so fb dimensions may still change.. + */ + ret = ovl->set_overlay_info(ovl, info); + if (ret) { + dev_err(dev->dev, "could not set overlay info\n"); + return ret; + } + + /* our encoder doesn't necessarily get a commit() after this, in + * particular in the dpms() and mode_set_base() cases, so force the + * manager to update: + * + * could this be in the encoder somehow? + */ + if (ovl->manager) { + ret = ovl->manager->apply(ovl->manager); + if (ret) { + dev_err(dev->dev, "could not apply\n"); + return ret; + } + } + + if (info->enabled) { + omap_framebuffer_flush(crtc->fb, crtc->x, crtc->y, + crtc->fb->width, crtc->fb->height); + } + + return 0; +} /* update parameters that are dependent on the framebuffer dimensions and * position within the fb that this crtc scans out from. This is called @@ -40,7 +86,7 @@ static int commit (struct drm_crtc *crtc); * to our mode, or a change in another crtc that is scanning out of the * same fb. */ -static void omap_crtc_update_scanout(struct drm_crtc *crtc) +static void update_scanout(struct drm_crtc *crtc) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); unsigned long paddr; @@ -81,7 +127,7 @@ static void omap_crtc_dpms(struct drm_crtc *crtc, int mode) DBG("%s: %d", omap_crtc->ovl->name, mode); if (mode == DRM_MODE_DPMS_ON) { - omap_crtc_update_scanout(crtc); + update_scanout(crtc); omap_crtc->info.enabled = true; } else { omap_crtc->info.enabled = false; @@ -149,81 +195,82 @@ static void omap_crtc_prepare (struct drm_crtc *crtc) omap_crtc_dpms (crtc, DRM_MODE_DPMS_OFF); } -static int commit (struct drm_crtc *crtc) +static void omap_crtc_commit(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct omap_overlay *ovl = omap_crtc->ovl; - struct omap_overlay_info *info = &omap_crtc->info; - int ret; - DBG("%s", omap_crtc->ovl->name); + omap_crtc_dpms(crtc, DRM_MODE_DPMS_ON); +} - DBG("%dx%d -> %dx%d (%d)", info->width, info->height, info->out_width, info->out_height, info->screen_width); - DBG("%d,%d %p %08x", info->pos_x, info->pos_y, info->vaddr, info->paddr); - - /* NOTE: do we want to do this at all here, or just wait - * for dpms(ON) since other CRTC's may not have their mode - * set yet, so fb dimensions may still change.. - */ - ret = ovl->set_overlay_info(ovl, info); - if (ret) { - dev_err(dev->dev, "could not set overlay info\n"); - return ret; - } - - /* our encoder doesn't necessarily get a commit() after this, in - * particular in the dpms() and mode_set_base() cases, so force the - * manager to update: - * - * could this be in the encoder somehow? - */ - if (ovl->manager) { - ret = ovl->manager->apply(ovl->manager); - if (ret) { - dev_err(dev->dev, "could not apply\n"); - return ret; - } - } - - if (info->enabled) { - omap_framebuffer_flush(crtc->fb, crtc->x, crtc->y, - crtc->fb->width, crtc->fb->height); - } - - return 0; +static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, + struct drm_framebuffer *old_fb) +{ + struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + DBG("%s %d,%d: fb=%p", omap_crtc->ovl->name, x, y, old_fb); + update_scanout(crtc); + return commit(crtc); } -static void omap_crtc_commit (struct drm_crtc *crtc) +static void omap_crtc_load_lut(struct drm_crtc *crtc) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); DBG("%s", omap_crtc->ovl->name); - omap_crtc_dpms (crtc, DRM_MODE_DPMS_ON); } -static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, - struct drm_framebuffer *old_fb) +static int omap_crtc_page_flip_locked(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event) { + struct drm_device *dev = crtc->dev; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + struct timeval now; + unsigned long flags; + int ret; - DBG("%s %d,%d: fb=%p", omap_crtc->ovl->name, x, y, old_fb); - - omap_crtc_update_scanout(crtc); + DBG("%d -> %d", crtc->fb ? crtc->fb->base.id : -1, fb->base.id); + + crtc->fb = fb; + + update_scanout(crtc); + ret = commit(crtc); + + /* wakeup userspace */ + // TODO: this should happen *after* flip.. somehow.. + if (event) { + spin_lock_irqsave(&dev->event_lock, flags); + event->event.sequence = + drm_vblank_count_and_time(dev, omap_crtc->id, &now); + event->event.tv_sec = now.tv_sec; + event->event.tv_usec = now.tv_usec; + list_add_tail(&event->base.link, + &event->base.file_priv->event_list); + wake_up_interruptible(&event->base.file_priv->event_wait); + spin_unlock_irqrestore(&dev->event_lock, flags); + } - return commit(crtc); + return ret; } -void omap_crtc_load_lut(struct drm_crtc *crtc) +int omap_crtc_page_flip(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event) { - struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - DBG("%s", omap_crtc->ovl->name); + struct drm_device *dev = crtc->dev; + int ret; + + mutex_lock(&dev->mode_config.mutex); + ret = omap_crtc_page_flip_locked(crtc, fb, event); + mutex_unlock(&dev->mode_config.mutex); + + return ret; } +EXPORT_SYMBOL(omap_crtc_page_flip); static const struct drm_crtc_funcs omap_crtc_funcs = { .gamma_set = omap_crtc_gamma_set, .set_config = drm_crtc_helper_set_config, .destroy = omap_crtc_destroy, -//TODO .page_flip = omap_page_flip, + .page_flip = omap_crtc_page_flip_locked, }; static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = { @@ -244,7 +291,7 @@ struct omap_overlay * omap_crtc_get_overlay(struct drm_crtc *crtc) /* initialize crtc */ struct drm_crtc * omap_crtc_init(struct drm_device *dev, - struct omap_overlay *ovl) + struct omap_overlay *ovl, int id) { struct drm_crtc *crtc = NULL; struct omap_crtc *omap_crtc = @@ -258,6 +305,7 @@ struct drm_crtc * omap_crtc_init(struct drm_device *dev, } omap_crtc->ovl = ovl; + omap_crtc->id = id; crtc = &omap_crtc->base; drm_crtc_init(dev, crtc, &omap_crtc_funcs); drm_crtc_helper_add(crtc, &omap_crtc_helper_funcs); diff --git a/drivers/gpu/drm/omap/omap_fb.c b/drivers/gpu/drm/omap/omap_fb.c index 363e5f6e4b9b..f91d5860297a 100644 --- a/drivers/gpu/drm/omap/omap_fb.c +++ b/drivers/gpu/drm/omap/omap_fb.c @@ -44,128 +44,6 @@ struct omap_framebuffer { void __iomem *vaddr; }; - -/* copied from omapfb-main.c to preserve vram param syntax */ -static int parse_vram_param(const char *param, int max_entries, - unsigned long *sizes, unsigned long *paddrs) -{ - int fbnum; - unsigned long size; - unsigned long paddr = 0; - char *p, *start; - - DBG("vram: %s", param); - - start = (char *)param; - - while (1) { - p = start; - - fbnum = simple_strtoul(p, &p, 10); - - if ((p == param) || (*p != ':') || (fbnum >= max_entries)) - return -EINVAL; - - size = memparse(p + 1, &p); - - if (!size) - return -EINVAL; - - paddr = 0; - - if (*p == '@') { - paddr = simple_strtoul(p + 1, &p, 16); - - if (!paddr) - return -EINVAL; - } - - paddrs[fbnum] = paddr; - sizes[fbnum] = size; - - if (*p == 0) - break; - - if (*p != ',') - return -EINVAL; - - ++p; - - start = p; - } - - return 0; -} - -#define MAX_FBS 10 - -static int allocate_vram(struct drm_framebuffer *fb, int idx, int size) -{ - struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); - struct drm_device *dev = fb->dev; - unsigned long sizes[MAX_FBS] = {0}; - unsigned long paddrs[MAX_FBS] = {0}; - unsigned long paddr = 0; - int ret = ret; - - if (idx >= MAX_FBS) { - dev_err(dev->dev, "invalid fb number: %d\n", idx); - ret = -EINVAL; - goto fail; - } - - if (def_vram) { - if (parse_vram_param(def_vram, MAX_FBS, sizes, paddrs)) { - dev_err(dev->dev, "failed to parse vram parameter\n"); - memset(&sizes, 0, sizeof(sizes)); - memset(&paddrs, 0, sizeof(paddrs)); - } else { - size = sizes[idx]; - paddr = paddrs[idx]; - } - } - - size = PAGE_ALIGN(size); - - if (paddr) { - DBG("reserving %d bytes at %lx for fb %d", size, paddr, idx); - ret = omap_vram_reserve(paddr, size); - } else { - DBG("allocating %d bytes for fb %d", size, idx); - ret = omap_vram_alloc(OMAP_VRAM_MEMTYPE_SDRAM, size, &paddr); - } - - if (ret) { - dev_err(dev->dev, "failed to allocate vram\n"); - goto fail; - } - - omap_fb->size = size; - omap_fb->paddr = paddr; - omap_fb->vaddr = ioremap_wc(paddr, size); - - if (!omap_fb->vaddr) { - dev_err(dev->dev, "failed to ioremap framebuffer\n"); - ret = -ENOMEM; - goto fail; - } - - //memset(vaddr, 0, size); - - return 0; - -fail: - if (omap_fb->paddr) { - omap_vram_free(paddr, size); - } - - omap_fb->size = 0; - omap_fb->vaddr = NULL; - omap_fb->paddr = 0; - - return ret; -} - static int omap_framebuffer_create_handle(struct drm_framebuffer *fb, struct drm_file *file_priv, unsigned int *handle) @@ -186,26 +64,27 @@ static int omap_framebuffer_create_handle(struct drm_framebuffer *fb, static void omap_framebuffer_destroy(struct drm_framebuffer *fb) { - /* omap_vram_free() doesn't really do what you'd think.. (or at - * least not if you think it'd return vram to the pool), so - * disabling this for now until there is a better way to alloc - * and free coherant.. - */ -#if 0 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); - struct omap_gpu_private *priv = fb->dev->dev_private; + DBG("destroy: FB ID: %d (%p)", fb->base.id, fb); + drm_framebuffer_cleanup(fb); + + if (omap_fb->vaddr) { + iounmap(omap_fb->vaddr); + } + /* drm framework should, but doesn't (as of 2.6.35) disconnect any * CRTCs connected to this fb before destroying it.. so could be * some small window when garbage is seen on screen. But in * practice, unlikely because we have a private vram pool. So I * won't worry too much about it. */ - omap_vram_free(omap_fb->paddr, omap_fb->size); - priv->fb = NULL; + if (omap_fb->paddr) { + omap_vram_free(omap_fb->paddr, omap_fb->size); + } + kfree(omap_fb); -#endif } static int omap_framebuffer_dirty(struct drm_framebuffer *fb, unsigned flags, @@ -242,6 +121,7 @@ int omap_framebuffer_get_buffer(struct drm_framebuffer *fb, int x, int y, return omap_fb->size; } +EXPORT_SYMBOL(omap_framebuffer_get_buffer); /* iterate thru all the connectors, returning ones that are attached * to the same fb.. @@ -308,10 +188,10 @@ struct drm_framebuffer * omap_framebuffer_create(struct drm_device *dev, struct drm_framebuffer * omap_framebuffer_init(struct drm_device *dev, struct drm_mode_fb_cmd *mode_cmd) { - struct omap_gpu_private *priv = dev->dev_private; - struct omap_framebuffer *omap_fb = NULL; - struct drm_framebuffer *fb; - int ret; + struct omap_framebuffer *omap_fb; + struct drm_framebuffer *fb = NULL; + unsigned long paddr; + int size, ret; /* in case someone tries to feed us a completely bogus stride: */ @@ -322,18 +202,6 @@ struct drm_framebuffer * omap_framebuffer_init(struct drm_device *dev, */ mode_cmd->pitch = ALIGN(mode_cmd->pitch, 8 * (mode_cmd->bpp / 8)); - /* for now, we can only support a single fb.. so we need to resize - * the old one instead of creating a new one of different size. If - * we can eventually get rid of the vram pool and had a better way - * to allocate contiguous memory after boot time, this restriction - * should be lifted. - */ - if (priv->fb) { - fb = priv->fb; - DBG("recycle: FB ID: %d (%p)", fb->base.id, fb); - goto recycle; /* ugg, we need CMA! */ - } - DBG("create framebuffer: dev=%p, mode_cmd=%p (%dx%d)", dev, mode_cmd, mode_cmd->width, mode_cmd->height); @@ -352,31 +220,34 @@ struct drm_framebuffer * omap_framebuffer_init(struct drm_device *dev, DBG("create: FB ID: %d (%p)", fb->base.id, fb); - ret = allocate_vram(fb, dev->primary->index, - mode_cmd->pitch * mode_cmd->height); + size = PAGE_ALIGN(mode_cmd->pitch * mode_cmd->height); + + DBG("allocating %d bytes for fb %d", size, dev->primary->index); + ret = omap_vram_alloc(OMAP_VRAM_MEMTYPE_SDRAM, size, &paddr); if (ret) { - dev_err(dev->dev, "failed to allocate framebuffer\n"); + dev_err(dev->dev, "failed to allocate vram\n"); goto fail; } recycle: - drm_helper_mode_fill_fb_struct(fb, mode_cmd); - - priv->fb = fb; + omap_fb->size = size; + omap_fb->paddr = paddr; + omap_fb->vaddr = ioremap_wc(paddr, size); - if (priv->fbdev) { - /* if fbdev is already created, we need to update it to - * be attached to the new fb - */ - omap_fbdev_update(priv->fbdev, fb); + if (!omap_fb->vaddr) { + dev_err(dev->dev, "failed to ioremap framebuffer\n"); + goto fail; } + drm_helper_mode_fill_fb_struct(fb, mode_cmd); + return fb; fail: - if (omap_fb) { - kfree(omap_fb); + if (fb) { + omap_framebuffer_destroy(fb); } return NULL; } +EXPORT_SYMBOL(omap_framebuffer_init); diff --git a/drivers/gpu/drm/omap/omap_fbdev.c b/drivers/gpu/drm/omap/omap_fbdev.c index 607320ef2bea..a603671a7933 100644 --- a/drivers/gpu/drm/omap/omap_fbdev.c +++ b/drivers/gpu/drm/omap/omap_fbdev.c @@ -34,6 +34,8 @@ struct omap_fbdev { struct drm_framebuffer *fb; }; +static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h); + static ssize_t omap_fbdev_write(struct fb_info *fbi, const char __user *buf, size_t count, loff_t *ppos) { @@ -83,6 +85,9 @@ static struct fb_ops omap_fb_ops = { .fb_pan_display = drm_fb_helper_pan_display, .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, + + .fb_debug_enter = drm_fb_helper_debug_enter, + .fb_debug_leave = drm_fb_helper_debug_leave, }; static void omap_fbdev_deferred_io(struct fb_info *fbi, @@ -115,8 +120,12 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, { struct omap_fbdev *fbdev = to_omap_fbdev(helper); struct drm_device *dev = helper->dev; + struct drm_framebuffer *fb; struct fb_info *fbi; struct drm_mode_fb_cmd mode_cmd = {0}; + unsigned long paddr; + void __iomem *vaddr; + int size, screen_width; struct device *device = &dev->platformdev->dev; int ret; @@ -153,7 +162,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, goto fail; } - helper->fb = fbdev->fb; + fb = fbdev->fb; + helper->fb = fb; helper->fbdev = fbi; fbi->par = helper; @@ -176,7 +186,18 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, goto fail; } - omap_fbdev_update(helper, fbdev->fb); + drm_fb_helper_fill_fix(fbi, fb->pitch, fb->depth); + drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); + + size = omap_framebuffer_get_buffer(fb, 0, 0, + &vaddr, &paddr, &screen_width); + + dev->mode_config.fb_base = paddr; + + fbi->screen_base = vaddr; + fbi->screen_size = size; + fbi->fix.smem_start = paddr; + fbi->fix.smem_len = size; DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres); DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height); @@ -235,50 +256,10 @@ static struct drm_fb_helper * get_fb(struct fb_info *fbi) return fbi->par; } -void omap_fbdev_update(struct drm_fb_helper *helper, - struct drm_framebuffer *fb) -{ - struct fb_info *fbi = helper->fbdev; - struct drm_device *dev = helper->dev; - struct omap_fbdev *fbdev = to_omap_fbdev(helper); - unsigned long paddr; - void __iomem *vaddr; - int size, screen_width; - - DBG("update fbdev: %dx%d, fbi=%p", fb->width, fb->height, fbi); - - fbdev->fb = fb; - - drm_fb_helper_fill_fix(fbi, fb->pitch, fb->depth); - drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); - - size = omap_framebuffer_get_buffer(fbdev->fb, 0, 0, - &vaddr, &paddr, &screen_width); - - dev->mode_config.fb_base = paddr; - - fbi->screen_base = vaddr; - fbi->screen_size = size; - fbi->fix.smem_start = paddr; - fbi->fix.smem_len = size; -} - -struct drm_connector * omap_fbdev_get_next_connector(struct fb_info *fbi, - struct drm_connector *from) -{ - struct drm_fb_helper *helper = get_fb(fbi); - - if (!helper) - return NULL; - - return omap_framebuffer_get_next_connector(helper->fb, from); -} -EXPORT_SYMBOL(omap_fbdev_get_next_connector); - /* flush an area of the framebuffer (in case of manual update display that * is not automatically flushed) */ -void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h) +static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h) { struct drm_fb_helper *helper = get_fb(fbi); diff --git a/drivers/gpu/drm/omap/omap_gpu.c b/drivers/gpu/drm/omap/omap_gpu.c index 1681cc5ff39a..f69c2cb74303 100644 --- a/drivers/gpu/drm/omap/omap_gpu.c +++ b/drivers/gpu/drm/omap/omap_gpu.c @@ -239,7 +239,7 @@ static int omap_modeset_init(struct drm_device *dev) ovl->set_manager(ovl, mgr); } - crtc = omap_crtc_init(dev, ovl); + crtc = omap_crtc_init(dev, ovl, priv->num_crtcs); if (!crtc) { dev_err(dev->dev, "could not create CRTC\n"); @@ -395,6 +395,13 @@ static int dev_load(struct drm_device *dev, unsigned long flags) //return ret; } + drm_kms_helper_poll_init(dev); + + ret = drm_vblank_init(dev, priv->num_crtcs); + if (ret) { + dev_err(dev->dev, "could not init vblank\n"); + } + loaded = true; list_for_each_entry(plugin, &plugin_list, list) { @@ -415,6 +422,8 @@ static int dev_unload(struct drm_device *dev) ret = plugin->unload(dev); } + drm_vblank_cleanup(dev); + loaded = false; return 0; @@ -718,12 +727,12 @@ int omap_gpu_unregister_plugin(struct omap_gpu_plugin *plugin) } EXPORT_SYMBOL(omap_gpu_unregister_plugin); -struct fb_info * omap_gpu_get_fbdev(struct drm_device *dev) +struct drm_framebuffer * omap_gpu_get_default_fb(struct drm_device *dev) { struct omap_gpu_private *priv = dev->dev_private; - return priv->fbdev->fbdev; + return priv->fbdev->fb; } -EXPORT_SYMBOL(omap_gpu_get_fbdev); +EXPORT_SYMBOL(omap_gpu_get_default_fb); static int __init omap_gpu_init(void) { diff --git a/drivers/gpu/drm/omap/omap_gpu_priv.h b/drivers/gpu/drm/omap/omap_gpu_priv.h index 1a3eaeb5c040..ceb103ef8286 100644 --- a/drivers/gpu/drm/omap/omap_gpu_priv.h +++ b/drivers/gpu/drm/omap/omap_gpu_priv.h @@ -24,6 +24,7 @@ #include <linux/module.h> #define DBG(fmt,...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) +#define VERB(fmt,...) do { if (0) DBG(fmt, ##__VA_ARGS__); } while (0) #define MODULE_NAME "omap_gpu" @@ -36,20 +37,12 @@ struct omap_gpu_private { struct drm_connector *connectors[8]; struct drm_fb_helper *fbdev; - - /* for now, we statically create a single framebuffer per device, since - * there is not yet any good way to dynamically allocate/free contiguous - * memory.. - */ - struct drm_framebuffer *fb; }; struct drm_fb_helper * omap_fbdev_init(struct drm_device *dev); -void omap_fbdev_update(struct drm_fb_helper *helper, - struct drm_framebuffer *fb); struct drm_crtc * omap_crtc_init(struct drm_device *dev, - struct omap_overlay *ovl); + struct omap_overlay *ovl, int id); struct omap_overlay * omap_crtc_get_overlay(struct drm_crtc *crtc); struct drm_encoder * omap_encoder_init(struct drm_device *dev, @@ -69,11 +62,7 @@ void omap_connector_flush(struct drm_connector *connector, int x, int y, int w, int h); void omap_connector_dpms(struct drm_connector *connector, int mode); -struct drm_framebuffer * omap_framebuffer_init(struct drm_device *dev, - struct drm_mode_fb_cmd *mode_cmd); struct drm_framebuffer * omap_framebuffer_create(struct drm_device *dev, struct drm_file *file, struct drm_mode_fb_cmd *mode_cmd); -int omap_framebuffer_get_buffer(struct drm_framebuffer *fb, int x, int y, - void **vaddr, unsigned long *paddr, int *screen_width); #endif /* __OMAP_GPU_PRIV_H__ */ |