Lines Matching full:layout
100 struct dpu_hw_fmt_layout *layout) in _dpu_format_get_plane_sizes_ubwc() argument
106 memset(layout, 0, sizeof(struct dpu_hw_fmt_layout)); in _dpu_format_get_plane_sizes_ubwc()
107 layout->format = fmt; in _dpu_format_get_plane_sizes_ubwc()
108 layout->width = width; in _dpu_format_get_plane_sizes_ubwc()
109 layout->height = height; in _dpu_format_get_plane_sizes_ubwc()
110 layout->num_planes = fmt->num_planes; in _dpu_format_get_plane_sizes_ubwc()
119 if (MSM_FORMAT_IS_YUV(layout->format)) { in _dpu_format_get_plane_sizes_ubwc()
124 layout->num_planes = 2; in _dpu_format_get_plane_sizes_ubwc()
125 layout->plane_pitch[0] = VENUS_Y_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
127 layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] * in _dpu_format_get_plane_sizes_ubwc()
130 layout->plane_pitch[1] = VENUS_UV_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
132 layout->plane_size[1] = MSM_MEDIA_ALIGN(layout->plane_pitch[1] * in _dpu_format_get_plane_sizes_ubwc()
138 layout->num_planes += 2; in _dpu_format_get_plane_sizes_ubwc()
139 layout->plane_pitch[2] = VENUS_Y_META_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
141 layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] * in _dpu_format_get_plane_sizes_ubwc()
144 layout->plane_pitch[3] = VENUS_UV_META_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
146 layout->plane_size[3] = MSM_MEDIA_ALIGN(layout->plane_pitch[3] * in _dpu_format_get_plane_sizes_ubwc()
152 layout->num_planes = 1; in _dpu_format_get_plane_sizes_ubwc()
154 layout->plane_pitch[0] = VENUS_RGB_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
156 layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] * in _dpu_format_get_plane_sizes_ubwc()
161 layout->num_planes += 2; in _dpu_format_get_plane_sizes_ubwc()
162 layout->plane_pitch[2] = VENUS_RGB_META_STRIDE(color, width); in _dpu_format_get_plane_sizes_ubwc()
164 layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] * in _dpu_format_get_plane_sizes_ubwc()
170 layout->total_size += layout->plane_size[i]; in _dpu_format_get_plane_sizes_ubwc()
179 struct dpu_hw_fmt_layout *layout, in _dpu_format_get_plane_sizes_linear() argument
184 memset(layout, 0, sizeof(struct dpu_hw_fmt_layout)); in _dpu_format_get_plane_sizes_linear()
185 layout->format = fmt; in _dpu_format_get_plane_sizes_linear()
186 layout->width = width; in _dpu_format_get_plane_sizes_linear()
187 layout->height = height; in _dpu_format_get_plane_sizes_linear()
188 layout->num_planes = fmt->num_planes; in _dpu_format_get_plane_sizes_linear()
192 layout->num_planes = 1; in _dpu_format_get_plane_sizes_linear()
193 layout->plane_size[0] = width * height * layout->format->bpp; in _dpu_format_get_plane_sizes_linear()
194 layout->plane_pitch[0] = width * layout->format->bpp; in _dpu_format_get_plane_sizes_linear()
212 layout->plane_pitch[0] = width * bpp; in _dpu_format_get_plane_sizes_linear()
213 layout->plane_pitch[1] = layout->plane_pitch[0] / h_subsample; in _dpu_format_get_plane_sizes_linear()
214 layout->plane_size[0] = layout->plane_pitch[0] * height; in _dpu_format_get_plane_sizes_linear()
215 layout->plane_size[1] = layout->plane_pitch[1] * in _dpu_format_get_plane_sizes_linear()
219 layout->num_planes = 2; in _dpu_format_get_plane_sizes_linear()
220 layout->plane_size[1] *= 2; in _dpu_format_get_plane_sizes_linear()
221 layout->plane_pitch[1] *= 2; in _dpu_format_get_plane_sizes_linear()
224 layout->num_planes = 3; in _dpu_format_get_plane_sizes_linear()
225 layout->plane_size[2] = layout->plane_size[1]; in _dpu_format_get_plane_sizes_linear()
226 layout->plane_pitch[2] = layout->plane_pitch[1]; in _dpu_format_get_plane_sizes_linear()
236 for (i = 0; i < layout->num_planes && i < DPU_MAX_PLANES; ++i) { in _dpu_format_get_plane_sizes_linear()
237 if (pitches && layout->plane_pitch[i] < pitches[i]) in _dpu_format_get_plane_sizes_linear()
238 layout->plane_pitch[i] = pitches[i]; in _dpu_format_get_plane_sizes_linear()
242 layout->total_size += layout->plane_size[i]; in _dpu_format_get_plane_sizes_linear()
251 struct dpu_hw_fmt_layout *layout, in dpu_format_get_plane_sizes() argument
254 if (!layout || !fmt) { in dpu_format_get_plane_sizes()
265 return _dpu_format_get_plane_sizes_ubwc(fmt, w, h, layout); in dpu_format_get_plane_sizes()
267 return _dpu_format_get_plane_sizes_linear(fmt, w, h, layout, pitches); in dpu_format_get_plane_sizes()
273 struct dpu_hw_fmt_layout *layout) in _dpu_format_populate_addrs_ubwc() argument
278 if (!fb || !layout) { in _dpu_format_populate_addrs_ubwc()
290 meta = MSM_FORMAT_IS_UBWC(layout->format); in _dpu_format_populate_addrs_ubwc()
293 if (MSM_FORMAT_IS_YUV(layout->format)) { in _dpu_format_populate_addrs_ubwc()
315 layout->plane_addr[0] = base_addr + layout->plane_size[2]; in _dpu_format_populate_addrs_ubwc()
318 layout->plane_addr[1] = base_addr + layout->plane_size[0] in _dpu_format_populate_addrs_ubwc()
319 + layout->plane_size[2] + layout->plane_size[3]; in _dpu_format_populate_addrs_ubwc()
325 layout->plane_addr[2] = base_addr; in _dpu_format_populate_addrs_ubwc()
328 layout->plane_addr[3] = base_addr + layout->plane_size[0] in _dpu_format_populate_addrs_ubwc()
329 + layout->plane_size[2]; in _dpu_format_populate_addrs_ubwc()
349 layout->plane_addr[0] = base_addr + layout->plane_size[2]; in _dpu_format_populate_addrs_ubwc()
350 layout->plane_addr[1] = 0; in _dpu_format_populate_addrs_ubwc()
355 layout->plane_addr[2] = base_addr; in _dpu_format_populate_addrs_ubwc()
356 layout->plane_addr[3] = 0; in _dpu_format_populate_addrs_ubwc()
364 struct dpu_hw_fmt_layout *layout) in _dpu_format_populate_addrs_linear() argument
369 for (i = 0; i < layout->num_planes; ++i) { in _dpu_format_populate_addrs_linear()
370 if (layout->plane_pitch[i] > fb->pitches[i]) { in _dpu_format_populate_addrs_linear()
372 i, layout->plane_pitch[i], fb->pitches[i]); in _dpu_format_populate_addrs_linear()
378 for (i = 0; i < layout->num_planes; ++i) { in _dpu_format_populate_addrs_linear()
380 layout->plane_addr[i] = in _dpu_format_populate_addrs_linear()
382 if (!layout->plane_addr[i]) { in _dpu_format_populate_addrs_linear()
394 struct dpu_hw_fmt_layout *layout) in dpu_format_populate_layout() argument
398 if (!fb || !layout) { in dpu_format_populate_layout()
409 layout->format = msm_framebuffer_format(fb); in dpu_format_populate_layout()
412 ret = dpu_format_get_plane_sizes(layout->format, fb->width, fb->height, in dpu_format_populate_layout()
413 layout, fb->pitches); in dpu_format_populate_layout()
418 if (MSM_FORMAT_IS_UBWC(layout->format) || in dpu_format_populate_layout()
419 MSM_FORMAT_IS_TILE(layout->format)) in dpu_format_populate_layout()
420 ret = _dpu_format_populate_addrs_ubwc(aspace, fb, layout); in dpu_format_populate_layout()
422 ret = _dpu_format_populate_addrs_linear(aspace, fb, layout); in dpu_format_populate_layout()
434 struct dpu_hw_fmt_layout layout; in dpu_format_check_modified_format() local
448 &layout, cmd->pitches); in dpu_format_check_modified_format()
461 if (bos_total_size < layout.total_size) { in dpu_format_check_modified_format()
463 bos_total_size, layout.total_size); in dpu_format_check_modified_format()