Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Debugging #95

Open
wants to merge 327 commits into
base: master
Choose a base branch
from
Open

Debugging #95

wants to merge 327 commits into from

Conversation

Shao-Feng
Copy link
Contributor

No description provided.

Alistair Strachan and others added 30 commits July 13, 2018 08:56
Set the ro.hardware.gralloc property to 'minigbm' to have the new module
name be loaded preferentially.

Bug: 77276633
Change-Id: Ib247ee08486887bd76b86ed9c8b7d62c58a31af7
Signed-off-by: Alistair Strachan <[email protected]>
am: 3fbaca6

Change-Id: I884b6bd6e0658b9b931b53d42bcee1ecbc16fc95
am: ff234ae

Change-Id: I3a6a0db16f4bd7048aa9b985fdd7444a8fda5cc7
…f234ae

am: 386c14a

Change-Id: Ib10c60c9018feac18277737347a0fa5ae5a2ac9e
Dri backend is not used for the all use flags. When same fd is
shared between dri backend and the minigbm drv, they end up using the
same kernel DRI context.

BUG=b:111081134
TEST=cheets_SurfaceComposition
     graphics_Gbm
     graphics_Gralloc

Change-Id: I47ae12391acfc9c947e8281de11472fcdf5dec5b
Signed-off-by: Satyajit Sahu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1164972
Tested-by: Deepak Sharma <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
This patch simply changes some methods' names in order to
align them with the upstream ones. It's needed because Chromium/Wayland
implementation is going to have a gbm implementation used by a GPU
split effort.

In order to avoid to have a per compile gn flags, we would like
to standartize the gbm APIs and be able to use the same binary without
recompilations.

In follow-up CLs, I will fix callers and finally remove the old APIs
namings in favor of new ones.

Change-Id: I850824e7194077c47baa761cddb2947959dff9c3
Reviewed-on: https://chromium-review.googlesource.com/1162170
Commit-Ready: Michael Spang <[email protected]>
Tested-by: Michael Spang <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Adding missing plane handle API renaming.

Change-Id: I33c4b4bcc5097ca568c95eb8c3718c3f790fd996
Reviewed-on: https://chromium-review.googlesource.com/1170773
Commit-Ready: Maksim Sisov <[email protected]>
Tested-by: Maksim Sisov <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
When the format is NV12, additional buffer is required for the UV plane.
Though size adjustment for this requirement is currently implemented
only in the msm driver, it is not specific to this device.

This commit moves the adjustment to helper function
'drv_dumb_bo_create', which is called from each driver.

BUG=chromium:852302
TEST=video playback on msm

Change-Id: I690f79ccc6a2c99e680b0d293ffa6002f74ae6bf
Signed-off-by: Keiichi Watanabe <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1163582
Reviewed-by: Tomasz Figa <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
To use vivid on VM as an external camera, virtio_gpu has to support
NV12.

BUG=chromium:852302
TEST=Use camera app on betty by using vivid as an external camera
Change-Id: I84ddcbae473a06337918328afe1db8d32003ad84
Signed-off-by: Keiichi Watanabe <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1160434
Reviewed-by: Tomasz Figa <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Though presubmit.sh requires formatting by clang-format, some files
are not formatted.

BUG=None
TEST=compile

Change-Id: I828dd85536cb94dc98cd11e83ec86af53a425070
Signed-off-by: Keiichi Watanabe <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1172241
Reviewed-by: Gurchetan Singh <[email protected]>
Because HAL_PIXEL_FORMAT_YV12 requires that height is not aligned,
adjustments are needed when the format is DRM_FORMAT_YVU420_ANDROID.
This adjustment was done in each driver, but it can be moved to the
helper function.

BUG=None
TEST=VDA test in import mode on Cheza

Change-Id: I23a8a6e674664e80c30ea66b75d79e10edc28d5d
Signed-off-by: Keiichi Watanabe <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1172262
Reviewed-by: Tomasz Figa <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
…USE_PROTECTED

