Lines Matching full:fb

343  * @cmd: FB add command structure
581 * @fb: Framebuffer
585 * Returns %true if @fb's color plane at index @color_plane is a CCS AUX plane.
587 bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane) in intel_fb_is_ccs_aux_plane() argument
589 const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); in intel_fb_is_ccs_aux_plane()
591 return ccs_aux_plane_mask(md, fb->format) & BIT(color_plane); in intel_fb_is_ccs_aux_plane()
596 * @fb: Framebuffer
600 * Returns %true if @fb's color plane at index @color_plane is a GEN12 CCS AUX plane.
602 static bool intel_fb_is_gen12_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane) in intel_fb_is_gen12_ccs_aux_plane() argument
604 const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); in intel_fb_is_gen12_ccs_aux_plane()
607 ccs_aux_plane_mask(md, fb->format) & BIT(color_plane); in intel_fb_is_gen12_ccs_aux_plane()
612 * @fb: Framebuffer
615 * Returns the index of the color clear plane for @fb, or -1 if @fb is not a
618 int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb) in intel_fb_rc_ccs_cc_plane() argument
620 const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); in intel_fb_rc_ccs_cc_plane()
625 drm_WARN_ON_ONCE(fb->dev, hweight8(md->ccs.cc_planes) > 1); in intel_fb_rc_ccs_cc_plane()
630 static bool is_gen12_ccs_cc_plane(const struct drm_framebuffer *fb, int color_plane) in is_gen12_ccs_cc_plane() argument
632 return intel_fb_rc_ccs_cc_plane(fb) == color_plane; in is_gen12_ccs_cc_plane()
635 bool is_surface_linear(const struct drm_framebuffer *fb, int color_plane) in is_surface_linear() argument
637 return fb->modifier == DRM_FORMAT_MOD_LINEAR || in is_surface_linear()
638 intel_fb_is_gen12_ccs_aux_plane(fb, color_plane) || in is_surface_linear()
639 is_gen12_ccs_cc_plane(fb, color_plane); in is_surface_linear()
642 int main_to_ccs_plane(const struct drm_framebuffer *fb, int main_plane) in main_to_ccs_plane() argument
644 drm_WARN_ON(fb->dev, !intel_fb_is_ccs_modifier(fb->modifier) || in main_to_ccs_plane()
645 (main_plane && main_plane >= fb->format->num_planes / 2)); in main_to_ccs_plane()
647 return fb->format->num_planes / 2 + main_plane; in main_to_ccs_plane()
650 int skl_ccs_to_main_plane(const struct drm_framebuffer *fb, int ccs_plane) in skl_ccs_to_main_plane() argument
652 drm_WARN_ON(fb->dev, !intel_fb_is_ccs_modifier(fb->modifier) || in skl_ccs_to_main_plane()
653 ccs_plane < fb->format->num_planes / 2); in skl_ccs_to_main_plane()
655 if (is_gen12_ccs_cc_plane(fb, ccs_plane)) in skl_ccs_to_main_plane()
658 return ccs_plane - fb->format->num_planes / 2; in skl_ccs_to_main_plane()
661 static unsigned int gen12_ccs_aux_stride(struct intel_framebuffer *fb, int ccs_plane) in gen12_ccs_aux_stride() argument
663 int main_plane = skl_ccs_to_main_plane(&fb->base, ccs_plane); in gen12_ccs_aux_stride()
664 unsigned int main_stride = fb->base.pitches[main_plane]; in gen12_ccs_aux_stride()
665 unsigned int main_tile_width = intel_tile_width_bytes(&fb->base, main_plane); in gen12_ccs_aux_stride()
670 int skl_main_to_aux_plane(const struct drm_framebuffer *fb, int main_plane) in skl_main_to_aux_plane() argument
672 const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); in skl_main_to_aux_plane()
673 struct drm_i915_private *i915 = to_i915(fb->dev); in skl_main_to_aux_plane()
676 return main_to_ccs_plane(fb, main_plane); in skl_main_to_aux_plane()
678 format_is_yuv_semiplanar(md, fb->format)) in skl_main_to_aux_plane()
690 intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane) in intel_tile_width_bytes() argument
692 struct drm_i915_private *dev_priv = to_i915(fb->dev); in intel_tile_width_bytes()
693 unsigned int cpp = fb->format->cpp[color_plane]; in intel_tile_width_bytes()
695 switch (fb->modifier) { in intel_tile_width_bytes()
715 if (intel_fb_is_ccs_aux_plane(fb, color_plane)) in intel_tile_width_bytes()
724 if (intel_fb_is_ccs_aux_plane(fb, color_plane) || in intel_tile_width_bytes()
725 is_gen12_ccs_cc_plane(fb, color_plane)) in intel_tile_width_bytes()
734 if (intel_fb_is_ccs_aux_plane(fb, color_plane)) in intel_tile_width_bytes()
753 MISSING_CASE(fb->modifier); in intel_tile_width_bytes()
758 unsigned int intel_tile_height(const struct drm_framebuffer *fb, int color_plane) in intel_tile_height() argument
760 return intel_tile_size(to_i915(fb->dev)) / in intel_tile_height()
761 intel_tile_width_bytes(fb, color_plane); in intel_tile_height()
768 static void intel_tile_dims(const struct drm_framebuffer *fb, int color_plane, in intel_tile_dims() argument
772 unsigned int tile_width_bytes = intel_tile_width_bytes(fb, color_plane); in intel_tile_dims()
773 unsigned int cpp = fb->format->cpp[color_plane]; in intel_tile_dims()
776 *tile_height = intel_tile_height(fb, color_plane); in intel_tile_dims()
784 static void intel_tile_block_dims(const struct drm_framebuffer *fb, int color_plane, in intel_tile_block_dims() argument
788 intel_tile_dims(fb, color_plane, tile_width, tile_height); in intel_tile_block_dims()
790 if (intel_fb_is_gen12_ccs_aux_plane(fb, color_plane)) in intel_tile_block_dims()
794 unsigned int intel_tile_row_size(const struct drm_framebuffer *fb, int color_plane) in intel_tile_row_size() argument
798 intel_tile_dims(fb, color_plane, &tile_width, &tile_height); in intel_tile_row_size()
800 return fb->pitches[color_plane] * tile_height; in intel_tile_row_size()
804 intel_fb_align_height(const struct drm_framebuffer *fb, in intel_fb_align_height() argument
807 unsigned int tile_height = intel_tile_height(fb, color_plane); in intel_fb_align_height()
817 bool intel_fb_uses_dpt(const struct drm_framebuffer *fb) in intel_fb_uses_dpt() argument
819 return to_i915(fb->dev)->display.params.enable_dpt && in intel_fb_uses_dpt()
820 intel_fb_modifier_uses_dpt(to_i915(fb->dev), fb->modifier); in intel_fb_uses_dpt()
824 const struct drm_framebuffer *fb, in intel_fb_plane_get_subsampling() argument
840 if (!intel_fb_is_gen12_ccs_aux_plane(fb, color_plane)) { in intel_fb_plane_get_subsampling()
841 *hsub = fb->format->hsub; in intel_fb_plane_get_subsampling()
842 *vsub = fb->format->vsub; in intel_fb_plane_get_subsampling()
847 main_plane = skl_ccs_to_main_plane(fb, color_plane); in intel_fb_plane_get_subsampling()
848 *hsub = drm_format_info_block_width(fb->format, color_plane) / in intel_fb_plane_get_subsampling()
849 drm_format_info_block_width(fb->format, main_plane); in intel_fb_plane_get_subsampling()
860 *hsub *= fb->format->hsub; in intel_fb_plane_get_subsampling()
865 static void intel_fb_plane_dims(const struct intel_framebuffer *fb, int color_plane, int *w, int *h) in intel_fb_plane_dims() argument
867 int main_plane = intel_fb_is_ccs_aux_plane(&fb->base, color_plane) ? in intel_fb_plane_dims()
868 skl_ccs_to_main_plane(&fb->base, color_plane) : 0; in intel_fb_plane_dims()
869 unsigned int main_width = fb->base.width; in intel_fb_plane_dims()
870 unsigned int main_height = fb->base.height; in intel_fb_plane_dims()
874 intel_fb_plane_get_subsampling(&main_hsub, &main_vsub, &fb->base, main_plane); in intel_fb_plane_dims()
875 intel_fb_plane_get_subsampling(&hsub, &vsub, &fb->base, color_plane); in intel_fb_plane_dims()
923 const struct drm_framebuffer *fb, in intel_adjust_aligned_offset() argument
929 struct drm_i915_private *i915 = to_i915(fb->dev); in intel_adjust_aligned_offset()
930 unsigned int cpp = fb->format->cpp[color_plane]; in intel_adjust_aligned_offset()
934 if (!is_surface_linear(fb, color_plane)) { in intel_adjust_aligned_offset()
939 intel_tile_dims(fb, color_plane, &tile_width, &tile_height); in intel_adjust_aligned_offset()
968 return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane, in intel_plane_adjust_aligned_offset()
990 const struct drm_framebuffer *fb, in intel_compute_aligned_offset() argument
996 unsigned int cpp = fb->format->cpp[color_plane]; in intel_compute_aligned_offset()
999 if (!is_surface_linear(fb, color_plane)) { in intel_compute_aligned_offset()
1004 intel_tile_dims(fb, color_plane, &tile_width, &tile_height); in intel_compute_aligned_offset()
1049 const struct drm_framebuffer *fb = state->hw.fb; in intel_plane_compute_aligned_offset() local
1052 unsigned int alignment = plane->min_alignment(plane, fb, color_plane); in intel_plane_compute_aligned_offset()
1054 return intel_compute_aligned_offset(i915, x, y, fb, color_plane, in intel_plane_compute_aligned_offset()
1058 /* Convert the fb->offset[] into x/y offsets */
1060 const struct drm_framebuffer *fb, in intel_fb_offset_to_xy() argument
1063 struct drm_i915_private *i915 = to_i915(fb->dev); in intel_fb_offset_to_xy()
1066 if (fb->modifier != DRM_FORMAT_MOD_LINEAR) in intel_fb_offset_to_xy()
1071 if (alignment != 0 && fb->offsets[color_plane] % alignment) { in intel_fb_offset_to_xy()
1074 fb->offsets[color_plane], color_plane); in intel_fb_offset_to_xy()
1078 height = drm_format_info_plane_height(fb->format, fb->height, color_plane); in intel_fb_offset_to_xy()
1079 height = ALIGN(height, intel_tile_height(fb, color_plane)); in intel_fb_offset_to_xy()
1082 if (check_add_overflow(mul_u32_u32(height, fb->pitches[color_plane]), in intel_fb_offset_to_xy()
1083 fb->offsets[color_plane], &unused)) { in intel_fb_offset_to_xy()
1086 fb->offsets[color_plane], fb->pitches[color_plane], in intel_fb_offset_to_xy()
1095 fb, color_plane, DRM_MODE_ROTATE_0, in intel_fb_offset_to_xy()
1096 fb->pitches[color_plane], in intel_fb_offset_to_xy()
1097 fb->offsets[color_plane], 0); in intel_fb_offset_to_xy()
1102 static int intel_fb_check_ccs_xy(const struct drm_framebuffer *fb, int ccs_plane, int x, int y) in intel_fb_check_ccs_xy() argument
1104 struct drm_i915_private *i915 = to_i915(fb->dev); in intel_fb_check_ccs_xy()
1105 const struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in intel_fb_check_ccs_xy()
1112 if (!intel_fb_is_ccs_aux_plane(fb, ccs_plane)) in intel_fb_check_ccs_xy()
1120 intel_tile_block_dims(fb, ccs_plane, &tile_width, &tile_height); in intel_fb_check_ccs_xy()
1121 intel_fb_plane_get_subsampling(&hsub, &vsub, fb, ccs_plane); in intel_fb_check_ccs_xy()
1129 main_plane = skl_ccs_to_main_plane(fb, ccs_plane); in intel_fb_check_ccs_xy()
1155 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_can_remap() local
1175 if (intel_fb_is_ccs_modifier(fb->modifier)) in intel_plane_can_remap()
1179 if (fb->modifier == DRM_FORMAT_MOD_LINEAR) { in intel_plane_can_remap()
1182 for (i = 0; i < fb->format->num_planes; i++) { in intel_plane_can_remap()
1183 if (fb->pitches[i] & alignment) in intel_plane_can_remap()
1191 bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb) in intel_fb_needs_pot_stride_remap() argument
1193 struct drm_i915_private *i915 = to_i915(fb->base.dev); in intel_fb_needs_pot_stride_remap()
1196 intel_fb_uses_dpt(&fb->base); in intel_fb_needs_pot_stride_remap()
1199 static int intel_fb_pitch(const struct intel_framebuffer *fb, int color_plane, unsigned int rotatio… in intel_fb_pitch() argument
1202 return fb->rotated_view.color_plane[color_plane].mapping_stride; in intel_fb_pitch()
1203 else if (intel_fb_needs_pot_stride_remap(fb)) in intel_fb_pitch()
1204 return fb->remapped_view.color_plane[color_plane].mapping_stride; in intel_fb_pitch()
1206 return fb->normal_view.color_plane[color_plane].mapping_stride; in intel_fb_pitch()
1212 const struct intel_framebuffer *fb = to_intel_framebuffer(plane_state->hw.fb); in intel_plane_needs_remap() local
1230 stride = intel_fb_pitch(fb, 0, rotation); in intel_plane_needs_remap()
1231 max_stride = plane->max_stride(plane, fb->base.format->format, in intel_plane_needs_remap()
1232 fb->base.modifier, rotation); in intel_plane_needs_remap()
1237 static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int color_plane, in convert_plane_offset_to_xy() argument
1240 struct drm_i915_gem_object *obj = intel_fb_obj(&fb->base); in convert_plane_offset_to_xy()
1243 ret = intel_fb_offset_to_xy(x, y, &fb->base, color_plane); in convert_plane_offset_to_xy()
1245 drm_dbg_kms(fb->base.dev, in convert_plane_offset_to_xy()
1246 "bad fb plane %d offset: 0x%x\n", in convert_plane_offset_to_xy()
1247 color_plane, fb->base.offsets[color_plane]); in convert_plane_offset_to_xy()
1251 ret = intel_fb_check_ccs_xy(&fb->base, color_plane, *x, *y); in convert_plane_offset_to_xy()
1261 * fb layout agrees with the fence layout. We already check that the in convert_plane_offset_to_xy()
1262 * fb stride matches the fence stride elsewhere. in convert_plane_offset_to_xy()
1265 (*x + plane_width) * fb->base.format->cpp[color_plane] > fb->base.pitches[color_plane]) { in convert_plane_offset_to_xy()
1266 drm_dbg_kms(fb->base.dev, in convert_plane_offset_to_xy()
1267 "bad fb plane %d offset: 0x%x\n", in convert_plane_offset_to_xy()
1268 color_plane, fb->base.offsets[color_plane]); in convert_plane_offset_to_xy()
1275 static u32 calc_plane_aligned_offset(const struct intel_framebuffer *fb, int color_plane, int *x, i… in calc_plane_aligned_offset() argument
1277 struct drm_i915_private *i915 = to_i915(fb->base.dev); in calc_plane_aligned_offset()
1281 offset = intel_compute_aligned_offset(i915, x, y, &fb->base, color_plane, in calc_plane_aligned_offset()
1282 fb->base.pitches[color_plane], in calc_plane_aligned_offset()
1294 static void init_plane_view_dims(const struct intel_framebuffer *fb, int color_plane, in init_plane_view_dims() argument
1301 intel_tile_dims(&fb->base, color_plane, &dims->tile_width, &dims->tile_height); in init_plane_view_dims()
1305 plane_view_src_stride_tiles(const struct intel_framebuffer *fb, int color_plane, in plane_view_src_stride_tiles() argument
1308 return DIV_ROUND_UP(fb->base.pitches[color_plane], in plane_view_src_stride_tiles()
1309 dims->tile_width * fb->base.format->cpp[color_plane]); in plane_view_src_stride_tiles()
1313 plane_view_dst_stride_tiles(const struct intel_framebuffer *fb, int color_plane, in plane_view_dst_stride_tiles() argument
1316 if (intel_fb_needs_pot_stride_remap(fb)) { in plane_view_dst_stride_tiles()
1328 plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane, in plane_view_scanout_stride() argument
1332 struct drm_i915_private *i915 = to_i915(fb->base.dev); in plane_view_scanout_stride()
1341 return stride_tiles * tile_width * fb->base.format->cpp[color_plane]; in plane_view_scanout_stride()
1345 plane_view_width_tiles(const struct intel_framebuffer *fb, int color_plane, in plane_view_width_tiles() argument
1353 plane_view_height_tiles(const struct intel_framebuffer *fb, int color_plane, in plane_view_height_tiles() argument
1361 plane_view_linear_tiles(const struct intel_framebuffer *fb, int color_plane, in plane_view_linear_tiles() argument
1365 struct drm_i915_private *i915 = to_i915(fb->base.dev); in plane_view_linear_tiles()
1368 size = (y + dims->height) * fb->base.pitches[color_plane] + in plane_view_linear_tiles()
1369 x * fb->base.format->cpp[color_plane]; in plane_view_linear_tiles()
1385 static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_plane, in calc_plane_remap_info() argument
1390 struct drm_i915_private *i915 = to_i915(fb->base.dev); in calc_plane_remap_info()
1401 if (intel_fb_is_gen12_ccs_aux_plane(&fb->base, color_plane)) { in calc_plane_remap_info()
1405 plane_view_linear_tiles(fb, color_plane, dims, x, y)); in calc_plane_remap_info()
1410 plane_view_src_stride_tiles(fb, color_plane, dims)); in calc_plane_remap_info()
1412 plane_view_width_tiles(fb, color_plane, dims, x)); in calc_plane_remap_info()
1414 plane_view_height_tiles(fb, color_plane, dims, y)); in calc_plane_remap_info()
1422 plane_view_dst_stride_tiles(fb, color_plane, remap_info->height)); in calc_plane_remap_info()
1458 color_plane_info->mapping_stride = fb->base.pitches[color_plane]; in calc_plane_remap_info()
1470 if (intel_fb_needs_pot_stride_remap(fb) && in calc_plane_remap_info()
1471 intel_fb_is_ccs_modifier(fb->base.modifier)) in calc_plane_remap_info()
1476 dst_stride = plane_view_dst_stride_tiles(fb, color_plane, dst_stride); in calc_plane_remap_info()
1481 fb->base.format->cpp[color_plane]; in calc_plane_remap_info()
1483 plane_view_scanout_stride(fb, color_plane, tile_width, in calc_plane_remap_info()
1498 fb->base.format->cpp[color_plane], in calc_plane_remap_info()
1514 calc_plane_normal_size(const struct intel_framebuffer *fb, int color_plane, in calc_plane_normal_size() argument
1520 if (is_surface_linear(&fb->base, color_plane)) { in calc_plane_normal_size()
1521 tiles = plane_view_linear_tiles(fb, color_plane, dims, x, y); in calc_plane_normal_size()
1523 tiles = plane_view_src_stride_tiles(fb, color_plane, dims) * in calc_plane_normal_size()
1524 plane_view_height_tiles(fb, color_plane, dims, y); in calc_plane_normal_size()
1547 bool intel_fb_supports_90_270_rotation(const struct intel_framebuffer *fb) in intel_fb_supports_90_270_rotation() argument
1549 if (DISPLAY_VER(to_i915(fb->base.dev)) >= 13) in intel_fb_supports_90_270_rotation()
1552 return fb->base.modifier == I915_FORMAT_MOD_Y_TILED || in intel_fb_supports_90_270_rotation()
1553 fb->base.modifier == I915_FORMAT_MOD_Yf_TILED; in intel_fb_supports_90_270_rotation()
1556 static unsigned int intel_fb_min_alignment(const struct drm_framebuffer *fb) in intel_fb_min_alignment() argument
1558 struct drm_i915_private *i915 = to_i915(fb->dev); in intel_fb_min_alignment()
1565 if (!drm_plane_has_format(&plane->base, fb->format->format, fb->modifier)) in intel_fb_min_alignment()
1568 plane_min_alignment = plane->min_alignment(plane, fb, 0); in intel_fb_min_alignment()
1582 int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *fb) in intel_fill_fb_info() argument
1584 struct drm_i915_gem_object *obj = intel_fb_obj(&fb->base); in intel_fill_fb_info()
1588 int i, num_planes = fb->base.format->num_planes; in intel_fill_fb_info()
1591 intel_fb_view_init(i915, &fb->normal_view, I915_GTT_VIEW_NORMAL); in intel_fill_fb_info()
1594 intel_fb_supports_90_270_rotation(fb) && in intel_fill_fb_info()
1595 intel_fb_needs_pot_stride_remap(fb)); in intel_fill_fb_info()
1597 if (intel_fb_supports_90_270_rotation(fb)) in intel_fill_fb_info()
1598 intel_fb_view_init(i915, &fb->rotated_view, I915_GTT_VIEW_ROTATED); in intel_fill_fb_info()
1599 if (intel_fb_needs_pot_stride_remap(fb)) in intel_fill_fb_info()
1600 intel_fb_view_init(i915, &fb->remapped_view, I915_GTT_VIEW_REMAPPED); in intel_fill_fb_info()
1611 * Plane 2 of Render Compression with Clear Color fb modifier in intel_fill_fb_info()
1615 if (is_gen12_ccs_cc_plane(&fb->base, i)) { in intel_fill_fb_info()
1616 if (IS_ALIGNED(fb->base.offsets[i], PAGE_SIZE)) in intel_fill_fb_info()
1622 intel_fb_plane_dims(fb, i, &width, &height); in intel_fill_fb_info()
1624 ret = convert_plane_offset_to_xy(fb, i, width, &x, &y); in intel_fill_fb_info()
1628 init_plane_view_dims(fb, i, width, height, &view_dims); in intel_fill_fb_info()
1634 fb->normal_view.color_plane[i].x = x; in intel_fill_fb_info()
1635 fb->normal_view.color_plane[i].y = y; in intel_fill_fb_info()
1636 fb->normal_view.color_plane[i].mapping_stride = fb->base.pitches[i]; in intel_fill_fb_info()
1637 fb->normal_view.color_plane[i].scanout_stride = in intel_fill_fb_info()
1638 fb->normal_view.color_plane[i].mapping_stride; in intel_fill_fb_info()
1640 offset = calc_plane_aligned_offset(fb, i, &x, &y); in intel_fill_fb_info()
1642 if (intel_fb_supports_90_270_rotation(fb)) in intel_fill_fb_info()
1643 gtt_offset_rotated += calc_plane_remap_info(fb, i, &view_dims, in intel_fill_fb_info()
1645 &fb->rotated_view); in intel_fill_fb_info()
1647 if (intel_fb_needs_pot_stride_remap(fb)) in intel_fill_fb_info()
1648 gtt_offset_remapped += calc_plane_remap_info(fb, i, &view_dims, in intel_fill_fb_info()
1650 &fb->remapped_view); in intel_fill_fb_info()
1652 size = calc_plane_normal_size(fb, i, &view_dims, x, y); in intel_fill_fb_info()
1659 "fb too big for bo (need %llu bytes, have %zu bytes)\n", in intel_fill_fb_info()
1664 fb->min_alignment = intel_fb_min_alignment(&fb->base); in intel_fill_fb_info()
1673 struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_remap_gtt() local
1674 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in intel_plane_remap_gtt()
1676 int i, num_planes = fb->format->num_planes; in intel_plane_remap_gtt()
1690 drm_WARN_ON(&i915->drm, intel_fb_is_ccs_modifier(fb->modifier)); in intel_plane_remap_gtt()
1703 unsigned int hsub = i ? fb->format->hsub : 1; in intel_plane_remap_gtt()
1704 unsigned int vsub = i ? fb->format->vsub : 1; in intel_plane_remap_gtt()
1732 void intel_fb_fill_view(const struct intel_framebuffer *fb, unsigned int rotation, in intel_fb_fill_view() argument
1736 *view = fb->rotated_view; in intel_fb_fill_view()
1737 else if (intel_fb_needs_pot_stride_remap(fb)) in intel_fb_fill_view()
1738 *view = fb->remapped_view; in intel_fb_fill_view()
1740 *view = fb->normal_view; in intel_fb_fill_view()
1763 intel_fb_stride_alignment(const struct drm_framebuffer *fb, int color_plane) in intel_fb_stride_alignment() argument
1765 struct drm_i915_private *dev_priv = to_i915(fb->dev); in intel_fb_stride_alignment()
1768 if (is_surface_linear(fb, color_plane)) { in intel_fb_stride_alignment()
1770 fb->format->format, in intel_fb_stride_alignment()
1771 fb->modifier); in intel_fb_stride_alignment()
1777 if (fb->pitches[color_plane] > max_stride && in intel_fb_stride_alignment()
1778 !intel_fb_is_ccs_modifier(fb->modifier)) in intel_fb_stride_alignment()
1784 tile_width = intel_tile_width_bytes(fb, color_plane); in intel_fb_stride_alignment()
1785 if (intel_fb_is_ccs_modifier(fb->modifier)) { in intel_fb_stride_alignment()
1798 * require the entire fb to accommodate that to avoid in intel_fb_stride_alignment()
1802 color_plane == 0 && fb->width > 3840) in intel_fb_stride_alignment()
1811 const struct drm_framebuffer *fb = plane_state->hw.fb; in intel_plane_check_stride() local
1827 max_stride = plane->max_stride(plane, fb->format->format, in intel_plane_check_stride()
1828 fb->modifier, rotation); in intel_plane_check_stride()
1832 "[FB:%d] stride (%d) exceeds [PLANE:%d:%s] max stride (%d)\n", in intel_plane_check_stride()
1833 fb->base.id, stride, in intel_plane_check_stride()
1843 const struct intel_framebuffer *fb = in intel_plane_compute_gtt() local
1844 to_intel_framebuffer(plane_state->hw.fb); in intel_plane_compute_gtt()
1847 if (!fb) in intel_plane_compute_gtt()
1862 intel_fb_fill_view(fb, rotation, &plane_state->view); in intel_plane_compute_gtt()
1867 fb->base.width << 16, fb->base.height << 16, in intel_plane_compute_gtt()
1873 static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) in intel_user_framebuffer_destroy() argument
1875 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); in intel_user_framebuffer_destroy()
1877 drm_framebuffer_cleanup(fb); in intel_user_framebuffer_destroy()
1879 if (intel_fb_uses_dpt(fb)) in intel_user_framebuffer_destroy()
1884 intel_fb_bo_framebuffer_fini(intel_fb_obj(fb)); in intel_user_framebuffer_destroy()
1889 static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb, in intel_user_framebuffer_create_handle() argument
1893 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_user_framebuffer_create_handle()
1920 static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, in intel_user_framebuffer_dirty() argument
1926 struct drm_i915_gem_object *obj = intel_fb_obj(fb); in intel_user_framebuffer_dirty()
1927 struct intel_frontbuffer *front = to_intel_frontbuffer(fb); in intel_user_framebuffer_dirty()
1981 struct drm_framebuffer *fb = &intel_fb->base; in intel_framebuffer_init() local
2025 drm_helper_mode_fill_fb_struct(&dev_priv->drm, fb, mode_cmd); in intel_framebuffer_init()
2027 for (i = 0; i < fb->format->num_planes; i++) { in intel_framebuffer_init()
2036 stride_alignment = intel_fb_stride_alignment(fb, i); in intel_framebuffer_init()
2037 if (fb->pitches[i] & (stride_alignment - 1)) { in intel_framebuffer_init()
2040 i, fb->pitches[i], stride_alignment); in intel_framebuffer_init()
2044 if (intel_fb_is_gen12_ccs_aux_plane(fb, i)) { in intel_framebuffer_init()
2047 if (fb->pitches[i] != ccs_aux_stride) { in intel_framebuffer_init()
2051 fb->pitches[i], ccs_aux_stride); in intel_framebuffer_init()
2056 fb->obj[i] = intel_bo_to_drm_bo(obj); in intel_framebuffer_init()
2063 if (intel_fb_uses_dpt(fb)) { in intel_framebuffer_init()
2076 ret = drm_framebuffer_init(&dev_priv->drm, fb, &intel_fb_funcs); in intel_framebuffer_init()
2085 if (intel_fb_uses_dpt(fb)) in intel_framebuffer_init()
2099 struct drm_framebuffer *fb; in intel_user_framebuffer_create() local
2108 fb = intel_framebuffer_create(obj, &mode_cmd); in intel_user_framebuffer_create()
2111 return fb; in intel_user_framebuffer_create()