#include "e.h"
#include "services/e_service_quickpanel.h"
+#include <wayland-tbm-server.h>
EINTERN Eina_Bool
e_hwc_planes_init(void)
ep = e_output_fb_target_get(output);
EINA_SAFETY_ON_NULL_RETURN(ep);
- e_plane_external_unset(ep);
+ if (e_output_display_mode_get(hwc->output) == E_OUTPUT_DISPLAY_MODE_NONE)
+ e_plane_external_unset(ep);
/* remove mirror_dst list at the src_hwc */
src_hwc->mirror_dst_hwc = eina_list_remove(src_hwc->mirror_dst_hwc, hwc);
e_hwc_planes_presentation_update(E_Hwc *hwc, E_Client *ec)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
-#if 0
- if (overlay)
- {
- Eina_Bool video_layer = EINA_FALSE;
- tbm_format format;
- Eina_Bool need_pp = EINA_FALSE;
+ E_Plane *ep = NULL;
+ E_Comp_Wl_Buffer *wl_buffer = NULL;
+ tbm_surface_h tsurface = NULL;
+ Eina_Rectangle rect = {0, };
+ int width = 0;
+ int height = 0;
- E_EomBufferPtr eom_buff = _e_eom_buffer_create(eom_output, wl_buffer);
- EINA_SAFETY_ON_NULL_RETURN_VAL(eom_buff, ECORE_CALLBACK_PASS_ON);
+ ep = e_output_default_fb_target_get(hwc->output);
- format = tbm_surface_get_format(tbm_buffer);
- video_layer = _e_eom_output_video_layer_find(eom_output, format);
- if (!video_layer)
- {
- /* need pp */
- need_pp = EINA_TRUE;
- eom_output->need_overlay_pp = EINA_TRUE;
- if (!_e_eom_pp_init(eom_output))
- {
- EOERR("pp_init for overlay fail", eom_output->eout);
- _e_eom_buffer_destroy(eom_output, eom_buff);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
-
- if (need_pp)
- {
- if (eom_trace_debug)
- EOINF("run _e_eom_presentation_pp_run", eom_output->eout);
- _e_eom_presentation_pp_run(eom_output, tbm_buffer, eom_buff);
- }
- else
- {
- if (eom_trace_debug)
- EOINF("run direct show", eom_output->eout);
- _e_eom_layer_overlay_set(eom_output, tbm_buffer);
+ if (ec)
+ {
+ e_plane_ec_set(ep, ec);
+
+ /* update the target_buffer */
+ wl_buffer = e_pixmap_resource_get(ec->pixmap);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer->resource, EINA_FALSE);
+
+ tsurface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, wl_buffer->resource);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
+
+ ep->tsurface = tsurface;
+
+ e_output_size_get(hwc->output, &width, &height);
+ rect.x = 0;
+ rect.y = 0;
+ rect.w = width;
+ rect.h = height;
+ if (!e_plane_external_set(ep, &rect, E_OUTPUT_DISPLAY_MODE_PRESENTATION))
+ {
+ ERR("e_plane_presentation_set failed.");
+ return EINA_FALSE;
+ }
- if (!_e_eom_output_show(eom_output, tbm_buffer, _e_eom_tbm_buffer_release_ext_mod, eom_buff))
- {
- if (eom_trace_debug)
- {
- EOINF("===============> EXT ENDERR tbm_buff:%p", eom_output->eout, tbm_buffer);
- EOINF("_e_eom_add_buff_to_show fail tbm_buff:%p", eom_output->eout, tbm_buffer);
- }
- _e_eom_buffer_destroy(eom_output, eom_buff);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
+ e_comp_object_hwc_update_set(ec->frame, EINA_TRUE);
}
else
{
- E_Plane *ep = NULL;
-
- ep = e_output_default_fb_target_get(eom_output->eout);
-
- if (ep->prepare_ec)
- e_plane_ec_set(ep, ec);
-
- e_comp_object_hwc_update_set(ec->frame, EINA_TRUE);
+ e_plane_ec_set(ep, NULL);
+ e_plane_external_unset(ep);
}
-#endif
return EINA_TRUE;
}
tbm_surface_h tsurface = NULL;
tdm_error ret = TDM_ERROR_NONE;
E_Plane *plane_primary_output_fb = NULL;
+ int w, h;
if (plane->display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
{
if ((tbm_surface_get_width(tsurface) <= 1) || (tbm_surface_get_height(tsurface) <= 1))
return NULL;
+
+ e_output_size_get(plane->output, &w, &h);
+ if (w == 0 || h == 0)
+ return NULL;
+
+ if (tbm_surface_get_width(tsurface) != w || tbm_surface_get_height(tsurface) != h)
+ return NULL;
+
+ return plane->tsurface;
}
else
return NULL;
tbm_error_e tbm_err = TBM_ERROR_NONE;
tdm_error tdm_err = TDM_ERROR_NONE;
tbm_surface_h tsurface = data->tsurface;
+ tdm_pos pos = {0, };
if (plane_trace_debug)
ELOGF("E_PLANE", "PP Commit Plane(%p) zpos(%d) tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)",
return EINA_FALSE;
}
+ pos.w = tbm_surface_get_width(pp_tsurface);
+ pos.h = tbm_surface_get_height(pp_tsurface);
+ tdm_helper_clear_buffer_color(pp_tsurface, &pos, 0xff000000);
+
if (!_e_plane_pp_info_set(plane, pp_tsurface))
{
ERR("fail _e_plane_pp_info_set");
Eina_Rectangle src_crop = {0, };
Eina_Rectangle dst_crop = {0, };
int rotate = 0;
+ tdm_pos pos = {0, };
if (plane_trace_debug)
ELOGF("E_PLANE", "PP Convert Commit Plane(%p) zpos(%d) tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)",
return EINA_FALSE;
}
+ pos.w = tbm_surface_get_width(dst_tsurface);
+ pos.h = tbm_surface_get_height(dst_tsurface);
+ tdm_helper_clear_buffer_color(dst_tsurface, &pos, 0xff000000);
+
src_vbuf = e_comp_wl_video_buffer_create_tbm(src_tsurface);
if (src_vbuf == NULL)
{
if (plane->wait_commit)
return EINA_FALSE;
- if (plane->is_external)
- {
- tsurface = _e_plane_external_surface_acquire(plane);
- }
- else if (plane->is_fb && !plane->ec)
+ if (plane->is_fb && !plane->ec)
{
if (_e_plane_fb_target_pending_commit_sync_check(plane))
return EINA_FALSE;
int w, h;
EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(plane->pp_tqueue, EINA_FALSE);
data = e_plane_commit_data_aquire(plane);
if (!data) return EINA_TRUE;
}
else /* plane->display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR */
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(plane->pp_tqueue, EINA_FALSE);
+
if (!tbm_surface_queue_can_dequeue(plane->pp_tqueue, 0))
{
if (plane_trace_debug)
plane->mirror_rect.w = rect->w;
plane->mirror_rect.h = rect->h;
- if (plane->display_mode == E_OUTPUT_DISPLAY_MODE_NONE)
+ if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
{
+ if (plane->display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
+ {
+ DBG("already mirror mode");
+ return EINA_TRUE;
+ }
ret = e_plane_zoom_set(plane, &plane->mirror_rect);
EINA_SAFETY_ON_FALSE_RETURN_VAL(ret == EINA_TRUE, EINA_FALSE);
}
- else if (plane->display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
- _e_plane_pp_pending_data_remove(plane);
+ else if (display_mode == E_OUTPUT_DISPLAY_MODE_PRESENTATION)
+ {
+ if (plane->display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
+ {
+ _e_plane_pp_pending_data_remove(plane);
+ e_plane_zoom_unset(plane);
+ }
+ }
plane->display_mode = display_mode;