platform/adaptation/emulator/emulator-yagl.git
2 years agobuild: Remove BuildRequires libtbm-vigs 44/276644/1 accepted/tizen/unified/20220624.143341 submit/tizen/20220624.075503
Changyeon Lee [Wed, 22 Jun 2022 10:24:14 +0000 (19:24 +0900)]
build: Remove BuildRequires libtbm-vigs

libtbm-vigs dependency is removed

Change-Id: I3a7e9dfe5197e55dcdb4e2427eb6b9e1cc1cbcb0

2 years agobuild: use /hal/lib64 runpath for x86_64 84/275184/1 accepted/tizen/unified/20220524.050411 submit/tizen/20220518.032136
byungchul.so [Mon, 9 May 2022 06:50:08 +0000 (15:50 +0900)]
build: use /hal/lib64 runpath for x86_64

Change-Id: Icaee3d90e2e0be7c796d3a361e816afdbd1a171f

2 years agoVersion Up 06/273306/1 accepted/tizen/unified/20220412.100116 submit/tizen/20220404.025520
byungchul.so [Fri, 1 Apr 2022 05:58:10 +0000 (14:58 +0900)]
Version Up

Change-Id: I04eb71341b57c8fdd04f7955055c401d588017de

2 years agoLogger: Enable dlog logging and log messages in one line 32/268832/1 accepted/tizen/unified/20220107.120835 submit/tizen/20220107.012650
Lukasz Kostyra [Tue, 16 Feb 2021 07:23:30 +0000 (08:23 +0100)]
Logger: Enable dlog logging and log messages in one line

Change-Id: I596372e265a1d679b294306fb692ec94bb00cbc7

2 years agoInvoke yagl_gles2_context_prepare_framebuffer in glClear for GLESv2/GLESv3 42/268342/1 accepted/tizen/unified/20211227.122832 submit/tizen/20211224.014123
byungchul.so [Mon, 13 Dec 2021 04:03:33 +0000 (13:03 +0900)]
Invoke yagl_gles2_context_prepare_framebuffer in glClear for GLESv2/GLESv3

- glClear can be used to clear entire framebuffer. Therefore invoke
  yagl_gles2_context_prepare_framebuffer in glClear for GLESv2/GLESv3
  to write back clear result if the fb is binded with texture that
  targets from an eglimage.

Change-Id: I591bdb1a6ebfd36afc948a070dd25089fed5be60

2 years agoSupport offscreen rendering for TBM_FORMAT_ARGB8888 tbm buffer 41/268341/1
byungchul.so [Mon, 13 Dec 2021 03:05:48 +0000 (12:05 +0900)]
Support offscreen rendering for TBM_FORMAT_ARGB8888 tbm buffer

- Assume below events:

  ...
  // Use TBM_FORMAT_ARGB8888 tbm buffer for offscreen rendering. The tbm buffer is used as
  // native buffer for an eglImage and the texture binded with the eglImage is attached to
  // framebuffer object.
  tbm_buffer = tbm_surface_create(w, h, TBM_FORMAT_ARGB8888);
  EvasGLImage *evas_image = evasglCreateImageForContext(evas_gl, evas_gl_ctx,
  EVAS_GL_NATIVE_SURFACE_TIZEN, tbm_surface, attrs);
  glGenTextures(1, &texture);
  glBindTexture(GL_TEXTURE_2D, texture);
  glEvasGLImageTargetTexture2DOES(GL_TEXTURE_2D, evas_image);
  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);

  Rendering something here...

  // Bind default framebuffer after rendering...
  glBindFramebuffer(GL_FRAMEBUFFER, old_framebuffer);
  ...

- The TBM_FORMAT_ARGB8888 tbm buffer should have rendering result after
  finishing rendering but it's not because offscreen rendering for TBM_FORMAT_ARGB8888
  tbm buffer not supported yet in the YAGL. This patch fixes this issue.

Change-Id: I0af2253e9d69fd20b45280a4c3380e5da1488d2a

2 years agoyagl_glsl_state: Prevent division by zero in yagl_glsl_state_pp_solve_binary 64/265964/1 accepted/tizen/unified/20211103.121806 submit/tizen/20211103.073433
Lukasz Kostyra [Tue, 2 Nov 2021 10:21:19 +0000 (11:21 +0100)]
yagl_glsl_state: Prevent division by zero in yagl_glsl_state_pp_solve_binary

Resolves coverity issue CID 1241990

Change-Id: Ie60284afee63a108d9b2f10ffc07e9cc04363909

3 years agoyagl_gles3_program: Prevent buffer overflow 82/265482/1 accepted/tizen/unified/20211028.122217 submit/tizen/20211026.234207
Lukasz Kostyra [Wed, 20 Oct 2021 09:31:15 +0000 (11:31 +0200)]
yagl_gles3_program: Prevent buffer overflow

Fixes defects WGID 467867 and WGID 467868

Change-Id: I03fca7c5af1d52b6f644c4517e09ee2e931d51c7

3 years agoyagl_gles3_program: Replace strcpy with strncpy for safety 34/265434/3
Lukasz Kostyra [Tue, 19 Oct 2021 09:17:03 +0000 (11:17 +0200)]
yagl_gles3_program: Replace strcpy with strncpy for safety

Fixes defect WGID 443657

Change-Id: I0c57b2b7f23175e218d17dce6320af51550f238b

3 years agoyagl_gles1_calls: Remove useless condition check in glPointParameter* 76/265376/1
Lukasz Kostyra [Fri, 15 Oct 2021 12:13:11 +0000 (14:13 +0200)]
yagl_gles1_calls: Remove useless condition check in glPointParameter*

Fixes defect WGID 443651

Change-Id: Ia5ffab9da9f2cde329e94813bc1a6ff9315437a2

3 years agoyagl_log: Replace strcat with strncat in yagl_log_func_enter_split 75/265375/1
Lukasz Kostyra [Fri, 15 Oct 2021 11:41:13 +0000 (13:41 +0200)]
yagl_log: Replace strcat with strncat in yagl_log_func_enter_split

Fixes defects WGID 106406 and WGID 289901

Change-Id: I01ff4890be3a803be476d1f01025e66222eec122

3 years agoyagl_tizen_window: Fix potential NULL dereference 74/265374/1
Lukasz Kostyra [Fri, 15 Oct 2021 11:11:48 +0000 (13:11 +0200)]
yagl_tizen_window: Fix potential NULL dereference

Fixes defect WGID 443650

Change-Id: I78718e64ef45510a0872062a7812c3aec4b9860f

3 years agoyagl_tizen_native_image: Fix potential NULL dereference 73/265373/1
Lukasz Kostyra [Fri, 15 Oct 2021 10:24:58 +0000 (12:24 +0200)]
yagl_tizen_native_image: Fix potential NULL dereference

Defect WGID 443637

Change-Id: I785a6c56bcfb5562303c7de1b87fa82e1994dac3

3 years agoyagl_glsl_parser: Fix invalid placement of set_last_sampler_array_count 27/265027/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211028.093639 accepted/tizen/unified/20211008.014737 submit/tizen/20211007.231031 submit/tizen_6.5/20211028.161501 tizen_6.5.m2_release
Lukasz Kostyra [Thu, 7 Oct 2021 08:19:24 +0000 (10:19 +0200)]
yagl_glsl_parser: Fix invalid placement of set_last_sampler_array_count

When parsing non-array uniforms, there was a possibility that a parsed
uniform was not a sampler. Despite that, set_last_sampler_array_count
was called, which could trigger an assertion.

This fixes boot issues on wearable image, as wearable image EFL was
using some shaders exploiting this corner case.

Change-Id: Icf3363f6c6622047ecbafa68a68e3bbc385e1471

3 years agoyagl_glsl_parser: Fix support for uniform arrays 88/264988/1 accepted/tizen/unified/20211007.052005 submit/tizen/20211007.015901
Lukasz Kostyra [Wed, 6 Oct 2021 12:08:08 +0000 (14:08 +0200)]
yagl_glsl_parser: Fix support for uniform arrays

Uniform arrays were incorrectly processed by GLSL ES parser, which in
some situations resulted in shader compilation errors. Uniform array
support has been added and sampler replacement code has been slightly
adjusted to read amount of sampler units from shader code.

Note that this only fixes shader parsing code to allow successful
compilation of shaders. This does NOT yet add full support for
samplerExternalOES uniform arrays for GLES 2 and above.

Change-Id: I24ead4473eb51e3e9d13b39fd98186763c6a5384

3 years agoyagl_glsl_state: Early exit on cleanup when Shader was not initialized 73/262673/1 accepted/tizen/unified/20210820.101815 submit/tizen/20210818.223105
Lukasz Kostyra [Tue, 17 Aug 2021 11:26:08 +0000 (13:26 +0200)]
yagl_glsl_state: Early exit on cleanup when Shader was not initialized

There might be situations like:
  glCreateShader(shader, ...);
  glDestroyShader(shader);

This would crash since yagl_glsl_state is initialized only when
glShaderSource() is called. Situation is now fixed.

This fixes gl-getshadersource WebGL browser test.

Change-Id: Icd8fa28bc1866f4f6cd3f199fb5a8ad724d71573
Signed-off-by: Lukasz Kostyra <l.kostyra@samsung.com>
3 years agoPrevent an out of array bounds access in yagl_glsl_state_pp_condition_parse_add_op() 84/258584/2 accepted/tizen/unified/20210531.130418 submit/tizen/20210526.012442
Sylwester Nawrocki [Thu, 20 May 2021 15:50:41 +0000 (17:50 +0200)]
Prevent an out of array bounds access in yagl_glsl_state_pp_condition_parse_add_op()

While moving higher or equal priority operations to expression stack in
yagl_glsl_state_pp_condition_parse_add_op function the state->pp_ops
array could be accessed with index -1. Reorder the while() expression
to avoid an out of array bounds access. This fixes an issue indicated
with SVACE warning:

* OVERFLOW_UNDER_CHECK: Buffer 'state->pp_ops' of size 64 accessed at
 yagl_glsl_state.c:640 can overflow, since its index 'state->pp_current_op
 - 1' can have value -1 that is out of range, as indicated by preceding
 conditional expression at yagl_glsl_state.c:640.

  [overflow] overflow at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640
  [check: Sub] Sub at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640
  [declaration] Shift at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640

Change-Id: I2cb6a16ce6c3302f8a2dd4fe92bd8bfbec11c5ca
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agoMerge "EGL: erase libtbm-vigs dependency" into tizen accepted/tizen/unified/20210330.111254 submit/tizen/20210329.075523
byungchul so [Mon, 29 Mar 2021 07:43:24 +0000 (07:43 +0000)]
Merge "EGL: erase libtbm-vigs dependency" into tizen

3 years agoEGL: erase libtbm-vigs dependency 87/256087/1
Junkyeong Kim [Mon, 29 Mar 2021 07:31:28 +0000 (16:31 +0900)]
EGL: erase libtbm-vigs dependency

use libhal-backend-tbm-vigs only.

Change-Id: Ide48f8395dab329f300044dcd0b8dd2ee6bc8522
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
3 years agoEGL: Fix linking issue to add runpath for accessing /hal/lib path 97/255997/1
Chanwoo Choi [Fri, 26 Mar 2021 08:56:55 +0000 (17:56 +0900)]
EGL: Fix linking issue to add runpath for accessing /hal/lib path

On Tizen 6.5, the install path of hal backend is changed
from /usr/lib to /hal/lib. In order to fix this linking issue,
add the runpath option for accessing /hal/lib path.

Change-Id: I04d9872d795091c560ace11c28e19b17a9c58fa7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoEGL: use libhal-backend-tbm-vigs 84/254584/3 accepted/tizen/unified/20210312.184240 submit/tizen/20210312.004154
Junkyeong Kim [Fri, 5 Mar 2021 02:26:23 +0000 (11:26 +0900)]
EGL: use libhal-backend-tbm-vigs

Change-Id: I567abfab3dff0306d61476c0fc95f09c24ddfcda
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
3 years agoGLSL parser: Rework precision qualifier patching 93/253693/1 accepted/tizen/unified/20210222.114534 submit/tizen/20210222.040422
Lukasz Kostyra [Tue, 16 Feb 2021 13:34:24 +0000 (14:34 +0100)]
GLSL parser: Rework precision qualifier patching

Since precision qualifiers can be used in multiple places (or can be
provided using preprocessor), they are now handled by adding following
statements to shader header (if needed):
    #define highp
    #define mediump
    #define lowp

Parser has been adjusted to pass forward precision qualifiers instead of
patching them.

Change-Id: I002fb62b7ddee0d00a81a60f6b082694c2f9653e

3 years agoKeep sampler information with Program object & cleanup 12/252112/1 accepted/tizen/unified/20210125.073655 submit/tizen/20210125.002716 submit/tizen_6.0/20210125.002404
Lukasz Kostyra [Fri, 22 Jan 2021 16:12:16 +0000 (17:12 +0100)]
Keep sampler information with Program object & cleanup

GL/GLES specification allows (and recommends) following sequence of
events:
  glAttachShader(); glAttachShader();
  glLinkProgram();
  glDetachShader(); glDetachShader();
  glDeleteShader(); glDeleteShader();

This makes program->vertex_shader and program->fragment_shader NULL
and forgoes any information regarding sampler types, which was used
for pre/post draw calls and TEXTURE_EXTERNAL_OES support. This
information is now cached in program object and all further actions
related to them refer to these cached copies.

Additional:
* Assume sampler uniform value to be 0 (as per GLES spec)
* Adjust some logging and cleanup code
* glTexParameter* functions are now recognizing TEXTURE_EXTERNAL_OES
  target and react accordingly
* glGetActiveUniform() returns correct type of uniform to user if
  uniform type is samplerExternalOES

Change-Id: Ib5f35730dd9f2f0139780a735ea8ec4f7ba84609

3 years agoReplace vertex shader external textures & fix some issues 12/252012/1
Lukasz Kostyra [Thu, 21 Jan 2021 17:49:50 +0000 (18:49 +0100)]
Replace vertex shader external textures & fix some issues

Vertex shader, just like fragment shader, has access to samplers.
This patch enables rebinding textures used in vertex shader, which
could be of type samplerExternalOES.

Additional issues fixed:
* Shader Program could be vertex-only. This caused crashes, which
  are now fixed.
* Condition resolution in GLSL parser was incorrect and has been fixed

Change-Id: I2c30b1c30ae9d75467e2c6dd4f4e128adc630320

3 years agoRecognize preprocessor functions in GLSL code 89/251689/1
Lukasz Kostyra [Mon, 18 Jan 2021 11:34:14 +0000 (12:34 +0100)]
Recognize preprocessor functions in GLSL code

On some situations preprocessor code can contain functions.
For now this code is recognized and ignored in order to not produce
syntax errors.

Change-Id: I1e80fc4f07a39dac1c112b7816efb0a813d091f9

3 years agoCleanup GLSL parser/lexer code 88/251688/1
Lukasz Kostyra [Fri, 15 Jan 2021 13:18:34 +0000 (14:18 +0100)]
Cleanup GLSL parser/lexer code

