Lines Matching full:fb
279 int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
284 refcount_init(&fb->refcount, 1);
286 ret = drm_mode_object_get(dev, &fb->base, DRM_MODE_OBJECT_FB);
290 fb->dev = dev;
291 fb->funcs = funcs;
293 list_add(&fb->head, &dev->mode_config.fb_list);
299 static void drm_framebuffer_free(struct drm_framebuffer *fb)
301 fb->funcs->destroy(fb);
310 void drm_framebuffer_unreference(struct drm_framebuffer *fb)
312 struct drm_device *dev = fb->dev;
313 DRM_DEBUG("FB ID: %d\n", fb->base.id);
316 if (refcount_release(&fb->refcount))
317 drm_framebuffer_free(fb);
322 * drm_framebuffer_reference - incr the fb refcnt
324 void drm_framebuffer_reference(struct drm_framebuffer *fb)
326 DRM_DEBUG("FB ID: %d\n", fb->base.id);
327 refcount_acquire(&fb->refcount);
333 * @fb: framebuffer to remove
338 * Scans all the CRTCs in @dev's mode_config. If they're using @fb, removes
341 void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
343 struct drm_device *dev = fb->dev;
346 * debugging is nice to keep around the list of fb's that are
351 drm_mode_object_put(dev, &fb->base);
352 list_del(&fb->head);
359 * @fb: framebuffer to remove
365 * using @fb, removes it, setting it to NULL.
367 void drm_framebuffer_remove(struct drm_framebuffer *fb)
369 struct drm_device *dev = fb->dev;
377 if (crtc->fb == fb) {
381 set.fb = NULL;
384 DRM_ERROR("failed to reset crtc %p when fb was deleted\n", crtc);
389 if (plane->fb == fb) {
393 DRM_ERROR("failed to disable plane with busy fb\n");
394 /* disconnect the plane from the fb and crtc: */
395 plane->fb = NULL;
400 list_del(&fb->filp_head);
402 drm_framebuffer_unreference(fb);
1058 struct drm_framebuffer *fb, *fbt;
1083 list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
1084 drm_framebuffer_remove(fb);
1202 struct drm_framebuffer *fb;
1258 list_for_each_entry(fb, &file_priv->fbs, filp_head) {
1259 if (put_user(fb->base.id, fb_id + copied)) {
1408 if (crtc->fb)
1409 crtc_resp->fb_id = crtc->fb->base.id;
1664 * current fb, etc.
1692 if (plane->fb)
1693 plane_resp->fb_id = plane->fb->base.id;
1731 * Set plane info, including placement, fb, scaling, and other factors.
1732 * Or pass a NULL fb to disable.
1741 struct drm_framebuffer *fb;
1752 * First, find the plane, crtc, and fb objects. If not available,
1765 /* No fb means shut it down */
1769 plane->fb = NULL;
1791 fb = obj_to_fb(obj);
1793 /* Check whether this plane supports the fb pixel format. */
1795 if (fb->pixel_format == plane->format_types[i])
1798 DRM_DEBUG_KMS("Invalid pixel format 0x%08x\n", fb->pixel_format);
1803 fb_width = fb->width << 16;
1804 fb_height = fb->height << 16;
1806 /* Make sure source coordinates are inside the fb. */
1837 ret = plane->funcs->update_plane(plane, crtc, fb,
1844 plane->fb = fb;
1878 struct drm_framebuffer *fb = NULL;
1906 /* If we pass -1, set the mode with the currently bound fb */
1908 if (!crtc->fb) {
1909 DRM_DEBUG_KMS("CRTC doesn't have current FB\n");
1913 fb = crtc->fb;
1918 DRM_DEBUG_KMS("Unknown FB ID%d\n",
1923 fb = obj_to_fb(obj);
1950 if (hdisplay > fb->width ||
1951 vdisplay > fb->height ||
1952 crtc_req->x > fb->width - hdisplay ||
1953 crtc_req->y > fb->height - vdisplay) {
1954 DRM_DEBUG_KMS("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n",
1955 fb->width, fb->height,
1969 if (crtc_req->count_connectors > 0 && (!mode || !fb)) {
1970 DRM_DEBUG_KMS("Count connectors is %d but no mode or fb set\n",
2019 set.fb = fb;
2112 * drm_mode_addfb - add an FB to the graphics configuration
2121 * Add a new FB to the specified CRTC, given a user request.
2134 struct drm_framebuffer *fb;
2159 ret = dev->mode_config.funcs->fb_create(dev, file_priv, &r, &fb);
2165 or->fb_id = fb->base.id;
2166 list_add(&fb->filp_head, &file_priv->fbs);
2167 DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
2295 * drm_mode_addfb2 - add an FB to the graphics configuration
2304 * Add a new FB to the specified CRTC, given a user request with format.
2316 struct drm_framebuffer *fb;
2344 ret = dev->mode_config.funcs->fb_create(dev, file_priv, r, &fb);
2350 r->fb_id = fb->base.id;
2351 list_add(&fb->filp_head, &file_priv->fbs);
2352 DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
2360 * drm_mode_rmfb - remove an FB from the configuration
2369 * Remove the FB specified by the user.
2380 struct drm_framebuffer *fb = NULL;
2396 fb = obj_to_fb(obj);
2399 if (fb == fbl)
2407 drm_framebuffer_remove(fb);
2415 * drm_mode_getfb - get FB info
2424 * Lookup the FB given its ID and return info about it.
2436 struct drm_framebuffer *fb;
2448 fb = obj_to_fb(obj);
2450 r->height = fb->height;
2451 r->width = fb->width;
2452 r->depth = fb->depth;
2453 r->bpp = fb->bits_per_pixel;
2454 r->pitch = fb->pitches[0];
2456 fb->funcs->create_handle(fb, file_priv, &r->handle);
2470 struct drm_framebuffer *fb;
2484 fb = obj_to_fb(obj);
2517 if (fb->funcs->dirty) {
2518 ret = fb->funcs->dirty(fb, file_priv, flags, r->color,
2550 struct drm_framebuffer *fb, *tfb;
2553 list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
2554 drm_framebuffer_remove(fb);
3531 struct drm_framebuffer *fb;
3549 if (crtc->fb == NULL) {
3564 fb = obj_to_fb(obj);
3576 if (hdisplay > fb->width ||
3577 vdisplay > fb->height ||
3578 crtc->x > fb->width - hdisplay ||
3579 crtc->y > fb->height - vdisplay) {
3580 DRM_DEBUG_KMS("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n",
3581 fb->width, fb->height, hdisplay, vdisplay, crtc->x, crtc->y,
3607 ret = crtc->funcs->page_flip(crtc, fb, e);