• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonrubyphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

external/gbm_gralloc


Commit MetaInfo

Revisioncfc6f0613c16e9bc888a4e6378e5900e3bcefdfa (tree)
Time2016-04-23 02:52:45
AuthorRob Herring <robh@kern...>
CommiterRob Herring

Log Message

gbm_map: update to revised gbm_bo_map API

Add stride return parameter and properly pass usage flags.

Signed-off-by: Rob Herring <robh@kernel.org>

Change Summary

Incremental Difference

--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -32,6 +32,7 @@
3232 #include <sys/types.h>
3333 #include <sys/stat.h>
3434 #include <fcntl.h>
35+#include <assert.h>
3536
3637 #include <hardware/gralloc.h>
3738 #include <system/graphics.h>
@@ -193,14 +194,21 @@ static int gbm_map(struct gralloc_gbm_bo_t *bo, int x, int y, int w, int h,
193194 int enable_write, void **addr)
194195 {
195196 int err = 0;
197+ int flags = GBM_BO_TRANSFER_READ;
198+ uint32_t stride;
196199
197200 if (bo->map_data)
198201 return -EINVAL;
199202
200- *addr = gbm_bo_map(bo->bo, x, y, w, h, 0, &bo->map_data);
203+ if (enable_write)
204+ flags |= GBM_BO_TRANSFER_WRITE;
205+
206+ *addr = gbm_bo_map(bo->bo, x, y, w, h, flags, &stride, &bo->map_data);
201207 ALOGE("mapped bo %p at %p", bo, *addr);
202208 if (*addr == NULL)
203- err = -ENOMEM;
209+ return -ENOMEM;
210+
211+ assert(stride == gbm_bo_get_stride(bo));
204212
205213 return err;
206214 }