* Improved precision qualifier flushing
* Clarified shift/reduce ambiguities
* Removed deprecated %name_prefix directive warning

Change-Id: Ib740538a67e6f5e6a13a8e35b2caae51874636fa

3 years agoAdd GLSL lexer/parser support for uniform arrays 87/251687/1
Lukasz Kostyra [Fri, 15 Jan 2021 12:09:12 +0000 (13:09 +0100)]
Add GLSL lexer/parser support for uniform arrays

Using uniform arrays caused syntax error. GLSL lexer/parser now
understands these statements.

Change-Id: Ia5345594ab356fa3977447fe6f3434a06371f946

3 years agoyagl_glsl_parser: Reorganize precision qualifier parsing 39/251139/1
Lukasz Kostyra [Fri, 8 Jan 2021 10:59:47 +0000 (11:59 +0100)]
yagl_glsl_parser: Reorganize precision qualifier parsing

It is possible for uniforms to have precision qualifier assigned to
them. GLSL lexer/parser now properly discovers such situations.

Additionally, following issues were found and fixed:
* Invalid logging format for yagl_gles2_context_pre_draw warnings.
* Uninitialized variable issues with yagl_glsl_state_pp_resolve_define.
* GL_TEXTURE_EXTERNAL_OES targets having no texture target assigned,
  causing debug assertions to fail on use.

Change-Id: Id01c84ed72f8c2a96a4f3d22bdc3c6a96eaaa803

3 years agoImplement parsing of preprocessor condition directives 74/251074/1
Lukasz Kostyra [Thu, 7 Jan 2021 12:56:41 +0000 (13:56 +0100)]
Implement parsing of preprocessor condition directives

Some #define statements could be hidden beneath #if/#elif/#else/#endif
blocks. In order to properly recognize them YaGL shader parser now
recognizes and evaluates these blocks.

Change-Id: I1c9c0d4237b9796dbad9e9d6ef0cad9e4b3196ae

3 years agoParse GLSL #define preprocessor macros 73/251073/1
Lukasz Kostyra [Tue, 29 Dec 2020 11:08:05 +0000 (12:08 +0100)]
Parse GLSL #define preprocessor macros

GLSL lexer/parser now handles #define macros in order to properly
discover samplerExternalOES/sampler2D type.

Change-Id: I77f01bb722d31f980bf8a1d6b00a717c108a15b0

3 years agoBind external textures via 2D texture targets 45/250345/2
Lukasz Kostyra [Wed, 23 Dec 2020 22:01:01 +0000 (23:01 +0100)]
Bind external textures via 2D texture targets

Change-Id: I56a834f01c3fdc862ed06a2e616f83600b425490

3 years agoCollect available samplers with their names 44/250344/2
Lukasz Kostyra [Tue, 22 Dec 2020 19:55:25 +0000 (20:55 +0100)]
Collect available samplers with their names

Flex/Bison parser is used to additionally collect what names of
sampler2D's/samplerExternalOES's are added.

This will be used in upcoming commit to resolve issues with
samplerExternalOES usage.

Change-Id: I5d1349a83ba5531a9bf5a97a6d18fadc9b8734f9

3 years agoKeep shader state cached for further analysis 43/250343/2
Lukasz Kostyra [Tue, 22 Dec 2020 16:14:55 +0000 (17:14 +0100)]
Keep shader state cached for further analysis

Change-Id: I55dac1c67109bb867af39079def0bcb827b925ff

4 years agoYaGL: Avoid potential null pointer dereference in glGetUniformLocation() 34/245634/3
Sylwester Nawrocki [Mon, 12 Oct 2020 15:26:27 +0000 (17:26 +0200)]
YaGL: Avoid potential null pointer dereference in glGetUniformLocation()

Avoid passing a NULL name argument to function
yagl_gles2_program_get_uniform_location() as that function will
dereference the pointer without checking.

When the name argument is NULL make the function return value -1,
which according to OpenGL/GLES specification indicates that name
contains an invalid value/string.

This suppresses a SVACE warning:

* DEREF_AFTER_NULL: After having been compared to NULL value at yagl_gles2_calls.c:1096,
   pointer 'name' is passed as 2nd parameter in call to function 'yagl_gles2_program_get_uniform_location'
   at yagl_gles2_calls.c:1100, where it is dereferenced at yagl_gles2_program.c:373.
   [dereference] Variable 'name' is passed to function 'yagl_gles2_program_get_uniform_location'
    as 2nd parameter at GLESv2/yagl_gles2_calls.c:1100
   [null check] null check at GLESv2/yagl_gles2_calls.c:1096

Change-Id: Id4a4315e6c48eebf2c4047c158faa5bf54897e18
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
4 years agoYaGL: Prevent potential null pointer dereference in eglCreateImageKHR() 33/245633/1
Sylwester Nawrocki [Fri, 9 Oct 2020 18:05:31 +0000 (20:05 +0200)]
YaGL: Prevent potential null pointer dereference in eglCreateImageKHR()

In case yagl_validate_context() fails ctx is NULL and as such will be
dereferenced at end of the function (ctx->client_ctx->sg). Fix this
by testing ctx before the yagl_sharegroup_mutex_unlock_if_shared() call.
yagl_context_release(ctx) is safe as it tests for null internally.

This suppresses SVACE warning:

* DEREF_OF_NULL.EX: After having been assigned to NULL value at yagl_egl_calls.c:1746,
   pointer 'ctx' is dereferenced at yagl_egl_calls.c:1923.
    [dereference] Dereference at EGL/yagl_egl_calls.c:1923
    [assignment] Null assign at EGL/yagl_egl_calls.c:1746

Change-Id: I7d67eed012cd03d320fc49a92e567fedf69ead46
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
4 years agoYaGL: Prevent potential null pointer dereference in yagl_render_finish() 32/245632/1
Sylwester Nawrocki [Fri, 9 Oct 2020 17:22:21 +0000 (19:22 +0200)]
YaGL: Prevent potential null pointer dereference in yagl_render_finish()

This suppresses SVACE warning:

* DEREF_OF_NULL.RET.PROC.STAT: Return value of a function 'yagl_get_context' is dereferenced at yagl_render.c:78 without checking,
  but it is usually checked for this function (10/11).
     [dereference] Dereference at /home/abuild/rpmbuild/BUILD/emulator-yagl-1.6/EGL/yagl_render.c:78
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:2421
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:2102
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1457
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1418
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1293
     [counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1012

Change-Id: Ie8d33b96af61e9a15e2a5ece46cdd6e63acc2d24
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
4 years agoEGL: Fix minor incosistencies with specification 03/243503/3 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.123125 accepted/tizen/6.0/unified/hotfix/20201103.051716 accepted/tizen/unified/20200914.001502 submit/tizen/20200911.084158 submit/tizen_6.0/20201029.205101 submit/tizen_6.0_hotfix/20201102.192501 submit/tizen_6.0_hotfix/20201103.114801 tizen_6.0.m2_release
Lukasz Kostyra [Mon, 7 Sep 2020 15:18:00 +0000 (17:18 +0200)]
EGL: Fix minor incosistencies with specification

Change-Id: Ie0ee72ce6299b31e0d61a282b93498b08f4680cc

4 years agoGLES: Perform additional transport flushes 02/243502/3
Lukasz Kostyra [Mon, 7 Sep 2020 09:04:56 +0000 (11:04 +0200)]
GLES: Perform additional transport flushes

On some rare cases there still was a multithreading issue with resource
sharing across GL contexts. Ensuring glBind*() calls flush the transport
queue eliminates these cases.

Additionally removed sharegroup locking and flushing for Framebuffer
objects - these, according to specification, are not shared between
contexts (and so, between threads) and thus don't require extra
implicit synchronization.

Change-Id: If696ab64d553f6aadca39cd0044c533d35c064d8

4 years agoImplement thread safety when sharing EGL context 87/239087/3 accepted/tizen/unified/20200729.165549 submit/tizen/20200729.080538
Lukasz Kostyra [Thu, 23 Jul 2020 14:11:40 +0000 (16:11 +0200)]
Implement thread safety when sharing EGL context

- glGen* and associated calls now lock a sharegroup-global mutex.
- glGen* and glDeleteObjects host calls flush the transport
  to ensure resource is created before recording more calls.
- Some instances of yagl_host_glDeleteObjects being called were removed
  because they caused the same assertion to fail - these could remove
  a texture which was next bound.

Change-Id: Iea1b71062f25bc48a6aa583f7074801d416574a8

4 years agoRemove dummy libraries 90/237790/2 accepted/tizen/unified/20200707.140939 submit/tizen/20200706.084419
Lukasz Kostyra [Fri, 3 Jul 2020 10:51:40 +0000 (12:51 +0200)]
Remove dummy libraries

Following commit removes dummy EGL/GLES libraries and implements
discovery of /dev/yagl in libEGL.so.

If /dev/yagl is missing (ex. there is no host GPU available), libEGL.so will
fail any EGL function. This will make it impossible to create a functioning
GLES context, which will make GLES functions exit early, on YAGL_GET_CTX() calls.

Change-Id: I758496c39806c854315399a2b5c33ca688a8573c

4 years ago[Tizen 6.0] Silence build warnings for GCC 9.2 build 13/221313/1 accepted/tizen/unified/20200108.131437 submit/tizen/20200107.112014
Dongkyun Son [Tue, 31 Dec 2019 05:14:29 +0000 (14:14 +0900)]
[Tizen 6.0] Silence build warnings for GCC 9.2 build

Change-Id: I7aa3dfc39a9ca9748b779b4c71c57ec129e693da
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
6 years agoModify decision for window reset by checking tpl_surface_validate 66/186166/2 accepted/tizen_5.0_unified accepted/tizen_5.5_unified_mobile_hotfix tizen_5.0 tizen_5.5_mobile_hotfix accepted/tizen/5.0/unified/20181102.012242 accepted/tizen/5.5/unified/20191031.014531 accepted/tizen/5.5/unified/mobile/hotfix/20201027.081758 accepted/tizen/unified/20180827.160650 submit/tizen/20180809.082641 submit/tizen/20180827.075509 submit/tizen_5.0/20181101.000001 submit/tizen_5.5/20191031.000001 submit/tizen_5.5_mobile_hotfix/20201026.185101 tizen_5.5.m2_release
Mikhail Labiuk [Tue, 7 Aug 2018 17:04:51 +0000 (20:04 +0300)]
Modify decision for window reset by checking tpl_surface_validate

Call tpl_surface_validate before dequeue to check if it needs to be reset.

Change-Id: I346ca23f4d85c7f8e3f174ac79a9bdf83cf7652e
Signed-off-by: Mikhail Labiuk <m.labiuk@samsung.com>
6 years agoAdd handling of new format XBGR 85/180585/5 accepted/tizen/unified/20180731.140010 submit/tizen/20180731.005737
Vladislav Andresov [Thu, 31 May 2018 04:43:52 +0000 (07:43 +0300)]
Add handling of new format XBGR

Currently this format can be used only for output images
which would be product of rendering.

Change-Id: Ic3a7c5fe2e2c528059dc41a4df868268720c94a9
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
6 years agoAdd fixes for video360 issue 99/181899/3
Vladislav Andresov [Mon, 18 Jun 2018 19:55:58 +0000 (22:55 +0300)]
Add fixes for video360 issue

- set internal format GL_RGBA as default
  for texture images;

- fix creating of dummy VIGS surfaces while
  eglCreatePbufferSurface is called with zero sizes.

Change-Id: Ic08c464fc010b9b01a5b893f392d589b531bb4bf
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
6 years agoDo not use the tbm_bufmgr_backend.h file 22/173822/5 accepted/tizen/unified/20180413.073538 submit/tizen/20180412.070136
SooChan Lim [Thu, 22 Mar 2018 11:47:28 +0000 (20:47 +0900)]
Do not use the tbm_bufmgr_backend.h file

libtbm-vigs provides the drm_dev to get the vigs_drm_device.
yagl can also get the vigs_surface through the tbm_bo_get_handle.

Change-Id: Iba180f60b101886ae940b2eb1f5b7c5617d5eda9

6 years agoYaGL: add new rule for texture2D in GLSL 94/163194/2 accepted/tizen/unified/20171208.170413 submit/tizen/20171208.080618
Jinhyung Jo [Thu, 7 Dec 2017 12:18:23 +0000 (21:18 +0900)]
YaGL: add new rule for texture2D in GLSL

The GLSL patchers did not work correctly with a statement like bellow:

    #define TextureLookup texture2D

The token 'texture2D' in the comment is not parsed with desired result.
So, add a new rule for that situation.

Change-Id: I84ae9166c0d322baf48d1c20bb74a1c27172c59f
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
6 years agoModified to completely unref the unused GEM memory. 15/163115/1
joonbum.ko [Wed, 6 Dec 2017 04:13:57 +0000 (13:13 +0900)]
Modified to completely unref the unused GEM memory.

 tbm_surface is dequeued from tpl_surface,
 but window does not want to use it(window resized or destroyed),
 then we have to cancel it to complete destroying using below API.
 - tpl_surface_cancel_dequeued_buffer(tpl_surface_t *, tbm_surface_h)

Change-Id: Ib4d5798d29111aa0ef0b74e9e3986abdf2665c4d
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
6 years agoYAGL: Add hardware conversion for YUV420 format 27/156927/3 accepted/tizen/unified/20171130.063224 submit/tizen/20171128.094631
Vladislav Andresov [Thu, 5 Oct 2017 14:12:21 +0000 (17:12 +0300)]
YAGL: Add hardware conversion for YUV420 format

Change-Id: Icf94edd832657527f940c0815653f0365e47d166
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
7 years agoAdd hw y-inverting for ARGB images 16/144416/3 accepted/tizen/unified/20170922.065340 submit/tizen/20170913.082218 submit/tizen/20170921.074615
Vladislav Andresov [Wed, 16 Aug 2017 13:15:56 +0000 (16:15 +0300)]
Add hw y-inverting for ARGB images

Change-Id: I9ee0fd94cb773d326a18074aa99d4576d5ac9639
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoEnsure fence_dpy is setup for all threads 23/127223/1 accepted/tizen/4.0/unified/20170816.012405 accepted/tizen/4.0/unified/20170816.015300 accepted/tizen/4.0/unified/20170828.224236 accepted/tizen/unified/20170428.032549 submit/tizen/20170427.063328 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.110001 submit/tizen_4.0_unified/20170814.115522 tizen_4.0.m1_release
Vasiliy Ulyanov [Wed, 26 Apr 2017 11:59:27 +0000 (14:59 +0300)]
Ensure fence_dpy is setup for all threads

This is needed in order to be able to create fences in transport layer
and avoid race conditions when invoking yagl_host_* routines with return
values. Previously fence_dpy was assigned only in eglGetDisplay. Though
the app may make EGL calls from auxiliary threads which will have
fence_dpy uninitialized.

Change-Id: Ibe66030cb4a30d189750d1ab233164cfea60b339
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoAvoid using yagl_host_handle when acquiring images 48/111648/1 devel/vulkan
Vasiliy Ulyanov [Fri, 9 Dec 2016 10:06:48 +0000 (13:06 +0300)]
Avoid using yagl_host_handle when acquiring images

yagl_host_handle is defined as uint32_t, while EGL image client handle
(either EGLImageKHR or GLeglImageOES) is void *. On x64 arch the cast to
yagl_host_handle will lead to data truncation and as a result the image
may not be found.

Change-Id: I02e8a14326c635d0f6bcb0e9b289a0467c846f1f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoFix wrong host texture binding 22/106922/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20161227.192209 accepted/tizen/ivi/20161226.131617 accepted/tizen/mobile/20161226.131518 accepted/tizen/tv/20161226.131538 accepted/tizen/unified/20170309.031107 accepted/tizen/wearable/20161226.131557 submit/tizen/20161226.050229 submit/tizen_unified/20170308.100403
Vasiliy Ulyanov [Fri, 23 Dec 2016 17:14:20 +0000 (20:14 +0300)]
Fix wrong host texture binding

The call sequence like bellow was causing flickering:

    glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
    glBindTexture(GL_TEXTURE_2D, 0);
    glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);

