OSDN Git Service

android-x86/external-minigbm.git
2 years agogralloc0_register_buffer: initialize gralloc0 when needed pie-x86
Mauro Rossi [Sat, 18 Apr 2020 08:20:32 +0000 (10:20 +0200)]
gralloc0_register_buffer: initialize gralloc0 when needed

Based on Michael Goffioul "Always initialize gralloc0 module"
considerign that !mod->initialized defines the condition when it's needed.

Original commit message:
Both mapper and allocator HIDL adapter uses the same gralloc module, but
the mapper HILD does not fully initialize the module, leaving the
allocator HIDL in limbo if the mapper HIDL is called first.

Fixes SystemUI crash on startup.

2 years agodefine BO_USE_SW_MASK and use it coherently in amdgpu
Mauro Rossi [Sun, 26 Jan 2020 22:36:03 +0000 (23:36 +0100)]
define BO_USE_SW_MASK and use it coherently in amdgpu

2 years agoamdgpu: Add ABGR8888 using non-linear tiling too.
Bas Nieuwenhuizen [Wed, 3 Apr 2019 16:12:12 +0000 (18:12 +0200)]
amdgpu: Add ABGR8888 using non-linear tiling too.

BUG=b:129625642
TEST=test_that ${IP} cheets_CTS_P.9.0_r7.x86.CtsGraphicsTestCases on Grunt

Change-Id: I716533df9e56e52818b4c52ee557747dc3a68e40
Reviewed-on: https://chromium-review.googlesource.com/1550921
Commit-Ready: Drew Davenport <ddavenport@chromium.org>
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
2 years agoamdgpu: Add ABGR8888 for scanout
Drew Davenport [Mon, 25 Mar 2019 15:18:42 +0000 (09:18 -0600)]
amdgpu: Add ABGR8888 for scanout

BUG=b:127868532
TEST=Complete glbench without errors in crosvm

Change-Id: I921ab9dd1611d6b45eb980ed7988941806eb6761
Reviewed-on: https://chromium-review.googlesource.com/1538374
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agominigbm:amdgpu: align stride to 256
Satyajit Sahu [Thu, 31 Jan 2019 04:28:24 +0000 (09:58 +0530)]
minigbm:amdgpu: align stride to 256

Previously stride was alinged to 256 only in linear path and
android. Now it is aligned to 256 for all cases.

BUG=b:122049612
TEST=suspend_stress_test

Change-Id: I757f2d056176fe5ebfd858a017273cf02bad6020
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1457777
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agoamdgpu: use amdgpu_gem_wait_idle_ioctl to wait for GPU to finish.
Deepak Sharma [Fri, 16 Nov 2018 20:10:54 +0000 (12:10 -0800)]
amdgpu: use amdgpu_gem_wait_idle_ioctl to wait for GPU to finish.

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 <Deepak.sharma@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1340484
Commit-Ready: Deepak Sharma <deepak.sharma@amd.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agoamdgpu: Don't use AMDGPU_GEM_CREATE_EXPLICIT_SYNC flag.
Deepak Sharma [Fri, 9 Nov 2018 22:12:04 +0000 (14:12 -0800)]
amdgpu: Don't use AMDGPU_GEM_CREATE_EXPLICIT_SYNC flag.

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 <Deepak.Sharma@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1329993
Commit-Ready: Deepak Sharma <deepak.sharma@amd.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agoamdgpu: fix misplaced code block
Gurchetan Singh [Fri, 26 Oct 2018 00:12:18 +0000 (17:12 -0700)]
amdgpu: fix misplaced code block

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 <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1300595
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
2 years agominigbm: align width so that stride aligns to 256
Satyajit Sahu [Thu, 4 Oct 2018 04:49:50 +0000 (10:19 +0530)]
minigbm: align width so that stride aligns to 256

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 <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1242767
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agominigbm: amdgpu: align the stride to 256
Satyajit Sahu [Wed, 11 Jul 2018 08:11:56 +0000 (13:41 +0530)]
minigbm: amdgpu: align the stride to 256

amdgpu has a requirement of stride to be aligned to 256.
Otherwise gpu faults and corruptions are observed for some
resolutions.

BUG=b:80148696 b:110472790
TEST=graphics autotest suite

Change-Id: Ic13c19cd1641a6ce206de9b1016a242ed21c2631
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1133060
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2 years agoRevert "Modify gralloc0 implementation"
Mauro Rossi [Sat, 25 Jan 2020 16:35:11 +0000 (17:35 +0100)]
Revert "Modify gralloc0 implementation"

This reverts commit 8894cf7256f1d17344fd1e0b5bb849e719afe11e.

2 years agoFix redefinition building error (blueprint)
Mauro Rossi [Sat, 25 Jan 2020 16:34:16 +0000 (17:34 +0100)]
Fix redefinition building error (blueprint)

Fixes the following building errors:

In file included from external/minigbm/amdgpu.c:16:
In file included from external/minigbm/dri.h:13:
external/mesa/include/GL/internal/dri_interface.h:46:22: error: redefinition of typedef 'drm_context_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef unsigned int drm_context_t;
                     ^
external/libdrm/include/drm/drm.h:77:22: note: previous definition is here
typedef unsigned int drm_context_t;
                     ^

2 years agogralloc.minigbm: enable amdgpu backend
Mauro Rossi [Sat, 25 Jan 2020 13:14:45 +0000 (14:14 +0100)]
gralloc.minigbm: enable amdgpu backend

Changelog:
- add gralloc.minigbm_amdgpu_defaults with required includes
- use gralloc.minigbm_amdgpu_defaults for gralloc.minigbm

2 years agogralloc.minigbm: enable i915 backend
Mauro Rossi [Sat, 25 Jan 2020 13:11:55 +0000 (14:11 +0100)]
gralloc.minigbm: enable i915 backend

Existing gralloc.minigbm_intel_defaults are added to gralloc.minigbm

2 years agoOpen the device node with O_CLOEXEC
Mauro Rossi [Sun, 5 Jan 2020 23:26:02 +0000 (00:26 +0100)]
Open the device node with O_CLOEXEC

Inspired by implementation of gbm gralloc

2 years agominigbm: radeon: add RGB565 to supported render target formats
Mauro Rossi [Sun, 6 Jan 2019 05:30:40 +0000 (06:30 +0100)]
minigbm: radeon: add RGB565 to supported render target formats

Necessary to avoid following errors in Android:

E [minigbm:gralloc0.cc(123)]: Unsupported combination -- HAL format: 4, HAL usage: 256, drv_format: RG16, use_flags: 131072
E GraphicBufferAllocator: Failed to allocate (1 x 1) layerCount 1 format 4 usage 100: 3

2 years agominigbm: nouveau: add RGB565 to supported render target formats
Mauro Rossi [Sun, 6 Jan 2019 05:27:12 +0000 (06:27 +0100)]
minigbm: nouveau: add RGB565 to supported render target formats

