summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Andresov <v.andresov@partner.samsung.com>2017-10-05 17:12:21 +0300
committerVladislav Andresov <v.andresov@partner.samsung.com>2017-10-26 18:49:58 +0300
commite87e8ba5c636d06fafa4af19914dbdf450b33ecb (patch)
tree750d3ade94ae720e33d98027a4f45c871a082059
parentec887d48ade43b19757d9771e99ed695176a6b2f (diff)
downloademulator-yagl-e87e8ba5c636d06fafa4af19914dbdf450b33ecb.tar.gz
emulator-yagl-e87e8ba5c636d06fafa4af19914dbdf450b33ecb.tar.bz2
emulator-yagl-e87e8ba5c636d06fafa4af19914dbdf450b33ecb.zip
YAGL: Add hardware conversion for YUV420 formatsubmit/tizen/20171128.094631accepted/tizen/unified/20171130.063224
Change-Id: Icf94edd832657527f940c0815653f0365e47d166 Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
-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);
}