Eventually zero texture was used on the host side since external
textures are currently handled as GL_TEXTURE_2D.

Change-Id: I9d8480df7dd5f44f49f31e170de6f478c663f8c3
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoY-invert ARGB images 49/100549/1 accepted/tizen/common/20161129.173735 accepted/tizen/ivi/20161130.015925 accepted/tizen/mobile/20161130.015830 accepted/tizen/tv/20161130.015848 accepted/tizen/wearable/20161130.015905 submit/tizen/20161129.132307
joonbum.ko [Mon, 28 Nov 2016 08:29:58 +0000 (17:29 +0900)]
Y-invert ARGB images

This patch resolves the issue with widgets rendered upside-down. Tizen
platfrom expects 'yinvert == 1' for EGL images created from tizen sfc.

Change-Id: If34b0c717f705a13351d94b50361b2a6d5945998
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoFix yagl setup script for x64 arch 71/94871/1 accepted/tizen/common/20161102.122215 accepted/tizen/ivi/20161103.000013 accepted/tizen/mobile/20161102.235924 accepted/tizen/tv/20161102.235939 accepted/tizen/wearable/20161102.235956 submit/tizen/20161102.080516
Vasiliy Ulyanov [Tue, 1 Nov 2016 17:23:29 +0000 (20:23 +0300)]
Fix yagl setup script for x64 arch

Driver path can be either /usr/lib/driver or /usr/lib64/driver.

Change-Id: I133ea4aa0152f396d3c7ebd4b61dd9fbac8bbfb5
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoYaGL: modify lib path 02/94302/2 accepted/tizen/common/20161028.114840 accepted/tizen/ivi/20161028.153003 accepted/tizen/mobile/20161028.152916 accepted/tizen/tv/20161028.152933 accepted/tizen/wearable/20161028.152959 submit/tizen/20161028.072954
Jinhyung Jo [Fri, 28 Oct 2016 06:20:37 +0000 (15:20 +0900)]
YaGL: modify lib path

The lib path in the 64-bit architecture was missing.
I modify the lib path.

Change-Id: I65e0ebbce42a782605b4d2c764fc5ba596603db0
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
8 years agoBuild: ASan build support added 10/88810/2 sandbox/vbarinov/asan
Slava Barinov [Tue, 20 Sep 2016 14:52:59 +0000 (17:52 +0300)]
Build: ASan build support added

Address Sanitizer support requires adding pthread in the end of list

Change-Id: I8db1b86e394002baf4418b7494d7497047b65be8
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
8 years agoYaGL: Add tpl surface validation 34/78134/3
Vasiliy Ulyanov [Mon, 4 Jul 2016 10:09:28 +0000 (13:09 +0300)]
YaGL: Add tpl surface validation

With EFL a 1x1 surface is created at first and then it is resized. There
is a need to handle such situation before drawing GL stuff and
invalidate the renderer.

Change-Id: Ic11cbae921d1f486f1a81fa1633c6f64d5673efe
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoAdd RGBA8888 format support for EGL tizen sfc ext 30/89730/1 accepted/tizen/3.0/ivi/20161011.044041 accepted/tizen/3.0/mobile/20161015.033105 accepted/tizen/3.0/tv/20161016.004518 accepted/tizen/3.0/wearable/20161015.082722 accepted/tizen/common/20160928.164441 accepted/tizen/ivi/20160929.002229 accepted/tizen/mobile/20160929.002032 accepted/tizen/tv/20160929.002155 accepted/tizen/wearable/20160929.002318 submit/tizen/20160928.075844 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000002 submit/tizen_3.0_mobile/20161015.000002 submit/tizen_3.0_tv/20161015.000002 submit/tizen_3.0_wearable/20161015.000002
Vasiliy Ulyanov [Mon, 26 Sep 2016 13:04:15 +0000 (16:04 +0300)]
Add RGBA8888 format support for EGL tizen sfc ext

This format requires convertion to ARGB.

Change-Id: Ia9ade3d84b3d061c5f713457e6ac0e2cbae31418
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoEnsure drm gem is always 'named' 48/88148/1
Vasiliy Ulyanov [Tue, 13 Sep 2016 16:10:37 +0000 (19:10 +0300)]
Ensure drm gem is always 'named'

When creating EGL image from tizen surface, the underlying gem may have
no name assigned. This ends up with client handle set to zero. The commit
fixes such an issue.

Change-Id: Ica907a251d9a64a8661232e2718930caa052e0a3
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoBuild: Remove link of libGLESv1_CM.so on /usr/lib 93/83093/1 accepted/tizen/common/20160830.150306 accepted/tizen/ivi/20160830.235659 accepted/tizen/mobile/20160830.235448 accepted/tizen/tv/20160830.235530 accepted/tizen/wearable/20160830.235615 submit/tizen/20160830.063644
Mun, Gwan-gyeong [Tue, 9 Aug 2016 07:05:19 +0000 (16:05 +0900)]
Build: Remove link of libGLESv1_CM.so on /usr/lib

CoreGL supports libGLESv1 so emulator-yagl does not need to make link of libGLESv1_CM

Change-Id: I68ff61626524c8ffcd82733c83bcc7604d061256

8 years agoDefine PATH variable in the script file. 92/81892/1 accepted/tizen/common/20160729.162312 accepted/tizen/ivi/20160729.062734 accepted/tizen/mobile/20160729.062648 accepted/tizen/tv/20160729.062700 accepted/tizen/wearable/20160729.062718 submit/tizen/20160729.055330
jin-gyu.kim [Fri, 29 Jul 2016 05:48:58 +0000 (14:48 +0900)]
Define PATH variable in the script file.

Change-Id: Iffc998df2d3a1400bd3d18f5b28b6968ecd19400

8 years agoYaGL: Check for GPU acceleration on boot 41/81041/2 accepted/tizen/common/20160725.153648 accepted/tizen/ivi/20160725.083417 accepted/tizen/mobile/20160725.083352 accepted/tizen/tv/20160725.083354 accepted/tizen/wearable/20160725.083348 submit/tizen/20160725.073531
Vasiliy Ulyanov [Thu, 21 Jul 2016 12:58:28 +0000 (15:58 +0300)]
YaGL: Check for GPU acceleration on boot

If emulator is run without host GPU acceleration, yagl will likely
terminate GL apps on initialization failure. In order to handle the
situation propely, dummy GL libs are now packed along with yagl. When
emulator boots up, a script will check if /dev/yagl is present and
setup the symlinks appropriately.