Necessary to avoid following errors in Android:

E [minigbm:gralloc0.cc(123)]: Unsupported combination -- HAL format: 4, HAL usage: 256, drv_format: RG16, use_flags: 131072
E GraphicBufferAllocator: Failed to allocate (1 x 1) layerCount 1 format 4 usage 100: 3

2 years agominigbm: radeon: add RGB{A,X}8888 to supported render target formats
Mauro Rossi [Fri, 4 Jan 2019 14:07:25 +0000 (15:07 +0100)]
minigbm: radeon: add RGB{A,X}8888 to supported render target formats

Necessary to avoid following errors in Android:

E [minigbm:gralloc0.cc(123)]: Unsupported combination -- HAL format: 1, HAL usage: 2304, drv_format: AB24, use_flags: 131072
E GraphicBufferAllocator: Failed to allocate (1024 x 24) layerCount 1 format 1 usage 900: 3

2 years agominigbm: nouveau: add RGB{A,X}8888 to supported render target formats
Mauro Rossi [Fri, 4 Jan 2019 12:51:58 +0000 (13:51 +0100)]
minigbm: nouveau: add RGB{A,X}8888 to supported render target formats

Necessary to avoid following errors in Android:

E [minigbm:gralloc0.cc(123)]: Unsupported combination -- HAL format: 1, HAL usage: 2304, drv_format: AB24, use_flags: 131072
E GraphicBufferAllocator: Failed to allocate (1024 x 24) layerCount 1 format 1 usage 900: 3

2 years agoandroid: fix amdgpu DRI_PATH as /vendor/{lib64,lib}/dri
Mauro Rossi [Sun, 11 Nov 2018 18:37:48 +0000 (19:37 +0100)]
android: fix amdgpu DRI_PATH as /vendor/{lib64,lib}/dri

The correct DRI_PATH is /vendor/{lib64,lib}/dri based on 64,32 bit target
Linux distributions case is omitted to concentrate on android-x86 builds

Fixes following SIGABRT for 64 bit builds:

E [minigbm:gralloc0.cc(159)] Failed to initialize driver.
F Gralloc0Allocator: Failed to open gralloc0 device
F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2654 (surfaceflinger)
...
F DEBUG   : pid: 2654, tid: 2654, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<
F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
F DEBUG   : Abort message: 'failed to open gralloc0 device: No such device'

2 years agoAndroid-x86: Implement some perform functionality from drm_gralloc (v2)
lambdadroid [Sat, 10 Nov 2018 18:48:11 +0000 (19:48 +0100)]
Android-x86: Implement some perform functionality from drm_gralloc (v2)

 Conflicts:
Android.mk

(v2) git rm Android.mk due to aosp master branch minigbm implementation

2 years agoAdd framebuffer HAL implementation based on drm_framebuffer (v3)
Mauro Rossi [Sat, 25 Jan 2020 20:34:29 +0000 (21:34 +0100)]
Add framebuffer HAL implementation based on drm_framebuffer (v3)

(v1) original lambdadroid implementation

(v2) changes in drv.h due to following commits:
     48b4c08 ("minigbm: fix flags to align with GBM")
     6e6dc49 ("minigbm: virtio: restrict formats supported without 3D")

(v3) changes in drv.h due to aosp master branch minigbm implementation

NOTE: #define BO_USE_FRAMEBUFFER (1ull << 19) as the fist available bit

2 years agoDO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Xin Li [Wed, 30 Oct 2019 18:48:14 +0000 (11:48 -0700)]
DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master

Bug: 142003500
Change-Id: Ia09f52b985183da2799aae2796b2836d158bc559

