Currently, minigbm unmaps when the (*unlock) gralloc hook is called. This necessarily does not need to be the case. As an optimization, we can implement a drv_bo_flush with the appropriate driver specific hooks (for drivers where this is not feasible, we can just unmap).
> Currently, minigbm unmaps when the (*unlock) gralloc hook is called.
That's not entirely true. It unmaps when unlock is called for the last last lock, when the lock count drops to zero. If we need to flush, we probably need to do it on every unlock. (The case of nested locks probably isn't very common, though...)
The following revision refers to this bug:
https://chromium.googlesource.com/chromiumos/platform/minigbm/+/2d1877f0417e5891ad6e2795db7cf395916b15b3
commit 2d1877f0417e5891ad6e2795db7cf395916b15b3
Author: Gurchetan Singh <gurchetansingh@chromium.org>
Date: Wed Oct 18 19:12:42 2017
minigbm: i915: call DRM_IOCTL_I915_GEM_SET_DOMAIN when invalidating
In the kernel, the i915_gem_set_domain_ioctl function calls these
functions:
- i915_gem_object_set_to_gtt_domain
- i915_gem_object_set_to_cpu_domain
These functions do various interesting things with caches, and some
CTS tests require this to pass.
BUG=b:67073097, b:67331142, chromium:764871
TEST=The following tests:
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
passes on Eve with the next patch applied.
Change-Id: I9acc14580f65eab6039d8b354bfbf51c31dfcf14
Reviewed-on: https://chromium-review.googlesource.com/710323
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
[modify] https://crrev.com/2d1877f0417e5891ad6e2795db7cf395916b15b3/i915.c
Comment 1 by tfiga@chromium.org
, Sep 14 2017