Change-Id: I6715c5798b0c2a6cdef16a24a1e3c8786f6aa36f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix debug build for x64 platform 07/80707/1
Vasiliy Ulyanov [Tue, 19 Jul 2016 15:17:56 +0000 (18:17 +0300)]
YaGL: Fix debug build for x64 platform

Ponters cannot be cast directly to integers of different size with
'-Werror=pointer-to-int-cast' gcc option. The commit fixes this issue
when making a build with debug logs enabled.

Change-Id: I401e5230af0f08b97a3597c05368f4859ed9d949
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix required texture image units query 10/75610/1
Vasiliy Ulyanov [Mon, 20 Jun 2016 13:48:54 +0000 (16:48 +0300)]
YaGL: Fix required texture image units query

GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is now accepted as parameter name in
glGetTexParameterfv.

Change-Id: I7bdc3635262b28826f225395a76048d897710eb6
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Add more strict error checking 09/75609/1
Vasiliy Ulyanov [Wed, 24 Feb 2016 13:30:23 +0000 (16:30 +0300)]
YaGL: Add more strict error checking

- glLinkProgram: linking should fail if vertex and fragment
shaders are not both present in the program object.

- glBlitFramebuffer: if the source and destination buffers
are identical, an INVALID_OPERATION error should be generated.

    NOTE: valid only for OGLES3.0. Not the case with e.g.
    GL_ANGLE_framebuffer_blit.

Change-Id: I0fdc4e383e32e9cfcb9028f4b279b8acdb8410c7
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix license issues 37/74437/2 accepted/tizen/common/20160615.193438 accepted/tizen/ivi/20160615.001930 accepted/tizen/mobile/20160615.001958 accepted/tizen/tv/20160615.001936 accepted/tizen/wearable/20160615.001938 submit/tizen/20160614.144853
Vasiliy Ulyanov [Tue, 14 Jun 2016 08:00:19 +0000 (11:00 +0300)]
YaGL: Fix license issues

    - COPYING: XFree86 -> MIT
    - LICENSE: LGPL3.0 -> LGPL3.0+

Change-Id: I90e9129f0098c38ef30eeb409dc627e2df70c6dd
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Redefine samplerExternalOES in GLSL 87/71687/1 accepted/tizen/common/20160609.145843 accepted/tizen/ivi/20160609.091238 accepted/tizen/mobile/20160609.091511 accepted/tizen/tv/20160609.091254 accepted/tizen/wearable/20160609.091243 submit/tizen/20160609.005815
Vasiliy Ulyanov [Thu, 26 May 2016 10:12:03 +0000 (13:12 +0300)]
YaGL: Redefine samplerExternalOES in GLSL

The former external sampler hadnling did not work correctly with
statements like bellow:

    #define SamplerType samplerExternalOES

Using a #define construct in the header for samplerExternalOES seems
more appropriate rather than substituing every occurrence.

Change-Id: If1c654046ad78011a5148013889f5dc93882a6a9
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Y-invert YUV images 11/71211/1 accepted/tizen/common/20160526.150358 accepted/tizen/ivi/20160526.110918 accepted/tizen/mobile/20160526.110821 accepted/tizen/tv/20160526.110838 accepted/tizen/wearable/20160526.110857 submit/tizen/20160526.080841
Vasiliy Ulyanov [Thu, 11 Feb 2016 09:12:23 +0000 (12:12 +0300)]
YaGL: Y-invert YUV images

EGL images created from tbm surfaces appear flipped vertically.
In case of planar data we have to make conversion anyway so it
can be handled as well.

Change-Id: I8242bdffdd1f0340b616cb1f5912ea51a5c27026
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Implement GL_OES_EGL_image_external extension 10/71210/1
Vasiliy Ulyanov [Mon, 1 Feb 2016 15:32:47 +0000 (18:32 +0300)]
YaGL: Implement GL_OES_EGL_image_external extension

Currently external textures are handled as 2d textures since
host will unlikely recognize GL_TEXTURE_EXTERNAL_OES as a valid
target. The same applies to GLSL (i.e. sampler2D is used instead
of samplerExternalOES). Color conversion is performed in software
and it is done when glEGLImageTargetTexture2DOES function is
called. It is an initial implementation and at the moment it is not
fully conformant.

Change-Id: I6a781d1062a2f5373e8ff507a5279c58ed29b042
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix debug build with tizen platform 09/71209/1
Vasiliy Ulyanov [Tue, 24 May 2016 11:10:13 +0000 (14:10 +0300)]
YaGL: Fix debug build with tizen platform

The macro YAGL_LOG_FUNC_SET initilizes logger specific local vars like
pid, tid, etc. There is no need to use it if the function actually does
not produce any logs, since it may lead to 'unused variable' compiler
errors.

Change-Id: I9f9c2ccba7b8364d60891a1748fc62d5b2516fbf
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Add back buffer null check in get_buffer_age 14/68914/1 accepted/tizen/common/20160510.141506 accepted/tizen/ivi/20160511.003442 accepted/tizen/mobile/20160511.003353 accepted/tizen/tv/20160511.003406 accepted/tizen/wearable/20160511.003424 submit/tizen/20160510.103126
Vasiliy Ulyanov [Tue, 10 May 2016 10:03:42 +0000 (13:03 +0300)]
YaGL: Add back buffer null check in get_buffer_age

Change-Id: I53b79769401aae2a1e8a7f9e58637473f1cd3299
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoBuild: Recover build architecture (x86, x86_64) and emulator bcond on rpm spec file 31/68131/1 accepted/tizen/common/20160504.125104 accepted/tizen/ivi/20160503.092521 accepted/tizen/mobile/20160503.092432 accepted/tizen/tv/20160503.092442 accepted/tizen/wearable/20160503.092506 submit/tizen/20160502.114011
Mun, Gwan-gyeong [Mon, 2 May 2016 11:31:27 +0000 (20:31 +0900)]
Build: Recover build architecture (x86, x86_64) and emulator bcond on rpm spec file

Change-Id: I27bc19e40273bf84f505001baadbd169ee80272f

8 years agoporting YAGL to TIZEN platform 21/67921/2 submit/tizen/20160502.043551
Xuelian Bai [Thu, 28 Apr 2016 19:51:31 +0000 (03:51 +0800)]
porting YAGL to TIZEN platform

This patch ports YAGL to TIZEN platform as an
initial version, creates following files:
EGL/tizen/yagl_tizen_display.c
EGL/tizen/yagl_tizen_display.h
EGL/tizen/yagl_tizen_native_image.c
EGL/tizen/yagl_tizen_native_image.h
EGL/tizen/yagl_tizen_pbuffer.c
EGL/tizen/yagl_tizen_pbuffer.h
EGL/tizen/yagl_tizen_platform.c
EGL/tizen/yagl_tizen_platform.h
EGL/tizen/yagl_tizen_window.c
EGL/tizen/yagl_tizen_window.h

Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
Change-Id: I639dc736f242096ba417054576453ea941113eea

8 years agoChange GLESV1_CM symbolic link for COREGL 54/66754/1 accepted/tizen/common/20160422.172145 accepted/tizen/ivi/20160425.044111 accepted/tizen/mobile/20160425.044035 accepted/tizen/tv/20160425.044100 accepted/tizen/wearable/20160425.044047 submit/tizen/20160422.084818
Mun, Gwan-gyeong [Wed, 20 Apr 2016 16:37:18 +0000 (01:37 +0900)]
Change GLESV1_CM symbolic link for COREGL

Change-Id: I970f8d859ba8a1d565219f304bbd2451feff2194