Originally, Android's HAL_PIXEL_FORMAT_BLOB always regards tilable.
It is not true if it is allocated with BO_USE_PROTECTED.
This CL enables to allocated protected non-tiled Android's HAL_PIXEL_FORMAT_BLOB.

BUG=b:112565837
TEST=Play protected videos with ARC++ at eve

Change-Id: I0e45f658f170cd380a74b9207ba57b08b6edab8b
Reviewed-on: https://chromium-review.googlesource.com/1175641
Commit-Ready: Hirokazu Honda <[email protected]>
Tested-by: Hirokazu Honda <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
Since we should be using llvmpipe with MSM for now, add formats
we know work well with vgem (which also uses llvmpipe).

BUG=none
TEST=none

Change-Id: I88bf183a23a593029ed303c16ef960eb36d59f9f
Reviewed-on: https://chromium-review.googlesource.com/1194189
Commit-Ready: Douglas Anderson <[email protected]>
Tested-by: Douglas Anderson <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Without doing this it's possible for the CPU to access the memory when it's
in use by another device.

TEST=adb shell "am instrument -w --abi armeabi-v7a -e class\
 android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromPersistentSurfaceToSurfaceQCIF\
 android.media.cts/android.support.test.runner.AndroidJUnitRunner"
BUG=b:71835379

Change-Id: I3b1508a0eab3b020b7c42978cb1e1099ebc029fd
Signed-off-by: Luigi Santivetti <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1193302
Commit-Ready: Gurchetan Singh <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Before this change, a NULL pointer could have been passed to munmap(),
making impossible for it to unmap previoulsy mapped memory. After this
change, munmap() always receives a valid pointer.

BUG=b:71835379 b:114699642
TEST=adb shell "am instrument -w --abi armeabi-v7a -e class\
 android.uirendering.cts.testclasses.InfrastructureTests#testScreenshot\
 android.uirendering.cts/android.support.test.runner.AndroidJUnitRunner"

Change-Id: Ic1b15807623209ab28d0d4ed63fe0d6ef2dcc6f8
Signed-off-by: Luigi Santivetti <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1221667
Commit-Ready: Kazuhiro Inaba <[email protected]>
Tested-by: Pin-chih Lin <[email protected]>
Reviewed-by: Stéphane Marchesin <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Change-Id: I9b5c3db33bd0c7914a214e2181d655aec84632c5
Reviewed-on: https://chromium-review.googlesource.com/1229436
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Change-Id: Ie5f8b148e3f051edde08b0b46ab22a80f034ff80
Reviewed-on: https://chromium-review.googlesource.com/1229437
Commit-Ready: Gurchetan Singh <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Reviewed-by: Stéphane Marchesin <[email protected]>
We defined the function, but it's since gone unused.

Change-Id: I23e7e57413c4a7c82d9da302b79e6b9c5068654d
Reviewed-on: https://chromium-review.googlesource.com/1229438
Commit-Ready: Gurchetan Singh <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Reviewed-by: Stéphane Marchesin <[email protected]>
Mesa drivers can't use it, in general.

I'm leaving in Rockchip since I haven't gotten any reports
about this test failing on kevin-arcnext.

Fixes: abe44f ("minigbm: add support for BG24")

BUG=b:77876551, b:115564746
TEST=The following tests should pass on Eve/Grunt arc-next:

  android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputAndSampledImage_R8G8B8_UNORM
  android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputCpuRead_R8G8B8_UNORM
  android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputIsRenderable_R8G8B8_UNORM
  android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuSampledImageCanBeSampled_R8G8B8_UNORM

Change-Id: Ic7aec07c89fdc21e0c8392238e833f7980062049
Reviewed-on: https://chromium-review.googlesource.com/1229439
Commit-Ready: Gurchetan Singh <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Reviewed-by: Stéphane Marchesin <[email protected]>
DRM_IOCTL_MSM_GEM_NEW is used to create buffer and
DRM_IOCTL_MSM_GEM_INFO is used to map buffer.

