summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--EGL/yagl_onscreen_image_tizen_sfc.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/EGL/yagl_onscreen_image_tizen_sfc.c b/EGL/yagl_onscreen_image_tizen_sfc.c
index 3a33a79..09e6c76 100644
--- a/EGL/yagl_onscreen_image_tizen_sfc.c
+++ b/EGL/yagl_onscreen_image_tizen_sfc.c
@@ -156,16 +156,20 @@ static void yagl_onscreen_image_tizen_sfc_update(struct yagl_image *image)
struct yagl_onscreen_image_tizen_sfc *tizen_sfc_image =
(struct yagl_onscreen_image_tizen_sfc *)image;
+ tbm_bo bo;
+ struct vigs_drm_surface *src;
+ int ret;
+
YAGL_LOG_FUNC_SET(yagl_onscreen_image_tizen_sfc_update);
if (!tizen_sfc_image->need_convert) {
return;
}
- if (tizen_sfc_image->format == TBM_FORMAT_ARGB8888) {
- tbm_bo bo = tbm_surface_internal_get_bo(tizen_sfc_image->sfc, 0);
- struct vigs_drm_surface *src = bo ? tbm_backend_get_bo_priv(bo) : NULL;
- int ret;
+ switch (tizen_sfc_image->format) {
+ case TBM_FORMAT_ARGB8888:
+ bo = tbm_surface_internal_get_bo(tizen_sfc_image->sfc, 0);
+ src = bo ? tbm_backend_get_bo_priv(bo) : NULL;
/*
* No actual format conversion in ARGB8888 case. We just need to
@@ -183,11 +187,30 @@ static void yagl_onscreen_image_tizen_sfc_update(struct yagl_image *image)
YAGL_LOG_ERROR("vigs_drm_surface_convert failed %s\n", strerror(-ret));
- /*
- * Fallback to software converson in case of error.
- */
+ break;
+ case TBM_FORMAT_YUV420:
+ bo = tbm_surface_internal_get_bo(tizen_sfc_image->sfc, 0);
+ src = bo ? tbm_backend_get_bo_priv(bo) : NULL;
+
+ ret = vigs_drm_surface_convert(src,
+ DRM_FORMAT_YUV420,
+ tizen_sfc_image->drm_sfc,
+ DRM_FORMAT_ARGB8888,
+ false);
+
+ if (ret == 0) {
+ return;
+ }
+
+ YAGL_LOG_ERROR("vigs_drm_surface_convert failed %s\n", strerror(-ret));
+
+ break;
}
+ /*
+ * Fallback to software converson in case of error or unsupported format
+ */
+
yagl_onscreen_image_tizen_sfc_convert(tizen_sfc_image);
}