Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

gbm_gralloc fails gralloctest gralloc_order #21

Open
maurossi opened this issue Apr 4, 2021 · 1 comment
Open

gbm_gralloc fails gralloctest gralloc_order #21

maurossi opened this issue Apr 4, 2021 · 1 comment

Comments

@maurossi
Copy link
Contributor

maurossi commented Apr 4, 2021

Hello,
gbm_gralloc is the only gralloc0 implementation not passing gralloc_order test,
the test case is described in the comment

gralloctest.c has not changed much, here is a recent version

https://android.googlesource.com/platform/external/minigbm/+/refs/tags/android-11.0.0_r33/cros_gralloc/gralloc0/tests/gralloctest.c

@line 394
	/*
	 * Duplicate the buffer handle to simulate an additional reference
	 * in same process.
	 */
	native_handle_t *native_handle = duplicate_buffer_handle(info.handle);
	duplicate.handle = native_handle;

	CHECK(unregister_buffer(ctx->module, &duplicate) == 0);
	CHECK(register_buffer(ctx->module, &duplicate));    /* @line 402 here is the CHECK that is failing only with gbm_gralloc */

@rsglobal
Copy link
Contributor

rsglobal commented Apr 5, 2021

Hi,

Minigbm's private handle structure has unique ID field, which is used to distinguish between duplicated/unique registration.
gbm_gralloc does not have such field.

But recently I was searching for unified way to get dma-buf unique fingerprint, and it seems that fstat(fd[0]) -> st_ino should be true unique number per dma-buf and can be used here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants