From 07d36cc464e6d20d08913856f50cb50c2c6877d4 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 10 Oct 2017 12:11:16 -0700 Subject: [PATCH] Revert "minigbm: Revert "minigbm: flush buffer instead of unmapping"" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The reason the tests weren't passing is because DRM_IOCTL_I915_GEM_SET_DOMAIN is required on x86 platforms when calling (*lock). A previous CLs added this. BUG=b:67073097, b:67331142 TEST= android.view.cts.SurfaceViewSyncTests android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Qual0720x0480 android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Qual1280x0720 android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Qual1920x1080 android.media.cts.EncodeDecodeTest#testVP8EncodeDecodeVideoFromSurfaceToSurface720p android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromPersistentSurfaceToSurface720p android.media.cts.EncodeDecodeTest#testVP8EncodeDecodeVideoFromPersistentSurfaceToSurface720p pass on Eve. This reverts commit 14033e0013b5cc0ffc5af59dda7c377d46ec761d. v2: Make lock_data[0] null after last (*unlock)(), because user may specify different access regions in the next (*lock)(). Change-Id: Ia56ecd57acc4471b026c852b178d8bc0f189dec7 Reviewed-on: https://chromium-review.googlesource.com/710324 Commit-Ready: Gurchetan Singh Tested-by: Gurchetan Singh Reviewed-by: Stéphane Marchesin --- cros_gralloc/cros_gralloc_buffer.cc | 2 +- gbm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cros_gralloc/cros_gralloc_buffer.cc b/cros_gralloc/cros_gralloc_buffer.cc index 7757069..47a13a2 100644 --- a/cros_gralloc/cros_gralloc_buffer.cc +++ b/cros_gralloc/cros_gralloc_buffer.cc @@ -90,7 +90,7 @@ int32_t cros_gralloc_buffer::unlock() if (!--lockcount_) { if (lock_data_[0]) { - drv_bo_unmap(bo_, lock_data_[0]); + drv_bo_flush(bo_, lock_data_[0]); lock_data_[0] = nullptr; } } diff --git a/gbm.c b/gbm.c index c67bdcd..25b4fa0 100644 --- a/gbm.c +++ b/gbm.c @@ -249,7 +249,7 @@ PUBLIC void *gbm_bo_map(struct gbm_bo *bo, uint32_t x, uint32_t y, uint32_t widt PUBLIC void gbm_bo_unmap(struct gbm_bo *bo, void *map_data) { assert(bo); - drv_bo_unmap(bo->bo, map_data); + drv_bo_flush(bo->bo, map_data); } PUBLIC uint32_t gbm_bo_get_width(struct gbm_bo *bo) -- 2.11.0