Home | History | Annotate | Download | only in libgscaler

Lines Matching refs:GSC_HANDLE

304     struct GSC_HANDLE *gsc_handle,
325 gsc_handle->out_mode = out_mode;
402 gsc_handle->gsc_sd_entity = gsc_sd_entity;
403 gsc_handle->gsc_vd_entity = gsc_vd_entity;
404 gsc_handle->sink_sd_entity = sink_sd_entity;
405 gsc_handle->media0 = media0;
471 static bool m_exynos_gsc_out_destroy(struct GSC_HANDLE *gsc_handle)
478 if (gsc_handle == NULL) {
479 ALOGE("%s::gsc_handle is NULL", __func__);
483 if (gsc_handle->src.stream_on == true) {
484 if (exynos_gsc_out_stop((void *)gsc_handle) < 0)
487 gsc_handle->src.stream_on = false;
491 for (i = 0; i < (int) gsc_handle->gsc_sd_entity->num_links; i++) {
492 links = &gsc_handle->gsc_sd_entity->links[i];
494 if (links == NULL || links->source->entity != gsc_handle->gsc_sd_entity ||
495 links->sink->entity != gsc_handle->sink_sd_entity) {
497 } else if (exynos_media_setup_link(gsc_handle->media0, links->source,
504 close(gsc_handle->gsc_vd_entity->fd);
505 close(gsc_handle->gsc_sd_entity->fd);
506 gsc_handle->gsc_vd_entity->fd = -1;
507 gsc_handle->gsc_vd_entity->fd = -1;
516 struct GSC_HANDLE *gsc_handle)
523 exynos_gsc_m2m_stop(gsc_handle);
525 if (0 < gsc_handle->gsc_fd)
526 close(gsc_handle->gsc_fd);
527 gsc_handle->gsc_fd = 0;
535 struct GSC_HANDLE *gsc_handle)
550 if (exynos_mutex_trylock(gsc_handle->obj_mutex[i]) == true) {
553 m_exynos_gsc_destroy(gsc_handle);
556 gsc_handle->gsc_id = i;
557 gsc_handle->gsc_fd = m_exynos_gsc_m2m_create(i);
558 if (gsc_handle->gsc_fd < 0) {
559 gsc_handle->gsc_fd = 0;
560 exynos_mutex_unlock(gsc_handle->obj_mutex[i]);
564 if (gsc_handle->cur_obj_mutex)
565 gsc_handle->cur_obj_mutex);
567 gsc_handle->cur_obj_mutex = gsc_handle->obj_mutex[i];
714 struct GSC_HANDLE *gsc_handle = (struct GSC_HANDLE *)malloc(sizeof(struct GSC_HANDLE));
715 if (gsc_handle == NULL) {
716 ALOGE("%s::malloc(struct GSC_HANDLE) fail", __func__);
720 gsc_handle->gsc_fd = 0;
721 memset(&gsc_handle->src, 0, sizeof(struct gsc_info));
722 memset(&gsc_handle->dst, 0, sizeof(struct gsc_info));
724 gsc_handle->src.buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
725 gsc_handle->dst.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
727 gsc_handle->op_mutex = NULL;
729 gsc_handle->obj_mutex[i] = NULL;
731 gsc_handle->cur_obj_mutex = NULL;
732 gsc_handle->flag_local_path = false;
733 gsc_handle->flag_exclusive_open = false;
738 gsc_handle->op_mutex = exynos_mutex_create(EXYNOS_MUTEX_TYPE_PRIVATE, mutex_name);
739 if (gsc_handle->op_mutex == NULL) {
744 exynos_mutex_lock(gsc_handle->op_mutex);
750 gsc_handle->obj_mutex[i] = exynos_mutex_create(EXYNOS_MUTEX_TYPE_SHARED, mutex_name);
751 if (gsc_handle->obj_mutex[i] == NULL) {
757 if (m_exynos_gsc_find_and_trylock_and_create(gsc_handle) == false) {
762 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
763 exynos_mutex_unlock(gsc_handle->op_mutex);
765 return (void *)gsc_handle;
768 if (gsc_handle) {
769 m_exynos_gsc_destroy(gsc_handle);
771 if (gsc_handle->cur_obj_mutex)
772 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
775 if ((gsc_handle->obj_mutex[i] != NULL) &&
776 (exynos_mutex_get_created_status(gsc_handle->obj_mutex[i]) == true)) {
777 if (exynos_mutex_destroy(gsc_handle->obj_mutex[i]) == false)
782 if (gsc_handle->op_mutex)
783 exynos_mutex_unlock(gsc_handle->op_mutex);
785 if (exynos_mutex_destroy(gsc_handle->op_mutex) == false)
788 free(gsc_handle);
807 struct GSC_HANDLE *gsc_handle = (struct GSC_HANDLE *)malloc(sizeof(struct GSC_HANDLE));
808 if (gsc_handle == NULL) {
809 ALOGE("%s::malloc(struct GSC_HANDLE) fail", __func__);
813 gsc_handle->gsc_fd = -1;
814 gsc_handle->op_mutex = NULL;
815 gsc_handle->cur_obj_mutex = NULL;
818 gsc_handle->cur_obj_mutex = exynos_mutex_create(EXYNOS_MUTEX_TYPE_SHARED, mutex_name);
819 if (gsc_handle->cur_obj_mutex == NULL) {
825 if (exynos_mutex_trylock(gsc_handle->cur_obj_mutex) == true) {
835 return (void *)gsc_handle;
838 if (gsc_handle) {
839 free(gsc_handle);
847 struct GSC_HANDLE *gsc_handle = (struct GSC_HANDLE *)handle;
854 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
855 exynos_mutex_destroy(gsc_handle->cur_obj_mutex);
856 free(gsc_handle);
892 struct GSC_HANDLE *gsc_handle = (struct GSC_HANDLE *)malloc(sizeof(struct GSC_HANDLE));
893 if (gsc_handle == NULL) {
894 ALOGE("%s::malloc(struct GSC_HANDLE) fail", __func__);
897 memset(gsc_handle, 0, sizeof(struct GSC_HANDLE));
898 gsc_handle->gsc_fd = -1;
899 gsc_handle->gsc_mode = mode;
900 gsc_handle->gsc_id = dev_num;
901 gsc_handle->allow_drm = allow_drm;
903 gsc_handle->src.buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
904 gsc_handle->dst.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
906 gsc_handle->op_mutex = NULL;
908 gsc_handle->obj_mutex[i] = NULL;
910 gsc_handle->cur_obj_mutex = NULL;
911 gsc_handle->flag_local_path = false;
912 gsc_handle->flag_exclusive_open = true;
917 gsc_handle->op_mutex = exynos_mutex_create(EXYNOS_MUTEX_TYPE_PRIVATE, mutex_name);
918 if (gsc_handle->op_mutex == NULL) {
923 exynos_mutex_lock(gsc_handle->op_mutex);
926 gsc_handle->cur_obj_mutex = exynos_mutex_create(EXYNOS_MUTEX_TYPE_SHARED, mutex_name);
927 if (gsc_handle->cur_obj_mutex == NULL) {
933 if (exynos_mutex_trylock(gsc_handle->cur_obj_mutex) == true) {
935 gsc_handle->gsc_fd = m_exynos_gsc_m2m_create(dev_num);
936 if (gsc_handle->gsc_fd < 0) {
941 ret = m_exynos_gsc_output_create(gsc_handle, dev_num, out_mode);
948 gsc_handle->gsc_fd = m_exynos_gsc_capture_create(dev_num);*/
958 exynos_mutex_unlock(gsc_handle->op_mutex);
961 return (void *)gsc_handle;
965 if (gsc_handle) {
966 m_exynos_gsc_destroy(gsc_handle);
968 if (gsc_handle->cur_obj_mutex)
969 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
972 if ((gsc_handle->obj_mutex[i] != NULL) &&
973 (exynos_mutex_get_created_status(gsc_handle->obj_mutex[i]) == true)) {
974 if (exynos_mutex_destroy(gsc_handle->obj_mutex[i]) == false)
979 if (gsc_handle->op_mutex)
980 exynos_mutex_unlock(gsc_handle->op_mutex);
982 if (exynos_mutex_destroy(gsc_handle->op_mutex) == false)
985 free(gsc_handle);
997 struct GSC_HANDLE *gsc_handle = (struct GSC_HANDLE *)handle;
1006 exynos_mutex_lock(gsc_handle->op_mutex);
1008 if (gsc_handle->flag_exclusive_open == false)
1009 exynos_mutex_lock(gsc_handle->cur_obj_mutex);
1011 if (gsc_handle->gsc_mode == GSC_OUTPUT_MODE)
1012 m_exynos_gsc_out_destroy(gsc_handle);
1014 m_exynos_gsc_destroy(gsc_handle);
1016 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
1019 if ((gsc_handle->obj_mutex[i] != NULL) &&
1020 (exynos_mutex_get_created_status(gsc_handle->obj_mutex[i]) == true)) {
1021 if (exynos_mutex_destroy(gsc_handle->obj_mutex[i]) == false)
1026 exynos_mutex_unlock(gsc_handle->op_mutex);
1028 if (exynos_mutex_destroy(gsc_handle->op_mutex) == false)
1031 if (gsc_handle)
1032 free(gsc_handle);
1052 struct GSC_HANDLE *gsc_handle;
1053 gsc_handle = (struct GSC_HANDLE *)handle;
1060 exynos_mutex_lock(gsc_handle->op_mutex);
1062 gsc_handle->src.width = width;
1063 gsc_handle->src.height = height;
1064 gsc_handle->src.crop_left = crop_left;
1065 gsc_handle->src.crop_top = crop_top;
1066 gsc_handle->src.crop_width = crop_width;
1067 gsc_handle->src.crop_height = crop_height;
1068 gsc_handle->src.v4l2_colorformat = v4l2_colorformat;
1069 gsc_handle->src.cacheable = cacheable;
1070 gsc_handle->src.mode_drm = mode_drm;
1071 gsc_handle->src.dirty = true;
1074 exynos_mutex_unlock(gsc_handle->op_mutex);
1096 struct GSC_HANDLE *gsc_handle;
1097 gsc_handle = (struct GSC_HANDLE *)handle;
1104 exynos_mutex_lock(gsc_handle->op_mutex);
1106 gsc_handle->dst.width = width;
1107 gsc_handle->dst.height = height;
1108 gsc_handle->dst.crop_left = crop_left;
1109 gsc_handle
1110 gsc_handle->dst.crop_width = crop_width;
1111 gsc_handle->dst.crop_height = crop_height;
1112 gsc_handle->dst.v4l2_colorformat = v4l2_colorformat;
1113 gsc_handle->dst.cacheable = cacheable;
1114 gsc_handle->dst.mode_drm = mode_drm;
1115 gsc_handle->dst.dirty = true;
1116 gsc_handle->dst.csc_range = !narrowRgb;
1118 exynos_mutex_unlock(gsc_handle->op_mutex);
1131 struct GSC_HANDLE *gsc_handle;
1132 gsc_handle = (struct GSC_HANDLE *)handle;
1139 exynos_mutex_lock(gsc_handle->op_mutex);
1151 gsc_handle->dst.rotation = new_rotation;
1152 gsc_handle->dst.flip_horizontal = flip_horizontal;
1153 gsc_handle->dst.flip_vertical = flip_vertical;
1157 exynos_mutex_unlock(gsc_handle->op_mutex);
1167 struct GSC_HANDLE *gsc_handle;
1168 gsc_handle = (struct GSC_HANDLE *)handle;
1177 exynos_mutex_lock(gsc_handle->op_mutex);
1179 gsc_handle->src.addr[0] = addr[0];
1180 gsc_handle->src.addr[1] = addr[1];
1181 gsc_handle->src.addr[2] = addr[2];
1182 gsc_handle->src.acquireFenceFd = acquireFenceFd;
1184 exynos_mutex_unlock(gsc_handle->op_mutex);
1196 struct GSC_HANDLE *gsc_handle;
1197 gsc_handle = (struct GSC_HANDLE *)handle;
1207 exynos_mutex_lock(gsc_handle->op_mutex);
1209 gsc_handle->dst.addr[0] = addr[0];
1210 gsc_handle->dst.addr[1] = addr[1];
1211 gsc_handle->dst.addr[2] = addr[2];
1212 gsc_handle->dst.acquireFenceFd = acquireFenceFd;
1215 exynos_mutex_unlock(gsc_handle->op_mutex);
1325 struct GSC_HANDLE *gsc_handle;
1335 gsc_handle = (struct GSC_HANDLE *)handle;
1336 if (gsc_handle == NULL) {
1337 ALOGE("%s::gsc_handle == NULL() fail", __func__);
1341 if ((src_img->drmMode && !gsc_handle->allow_drm) ||
1344 __func__, gsc_handle->gsc_id,
1352 exynos_gsc_set_rotation(gsc_handle, rotate, hflip, vflip);
1354 ret = exynos_gsc_set_src_format(gsc_handle, src_img->fw, src_img->fh,
1364 ret = exynos_gsc_set_dst_format(gsc_handle, dst_img->fw, dst_img->fh,
1384 struct GSC_HANDLE *gsc_handle;
1403 gsc_handle = (struct GSC_HANDLE *)handle;
1404 if (gsc_handle == NULL) {
1405 ALOGE("%s::gsc_handle == NULL() fail", __func__);
1411 if (gsc_handle->src.stream_on != false) {
1416 memcpy(&gsc_handle->src_img, src_img, sizeof(exynos_gsc_img));
1417 memcpy(&gsc_handle->dst_img, dst_img, sizeof(exynos_gsc_img));
1425 if (m_exynos_gsc_check_src_size(&gsc_handle->src_img.fw, &gsc_handle->src_img.fh,
1426 &gsc_handle->src_img.x, &gsc_handle->src_img.y,
1427 &gsc_handle->src_img.w, &gsc_handle->src_img.h,
1433 if (m_exynos_gsc_check_dst_size(&gsc_handle->dst_img.fw, &gsc_handle->dst_img.fh,
1434 &gsc_handle->dst_img.x, &gsc_handle->dst_img.y,
1435 &gsc_handle->dst_img.w, &gsc_handle->dst_img.h,
1443 gsc_handle->src.src_buf_idx = 0;
1444 gsc_handle->src.qbuf_cnt = 0;
1448 if (gsc_handle->out_mode == GSC_OUT_FIMD) {
1449 sd_fmt.format.width = gsc_handle->dst_img.fw;
1450 sd_fmt.format.height = gsc_handle->dst_img.fh;
1452 sd_fmt.format.width = gsc_handle->dst_img.w;
1453 sd_fmt.format.height = gsc_handle->dst_img.h;
1457 if (exynos_subdev_s_fmt(gsc_handle->gsc_sd_entity->fd, &sd_fmt) < 0) {
1465 if (gsc_handle->out_mode == GSC_OUT_FIMD) {
1466 sd_crop.rect.left = gsc_handle->dst_img.x;
1467 sd_crop.rect.top = gsc_handle->dst_img.y;
1468 sd_crop.rect.width = gsc_handle->dst_img.w;
1469 sd_crop.rect.height = gsc_handle->dst_img.h;
1473 sd_crop.rect.width = gsc_handle->dst_img.w;
1474 sd_crop.rect.height = gsc_handle->dst_img.h;
1476 if (exynos_subdev_s_crop(gsc_handle->gsc_sd_entity->fd, &sd_crop) < 0) {
1483 if (gsc_handle->out_mode == GSC_OUT_FIMD) {
1485 sd_fmt.format.width = gsc_handle->dst_img.w;
1486 sd_fmt.format.height = gsc_handle->dst_img.h;
1489 sd_fmt.format.width = gsc_handle->dst_img.w + gsc_handle->dst_img.x*2;
1490 sd_fmt.format.height = gsc_handle->dst_img.h + gsc_handle->dst_img.y*2;
1496 if (exynos_subdev_s_fmt(gsc_handle->sink_sd_entity->fd, &sd_fmt) < 0) {
1502 if (gsc_handle->out_mode == GSC_OUT_FIMD)
1508 if (gsc_handle->out_mode == GSC_OUT_FIMD) {
1509 sd_crop.rect.left = gsc_handle->dst_img.x;
1510 sd_crop.rect.top = gsc_handle->dst_img.y;
1511 sd_crop.rect.width = gsc_handle->dst_img.w;
1512 sd_crop.rect.height = gsc_handle->dst_img.h;
1516 sd_crop.rect.width = gsc_handle->dst_img.w;
1517 sd_crop.rect.height = gsc_handle->dst_img.h;
1519 if (exynos_subdev_s_crop(gsc_handle->sink_sd_entity->fd, &sd_crop) < 0) {
1524 if (gsc_handle->out_mode != GSC_OUT_FIMD) {
1527 sd_fmt.format.width = gsc_handle->dst_img.w + gsc_handle->dst_img.x*2;
1528 sd_fmt.format.height = gsc_handle->dst_img.h + gsc_handle->dst_img.y*2;
1530 if (exynos_subdev_s_fmt(gsc_handle->sink_sd_entity->fd, &sd_fmt) < 0) {
1537 sd_crop.rect.left = gsc_handle->dst_img.x;
1538 sd_crop.rect.top = gsc_handle->dst_img.y;
1539 sd_crop.rect.width = gsc_handle->dst_img.w;
1540 sd_crop.rect.height = gsc_handle->dst_img.h;
1541 if (exynos_subdev_s_crop(gsc_handle->sink_sd_entity->fd, &sd_crop) < 0) {
1548 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd, V4L2_CID_ROTATE, rotate) < 0) {
1553 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd, V4L2_CID_HFLIP, hflip) < 0) {
1558 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd, V4L2_CID_VFLIP, vflip) < 0) {
1563 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd, V4L2_CID_CACHEABLE, 1) < 0) {
1568 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd,
1569 V4L2_CID_CONTENT_PROTECTION, gsc_handle->src_img.drmMode) < 0) {
1574 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_vd_entity->fd, V4L2_CID_CSC_RANGE,
1583 fmt.fmt.pix_mp.width = gsc_handle->src_img.fw;
1584 fmt.fmt.pix_mp.height = gsc_handle->src_img.fh;
1589 if (exynos_v4l2_s_fmt(gsc_handle->gsc_vd_entity->fd, &fmt) < 0) {
1596 crop.c.left = gsc_handle->src_img.x;
1597 crop.c.top = gsc_handle->src_img.y;
1598 crop.c.width = gsc_handle->src_img.w;
1599 crop.c.height = gsc_handle->src_img.h;
1601 if (exynos_v4l2_s_crop(gsc_handle->gsc_vd_entity->fd, &crop) < 0) {
1610 gsc_handle->gsc_vd_entity->fd, &reqbuf) < 0) {
1623 struct GSC_HANDLE *gsc_handle;
1631 gsc_handle = (struct GSC_HANDLE *)handle;
1638 if (gsc_handle->src.qbuf_cnt == MAX_BUFFERS_GSCALER_OUT) {
1648 if (exynos_v4l2_dqbuf(gsc_handle->gsc_vd_entity->fd, &buf) < 0) {
1650 gsc_handle->src.src_buf_idx, MAX_BUFFERS_GSCALER_OUT);
1653 gsc_handle->src.qbuf_cnt--;
1660 src_color_space = HAL_PIXEL_FORMAT_2_V4L2_PIX(gsc_handle->src_img.format);
1668 buf.index = gsc_handle->src.src_buf_idx;
1672 gsc_handle->src.addr[0] = src_img->yaddr;
1673 gsc_handle->src.addr[1] = src_img->uaddr;
1674 gsc_handle->src.addr[2] = src_img->vaddr;
1677 gsc_handle->src_img.fw * gsc_handle->src_img.fh, src_planes) != true) {
1683 buf.m.planes[i].m.fd = (int)gsc_handle->src.addr[i];
1689 if (exynos_v4l2_qbuf(gsc_handle->gsc_vd_entity->fd, &buf) < 0) {
1691 gsc_handle->src.src_buf_idx, MAX_BUFFERS_GSCALER_OUT);
1694 gsc_handle->src.src_buf_idx++;
1695 gsc_handle->src.src_buf_idx = gsc_handle->src.src_buf_idx % MAX_BUFFERS_GSCALER_OUT;
1696 gsc_handle->src.qbuf_cnt++;
1698 if (gsc_handle->src.stream_on == false) {
1699 if (exynos_v4l2_streamon(gsc_handle->gsc_vd_entity->fd, buf.type) < 0) {
1703 gsc_handle->src.stream_on = true;
1712 struct GSC_HANDLE *gsc_handle;
1720 gsc_handle = (struct GSC_HANDLE *)handle;
1726 if (gsc_handle->src.stream_on == true) {
1727 if (exynos_v4l2_streamoff(gsc_handle->gsc_vd_entity->fd,
1732 gsc_handle->src.stream_on = false;
1735 gsc_handle->src.src_buf_idx = 0;
1736 gsc_handle->src.qbuf_cnt = 0;
1742 if (exynos_v4l2_reqbufs(gsc_handle->gsc_vd_entity->fd, &reqbuf) < 0) {
1754 struct GSC_HANDLE *gsc_handle;
1758 gsc_handle = (struct GSC_HANDLE *)handle;
1767 is_dirty = gsc_handle->src.dirty || gsc_handle->dst.dirty;
1768 is_drm = gsc_handle->src.mode_drm;
1770 if (is_dirty && (gsc_handle->src.mode_drm != gsc_handle->dst.mode_drm)) {
1772 __func__, gsc_handle->gsc_id, gsc_handle->src.mode_drm,
1773 gsc_handle->dst.mode_drm);
1775 } else if (is_drm && !gsc_handle->allow_drm) {
1777 gsc_handle->gsc_id);
1781 if (m_exynos_gsc_check_src_size(&gsc_handle->src.width, &gsc_handle->src.height,
1782 &gsc_handle->src.crop_left, &gsc_handle->src.crop_top,
1783 &gsc_handle->src.crop_width, &gsc_handle->src.crop_height,
1784 gsc_handle->src.v4l2_colorformat) == false) {
1789 if (m_exynos_gsc_check_dst_size(&gsc_handle->dst.width, &gsc_handle->dst.height,
1790 &gsc_handle->dst.crop_left, &gsc_handle->dst.crop_top,
1791 &gsc_handle->dst.crop_width, &gsc_handle->dst.crop_height,
1792 gsc_handle->dst.v4l2_colorformat,
1793 gsc_handle->dst.rotation) == false) {
1799 if (gsc_handle->src.stream_on == true) {
1810 if (is_dirty && gsc_handle->allow_drm && is_drm) {
1811 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_fd,
1823 if (gsc_handle->src.dirty) {
1824 if (m_exynos_gsc_set_format(gsc_handle->gsc_fd, &gsc_handle->src) == false) {
1828 gsc_handle->src.dirty = false;
1831 if (gsc_handle->dst.dirty) {
1832 if (m_exynos_gsc_set_format(gsc_handle->gsc_fd, &gsc_handle->dst) == false) {
1836 gsc_handle->dst.dirty = false;
1843 if (is_dirty && gsc_handle->allow_drm && is_drm) {
1846 if (gsc_handle->gsc_id == 0) {
1848 } else if (gsc_handle->gsc_id == 3) {
1852 gsc_handle->gsc_id);
1860 gsc_handle->protection_enabled = true;
1863 if (m_exynos_gsc_set_addr(gsc_handle->gsc_fd, &gsc_handle->src) == false) {
1868 if (m_exynos_gsc_set_addr(gsc_handle->gsc_fd, &gsc_handle->dst) == false) {
1873 if (gsc_handle->src.stream_on == false) {
1874 if (exynos_v4l2_streamon(gsc_handle->gsc_fd, gsc_handle->src.buf_type) < 0) {
1878 gsc_handle->src.stream_on = true;
1881 if (gsc_handle->dst.stream_on == false) {
1882 if (exynos_v4l2_streamon(gsc_handle->gsc_fd, gsc_handle->dst.buf_type) < 0) {
1886 gsc_handle->dst.stream_on = true;
1900 struct GSC_HANDLE *gsc_handle;
1902 gsc_handle = (struct GSC_HANDLE *)handle;
1911 if ((gsc_handle->src.stream_on == false) || (gsc_handle->dst.stream_on == false)) {
1916 if (gsc_handle->src.buffer_queued) {
1917 if (exynos_v4l2_dqbuf(gsc_handle->gsc_fd, &gsc_handle->src.buffer) < 0) {
1921 gsc_handle->src.buffer_queued = false;
1924 if (gsc_handle->dst.buffer_queued) {
1925 if (exynos_v4l2_dqbuf(gsc_handle->gsc_fd, &gsc_handle->dst.buffer) < 0) {
1929 gsc_handle->dst.buffer_queued = false;
1939 struct GSC_HANDLE *gsc_handle;
1943 gsc_handle = (struct GSC_HANDLE *)handle;
1947 if (!gsc_handle->src.stream_on && !gsc_handle->dst.stream_on) {
1950 } else if (gsc_handle->src.stream_on != gsc_handle->dst.stream_on) {
1952 __func__, gsc_handle->src.stream_on, gsc_handle->dst.stream_on);
1963 if (gsc_handle->src.stream_on == true) {
1964 if (exynos_v4l2_streamoff(gsc_handle->gsc_fd, gsc_handle->src.buf_type) < 0) {
1968 gsc_handle->src.stream_on = false;
1972 if (gsc_handle->dst.stream_on == true) {
1973 if (exynos_v4l2_streamoff(gsc_handle->gsc_fd, gsc_handle->dst.buf_type) < 0) {
1977 gsc_handle->dst.stream_on = false;
1981 if (gsc_handle->allow_drm && gsc_handle->protection_enabled) {
1984 if (gsc_handle->gsc_id == 0)
1986 else if (gsc_handle->gsc_id == 3)
1990 gsc_handle->protection_enabled = false;
1993 if (exynos_v4l2_s_ctrl(gsc_handle->gsc_fd,
2002 req_buf.type = gsc_handle->src.buf_type;
2004 if (exynos_v4l2_reqbufs(gsc_handle->gsc_fd, &req_buf) < 0) {
2011 req_buf.type = gsc_handle->dst.buf_type;
2013 if (exynos_v4l2_reqbufs(gsc_handle->gsc_fd, &req_buf) < 0) {
2026 struct GSC_HANDLE *gsc_handle;
2028 gsc_handle = (struct GSC_HANDLE *)handle;
2037 exynos_mutex_lock(gsc_handle->op_mutex);
2039 if (gsc_handle->flag_local_path == true) {
2054 if (gsc_handle->src.releaseFenceFd >= 0) {
2055 close(gsc_handle->src.releaseFenceFd);
2056 gsc_handle->src.releaseFenceFd = -1;
2059 if (gsc_handle->dst.releaseFenceFd >= 0) {
2060 close(gsc_handle->dst.releaseFenceFd);
2061 gsc_handle->dst.releaseFenceFd = -1;
2072 if (gsc_handle->flag_exclusive_open == false) {
2073 if (gsc_handle->flag_local_path == false)
2074 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
2077 exynos_mutex_unlock(gsc_handle->op_mutex);
2088 struct GSC_HANDLE *gsc_handle = handle;
2130 src_img->releaseFenceFd = gsc_handle->src.releaseFenceFd;
2131 dst_img->releaseFenceFd = gsc_handle->dst.releaseFenceFd;
2145 struct GSC_HANDLE *gsc_handle;
2147 gsc_handle = (struct GSC_HANDLE *)handle;
2153 switch (gsc_handle->gsc_mode) {
2177 struct GSC_HANDLE *gsc_handle;
2182 gsc_handle = (struct GSC_HANDLE *)handle;
2188 switch (gsc_handle->gsc_mode) {
2209 struct GSC_HANDLE *gsc_handle;
2211 gsc_handle = (struct GSC_HANDLE *)handle;
2220 if (gsc_handle->gsc_mode == GSC_M2M_MODE)
2230 struct GSC_HANDLE *gsc_handle;
2232 gsc_handle = (struct GSC_HANDLE *)handle;
2241 switch (gsc_handle->gsc_mode) {
2264 struct GSC_HANDLE *gsc_handle;
2266 gsc_handle = (struct GSC_HANDLE *)handle;
2275 exynos_mutex_lock(gsc_handle->op_mutex);
2277 gsc_handle->flag_local_path = true;
2279 if (exynos_mutex_trylock(gsc_handle->cur_obj_mutex) == false) {
2280 if (m_exynos_gsc_find_and_trylock_and_create(gsc_handle) == false) {
2291 exynos_mutex_unlock(gsc_handle->op_mutex);
2300 struct GSC_HANDLE *gsc_handle;
2301 gsc_handle = (struct GSC_HANDLE *)handle;
2310 exynos_mutex_lock(gsc_handle->op_mutex);
2312 gsc_handle->flag_local_path = false;
2314 exynos_mutex_unlock(gsc_handle->cur_obj_mutex);
2316 exynos_mutex_unlock(gsc_handle->op_mutex);