BUG=none
TEST=mmap_test, plane_test

Change-Id: I7db0cf36b03625f02828b63946550c768c422419
Signed-off-by: Tanmay Shah <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1134481
Reviewed-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
map stride is bigger than the allocation stride. Currently
gralloc_lock does not consider map_stride. Align the width so
that stride get alinged to 256.

BUG=b:115946221
TEST= CtsNativeHardwareTestCases GpuColorOutputCpuRead* tests

Change-Id: I0e1ccfba4ec981702498a76fa5a0b2c662b6e728
Signed-off-by: Satyajit Sahu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1242767
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Tested-by: Deepak Sharma <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
This patch does not bring any functionality changes, but just
adds a MINIGBM define in order to be able to distiguish if
Chromium, for example, uses a system libgbm (needed by Ozone/Wayland
builds for Linux due to some diffirences, which we cannot fix yet)
or minigbm.

Change-Id: I82366ce9a1c302124b75a6c21028a67127497065
Reviewed-on: https://chromium-review.googlesource.com/1281887
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Tested-by: Maksim Sisov <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Some camera use cases, such as camera output buffers shared between
video encoder and hwcomposer, require CPU access to the buffers (the
ARC++ encoder stack is not zero-copy yet) and having uncached mapping
slows them down significantly, to the point that respective CTS tests
start failing. Fix it by excluding buffers with BO_CAMERA_READ and
BO_CAMERA_WRITE from the WC mapping condition.

BUG=b:117978452
TEST=android.hardware.camera2.cts.RecordingTest#testVideoPreviewSurfaceSharing on Nocturne

Change-Id: Icc3c7104029403fbf64a7fcc8476d52a3f9ea3f0
Reviewed-on: https://chromium-review.googlesource.com/1309914
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Tested-by: Tomasz Figa <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
We only need this workaround for DRI Android buffers, not
all buffers.

Also, we don't need this for buffers with non-SW uses.

BUG=b:117942643
TEST=compile

Change-Id: I7ea24b0dc3b040b726f6c1223c96998f078a20fc
Signed-off-by: Satyajit Sahu <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1300595
Reviewed-by: Robert Tarasov <[email protected]>
some of the android.media.cts.EncodeDecodeTest in media test are
failing when enabled.

Bug=b:115585732
TEST=run android.media.cts.EncodeDecodeTest tests

Change-Id: Id54236a4441e6441bd8500a81f83c00e2fa405d8
Signed-off-by: Deepak Sharma <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1329993
Commit-Ready: Deepak Sharma <[email protected]>
Tested-by: Deepak Sharma <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
For linear path we don't wait for GPU to finish before CPU access
which may case issues in gralloc lock() case.

Bug=b:115585732
TEST=android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Qual1920x1080

Change-Id: If827fe4a18726797082046b4f24fc8c75ff1bcb7
Signed-off-by: Deepak Sharma <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1340484
Commit-Ready: Deepak Sharma <[email protected]>
Tested-by: Deepak Sharma <[email protected]>
Reviewed-by: Deepak Sharma <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
This CL aligns the minigbm more with the upstream GBM
by defining GBM_BO_IMPORT_FD_MODIFIER and using
gbm_import_fd_modifier_data instead.

That is, the main difference between the old
gbm_import_fd_planar_data one and the new one is
the format_modifiers variable. In the upstream
GBM, it's a single variable. In the minigbm, it is
an array.

As we know there are no cases when modifiers would
be different for each plane. Thus, it's safe to eliminate
that and adapt more to the upstream.

Change-Id: Iaae062ef1fe9fc9ab0ead09c5f4bfa91d2db67c3
Reviewed-on: https://chromium-review.googlesource.com/1360771
Commit-Ready: Maksim Sisov <[email protected]>
Tested-by: Maksim Sisov <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
This reverts commit bc667c3.