8 years agoYaGL: Fix LICENSE.MIT text 97/64797/1 accepted/tizen/common/20160406.144850 accepted/tizen/ivi/20160406.105253 accepted/tizen/mobile/20160406.105202 accepted/tizen/tv/20160406.105217 accepted/tizen/wearable/20160406.105233 submit/tizen/20160406.081710
Vasiliy Ulyanov [Tue, 5 Apr 2016 10:52:36 +0000 (13:52 +0300)]
YaGL: Fix LICENSE.MIT text

Change-Id: I4fda882a7ea7f3604025d4c5574dcb17c530ef7f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Disable ETC1_RGB8_OES format check 52/62552/1 accepted/tizen/common/20160317.160510 accepted/tizen/ivi/20160317.115702 accepted/tizen/mobile/20160317.115617 accepted/tizen/tv/20160317.115631 accepted/tizen/wearable/20160317.115645 submit/tizen/20160317.020331
Vasiliy Ulyanov [Wed, 16 Mar 2016 12:34:19 +0000 (15:34 +0300)]
YaGL: Disable ETC1_RGB8_OES format check

OES_compressed_ETC1_RGB8_texture spec says:

    INVALID_OPERATION is generated by CompressedTexSubImage2D,
    TexSubImage2D, or CopyTexSubImage2D if the texture image <level>
    bound to <target> has internal format ETC1_RGB8_OES.

Currently this error check causes problems with some apps so
temporarly disable it as a workaround.

Change-Id: I8bdc6f2b7a7b65730d4dee9a8a91b9f6ce465485
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoRevert "YaGL: Mark glGenTextures call as flushing" 50/62350/2 accepted/tizen/common/20160316.161043 accepted/tizen/ivi/20160316.135604 accepted/tizen/mobile/20160316.135516 accepted/tizen/tv/20160316.135531 accepted/tizen/wearable/20160316.135547 submit/tizen/20160316.101805
Vasiliy Ulyanov [Tue, 15 Mar 2016 08:56:29 +0000 (11:56 +0300)]
Revert "YaGL: Mark glGenTextures call as flushing"

This reverts commit 246a7db9c03797276b650b955139210c04f80e84.

The race condition was occuring because of improper glFinish
call handling with surfaceless context. The commit also adds
explicit transport flushing to ensure all the rendering commands
are offloaded to the host in this case.

Change-Id: Ic70d7f82904c1636acc495fb2e500115f62c6125
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Mark glGenTextures call as flushing 00/62000/1 accepted/tizen/common/20160315.221341 accepted/tizen/ivi/20160315.115920 accepted/tizen/mobile/20160315.115824 accepted/tizen/tv/20160315.115842 accepted/tizen/wearable/20160315.115902 submit/tizen/20160315.012116
Vasiliy Ulyanov [Sat, 12 Mar 2016 14:10:12 +0000 (17:10 +0300)]
YaGL: Mark glGenTextures call as flushing

This is a workaround for web-tct. There seems to be a race
condition with these tests (i.e. they are rendering from
several threads without ensuring GL synchronization). The
commit should be reverted as soon as a proper fix is applied.

Change-Id: I095e76f0d9c84e7623035ca24817cfc98e7a2ae5
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix dynamic symbols loading with coregl 57/61757/2
Vasiliy Ulyanov [Thu, 3 Mar 2016 15:14:47 +0000 (18:14 +0300)]
YaGL: Fix dynamic symbols loading with coregl

EGL/GLES vendor-specific drivers are located in /usr/lib/driver
when emulator runs with coregl. This needs to be considered when
loading symbols internally.

Change-Id: I6461ead2c5d6d66cbf2cc1fd25ee53887981df8a
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Add pbuffer support for Wayland platform 60/61060/1 accepted/tizen/ivi/20160311.054606 accepted/tizen/mobile/20160311.054508 accepted/tizen/tv/20160311.054532 accepted/tizen/wearable/20160311.054545 submit/tizen/20160310.060703
Vasiliy Ulyanov [Thu, 3 Mar 2016 14:55:02 +0000 (17:55 +0300)]
YaGL: Add pbuffer support for Wayland platform

Currently it is needed to make Tizen 3.0 feature tests pass
in emulator. They appear to be using eglCreatePbufferSurface(...)
for offscreen rendering. I am not sure if such functionality is
really needed with Wayland (in fact it is not supported even in
Mesa). Anyway I have not found any spec saying that Wayland should
fail with this call so for the moment some draft implementation
should be okay I think.

Change-Id: I01372121c0e080e0007c69a12d4b97ad8df6fc04
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix Prevent issues 61/58461/1 accepted/tizen/common/20160304.195047 accepted/tizen/ivi/20160304.015431 accepted/tizen/mobile/20160304.015338 accepted/tizen/tv/20160304.015357 accepted/tizen/wearable/20160304.015410 accepted/tizen/wearable/20160307.020711 submit/tizen/20160303.131907 submit/tizen_wearable/20160304.133021
Vasiliy Ulyanov [Mon, 1 Feb 2016 08:20:17 +0000 (11:20 +0300)]
YaGL: Fix Prevent issues

Change-Id: I781453b800d376a16294921984e2cb2b36f1411b
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
8 years agoYaGL: Fix build configuration for install directory of 64bit architecture. 56/55756/4 accepted/tizen/common/20160129.173120 accepted/tizen/ivi/20160218.022900 accepted/tizen/mobile/20160108.010156 accepted/tizen/tv/20160108.010521 submit/tizen_common/20160128.052157 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000001 submit/tizen_mobile/20160105.110407 submit/tizen_tv/20160105.110358
Mun, Gwan-gyeong [Mon, 28 Dec 2015 05:32:27 +0000 (14:32 +0900)]
YaGL: Fix build configuration for install directory of 64bit architecture.

32bit: install /usr/lib
64bit: install /usr/lib64

Change-Id: I6c50ea39a7eeaa17abe188aaa48d5ee61615529c

8 years agowayland-egl: add missed package config file 55/55755/3
Mun, Gwan-gyeong [Mon, 28 Dec 2015 01:23:51 +0000 (10:23 +0900)]
wayland-egl: add missed package config file

Change-Id: I973a4ef3f89c1b26e52772c5bc386726d61d326c

8 years agoYaGL: Seperate emulator-yagl package to libwayland-egl package. 54/55754/3
Mun, Gwan-gyeong [Mon, 28 Dec 2015 01:06:08 +0000 (10:06 +0900)]
YaGL: Seperate emulator-yagl package to libwayland-egl package.

Change-Id: I99ef17705e7a1197f8555116f2c2a386f5726a03

8 years agoYaGL: Change install directory of real driver. 53/55753/3
Mun, Gwan-gyeong [Thu, 24 Dec 2015 12:46:40 +0000 (21:46 +0900)]
YaGL: Change install directory of real driver.

Coregl package provide libGLES, liEGL wrapper. and Coregl dynamically load real driver from /usr/lib/driver
Remove GL/EGL header files from devel package. : CoreGL provide GL/EGL header file.
Remove build script of X env.

Change-Id: I3015c5ee2828b94cd1525b98db9e7acba4cf5762

8 years agoYaGL: support EGL_NATIVE_VISUAL_ID for GBM 31/53731/1 accepted/tizen/mobile/20151215.124619 accepted/tizen/mobile/20151215.124651 accepted/tizen/tv/20151215.125231 accepted/tizen/wearable/20151215.125518 submit/tizen/20151215.084935 submit/tizen_common/20160223.170033
Jinhyung Jo [Wed, 9 Dec 2015 04:33:51 +0000 (13:33 +0900)]
YaGL: support EGL_NATIVE_VISUAL_ID for GBM

