OSDN Git Service

minigbm: plumb buffer access region
authorGurchetan Singh <gurchetansingh@chromium.org>
Mon, 6 Nov 2017 19:07:52 +0000 (11:07 -0800)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 16 Nov 2017 21:52:02 +0000 (13:52 -0800)
commit1ef809ecd434bfc0fd1d669ba925d58b1255d163
tree2021d33b377ae8aec16d1eee63854ab24f24954b
parentee43c301c21976fb82538261c4e4288ffc754777
minigbm: plumb buffer access region

This will allow drivers to tile or detile only the regions requested
by the user. Note that the gralloc spec states that:

"This address will represent the top-left corner of the entire buffer,
even if accessRegion does not begin at the top-left corner."

(see hardware/interfaces/graphics/mapper/2.0/IMapper.hal in AOSP)

Also, the gralloc API makes it difficult to maintain two mappings of
the same buffer.  For example, say you have two access regions:

module->lock(mod, handle1, 0, 0, 5, 5, &addr);
module->lock(mod, handle1, 5, 5, 10, 10, &addr);

module->unlock(mod, handle1); // which access region should be unlocked?

In practice, this scenario never happens on Android.

It's not exactly clear what gbm should return.  Let's just return the
top left of the access region because that's what we where doing before.

BUG=chromium:764871
TEST=gbmtest, mmap_test -g, the following CTS tests:

android.view.cts.SurfaceViewSyncTests
android.media.cts.EncodeDecodeTest
android.video.cts.VideoEncoderDecoderTest

Change-Id: I7ca0713871e03928b1d4402aa161588990c7e775
Reviewed-on: https://chromium-review.googlesource.com/758147
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
cros_gralloc/cros_gralloc_buffer.cc
cros_gralloc/cros_gralloc_buffer.h
cros_gralloc/cros_gralloc_driver.cc
cros_gralloc/cros_gralloc_driver.h
cros_gralloc/gralloc0/gralloc0.cc
drv.c
drv.h
gbm.c
helpers.h