summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuelian <xuelian.bai@samsung.com>2019-12-12 18:51:01 +0800
committerXuelian <xuelian.bai@samsung.com>2019-12-12 18:54:08 +0800
commitad98e5ed4e87577245afcf429f562604a5eaea73 (patch)
tree5629300349f4c5f6048d19d6001e812fcf709357
parent844f7559db373f0a9c5321ba832fe534aaf19b39 (diff)
downloadmesa-ad98e5ed4e87577245afcf429f562604a5eaea73.tar.gz
mesa-ad98e5ed4e87577245afcf429f562604a5eaea73.tar.bz2
mesa-ad98e5ed4e87577245afcf429f562604a5eaea73.zip
Handle 1x1 issue for driimage
For RPI4, render node is used, so buffer is allocated on another device, when 1x1 issue happen, we need to make sure if driimage size is changed, then created new if yes. Change-Id: I9b6474381c7b855c0e4bf0189a8838a1dcfa30d0 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
-rw-r--r--include/GL/internal/dri_interface.h4
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c16
-rw-r--r--src/gallium/state_trackers/dri/dri2.c15
3 files changed, 31 insertions, 4 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index ea9e560896a..385db466ecf 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -2030,6 +2030,10 @@ struct __DRIimageLoaderExtensionRec {
* \since 3
*/
void (*flushSwapBuffers)(__DRIdrawable *driDrawable, void *loaderPrivate);
+#ifdef HAVE_TIZEN_PLATFORM
+ bool (*validate)(__DRIdrawable *driDrawable, void *loaderPrivate);
+#endif
+
};
/**
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index ddc399596f5..68a78ab4056 100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -551,9 +551,20 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, unsigned int format)
int fourcc, pitch;
int offset = 0, fd;
tbm_surface_info_s surf_info;
+ EGLBoolean query;
+ int width, height;
- if (dri2_surf->dri_image_back)
- return 0;
+ if (dri2_surf->dri_image_back) {
+ query = dri2_dpy->image->queryImage(dri2_surf->dri_image_back, __DRI_IMAGE_ATTRIB_WIDTH, &width);
+ query &= dri2_dpy->image->queryImage(dri2_surf->dri_image_back, __DRI_IMAGE_ATTRIB_HEIGHT, &height);
+
+ if (width == dri2_surf->base.Width && height == dri2_surf->base.Height)
+ return 0;
+ else {
+ dri2_dpy->image->destroyImage(dri2_surf->dri_image_back);
+ dri2_surf->dri_image_back = NULL;
+ }
+ }
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
if (!dri2_surf->tbm_surface) {
@@ -1391,6 +1402,7 @@ static const __DRIimageLoaderExtension tizen_image_loader_extension = {
.getBuffers = tizen_image_get_buffers,
.flushFrontBuffer = tizen_flush_front_buffer,
+ .validate = tizen_validate_drawable,
};
static const __DRIswrastLoaderExtension tizen_swrast_loader_extension = {
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index cabd20b4cc0..1bee33247ea 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -454,8 +454,19 @@ static bool dri2_validate_drawable(struct dri_drawable *drawable)
}
return valid;
}
- else
- return TRUE;
+ else {
+ const __DRIimageLoaderExtension *image_loader = drawable->sPriv->image.loader;
+ if (image_loader && image_loader->validate != NULL) {
+ boolean valid = (image_loader->validate)(dri_drawable, dri_drawable->loaderPrivate);
+ if (valid == FALSE) /*drawable may be resized, not valid anymore*/ {
+ drawable->dPriv->lastStamp = drawable->dPriv->dri2.stamp;
+ drawable->texture_mask = 0;
+ }
+ return valid;
+ }
+ return TRUE;
+ }
+
}
#endif