Lines Matching refs:fb

279 int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,  in drm_framebuffer_init()  argument
284 refcount_init(&fb->refcount, 1); in drm_framebuffer_init()
286 ret = drm_mode_object_get(dev, &fb->base, DRM_MODE_OBJECT_FB); in drm_framebuffer_init()
290 fb->dev = dev; in drm_framebuffer_init()
291 fb->funcs = funcs; in drm_framebuffer_init()
293 list_add(&fb->head, &dev->mode_config.fb_list); in drm_framebuffer_init()
299 static void drm_framebuffer_free(struct drm_framebuffer *fb) in drm_framebuffer_free() argument
301 fb->funcs->destroy(fb); in drm_framebuffer_free()
310 void drm_framebuffer_unreference(struct drm_framebuffer *fb) in drm_framebuffer_unreference() argument
312 struct drm_device *dev = fb->dev; in drm_framebuffer_unreference()
313 DRM_DEBUG("FB ID: %d\n", fb->base.id); in drm_framebuffer_unreference()
316 if (refcount_release(&fb->refcount)) in drm_framebuffer_unreference()
317 drm_framebuffer_free(fb); in drm_framebuffer_unreference()
324 void drm_framebuffer_reference(struct drm_framebuffer *fb) in drm_framebuffer_reference() argument
326 DRM_DEBUG("FB ID: %d\n", fb->base.id); in drm_framebuffer_reference()
327 refcount_acquire(&fb->refcount); in drm_framebuffer_reference()
341 void drm_framebuffer_cleanup(struct drm_framebuffer *fb) in drm_framebuffer_cleanup() argument
343 struct drm_device *dev = fb->dev; in drm_framebuffer_cleanup()
351 drm_mode_object_put(dev, &fb->base); in drm_framebuffer_cleanup()
352 list_del(&fb->head); in drm_framebuffer_cleanup()
367 void drm_framebuffer_remove(struct drm_framebuffer *fb) in drm_framebuffer_remove() argument
369 struct drm_device *dev = fb->dev; in drm_framebuffer_remove()
377 if (crtc->fb == fb) { in drm_framebuffer_remove()
381 set.fb = NULL; in drm_framebuffer_remove()
389 if (plane->fb == fb) { in drm_framebuffer_remove()
395 plane->fb = NULL; in drm_framebuffer_remove()
400 list_del(&fb->filp_head); in drm_framebuffer_remove()
402 drm_framebuffer_unreference(fb); in drm_framebuffer_remove()
1058 struct drm_framebuffer *fb, *fbt; in drm_mode_config_cleanup() local
1083 list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) { in drm_mode_config_cleanup()
1084 drm_framebuffer_remove(fb); in drm_mode_config_cleanup()
1202 struct drm_framebuffer *fb; in drm_mode_getresources() local
1258 list_for_each_entry(fb, &file_priv->fbs, filp_head) { in drm_mode_getresources()
1259 if (put_user(fb->base.id, fb_id + copied)) { in drm_mode_getresources()
1408 if (crtc->fb) in drm_mode_getcrtc()
1409 crtc_resp->fb_id = crtc->fb->base.id; in drm_mode_getcrtc()
1692 if (plane->fb) in drm_mode_getplane()
1693 plane_resp->fb_id = plane->fb->base.id; in drm_mode_getplane()
1741 struct drm_framebuffer *fb; in drm_mode_setplane() local
1769 plane->fb = NULL; in drm_mode_setplane()
1791 fb = obj_to_fb(obj); in drm_mode_setplane()
1795 if (fb->pixel_format == plane->format_types[i]) in drm_mode_setplane()
1798 DRM_DEBUG_KMS("Invalid pixel format 0x%08x\n", fb->pixel_format); in drm_mode_setplane()
1803 fb_width = fb->width << 16; in drm_mode_setplane()
1804 fb_height = fb->height << 16; in drm_mode_setplane()
1837 ret = plane->funcs->update_plane(plane, crtc, fb, in drm_mode_setplane()
1844 plane->fb = fb; in drm_mode_setplane()
1878 struct drm_framebuffer *fb = NULL; in drm_mode_setcrtc() local
1908 if (!crtc->fb) { in drm_mode_setcrtc()
1913 fb = crtc->fb; in drm_mode_setcrtc()
1923 fb = obj_to_fb(obj); in drm_mode_setcrtc()
1950 if (hdisplay > fb->width || in drm_mode_setcrtc()
1951 vdisplay > fb->height || in drm_mode_setcrtc()
1952 crtc_req->x > fb->width - hdisplay || in drm_mode_setcrtc()
1953 crtc_req->y > fb->height - vdisplay) { in drm_mode_setcrtc()
1955 fb->width, fb->height, in drm_mode_setcrtc()
1969 if (crtc_req->count_connectors > 0 && (!mode || !fb)) { in drm_mode_setcrtc()
2019 set.fb = fb; in drm_mode_setcrtc()
2134 struct drm_framebuffer *fb; in drm_mode_addfb() local
2159 ret = dev->mode_config.funcs->fb_create(dev, file_priv, &r, &fb); in drm_mode_addfb()
2165 or->fb_id = fb->base.id; in drm_mode_addfb()
2166 list_add(&fb->filp_head, &file_priv->fbs); in drm_mode_addfb()
2167 DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id); in drm_mode_addfb()
2316 struct drm_framebuffer *fb; in drm_mode_addfb2() local
2344 ret = dev->mode_config.funcs->fb_create(dev, file_priv, r, &fb); in drm_mode_addfb2()
2350 r->fb_id = fb->base.id; in drm_mode_addfb2()
2351 list_add(&fb->filp_head, &file_priv->fbs); in drm_mode_addfb2()
2352 DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id); in drm_mode_addfb2()
2380 struct drm_framebuffer *fb = NULL; in drm_mode_rmfb() local
2396 fb = obj_to_fb(obj); in drm_mode_rmfb()
2399 if (fb == fbl) in drm_mode_rmfb()
2407 drm_framebuffer_remove(fb); in drm_mode_rmfb()
2436 struct drm_framebuffer *fb; in drm_mode_getfb() local
2448 fb = obj_to_fb(obj); in drm_mode_getfb()
2450 r->height = fb->height; in drm_mode_getfb()
2451 r->width = fb->width; in drm_mode_getfb()
2452 r->depth = fb->depth; in drm_mode_getfb()
2453 r->bpp = fb->bits_per_pixel; in drm_mode_getfb()
2454 r->pitch = fb->pitches[0]; in drm_mode_getfb()
2456 fb->funcs->create_handle(fb, file_priv, &r->handle); in drm_mode_getfb()
2470 struct drm_framebuffer *fb; in drm_mode_dirtyfb_ioctl() local
2484 fb = obj_to_fb(obj); in drm_mode_dirtyfb_ioctl()
2517 if (fb->funcs->dirty) { in drm_mode_dirtyfb_ioctl()
2518 ret = fb->funcs->dirty(fb, file_priv, flags, r->color, in drm_mode_dirtyfb_ioctl()
2550 struct drm_framebuffer *fb, *tfb; in drm_fb_release() local
2553 list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) { in drm_fb_release()
2554 drm_framebuffer_remove(fb); in drm_fb_release()
3531 struct drm_framebuffer *fb; in drm_mode_page_flip_ioctl() local
3549 if (crtc->fb == NULL) { in drm_mode_page_flip_ioctl()
3564 fb = obj_to_fb(obj); in drm_mode_page_flip_ioctl()
3576 if (hdisplay > fb->width || in drm_mode_page_flip_ioctl()
3577 vdisplay > fb->height || in drm_mode_page_flip_ioctl()
3578 crtc->x > fb->width - hdisplay || in drm_mode_page_flip_ioctl()
3579 crtc->y > fb->height - vdisplay) { in drm_mode_page_flip_ioctl()
3581 fb->width, fb->height, hdisplay, vdisplay, crtc->x, crtc->y, in drm_mode_page_flip_ioctl()
3607 ret = crtc->funcs->page_flip(crtc, fb, e); in drm_mode_page_flip_ioctl()