The EGL_KHR_platform_gbm extension has specific behavior
for the EGL_NATIVE_VISUAL_ID.
There is following contents in the EGL officail size,
(https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_platform_gbm.txt)
New Behavior section
"For each EGLConfig that belongs to the GBM platform, the
 EGL_NATIVE_VISUAL_ID attribute is a GBM color format, such as
 GBM_FORMAT_XRGB8888. "

The EFL EVAS in Tizen requires the GBM_FORMAT_ARGB8888.
And YaGL can support this format. So returns it.
This is W/A patch. Must be resolved correclty.

Change-Id: I402ebb20d17bf1a119ca09154519d57305e539a7
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
8 years agoYaGL: Version bump 70/51270/1 accepted/tizen/mobile/20151107.080053 accepted/tizen/tv/20151107.080218 accepted/tizen/wearable/20151107.080420 submit/tizen/20151106.083914
jinhyung.jo [Fri, 6 Nov 2015 05:14:29 +0000 (14:14 +0900)]
YaGL: Version bump

For the 64bit addressing
(commit id: 233c1f2ea5be0b1d160b64856e33365e0ab58313)
Be sure synchronize with the kernel & QEMU packages.

Change-Id: Ia3537a5d5e13f1a0764c20105dea576c364b826d
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
8 years agoYaGL: Fix compilation warning & add '-Werror' option 24/51024/1 accepted/tizen/mobile/20151105.083843 accepted/tizen/tv/20151105.083856 accepted/tizen/wearable/20151105.083914 submit/tizen/20151105.033621
jinhyung.jo [Wed, 4 Nov 2015 13:15:31 +0000 (22:15 +0900)]
YaGL: Fix compilation warning & add '-Werror' option

Removed a usage of the deprecated function, wl_client_add_resource'
And added a compilation option, '-Werror'.

Change-Id: I20fb58f9ab26c9a1f359ec8f4f5d56c261778bd7
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
8 years agoYaGL: Patches for the 64bit addressing 97/50997/2
jinhyung.jo [Wed, 4 Nov 2015 09:48:16 +0000 (18:48 +0900)]
YaGL: Patches for the 64bit addressing

Tizen 3.0 supports a 64bit guest.
However current yagl is implemented by assumed to use 32bit address.
So modify the address related parts.
The qemu device sources were also modifed.
And remove the warnings:
  -Wint-to-pointer-cast/-Wpointer-to-int-cast/-Wunused-variables
TODO: fix the warning - 'wl_client_add_resource' is deprecated

Change-Id: Id3875eefa012240df34fffbc7d12f36c9584b4f1
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
9 years agoRevert "YaGL: Workaround for libevas gles version check" 45/45645/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150810.080518 accepted/tizen/tv/20150810.080541 accepted/tizen/wearable/20150810.080559 submit/tizen/20150810.071326 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
Vasiliy Ulyanov [Fri, 7 Aug 2015 15:52:28 +0000 (18:52 +0300)]
Revert "YaGL: Workaround for libevas gles version check"

This workaround appears no longer needed since the corresponding
fix has been applied to libevas. Besides it seems to cause
problems with cairo.

This reverts commit 1a1d13934f4bad7b779cd6093c0f00cc9f36ec03.

Change-Id: Iad9af1b3bcd6c2756963ebd0e10e97879245d496
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Modified the .spec & COPYING files. 38/45338/1
jinhyung.jo [Fri, 31 Jul 2015 07:57:30 +0000 (16:57 +0900)]
YaGL: Modified the .spec & COPYING files.

Modified to provide the correct license information.

Change-Id: Ie0689f070e6e6162132c07df6603a721c3fca453
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
9 years agoYaGL: Updating the EGL header files 37/45337/1
jinhyung.jo [Tue, 21 Jul 2015 02:41:05 +0000 (11:41 +0900)]
YaGL: Updating the EGL header files

Update EGL header files to the version of May 2015, EGL spec 1.5.

Change-Id: Ifc7ba9cadebb0b229f1d1ee72171e241d2801a0a
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
9 years agoYaGL: mark eglMakeCurrent call as 'flushing' 36/45336/1
Vasiliy Ulyanov [Wed, 1 Jul 2015 07:49:30 +0000 (10:49 +0300)]
YaGL: mark eglMakeCurrent call as 'flushing'

According to EGL spec the currently bound context needs
to be flushed before being released or another context
is made current.

Without flushing we may miss some GL calls if there are
several threads rendering to a single context.

Change-Id: Id6680a086d895ba94b4c279b18443d93017838d1
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: keep at least 2 back buffers for dri3 drawables 35/45335/1
Vasiliy Ulyanov [Tue, 23 Jun 2015 13:53:20 +0000 (16:53 +0300)]
YaGL: keep at least 2 back buffers for dri3 drawables

With only one back buffer available the rendering freezes

Change-Id: I9b2cdbeddf4786bc57bef997574d606a15ebf4cb
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Avoid clamping with floating point textures 34/45334/1
Vasiliy Ulyanov [Thu, 11 Jun 2015 10:11:28 +0000 (13:11 +0300)]
YaGL: Avoid clamping with floating point textures

We need to pass the proper dst_internalformat to the host when
using a texture with floating-point components in glTexImage2D.

Change-Id: Ia588a6e84ad5e359d3ed6d6eaf7d8769569acc38
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Modified the startup script 33/45333/1
jinhyung.jo [Thu, 18 Jun 2015 02:19:59 +0000 (11:19 +0900)]
YaGL: Modified the startup script

Checks the device node instead of the kernel command

Change-Id: Ib14005a53dd989419b8c49ec72600f107af1ab50
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
9 years agoYaGL: Add program link status check 32/45332/1
Vasiliy Ulyanov [Tue, 9 Jun 2015 16:06:21 +0000 (19:06 +0300)]
YaGL: Add program link status check

According to the OGLES2.0 spec:

    void UseProgram(uint program);

If program has not been successfully linked, the error
INVALID_OPERATION is generated and the current rendering
state is not modified.

Change-Id: I481a494c210e76ee4db319ae569d3491ade1d35a
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Generate error for rectangular cubemap images 31/45331/1
Vasiliy Ulyanov [Tue, 9 Jun 2015 15:53:47 +0000 (18:53 +0300)]
YaGL: Generate error for rectangular cubemap images

According to the OGLES2.0 spec:

    void TexImage2D(enum target, int level,
                    int internalformat, sizei width, sizei height,
                    int border, enum format, enum type, void *data);

When the target parameter to TexImage2D is one of the six cube map
two-dimensional image targets, the error INVALID_VALUE is generated
if the width and height parameters are not equal.

Change-Id: Ideb9172fa721cd7c92d1ef98a397d9fe48690e66
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Fix yagl_get_gles2_sym(...) resolution order 30/45330/1
Vasiliy Ulyanov [Tue, 9 Jun 2015 15:35:09 +0000 (18:35 +0300)]
YaGL: Fix yagl_get_gles2_sym(...) resolution order

dlsym(NULL, ...) may return a valid pointer to a local symbol. We
need to search it in libGLESv2 explicitly first.

Change-Id: I6200679d7b69444798d3feeb77b685e2772eb3a7
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
9 years agoYaGL: Fix incorrect texture object release 29/45329/1
Vasiliy Ulyanov [Mon, 1 Jun 2015 06:54:06 +0000 (09:54 +0300)]
YaGL: Fix incorrect texture object release

EGL_KHR_gl_texture_2D_image: texture object is acquired in
yagl_gles_image_wrap_tex(...). Hence the release should be performed
in the corresponding destructor (i.e. yagl_gles_image_destroy(...)).

Change-Id: I92aaf0a4368201453e022859f4c52cdeb103af06
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>