summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuelian Bai <xuelian.bai@samsung.com>2019-01-31 01:14:03 +0800
committerXuelian Bai <xuelian.bai@samsung.com>2019-04-08 23:00:54 +0800
commit24902d172d95f1c6e505c74477d1626a541c7069 (patch)
treefba1cca88f6054795e621c6da237d087ad80ed51
parent5cd0256faa43e376dcd5b5f2c2edd2515aff9c04 (diff)
downloadmesa-24902d172d95f1c6e505c74477d1626a541c7069.tar.gz
mesa-24902d172d95f1c6e505c74477d1626a541c7069.tar.bz2
mesa-24902d172d95f1c6e505c74477d1626a541c7069.zip
Add modifier in attribute list if surface flag is tiled.
Change-Id: I11de267b2940e0cf8aa36f0d7c2bc1719b2011b1
-rw-r--r--src/egl/drivers/dri2/platform_tizen.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 43130c17717..0c81e880e52 100644
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -810,6 +810,7 @@ tizen_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
{
unsigned int pitch;
tbm_surface_info_s surf_info;
+ unsigned int flags = tbm_bo_get_flags(tbm_surface_internal_get_bo(tbm_surface, 0));
if (is_yuv_format(tbm_surface_get_format(tbm_surface)))
return tizen_create_image_from_prime_fd_yuv(disp, ctx, tbm_surface);
@@ -831,7 +832,7 @@ tizen_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
return NULL;
}
- const EGLint attr_list[] = {
+ /*const EGLint attr_list[] = {
EGL_WIDTH, surf_info.width,
EGL_HEIGHT, surf_info.height,
EGL_LINUX_DRM_FOURCC_EXT, fourcc,
@@ -839,7 +840,34 @@ tizen_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
EGL_DMA_BUF_PLANE0_PITCH_EXT, pitch,
EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
EGL_NONE, 0
- };
+ };*/
+
+ //TODO: get modifier from vendor driver/TBM
+ EGLint attr_list[50];
+ int atti = 0;
+
+ attr_list[atti++] = EGL_WIDTH;
+ attr_list[atti++] = surf_info.width;
+ attr_list[atti++] = EGL_HEIGHT;
+ attr_list[atti++] = surf_info.height;
+ attr_list[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
+ attr_list[atti++] = fourcc;
+ attr_list[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
+ attr_list[atti++] = fd;
+ attr_list[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
+ attr_list[atti++] = pitch;
+ attr_list[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
+ attr_list[atti++] = 0;
+
+ if (flags == TBM_BO_TILED) {
+ attr_list[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
+ attr_list[atti++] = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED & 0xFFFFFFFF;
+ attr_list[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
+ attr_list[atti++] = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED >> 32;
+ }
+ attr_list[atti++] = EGL_NONE;
+ attr_list[atti++] = 0;
+
return dri2_create_image_dma_buf(disp, ctx, NULL, attr_list);
}