Reason for revert: This change might cause crbug.com/913329.

Original change's description:
> minigbm: define GBM_BO_IMPORT_FD_MODIFIER
>
> This CL aligns the minigbm more with the upstream GBM
> by defining GBM_BO_IMPORT_FD_MODIFIER and using
> gbm_import_fd_modifier_data instead.
>
> That is, the main difference between the old
> gbm_import_fd_planar_data one and the new one is
> the format_modifiers variable. In the upstream
> GBM, it's a single variable. In the minigbm, it is
> an array.
>
> As we know there are no cases when modifiers would
> be different for each plane. Thus, it's safe to eliminate
> that and adapt more to the upstream.
>
> Change-Id: Iaae062ef1fe9fc9ab0ead09c5f4bfa91d2db67c3
> Reviewed-on: https://chromium-review.googlesource.com/1360771
> Commit-Ready: Maksim Sisov <[email protected]>
> Tested-by: Maksim Sisov <[email protected]>
> Reviewed-by: Gurchetan Singh <[email protected]>

Change-Id: I7dec62abd4243554847930cce33f0d5db069c3f4
Reviewed-on: https://chromium-review.googlesource.com/1369469
Commit-Ready: Naoki Fukino <[email protected]>
Tested-by: Naoki Fukino <[email protected]>
Reviewed-by: Naoki Fukino <[email protected]>
Venus driver requires extra padding for NV12 buffers.

BUG=b:120118851
TEST=plane_test -f NV12
TEST=plane_test -f NV12 -z 640x480

Change-Id: If86c548350278cc8d87159b58e56802b2598d448
Signed-off-by: Tanmay Shah <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/1362202
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
No functional changs.

BUG=none
TEST=compile

Change-Id: I6b302e9bbf9d46489bfaa03d3b5cf2b070cb1d24
Reviewed-on: https://chromium-review.googlesource.com/1356697
Commit-Ready: ChromeOS CL Exonerator Bot <[email protected]>
Tested-by: Stéphane Marchesin <[email protected]>
Reviewed-by: Stéphane Marchesin <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
renchenglei and others added 30 commits December 17, 2020 18:59
This format is used in VTS tests
VTS use it as default color format
This is to help fix the building issues in IA HWC
SetInterface is used by MSDK for the interalce info of the buffer
SetProtectionInfo is used by MSDK for protection info for the buffer
union type added for protection info
Otherwise it will cause sramble sceen issues in Android
lockFlex fills outFlexLayout->planes with pointer to global variable
ycbcrplanes, doesn't work from multiple threads.
Workaround: change the variable to thread_local.
We allocate buffer by using allocate4, but lockFlex is called
by gralloc1. Bufore we use buffer, we need retain/release.
Add NV12_Y_TILED_INTEL video format support
We use one wrong align heigh for NV12_Y_TILED_INTEL video
format. Fix this issue with this changes.
The DRM_FORMAT_ABGR2101010 format will be used by Android Media
framework for software codec of AV1Hdr, and the usage flag request
as:
 BO_USE_SW_READ_RARELY
 BO_USE_SW_READ_OFTEN
 BO_USE_SW_WRITE_RARELY
 BO_USE_SW_WRITE_OFTEN

Tracked-On: OAM-95578
Signed-off-by: Yang, Dong <[email protected]>
Add YUYV format for 264 video which is used by HWC.

Align 263 video with 64, if we use 32, we may encounter VA
create surface failures in HWC.

Tracked-On: OAM-95589
Signed-off-by: Ren Chenglei <[email protected]>
Fix PlaneLayout width/height metadata by using the
horizontal/vertical subsampling of each plane.

TEST=vts -m VtsHalGraphicsMapperV4_0TargetTest

