&pp->minw, &pp->minh,
&pp->maxw, &pp->maxh,
&pp->align);
+ tdm_display_get_pp_preferred_align_vertical(display, &pp->align_vertical);
err = tdm_display_get_pp_capabilities(display, &caps);
if (err == TDM_ERROR_NONE)
evh->pp_buffer_list = eina_list_remove(evh->pp_buffer_list, vbuf);
}
+static int
+_e_video_hwc_pp_gcd_get(int x, int y)
+{
+ int temp = 0;
+
+ while (y > 0)
+ {
+ temp = y;
+ y = x % y;
+ x = temp;
+ }
+
+ return x;
+}
+
+static void
+_e_video_hwc_pp_aligned_value_get(E_Video_Hwc *evh, int *aligned_width, int *aligned_height)
+{
+ int width_align = 0;
+
+ if (evh->pp->minw != -1)
+ {
+ if (evh->pp->minw > *aligned_width)
+ *aligned_width = evh->pp->minw;
+ }
+
+ if (evh->pp->minh != -1)
+ {
+ if (evh->pp->minh > *aligned_height)
+ *aligned_height = evh->pp->minh;
+ }
+
+ if (evh->pp->align > 0)
+ {
+ if (evh->output_align != -1)
+ {
+ if (evh->output_align >= evh->pp->align)
+ width_align = _e_video_hwc_pp_gcd_get(evh->output_align, evh->pp->align);
+ else
+ width_align = _e_video_hwc_pp_gcd_get(evh->pp->align, evh->output_align);
+
+ width_align = evh->output_align * evh->pp->align / width_align;
+ }
+ else
+ {
+ width_align = evh->pp->align;
+ }
+ }
+ else
+ {
+ if (evh->output_align != -1)
+ width_align = evh->output_align;
+ else
+ width_align = *aligned_width;
+ }
+
+ *aligned_width = ROUNDUP(*aligned_width, width_align);
+
+ if (evh->pp->align_vertical != -1)
+ *aligned_height = ROUNDUP(*aligned_height, evh->pp->align_vertical);
+
+}
+
static E_Comp_Wl_Video_Buf *
_e_video_hwc_pp_buffer_get(E_Video_Hwc *evh, int width, int height)
{
E_Comp_Wl_Video_Buf *vbuf;
Eina_List *l;
int i = 0;
- int aligned_width;
+ int aligned_width = width;
+ int aligned_height = height;
- if (evh->output_align != -1)
- aligned_width = ROUNDUP(width, evh->output_align);
- else
- aligned_width = width;
+ _e_video_hwc_pp_aligned_value_get(evh, &aligned_width, &aligned_height);
if (evh->pp_buffer_list)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(vbuf, NULL);
/* if we need bigger pp_buffers, destroy all pp_buffers and create */
- if (aligned_width > vbuf->width_from_pitch || height != vbuf->height)
+ if (aligned_width > vbuf->width_from_pitch || aligned_height != vbuf->height)
{
Eina_List *ll;
VIN("pp buffer changed: %dx%d => %dx%d", evh->ec,
vbuf->width_from_pitch, vbuf->height,
- aligned_width, height);
+ aligned_width, aligned_height);
EINA_LIST_FOREACH_SAFE(evh->pp_buffer_list, l, ll, vbuf)
{
{
for (i = 0; i < BUFFER_MAX_COUNT; i++)
{
- vbuf = e_comp_wl_video_buffer_alloc(aligned_width, height, evh->pp_tbmfmt, EINA_TRUE);
+ vbuf = e_comp_wl_video_buffer_alloc(aligned_width, aligned_height, evh->pp_tbmfmt, EINA_TRUE);
EINA_SAFETY_ON_NULL_RETURN_VAL(vbuf, NULL);
e_comp_wl_video_buffer_free_func_add(vbuf, _e_video_hwc_pp_buffer_cb_free, evh);
}
VIN("pp buffer created: %dx%d, %c%c%c%c", evh->ec,
- vbuf->width_from_pitch, height, FOURCC_STR(evh->pp_tbmfmt));
+ vbuf->width_from_pitch, aligned_height, FOURCC_STR(evh->pp_tbmfmt));
evh->next_buffer = evh->pp_buffer_list;
}