Lines Matching refs:fb
973 return intel_crtc->active && crtc->primary->state->fb && in intel_crtc_active()
2220 dev_priv->display.update_primary_plane(crtc, plane->fb, in intel_enable_primary_hw_plane()
2254 dev_priv->display.update_primary_plane(crtc, plane->fb, in intel_disable_primary_hw_plane()
2323 intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb, in intel_fill_fb_ggtt_view() argument
2338 info->height = fb->height; in intel_fill_fb_ggtt_view()
2339 info->pixel_format = fb->pixel_format; in intel_fill_fb_ggtt_view()
2340 info->pitch = fb->pitches[0]; in intel_fill_fb_ggtt_view()
2341 info->fb_modifier = fb->modifier[0]; in intel_fill_fb_ggtt_view()
2355 struct drm_framebuffer *fb, in intel_pin_and_fence_fb_obj() argument
2359 struct drm_device *dev = fb->dev; in intel_pin_and_fence_fb_obj()
2361 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_pin_and_fence_fb_obj()
2368 switch (fb->modifier[0]) { in intel_pin_and_fence_fb_obj()
2395 MISSING_CASE(fb->modifier[0]); in intel_pin_and_fence_fb_obj()
2399 ret = intel_fill_fb_ggtt_view(&view, fb, plane_state); in intel_pin_and_fence_fb_obj()
2449 static void intel_unpin_fb_obj(struct drm_framebuffer *fb, in intel_unpin_fb_obj() argument
2452 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_unpin_fb_obj()
2458 ret = intel_fill_fb_ggtt_view(&view, fb, plane_state); in intel_unpin_fb_obj()
2546 struct drm_framebuffer *fb = &plane_config->fb->base; in intel_alloc_initial_plane_obj() local
2565 obj->stride = fb->pitches[0]; in intel_alloc_initial_plane_obj()
2567 mode_cmd.pixel_format = fb->pixel_format; in intel_alloc_initial_plane_obj()
2568 mode_cmd.width = fb->width; in intel_alloc_initial_plane_obj()
2569 mode_cmd.height = fb->height; in intel_alloc_initial_plane_obj()
2570 mode_cmd.pitches[0] = fb->pitches[0]; in intel_alloc_initial_plane_obj()
2571 mode_cmd.modifier[0] = fb->modifier[0]; in intel_alloc_initial_plane_obj()
2575 if (intel_framebuffer_init(dev, to_intel_framebuffer(fb), in intel_alloc_initial_plane_obj()
2595 if (plane->fb == plane->state->fb) in update_state_fb()
2598 if (plane->state->fb) in update_state_fb()
2599 drm_framebuffer_unreference(plane->state->fb); in update_state_fb()
2600 plane->state->fb = plane->fb; in update_state_fb()
2601 if (plane->state->fb) in update_state_fb()
2602 drm_framebuffer_reference(plane->state->fb); in update_state_fb()
2615 struct drm_framebuffer *fb; in intel_find_initial_plane_obj() local
2617 if (!plane_config->fb) in intel_find_initial_plane_obj()
2621 fb = &plane_config->fb->base; in intel_find_initial_plane_obj()
2625 kfree(plane_config->fb); in intel_find_initial_plane_obj()
2640 fb = c->primary->fb; in intel_find_initial_plane_obj()
2641 if (!fb) in intel_find_initial_plane_obj()
2644 obj = intel_fb_obj(fb); in intel_find_initial_plane_obj()
2646 drm_framebuffer_reference(fb); in intel_find_initial_plane_obj()
2654 obj = intel_fb_obj(fb); in intel_find_initial_plane_obj()
2658 primary->fb = fb; in intel_find_initial_plane_obj()
2666 struct drm_framebuffer *fb, in i9xx_update_primary_plane() argument
2689 obj = intel_fb_obj(fb); in i9xx_update_primary_plane()
2693 pixel_size = drm_format_plane_cpp(fb->pixel_format, 0); in i9xx_update_primary_plane()
2718 switch (fb->pixel_format) { in i9xx_update_primary_plane()
2756 linear_offset = y * fb->pitches[0] + x * pixel_size; in i9xx_update_primary_plane()
2762 fb->pitches[0]); in i9xx_update_primary_plane()
2777 (intel_crtc->config->pipe_src_h - 1) * fb->pitches[0] + in i9xx_update_primary_plane()
2783 I915_WRITE(DSPSTRIDE(plane), fb->pitches[0]); in i9xx_update_primary_plane()
2795 struct drm_framebuffer *fb, in ironlake_update_primary_plane() argument
2815 obj = intel_fb_obj(fb); in ironlake_update_primary_plane()
2819 pixel_size = drm_format_plane_cpp(fb->pixel_format, 0); in ironlake_update_primary_plane()
2828 switch (fb->pixel_format) { in ironlake_update_primary_plane()
2861 linear_offset = y * fb->pitches[0] + x * pixel_size; in ironlake_update_primary_plane()
2865 fb->pitches[0]); in ironlake_update_primary_plane()
2877 (intel_crtc->config->pipe_src_h - 1) * fb->pitches[0] + in ironlake_update_primary_plane()
2884 I915_WRITE(DSPSTRIDE(plane), fb->pitches[0]); in ironlake_update_primary_plane()
2942 struct drm_framebuffer *fb, in skylake_update_primary_plane() argument
2964 switch (fb->pixel_format) { in skylake_update_primary_plane()
2995 switch (fb->modifier[0]) { in skylake_update_primary_plane()
3008 MISSING_CASE(fb->modifier[0]); in skylake_update_primary_plane()
3015 obj = intel_fb_obj(fb); in skylake_update_primary_plane()
3016 stride_div = intel_fb_stride_alignment(dev, fb->modifier[0], in skylake_update_primary_plane()
3017 fb->pixel_format); in skylake_update_primary_plane()
3026 I915_WRITE(PLANE_STRIDE(pipe, 0), fb->pitches[0] / stride_div); in skylake_update_primary_plane()
3034 intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, in intel_pipe_set_base_atomic() argument
3043 dev_priv->display.update_primary_plane(crtc, fb, x, y); in intel_pipe_set_base_atomic()
3075 if (intel_crtc->active && crtc->primary->fb) in intel_update_primary_planes()
3077 crtc->primary->fb, in intel_update_primary_planes()
3813 if (crtc->primary->fb) { in intel_crtc_wait_for_pending_flips()
3815 intel_finish_fb(crtc->primary->fb); in intel_crtc_wait_for_pending_flips()
4331 if (plane->fb && intel_plane->pipe == pipe) in intel_disable_sprite_planes()
6949 struct drm_framebuffer *fb; in i9xx_get_initial_plane_config() local
6962 fb = &intel_fb->base; in i9xx_get_initial_plane_config()
6967 fb->modifier[0] = I915_FORMAT_MOD_X_TILED; in i9xx_get_initial_plane_config()
6973 fb->pixel_format = fourcc; in i9xx_get_initial_plane_config()
6974 fb->bits_per_pixel = drm_format_plane_cpp(fourcc, 0) * 8; in i9xx_get_initial_plane_config()
6988 fb->width = ((val >> 16) & 0xfff) + 1; in i9xx_get_initial_plane_config()
6989 fb->height = ((val >> 0) & 0xfff) + 1; in i9xx_get_initial_plane_config()
6992 fb->pitches[0] = val & 0xffffffc0; in i9xx_get_initial_plane_config()
6994 aligned_height = intel_fb_align_height(dev, fb->height, in i9xx_get_initial_plane_config()
6995 fb->pixel_format, in i9xx_get_initial_plane_config()
6996 fb->modifier[0]); in i9xx_get_initial_plane_config()
6998 plane_config->size = fb->pitches[0] * aligned_height; in i9xx_get_initial_plane_config()
7001 pipe_name(pipe), plane, fb->width, fb->height, in i9xx_get_initial_plane_config()
7002 fb->bits_per_pixel, base, fb->pitches[0], in i9xx_get_initial_plane_config()
7005 plane_config->fb = intel_fb; in i9xx_get_initial_plane_config()
8002 struct drm_framebuffer *fb; in skylake_get_initial_plane_config() local
8011 fb = &intel_fb->base; in skylake_get_initial_plane_config()
8021 fb->pixel_format = fourcc; in skylake_get_initial_plane_config()
8022 fb->bits_per_pixel = drm_format_plane_cpp(fourcc, 0) * 8; in skylake_get_initial_plane_config()
8027 fb->modifier[0] = DRM_FORMAT_MOD_NONE; in skylake_get_initial_plane_config()
8031 fb->modifier[0] = I915_FORMAT_MOD_X_TILED; in skylake_get_initial_plane_config()
8034 fb->modifier[0] = I915_FORMAT_MOD_Y_TILED; in skylake_get_initial_plane_config()
8037 fb->modifier[0] = I915_FORMAT_MOD_Yf_TILED; in skylake_get_initial_plane_config()
8050 fb->height = ((val >> 16) & 0xfff) + 1; in skylake_get_initial_plane_config()
8051 fb->width = ((val >> 0) & 0x1fff) + 1; in skylake_get_initial_plane_config()
8054 stride_mult = intel_fb_stride_alignment(dev, fb->modifier[0], in skylake_get_initial_plane_config()
8055 fb->pixel_format); in skylake_get_initial_plane_config()
8056 fb->pitches[0] = (val & 0x3ff) * stride_mult; in skylake_get_initial_plane_config()
8058 aligned_height = intel_fb_align_height(dev, fb->height, in skylake_get_initial_plane_config()
8059 fb->pixel_format, in skylake_get_initial_plane_config()
8060 fb->modifier[0]); in skylake_get_initial_plane_config()
8062 plane_config->size = fb->pitches[0] * aligned_height; in skylake_get_initial_plane_config()
8065 pipe_name(pipe), fb->width, fb->height, in skylake_get_initial_plane_config()
8066 fb->bits_per_pixel, base, fb->pitches[0], in skylake_get_initial_plane_config()
8069 plane_config->fb = intel_fb; in skylake_get_initial_plane_config()
8073 kfree(fb); in skylake_get_initial_plane_config()
8110 struct drm_framebuffer *fb; in ironlake_get_initial_plane_config() local
8123 fb = &intel_fb->base; in ironlake_get_initial_plane_config()
8128 fb->modifier[0] = I915_FORMAT_MOD_X_TILED; in ironlake_get_initial_plane_config()
8134 fb->pixel_format = fourcc; in ironlake_get_initial_plane_config()
8135 fb->bits_per_pixel = drm_format_plane_cpp(fourcc, 0) * 8; in ironlake_get_initial_plane_config()
8149 fb->width = ((val >> 16) & 0xfff) + 1; in ironlake_get_initial_plane_config()
8150 fb->height = ((val >> 0) & 0xfff) + 1; in ironlake_get_initial_plane_config()
8153 fb->pitches[0] = val & 0xffffffc0; in ironlake_get_initial_plane_config()
8155 aligned_height = intel_fb_align_height(dev, fb->height, in ironlake_get_initial_plane_config()
8156 fb->pixel_format, in ironlake_get_initial_plane_config()
8157 fb->modifier[0]); in ironlake_get_initial_plane_config()
8159 plane_config->size = fb->pitches[0] * aligned_height; in ironlake_get_initial_plane_config()
8162 pipe_name(pipe), fb->width, fb->height, in ironlake_get_initial_plane_config()
8163 fb->bits_per_pixel, base, fb->pitches[0], in ironlake_get_initial_plane_config()
8166 plane_config->fb = intel_fb; in ironlake_get_initial_plane_config()
8899 struct drm_framebuffer *fb; in intel_framebuffer_create() local
8905 fb = __intel_framebuffer_create(dev, mode_cmd, obj); in intel_framebuffer_create()
8908 return fb; in intel_framebuffer_create()
8954 struct drm_framebuffer *fb; in mode_fits_in_fbdev() local
8959 if (!dev_priv->fbdev->fb) in mode_fits_in_fbdev()
8962 obj = dev_priv->fbdev->fb->obj; in mode_fits_in_fbdev()
8965 fb = &dev_priv->fbdev->fb->base; in mode_fits_in_fbdev()
8966 if (fb->pitches[0] < intel_framebuffer_pitch_for_width(mode->hdisplay, in mode_fits_in_fbdev()
8967 fb->bits_per_pixel)) in mode_fits_in_fbdev()
8970 if (obj->base.size < mode->vdisplay * fb->pitches[0]) in mode_fits_in_fbdev()
8973 return fb; in mode_fits_in_fbdev()
8991 struct drm_framebuffer *fb; in intel_get_load_detect_pipe() local
9101 fb = mode_fits_in_fbdev(dev, mode); in intel_get_load_detect_pipe()
9102 if (fb == NULL) { in intel_get_load_detect_pipe()
9104 fb = intel_framebuffer_create_for_mode(dev, mode, 24, 32); in intel_get_load_detect_pipe()
9105 old->release_fb = fb; in intel_get_load_detect_pipe()
9108 if (IS_ERR(fb)) { in intel_get_load_detect_pipe()
9113 if (intel_set_mode(crtc, mode, 0, 0, fb, state)) { in intel_get_load_detect_pipe()
9455 if (!crtc->primary->fb) in intel_mark_idle()
9649 struct drm_framebuffer *fb, in intel_gen2_queue_flip() argument
9673 intel_ring_emit(ring, fb->pitches[0]); in intel_gen2_queue_flip()
9684 struct drm_framebuffer *fb, in intel_gen3_queue_flip() argument
9705 intel_ring_emit(ring, fb->pitches[0]); in intel_gen3_queue_flip()
9716 struct drm_framebuffer *fb, in intel_gen4_queue_flip() argument
9736 intel_ring_emit(ring, fb->pitches[0]); in intel_gen4_queue_flip()
9755 struct drm_framebuffer *fb, in intel_gen6_queue_flip() argument
9771 intel_ring_emit(ring, fb->pitches[0] | obj->tiling_mode); in intel_gen6_queue_flip()
9791 struct drm_framebuffer *fb, in intel_gen7_queue_flip() argument
9875 intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode)); in intel_gen7_queue_flip()
9915 struct drm_framebuffer *fb = intel_crtc->base.primary->fb; in skl_do_mmio_flip() local
9916 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in skl_do_mmio_flip()
9930 stride = fb->pitches[0] >> 6; in skl_do_mmio_flip()
9932 stride = fb->pitches[0] >> 9; /* X tiles are 512 bytes wide */ in skl_do_mmio_flip()
9950 to_intel_framebuffer(intel_crtc->base.primary->fb); in ilk_do_mmio_flip()
10017 struct drm_framebuffer *fb, in intel_queue_mmio_flip() argument
10034 struct drm_framebuffer *fb, in intel_default_queue_flip() argument
10103 struct drm_framebuffer *fb, in intel_crtc_page_flip() argument
10109 struct drm_framebuffer *old_fb = crtc->primary->fb; in intel_crtc_page_flip()
10110 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_crtc_page_flip()
10127 if (fb->pixel_format != crtc->primary->fb->pixel_format) in intel_crtc_page_flip()
10135 (fb->offsets[0] != crtc->primary->fb->offsets[0] || in intel_crtc_page_flip()
10136 fb->pitches[0] != crtc->primary->fb->pitches[0])) in intel_crtc_page_flip()
10183 crtc->primary->fb = fb; in intel_crtc_page_flip()
10213 ret = intel_pin_and_fence_fb_obj(crtc->primary, fb, in intel_crtc_page_flip()
10222 ret = intel_queue_mmio_flip(dev, crtc, fb, obj, ring, in intel_crtc_page_flip()
10230 ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, ring, in intel_crtc_page_flip()
10254 intel_unpin_fb_obj(fb, crtc->primary->state); in intel_crtc_page_flip()
10259 crtc->primary->fb = old_fb; in intel_crtc_page_flip()
10410 struct drm_framebuffer *fb, in compute_baseline_pipe_bpp() argument
10418 switch (fb->pixel_format) { in compute_baseline_pipe_bpp()
10633 struct drm_framebuffer *fb, in intel_modeset_pipe_config() argument
10688 fb, pipe_config); in intel_modeset_pipe_config()
11433 struct drm_framebuffer *fb, in intel_modeset_compute_config() argument
11471 pipe_config = intel_modeset_pipe_config(crtc, fb, mode, state); in intel_modeset_compute_config()
11514 int x, int y, struct drm_framebuffer *fb, in __intel_set_mode() argument
11605 fb, 0, 0, in __intel_set_mode()
11645 int x, int y, struct drm_framebuffer *fb, in intel_set_mode_pipes() argument
11653 ret = __intel_set_mode(crtc, mode, x, y, fb, pipe_config, modeset_pipes, in intel_set_mode_pipes()
11664 int x, int y, struct drm_framebuffer *fb, in intel_set_mode() argument
11671 pipe_config = intel_modeset_compute_config(crtc, mode, fb, state, in intel_set_mode()
11681 ret = intel_set_mode_pipes(crtc, mode, x, y, fb, pipe_config, in intel_set_mode()
11735 intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->primary->fb, in intel_crtc_restore_mode()
11862 } else if (set->crtc->primary->fb != set->fb) { in intel_set_config_compute_mode_changes()
11869 if (set->crtc->primary->fb == NULL) { in intel_set_config_compute_mode_changes()
11880 } else if (set->fb == NULL) { in intel_set_config_compute_mode_changes()
11882 } else if (set->fb->pixel_format != in intel_set_config_compute_mode_changes()
11883 set->crtc->primary->fb->pixel_format) { in intel_set_config_compute_mode_changes()
11890 if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y)) in intel_set_config_compute_mode_changes()
11918 WARN_ON(!set->fb && (set->num_connectors != 0)); in intel_modeset_stage_output_state()
11919 WARN_ON(set->fb && (set->num_connectors == 0)); in intel_modeset_stage_output_state()
11934 if ((!set->fb || ro == set->num_connectors) && in intel_modeset_stage_output_state()
12092 BUG_ON(!set->mode && set->fb); in intel_crtc_set_config()
12093 BUG_ON(set->fb && set->num_connectors == 0); in intel_crtc_set_config()
12095 if (set->fb) { in intel_crtc_set_config()
12097 set->crtc->base.id, set->fb->base.id, in intel_crtc_set_config()
12118 save_set.fb = set->crtc->primary->fb; in intel_crtc_set_config()
12139 set->fb, state, in intel_crtc_set_config()
12163 set->x, set->y, set->fb, pipe_config, in intel_crtc_set_config()
12172 ret = primary->funcs->update_plane(primary, set->crtc, set->fb, in intel_crtc_set_config()
12212 if (to_intel_crtc(save_set.crtc)->new_enabled && !save_set.fb) in intel_crtc_set_config()
12218 save_set.x, save_set.y, save_set.fb, in intel_crtc_set_config()
12354 if (!plane->state->fb || !state->fb || in intel_wm_need_update()
12355 plane->state->fb->modifier[0] != state->fb->modifier[0] || in intel_wm_need_update()
12376 struct drm_framebuffer *fb, in intel_prepare_plane_fb() argument
12382 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_prepare_plane_fb()
12383 struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->fb); in intel_prepare_plane_fb()
12411 ret = intel_pin_and_fence_fb_obj(plane, fb, new_state, NULL); in intel_prepare_plane_fb()
12431 struct drm_framebuffer *fb, in intel_cleanup_plane_fb() argument
12435 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_cleanup_plane_fb()
12443 intel_unpin_fb_obj(fb, old_state); in intel_cleanup_plane_fb()
12456 struct drm_framebuffer *fb = state->base.fb; in intel_check_primary_plane() local
12465 ret = drm_plane_helper_check_update(plane, crtc, fb, in intel_check_primary_plane()
12510 if (!state->visible || !fb) in intel_check_primary_plane()
12530 struct drm_framebuffer *fb = state->base.fb; in intel_commit_primary_plane() local
12539 plane->fb = fb; in intel_commit_primary_plane()
12550 dev_priv->display.update_primary_plane(crtc, plane->fb, in intel_commit_primary_plane()
12593 i915_gem_track_fb(intel_fb_obj(p->fb), NULL, fb_bits); in intel_begin_crtc_commit()
12747 struct drm_framebuffer *fb = state->base.fb; in intel_check_cursor_plane() local
12751 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_check_cursor_plane()
12759 ret = drm_plane_helper_check_update(plane, crtc, fb, in intel_check_cursor_plane()
12785 if (fb->modifier[0] != DRM_FORMAT_MOD_NONE) { in intel_check_cursor_plane()
12809 struct drm_i915_gem_object *obj = intel_fb_obj(state->base.fb); in intel_commit_cursor_plane()
12815 plane->fb = state->base.fb; in intel_commit_cursor_plane()
13196 static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) in intel_user_framebuffer_destroy() argument
13198 struct drm_device *dev = fb->dev; in intel_user_framebuffer_destroy()
13199 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in intel_user_framebuffer_destroy()
13201 drm_framebuffer_cleanup(fb); in intel_user_framebuffer_destroy()
13209 static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb, in intel_user_framebuffer_create_handle() argument
13213 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in intel_user_framebuffer_create_handle()
14311 obj = intel_fb_obj(c->primary->fb); in intel_modeset_gem_init()
14317 c->primary->fb, in intel_modeset_gem_init()
14324 drm_framebuffer_unreference(c->primary->fb); in intel_modeset_gem_init()
14325 c->primary->fb = NULL; in intel_modeset_gem_init()