• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoapythonrubywindowsphpgameguibathyscaphec翻訳omegatframework計画中(planning stage)twitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

external/gbm_gralloc


Commit MetaInfo

Revisionc10ef2b61bb5957470f55d15cf98ecaf7a0b4d4a (tree)
Time2017-11-30 01:22:22
AuthorRob Herring <robh@kern...>
CommiterRob Herring

Log Message

Use native_handle functions

Use native_handle_{create,delete} functions instead of the C++
alloc/free. This will do the initialization for us instead of open
coding it.

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

Change Summary

Incremental Difference

--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -341,14 +341,10 @@ static struct gralloc_gbm_handle_t *create_bo_handle(int width,
341341 {
342342 struct gralloc_gbm_handle_t *handle;
343343
344- handle = new gralloc_gbm_handle_t();
344+ handle = (gralloc_gbm_handle_t *)native_handle_create(GRALLOC_GBM_HANDLE_NUM_FDS, GRALLOC_GBM_HANDLE_NUM_INTS);
345345 if (!handle)
346346 return NULL;
347347
348- handle->base.version = sizeof(handle->base);
349- handle->base.numInts = GRALLOC_GBM_HANDLE_NUM_INTS;
350- handle->base.numFds = GRALLOC_GBM_HANDLE_NUM_FDS;
351-
352348 handle->magic = GRALLOC_GBM_HANDLE_MAGIC;
353349 handle->width = width;
354350 handle->height = height;
@@ -374,7 +370,7 @@ struct gralloc_gbm_handle_t *gralloc_gbm_bo_create(struct gbm_device *gbm,
374370
375371 bo = gbm_alloc(gbm, handle);
376372 if (!bo) {
377- delete handle;
373+ native_handle_delete(&handle->base);
378374 return NULL;
379375 }
380376