/* * struct dpu_media_color_map - maps drm format to media format * @format: DRM base pixel format * @color: Media API color related to DRM format
*/ struct dpu_media_color_map {
uint32_t format;
uint32_t color;
};
/* _dpu_get_v_h_subsample_rate - Get subsample rates for all formats we support * Note: Not using the drm_format_*_subsampling since we have formats
*/ staticvoid _dpu_get_v_h_subsample_rate( enum mdp_chroma_samp_type chroma_sample,
uint32_t *v_sample,
uint32_t *h_sample)
{ if (!v_sample || !h_sample) return;
color = _dpu_format_get_media_color_ubwc(fmt); if (color < 0) {
DRM_ERROR("UBWC format not supported for fmt: %p4cc\n",
&fmt->pixel_format); return -EINVAL;
}
/* * linear format: allow user allocated pitches if they are greater than * the requirement. * ubwc format: pitch values are computed uniformly across * all the components based on ubwc specifications.
*/ for (i = 0; i < layout->num_planes && i < DPU_MAX_PLANES; ++i) { if (layout->plane_pitch[i] <= fb->pitches[i]) {
layout->plane_pitch[i] = fb->pitches[i];
} else {
DRM_DEBUG("plane %u expected pitch %u, fb %u\n",
i, layout->plane_pitch[i], fb->pitches[i]); return -EINVAL;
}
}
for (i = 0; i < DPU_MAX_PLANES; i++)
layout->total_size += layout->plane_size[i];
return 0;
}
/** * dpu_format_populate_plane_sizes - populate non-address part of the layout based on * fb, and format found in the fb * @fb: framebuffer pointer * @layout: format layout structure to populate * * Return: error code on failure or 0 if new addresses were populated
*/ int dpu_format_populate_plane_sizes( struct drm_framebuffer *fb, struct dpu_hw_fmt_layout *layout)
{ conststruct msm_format *fmt;
if (!layout || !fb) {
DRM_ERROR("invalid pointer\n"); return -EINVAL;
}
if (fb->width > DPU_MAX_IMG_WIDTH ||
fb->height > DPU_MAX_IMG_HEIGHT) {
DRM_ERROR("image dimensions outside max range\n"); return -ERANGE;
}
fmt = msm_framebuffer_format(fb);
if (MSM_FORMAT_IS_UBWC(fmt) || MSM_FORMAT_IS_TILE(fmt)) return _dpu_format_populate_plane_sizes_ubwc(fmt, fb, layout);
/* Populate addresses for simple formats here */ for (i = 0; i < layout->num_planes; ++i)
layout->plane_addr[i] = msm_framebuffer_iova(fb, i);
}
/** * dpu_format_populate_addrs - populate buffer addresses based on * mmu, fb, and format found in the fb * @fb: framebuffer pointer * @layout: format layout structure to populate
*/ void dpu_format_populate_addrs(struct drm_framebuffer *fb, struct dpu_hw_fmt_layout *layout)
{ conststruct msm_format *fmt;
fmt = msm_framebuffer_format(fb);
/* Populate the addresses given the fb */ if (MSM_FORMAT_IS_UBWC(fmt) ||
MSM_FORMAT_IS_TILE(fmt))
_dpu_format_populate_addrs_ubwc(fb, layout); else
_dpu_format_populate_addrs_linear(fb, layout);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.