mode
[platform/core/uifw/libtdm.git] / src / tdm_hwc_window.c
1 /**************************************************************************
2  *
3  * libtdm
4  *
5  * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
6  *
7  * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
8  *          JinYoung Jeon <jy0.jeon@samsung.com>,
9  *          Taeheon Kim <th908.kim@samsung.com>,
10  *          YoungJun Cho <yj44.cho@samsung.com>,
11  *          SooChan Lim <sc1.lim@samsung.com>,
12  *          Boram Park <sc1.lim@samsung.com>
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining a
15  * copy of this software and associated documentation files (the
16  * "Software"), to deal in the Software without restriction, including
17  * without limitation the rights to use, copy, modify, merge, publish,
18  * distribute, sub license, and/or sell copies of the Software, and to
19  * permit persons to whom the Software is furnished to do so, subject to
20  * the following conditions:
21  *
22  * The above copyright notice and this permission notice (including the
23  * next paragraph) shall be included in all copies or substantial portions
24  * of the Software.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
29  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
30  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33  *
34 **************************************************************************/
35
36 #ifdef HAVE_CONFIG_H
37 #include "config.h"
38 #endif
39
40 #include "tdm_private.h"
41
42 #define COUNT_MAX   10
43
44 #define HWC_WINDOW_FUNC_ENTRY() \
45         tdm_private_display *private_display; \
46         tdm_private_output *private_output; \
47         tdm_private_hwc_window *private_hwc_window; \
48         tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
49         TDM_RETURN_VAL_IF_FAIL(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER); \
50         private_hwc_window = (tdm_private_hwc_window*)hwc_window; \
51         private_output = private_hwc_window->private_output; \
52         private_display = private_output->private_display
53
54 #define HWC_WINDOW_FUNC_ENTRY_ERROR() \
55         tdm_private_display *private_display; \
56         tdm_private_output *private_output; \
57         tdm_private_hwc_window *private_hwc_window; \
58         tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
59         TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \
60         private_hwc_window = (tdm_private_hwc_window*)hwc_window; \
61         private_output = private_hwc_window->private_output; \
62         private_display = private_output->private_display
63
64 #define HWC_WINDOW_FUNC_ENTRY_VOID_RETURN() \
65         tdm_private_display *private_display; \
66         tdm_private_output *private_output; \
67         tdm_private_hwc_window *private_hwc_window; \
68         tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\
69         TDM_RETURN_IF_FAIL(hwc_window != NULL); \
70         private_hwc_window = (tdm_private_hwc_window*)hwc_window; \
71         private_output = private_hwc_window->private_output; \
72         private_display = private_output->private_display
73
74 tbm_surface_queue_h
75 tdm_hwc_window_get_tbm_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error)
76 {
77         tdm_func_hwc_window *func_hwc_window = NULL;
78         tbm_surface_queue_h queue = NULL;
79
80         HWC_WINDOW_FUNC_ENTRY_ERROR();
81
82         _pthread_mutex_lock(&private_display->lock);
83
84         func_hwc_window = &private_display->func_hwc_window;
85
86         if (!func_hwc_window->hwc_window_get_tbm_buffer_queue) {
87                 /* LCOV_EXCL_START */
88                 _pthread_mutex_unlock(&private_display->lock);
89                 TDM_ERR("not implemented!!");
90                 if (error)
91                         *error = TDM_ERROR_NOT_IMPLEMENTED;
92                 return NULL;
93                 /* LCOV_EXCL_STOP */
94         }
95
96         queue = func_hwc_window->hwc_window_get_tbm_buffer_queue(private_hwc_window->hwc_window_backend, error);
97
98         _pthread_mutex_unlock(&private_display->lock);
99
100         return queue;
101 }
102
103 EXTERN tdm_error
104 tdm_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
105                                                                         tdm_hwc_window_composition composition_type)
106 {
107         tdm_func_hwc_window *func_hwc_window = NULL;
108
109         HWC_WINDOW_FUNC_ENTRY();
110         TDM_RETURN_VAL_IF_FAIL(composition_type >= TDM_COMPOSITION_NONE, TDM_ERROR_INVALID_PARAMETER);
111         TDM_RETURN_VAL_IF_FAIL(composition_type <= TDM_COMPOSITION_VIDEO, TDM_ERROR_INVALID_PARAMETER);
112
113         _pthread_mutex_lock(&private_display->lock);
114
115         func_hwc_window = &private_display->func_hwc_window;
116
117         if (!func_hwc_window->hwc_window_set_composition_type) {
118                 /* LCOV_EXCL_START */
119                 _pthread_mutex_unlock(&private_display->lock);
120                 TDM_ERR("not implemented!!");
121                 return TDM_ERROR_NOT_IMPLEMENTED;
122                 /* LCOV_EXCL_STOP */
123         }
124
125         ret = func_hwc_window->hwc_window_set_composition_type(private_hwc_window->hwc_window_backend, composition_type);
126
127         _pthread_mutex_unlock(&private_display->lock);
128
129         return ret;
130 }
131
132 EXTERN tdm_error
133 tdm_hwc_window_set_buffer_damage(tdm_hwc_window *hwc_window, tdm_hwc_region damage)
134 {
135         tdm_func_hwc_window *func_hwc_window = NULL;
136
137         HWC_WINDOW_FUNC_ENTRY();
138         if (damage.num_rects > 0)
139                 TDM_RETURN_VAL_IF_FAIL(damage.rects != NULL, TDM_ERROR_INVALID_PARAMETER);
140
141         _pthread_mutex_lock(&private_display->lock);
142
143         func_hwc_window = &private_display->func_hwc_window;
144
145         if (!func_hwc_window->hwc_window_set_buffer_damage) {
146                 /* LCOV_EXCL_START */
147                 _pthread_mutex_unlock(&private_display->lock);
148                 TDM_ERR("not implemented!!");
149                 return TDM_ERROR_NOT_IMPLEMENTED;
150                 /* LCOV_EXCL_STOP */
151         }
152
153         ret = func_hwc_window->hwc_window_set_buffer_damage(private_hwc_window->hwc_window_backend, damage);
154
155         _pthread_mutex_unlock(&private_display->lock);
156
157         return ret;
158 }
159
160
161 EXTERN tdm_error
162 tdm_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info)
163 {
164         tdm_func_hwc_window *func_hwc_window = NULL;
165         char fmtstr[128];
166
167         HWC_WINDOW_FUNC_ENTRY();
168
169         TDM_RETURN_VAL_IF_FAIL(info != NULL, TDM_ERROR_INVALID_PARAMETER);
170
171         _pthread_mutex_lock(&private_display->lock);
172
173         func_hwc_window = &private_display->func_hwc_window;
174
175         if (!func_hwc_window->hwc_window_set_info) {
176                 /* LCOV_EXCL_START */
177                 _pthread_mutex_unlock(&private_display->lock);
178                 TDM_ERR("not implemented!!");
179                 return TDM_ERROR_NOT_IMPLEMENTED;
180                 /* LCOV_EXCL_STOP */
181         }
182
183         if (info->src_config.format)
184                 snprintf(fmtstr, 128, "%c%c%c%c", FOURCC_STR(info->src_config.format));
185         else
186                 snprintf(fmtstr, 128, "NONE");
187
188         TDM_INFO("hwc_window(%p) info: src(%dx%d %d,%d %dx%d %s) dst(%d,%d %dx%d) trans(%d)",
189                          private_hwc_window, info->src_config.size.h, info->src_config.size.v,
190                          info->src_config.pos.x, info->src_config.pos.y,
191                          info->src_config.pos.w, info->src_config.pos.h,
192                          fmtstr,
193                          info->dst_pos.x, info->dst_pos.y,
194                          info->dst_pos.w, info->dst_pos.h,
195                          info->transform);
196
197         ret = func_hwc_window->hwc_window_set_info(private_hwc_window->hwc_window_backend, info);
198         if (ret == TDM_ERROR_NONE) {
199                 if (memcmp(&private_hwc_window->info, info, sizeof(tdm_hwc_window_info)) != 0)
200                         private_hwc_window->info = *info;
201         }
202
203         _pthread_mutex_unlock(&private_display->lock);
204
205         return ret;
206 }
207
208 EXTERN tdm_error
209 tdm_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h buffer)
210 {
211         tdm_func_hwc_window *func_hwc_window;
212
213         HWC_WINDOW_FUNC_ENTRY();
214
215         _pthread_mutex_lock(&private_display->lock);
216
217         if ((tdm_debug_dump & TDM_DUMP_FLAG_WINDOW) && buffer) {
218                 /* LCOV_EXCL_START */
219                 char str[TDM_PATH_LEN];
220                 static int i;
221                 snprintf(str, TDM_PATH_LEN, "window_%d_%03d", private_output->index, i++);
222                 tdm_helper_dump_buffer_str(buffer, tdm_debug_dump_dir, str);
223                 /* LCOV_EXCL_STOP */
224         }
225
226         func_hwc_window = &private_display->func_hwc_window;
227
228         if (!func_hwc_window->hwc_window_set_buffer) {
229                 /* LCOV_EXCL_START */
230                 _pthread_mutex_unlock(&private_display->lock);
231                 TDM_ERR("not implemented!!");
232                 return TDM_ERROR_NOT_IMPLEMENTED;
233                 /* LCOV_EXCL_STOP */
234         }
235
236         ret = func_hwc_window->hwc_window_set_buffer(private_hwc_window->hwc_window_backend, buffer);
237         if (ret == TDM_ERROR_NONE)
238                 private_hwc_window->buffer = buffer;
239
240         _pthread_mutex_unlock(&private_display->lock);
241
242         return ret;
243 }
244
245 INTERN tdm_hwc_window *
246 tdm_hwc_window_create_internal(tdm_private_output *private_output, int is_video,
247                                                                    tdm_error *error)
248 {
249         tdm_private_display *private_display = private_output->private_display;
250         tdm_func_output *func_output = &private_display->func_output;
251         tdm_private_hwc_window *private_hwc_window = NULL;
252         tdm_hwc_window *hwc_window_backend = NULL;
253         tdm_error ret = TDM_ERROR_NONE;
254
255         TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), NULL);
256
257         if (!is_video) {
258                 if (!func_output->output_hwc_create_window) {
259                         /* LCOV_EXCL_START */
260                         if (error)
261                                 *error = TDM_ERROR_BAD_MODULE;
262                         return NULL;
263                         /* LCOV_EXCL_STOP */
264                 }
265
266                 hwc_window_backend = func_output->output_hwc_create_window(
267                                                  private_output->output_backend, &ret);
268                 if (ret != TDM_ERROR_NONE) {
269                         if (error)
270                                 *error = ret;
271                         return NULL;
272                 }
273         } else {
274                 if (!func_output->output_hwc_create_video_window) {
275                         /* LCOV_EXCL_START */
276                         if (error)
277                                 *error = TDM_ERROR_NOT_IMPLEMENTED;
278                         return NULL;
279                         /* LCOV_EXCL_STOP */
280                 }
281
282                 hwc_window_backend = func_output->output_hwc_create_video_window(
283                                                  private_output->output_backend, &ret);
284                 if (ret != TDM_ERROR_NONE) {
285                         if (error)
286                                 *error = ret;
287                         return NULL;
288                 }
289         }
290
291         private_hwc_window = calloc(1, sizeof(tdm_private_hwc_window));
292         if (!private_hwc_window) {
293                 /* LCOV_EXCL_START */
294                 TDM_ERR("failed: alloc memory");
295                 func_output->output_hwc_destroy_window(private_output->output_backend, hwc_window_backend);
296                 if (error)
297                         *error = TDM_ERROR_OUT_OF_MEMORY;
298                 return NULL;
299                 /* LCOV_EXCL_STOP */
300         }
301
302         LIST_ADD(&private_hwc_window->link, &private_output->hwc_window_list);
303
304         private_hwc_window->private_display = private_display;
305         private_hwc_window->private_output = private_output;
306         private_hwc_window->hwc_window_backend = hwc_window_backend;
307
308         TDM_DBG("hwc_window(%p) create", private_hwc_window);
309
310         if (error)
311                 *error = TDM_ERROR_NONE;
312
313         return private_hwc_window;
314 }
315
316 INTERN tdm_error
317 tdm_hwc_window_destroy_internal(tdm_private_hwc_window * private_hwc_window)
318 {
319         tdm_private_display *private_display;
320         tdm_private_output *private_output;
321         tdm_func_output *func_output;
322
323         TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), TDM_ERROR_OPERATION_FAILED);
324
325         if (!private_hwc_window)
326                 return TDM_ERROR_OPERATION_FAILED;
327
328         private_display = private_hwc_window->private_display;
329         private_output = private_hwc_window->private_output;
330
331         LIST_DEL(&private_hwc_window->link);
332
333         func_output = &private_display->func_output;
334         func_output->output_hwc_destroy_window(private_output->output_backend, private_hwc_window->hwc_window_backend);
335
336         free(private_hwc_window);
337         return TDM_ERROR_NONE;
338 }
339
340 EXTERN tdm_error
341 tdm_hwc_window_set_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
342 {
343         tdm_func_hwc_window *func_hwc_window = NULL;
344
345         HWC_WINDOW_FUNC_ENTRY();
346
347         _pthread_mutex_lock(&private_display->lock);
348
349         func_hwc_window = &private_display->func_hwc_window;
350
351         if (!func_hwc_window->hwc_window_set_flags) {
352                 /* LCOV_EXCL_START */
353                 _pthread_mutex_unlock(&private_display->lock);
354                 TDM_ERR("not implemented!!");
355                 return TDM_ERROR_NOT_IMPLEMENTED;
356                 /* LCOV_EXCL_STOP */
357         }
358
359         ret = func_hwc_window->hwc_window_set_flags(private_hwc_window->hwc_window_backend, flags);
360
361         _pthread_mutex_unlock(&private_display->lock);
362
363         return ret;
364 }
365
366 EXTERN tdm_error
367 tdm_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
368 {
369         tdm_func_hwc_window *func_hwc_window = NULL;
370
371         HWC_WINDOW_FUNC_ENTRY();
372
373         _pthread_mutex_lock(&private_display->lock);
374
375         func_hwc_window = &private_display->func_hwc_window;
376
377         if (!func_hwc_window->hwc_window_unset_flags) {
378                 /* LCOV_EXCL_START */
379                 _pthread_mutex_unlock(&private_display->lock);
380                 TDM_ERR("not implemented!!");
381                 return TDM_ERROR_NOT_IMPLEMENTED;
382                 /* LCOV_EXCL_STOP */
383         }
384
385         ret = func_hwc_window->hwc_window_unset_flags(private_hwc_window->hwc_window_backend, flags);
386
387         _pthread_mutex_unlock(&private_display->lock);
388
389         return ret;
390 }
391
392 static void
393 _tdm_hwc_window_layer_commit_handler(tdm_layer *layer, unsigned int sequence,
394                                                                                  unsigned int tv_sec, unsigned int tv_usec,
395                                                                                  void *user_data)
396 {
397         tdm_private_hwc_window_commit_handler *hwc_window_commit_handler = (tdm_private_hwc_window_commit_handler *)user_data;
398         tdm_hwc_window_commit_handler func = hwc_window_commit_handler->func;
399         tdm_hwc_window *hwc_window = (tdm_hwc_window *)hwc_window_commit_handler->private_hwc_window;
400         void *data = hwc_window_commit_handler->user_data;
401
402         func(hwc_window, sequence, tv_sec, tv_usec, data);
403
404         free(hwc_window_commit_handler);
405 }
406
407 tdm_error
408 tdm_hwc_window_commit(tdm_hwc_window *hwc_window, tdm_hwc_window_commit_handler func, void *user_data)
409 {
410         tdm_func_hwc_window *func_hwc_window = NULL;
411         tdm_private_hwc_window_commit_handler *hwc_window_commit_handler;
412         tdm_layer *layer = NULL;
413         tdm_private_layer *private_layer;
414         tdm_info_layer *info_layer;
415
416         HWC_WINDOW_FUNC_ENTRY();
417
418         _pthread_mutex_lock(&private_display->lock);
419
420         func_hwc_window = &private_display->func_hwc_window;
421
422         if (!func_hwc_window->hwc_window_get_layer) {
423                 /* LCOV_EXCL_START */
424                 _pthread_mutex_unlock(&private_display->lock);
425                 TDM_ERR("not implemented!!");
426                 return TDM_ERROR_NOT_IMPLEMENTED;
427                 /* LCOV_EXCL_STOP */
428         }
429
430         layer = func_hwc_window->hwc_window_get_layer(private_hwc_window->hwc_window_backend,
431                                                                                                                    &ret);
432         if (!layer) {
433                 /* LCOV_EXCL_START */
434                 _pthread_mutex_unlock(&private_display->lock);
435                 TDM_ERR("no assigned layer!!");
436                 return TDM_ERROR_INVALID_PARAMETER;
437                 /* LCOV_EXCL_STOP */
438         }
439
440         private_layer = (tdm_private_layer*)layer;
441
442     info_layer = (tdm_info_layer *)&private_window->info;
443         ret = tdm_layer_set_info_internal(private_layer, info_layer);
444         if (ret != TDM_ERROR_NONE) {
445                 /* LCOV_EXCL_START */
446                 TDM_ERR("failed: layer set info(window)");
447                 /* LCOV_EXCL_STOP */
448                 return ret;
449         }
450         
451         if (private_window->buffer)
452                 ret = tdm_layer_set_buffer_internal(private_layer, private_window->buffer);
453         else
454                 ret = tdm_layer_unset_buffer_internal(private_layer);
455         if (ret != TDM_ERROR_NONE) {
456                 /* LCOV_EXCL_START */
457                 TDM_ERR("failed: layer set info(window)");
458                 /* LCOV_EXCL_STOP */
459                 return ret;
460         }
461
462         hwc_window_commit_handler = calloc(1, sizeof(tdm_private_hwc_window_commit_handler));
463         if (!hwc_window_commit_handler) {
464                 /* LCOV_EXCL_START */
465                 TDM_ERR("failed: alloc memory");
466                 return TDM_ERROR_OUT_OF_MEMORY;
467                 /* LCOV_EXCL_STOP */
468         }
469
470         hwc_window_commit_handler->private_hwc_window = private_hwc_window;
471         hwc_window_commit_handler->func = func;
472         hwc_window_commit_handler->user_data = user_data;
473
474         ret = tdm_layer_commit_internal(private_layer, _tdm_hwc_window_layer_commit_handler, user_data);
475         if (ret != TDM_ERROR_NONE) {
476                 /* LCOV_EXCL_START */
477                 TDM_ERR("failed: commit layer(window)");
478                 free(hwc_window_commit_handler);
479                 /* LCOV_EXCL_STOP */
480                 return ret;
481         }
482
483         _pthread_mutex_unlock(&private_display->lock);
484
485         return ret;
486 }
487
488 EXTERN tdm_error
489 tdm_hwc_window_video_get_capability(tdm_hwc_window *hwc_window,
490                                                                         tdm_hwc_window_video_capability *video_capability)
491 {
492         tdm_func_hwc_window *func_hwc_window = NULL;
493
494         HWC_WINDOW_FUNC_ENTRY();
495
496         TDM_RETURN_VAL_IF_FAIL(video_capability != NULL, TDM_ERROR_INVALID_PARAMETER);
497
498         _pthread_mutex_lock(&private_display->lock);
499
500         func_hwc_window = &private_display->func_hwc_window;
501
502         if (!func_hwc_window->hwc_window_video_get_capability) {
503                 /* LCOV_EXCL_START */
504                 _pthread_mutex_unlock(&private_display->lock);
505                 TDM_ERR("not implemented!!");
506                 return TDM_ERROR_NOT_IMPLEMENTED;
507                 /* LCOV_EXCL_STOP */
508         }
509
510         ret = func_hwc_window->hwc_window_video_get_capability(private_hwc_window->hwc_window_backend,
511                                                                                                                    video_capability);
512
513         _pthread_mutex_unlock(&private_display->lock);
514
515         return ret;
516 }
517
518 EXTERN tdm_error
519 tdm_hwc_window_video_get_available_properties(tdm_hwc_window *hwc_window,
520                                                                                           const tdm_prop **props, int *count)
521 {
522         tdm_func_hwc_window *func_hwc_window = NULL;
523
524         HWC_WINDOW_FUNC_ENTRY();
525
526         TDM_RETURN_VAL_IF_FAIL(props != NULL, TDM_ERROR_INVALID_PARAMETER);
527         TDM_RETURN_VAL_IF_FAIL(count != NULL, TDM_ERROR_INVALID_PARAMETER);
528
529         _pthread_mutex_lock(&private_display->lock);
530
531         func_hwc_window = &private_display->func_hwc_window;
532
533         if (!func_hwc_window->hwc_window_video_get_available_properties) {
534                 /* LCOV_EXCL_START */
535                 _pthread_mutex_unlock(&private_display->lock);
536                 TDM_ERR("not implemented!!");
537                 return TDM_ERROR_NOT_IMPLEMENTED;
538                 /* LCOV_EXCL_STOP */
539         }
540
541         ret = func_hwc_window->hwc_window_video_get_available_properties(private_hwc_window->hwc_window_backend,
542                                                                                                                                          props, count);
543
544         _pthread_mutex_unlock(&private_display->lock);
545
546         return ret;
547 }
548
549 EXTERN tdm_error
550 tdm_hwc_window_video_get_property(tdm_hwc_window *hwc_window,
551                                                                         unsigned int id, tdm_value *value)
552 {
553         tdm_func_hwc_window *func_hwc_window = NULL;
554
555         HWC_WINDOW_FUNC_ENTRY();
556
557         TDM_RETURN_VAL_IF_FAIL(value != NULL, TDM_ERROR_INVALID_PARAMETER);
558
559         _pthread_mutex_lock(&private_display->lock);
560
561         func_hwc_window = &private_display->func_hwc_window;
562
563         if (!func_hwc_window->hwc_window_video_get_property) {
564                 /* LCOV_EXCL_START */
565                 _pthread_mutex_unlock(&private_display->lock);
566                 TDM_ERR("not implemented!!");
567                 return TDM_ERROR_NOT_IMPLEMENTED;
568                 /* LCOV_EXCL_STOP */
569         }
570
571         ret = func_hwc_window->hwc_window_video_get_property(private_hwc_window->hwc_window_backend,
572                                                                                                                  id, value);
573
574         _pthread_mutex_unlock(&private_display->lock);
575
576         return ret;
577 }
578
579 EXTERN tdm_error
580 tdm_hwc_window_video_set_property(tdm_hwc_window *hwc_window,
581                                                                         unsigned int id, tdm_value value)
582 {
583         tdm_func_hwc_window *func_hwc_window = NULL;
584
585         HWC_WINDOW_FUNC_ENTRY();
586
587         _pthread_mutex_lock(&private_display->lock);
588
589         func_hwc_window = &private_display->func_hwc_window;
590
591         if (!func_hwc_window->hwc_window_video_set_property) {
592                 /* LCOV_EXCL_START */
593                 _pthread_mutex_unlock(&private_display->lock);
594                 TDM_ERR("not implemented!!");
595                 return TDM_ERROR_NOT_IMPLEMENTED;
596                 /* LCOV_EXCL_STOP */
597         }
598
599         ret = func_hwc_window->hwc_window_video_set_property(private_hwc_window->hwc_window_backend,
600                                                                                                                  id, value);
601
602         _pthread_mutex_unlock(&private_display->lock);
603
604         return ret;
605 }