2 years ago[automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage...
Xin Li [Sun, 8 Sep 2019 21:52:48 +0000 (14:52 -0700)]
[automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master am: 513558d983 -s ours
am: 0484cc459d -s ours
am skip reason: change_id Ibfac366eff7b1e63b2b6757d2600ef20f19e71a6 with SHA1 03d46b8ec2 is in history

Change-Id: I774dc301a4868b98f5cd4858b52cf7e0b1ebb327

2 years ago[automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage...
Xin Li [Sun, 8 Sep 2019 21:32:24 +0000 (14:32 -0700)]
[automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
am: 513558d983 -s ours
am skip reason: change_id Ibfac366eff7b1e63b2b6757d2600ef20f19e71a6 with SHA1 03d46b8ec2 is in history

Change-Id: If8b46edb3d19fb36581337e19773a85fdc3e74f1

2 years agoMerge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Xin Li [Sun, 8 Sep 2019 19:43:56 +0000 (12:43 -0700)]
Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master

No content change.

Bug: 135460123
Change-Id: I9ddc1e4394738bc99b33e251f138736806fdffd7
Merged-In: Ibfac366eff7b1e63b2b6757d2600ef20f19e71a6

2 years ago[automerger skipped] DO NOT MERGE - Merge Android 10 into master am: 03d46b8ec2 ...
Xin Li [Thu, 5 Sep 2019 19:56:06 +0000 (12:56 -0700)]
[automerger skipped] DO NOT MERGE - Merge Android 10 into master am: 03d46b8ec2 -s ours am: 8e859c3fc8
am: 8a1667b9d3

Change-Id: I851ec26c25933ce1341a4b0dc3c0457bc7b4c5ea

2 years ago[automerger skipped] DO NOT MERGE - Merge Android 10 into master am: 03d46b8ec2 ...
Xin Li [Thu, 5 Sep 2019 19:31:24 +0000 (12:31 -0700)]
[automerger skipped] DO NOT MERGE - Merge Android 10 into master am: 03d46b8ec2 -s ours
am: 8e859c3fc8

Change-Id: I3accd9b32304054b1543bceef94bfe480e0f7c3d

2 years ago[automerger skipped] DO NOT MERGE - Merge Android 10 into master
Xin Li [Thu, 5 Sep 2019 18:44:24 +0000 (11:44 -0700)]
[automerger skipped] DO NOT MERGE - Merge Android 10 into master
am: 03d46b8ec2 -s ours
am skip reason: subject contains skip directive

Change-Id: I41627158e22d83ac54c395523706bdd4b8ddbe05

2 years agoDO NOT MERGE - Merge Android 10 into master
Xin Li [Wed, 4 Sep 2019 20:33:46 +0000 (13:33 -0700)]
DO NOT MERGE - Merge Android 10 into master

Bug: 139893257
Change-Id: Ibfac366eff7b1e63b2b6757d2600ef20f19e71a6

2 years agoFix potential uninitialized read am: 6acf248c84 am: 1c4a1cf7e4
Greg Hartman [Thu, 18 Jul 2019 04:09:31 +0000 (21:09 -0700)]
Fix potential uninitialized read am: 6acf248c84 am: 1c4a1cf7e4
am: a4ec2bb29d

Change-Id: Iae80b4aaad1c79ed9a0fda9cea2ba8ea1ac42f90

2 years agoFix potential uninitialized read am: 6acf248c84
Greg Hartman [Thu, 18 Jul 2019 03:45:20 +0000 (20:45 -0700)]
Fix potential uninitialized read am: 6acf248c84
am: 1c4a1cf7e4

Change-Id: I372f5d9c878cda0512eaa6ea475cfb39949106d1

2 years agoFix potential uninitialized read
Greg Hartman [Thu, 18 Jul 2019 03:24:45 +0000 (20:24 -0700)]
Fix potential uninitialized read
am: 6acf248c84

Change-Id: I2bb6e03c66349cde447abddb6b8cc9e138a2b3b7

2 years agoFix potential uninitialized read
Greg Hartman [Wed, 17 Jul 2019 22:55:17 +0000 (15:55 -0700)]
Fix potential uninitialized read

BUG: 137793471
Test: Patched and can compile minigbm
Change-Id: I65577ca08f4d41ff6a7b6d2a2af42f82798608bf

3 years agoDO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master
Xin Li [Tue, 2 Jul 2019 19:42:45 +0000 (12:42 -0700)]
DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master
am: c960faca0f

Change-Id: I7ecfedce5f9214ed1b75f7378d3b743bc02aadbd

3 years agoDO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master
Xin Li [Mon, 1 Jul 2019 20:59:32 +0000 (20:59 +0000)]
DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master

Bug: 134405016
Change-Id: Ie88471035cd29f26971b4865c7c1d721bd6f5c76

3 years agoUpdate OWNERS for my new LDAP am: d0dceb46dd am: 9f8fe2bbe0
Alistair Delva [Thu, 27 Jun 2019 19:41:52 +0000 (12:41 -0700)]
Update OWNERS for my new LDAP am: d0dceb46dd am: 9f8fe2bbe0
am: 6c13d0657c

Change-Id: I34f6f5ff0da513faf3f008944885785011130997

3 years agoUpdate OWNERS for my new LDAP am: d0dceb46dd
Alistair Delva [Thu, 27 Jun 2019 19:20:24 +0000 (12:20 -0700)]
Update OWNERS for my new LDAP am: d0dceb46dd
am: 9f8fe2bbe0

Change-Id: Ice7c045feace9fe2f2876569215abd9e94481640

3 years agoUpdate OWNERS for my new LDAP
Alistair Delva [Thu, 27 Jun 2019 19:05:51 +0000 (12:05 -0700)]
Update OWNERS for my new LDAP
am: d0dceb46dd

Change-Id: I440ec83d2f236b52c442891535e866f559e282fa

3 years agoUpdate OWNERS for my new LDAP
Alistair Delva [Wed, 26 Jun 2019 18:29:55 +0000 (11:29 -0700)]
Update OWNERS for my new LDAP

Exempt-From-Owner-Approval: I was the only owner

Change-Id: Ife39959288f2414da063652739343656bccc7cf9

3 years agoModify gralloc0 implementation
Valerie Hau [Mon, 6 May 2019 16:28:35 +0000 (09:28 -0700)]
Modify gralloc0 implementation
am: 8894cf7256

Change-Id: I904b1c519f8a39284738d4d26418a00fbf2f896f

3 years agoModify gralloc0 implementation
Valerie Hau [Thu, 25 Apr 2019 18:12:42 +0000 (11:12 -0700)]
Modify gralloc0 implementation

Add validateBufferSize and getTransportSize

Bug: 131089111
Test: build, boot
Change-Id: I53195c75907c51585ed68a885d8c35fe90f1b885

3 years agoMerge master@5428150 into git_qt-dev-plus-aosp.
Bill Rassieur [Wed, 3 Apr 2019 23:29:47 +0000 (16:29 -0700)]
Merge master@5428150 into git_qt-dev-plus-aosp.
am: 2ebe94b665

Change-Id: I9324f1d823e3f971bd63a2a5bcc3d70dbec36480

3 years agoMerge master@5428150 into git_qt-dev-plus-aosp.
Bill Rassieur [Tue, 2 Apr 2019 18:30:16 +0000 (18:30 +0000)]
Merge master@5428150 into git_qt-dev-plus-aosp.

Change-Id: Iab4a62d752fbf4432cff21eb2ac34a52557582b8
BUG: 129345239

3 years agoConvert external/minigbm to Android.bp am: 9521a60253 am: 5a5d91c739
Colin Cross [Wed, 27 Mar 2019 08:26:34 +0000 (01:26 -0700)]
Convert external/minigbm to Android.bp am: 9521a60253 am: 5a5d91c739
am: 1649282621

Change-Id: I45add530e5e692a4878aa37117858c639a5711e7

3 years agoConvert external/minigbm to Android.bp am: 9521a60253
Colin Cross [Wed, 27 Mar 2019 08:10:10 +0000 (01:10 -0700)]
Convert external/minigbm to Android.bp am: 9521a60253
am: 5a5d91c739

Change-Id: I068e82860803140b3df1585e63cdf0fcdc1939b9

3 years agoConvert external/minigbm to Android.bp
Colin Cross [Wed, 27 Mar 2019 08:06:18 +0000 (01:06 -0700)]
Convert external/minigbm to Android.bp
am: 9521a60253

Change-Id: Ic3cd220fb8bd69a3e438e98550483d77f4abdfa8

3 years agoConvert external/minigbm to Android.bp
Colin Cross [Fri, 22 Mar 2019 20:15:06 +0000 (13:15 -0700)]
Convert external/minigbm to Android.bp

See build/soong/README.md for more information.

This replaces the product and BoardConfig.mk variable conditionals
with different versions of the HAL for each product, which will
also allow checkbuild to verify that they build even on products
that don't use them.

Fixes: 122332792
Test: mma
Change-Id: Ie8b6316ea09795e36339f94883c89795771c1f48

3 years agoAllow minigbm gralloc to coexist with board gralloc. am: 3fbaca6783 am: ff234ae422
Alistair Strachan [Fri, 13 Jul 2018 20:25:54 +0000 (13:25 -0700)]
Allow minigbm gralloc to coexist with board gralloc. am: 3fbaca6783 am: ff234ae422
am: 386c14aaeb

Change-Id: Ib10c60c9018feac18277737347a0fa5ae5a2ac9e

3 years agoAllow minigbm gralloc to coexist with board gralloc. am: 3fbaca6783
Alistair Strachan [Fri, 13 Jul 2018 19:56:19 +0000 (12:56 -0700)]
Allow minigbm gralloc to coexist with board gralloc. am: 3fbaca6783
am: ff234ae422

Change-Id: I3a6a0db16f4bd7048aa9b985fdd7444a8fda5cc7

3 years agoAllow minigbm gralloc to coexist with board gralloc.
Alistair Strachan [Fri, 13 Jul 2018 19:17:26 +0000 (12:17 -0700)]
Allow minigbm gralloc to coexist with board gralloc.
am: 3fbaca6783

Change-Id: I884b6bd6e0658b9b931b53d42bcee1ecbc16fc95

3 years agoAllow minigbm gralloc to coexist with board gralloc.
Alistair Strachan [Fri, 13 Jul 2018 15:56:21 +0000 (08:56 -0700)]
Allow minigbm gralloc to coexist with board gralloc.

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 <astrachan@google.com>
3 years agoMerge branch 'upstream-master'
Alistair Strachan [Thu, 12 Jul 2018 18:38:52 +0000 (11:38 -0700)]
Merge branch 'upstream-master'
am: 5e2c4ec751

Change-Id: Id2b36261424b2297fdd3e65b588a3fb4af128e70

3 years agoAdd OWNERS and METADATA.
Alistair Strachan [Thu, 12 Jul 2018 18:38:40 +0000 (11:38 -0700)]
Add OWNERS and METADATA.
am: f8de45da7b

Change-Id: I9cf6883a60a3f2aec417f0533b12d9c1d31603aa

3 years agoMerge remote-tracking branch 'aosp/upstream-master' into HEAD
Casey Dahlin [Thu, 12 Jul 2018 18:37:20 +0000 (11:37 -0700)]
Merge remote-tracking branch 'aosp/upstream-master' into HEAD
am: 721abfd9a6

Change-Id: I551a4dc8b421c2824c7c2586e899ea15cc6ddb8f

4 years agoMerge branch 'upstream-master'
Alistair Strachan [Mon, 25 Jun 2018 21:45:26 +0000 (14:45 -0700)]
Merge branch 'upstream-master'

Bug: 77276633
Change-Id: I28e84c7d1c280d229cca13ec6c6bd3f9c58d0455
Signed-off-by: Alistair Strachan <astrachan@google.com>
4 years agoAdd OWNERS and METADATA.
Alistair Strachan [Mon, 25 Jun 2018 21:40:04 +0000 (14:40 -0700)]
Add OWNERS and METADATA.

Along with the licensing files required by AOSP.

Bug: 77276633
Change-Id: I9b8d8d2f32658750696c453d439a168af2b7f7fb
Signed-off-by: Alistair Strachan <astrachan@google.com>
4 years agominigbm: DRM_FORMAT_BGR888 for amdgpu
Drew Davenport [Wed, 20 Jun 2018 21:46:50 +0000 (15:46 -0600)]
minigbm: DRM_FORMAT_BGR888 for amdgpu

Move DRM_FORMAT_BGR888 from render_target_formats to texture_source_formats

BUG=b:110472317
TEST=test_that --board=grunt graphics_Gbm

Change-Id: I4da4ca1544b0596ef39c24f268c85014ef58ad7e
Reviewed-on: https://chromium-review.googlesource.com/1108756
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: Build fix for arm64
Dániel Bátyai [Fri, 15 Jun 2018 13:12:13 +0000 (15:12 +0200)]
minigbm: Build fix for arm64

When compiling for arm64 uint64_t is considered to be unsigned long,
which caused a format error.

BUG=none
TEST=emerge

Change-Id: Ic5559ba5dce1725dd34eed60609bc1a65735c7f2
Reviewed-on: https://chromium-review.googlesource.com/1102468
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Daniel Batyai <dbatyai@inf.u-szeged.hu>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: add support for BG24
Gurchetan Singh [Thu, 7 Jun 2018 00:01:51 +0000 (17:01 -0700)]
minigbm: add support for BG24

Some CTS tests apparently require HAL_PIXEL_FORMAT_RGB_888 now.
This format is DRM_FORMAT_BGR888 in <drm_fourcc.h>.  Let's add it
to the revelant drivers.

BUG=b:80496655
TEST=emerge-eve minigbm, let lab test

Change-Id: Ia9dadbd2c17c137262865679af1d97d55b1a7087
Reviewed-on: https://chromium-review.googlesource.com/1089493
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
4 years agominigbm: run clang-format
Gurchetan Singh [Thu, 7 Jun 2018 00:15:31 +0000 (17:15 -0700)]
minigbm: run clang-format

It's good to do this now and again.

BUG=none
TEST=none

Change-Id: Ie96486b5d34c99a4b00cdfd8488a0468188d35bd
Reviewed-on: https://chromium-review.googlesource.com/1089492
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoReland "i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag"
Kristian H. Kristensen [Wed, 4 Apr 2018 23:10:42 +0000 (16:10 -0700)]
Reland "i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag"

This is a reland of 1bd7b04a3ae68c0314bdee06c559093de9e5a304

We've landed CL:1070995 which fixes the missing modifier that
caused tiling corruption on pre-KBL Intel devices and CL:1072638
which makes the failing vda unittests use SCANOUT_VDA_WRITE as
they were supposed to.

Original change's description:
> i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag
>
> This flag is used to indicate that the platform video decoder will be
> writing into this buffer and that it should be allocated
> accordingly. On Intel, this means that we have to allocate y-tiled
> NV12 for libva to be able to decode to the buffer.
>
> We force gralloc NV12 allocations to be linear for now, since ARC++
> doesn't properly pass modifiers to ChromeOS.
>
> BUG=822346
> TEST=test_that graphics_Gbm
>
> Change-Id: I840c30d22355d26816df718b49717407e2e4620f
> Reviewed-on: https://chromium-review.googlesource.com/996648
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>

Bug: 822346
Change-Id: Icf0921dc91ac422da26371bffea34b26550b8234
Reviewed-on: https://chromium-review.googlesource.com/1073877
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
4 years agoRevert "i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag"
Hirokazu Honda [Mon, 21 May 2018 06:32:57 +0000 (06:32 +0000)]
Revert "i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag"

This reverts commit 1bd7b04a3ae68c0314bdee06c559093de9e5a304.

Reason for revert: Breaks video decoding on most intel platforms, e.g., caroline and samus

Original change's description:
> i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag
>
> This flag is used to indicate that the platform video decoder will be
> writing into this buffer and that it should be allocated
> accordingly. On Intel, this means that we have to allocate y-tiled
> NV12 for libva to be able to decode to the buffer.
>
> We force gralloc NV12 allocations to be linear for now, since ARC++
> doesn't properly pass modifiers to ChromeOS.
>
> BUG=822346
> TEST=test_that graphics_Gbm
>
> Change-Id: I840c30d22355d26816df718b49717407e2e4620f
> Reviewed-on: https://chromium-review.googlesource.com/996648
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>

Bug: 822346, 845076
Change-Id: I7681ddb66e4789951e840821993fc5562a55d1af
Reviewed-on: https://chromium-review.googlesource.com/1066032
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kuo Jen Wei <inker@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
4 years agoi915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag
Kristian H. Kristensen [Wed, 4 Apr 2018 23:10:42 +0000 (16:10 -0700)]
i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag

This flag is used to indicate that the platform video decoder will be
writing into this buffer and that it should be allocated
accordingly. On Intel, this means that we have to allocate y-tiled
NV12 for libva to be able to decode to the buffer.

We force gralloc NV12 allocations to be linear for now, since ARC++
doesn't properly pass modifiers to ChromeOS.

BUG=822346
TEST=test_that graphics_Gbm

Change-Id: I840c30d22355d26816df718b49717407e2e4620f
Reviewed-on: https://chromium-review.googlesource.com/996648
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
4 years agominigbm: remove addrlib dependency for arc-cros-gralloc
Satyajit Sahu [Wed, 16 May 2018 08:52:48 +0000 (14:22 +0530)]
minigbm: remove addrlib dependency for arc-cros-gralloc

addrlib is not required now. Removing the dependency

BUG=b:72972511
TEST=Chrome boots to UI and android play store comes up

Change-Id: If0ddfe8bee2bb74bf898479f7e263ae731e8bea9
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1060935
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: Update Android.mk to export the include path
Daniel Nicoara [Thu, 10 May 2018 21:58:03 +0000 (17:58 -0400)]
minigbm: Update Android.mk to export the include path

Allows other applications depending on it to pick up minigbm headers
without explicitly specifying the path.

BUG=b:78869504
TEST=Compiled application depending on minigbm

Change-Id: Ie1681579145620ba330721393f0ad71a00109102
Reviewed-on: https://chromium-review.googlesource.com/1054615
Commit-Ready: Daniel Nicoara <dnicoara@chromium.org>
Tested-by: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: Use the stride value returned by mapImage
Satyajit Sahu [Thu, 3 May 2018 11:05:24 +0000 (16:35 +0530)]
minigbm: Use the stride value returned by mapImage

mapImage can return a different stride value. This value must be
used for the mapped address.

BUG=b:38152101 b:79346377
TEST=graphics_Sanity autotest passed

Change-Id: Ie0eb716291366ae6a047d704f66d24ec41738713
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1041369
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: amdgpu: switch BO allocation domain to GTT from VRAM
Deepak Sharma [Tue, 1 May 2018 19:11:27 +0000 (12:11 -0700)]
minigbm: amdgpu: switch BO allocation domain to GTT from VRAM

With SG feature enabled, will move all bo allocation to GTT.

BUG=b:69941535
TEST=boot Grunt, run graphics_Stress.tabopenclose

Change-Id: If424709315e36e29bc99400d9333df72d5979aa0
Signed-off-by: Deepak Sharma <Deepak.Sharma@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1037914
Commit-Ready: Deepak Sharma <deepak.sharma@amd.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoRevert "minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16"
Gurchetan Singh [Sat, 5 May 2018 00:42:12 +0000 (00:42 +0000)]
Revert "minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16"

This reverts commit 292da5365a373a8e1eed603fc3aa16e3595d8252.

Reason for revert: The Android framework uses successful allocation of HAL_PIXEL_FORMAT_RGBA_FP16 to test for wide-gamut capabilities.  We don't want to advertise this, so let's revert.

android.graphics.cts.BitmapColorSpaceTest#test16bitHardware

can pass if the framework falls back to RGBA8888, as is the plan.

Original change's description:
> minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16
>
> This is needed to support the following CTS test:
>
> android.graphics.cts.BitmapColorSpaceTest#test16bitHardware
>
> There have been some rumblings about adding 64-bit formats to <drm_fourcc.h>:
>
> https://lists.freedesktop.org/archives/intel-gvt-dev/2017-July/001469.html
>
> However, nothing has landed, so let's just define our own format
> for the time being.
>
> BUG=b:77973662
> TEST=Compile for kevin and kevin-arcnext
>      Unfortunately, my P setup refuses to work, so let the lab
>      test.
>
> Change-Id: I1fea16400ba6632a8ef17105e27bc7799d2af515
> Reviewed-on: https://chromium-review.googlesource.com/1029355
> Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>

Bug: b:77973662
Change-Id: I9e4b79b06dd565189a2e783e8453f08af173d84c
Reviewed-on: https://chromium-review.googlesource.com/1045805
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoi915: Align stride and offset per plane
Kristian H. Kristensen [Wed, 4 Apr 2018 21:21:41 +0000 (14:21 -0700)]
i915: Align stride and offset per plane

Current code over-aligns the Y-plane dimensions by a factor of two, so
as to make sure alignment requirements are still satisfied when the
subsampled plane stride and height are divided by two. Instead, this
commit changes the approach to align each plane separately after
computing the plane width and height. We stop using
drv_bo_from_format(), which divides the stride and instead loop
through the planes ourselves.

BUG=822346
TEST=test_that graphics_Gbm

Change-Id: I1ea8f2fb8b1780686d4086f51e9bab759f724d78
Reviewed-on: https://chromium-review.googlesource.com/996647
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: For BO_USE_SW usage buffer need not be linear
Satyajit Sahu [Thu, 3 May 2018 10:40:11 +0000 (16:10 +0530)]
minigbm: For BO_USE_SW usage buffer need not be linear

It is incorrect to force linear for BO_USE_SW usage as mapImage
in dri_bo_map converts tiled data and returns linear.

BUG=b:78200321
TEST=drm_cursor_test completes within 20 seconds.

Change-Id: Ifa3ca2218cee9ff52b049a984a70a54f4899965d
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1041448
Commit-Ready: Drew Davenport <ddavenport@chromium.org>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoRevert "minigbm: i915: Add necessary padding to Android YV12 buffers"
Kristian H. Kristensen [Thu, 3 May 2018 20:40:47 +0000 (20:40 +0000)]
Revert "minigbm: i915: Add necessary padding to Android YV12 buffers"

This reverts commit d846de667cba72121ec579912d0854729f013731.

When mesa switched to isl internally, dma-buf import regressed in a
few cases where isl was overly strict.  One issue was enforcing slice
alignment in calculating the minimum size of a buffer.  The alignment
is required for the slice placement, but not the size.  We worked
around it in commit d846de667cba72121ec579912d0854729f013731, but mesa
commit 4d27c6095e8385cccd225993452baad4d2e35420 fixes the problem and
we can now revert the minigbm bandaid.

The revert leaves the change to drv_bo_from_format() in place where it
was modified to look at the passed in format argument instead of
bo->format.

Original change's description:
> minigbm: i915: Add necessary padding to Android YV12 buffers
>
> All the regular formats are already aligned by current code, except
> Android YV12, which requires height of planes to be unchanged. However
> Mesa requires each plane to have at least certain required padding
> between planes. Work around this by calculating total BO size with
> aligned height to allow padding space to overlap with further planes
> and making sure that padding of last plane fits in the buffer. This is
> okay, since Mesa requirement seems to indicate that data of the padding
> area should not be affected and padding is only needed to satisfy GPU
> cache requests.
>
> Fixes following CTS tests on Intel platforms:
> android.media.cts.VideoEncoderTest#testGoogH264FlexArbitraryH
> android.media.cts.VideoEncoderTest#testGoogH264FlexNearMaxMin
> android.media.cts.VideoEncoderTest#testGoogH264SurfArbitraryH
> android.media.cts.VideoEncoderTest#testGoogH264SurfNearMaxMin
>
> BUG=b:63957026
> TEST=./cts-tradefed run cts -m CtsMediaTestCases -t
>  android.media.cts.VideoEncoderTest
>
> Change-Id: I46d44178ba983c0038b630b13b9b281251393f8f
> Reviewed-on: https://chromium-review.googlesource.com/592990
> Commit-Ready: Tomasz Figa <tfiga@chromium.org>
> Tested-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>

Bug: b:63957026
Change-Id: I9a0db4f01a7ec206375f8a0ba5219b5c5d9a4c0e
Reviewed-on: https://chromium-review.googlesource.com/1042746
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoRevert "minigbm: i965: Add 64-byte padding at the end of linear buffers"
Tomasz Figa [Wed, 2 Aug 2017 05:35:52 +0000 (05:35 +0000)]
Revert "minigbm: i965: Add 64-byte padding at the end of linear buffers"

This reverts commit 581f3a5e3089cfd5bb38432eb2874d9a5b132a17.

Reason for revert: It looks like the requirements are being
removed from Mesa, due to the kernel driver being expected to
provide certain guaranties over how it manages the GPU address
space, so that they are satisfied (see CL:597567).

With this, we can stop overallocating and simplify minigbm code.

Original change's description:
> minigbm: i965: Add 64-byte padding at the end of linear buffers
>
> According to the ISL library used now by Mesa i965 driver to manage
> surfaces, linear surfaces must have 64-byte padding added at the end,
> due to the way how the GPU issues cache requests.
>
> BUG=b:63957026
> TEST=./cts-tradefed run cts --skip-preconditions --skip-device-info -m
>   CtsCameraTestCases -t
>   android.hardware.camera2.cts.MultiViewTest#testDualTextureViewAndImageReaderPreview
>   on Eve
>
> Change-Id: I4887449a8e6e090b5ab7925b6f5c764cedd7589f
> Reviewed-on: https://chromium-review.googlesource.com/582253
> Commit-Ready: Tomasz Figa <tfiga@chromium.org>
> Tested-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>

BUG=b:63957026
TEST=./cts-tradefed run cts -m CtsCameraTestCases
 -t android.hardware.camera2.cts.MultiViewTest
TEST=./cts-tradefed run cts -m CtsMediaTestCases
 -t android.media.cts.VideoEncoderTest

Change-Id: Id17d65fd9fe81e0152e37e92e8eda39c0fceebf1
Reviewed-on: https://chromium-review.googlesource.com/597529
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: Drop drv_bo_get_stride_in_pixels() helper
Kristian H. Kristensen [Wed, 4 Apr 2018 20:40:47 +0000 (13:40 -0700)]
minigbm: Drop drv_bo_get_stride_in_pixels() helper

Computing "stride in pixels" assumes the pixel size divides the
stride, which isn't always the case.  This is only used for the
cros_gralloc implementation, so lets move the calculation there
instead of providing a generic helper for an unhealthy concept.

BUG=822346
TEST=test_that graphics_Gbm

Change-Id: Iab7a363c5471e4bacef7df7095ef77723adf5e93
Reviewed-on: https://chromium-review.googlesource.com/996645
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16
Gurchetan Singh [Thu, 26 Apr 2018 00:36:59 +0000 (17:36 -0700)]
minigbm: add support for HAL_PIXEL_FORMAT_RGBA_FP16

This is needed to support the following CTS test:

android.graphics.cts.BitmapColorSpaceTest#test16bitHardware

There have been some rumblings about adding 64-bit formats to <drm_fourcc.h>:

https://lists.freedesktop.org/archives/intel-gvt-dev/2017-July/001469.html

However, nothing has landed, so let's just define our own format
for the time being.

BUG=b:77973662
TEST=Compile for kevin and kevin-arcnext
     Unfortunately, my P setup refuses to work, so let the lab
     test.

Change-Id: I1fea16400ba6632a8ef17105e27bc7799d2af515
Reviewed-on: https://chromium-review.googlesource.com/1029355
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: cros_gralloc: fix -Wimplicit-function-declaration warnings in gralloctest
Gurchetan Singh [Wed, 25 Apr 2018 22:29:32 +0000 (15:29 -0700)]
minigbm: cros_gralloc: fix -Wimplicit-function-declaration warnings in gralloctest

The arcnext compiler seems to throw more warnings.

BUG=none
TEST=compile for kevin arc-next

Change-Id: Ib7b0518d675db06549312a2e7b814093d75424f5
Reviewed-on: https://chromium-review.googlesource.com/1029354
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
4 years agominigbm: Consolidate format info in new struct planar_layout
Kristian H. Kristensen [Wed, 4 Apr 2018 21:02:50 +0000 (14:02 -0700)]
minigbm: Consolidate format info in new struct planar_layout

This consolidates the relevant information about the planar layouts we
support in one place.

Change-Id: I6fbfd59f5d56777f612e4cc44e634ed193a435ad
Reviewed-on: https://chromium-review.googlesource.com/996646
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoBuild fix against latest AOSP master.
Alistair Strachan [Tue, 10 Apr 2018 01:50:30 +0000 (18:50 -0700)]
Build fix against latest AOSP master.

Move away from using the deprecated header paths in AOSP master. Add
explicit dependencies on the header modules and library modules being
used.

Change-Id: Ifaf159129dd34d2b99f7ee86f6e5fde9276d0aea
Reviewed-on: https://chromium-review.googlesource.com/1005720
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoFix -Wcast-qual warnings.
Alistair Strachan [Tue, 10 Apr 2018 01:49:51 +0000 (18:49 -0700)]
Fix -Wcast-qual warnings.

The Android.mk file enables -Wcast-qual and clang finds problems in
gralloc0.cc where the constness of a pointer is being cast away. AOSP
master is setting -Werror, so these warnings break the build. Fix them.

Change-Id: I8820efab34a15d0653b89303d5390fb9f3eee12d
Reviewed-on: https://chromium-review.googlesource.com/1005719
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: using dri extensions
Satyajit [Fri, 12 Jan 2018 09:19:05 +0000 (14:49 +0530)]
minigbm: using dri extensions

addrlib dependency removed. dri extensions are called instead.
dri.c/dri.h implements the generic dri extensions call.
amdgpu.c implements amdgpu specific.

BUG=b:72972511
TEST=Chrome booted to UI and passed graphics_Gbm autotest

Change-Id: Ia0edec7752a258fe2f70bc4838dac6398d46def2
Signed-off-by: Satyajit <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/863723
Commit-Ready: Satyajit Sahu <satyajit.sahu@amd.com>
Tested-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoi915: Allow allocating ARGB buffers for scanout
Kristian H. Kristensen [Wed, 11 Apr 2018 22:55:13 +0000 (15:55 -0700)]
i915: Allow allocating ARGB buffers for scanout

CL:991261 changed our primary framebuffer format from XRGB to ARGB. We
still only scanout as XRGB where the display controller doesn't
support ARGB, but minigbm doesn't know that. As a result, when we try
to allocate an ARGB buffer with the SCANOUT useflag, we get a linear
buffer.  This breaks PSR and regresses performance and, in general,
just isn't what we want.

This CL enables SCANOUT for all ARGB formats where the corresponding
XRGB formats supports scanout. In the end, it's up to the caller to
make sure a format works for scanout anyway.

BUG=827188,830969
TEST=test_that graphics_Idle on samus

Change-Id: Iab428e5b21abedcac7cee86fccc8df50dab3f471
Reviewed-on: https://chromium-review.googlesource.com/1008867
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: virtio_gpu: select dumb/virgl at runtime.
Lepton Wu [Thu, 5 Apr 2018 19:50:03 +0000 (12:50 -0700)]
minigbm: virtio_gpu: select dumb/virgl at runtime.

For using same image on legacy-qemu and virgl enabled qemu. We need
to handle dumb and virgl code path at run time. Just merge them to
one driver.

BUG=b:77302150
TEST=manual - run novato image under qemu with gl=on/off.

Change-Id: Ia12140fba16a350fe13f4258d25333ecfe8352b3
Reviewed-on: https://chromium-review.googlesource.com/998631
Commit-Ready: Lepton Wu <lepton@chromium.org>
Tested-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoUpdate Android.mk for amlogic
Albert Chaulk [Thu, 5 Apr 2018 20:56:53 +0000 (16:56 -0400)]
Update Android.mk for amlogic

This adds a separate app-linkable libminigbm target that disables
the gralloc code and links in the gbm api. Adds support for meson
buildflag.

Bug: b/76099793
Test: amlogic test tool, drawframe
Change-Id: I7aba3ec65fa39cabbb8c96c44d6d59b8225956a9
Reviewed-on: https://chromium-review.googlesource.com/998758
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: drv_bo_flush --> drv_bo_flush_or_unmap
Gurchetan Singh [Thu, 29 Mar 2018 23:34:53 +0000 (16:34 -0700)]
minigbm: drv_bo_flush --> drv_bo_flush_or_unmap

There's no flush or invalidate mechnaism with the DRI interface,
so we'll have to support mapping and unmapping.

BUG=b:72972511
TEST=gbmtest passes in CQ

Change-Id: If3aef651f8549544ed4ed499e17f7f99c597974c
Reviewed-on: https://chromium-review.googlesource.com/990892
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-by: Joe Kniss <djmk@google.com>
Reviewed-by: Satyajit Sahu <satyajit.sahu@amd.com>
4 years agominigbm: Enable vc4 driver
Jeremy Grosser [Fri, 30 Mar 2018 08:19:41 +0000 (01:19 -0700)]
minigbm: Enable vc4 driver

BUG=None
TEST=graphics_Gbm on target board

Change-Id: Id92466354e644f9237f8c19aebd0534c1b23bbc0
Reviewed-on: https://chromium-review.googlesource.com/989301
Commit-Ready: Jeremy Grosser <jeremy@synack.me>
Tested-by: Jeremy Grosser <jeremy@synack.me>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: amdgpu: Disable explicit synchronization when possible.
Bas Nieuwenhuizen [Fri, 23 Mar 2018 16:21:37 +0000 (17:21 +0100)]
minigbm: amdgpu: Disable explicit synchronization when possible.

With drm minor 21 both radv and mesa can do all the explicit
synchornization extensions and hence explicit synchronization gets
used.

However, as implicit synchronization is not disabled we can get
surprises like cyclic dependencies if producer and consumer are too
far out of sync with each other.

Therefore this disables implicit synchronization if the kernel is
new enough for explicit synchronization to get used.

v2: - Fix up compile errors
    - Actually set priv->addrlib

BUG=b:76135512
TEST=Run dEQP-VK.wsi.android.swapchain.render.basic 10 times on
     Kahlee.

Change-Id: I6e5389793e82b167e025b7d94958effad278c361
Reviewed-on: https://chromium-review.googlesource.com/978166
Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org>
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoUse Android log system in helpers.c.
Alistair Strachan [Mon, 19 Mar 2018 21:03:23 +0000 (14:03 -0700)]
Use Android log system in helpers.c.

This code might be loaded by a daemonized process now, so the existing
logging to stderr goes nowhere. It's better to use the Android logger.

Change-Id: I19f088b8f049f07c9c6839038d2971fad1a0e852
Reviewed-on: https://chromium-review.googlesource.com/971360
Commit-Ready: Alistair Strachan <astrachan@google.com>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoAndroid: Support building the virtio_virgl backend.
Alistair Strachan [Tue, 20 Mar 2018 22:55:20 +0000 (15:55 -0700)]
Android: Support building the virtio_virgl backend.

Enabled automatically if BOARD_GPU_DRIVERS=virgl. If you leave this
unset, the build will still include support for virtio_dumb.

Change-Id: I2cfeab8fb3a0be7b3c1874fa036d433ff57567cd
Reviewed-on: https://chromium-review.googlesource.com/972449
Commit-Ready: Alistair Strachan <astrachan@google.com>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoFix minigbm against older kernel DRM versions.
Alistair Strachan [Tue, 20 Mar 2018 18:10:51 +0000 (11:10 -0700)]
Fix minigbm against older kernel DRM versions.

In 4.4, the DRM implementation only allowed DRM_CLOEXEC to be specified to
drmPrimeHandleToFD(), but it gave you a read/write mapping when mmap'ed.

In newer kernels the DRM_RDWR flag needs to be specified to get a
read/write mapping.

Try the new way, and if that fails, try the old way. If the handle
conversion fails for any reason other than this flag check, it'll
still fail.

Change-Id: I7fabb6a0d23e7b9b70f970aad0bc243a76583e33
Reviewed-on: https://chromium-review.googlesource.com/971461
Commit-Ready: Alistair Strachan <astrachan@google.com>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoFix the build against AOSP master.
Alistair Strachan [Mon, 19 Mar 2018 21:06:39 +0000 (14:06 -0700)]
Fix the build against AOSP master.

Clear out some bitrot and use the new mechanism for including headers.

Change-Id: I3b74a5472209c7632e7aab757ef88365141c9525
Reviewed-on: https://chromium-review.googlesource.com/971359
Commit-Ready: Alistair Strachan <astrachan@google.com>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoBuild fix for older libdrm versions.
Alistair Strachan [Mon, 19 Mar 2018 21:04:23 +0000 (14:04 -0700)]
Build fix for older libdrm versions.

When building against an older libdrm, the DRM_FORMAT_MOD_LINEAR enum
will be missing. It's OK to use DRM_FORMAT_MOD_NONE instead, because
this older libdrm has limited DRM_FORMAT_MOD_xx support and not all of
the backends actually need it.

Change-Id: I0c289c50de4ad1fe5a9b0848961f5bcb75bd4bf8
Reviewed-on: https://chromium-review.googlesource.com/971358
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: virtio_gpu: set vma->length when mmap.
Tao Wu [Tue, 13 Mar 2018 01:07:43 +0000 (18:07 -0700)]
minigbm: virtio_gpu: set vma->length when mmap.

Othewise bo_unmap won't work. Also add a ifdef guard for PAGE_SIZE
to make it also compile under ARC++.

BUG=b:70179880
TEST=Run /usr/local/autotest/bin/screenshot.py with qemu+virgl
TEST=Run Android App under ARC++ with qemu+virgl

Change-Id: I586446c56da091dd82d9bc9c1010d9b4ee4d92ee
Reviewed-on: https://chromium-review.googlesource.com/959527
Commit-Ready: Lepton Wu <lepton@chromium.org>
Tested-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoRename amlogic backend in minigbm into meson
Sergey Volk [Tue, 6 Mar 2018 21:29:32 +0000 (13:29 -0800)]
Rename amlogic backend in minigbm into meson

The name of Amlogic DRM driver in kernel is "meson", so rename it in
minigbm to match that.

BUG=internal b/74248568
TEST=run ozone_demo on device

Change-Id: If2ef376715231f0b3c9fe320177d0e82d94214f0
Reviewed-on: https://chromium-review.googlesource.com/951912
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
Tested-by: Sergey Volk <servolk@chromium.org>
4 years agomsm: Align buffer dimensions for llvmpipe
Stéphane Marchesin [Thu, 1 Mar 2018 00:37:46 +0000 (16:37 -0800)]
msm: Align buffer dimensions for llvmpipe

While we are using llvmpipe, we should align the buffer dimensions
to a tile size.

Change-Id: Ia0da10851886a2c25f8a4bff779fe890ec86baef
Reviewed-on: https://chromium-review.googlesource.com/942346
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: amdgpu: support DRM_FORMAT_YVU420_ANDROID
Deepak Sharma [Tue, 20 Feb 2018 22:58:26 +0000 (14:58 -0800)]
minigbm: amdgpu: support DRM_FORMAT_YVU420_ANDROID

Add support for DRM_FORMAT_YVU_420 for CTS.

BUG=b:70373715
TEST=build cros-gralloc and run ctsMediaTestcases.

Change-Id: I09f0a3da5ba56a5f275f33348fdb4d61e2fde7db
Signed-off-by: Deepak Sharma <Deepak.Sharma@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/935491
Commit-Ready: Deepak Sharma <deepak.sharma@amd.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoi915: Always set the modifier when allocating BOs
Kristian H. Kristensen [Thu, 8 Feb 2018 00:10:06 +0000 (16:10 -0800)]
i915: Always set the modifier when allocating BOs

With CL:907756 we now pass modifiers around when export to and
importing from the rest of Chrome and we need to give the right answer
when ozone queries the modifier of a bo allocated with use flags.

Bug: 809670, 809666
Change-Id: Iab5ea62d5e0da9ddd90013f559f802270de1e420
Reviewed-on: https://chromium-review.googlesource.com/907848
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: Add minimal buffer allocation support for msm
Rajesh Yadav [Mon, 22 Jan 2018 12:59:06 +0000 (18:29 +0530)]
minigbm: Add minimal buffer allocation support for msm

Add minimal buffer allocation support using dumb_bo
for early enablement till the minigbm backend
implementation is avaialble for msm drv using
gem ioctls.

See CL:898422 for getting the DRV_MSM define in.

BUG=chromium:795946, b:72483556
TEST=Boot and see some graphics

Change-Id: Ieeb05923d756a3e4581a38cf6ce5cf406e2d197b
Reviewed-on: https://chromium-review.googlesource.com/897729
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
4 years agominigbm: i915: Use NV12 as the main YUV format, including camera output
Tomasz Figa [Thu, 22 Jun 2017 07:52:43 +0000 (16:52 +0900)]
minigbm: i915: Use NV12 as the main YUV format, including camera output

On SKL and newer, the display controller supports NV12 natively for
overlays. Moreover it's the only output format supported by the camera
subsystem. Since it shouldn't matter for other uses cases if we use NV12
or YVU420, let's just switch everything to NV12 for simplicity.

BUG=b:32077885
TEST=Play a video in Android YouTube app on Cyan and Reef

Change-Id: I5cfcdec2b0e2020a3ae1e8364b60df3585838807
Reviewed-on: https://chromium-review.googlesource.com/544489
Commit-Ready: Owen Lin <owenlin@chromium.org>
Tested-by: Owen Lin <owenlin@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: remove gma500
Gurchetan Singh [Tue, 9 Jan 2018 22:22:04 +0000 (14:22 -0800)]
minigbm: remove gma500

We don't support this driver anymore.

BUG=none
TEST=none

Change-Id: Ib9f03a48e8825e3ac1f359e8fd75a68599790a14
Reviewed-on: https://chromium-review.googlesource.com/858169
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
4 years agoRevert "Revert "minigbm: replace DRM_FORMAT_MOD_INVALID with DRM_FORMAT_MOD_LINEAR""
Gurchetan Singh [Fri, 12 Jan 2018 23:31:50 +0000 (23:31 +0000)]
Revert "Revert "minigbm: replace DRM_FORMAT_MOD_INVALID with DRM_FORMAT_MOD_LINEAR""

This reverts commit 9ad07155dd9e5370e507d266766a8bcfbb4fa4d7.

Reason for revert: We haven't seen improvements in the graphs after the speculative
revert that landed in 10292.0.0:

https://chromeperf.appspot.com/group_report?keys=agxzfmNocm9tZXBlcmZyFAsSB0Fub21hbHkYgICQ6IzqogoM

Original change's description:
> Revert "minigbm: replace DRM_FORMAT_MOD_INVALID with DRM_FORMAT_MOD_LINEAR"
>
> This reverts commit 9927d78669f67c2446888aa32a3e9f9c71f7228b.
>
> BUG=chromium:799639
> TEST=run graphics_GLMark2
>
> Change-Id: Idcf25de31fe2a17cc28900558e19145ca33dbff5
> Reviewed-on: https://chromium-review.googlesource.com/853223
> Commit-Ready: Dominik Behr <dbehr@chromium.org>
> Tested-by: Dominik Behr <dbehr@chromium.org>
> Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>

Bug: chromium:799639
Change-Id: I100b93e41f43c026181eef0777f76b5c2cd93d6c
Reviewed-on: https://chromium-review.googlesource.com/865773
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>