Tracked-On: OAM-95590
Signed-off-by: ason Macnak <[email protected]>
Camera preview use YCbCr, and will be converted to resolved format
NV12. NV12 is one private defined format. So the descriptor.format
is not same with crosHandle->droid_format. Suppress the check here.

Camera works as one buffer producer for media. In previous, we may
allocate & lock buffer with one same "driver". But when we switch to
allocator & mapper 4.0, some components still use allocate & mapper
2.0, and which will use two different drivers. So, we need retain
before we use the buffer allocated by other driver. In future, those
components should switch to allocator & mapper 4.0 which is asked by
API 30.

Tracked-On: OAM-95595
Signed-off-by: Ren Chenglei <[email protected]>
With allocator & mapper 4.0, there is some regression in
CTS CtsNativeHardwareTestCases. Compared with allocator &
mapper 2.0, we still not support two mipmap usage, and also
not support to allocate more than 1 layer.

Tracked-On: OAM-95612
Signed-off-by: Ren Chenglei [email protected]
For RGBA_FP16 format, we still not support RENDERING
and TEXTURE usage.

Tracked-On: OAM-95612
Signed-off-by: Ren Chenglei [email protected]
For DRM_FORMAT_R8, we don't need align the stride. This
change could help fix allocator issues in CtsNNAPITestCases.

Tracked-On: OAM-95724
Signed-off-by: Ren Chenglei [email protected]
Add BO_USE_SW_MASK usage to DRM_FORMAT_RGB888 format,
this is required by Android R CTS.

Test: android.hardware.cts.HardwareBufferTest#testCreate

Tracked-On: OAM-95726
Signed-off-by: Ren Chenglei [email protected]
After we rebased our allocator & mapper from 2.0 to
4.0, we use allocator 4.0 to allocate buffer, which
can't be accessed by mapper 2.0 directly. Here, we
add freeBuffer function, if we want to use mapper 2.0
to lock & unlock buffer(allocated by allocator 4.0),
we need importBuffer & freeBuffer before/after lock
and unlock.

Tracked-On: OAM-95916
Signed-off-by: Ren Chenglei <[email protected]>
Issue has been fixed from media driver,
revert back to 32, which can help pass
VTS failure

Tracked-On: OAM-96724
Signed-off-by: Ren Chenglei <[email protected]>
On virgl backend, we use vhal camera. During camera
preview, we use RGBA format, so add camera usage for
it.

Tracked-On: OAM-96725
Signed-off-by: Ren Chenglei [email protected]
This is needed for codec2.0

Tracked-On: OAM-96726
Signed-off-by: Yang, Dong <[email protected]>
Signed-off-by: Ren Chenglei <[email protected]>
1. native_handle_* need native_handle_t instead of
   buffer_handle_t, this conflicts with mapper 2.0
   release function
2. importBuffer call native_handle_clone, which will
   have "malloc", then we need use "free" by
   native_handle_delete in case of memory leak, which
   is called in private defined API freeBuffer
3. We should use Android official define API release
   instead of private defined API freeBuffer; so we
   need remove native_handle_clone in importBuffer
   and use release directly

Tracked-On: OAM-96807
Signed-off-by: Chenglei Ren <[email protected]>
Inside the release function (CrosGralloc1::release())
native_handle_close() and native_handle_delete() functions are
getting called after driver release function call (driver->release()).
In driver release function these are already cleaned up.
Inside driver release function native_handle_close() is
called  inside destructor of cros_gralloc_buffer.

Tracked-On: OAM-97019
Signed-off-by: Kaushlendra Kumar <[email protected]>
Signed-off-by: Chenglei Ren <[email protected]>
getBackingStore() should return a globally unique value for a
dedicated graphics buffer, the graphics buffers will share between
different modules like display and codec, the unique value will be
used to identify specifi memory.

Tracked-On: OAM-97062
Signed-off-by: Yang, Dong <[email protected]>
Signed-off-by: Shaofeng Tang <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.