staticstruct drm_fb_helper *get_fb(struct fb_info *fbi)
{ if (!fbi || strcmp(fbi->fix.id, MODULE_NAME)) { /* these are not the fb's you're looking for */ return NULL;
} return fbi->par;
}
fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled; if (fbdev->ywrap_enabled) { /* need to align pitch to page size if using DMM scrolling */
mode_cmd.pitches[0] = PAGE_ALIGN(mode_cmd.pitches[0]);
}
/* allocate backing bo */
gsize = (union omap_gem_size){
.bytes = PAGE_ALIGN(mode_cmd.pitches[0] * mode_cmd.height),
};
DBG("allocating %d bytes for fb %d", gsize.bytes, dev->primary->index);
bo = omap_gem_new(dev, gsize, OMAP_BO_SCANOUT | OMAP_BO_WC); if (!bo) {
dev_err(dev->dev, "failed to allocate buffer object\n");
ret = -ENOMEM; goto fail;
}
fb = omap_framebuffer_init(dev,
drm_get_format_info(dev, mode_cmd.pixel_format,
mode_cmd.modifier[0]),
&mode_cmd, &bo); if (IS_ERR(fb)) {
dev_err(dev->dev, "failed to allocate fb\n"); /* note: if fb creation failed, we can't rely on fb destroy *tounrefthebo:
*/
drm_gem_object_put(bo);
ret = PTR_ERR(fb); goto fail;
}
/* note: this keeps the bo pinned.. which is perhaps not ideal, *butisneededaslongasweusefb_mmap()tommaptouserspace *(sincethishappensusingfix.smem_start).Possiblywecould *implementourownmmapusingGEMmmapsupporttoavoidthis *(non-tiledbufferdoesn'tneedtobepinnedforfbcontowrite *toit).Thenwejustneedtobesurethatweareabletore- *pinitincaseofanopps.
*/
ret = omap_gem_pin(bo, &dma_addr); if (ret) {
dev_err(dev->dev, "could not pin framebuffer\n");
ret = -ENOMEM; goto fail;
}
fbi = drm_fb_helper_alloc_info(helper); if (IS_ERR(fbi)) {
dev_err(dev->dev, "failed to allocate fb info\n");
ret = PTR_ERR(fbi); goto fail;
}
fbi->fbdefio = &helper->fbdefio;
ret = fb_deferred_io_init(fbi); if (ret) goto fail;
/* if we have DMM, then we can use it for scrolling by just *shufflingpagesaroundinDMMratherthandoingswblit.
*/ if (fbdev->ywrap_enabled) {
DRM_INFO("Enabling DMM ywrap scrolling\n");
fbi->flags |= FBINFO_HWACCEL_YWRAP | FBINFO_READS_FAST;
fbi->fix.ywrapstep = 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.